Index: trunk/COPYING
===================================================================
--- trunk/COPYING	(revision 591)
+++ trunk/COPYING	(revision 1)
@@ -3,5 +3,5 @@
 ------------------------------------------
 
-Copyright (C) 1999-2009 Rainer Wichmann                                    
+Copyright (C) 1999-2004 Rainer Wichmann                                    
                                                                       
 This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,6 @@
 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-On Debian-based systems, see /usr/share/common-licenses
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             
+
 
 Incorporated code
@@ -102,5 +101,5 @@
        * along with the LZO library; see the file COPYING.
        * If not, write to the Free Software Foundation, Inc.,
-       * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+       * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
        * 
        * Markus F.X.J. Oberhumer
@@ -126,5 +125,5 @@
       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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA  */
+      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
    /* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
@@ -132,30 +131,30 @@
 
   (vi) Support for the MD5 hash algorithm is provided by code
-  from busybox which is distributed under the GPL.
-
-   /* md5.c - Functions to compute MD5 message digest of files or memory blocks
-    *         according to the definition of MD5 in RFC 1321 from April 1992.
-    * Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-    *
-    * NOTE: The canonical source of this file is maintained with the GNU C
-    * Library.  Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-    *
-    * 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, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-    */
-
-   /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.  */
-
+  from beecrypt which is distributed under the LGPL.
+
+      /*
+       * md5.c
+       *
+       * MD5 hash function, code
+       *
+       * Copyright (c) 2000 Virtual Unlimited B.V.
+       *
+       * Author: Bob Deblier <bob@virtualunlimited.com>
+       *
+       * This library is free software; you can redistribute it and/or
+       * modify it under the terms of the GNU Lesser General Public
+       * License as published by the Free Software Foundation; either
+       * version 2.1 of the License, or (at your option) any later version.
+       *
+       * This library 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
+       * Lesser General Public License for more details.
+       *
+       * You should have received a copy of the GNU Lesser General Public
+       * License along with this library; if not, write to the Free Software
+       * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+       * USA
+       */
 
   (vi) Support for the SHA-1 hash algorithm is provided by code
@@ -170,5 +169,5 @@
         * country of residence.
         *
-        * Adapted to pike and some cleanup by Niels MÃ¶ller.
+        * Adapted to pike and some cleanup by Niels Möller.
         */
 
@@ -204,5 +203,5 @@
      * You should have received a copy of the GNU Library General Public
      * License along with this library; if not, write to the Free
-     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
      *
      * The author of this library can be reached at the following address:
@@ -242,45 +241,4 @@
    either version 2 of the License, or (at your option) any later version."
 
-   (x) Unit testing uses the 'cutest' framework by Asim Jalis, (files
-   CuTest.h, CuTest.c, make-tests.sh) which is licensed under the zlib license:
-
-     * Copyright (c) 2003 Asim Jalis
-     *
-     * This software is provided 'as-is', without any express or implied
-     * warranty. In no event will the authors be held liable for any damages
-     * arising from the use of this software.
-     *
-     * Permission is granted to anyone to use this software for any purpose,
-     * including commercial applications, and to alter it and redistribute it
-     * freely, subject to the following restrictions:
-     *
-     * 1. The origin of this software must not be misrepresented; you must not
-     * claim that you wrote the original software. If you use this software in
-     * a product, an acknowledgment in the product documentation would be
-     * appreciated but is not required.
-     *
-     * 2. Altered source versions must be plainly marked as such, and must not
-     * be misrepresented as being the original software.
-     *
-     * 3. This notice may not be removed or altered from any source
-     * distribution.
-
-   (xi) The dnmalloc library used by samhain is Copyright (C) 2005, Yves Younan, 
-   Wouter Joosen and Frank Piessens, and licensed under the LGPL:
-
-     *   This library is free software; you can redistribute it and/or
-     *   modify it under the terms of the GNU Lesser General Public
-     *   License as published by the Free Software Foundation; either
-     *   version 2.1 of the License, or (at your option) any later version.
-     *
-     *   This library 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
-     *   Lesser General Public License for more details.
-     *
-     *   You should have received a copy of the GNU Lesser General Public
-     *   License along with this library; if not, write to the Free Software
-     *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-  
 
 Other
Index: trunk/Install.sh
===================================================================
--- trunk/Install.sh	(revision 591)
+++ trunk/Install.sh	(revision 1)
@@ -45,5 +45,5 @@
 
 This script is meant to make installing SAMHAIN as easy as
-possible.  Just read the text below, hit ENTER, and you are
+possible.  Just read the text below, hit ENTER, and you're
 on your way. 
 
@@ -279,4 +279,36 @@
 fi
 
+#------------------------------------------------------------
+#
+#  Kernel module
+#
+#------------------------------------------------------------
+
+KCHECK="no"
+
+if [ "x$I386_LINUX" = "xyes" ]; then
+
+$dialog \
+--title "Kernel module rootkit detection" \
+--separate-output \
+--backtitle "Samhain $VERSION" \
+--inputbox "SAMHAIN can detect kernel module rootkits if compiled with support\nfor this. If you want to enable this option, please give the path\nto your System.map file, else choose CANCEL.\n\nNOTE: this option will require root privileges for at least one\ncommand during compilation (to read from /dev/kmem)." \
+16 75 "/boot/System.map" \
+2> $tmp
+
+mtest=$?
+
+if [ $mtest = -1 ]; then
+    exit 1
+fi
+if [ $mtest = 0 ]; then
+    mfile=`cat $tmp`
+    for z in $mfile ; do
+	cfgline="$cfgline --with-kcheck=$z"
+    done
+    KCHECK="yes"
+fi
+
+fi
 
 #------------------------------------------------------------
@@ -287,4 +319,5 @@
 $dialog \
 --title "Signed database and configuration" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --yesno "Samhain can be configured to support PGP signed database\nand configuration files. This requires a working installation\nof GnuPG.\n\nDo you want to use this option ?" \
@@ -302,4 +335,5 @@
 $dialog \
 --title "Signed database and configuration" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --inputbox "Please enter the full path to gpg (i.e. the GnuPG binary)" \
@@ -323,4 +357,5 @@
 $dialog \
 --title "Signed database and configuration" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --inputbox "Please enter the fingerprint of the key to use (one string, no spaces)" \
@@ -350,4 +385,5 @@
 $dialog \
 --title "Stealth options" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --yesno "Samhain has some stealth options to hide its presence.\nDo you want to take advantage of these ?" \
@@ -439,4 +475,5 @@
 $dialog \
 --title "Stealth options" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --inputbox "You can set a magic string such that command line arguments will be ignored unless the first argument is this magic string, and read from stdin otherwise. If you do not want this, select CANCEL, otherwise choose a string and select OK." \
@@ -458,4 +495,5 @@
 $dialog \
 --title "Stealth options" \
+--separate-output \
 --backtitle "Samhain $VERSION" \
 --yesno "SAMHAIN can compile and install a kernel module to hide the SAMHAIN daemon process. Do you want that ?"\
@@ -557,5 +595,5 @@
     mfile=`cat $tmp`
     for z in $mfile ; do
-	cfgline="$cfgline --mandir=$z"
+	cfgline="$cfgline --with-mandir=$z"
     done
 fi
@@ -654,5 +692,5 @@
 if [ "x$KCHECK" = "xyes" ]; then
     if [ `id -u` != 0 ]; then
-$dialog --msgbox "Compiling with --with-kcheck option (kernel rootkit detection). This\nrequires root privileges for at least one command during compilation,\nbut you are not running this as root. Please expect compilation to fail.\n\nYou need to follow the instructions shown in the \nerror message after failure." 20 75
+$dialog --msgbox "Compiling with --with-kcheck option (kernel rootkit detection). This\nrequires root privileges for at least one command during compilation,\nbut you are not running this as root. Please expect compilation to fail.\n\nYou need to run \"make\" manually after failure, and\nfollow the instructions to execute the one required\ncommand as root." 20 75
     fi
 fi
Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 591)
+++ trunk/Makefile.in	(revision 1)
@@ -1,20 +1,6 @@
-#
-# 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.
-
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
 
 # --- boiler-plate stuff ---
@@ -38,6 +24,4 @@
 localstatedir = @localstatedir@
 mandir = @mandir@
-datarootdir = @datarootdir@
-mytmpdir = @mytmpdir@
 
 configfile = @myconffile@
@@ -63,9 +47,6 @@
 INSTALL_DSYS = @INSTALL@ -m 755
 
-PACKAGE = @PACKAGE_NAME@
-VERSION = @PACKAGE_VERSION@
-BUILD_NUM = 1
-
-DEFAULT_MAINTAINER = Nobody Nowhere <nobody@example.com>
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
 
 VFLAG    = @mytclient@
@@ -74,7 +55,6 @@
 SAMHAIN  = @sh_main_prg@
 YULECTL  = @yulectl_prg@
-SADMIN   = @samhainadmin_prg@
 XOR_CODE = @xor_code@
-TIGER_SRC = @tiger_src@
+SH_LKM   = @sh_lkm@
 
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -83,6 +63,4 @@
 
 CC = @CC@
-BUILD_CC = @BUILD_CC@
-# DBGDEF = -pg -DSH_PROFILE=1
 DBGDEF = @mydebugdef@
 DEFS = $(DBGDEF) @DEFS@ -I. -I$(top_srcdir)/include
@@ -91,8 +69,7 @@
 LIBS_TRY = @LIBS@
 LIBS_SOCK = @sh_libsocket@
-
+LIBS_KVM = @sh_libkvm@
 CFLAGS = @CFLAGS@
-CUTEST =
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(CUTEST)
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(CC) $(DBGDEF) -O $(LDFLAGS) -o $@
 
@@ -114,19 +91,12 @@
 
 HEADERS = samhain.h sh_unix.h sh_utils.h sh_error.h sh_error_min.h sh_files.h \
-	sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h \
-	sh_mail.h sh_mail_int.h sh_nmail.h sh_filter.h \
-	sh_mem.h sh_entropy.h sh_xfer.h sh_modules.h sh_utmp.h \
-	sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
-	sh_sig.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
+	sh_getopt.h sh_readconf.h sh_tiger.h sh_hash.h sh_mail.h \
+	sh_mem.h sh_entropy.h sh_forward.h sh_modules.h sh_utmp.h \
+	sh_kern.h sh_suidchk.h sh_srp.h sh_fifo.h sh_html.h sh_tools.h \
+	sh_gpg.h sh_cat.h sh_calls.h sh_extern.h sh_database.h sh_trace.h \
 	sh_schedule.h bignum.h trustfile.h slib.h zAVLTree.h \
 	lzoconf.h minilzo.h rijndael-alg-fst.h rijndael-api-fst.h \
 	rijndael-boxes-fst.h sh_socket.h sh_ignore.h sh_prelude.h \
-	sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h \
-	sh_processcheck.h sh_portcheck.h sh_pthread.h sh_string.h \
-	sh_log_check.h sh_log_evalrule.h sh_log_correlate.h \
-	sh_log_mark.h sh_log_repeat.h sh_inotify.h sh_registry.h sh_ipvx.h \
-	sh_restrict.h sh_sub.h sh_fInotify.h sh_checksum.h \
-	sh_dbIO.h sh_dbIO_int.h sh_guid.h sh_dbCheck.h sh_dbCreate.h \
-	sh_sem.h sh_subuid.h
+	sh_mounts.h sh_userfiles.h sh_static.h sh_prelink.h
 
 
@@ -137,12 +107,11 @@
 	$(srcsrc)/sh_tiger1.c $(srcsrc)/sh_tiger2.c \
 	$(srcsrc)/sh_tiger1_64.c $(srcsrc)/sh_tiger2_64.c \
-	$(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c $(srcsrc)/sh_nmail.c \
+	$(srcsrc)/sh_hash.c $(srcsrc)/sh_mail.c \
 	$(srcsrc)/sh_mem.c $(srcsrc)/sh_entropy.c \
-	$(srcsrc)/sh_xfer_client.c $(srcsrc)/sh_xfer_server.c \
-	$(srcsrc)/sh_xfer_syslog.c $(srcsrc)/sh_modules.c \
-	$(srcsrc)/sh_utmp.c $(srcsrc)/sh_login_track.c \
+	$(srcsrc)/sh_forward.c $(srcsrc)/sh_modules.c \
+	$(srcsrc)/sh_utmp.c $(srcsrc)/sh_kern.c \
 	$(srcsrc)/sh_suidchk.c $(srcsrc)/sh_srp.c \
 	$(srcsrc)/sh_fifo.c $(srcsrc)/sh_tools.c \
-	$(srcsrc)/sh_html.c $(srcsrc)/sh_sig.c \
+	$(srcsrc)/sh_html.c $(srcsrc)/sh_gpg.c \
 	$(srcsrc)/sh_cat.c $(srcsrc)/sh_calls.c \
 	$(srcsrc)/sh_extern.c $(srcsrc)/sh_database.c \
@@ -151,5 +120,5 @@
 	$(srcsrc)/bignum.c $(srcsrc)/mkhdr.c \
 	$(srcsrc)/samhain_setpwd.c $(srcsrc)/samhain_stealth.c \
-	$(srcsrc)/encode.c \
+	$(srcsrc)/encode.c $(srcsrc)/sstrip.c \
 	$(srcsrc)/trustfile.c $(srcsrc)/exepack.c \
 	$(srcsrc)/exepack_fill.c $(srcsrc)/exepack_mkdata.c \
@@ -161,59 +130,29 @@
 	$(srcsrc)/sh_userfiles.c $(srcsrc)/sh_prelude.c \
 	$(srcsrc)/sh_prelink.c $(srcsrc)/sh_static.c \
-	$(srcsrc)/sh_portcheck.c $(srcsrc)/sh_port2proc.c\
-	$(srcsrc)/sh_processcheck.c $(srcsrc)/sh_filter.c \
-	$(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c \
-	$(srcsrc)/sh_log_parse_syslog.c $(srcsrc)/sh_log_parse_pacct.c \
-	$(srcsrc)/sh_log_parse_samba.c $(srcsrc)/sh_log_parse_generic.c \
-	$(srcsrc)/sh_log_parse_apache.c $(srcsrc)/sh_log_evalrule.c \
-	$(srcsrc)/sh_log_correlate.c $(srcsrc)/sh_log_mark.c \
-	$(srcsrc)/sh_log_check.c $(srcsrc)/dnmalloc.c \
-	$(srcsrc)/sh_inotify.c $(srcsrc)/sh_log_repeat.c \
-	$(srcsrc)/sh_audit.c $(srcsrc)/sh_registry.c \
-	$(srcsrc)/sh_ipvx.c $(srcsrc)/sh_restrict.c \
-	$(srcsrc)/sh_filetype.c $(srcsrc)/sh_sub.c $(srcsrc)/sh_fInotify.c \
-	$(srcsrc)/sh_checksum.c $(srcsrc)/sh_guid.c $(srcsrc)/sh_sem.c \
-	$(srcsrc)/sh_dbIO.c $(srcsrc)/sh_dbCheck.c  $(srcsrc)/sh_dbCreate.c \
-	$(srcsrc)/sh_subuid.c \
-	$(srcsrc)/t-test1.c 
-
-OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \
-	samhain.o sh_unix.o sh_utils.o sh_error.o \
-	sh_getopt.o sh_readconf.o sh_filter.o \
-	sh_hash.o sh_mail.o sh_nmail.o sh_mem.o sh_login_track.o \
-	sh_entropy.o sh_modules.o sh_utmp.o \
-	sh_xfer_client.o sh_xfer_server.o sh_xfer_syslog.o \
-	sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_sig.o \
+	$(srcsrc)/sh_prelude_old.c
+
+OBJECTS = samhain.o sh_unix.o sh_utils.o sh_error.o sh_files.o \
+	sh_getopt.o sh_readconf.o sh_tiger0.o sh_tiger1.o sh_tiger2.o \
+	sh_tiger1_64.o sh_tiger2_64.o sh_hash.o sh_mail.o sh_mem.o \
+	sh_entropy.o sh_forward.o sh_modules.o sh_utmp.o sh_kern.o \
+	sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
 	sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
 	sh_err_console.o sh_err_syslog.o sh_schedule.o bignum.o \
 	trustfile.o rijndael-alg-fst.o rijndael-api-fst.o slib.o \
 	zAVLTree.o sh_socket.o sh_ignore.o sh_prelude.o \
-	sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \
-	sh_processcheck.o sh_portcheck.o sh_port2proc.o \
-	sh_log_parse_syslog.o sh_log_parse_pacct.o sh_log_parse_apache.o \
-	sh_log_parse_samba.o sh_log_evalrule.o sh_log_check.o \
-	sh_log_parse_generic.o \
-	sh_log_correlate.o sh_log_mark.o sh_log_repeat.o \
-	sh_pthread.o sh_string.o sh_inotify.o dnmalloc.o \
-	sh_audit.o sh_registry.o sh_ipvx.o sh_restrict.o \
-	sh_filetype.o sh_sub.o sh_fInotify.o sh_checksum.o \
-	sh_guid.o sh_sem.o sh_dbIO.o sh_dbCheck.o sh_dbCreate.o \
-	sh_subuid.o
-
+	sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o sh_prelude_old.o
+
+KERN = kern_head.h kern_head.c
 
 TESTSUITE = test.sh testcompile.sh testhash.sh testtiger.txt \
 	testtimesrv.sh \
-	testext.sh testrc_1ext.in test_ext.c.in testrun_1d.sh \
-	testrun_1.sh testrun_1a.sh testrun_1b.sh testrun_1c.sh \
-	testrc_1 testrc_1i.dyn test1i_file.sig test1i_samhain.pub \
-	testrun_1d.sh testrun_1e.sh testrun_1f.sh \
-	testrun_1g.sh testrun_1h.sh testrun_1i.sh \
+	testext.sh testrc_1ext.in test_ext.c.in \
+	testrun_1.sh testrun_1a.sh testrun_1b.sh testrc_1 \
 	testrun_2.sh testrun_2a.sh testrun_2b.sh testrc_2.in \
-	testrun_2c.sh testrun_2d.sh testrun_2e.sh testrun_2f.sh \
-	testrun_2g.sh
+	testrun_2c.sh testrun_2d.sh
 
 DIST_COMMON =  README COPYING LICENSE samhain.jpg \
 samhainrc.linux samhainrc.solaris samhainrc.freebsd samhainrc.aix5.2.0 \
-samhainrc.netbsd yulerc.template \
+yulerc.template \
 Install.sh 
 
@@ -222,5 +161,5 @@
 stealth_template.jpg \
 config.guess config.h.in stamp-h.in config.sub configure \
-configure.ac aclocal.m4 acinclude.m4 compile install-sh missing mkinstalldirs \
+configure.ac acconfig.h aclocal.m4 install-sh missing mkinstalldirs \
 c_random.sh c_bits.sh depend.sum depend.dep stamp-hdep
 
@@ -228,5 +167,5 @@
         src include man scripts init docs sql_init test dsys
 
-PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) $(SADMIN)
+PROGRAMS = $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
 
 #----------------------------------------------------------
@@ -236,5 +175,5 @@
 #----------------------------------------------------------
 
-all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL)
+all: $(top_srcdir)/depend.sum $(SETPWD) $(STEGIN) $(SAMHAIN) $(YULECTL) @sh_lkm@ sstrip
 
 
@@ -261,6 +200,6 @@
 	touch config.h
 
-#stamp-h: $(top_srcdir)/config.h.in config.status
-#	./config.status
+stamp-h: $(top_srcdir)/config.h.in config.status
+	./config.status
 
 Makefile: $(top_srcdir)/Makefile.in config.status
@@ -281,6 +220,6 @@
 
 depend-gen: $(srcsrc)/depend-gen.c 
-	@echo "$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c"; \
-	$(BUILD_CC) -I. -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
+	@echo "$(CC) $(CFLAGS) -o depend-gen $(srcsrc)/depend-gen.c"; \
+	$(CC) $(CFLAGS) -o depend-gen $(srcsrc)/depend-gen.c 2>/dev/null || \
 	echo "failed to compile ... hope depend.dep is ok"
 
@@ -292,5 +231,5 @@
 	if test -f depend-gen; then \
 	  failfiles=""; \
-	  for ff in $(SOURCES); do \
+	  for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	    ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/depend.dep $$ff || \
 		failfiles="$${failfiles} $$ff"; \
@@ -322,7 +261,4 @@
 	fi;
 
-$(top_srcdir)/stamp-hdep:
-	touch $(top_srcdir)/stamp-hdep && touch $(top_srcdir)/Makefile.in
-
 $(top_srcdir)/Makefile.in: $(top_srcdir)/stamp-hdep
 	@echo "update Makefile.in ..."; \
@@ -331,5 +267,5 @@
 	if test -f depend-gen; then \
 	  failfiles=""; \
-	  for ff in $(SOURCES); do \
+	  for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	     ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff || \
 		failfiles="$${failfiles} $$ff"; \
@@ -350,5 +286,5 @@
 depend: depend-gen
 	@echo "update Makefile.in ..."; \
-	for ff in $(SOURCES); do \
+	for ff in $(SOURCES) $(srcsrc)/kern_head.c; do \
 	  ./depend-gen -i '$$(srcinc)/' -o $(top_srcdir)/Makefile.in $$ff; \
 	  echo $(srcsrc) > $(top_srcdir)/stamp-dep; \
@@ -366,7 +302,7 @@
 #
 
-CLEANFILES = encode config_xor.h depend-gen \
-	internal.h sh_MK.h trustfile samhain mkhdr encode cutest \
-	yule samhain_setpwd samhain_stealth samhainrc yulectl
+CLEANFILES = encode config_xor.h depend-gen sh_ks.h sh_ks_xor.h kern_head \
+	internal.h sh_MK.h trustfile sstrip samhain mkhdr encode \
+	yule samhain_setpwd samhain_stealth samhainrc yulectl samhain_hide.ko 
 
 clean:
@@ -378,24 +314,20 @@
 #
 
-DISTCLEANFILES = Makefile samhain.spec sh_sig_checksum.h sh_gpg_fp.h \
-	init/samhain.startLinux init/samhain.startGentoo init/samhain.startSystemd \
+DISTCLEANFILES = Makefile samhain.spec sh_gpg_checksum.h sh_gpg_fp.h \
+	init/samhain.startLinux init/samhain.startGentoo \
 	init/samhain.startLSB init/samhain.startFreeBSD \
 	init/samhain.startSolaris init/samhain.startHPUX \
-	init/samhain.startIRIX init/samhain.startMACOSX \
-	deploy.sh sh_MK.h samhain-install.sh \
-	rules.deb rules.deb-light src/CuTestMain.c \
-	scripts/samhainadmin-sig.pl scripts/samhainadmin-gpg.pl \
+	init/samhain.startIRIX \
+	deploy.sh sh_MK.h samhain-install.sh sh_gpg_chksum.h sh_gpg_fp.h \
+	rules.deb rules.deb-light \
 	scripts/samhainadmin.pl scripts/check_samhain.pl \
-	scripts/samhain.ebuild scripts/samhain.ebuild-light \
-	scripts/yuleadmin.pl scripts/logrotate \
-	scripts/redhat_i386.client.spec scripts/samhain.spec hp_ux.psf 
+	scripts/samhain.ebuild scripts/samhain.ebuild-light 
 
 TESTCLEANFILES = samhain.build samhain.new yule.html \
-	test_ext test_ext.c test_ext.res testhash.tmp \
-	testrc1.signed testrc_1ext testrc_2 testrc_2.signed \
-	test_dnmalloc samhainrc yulerc
+	test_ext test_ext.c test_ext.res test_log testhash.tmp \
+	testrc1.signed testrc_1ext testrc_2 testrc_2.signed 
 
 distclean:  clean
-	-rm -f config.status config.log configure.lineno config.h config.cache stamp-dep stamp-h @install_name@rc
+	-rm -f config.status config.log configure.lineno config.h config.cache
 	@-test -z "$(TESTCLEANFILES)" || rm -f $(TESTCLEANFILES)
 	@-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
@@ -466,9 +398,4 @@
 	fi
 
-test_dnmalloc: $(srcsrc)/t-test1.c dnmalloc.o
-	$(COMPILE) $(VFLAG) -o t-test1.o -c $(srcsrc)/t-test1.c; \
-	$(LINK) t-test1.o dnmalloc.o $(LIBS_TRY)
-
-
 #----------------------------------------------------------
 #
@@ -477,5 +404,5 @@
 #----------------------------------------------------------
 
-install: install-program install-man install-data
+install: install-lkm install-program install-man install-data
 	@echo; \
 	echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
@@ -485,5 +412,5 @@
 	echo
 
-install-light: install-program install-data
+install-light: install-lkm install-program install-data
 	@echo; \
 	echo "  You can use 'samhain-install.sh uninstall' for uninstalling"; \
@@ -493,5 +420,5 @@
 	echo
 
-purge: uninstall-program uninstall-man 
+purge: uninstall-lkm uninstall-program uninstall-man 
 	@echo "./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data"; \
 	./samhain-install.sh --destdir=$(DESTDIR) --force --verbose uninstall-data
@@ -499,5 +426,5 @@
 remove: uninstall
 
-uninstall: uninstall-program uninstall-man uninstall-data
+uninstall: uninstall-lkm uninstall-program uninstall-man uninstall-data
 	@echo; \
 	echo "  Use 'make purge' if you also want to uninstall the configuration file"; \
@@ -519,23 +446,40 @@
 #
 
-
-install-program: $(PROGRAMS) 
+# -- NEW --
+install-lkm: @sh_lkm@
+	@RVER=`uname -r`; \
+	if test "x@sh_lkm@" != "x"; then \
+	  if test -d /lib/modules/$$RVER; then \
+	    MODDIR="/lib/modules/$$RVER"; \
+	  elif test -d /lib/modules/misc; then \
+	    MODDIR="/lib/modules/misc"; \
+	  elif test -d /lib/modules; then \
+	    MODDIR="/lib/modules/misc"; \
+	  fi; \
+	  $(mkinstalldirs) $(DESTDIR)$${MODDIR}; \
+	  list='@sh_lkm@'; for p in $$list; do \
+	    echo " cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`"; \
+	    cp $$p $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'` ; \
+	    chown root $(DESTDIR)$${MODDIR}/`echo $$p|sed 's%samhain%@install_name@%'`; \
+	  done; \
+	  if test "x$(DESTDIR)" = x; then \
+	    echo " depmod -a || /sbin/depmod -a"; \
+	    depmod -a || /sbin/depmod -a; \
+	  fi; \
+	fi
+
+uninstall-lkm:
+	@echo "./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm";\
+	./samhain-install.sh --destdir=$(DESTDIR) --express --verbose uninstall-lkm
+
+
+install-program: $(PROGRAMS) sstrip
 	@$(mkinstalldirs) $(DESTDIR)$(sbindir)
-	@if test x$(mytmpdir) != x; then \
-		$(mkinstalldirs) $(DESTDIR)$(mytmpdir); \
-	fi
 	@list='$(PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
-	    target=$(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`; \
-	    extension=`echo $$target|sed 's%.*\.%%'`; \
-	    if test x$$extension = x; then \
-	      echo " $(INSTALL_PROGRAM) $$p $$target"; \
-	      $(INSTALL_PROGRAM) $$p $$target; \
-	      chmod 0700 $$target; \
-	    else \
-	      echo " $(INSTALL_SHELL) $$p $$target"; \
-	      $(INSTALL_SHELL) $$p $$target; \
-	      chmod 0700 $$target; \
-	    fi; \
+	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
+	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
+	    echo " ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
+	    ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
 	  else :; fi; \
 	done
@@ -583,10 +527,6 @@
 	@$(mkinstalldirs) $(DESTDIR)$(mylockdir)
 	@$(mkinstalldirs) $(DESTDIR)$(mylogdir)
-	@if test -d $(DESTDIR)$(mydatadir); then \
-		:; \
-	else \
-		$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
-		chmod 755 $(DESTDIR)$(mydatadir); \
-	fi
+	@$(mkinstalldirs) $(DESTDIR)$(mydatadir); \
+	chmod 700 $(DESTDIR)$(mydatadir)
 	@if test -f samhainrc.$(selectconfig); then \
 		:; \
@@ -608,18 +548,4 @@
 		if test -f $(srcdir)/stealth_template.jpg; then \
 			cp $(srcdir)/stealth_template.jpg . ; \
-		fi; \
-	fi
-	@if test -d /etc/logrotate.d; then \
-		if test ! -d $(DESTDIR)/etc/logrotate.d; then \
-			$(mkinstalldirs) $(DESTDIR)/etc/logrotate.d; \
-		fi; \
-		if test ! -f $(DESTDIR)/etc/logrotate.d/@install_name@; then \
-			if test -w $(DESTDIR)/etc/logrotate.d; then \
-				cp $(srcdir)/scripts/logrotate $(DESTDIR)/etc/logrotate.d/@install_name@; \
-			else \
-				echo "$(DESTDIR)/etc/logrotate.d not writable"; \
-			fi; \
-		else \
-			echo "$(DESTDIR)/etc/logrotate.d/@install_name@ exists, not overwriting"; \
 		fi; \
 	fi
@@ -687,5 +613,5 @@
 run-light: all
 	@echo "Building $(PACKAGE)-$(VERSION).run"; \
-	STAGE=$(PACKAGE)-$(VERSION)-run-installer; \
+	STAGE=$(PACKAGE)-$(VERSION); \
 	mkdir $$STAGE; \
 	if test x"$$?" != x0; then \
@@ -693,10 +619,7 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install-light; \
+	make DESTDIR=$$STAGE install-light; \
 	rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
 	echo "#! /bin/sh"                        > $$STAGE/setup.sh; \
-	if test x$(mytmpdir) != x; then \
-	echo  "./mkinstalldirs @mytmpdir@ || exit 1"    >> $$STAGE/setup.sh; \
-	fi; \
 	echo  "./mkinstalldirs @sbindir@ || exit 1"     >> $$STAGE/setup.sh; \
 	echo  "./mkinstalldirs @sysconfdir@ || exit 1"  >> $$STAGE/setup.sh; \
@@ -705,19 +628,27 @@
 	echo  "./mkinstalldirs @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
 	echo  "chmod 700       @mydataroot@ || exit 1"  >> $$STAGE/setup.sh; \
+	if test -f $$STAGE/lib/modules; then \
+	  RVER=`uname -r`; \
+	  echo "chown root:root lib/modules/$$RVER/*" >> $$STAGE/setup.sh; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "./mkinstalldirs /lib/modules/$$RVER" >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/$$RVER/* /lib/modules/$$RVER/" >> $$STAGE/setup.sh; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
+	  elif test -d /lib/modules; then \
+	    echo "./mkinstalldirs /lib/modules/misc"   >> $$STAGE/setup.sh; \
+	    echo  "cp -p lib/modules/misc/* /lib/modules/misc/" >> $$STAGE/setup.sh; \
+	  fi; \
+	  echo "/sbin/depmod -a" >> $$STAGE/setup.sh; \
+	fi; \
 	temp=`echo $(sbindir) | sed s,^/,,`; \
 	echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
 	echo  "cp -p $$temp/* $(sbindir) || exit 1" >> $$STAGE/setup.sh; \
 	temp=`echo $(sysconfdir) | sed s,^/,,`; \
-	echo "chown -R root $$temp/*" >> $$STAGE/setup.sh; \
+	echo "chown root $$temp/*" >> $$STAGE/setup.sh; \
 	configfile=`echo  @myconffile@ | sed 's%^REQ_FROM_SERVER%%'`; \
-	echo  "cp -pr $$temp/* @sysconfdir@"                           >> $$STAGE/setup.sh; \
-	echo  "./samhain-install.sh --express --verbose install-boot"  >> $$STAGE/setup.sh; \
-	echo  "if [ \$$? -ne 0 ]"                                      >> $$STAGE/setup.sh; \
-	echo  "then"                                                   >> $$STAGE/setup.sh; \
-	echo  "  echo 'Installation finished, but could not install boot-time init scripts'"      >> $$STAGE/setup.sh; \
-	echo  "  exit 2"                                               >> $$STAGE/setup.sh; \
-	echo  "fi"                                                     >> $$STAGE/setup.sh; \
-	echo  "echo 'Installation finished'"                           >> $$STAGE/setup.sh; \
-	echo  "exit 0"                                                 >> $$STAGE/setup.sh; \
+	echo  "test -f $$configfile || cp -p $$temp/* $$configfile" >> $$STAGE/setup.sh; \
+	echo  "./samhain-install.sh --express --verbose install-boot"    >> $$STAGE/setup.sh; \
 	cp $(top_srcdir)/mkinstalldirs $$STAGE/; \
 	cp $(top_srcdir)/install-sh $$STAGE/; \
@@ -729,5 +660,5 @@
 	chmod +x $$STAGE/install-sh; \
 	$(top_srcdir)/scripts/makeself/makeself.sh --header $(top_srcdir)/scripts/makeself/makeself-header.sh --nocomp --nomd5 --notemp $$STAGE $(PACKAGE)-$(VERSION).run "$(PACKAGE)_$(VERSION)_self_extracting_installer" ./setup.sh && \
-	rm -r $$STAGE
+	rm -r $(PACKAGE)-$(VERSION)
 
 emerge-prepare: dist
@@ -808,13 +739,19 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
-	if test x$(mytmpdir) != x; then \
-	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
-	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
-	echo lib/systemd/system          >> debian/dirs; \
 	echo $(mydatadir)   | sed s,^/,, >> debian/dirs; \
 	echo $(mylogdir)    | sed s,^/,, >> debian/dirs; \
 	echo $(mylockdir)   | sed s,^/,, >> debian/dirs; \
+	if test "x@sh_lkm@" != x; then \
+	  RVER=`uname -r`; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "lib/modules/$$RVER"    >> debian/dirs; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  elif test -d /lib/modules; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  fi; \
+	fi; \
 	$(MAKE) deb-run
 
@@ -825,10 +762,6 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
-	if test x$(mytmpdir) != x; then \
-	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
-	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
-	echo lib/systemd/system          >> debian/dirs; \
 	echo $(mydatadir)   | sed s,^/,, >> debian/dirs; \
 	echo $(mylogdir)    | sed s,^/,, >> debian/dirs; \
@@ -837,4 +770,14 @@
 	echo $(mandir)/man8 | sed s,^/,, >> debian/dirs; \
 	echo usr/share/doc/$(PACKAGE)    >> debian/dirs; \
+	if test "x@sh_lkm@" != x; then \
+	  RVER=`uname -r`; \
+	  if test -d /lib/modules/$$RVER; then \
+	    echo "lib/modules/$$RVER"    >> debian/dirs; \
+	  elif test -d /lib/modules/misc; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  elif test -d /lib/modules; then \
+	    echo "lib/modules/misc"      >> debian/dirs; \
+	  fi; \
+	fi; \
 	echo $(top_srcdir)/README                         > debian/docs; \
 	echo $(top_srcdir)/test/testtiger.txt            >> debian/docs; \
@@ -846,22 +789,20 @@
 	echo $(top_srcdir)/docs/HOWTO-client+server.html >> debian/docs; \
 	echo $(top_srcdir)/docs/HOWTO-samhain+GnuPG.html >> debian/docs; \
-	echo $(top_srcdir)/docs/MANUAL-2_4.html.tar      >> debian/docs; \
-	echo $(top_srcdir)/docs/MANUAL-2_4.pdf           >> debian/docs; \
+	echo $(top_srcdir)/docs/MANUAL-2_0.html.tar      >> debian/docs; \
+	echo $(top_srcdir)/docs/MANUAL-2_0.ps            >> debian/docs; \
 	echo $(top_srcdir)/docs/README.gcc_bug           >> debian/docs; \
 	echo $(top_srcdir)/docs/README.LZO               >> debian/docs; \
+	echo $(top_srcdir)/docs/README.sstrip            >> debian/docs; \
 	echo $(top_srcdir)/docs/README.UPGRADE           >> debian/docs; \
 	echo $(top_srcdir)/docs/README.win2K             >> debian/docs; \
+	echo $(top_srcdir)/docs/TODO                     >> debian/docs; \
 	$(MAKE) deb-run
 
 deb-run:
-	@maintainer=`gpg --list-secret-keys | grep 'uid ' | cut -d" " -f 5- | sed 's/^ *//' | sed q1`;\
+	@maintainer=`gpg --list-secret-keys | grep 'sec ' | cut -d" " -f 5-`;\
 	if test "x$$maintainer" = x; then \
-		maintainer="$(DEFAULT_MAINTAINER)"; \
-	fi; \
-	codename=`lsb_release -a 2>/dev/null | grep Codename | cut -f 2`; \
-	if test "x$$codename" = x; then \
-		codename="stable"; \
-	fi; \
-	echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) $$codename; urgency=low" > debian/changelog; \
+		maintainer="Nobody Nowhere <nobody@example.com>"; \
+	fi; \
+	echo "$(PACKAGE) ($(VERSION)-1) stable; urgency=low" > debian/changelog; \
 	echo >> debian/changelog; \
 	echo "  * Initial release." >> debian/changelog; \
@@ -869,7 +810,9 @@
 	echo " -- $$maintainer  `date -R`" >> debian/changelog; \
 	echo >> debian/changelog; \
+	echo "Local variables:" >> debian/changelog; \
+	echo "mode: debian-changelog" >> debian/changelog; \
+	echo "End:" >> debian/changelog; \
 	cp   $(top_srcdir)/COPYING  debian/copyright; \
-	echo "9" > debian/compat; \
-	echo "Nothing to see here." > debian/README.debian; \
+	touch debian/README.debian; \
 	echo "Document: @install_name@-manual" > debian/@install_name@.doc-base; \
 	echo "Title: @install_name@ Manual" >> debian/@install_name@.doc-base; \
@@ -878,32 +821,29 @@
 	echo " and how it can be used to check the file integrity of your" >> debian/@install_name@.doc-base; \
 	echo " server." >> debian/@install_name@.doc-base; \
-	echo "Section: System/Security" >> debian/@install_name@.doc-base; \
+	echo "Section: admin" >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo "Format: Postscript" >> debian/@install_name@.doc-base; \
-	echo "Files: /usr/share/doc/@install_name@/manual.pdf.gz" >> debian/@install_name@.doc-base; \
+	echo "Files: /usr/share/doc/@install_name@/manual.ps.gz" >> debian/@install_name@.doc-base; \
 	echo  >> debian/@install_name@.doc-base; \
 	echo "Format: HTML" >> debian/@install_name@.doc-base; \
 	echo "Index: /usr/share/doc/@install_name@/manual.html/index.html" >> debian/@install_name@.doc-base; \
 	echo "Files: /usr/share/doc/@install_name@/manual.html/*.html" >> debian/@install_name@.doc-base; \
-	if test -f /usr/lib/lsb/install_initd; then \
-	  cp init/samhain.startLSB debian/@install_name@.init; \
-	else \
-	  cp init/samhain.startLinux debian/@install_name@.init; \
-	fi; \
+	echo $(sysconfdir)/@install_name@rc > debian/conffiles; \
+	echo /etc/init.d/@install_name@ >> debian/conffiles; \
+	cp init/samhain.startLinux debian/@install_name@.init; \
 	echo "Source: samhain"     > debian/control; \
 	echo "Section: admin"     >> debian/control; \
 	echo "Priority: optional" >> debian/control; \
 	echo "Maintainer: $$maintainer" >> debian/control; \
-	echo "Build-Depends: debhelper (>> 9)" >> debian/control; \
-	echo "Standards-Version: 3.9.8" >> debian/control; \
+	echo "Standards-Version: 3.2.1" >> debian/control; \
 	echo >> debian/control; \
 	echo "Package: @install_name@" >> debian/control; \
 	echo "Architecture: any" >> debian/control; \
-	echo "Depends: \$${shlibs:Depends}, \$${misc:Depends}" >> debian/control; \
+	echo "Depends: \$${shlibs:Depends}" >> debian/control; \
 	echo "Description: File integrity checker"  >> debian/control; \
 	echo " A file integrity checker"  >> debian/control; \
 	echo "running debuild -us -uc"; \
-	export DEB_BUILD_MAINT_OPTIONS=optimize=-all; debuild --preserve-envvar=PASSWORD -us -uc -b; \
+	debuild -us -uc; \
 	DEBFILE=`find ../ -follow -maxdepth 1 -cnewer ./debian/control 2>/dev/null | grep '@install_name@_$(VERSION)' | grep '\.deb'`; \
 	if test x"$$DEBFILE" = x; then \
@@ -912,6 +852,5 @@
 	else \
 	  echo "Package $$DEBFILE built."; \
-	  cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
-	  ln --backup=numbered -fs ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
+	  cp $$DEBFILE ./$(PACKAGE)-$(VERSION).deb; \
 	fi; \
 	echo
@@ -933,24 +872,11 @@
 rpmspec-light: samhain.spec
 	@echo "Stripping docs from samhain.spec"; \
-	cat samhain.spec | sed 's,make DESTDIR=$${RPM_BUILD_ROOT} install,make   DESTDIR=$${RPM_BUILD_ROOT} install-light,' | sed s,shkeep=yes,shkeep=no, | sed s,%doc.*,, | sed '/logrotate/! { s,%attr.*,, }' > samhain.spec-light; \
+	cat samhain.spec | sed 's,make DESTDIR=$${RPM_BUILD_ROOT} install,make   DESTDIR=$${RPM_BUILD_ROOT} install-light,' | sed s,shkeep=yes,shkeep=no, | sed s,%doc.*,, | sed s,%attr.*,, > samhain.spec-light; \
 	mv samhain.spec-light samhain.spec
 
 rpm-light: rpmspec-light distrpm
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
-	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then \
-	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	else \
-	  if test ! -d "$${try_RPMTOP}"; then \
-	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	  fi; \
-	fi; \
-	if test -d "$${try_RPMTOP}"; then \
-	  RPMTOP="$${try_RPMTOP}"; \
-	else \
-	  RPMTOP=/usr/src; \
-	fi; \
-	echo "Searching the RPM package below $$RPMTOP ..."; \
-	RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
+	@echo "Searching the RPM package ..."; \
+	RPMFILE=`find /usr/src -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
 	echo; \
 	if test x"$$RPMFILE" = x; then \
@@ -959,5 +885,4 @@
 	else \
 	  echo "Package $$RPMFILE built."; \
-	  echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
 	  cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
 	fi; \
@@ -966,19 +891,6 @@
 rpm: rpmspec-full distrpm
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
-	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then \
-	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	else \
-	  if test ! -d "$${try_RPMTOP}"; then \
-	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
-	  fi; \
-	fi; \
-	if test -d "$${try_RPMTOP}"; then \
-	  RPMTOP="$${try_RPMTOP}"; \
-	else \
-	  RPMTOP=/usr/src; \
-	fi; \
-	echo "Searching the RPM package below $$RPMTOP ..."; \
-	RPMFILE=`find $$RPMTOP -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
+	@echo "Searching the RPM package ..."; \
+	RPMFILE=`find /usr/src -follow -maxdepth 4 -cnewer ./samhain.spec 2>/dev/null | grep '@install_name@-$(VERSION)' | grep '\.rpm' | grep -v '\.src\.'`; \
 	echo; \
 	if test x"$$RPMFILE" = x; then \
@@ -987,5 +899,4 @@
 	else \
 	  echo "Package $$RPMFILE built."; \
-	  echo "Copying it to ./$(PACKAGE)-$(VERSION).rpm"; \
 	  cp $$RPMFILE ./$(PACKAGE)-$(VERSION).rpm; \
 	fi; \
@@ -1011,5 +922,5 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install-light;
+	make DESTDIR=$$STAGE install-light;
 	$(MAKE) solaris-pkg-finish
 
@@ -1021,5 +932,5 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install; 
+	make DESTDIR=$$STAGE install; 
 	$(MAKE) solaris-pkg-finish
 
@@ -1031,21 +942,11 @@
 	user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
 	group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
-	cat prototype | grep -v 'none / ' | \
+	cat prototype | grep -v 'none / ' | grep -v 'none /usr ' | \
+	grep -v 'none /usr/local ' | grep -v 'none /usr/bin ' | \
+	grep -v 'none /usr/local/bin ' | grep -v 'none /usr/local/sbin ' | \
+	grep -v 'none /var ' | grep -v 'none /usr/sbin ' | \
 	sed s,$$user\ $$group,root\ sys,g > prototype.1; \
-	rm -f prototype.2; \
-	while read line; do \
-		echo "$${line}" | egrep '^d none' >/dev/null 2>&1;  \
-		if [ $$? = 0 ]; then \
-			dir=`echo "$${line}" | awk '{ print $$3 }'`; \
-			if [ -d "$$dir" ]; then \
-				echo "d none $${dir} ? ? ?" >> prototype.2; \
-			else \
-				echo "$${line}" >> prototype.2; \
-			fi; \
-		else \
-			echo "$${line}" >> prototype.2; \
-		fi; \
-	done < prototype.1; \
-	rm -f prototype && rm prototype.1 && mv prototype.2 prototype; \
+	rm -f prototype && mv prototype.1 prototype; \
+	echo "d none /var ? ? ?" >> prototype; \
 	echo "d none /etc/rc0.d ? ? ?" >> prototype; \
 	echo "d none /etc/rc1.d ? ? ?" >> prototype; \
@@ -1055,5 +956,5 @@
 	echo "l none /etc/rc1.d/K10@install_name@=/etc/init.d/@install_name@" >> prototype; \
 	ARCH=`uname -p`; \
-	PSTAMP=`date '+%c%y%m%d%H%M%S'`; \
+	PSTAMP=`date '+%cc%yy%mm%dd%HH%MM%SS'`; \
 	echo "PKG=@install_name@"         >  pkginfo; \
 	echo "NAME=file integrity check"  >> pkginfo; \
@@ -1070,18 +971,11 @@
 	  echo; \
 	  cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
-	  echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
-	  echo "to install, use: pkgadd -n -d $(PACKAGE)-$(VERSION).pkg all"; \
+	  echo "Package @install_name@.pkg is ready for installation"; \
 	  echo; \
-	  rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
+	  rm -r /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
 	else \
 	  echo; \
-	  echo "**************************************************************"; \
 	  echo "Error ... cannot find /tmp/samhain-pkg-staging/@install_name@.pkg."; \
 	  echo "Keeping /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging"; \
-	  if test -d /var/spool/pkg; then \
-		echo "**************************************************************"; \
-	  else \
-		echo "************** /var/spool/pkg is missing *********************"; \
-	  fi; \
 	  echo; \
 	  exit 1; \
@@ -1095,6 +989,6 @@
 	  exit 1; \
 	fi; \
-	$(MAKE) DESTDIR=$$STAGE install; \
-	$(MAKE) DESTDIR=$$STAGE install-boot; \
+	make DESTDIR=$$STAGE install; \
+	make DESTDIR=$$STAGE install-boot; \
 	cp hp_ux.psf $$STAGE; \
 	mkdir $$STAGE/sc; \
@@ -1137,23 +1031,29 @@
 
 
+sstrip: $(srcsrc)/sstrip.c Makefile
+	$(COMPILE)  -o sstrip $(srcsrc)/sstrip.c
+
 encode: $(srcsrc)/encode.c Makefile
-	$(BUILD_CC) -I. -o encode $(srcsrc)/encode.c
+	$(COMPILE)  -o encode $(srcsrc)/encode.c
 
 config_xor.h: config.h encode
 	@echo 'encode $(XOR_CODE) config.h'; \
+	sleep 1; \
 	./encode $(XOR_CODE) config.h; \
 	mv x_config.h  config_xor.h
 
-
-$(OBJECTS): encode internal.h config_xor.h
+#.c.o:
+#	@echo "./encode $(XOR_CODE) $<  -->  x_`echo $< |sed 's%.*/%%'`"; \
+#	./encode $(XOR_CODE) $<; \
+#	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`"; \
+#	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $< |sed 's%.*/%%'`; \
+#	rm x_`echo $< |sed 's%.*/%%'`
+
+$(OBJECTS):
 	@echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
 	./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
 	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c && \
+	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
 	rm x_`echo $@ |sed 's%\.o$$%%'`.c
-
-sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h 
-	@echo "$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC)";\
-	$(COMPILE) $(VFLAG) -o sh_tiger_i.o -c $(srcsrc)/$(TIGER_SRC);
 
 samhain_setpwd: encode config_xor.h $(srcsrc)/samhain_setpwd.c
@@ -1175,54 +1075,57 @@
 	rm x_yulectl.c
 
-$(SAMHAIN): internal.h $(OBJECTS) sh_tiger_i.o
+$(SAMHAIN): internal.h $(OBJECTS)
 	@-rm -f $(SAMHAIN)
-	@echo "$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)"; \
-	$(LINK) sh_tiger_i.o $(OBJECTS) $(LIBS_TRY)
-
-
-CUTEST_SOURCES = $(srcsrc)/cutest_sh_tools.c \
-		$(srcsrc)/cutest_sh_utils.c \
-		$(srcsrc)/cutest_sh_unix.c \
-		$(srcsrc)/cutest_slib.c \
-		$(srcsrc)/cutest_zAVLTree.c \
-		$(srcsrc)/cutest_sh_hash.c \
-		$(srcsrc)/cutest_sh_tiger0.c
-
-CUTEST_OBJECTS = cutest_sh_tools.o \
-	cutest_sh_utils.o \
-	cutest_sh_unix.o \
-	cutest_slib.o \
-	cutest_zAVLTree.o \
-	cutest_sh_hash.o \
-	cutest_sh_tiger0.o
-
-$(CUTEST_OBJECTS): $(CUTEST_SOURCES) config_xor.h internal.h
-	@echo "./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c --> x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	./encode $(XOR_CODE) $(srcsrc)/`echo $@ |sed 's%\.o$$%%'`.c; \
-	echo "$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c"; \
-	$(COMPILE) $(VFLAG) -o `echo $@ |sed 's%.*/%%'` -c x_`echo $@ |sed 's%\.o$$%%'`.c; \
-	rm x_`echo $@ |sed 's%\.o$$%%'`.c
-
-
-cutest: $(SOURCES) $(CUTEST_SOURCES)
-	@$(MAKE) CUTEST='-DSH_CUTEST=1' intcutest
-
-$(srcsrc)/CuTestMain.c: $(SOURCES) $(CUTEST_SOURCES) $(srcsrc)/make-tests.sh
-	cd $(srcsrc)/ && ./make-tests.sh >CuTestMain.c;
-
-intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTestMain.c
-	@$(COMPILE) -o CuTestMain.o -c $(srcsrc)/CuTestMain.c; \
-	$(COMPILE) -o CuTest.o -c $(srcsrc)/CuTest.c; \
-	rm -f samhain.o; \
-	./encode $(XOR_CODE) $(srcsrc)/samhain.c; \
-	$(COMPILE) $(VFLAG) -o samhain.o -c x_samhain.c; \
-	rm x_samhain.c; \
-	$(LINK) sh_tiger_i.o $(CUTEST_OBJECTS) CuTestMain.o CuTest.o $(OBJECTS) $(LIBS_TRY); \
-	test -f ./intcutest && mv ./intcutest ./cutest; \
-	./cutest
-
-runcutest:
-	gdb ./cutest
-
+	@echo "$(LINK) $(OBJECTS) $(LIBS_TRY)"; \
+	$(LINK) $(OBJECTS) $(LIBS_TRY)
+
+
+
+samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o
+	gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_hide.c
+
+samhain_erase.o: $(srcsrc)/samhain_erase.c
+	gcc @lkm_inc@ -I. -Wall -O2  -c $(srcsrc)/samhain_erase.c
+
+# -- NEW --
+samhain_hide.ko: $(srcsrc)/samhain_hide.c
+	@test -d m_comp || mkdir m_comp; \
+	echo "KVERSION := \$$(shell uname -r)" > m_comp/Makefile;\
+	echo "KSOURCE ?= /lib/modules/\$$(KVERSION)/build" >> m_comp/Makefile;\
+	echo "obj-m   := samhain_hide.o"                   >> m_comp/Makefile;\
+	echo ".PHONY: modules install clean modules_add"   >> m_comp/Makefile;\
+	echo "install : modules_add"                       >> m_comp/Makefile;\
+	echo "modules modules_install clean:"              >> m_comp/Makefile;\
+	echo "T\$$(MAKE) -C \$$(KSOURCE) \$$@ SUBDIRS=\$$(CURDIR) KBUILD_VERBOSE=2" |  tr T '\t' >> m_comp/Makefile;\
+	cp config.h m_comp/; \
+	cp $(srcsrc)/samhain_hide.c m_comp/; \
+	cd m_comp && make modules
+	@if test -f m_comp/samhain_hide.ko; then \
+	  cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
+	  rm -rf m_comp/; \
+	else \
+	  echo "Kernel module samhain_hide.ko not build"; \
+	  exit 1; \
+	fi
+
+# -- NEW --
+lkm: @sh_lkm@
+
+
+
+# For kernel syscall monitoring
+kern_head: Makefile $(top_srcdir)/include/kern_head.h $(srcsrc)/kern_head.c
+	@echo "$(COMPILE) -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)"; \
+	$(COMPILE) -DSYSTEMMAP=\"@systemmap@\" -o kern_head $(srcsrc)/kern_head.c $(LIBS_KVM)
+
+sh_ks.h: kern_head
+	@sleep 1; \
+	./kern_head > sh_ks.h
+
+sh_ks_xor.h: encode sh_ks.h
+	@echo 'encode $(XOR_CODE) sh_ks.h'; \
+	sleep 1; \
+	./encode $(XOR_CODE) sh_ks.h; \
+	mv x_sh_ks.h  sh_ks_xor.h
 
 # For bignum
@@ -1233,12 +1136,11 @@
 bignum.o: internal.h
 
-
 # If your compiler can't handle long identifiers (> 6 chars), move the `#' to
 # the other line.
 
 mkhdr: $(srcsrc)/mkhdr.c config.h 
-	@echo "$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c"; \
+	@echo "$(COMPILE)  -o mkhdr $(srcsrc)/mkhdr.c"; \
 	sleep 1; \
-	$(BUILD_CC) -I. -o mkhdr $(srcsrc)/mkhdr.c
+	$(COMPILE)  -o mkhdr $(srcsrc)/mkhdr.c
 
 #	$(COMPILE)  -DBIG_SHORT_NAMES -o mkhdr $(srcdir)/mkhdr.c
@@ -1263,9 +1165,11 @@
 # prepare the data to be packed
 #
-exepack.data: $(SAMHAIN) exepack_mkdata 
+exepack.data: $(SAMHAIN) exepack_mkdata sstrip
 	@echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
 	cp ./$(SAMHAIN) ./samhain.pk.data; \
 	echo "strip ./samhain.pk.data"; \
 	strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
+	echo "./sstrip ./samhain.pk.data"; \
+	./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
 	echo "./exepack_mkdata ./samhain.pk.data ./exepack.data 0"; \
 	./exepack_mkdata ./samhain.pk.data ./exepack.data 0; \
@@ -1288,9 +1192,11 @@
 	$(LINK) exepack_fill.o minilzo.o
 
-samhain.pk: $(SAMHAIN) exepack exepack_fill 
+samhain.pk: $(SAMHAIN) exepack exepack_fill sstrip
 	@echo "cp ./$(SAMHAIN) ./samhain.pk.data"; \
 	cp ./$(SAMHAIN) ./samhain.pk.data; \
 	echo "strip ./samhain.pk.data"; \
 	strip ./samhain.pk.data > /dev/null 2>&1  || echo "... is already stripped"; \
+	echo "./sstrip ./samhain.pk.data"; \
+	./sstrip ./samhain.pk.data > /dev/null 2>&1  || echo "sstrip returned false"; \
 	test -f exepack.out && rm exepack.out; \
 	echo "./exepack_fill exepack samhain.pk.data exepack.out"; \
@@ -1299,4 +1205,5 @@
 	echo "strip exepack.out"; \
 	strip exepack.out > /dev/null 2>&1 || echo "... is already stripped"; \
+	./sstrip exepack.out > /dev/null 2>&1 || echo "sstrip returned false"; \
 	echo "mv exepack.out samhain.pk"; \
 	rm -f samhain.pk; mv exepack.out samhain.pk
@@ -1494,18 +1401,13 @@
 	-rm -rf $(distdir)
 	-rm -f $(distdir).tar.gz.asc
-	gpg -a --detach-sign $(distdir).tar.gz; 
-	$(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; 
-	@if test x"$$?" != x0; then \
-		rm -f $(distdir).tar.gz; \
-		echo "ERROR creating $(PACKAGE)_signed-$(VERSION).tar.gz"; \
-	else \
-		rm -f $(distdir).tar.gz; \
-		rm -f $(distdir).tar.gz.asc; \
-		gzip --best $(distdir).tar; \
-		mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz; \
-		echo "========================"; \
-		echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
-		echo "========================"; \
-	fi; \
+	@gpg -a --detach-sign $(distdir).tar.gz; \
+	$(TAR) chof $(distdir).tar $(distdir).tar.gz $(distdir).tar.gz.asc; \
+	rm -f $(distdir).tar.gz; \
+	rm -f $(distdir).tar.gz.asc; \
+	gzip --best $(distdir).tar
+	mv $(distdir).tar.gz $(PACKAGE)_signed-$(VERSION).tar.gz
+	@echo "========================"; \
+	echo "$(PACKAGE)_signed-$(VERSION).tar.gz is ready for distribution"; \
+	echo "========================"
 
 #
@@ -1561,14 +1463,10 @@
 #
 INITFILES=samhain.startIRIX samhain.startFreeBSD samhain.startSolaris \
-samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX \
-samhain.startIRIX samhain.startMACOSX samhain.startSystemd
-
-SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl \
-samhainadmin-gpg.pl samhainadmin-sig.pl logrotate \
-yuleadmin.pl samhain.ebuild samhain.ebuild-light samhain.spec
+samhain.startLSB samhain.startGentoo samhain.startLinux samhain.startHPUX
+
+SCRIPTFILES=redhat_i386.client.spec check_samhain.pl samhainadmin.pl 
 
 distdir: distfilecheck
 	-rm -f $(top_srcdir)/init/*~
-	-rm -f $(top_srcdir)/sql_init/*~
 	-rm -f $(top_srcdir)/dsys/*~
 	-rm -f $(top_srcdir)/docs/*~
@@ -1578,9 +1476,8 @@
 	-rm -f $(top_srcdir)/scripts/*~
 	(cd $(top_srcdir)/init && rm -f $(INITFILES))
+	(cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
 	-rm -rf $(distdir)
 	mkdir $(distdir)
 	-chmod 777 $(distdir)
-	cp scripts/samhain.spec $(distdir)/samhain.spec; \
-	(cd $(top_srcdir)/scripts && rm -f $(SCRIPTFILES))
 	@for file in $(DISTFILES); do \
 	  d=$(top_srcdir); \
@@ -1589,4 +1486,5 @@
 	  fi; \
 	done; \
+	cp scripts/samhain.spec $(distdir)/samhain.spec; \
 	rm -f $(distdir)/scripts/*.spec
 
@@ -1639,42 +1537,38 @@
 
 
-
-samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h 
-sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_subuid.h $(srcinc)/sh_ignore.h 
-sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 
-sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h 
-sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/sh_dbIO.h $(srcinc)/CuTest.h 
-sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbCheck.h $(srcinc)/sh_dbCreate.h $(srcinc)/sh_sem.h $(srcinc)/sh_extern.h 
-sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_xfer.h $(srcinc)/sh_sig.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/sh_socket.h 
-sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_checksum.h 
+samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h 
+sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h 
+sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h 
+sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h 
+sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h 
+sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h 
+sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_database.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_files.h $(srcinc)/sh_mail.h $(srcinc)/sh_calls.h $(srcinc)/sh_tiger.h $(srcinc)/sh_forward.h $(srcinc)/sh_modules.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_extern.h $(srcinc)/sh_database.h $(srcinc)/sh_prelude.h 
+sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h 
 sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h 
 sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h 
 sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h 
-sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_hash.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h 
-sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
-sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h 
-sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h 
-sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_xfer_client.o: $(srcsrc)/sh_xfer_client.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h 
-sh_xfer_server.o: $(srcsrc)/sh_xfer_server.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/sh_guid.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
-sh_xfer_syslog.o: $(srcsrc)/sh_xfer_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h 
-sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h 
-sh_login_track.o: $(srcsrc)/sh_login_track.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_tools.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_error_min.h $(srcinc)/CuTest.h $(srcinc)/CuTest.h 
-sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h 
-sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h 
-sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h $(srcinc)/CuTest.h 
-sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
-sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_xfer.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
-sh_sig.o: $(srcsrc)/sh_sig.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_sig.h 
+sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h 
+sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
+sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h 
+sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_mail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
+sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h 
+sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h 
+sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 
+sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h 
+sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h 
+sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h 
+sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
+sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
+sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h 
 sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h 
-sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h 
-sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_filter.h $(srcinc)/sh_static.h 
+sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h 
+sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
 sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h 
-sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_sem.h 
+sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h 
-sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_schedule.h 
+sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h 
 bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h 
 mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h 
@@ -1682,52 +1576,22 @@
 samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h 
 encode.o: $(srcsrc)/encode.c Makefile 
-trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
+sstrip.o: $(srcsrc)/sstrip.c Makefile 
+trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h 
 exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data 
 exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h 
 exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h 
 minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h 
-slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h 
-rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h 
-rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h 
+slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h 
+rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-api-fst.h 
 zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h 
-sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_guid.h $(srcinc)/sh_fifo.h $(srcinc)/sh_utils.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h $(srcinc)/CuTest.h 
-sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h 
+sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h 
+sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h 
 yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h 
 sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h 
-sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
-sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
+sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h 
+sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h 
+kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 
 sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h 
-sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h 
-sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h 
-sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h 
-sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h 
-sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_samba.o: $(srcsrc)/sh_log_parse_samba.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_log_parse_generic.o: $(srcsrc)/sh_log_parse_generic.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_log_parse_apache.o: $(srcsrc)/sh_log_parse_apache.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_evalrule.o: $(srcsrc)/sh_log_evalrule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/zAVLTree.h 
-sh_log_correlate.o: $(srcsrc)/sh_log_correlate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_log_mark.o: $(srcsrc)/sh_log_mark.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_string.h $(srcinc)/sh_error_min.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/zAVLTree.h 
-sh_log_check.o: $(srcsrc)/sh_log_check.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h 
-dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 
-sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/slib.h $(srcinc)/zAVLTree.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/CuTest.h 
-sh_log_repeat.o: $(srcsrc)/sh_log_repeat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_audit.o: $(srcsrc)/sh_audit.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h 
-sh_registry.o: $(srcsrc)/sh_registry.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_modules.h $(srcinc)/sh_hash.h $(srcinc)/sh_tiger.h 
-sh_ipvx.o: $(srcsrc)/sh_ipvx.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_restrict.o: $(srcsrc)/sh_restrict.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/CuTest.h 
-sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h 
-sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h 
-sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h 
-sh_checksum.o: $(srcsrc)/sh_checksum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_checksum.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_guid.o: $(srcsrc)/sh_guid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h 
-sh_dbIO.o: $(srcsrc)/sh_dbIO.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_sig.h $(srcinc)/sh_tiger.h $(srcinc)/sh_xfer.h $(srcinc)/sh_pthread.h $(srcinc)/sh_socket.h $(srcinc)/sh_files.h $(srcinc)/zAVLTree.h 
-sh_dbCheck.o: $(srcsrc)/sh_dbCheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h 
-sh_dbCreate.o: $(srcsrc)/sh_dbCreate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h $(srcinc)/sh_guid.h 
-sh_subuid.o: $(srcsrc)/sh_subuid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h 
-t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 
+sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h 
+sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
Index: trunk/README
===================================================================
--- trunk/README	(revision 591)
+++ trunk/README	(revision 1)
@@ -84,4 +84,16 @@
 	see the MANUAL.
 
+
+	WARNING:
+	------- 
+	Some versions of gcc have a bug that generates incorrect 
+	code if strength reducing is enabled. 
+	If you modify the compiler flags, always use the -fno-strength-reduce 
+	option with gcc, unless you are sure that your compiler does not
+	suffer from the problem (see README.gcc_bug).
+	Also, some gcc versions generate incorrect code unless the
+	-fno-omit-frame-pointer option is used. 
+	The -fno-strength-reduce and the -fno-omit-frame-pointer options are 
+	enabled by default by the 'configure' script.
 
 PGP SIGNATURES:
Index: trunk/acconfig.h
===================================================================
--- trunk/acconfig.h	(revision 1)
+++ trunk/acconfig.h	(revision 1)
@@ -0,0 +1,433 @@
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+
+@TOP@
+
+/* ---- compile options        ------------   */
+
+/* Define if you want database support        */
+#undef WITH_DATABASE
+
+/* Define if the database is unixODBC         */
+#undef WITH_ODBC
+
+/* Define if the database is oracle           */
+#undef WITH_ORACLE
+
+/* Define if the database is mysql            */
+#undef WITH_MYSQL
+
+/* Define if the database is postgresql       */
+#undef WITH_POSTGRES
+
+/* Define if the server may listen on 514/udp */
+#undef INET_SYSLOG
+
+/* Define if you want logfile in XML format   */
+#undef SH_USE_XML
+
+/* Define if you want external programs.      */
+#undef WITH_EXTERNAL
+
+/* Define if you want to reload the database  */
+/* on SIGHUP.                                 */
+#undef RELOAD_DATABASE
+
+/* Define if you want SysV message queue.     */
+#undef WITH_MESSAGE_QUEUE
+
+/* Define the mode of the message queue.      */
+#undef MESSAGE_QUEUE_MODE
+
+/* Define which users are always trusted.     */
+/* default = 0 ( = root)                      */
+#undef SL_ALWAYS_TRUSTED
+
+/* Define if you want network time.           */
+/* default = no                               */
+#undef HAVE_NTIME
+
+/* The time server host address.              */
+/* default = "NULL"                           */
+#undef DEFAULT_TIMESERVER
+#undef ALT_TIMESERVER
+
+/* Define if you want to use the mail code.   */
+/* default = yes                              */
+#undef  SH_WITH_MAIL
+
+/* Define if you want client/server encryption*/
+#undef  SH_ENCRYPT
+
+/* Define if you want version 2 encryption    */
+#undef  SH_ENCRYPT_2
+
+/* Define if you want to watch for login/-out.*/
+/* default = no                               */
+#undef  SH_USE_UTMP
+
+/* Define if you want to check mount options on filesystems */
+/* default = no                               */
+#undef SH_USE_MOUNTS
+
+/* Define if you want to keep an eye on       */
+/* sensitive files that your users own        */
+#undef SH_USE_USERFILES
+
+/* Define if you want to watch for suid/sgid  */
+/* files                                      */
+#undef  SH_USE_SUIDCHK
+
+/* Define if you want to check kernel syscall */
+/* table to detect LKM rootkits.              */
+/* default = no                               */
+#undef  SH_USE_KERN
+
+/* Define if you want to use the Kernel       */
+/* module to hide samhain.                    */
+#undef  SH_USE_LKM
+
+/* Define if you have a vanilla  Kernel       */
+/* (2.4 or 2.2)                               */
+#undef  SH_VANILLA_KERNEL
+
+/* Define to the name of the MAGIC_HIDE       */
+/* string if you use the Kernel module to     */
+/* hide samhain.                              */
+#undef  SH_MAGIC_HIDE
+
+/* Define if you want 'micro' stealth mode.   */
+/* default = no                               */
+#undef SH_STEALTH_MICRO
+
+/* Define if you want to use stealth mode.    */
+/* default = no                               */
+#undef SH_STEALTH
+
+/* Define if you want stealth w/o CL parsing. */
+/* default = no                               */
+#undef SH_STEALTH_NOCL
+
+/* The magic argv[1] to re-enable CL parsing. */
+/* default = "yes"                            */
+#undef NOCL_CODE
+
+/* XOR value to hide literal strings.         */
+/* default = 0                                */
+#undef XOR_CODE
+
+/* The port number for TCP/IP connection.     */
+/* default = 49777                            */
+#undef SH_DEFAULT_PORT
+
+/* The identity to assume when dropping root  */
+/* default = "nobody"                         */
+#undef DEFAULT_IDENT
+
+/* Directory for tmp files                    */
+#undef SH_TMPDIR
+
+/* The data root directory.                   */
+/* default="/var/lib/samhain"                 */
+#undef DEFAULT_DATAROOT
+
+/* The quarantine directory.                  */
+/* default="/var/lib/samhain/.quarantine      */
+#undef DEFAULT_QDIR
+
+/* The location of the log file.              */
+/* default="/var/log/samhain_log"             */
+#undef DEFAULT_ERRFILE
+
+/* The directory of the log file.             */
+/* default="/var/log"                         */
+#undef DEFAULT_LOGDIR
+
+/* The location of the pid file.              */
+/* default="/var/run/samhain.pid"             */
+#undef DEFAULT_ERRLOCK
+
+/* The location of the pid file directory.    */
+/* default="/var/run            "             */
+#undef DEFAULT_PIDDIR
+
+/* The location of the configuration file.    */ 
+/* default="/etc/samhainrc"                   */
+#undef DEFAULT_CONFIGFILE
+
+/* The location of the checksum data.         */
+/* default="/var/lib/samhain/samhain_file"    */
+#undef DEFAULT_DATA_FILE
+
+/* The location of the html report.           */
+/* default="/var/log/.samhain.html"           */
+#undef DEFAULT_HTML_FILE
+
+/* The install directory.                     */
+/* default="/usr/local/sbin"                  */
+#undef SH_INSTALL_DIR
+
+/* The install path.                          */
+/* default="/usr/local/sbin/samhain"          */
+#undef SH_INSTALL_PATH
+#undef SH_INSTALL_YULE_PATH
+
+/* The install name.                          */
+/* default="samhain"                          */
+#undef SH_INSTALL_NAME
+
+/* The sender name to use.                    */
+/* default = "daemon"                         */
+#undef  DEFAULT_SENDER 
+
+/* The address to send mail to.               */ 
+/* default = "NULL"                           */
+#undef  DEFAULT_MAILADDRESS 
+#undef  ALT_MAILADDRESS 
+
+/* The log server.                            */ 
+/* default = "NULL"                           */
+#undef  DEFAULT_LOGSERVER 
+#undef  ALT_LOGSERVER 
+
+/* The console.                               */ 
+/* default = "NULL"                           */
+#undef  DEFAULT_CONSOLE 
+#undef  ALT_CONSOLE 
+
+/* The default base for one-time pads.        */ 
+/* default = compile_time,compile_time        */
+#undef  DEFKEY
+
+/* Define if you want more debug options.     */
+/* default = no                               */
+#undef MEM_DEBUG
+
+/* Define if you want more debug output.      */
+/* default = no                               */
+#undef WITH_TPT
+
+/* Define if you want tracing.                */
+/* default = no                               */
+#undef WITH_TRACE
+
+/* Define if you want slib debug.             */
+/* default = no                               */
+#undef SL_DEBUG
+
+/* Define if you want slib to abort on errors.*/
+/* default = no                               */
+#undef SL_FAIL_ON_ERROR
+
+/* Define if you want to use SRP authenticaton*/
+#undef USE_SRP_PROTOCOL
+
+/* Define if you want to use GnuPG to         */
+/* verify database and configuation file.     */
+#undef WITH_GPG
+
+/* The full path to GnuPG                     */
+#undef DEFAULT_GPG_PATH
+
+/* Define if using the gpg/pgp checksum.      */
+#undef HAVE_GPG_CHECKSUM
+
+/* The tiger checksum of the gpg/pgp binary.  */
+#undef GPG_HASH
+
+/* Define if you want to compile in the       */
+/* public key fingerprint.                    */
+#undef USE_FINGERPRINT
+
+/* The public key fingerprint.                */
+#undef SH_GPG_FP
+
+/* Use ptrace - screw up signal handling.     */
+#undef SCREW_IT_UP
+
+/* ---- misc                   ------------   */
+
+/* Define the package name.                   */
+#undef PACKAGE
+
+/* Define the package version.                */
+#undef VERSION
+
+/* Define to the position of the key (1...8). */
+#undef POS_TF
+
+/* Init key for exepack.                      */
+#undef EXEPACK_STATE_0
+#undef EXEPACK_STATE_1
+#undef EXEPACK_STATE_2
+
+/* ---- system-specific options ------------  */
+
+/* Define to the address of sys_call_table */
+#undef SH_SYSCALLTABLE
+
+/* Define to use SVR4 statvfs to get filesystem type.  */
+#undef FSTYPE_STATVFS
+
+/* Define to use SVR3.2 statfs to get filesystem type.  */
+#undef FSTYPE_USG_STATFS
+
+/* Define to use AIX3 statfs to get filesystem type.  */
+#undef FSTYPE_AIX_STATFS
+
+/* Define to use 4.3BSD getmntent to get filesystem type.  */
+#undef FSTYPE_MNTENT
+
+/* Define to use 4.4BSD and OSF1 statfs to get filesystem type.  */
+#undef FSTYPE_STATFS
+
+/* Define to use Ultrix getmnt to get filesystem type.  */
+#undef FSTYPE_GETMNT
+
+/* the basic type to which we can cast a uid
+ */
+#undef UID_CAST
+
+/* for ext2fs flags                           */
+#undef HAVE_EXT2_IOCTLS
+#undef HAVE_STAT_FLAGS
+
+/* obvious                                    */
+#undef HOST_IS_LINUX
+#undef HOST_IS_I86LINUX
+
+/* obvious                                    */
+#undef HOST_IS_CYGWIN
+
+/* obvious                                    */
+#undef HOST_IS_DARWIN
+
+/* obvious                                    */
+#undef HOST_IS_FREEBSD
+
+/* obvious                                    */
+#undef HOST_IS_AIX
+
+/* obvious                                    */
+#undef HOST_IS_SOLARIS
+
+/* obvious                                    */
+#undef HOST_IS_I86SOLARIS
+
+/* obvious                                    */
+#undef HOST_IS_HPUX
+
+/* Define to the name of the random devices.  */
+#undef NAME_OF_DEV_RANDOM
+
+#undef NAME_OF_DEV_URANDOM
+
+/* Define if you have long long.              */
+#undef HAVE_LONG_LONG
+
+/* Define if short is 32 bits.                */
+#undef HAVE_SHORT_32
+
+/* Define if int is 32 bits.                  */
+#undef HAVE_INT_32
+
+/* Define if long is 32 bits.                 */
+#undef HAVE_LONG_32
+
+/* Define if long is 64 bits.                 */
+#undef HAVE_LONG_64
+
+/* Define if UINT64 is 32 bits.                 */
+#undef UINT64_IS_32
+
+/* Define if you have utmpx.h.                */
+#undef HAVE_UTMPX_H
+
+/* Define if your struct utmpx has ut_xtime.  */
+#undef HAVE_UTXTIME
+
+/* Define if your struct utmp has ut_type.    */
+#undef HAVE_UTTYPE
+
+/* Define if your struct utmp has ut_host.    */
+#undef HAVE_UTHOST
+
+/* Define if your struct utmp has ut_addr.    */
+#undef HAVE_UTADDR
+
+/* Define if your includes are broken.        */
+#undef HAVE_BROKEN_INCLUDES
+
+/* Define if your getcwd uses 'popen'.        */
+#undef HAVE_BROKEN_GETCWD
+
+/* Define if your vsnprintf is broken.        */
+#undef HAVE_BROKEN_VSNPRINTF
+
+/* Define if you have va_copy.                */
+#undef VA_COPY
+
+/* Define if va_list may be copied as array.  */
+#undef VA_COPY_AS_ARRAY
+
+/* Define if you need unix entropy gatherer.  */
+#undef HAVE_UNIX_RANDOM
+
+/* Define if you have EGD.                    */
+#undef HAVE_EGD_RANDOM
+
+/* Define if you have /dev/random.            */
+#undef HAVE_URANDOM
+
+/* Soket name for EGD.                        */
+#undef EGD_SOCKET_NAME
+
+/* Define if your mlock() is broken.          */
+#undef HAVE_BROKEN_MLOCK
+
+/* Define the proc f_type.                    */
+#undef SH_PROC_MAGIC
+
+/* Define if you have statfs.                 */
+#undef HAVE_STATFS
+
+/* Define if statfs works.                    */
+#undef STATFS_WORKS
+
+/* Define to long if not defined.             */
+#undef ptrdiff_t
+
+@BOTTOM@
+
+/* dont modify this, unless you know what you do
+ */
+#define SRP_GENERATOR_1024      "2"
+#define SRP_MODULUS_1024_1        \
+_("f488fd584e49dbcd20b49de49107366b336c380d451d0f7c88b31c7c5b2d8ef6") 
+#define SRP_MODULUS_1024_2        \
+_("f3c923c043f0a55b188d8ebb558cb85d38d334fd7c175743a31d186cde33212c") 
+#define SRP_MODULUS_1024_3        \
+_("b52aff3ce1b1294018118d7c84a70a72d686c40319c807297aca950cd9969fab")
+#define SRP_MODULUS_1024_4        \
+_("d00a509b0246d3083d66a45d419f9c7cbd894b221926baaba25ec355e92f78c7")
+
+#define SDG_0RETU _("return.\n")
+#define SDG_TERRO _("ERROR: file=<%s>, line=<%d>, reason=<%s>\n")
+#define SDG_AERRO _("ERROR: file=<%s>, line=<%d>, failed_assertion=<%s>\n")
+#define SDG_AFAIL _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n")
+#define SDG_ENTER _("enter=<%s>\n")
+#define SDG_RETUR _("return=<%s>.\n")
+#define SDG_ERROR _("error=<%ld>.\n")
+
+#ifdef SH_STEALTH
+char * globber(const char * string);
+#define _(string) globber(string) 
+#define N_(string) string
+#else
+#define _(string)  string 
+#define N_(string) string
+#endif
+
+#endif
Index: trunk/acinclude.m4
===================================================================
--- trunk/acinclude.m4	(revision 591)
+++ 	(revision )
@@ -1,2106 +1,0 @@
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-# serial 1
-
-
-AC_DEFUN([sh_run_prog],
-[if test "$cross_compiling" = "yes"; then
-   AC_MSG_ERROR([Can not probe non-portable values when cross compiling])
-fi
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-])
-[$1]
-EOF
-if AC_TRY_EVAL(ac_link) && test -s conftest && $2=`(./conftest 2>/dev/null)`
-then
-dnl Don't remove the temporary files here, so they can be examined.
-ifelse([$3], , :, [$3])
-else
-echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-ifelse([$4], , , [  rm -fr conftest*
-  $4
-])
-fi
-rm -fr conftest* ])
-
-dnl fs type number of the proc filing system
-AC_DEFUN([sh_procfs_id],
-[AC_MSG_CHECKING([f_type of /proc])
-AC_CACHE_VAL([sh_cv_proc_fstype],
-[sh_run_prog(
-changequote(<<, >>)dnl
-<<#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifndef Q
-#define __Q(x) #x
-#define Q(x) __Q(x)
-#endif
-int main(void)
-{
-struct statfs fsbuf;
-long ft;
-if (statfs("/", &fsbuf)!=0)
-  exit(1);
-ft=fsbuf.f_type;
-if (statfs("/proc/1", &fsbuf)!=0)
-  exit(1);
-if (ft!=fsbuf.f_type)
-  printf("0x%08lx", fsbuf.f_type);
-else
-  puts("statfs useless");
-exit(0);
-} >>
-changequote([, ]), sh_cv_proc_fstype,, sh_cv_proc_fstype="a fatal error occured")])
-AC_MSG_RESULT($sh_cv_proc_fstype)
-if test "${sh_cv_proc_fstype}" = "a fatal error occured"; then
-  $1=$2
-  $4
-else if test "${sh_cv_proc_fstype}" = "statfs useless"; then
-  $1=$2
-  $4
-else
-  $1=$sh_cv_proc_fstype
-  $3
-fi; fi ])
-
-# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
-# is not called from uid 0 (not tested whether uid 0 works)
-dnl AC_CHECK_MLOCK
-dnl
-define([AC_CHECK_MLOCK],
-  [ AC_CHECK_FUNCS(mlock)
-    if test "$ac_cv_func_mlock" = "yes"; then
-        AC_MSG_CHECKING(whether mlock is broken)
-          AC_CACHE_VAL(ac_cv_have_broken_mlock,
-             AC_RUN_IFELSE([AC_LANG_SOURCE([[
-                #include <stdlib.h>
-                #include <unistd.h>
-                #include <errno.h>
-                #include <sys/mman.h>
-                #include <sys/types.h>
-                #include <fcntl.h>
-
-                int main()
-                {
-                    char *pool;
-                    int err;
-                    long int pgsize = getpagesize();
-
-                    pool = malloc( 4096 + pgsize );
-                    if( !pool )
-                        return 2;
-                    pool += (pgsize - ((long int)pool % pgsize));
-
-                    err = mlock( pool, 4096 );
-                    if( !err || errno == EPERM )
-                        return 0; /* okay */
-
-                    return 1;  /* hmmm */
-                }
-
-            ]])],[ac_cv_have_broken_mlock="no"],[ac_cv_have_broken_mlock="yes"],[ac_cv_have_broken_mlock="assume-no"
-           ])
-         )
-         if test "$ac_cv_have_broken_mlock" = "yes"; then
-             AC_DEFINE([HAVE_BROKEN_MLOCK], [1], [mlock broken])
-             AC_MSG_RESULT(yes)
-         else
-            if test "$ac_cv_have_broken_mlock" = "no"; then
-                AC_MSG_RESULT(no)
-            else
-                AC_MSG_RESULT(assuming no)
-            fi
-         fi
-    fi
-  ])
-
-dnl @synopsis AC_FUNC_VSNPRINTF
-dnl
-dnl Check whether there is a reasonably sane vsnprintf() function installed.
-dnl "Reasonably sane" in this context means never clobbering memory beyond
-dnl the buffer supplied, and having a sensible return value.  It is
-dnl explicitly allowed not to NUL-terminate the return value, however.
-dnl
-dnl @version $Id: ac_func_vsnprintf.m4,v 1.1 2001/07/26 02:00:21 guidod Exp $
-dnl @author Gaute Strokkenes <gs234@cam.ac.uk>
-dnl
-AC_DEFUN([SL_CHECK_VSNPRINTF],
-[AC_CACHE_CHECK(for working vsnprintf,
-  ac_cv_func_vsnprintf,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
-#include <stdarg.h>
-
-int
-doit(char * s, ...)
-{
-  char buffer[32];
-  va_list args;
-  int r;
-
-  buffer[5] = 'X';
-
-  va_start(args, s);
-  r = vsnprintf(buffer, 5, s, args);
-  va_end(args);
-
-  /* -1 is pre-C99, 7 is C99. R.W. 17.01.2003 disallow -1 */
-
-  if (r != 7)
-    exit(1);
-
-  /* We deliberately do not care if the result is NUL-terminated or
-     not, since this is easy to work around like this.  */
-
-  buffer[4] = 0;
-
-  /* Simple sanity check.  */
-
-  if (strcmp(buffer, "1234"))
-    exit(1);
-
-  if (buffer[5] != 'X')
-    exit(1);
-
-  exit(0);
-}
-
-int
-main(void)
-{
-  doit("1234567");
-  exit(1);
-}]])],[ac_cv_func_vsnprintf=yes],[ac_cv_func_vsnprintf=no],[ac_cv_func_vsnprintf=no])])
-dnl Note that the default is to be pessimistic in the case 
-dnl of cross compilation.
-dnl If you know that the target has a sensible vsnprintf(), 
-dnl you can get around this
-dnl by setting ac_func_vsnprintf to yes, as described in the Autoconf manual.
-if test $ac_cv_func_vsnprintf = yes; then
-  :
-else
-  AC_DEFINE([HAVE_BROKEN_VSNPRINTF], [1],
-            [Define if you have a broken version of the `vsnprintf' function.])
-fi
-])# AC_FUNC_VSNPRINTF
-
-dnl SH_CHECK_TYPEDEF(TYPE, HAVE_NAME)
-dnl Check whether a typedef exists and create a #define $2 if it exists
-dnl
-AC_DEFUN([SH_CHECK_TYPEDEF],
-  [ AC_MSG_CHECKING(for $1 typedef)
-    sh_cv_typedef_foo=`echo sh_cv_typedef_$1 | sed -e 's% %_%g'`
-    AC_CACHE_VAL( $sh_cv_typedef_foo,
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdlib.h>
-#include <sys/types.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif]], [[
-    #undef $1
-    int a = sizeof($1);
-    ]])],[sh_cv_typedef=yes],[sh_cv_typedef=no ])])
-    AC_MSG_RESULT($sh_cv_typedef)
-    if test "$sh_cv_typedef" = yes; then
-        AC_DEFINE([$2], [1], [Define if type is defined in stdint.h or inttypes.h])
-	sh_$2=yes
-    else
-	sh_$2=no
-    fi
-  ])
-
-
-
-dnl **********************
-dnl *** va_copy checks ***
-dnl **********************
-AC_DEFUN([SL_CHECK_VA_COPY],
-[AC_MSG_CHECKING(for va_copy())
-AC_CACHE_VAL(sh_cv_va_copy,[
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        va_copy (args2, args1);
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }]])],[sh_cv_va_copy=yes
-        ],[sh_cv_va_copy=no
-        ],[sh_cv_va_copy=no])
-])
-AC_MSG_RESULT($sh_cv_va_copy)
-AC_MSG_CHECKING(for __va_copy())
-AC_CACHE_VAL(sh_cv___va_copy,[
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        __va_copy (args2, args1);
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }]])],[sh_cv___va_copy=yes
-        ],[sh_cv___va_copy=no
-        ],[sh_cv___va_copy=no])
-])
-AC_MSG_RESULT($sh_cv___va_copy)
-AC_MSG_CHECKING(whether va_lists can be copied by value)
-AC_CACHE_VAL(sh_cv_va_val_copy,[
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        args2 = args1;
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }]])],[sh_cv_va_val_copy=yes
-        ],[sh_cv_va_val_copy=no
-        ],[sh_cv_va_val_copy=no])
-])
-if test "x$sh_cv_va_copy" = "xyes"; then
-  AC_DEFINE([VA_COPY], [va_copy], [va_copy type])
-else if test "x$sh_cv___va_copy" = "xyes"; then
-  AC_DEFINE([VA_COPY], [__va_copy], [va_copy type])
-fi
-fi
-if test "x$sh_cv_va_val_copy" = "xno"; then
-  AC_DEFINE([VA_COPY_AS_ARRAY], [1], [va_copy type])
-fi
-AC_MSG_RESULT($sh_cv_va_val_copy)
-])
-
-
-dnl SH_INIT_PARSE_ARGS()
-m4_define([SH_INIT_PARSE_ARGS],
-[
-m4_divert_push([PARSE_ARGS])dnl
-
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[[^_$as_cr_alnum]]%_%g"
-
-as_tr_sh="eval sed 'y%*+%pp%;s%[[^_$as_cr_alnum]]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-AC_SUBST(exec_prefix, NONE)dnl
-no_create=
-no_recursion=
-AC_SUBST(prefix, NONE)dnl
-program_prefix=NONE
-program_suffix=NONE
-AC_SUBST(program_transform_name, [s,x,x,])dnl
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-DESTDIR=
-SH_ENABLE_OPTS="selinux posix-acl asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid"
-SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver signify pubkey-checksum gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-dnl Use braces instead of parens because sh, perl, etc. also accept them.
-sbindir='${exec_prefix}/sbin'
-sysconfdir='${prefix}/etc'
-localstatedir='${prefix}/var'
-mandir='${prefix}/share/man'
-
-AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
-AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
-AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
-AC_SUBST([mandir],         ['${prefix}/share/man'])dnl
-
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  case "$ac_option" in
-changequote(, )dnl
-  *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-changequote([, ])dnl
-  *) ac_optarg= ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case "$ac_option" in
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias="$ac_optarg" ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid feature name: $ac_feature])
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    ac_enable_check_opt=no
-    for f in ${SH_ENABLE_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_feature}"
-	then
-		ac_enable_check_opt=yes
-	fi
-    done
-    if test x${ac_enable_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid feature name: $ac_feature])
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    ac_enable_check_opt=no
-    for f in ${SH_ENABLE_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_feature}"
-	then
-		ac_enable_check_opt=yes
-	fi
-    done
-    if test x${ac_enable_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix 
-    ac_exec_prefix_set="yes"
-    ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" 
-    ac_exec_prefix_set="yes"
-    ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias="$ac_optarg" ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir 
-    ac_localstatedir_set="yes"
-    ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" 
-    ac_localstatedir_set="yes"
-    ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir 
-    ac_mandir_set="yes"
-    ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" 
-    ac_mandir_set="yes"
-    ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix
-    ac_prefix_set="yes" 
-    ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" 
-    ac_prefix_set="yes" 
-    ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir 
-    ac_sbindir_set="yes" 
-    ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" 
-    ac_sbindir_set="yes" 
-    ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi | --b)
-    echo "WARNING: bindir will be ignored, use sbindir" 
-    ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* \
-  | --bi=* | --b=*)
-    echo "WARNING: bindir will be ignored, use sbindir" 
-    ;;
-
-  -datadir | --datadir)
-    echo "WARNING: datadir will be ignored" 
-   ;;
-  -datadir=* | --datadir=*)
-    echo "WARNING: datadir will be ignored" 
-   ;;
- 
-  -includedir | --includedir)
-    echo "WARNING: includedir will be ignored" 
-   ;;
-  -includedir=* | --includedir=*)
-    echo "WARNING: includedir will be ignored" 
-   ;;
-
-  -infodir | --infodir)
-    echo "WARNING: infodir will be ignored" 
-   ;;
-  -infodir=* | --infodir=*)
-    echo "WARNING: infodir will be ignored" 
-   ;;
- 
-  -libdir | --libdir)
-    echo "WARNING: libdir will be ignored" 
-   ;;
-  -libdir=* | --libdir=*)
-    echo "WARNING: libdir will be ignored" 
-   ;;
- 
-  -libexecdir | --libexecdir)
-    echo "WARNING: libexecdir will be ignored" 
-   ;;
-  -libexecdir=* | --libexecdir=*)
-    echo "WARNING: libexecdir will be ignored" 
-   ;;
-
-  -sharedstatedir | --sharedstatedir)
-    echo "WARNING: sharedstatedir will be ignored" 
-   ;;
-  -sharedstatedir=* | --sharedstatedir=*)
-    echo "WARNING: sharedstatedir will be ignored" 
-   ;;
- 
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir 
-    ac_sysconfdir_set="yes" 
-    ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" 
-    ac_sysconfdir_set="yes" 
-    ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias="$ac_optarg" ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers)
-    ac_init_version=: ;;
-
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid package name: $ac_package])
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    ac_with_check_opt=no
-    for f in ${SH_WITH_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_package}"
-	then
-		ac_with_check_opt=yes
-	fi
-    done
-    if test x${ac_with_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid package name: $ac_package])
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    ac_with_check_opt=no
-    for f in ${SH_WITH_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_package}"
-	then
-		ac_with_check_opt=yes
-	fi
-    done
-    if test x${ac_with_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "with_$ac_package=no" ;;
-
-
-  -*) AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid variable name: $ac_envvar])
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    AC_MSG_WARN([you should use --build, --host, --target])
-    expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_WARN([invalid host type: $ac_option])
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
-fi
-
-# Be sure to have absolute paths.
-for ac_var in prefix exec_prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [[\\/$]]* | ?:[[\\/]]* | NONE | '' | OPT | USR ) ;;
-    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in sbindir sysconfdir localstatedir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [[\\/$]]* | ?:[[\\/]]* ) ;;
-    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used.])
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
-
-m4_divert_pop([PARSE_ARGS])dnl
-])# SH_INIT_PARSE_ARGS
-
-m4_define([SH_INIT_HELP],
-[m4_divert_push([HELP_BEGIN])dnl
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures m4_ifset([AC_PACKAGE_STRING],
-                        [AC_PACKAGE_STRING],
-                        [this package]) to adapt to many kinds of systems.
-
-Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
-
-[To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
-  cat <<_ACEOF
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install binaries in \`/usr/local/sbin',
-the config file in \`/etc', manpage in \`/usr/local/share/man', and state
-data in \`/var/lib/INSTALL_NAME' (FSH layout).  You can specify other
-FSH compliant layouts with \`--prefix=OPT' or \`--prefix=USR', or you
-can specify a directory with \`--prefix=DIR' to install in \`DIR/sbin',
-\`DIR/etc', etc.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --mandir=DIR           man documentation [PREFIX/man]
-
-For even finer tuning, paths can be specified for individual files (see below)
-
-_ACEOF
-
-  cat <<\_ACEOF]
-m4_divert_pop([HELP_BEGIN])dnl
-dnl The order of the diversions here is
-dnl - HELP_BEGIN
-dnl   which may be prolongated by extra generic options such as with X or
-dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
-dnl
-dnl - HELP_CANON
-dnl   Support for cross compilation (--build, --host and --target).
-dnl   Display only in long --help.
-dnl
-dnl - HELP_ENABLE
-dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
-dnl   then implements the header of the non generic options.
-dnl
-dnl - HELP_WITH
-dnl
-dnl - HELP_VAR
-dnl
-dnl - HELP_VAR_END
-dnl
-dnl - HELP_END
-dnl   initialized below, in which we dump the trailer (handling of the
-dnl   recursion for instance).
-m4_divert_push([HELP_ENABLE])dnl
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-m4_ifset([AC_PACKAGE_STRING],
-[  case $ac_init_help in
-     short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
-   esac])
-  cat <<\_ACEOF
-m4_divert_pop([HELP_ENABLE])dnl
-m4_divert_push([HELP_END])dnl
-m4_ifset([AC_PACKAGE_BUGREPORT], [
-Report bugs to <AC_PACKAGE_BUGREPORT>.])
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
-    _AC_SRCPATHS(["$ac_dir"])
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      AC_MSG_WARN([no configuration information is in $ac_dir])
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-m4_divert_pop([HELP_END])dnl
-])# SH_INIT_HELP
-
-
-
-
-
-
-
-
-# Check whether sa_sigaction works.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-AC_DEFUN([AM_SA_SIGACTION_WORKS],
-  [
-   am_cv_val_SA_SIGACTION=no
-   AC_CHECK_HEADER(signal.h,
-     [
-      AM_SI_USER
-      AM_SA_SIGINFO
-      if test $am_cv_val_SI_USER = yes && test $am_cv_val_SA_SIGINFO = yes
-      then
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <signal.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-volatile int xnum  = 0;
-volatile int xcode = 0; 
-jmp_buf      Buf;
-int          xsig  = SIGSEGV;
-
-void sighandler (int xsignam, siginfo_t * xsiginfo, void * xsigadd)
-{
-  static sigset_t x;
-
-  if (xsiginfo == NULL)
-    exit(__LINE__);
-  if (xsiginfo->si_signo != xsignam)
-    exit(__LINE__);
-  ++xnum;
-  xcode   = xsiginfo->si_code;
-  sigemptyset (&x);
-  sigprocmask(SIG_SETMASK, &x, NULL);
-  longjmp ( Buf, 1);
-}
-
-int main ()
-{
-  struct sigaction newact;
-
-  newact.sa_sigaction = sighandler;
-  sigemptyset (&newact.sa_mask);
-  newact.sa_flags = SA_SIGINFO;
-  if (0 != sigaction (xsig, &newact, NULL))
-    exit (__LINE__);
-  if(setjmp ( Buf)) {
-      if (xnum > 1)
-	goto Third;
-      goto Second;
-  }
-  memcpy((void *) 0x0, "test", 5);
- Second:
-  if (xcode == SI_USER)
-    exit (__LINE__);
-  raise(xsig);
- Third:
-  if (xcode != SI_USER)
-    exit (__LINE__);
-  if (xnum != 2)
-    exit (__LINE__);
-  return (0);
-}]])],[am_cv_val_SA_SIGACTION=yes],[am_cv_val_SA_SIGACTION=no],[am_cv_val_SA_SIGACTION=no])
-   fi
-      ])
-     AC_MSG_CHECKING([whether sa_sigaction is supported])
-     if test $am_cv_val_SA_SIGACTION = yes
-     then
-       AC_MSG_RESULT(yes)
-       AC_DEFINE([SA_SIGACTION_WORKS], [1], [Define if sa_sigaction works])
-     else
-	AC_MSG_RESULT(no)
-     fi
-     ])
-
-# Check whether SI_USER is available in <signal.h>.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-
-AC_DEFUN([AM_SI_USER],
-  [if test $ac_cv_header_signal_h = yes; then
-    AC_CACHE_CHECK([for SI_USER in signal.h], am_cv_val_SI_USER,
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[return SI_USER]])],[am_cv_val_SI_USER=yes],[am_cv_val_SI_USER=no])])
-    if test $am_cv_val_SI_USER = yes; then
-      AC_DEFINE([HAVE_SI_USER], [1], [Define if you have SI_USER])
-    fi
-  fi])
-
-# Check whether SA_SIGINFO is available in <signal.h>.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-
-AC_DEFUN([AM_SA_SIGINFO],
-  [if test $ac_cv_header_signal_h = yes; then
-    AC_CACHE_CHECK([for SA_SIGINFO in signal.h], am_cv_val_SA_SIGINFO,
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[return SA_SIGINFO]])],[am_cv_val_SA_SIGINFO=yes],[am_cv_val_SA_SIGINFO=no])])
-    if test $am_cv_val_SA_SIGINFO = yes; then
-      AC_DEFINE([HAVE_SA_SIGINFO], [1], [Define if you have SA_SIGINFO])
-    fi
-  fi])
-
-dnl
-dnl Useful macros for autoconf to check for ssp-patched gcc
-dnl 1.0 - September 2003 - Tiago Sousa <mirage@kaotik.org>
-dnl 1.1 - August 2006 - Ted Percival <ted@midg3t.net>
-dnl     * Stricter language checking (C or C++)
-dnl     * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary
-dnl     * Caches all results
-dnl     * Uses macros to ensure correct ouput in quiet/silent mode
-dnl 1.2 - April 2007 - Ted Percival <ted@midg3t.net>
-dnl     * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation
-dnl     * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS
-dnl
-dnl About ssp:
-dnl GCC extension for protecting applications from stack-smashing attacks
-dnl http://www.research.ibm.com/trl/projects/security/ssp/
-dnl
-dnl Usage:
-dnl Most people will simply call GCC_STACK_PROTECTOR.
-dnl If you only use one of C or C++, you can save time by only calling the
-dnl macro appropriate for that language. In that case you should also call
-dnl GCC_STACK_PROTECT_LIB first.
-dnl
-dnl GCC_STACK_PROTECTOR
-dnl Tries to turn on stack protection for C and C++ by calling the following
-dnl three macros with the right languages.
-dnl
-dnl GCC_STACK_PROTECT_CC
-dnl checks -fstack-protector with the C compiler, if it exists then updates
-dnl CFLAGS and defines ENABLE_SSP_CC
-dnl
-dnl GCC_STACK_PROTECT_CXX
-dnl checks -fstack-protector with the C++ compiler, if it exists then updates
-dnl CXXFLAGS and defines ENABLE_SSP_CXX
-dnl
-dnl GCC_STACK_PROTECT_LIB
-dnl adds -lssp to LIBS if it is available
-dnl ssp is usually provided as part of libc, but was previously a separate lib
-dnl It does not hurt to add -lssp even if libc provides SSP - in that case
-dnl libssp will simply be ignored.
-dnl
-
-AC_DEFUN([GCC_STACK_PROTECT_LIB],[
-  AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib,
-    [ssp_old_libs="$LIBS"
-     LIBS="$LIBS -lssp"
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_lib=yes],[ssp_cv_lib=no])
-     LIBS="$ssp_old_libs"
-    ])
-  if test $ssp_cv_lib = yes; then
-    LIBS="$LIBS -lssp"
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECT_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-strong],
-      ssp_cv_cc,
-      [ssp_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -fstack-protector-strong"
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
-       CFLAGS="$ssp_old_cflags"
-      ])
-    if test $ssp_cv_cc = no; then
-      AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
-        ssp_cv_cc,
-        [ssp_old_cflags="$CFLAGS"
-         CFLAGS="$CFLAGS -fstack-protector-all"
-         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
-         CFLAGS="$ssp_old_cflags"
-        ])
-      if test $ssp_cv_cc = no; then
-        AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
-          ssp_cv_cc,
-          [ssp_old_cflags="$CFLAGS"
-           CFLAGS="$CFLAGS -fstack-protector"
-           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
-           CFLAGS="$ssp_old_cflags"
-          ])
-        if test $ssp_cv_cc = yes; then
-          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
-	  LDFLAGS="$LDFLAGS -fstack-protector"
-          AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
-        fi
-      else
-        if test $ssp_cv_cc = yes; then
-          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
-	  LDFLAGS="$LDFLAGS -fstack-protector-all"
-          AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
-        fi
-      fi
-    else
-      if test $ssp_cv_cc = yes; then
-        CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-strong"
-	LDFLAGS="$LDFLAGS -fstack-protector-strong"
-        AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
-      fi
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECT_CXX],[
-  AC_LANG_ASSERT(C++)
-  if test "X$CXX" != "X"; then
-    AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector],
-      ssp_cv_cxx,
-      [ssp_old_cxxflags="$CXXFLAGS"
-       CXXFLAGS="$CXXFLAGS -fstack-protector"
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cxx=yes],[ssp_cv_cxx=no])
-       CXXFLAGS="$ssp_old_cxxflags"
-      ])
-    if test $ssp_cv_cxx = yes; then
-      CXXFLAGS="$CXXFLAGS -fstack-protector"
-      AC_DEFINE([ENABLE_SSP_CXX], [1], [Define if SSP C++ support is enabled.])
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECTOR],[
-  GCC_STACK_PROTECT_LIB
-
-  AC_LANG_PUSH([C])
-  GCC_STACK_PROTECT_CC
-  AC_LANG_POP([C])
-
-  AC_LANG_PUSH([C++])
-  GCC_STACK_PROTECT_CXX
-  AC_LANG_POP([C++])
-])
-
-
-AC_DEFUN([GCC_PIE_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -pie -fPIE],
-      pie_cv_cc,
-      [pie_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -pie -fPIE"
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[pie_cv_cc=yes],[pie_cv_cc=no])
-       CFLAGS="$pie_old_cflags"
-      ])
-    if test $pie_cv_cc = yes; then
-      case "$host_os" in
-      *cygwin*)
-      ;;
-      *)
-      PIE_CFLAGS="-fPIE"
-      PIE_LDFLAGS="-pie"
-      ;;
-      esac
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_CHECK_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -fstack-clash-protection],
-      stackcheck_cv_cc,
-      [stackcheck_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -fstack-clash-protection"
-       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[stackcheck_cv_cc=yes],[stackcheck_cv_cc=no])
-       CFLAGS="$stackcheck_old_cflags"
-      ])
-    if test $stackcheck_cv_cc = yes; then
-      CFLAGS="$CFLAGS -fstack-clash-protection"
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_FLAG_CHECK],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-     AC_MSG_CHECKING([whether ${CC} accepts $1])
-     saved_cflags="$CFLAGS"
-     # any -Wno- option will always succeed :-(
-     flag_check_opt=`echo $1 | sed 's,-Wno-,-W,'`
-     CFLAGS="$CFLAGS -Werror $flag_check_opt"
-     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[flag_check_cv=yes],[flag_check_cv=no])
-     CFLAGS="$saved_cflags"
-     if test $flag_check_cv = yes; then
-      	CFLAGS="$CFLAGS $1"
-	AC_MSG_RESULT([yes])
-     else
-        AC_MSG_RESULT([no])
-     fi
-  fi
-])
-
-AC_DEFUN([SAMHAIN_POSIX],[
-	AC_MSG_CHECKING([whether _POSIX_SOURCE is necessary])
-	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
-void fileno(int);int fdopen(int, char *); ]], [[]])],[
-	AC_MSG_RESULT(yes)
-	AC_DEFINE([_POSIX_SOURCE], [1], [Define if POSIX functions are required])
-	],[AC_MSG_RESULT(no)])
-])dnl
-
-dnl checks for a known 64 bit programming environment
-dnl AC_RUN_IFELSE(PROGRAM,
-dnl               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
-dnl               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
-dnl
-AC_DEFUN([SAMHAIN_PRG_ENV],[
-    AC_MSG_CHECKING([for a known 64 bit programming environment])
-    # Compile and run a program that determines the programming environment
-    AC_RUN_IFELSE([
-      AC_LANG_SOURCE([[
-#include <stdio.h>
-int main(int argc,char **argv)
-{
-  if (argc > 1) {
-#if defined(__arch64__)
-  printf("__arch64__\n");
-#elif defined(__ia64__)
-  printf("__ia64__\n");
-#elif defined(__x86_64__)
-  printf("__x86_64__\n");
-#elif defined(__LP64__)
-  printf("__LP64__\n");
-#elif defined(__64BIT__)
-  printf("__64BIT__\n");
-#elif defined(_LP64)
-  printf("_LP64\n");
-#elif defined(_M_IA64)
-  printf("_M_IA64\n");
-#elif defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64)
-  printf("_MIPS_64\n");
-#else
-choke me
-#endif
-  }
-  return 0;
-}
-      ]])
-    ],[
-      # Program compiled and ran, so get version by adding argument.
-      samhain_prg_ENV=`./conftest$ac_exeext x`
-      samhain_64=yes
-      AC_MSG_RESULT([$samhain_prg_ENV])
-    ],[
-      AC_MSG_RESULT([none])
-	],[
-      AC_MSG_RESULT([none])
-	])
-])dnl
-
-AC_DEFUN([SAMHAIN_X86_64],[
-	AC_MSG_CHECKING([for x86_64])
-	AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main() {
-__asm__ volatile (
-"movq %rax, %rax"
-);
-return 0;
-}
-	]])],[
-	AC_MSG_RESULT(yes)
-	samhain_64=yes
-	tiger_src=sh_tiger1_64.c
-	samhain_64_asm=yes
-	],[
-	AC_MSG_RESULT([no])
-	],[
-	AC_MSG_RESULT([no])
-	])
-])dnl
-
-
-AC_DEFUN([SAMHAIN_64],[
-samhain_64=no
-tiger_src=sh_tiger1.c
-samhain_64_asm=no
-#
-# if sizeof(unsigned long) = 4, try compiler macros for 64bit
-#
-if test "x$ac_cv_sizeof_unsigned_long" = x4; then
-  if test "x$ac_cv_sizeof_unsigned_long_long" = x8; then
-	SAMHAIN_PRG_ENV
-	if test "x$samhain_64" = xyes; then
-	  tiger_src=sh_tiger1_64.c
-        fi
-	#
-	# if GCC and __i386__, use precompiled assembler
-	#
-	if test "x$GCC" = xyes; then
-	  AC_MSG_CHECKING([for non-apple non-cygwin i386])
-	  samhain_i386=no
-          $CC -E -dM - < /dev/null | egrep '__i386__' >/dev/null 2>&1 
-          if test $? = 0; then
-	    case "$host_os" in
-	    	 *linux*)
-            	 # apples gcc does not understand the assembly we provide
-            	 $CC -E -dM - < /dev/null | egrep '(__sun__|__APPLE__|__CYGWIN__)' >/dev/null 2>&1 || samhain_i386=yes
-	    	 ;;
-	    	 *)
-	    	 ;;
-	    esac
-          fi
-	  AC_MSG_RESULT([$samhain_i386])
-	  if test "x$samhain_i386" = xyes; then
-	    GCC_PIE_CC
-	    if test $pie_cv_cc = yes; then
-	       tiger_src=sh_tiger1.s
-	       AC_DEFINE([TIGER_32_BIT_S], [1], [Define to use tiger 32 bit i386 assembler])
-	    fi
-          fi
-	fi
-	#
-	#
-	#
-  else
-	samhain_64=no
-	tiger_src=sh_tiger1.c
-  fi
-else
-  #
-  # sizeof(unsigned long) = 8
-  #
-  tiger_src=sh_tiger1_64.c
-  samhain_64=yes
-  #
-  # check for x86_64 (enables assembly optimizations)
-  #
-  if test "x$GCC" = xyes; then
-     $CC -E -dM - < /dev/null | egrep '__clang__' >/dev/null 2>&1 
-     if ! test $? = 0; then
-     	 case "$host_os" in
-     	     *linux*)
-    	     SAMHAIN_X86_64
-	     ;;
-     	     *bsd*)
-    	     SAMHAIN_X86_64
-	     ;;
-     	     *)
-    	     SAMHAIN_X86_64
-	     ;;
-      	 esac
-     fi	
-  fi
-fi
-if test "x$samhain_64" = xyes; then 
-	AC_DEFINE([TIGER_64_BIT], [1], [Define to use tiger 64 bit implementation])
-fi
-AC_MSG_CHECKING([for 64 bit environment])
-AC_MSG_RESULT([$samhain_64])
-AC_MSG_CHECKING([for tiger source to use])
-AC_MSG_RESULT([$tiger_src])
-AC_SUBST(tiger_src)
-])dnl
-
-AC_DEFUN([sh_CHECK_POSIX_ACL],
-[
-  AC_CHECK_HEADERS(sys/acl.h)
-  if test $ac_cv_header_sys_acl_h = yes; then
-
-  	AC_CHECK_LIB([acl], [acl_get_file], sh_lacl=yes, sh_lacl=no)
-  	if test x"$sh_lacl" = xyes; then
-    		LIBACL=-lacl
-  	else
-    		LIBACL=
-  	fi
-
-  	OLDLIBS="$LIBS"
-  	LIBS="$LIBS $LIBACL"
-  	AC_CHECK_FUNCS([acl_free acl_get_file acl_get_fd],
-                       [sh_facl=yes],[sh_facl=no])
-  	LIBS="$OLDLIBS"
-  fi	
-
-  if test x"$sh_facl" = xyes; then
-  	  AC_DEFINE([USE_ACL], [1], [Define if you want ACL support.])
-	  LIBS="$LIBS $LIBACL"
-  else
-	  if test "x$enable_posix_acl" != xcheck; then
-             AC_MSG_FAILURE([--enable-posix-acl was given, but test for acl support failed])
-          fi
-  fi
-])
-
-AC_DEFUN([sh_CHECK_XATTR],
-[
-  AC_CHECK_HEADERS(attr/xattr.h)
-  if test $ac_cv_header_attr_xattr_h = yes; then
-
-  	AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no)
-  	if test x"$sh_lattr" = xyes; then
-    		LIBATTR=-lattr
-  	else
-    		LIBATTR=
-  	fi
-  
-  	OLDLIBS="$LIBS"
-  	LIBS="$LIBS $LIBATTR"
-  	AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr],
-                       [sh_fattr=yes],[sh_fattr=no])
-  	LIBS="$OLDLIBS"
-  fi
-
-  if test x"$sh_fattr" = xyes; then
-	  AC_DEFINE([USE_XATTR], [1], [Define if you want extended attributes support.])
-	  LIBS="$LIBS $LIBATTR"
-  else
-	  if test "x$enable_selinux" != xcheck; then
-             AC_MSG_FAILURE([--enable-selinux was given, but test for selinux support failed])
-          fi
-  fi
-])
-
-dnl Autoconf macros for libprelude
-dnl $id$
-
-# Modified for LIBPRELUDE -- Yoann Vandoorselaere
-# Modified for LIBGNUTLS -- nmav
-# Configure paths for LIBGCRYPT
-# Shamelessly stolen from the one of XDELTA by Owen Taylor
-# Werner Koch   99-12-09
-
-dnl AM_PATH_LIBPRELUDE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl Test for libprelude, and define LIBPRELUDE_PREFIX, LIBPRELUDE_CFLAGS, LIBPRELUDE_PTHREAD_CFLAGS, 
-dnl LIBPRELUDE_LDFLAGS, and LIBPRELUDE_LIBS
-dnl
-AC_DEFUN([AM_PATH_LIBPRELUDE],
-[dnl
-dnl Get the cflags and libraries from the libprelude-config script
-dnl
-dnl AC_ARG_WITH(libprelude-prefix,
-dnl          [  --with-libprelude-prefix=PFX   Prefix where libprelude is installed (optional)],
-dnl          libprelude_config_prefix="$withval", libprelude_config_prefix="")
-dnl
-dnl  if test x$libprelude_config_prefix != x ; then
-dnl     if test x${LIBPRELUDE_CONFIG+set} != xset ; then
-dnl        LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
-dnl     fi
-dnl  fi
-dnl
-dnl  AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
-  min_libprelude_version=ifelse([$1], ,0.1.0,$1)
-  AC_MSG_CHECKING(for libprelude - version >= $min_libprelude_version)
-  no_libprelude=""
-  if test "$LIBPRELUDE_CONFIG" = "no" ; then
-    no_libprelude=yes
-  else
-    LIBPRELUDE_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --cflags`
-    LIBPRELUDE_PTHREAD_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --pthread-cflags`
-    LIBPRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --ldflags`
-    LIBPRELUDE_LIBS=`$LIBPRELUDE_CONFIG $libprelude_config_args --libs`
-    LIBPRELUDE_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --prefix`
-    LIBPRELUDE_CONFIG_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --config-prefix`
-    libprelude_config_version=`$LIBPRELUDE_CONFIG $libprelude_config_args --version`
-
-
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LDFLAGS="$LDFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
-      LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
-      LIBS="$LIBS $LIBPRELUDE_LIBS"
-dnl
-dnl Now check if the installed libprelude is sufficiently new. Also sanity
-dnl checks the results of libprelude-config to some extent
-dnl
-      rm -f conf.libpreludetest
-      AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libprelude/prelude.h>
-
-int
-main ()
-{
-    system ("touch conf.libpreludetest");
-
-    if( strcmp( prelude_check_version(NULL), "$libprelude_config_version" ) )
-    {
-      printf("\n*** 'libprelude-config --version' returned %s, but LIBPRELUDE (%s)\n",
-             "$libprelude_config_version", prelude_check_version(NULL) );
-      printf("*** was found! If libprelude-config was correct, then it is best\n");
-      printf("*** to remove the old version of LIBPRELUDE. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If libprelude-config was wrong, set the environment variable LIBPRELUDE_CONFIG\n");
-      printf("*** to point to the correct copy of libprelude-config, and remove the file config.cache\n");
-      printf("*** before re-running configure\n");
-    }
-    else if ( strcmp(prelude_check_version(NULL), LIBPRELUDE_VERSION ) )
-    {
-      printf("\n*** LIBPRELUDE header file (version %s) does not match\n", LIBPRELUDE_VERSION);
-      printf("*** library (version %s)\n", prelude_check_version(NULL) );
-    }
-    else
-    {
-      if ( prelude_check_version( "$min_libprelude_version" ) )
-      {
-        return 0;
-      }
-     else
-      {
-        printf("no\n*** An old version of LIBPRELUDE (%s) was found.\n",
-                prelude_check_version(NULL) );
-        printf("*** You need a version of LIBPRELUDE newer than %s. The latest version of\n",
-               "$min_libprelude_version" );
-        printf("*** LIBPRELUDE is always available from http://www.prelude-ids.org/download/releases.\n");
-        printf("*** \n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the libprelude-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LIBPRELUDE, but you can also set the LIBPRELUDE_CONFIG environment to point to the\n");
-        printf("*** correct copy of libprelude-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-]])],[],[no_libprelude=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-       LDFLAGS="$ac_save_LDFLAGS"
-  fi
-
-  if test "x$no_libprelude" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])
-  else
-     if test -f conf.libpreludetest ; then
-        :
-     else
-        AC_MSG_RESULT(no)
-     fi
-     if test "$LIBPRELUDE_CONFIG" = "no" ; then
-       echo "*** The libprelude-config script installed by LIBPRELUDE could not be found"
-       echo "*** If LIBPRELUDE was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the LIBPRELUDE_CONFIG environment variable to the"
-       echo "*** full path to libprelude-config."
-     else
-       if test -f conf.libpreludetest ; then
-        :
-       else
-          echo "*** Could not run libprelude test program, checking why..."
-          CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
-	  LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
-          LIBS="$LIBS $LIBPRELUDE_LIBS"
-          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libprelude/prelude.h>
-]], [[ return !!prelude_check_version(NULL); ]])],[ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LIBPRELUDE or finding the wrong"
-          echo "*** version of LIBPRELUDE. If it is not finding LIBPRELUDE, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-          echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***" ],[ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LIBPRELUDE was incorrectly installed"
-          echo "*** or that you have moved LIBPRELUDE since it was installed. In the latter case, you"
-          echo "*** may want to edit the libprelude-config script: $LIBPRELUDE_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-	  LDFLAGS="$ac_save_LDFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     LIBPRELUDE_CFLAGS=""
-     LIBPRELUDE_LDFLAGS=""
-     LIBPRELUDE_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  rm -f conf.libpreludetest
-  AC_SUBST(LIBPRELUDE_CFLAGS)
-  AC_SUBST(LIBPRELUDE_PTHREAD_CFLAGS)
-  AC_SUBST(LIBPRELUDE_LDFLAGS)
-  AC_SUBST(LIBPRELUDE_LIBS)
-  AC_SUBST(LIBPRELUDE_PREFIX)
-  AC_SUBST(LIBPRELUDE_CONFIG_PREFIX)
-])
-
-
-##### http://autoconf-archive.cryp.to/acx_pthread.html
-#
-# SYNOPSIS
-#
-#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-#   This macro figures out how to build C programs using POSIX threads.
-#   It sets the PTHREAD_LIBS output variable to the threads library and
-#   linker flags, and the PTHREAD_CFLAGS output variable to any special
-#   C compiler flags that are needed. (The user can also force certain
-#   compiler flags/libs to be tested by setting these environment
-#   variables.)
-#
-#   Also sets PTHREAD_CC to any special C compiler that is needed for
-#   multi-threaded programs (defaults to the value of CC otherwise).
-#   (This is necessary on AIX to use the special cc_r compiler alias.)
-#
-#   NOTE: You are assumed to not only compile your program with these
-#   flags, but also link it with them as well. e.g. you should link
-#   with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
-#   $LIBS
-#
-#   If you are only building threads programs, you may wish to use
-#   these variables in your default LIBS, CFLAGS, and CC:
-#
-#          LIBS="$PTHREAD_LIBS $LIBS"
-#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-#          CC="$PTHREAD_CC"
-#
-#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
-#   constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
-#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-#   ACTION-IF-FOUND is a list of shell commands to run if a threads
-#   library is found, and ACTION-IF-NOT-FOUND is a list of commands to
-#   run it if it is not found. If ACTION-IF-FOUND is not specified, the
-#   default action will define HAVE_PTHREAD.
-#
-#   Please let the authors know if this macro fails on any platform, or
-#   if you have any other suggestions or comments. This macro was based
-#   on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
-#   (with help from M. Frigo), as well as ac_pthread and hb_pthread
-#   macros posted by Alejandro Forero Cuervo to the autoconf macro
-#   repository. We are also grateful for the helpful feedback of
-#   numerous users.
-#
-# LAST MODIFICATION
-#
-#   2007-07-29
-#
-# COPYLEFT
-#
-#   Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-#   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 3 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, see
-#   <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright
-#   owner gives unlimited permission to copy, distribute and modify the
-#   configure scripts that are the output of Autoconf when processing
-#   the Macro. You need not follow the terms of the GNU General Public
-#   License when using or distributing such scripts, even though
-#   portions of the text of the Macro appear in them. The GNU General
-#   Public License (GPL) does govern all other use of the material that
-#   constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the
-#   Autoconf Macro released by the Autoconf Macro Archive. When you
-#   make and distribute a modified version of the Autoconf Macro, you
-#   may extend this special exception to the GPL to apply to your
-#   modified version as well.
-
-AC_DEFUN([ACX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG([C])
-acx_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
-        save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-        save_LIBS="$LIBS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test x"$acx_pthread_ok" = xno; then
-                PTHREAD_LIBS=""
-                PTHREAD_CFLAGS=""
-        fi
-        LIBS="$save_LIBS"
-        CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try.  Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important.  Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-#       other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-#      doesn't hurt to check since this sometimes defines pthreads too;
-#      also defines -D_REENTRANT)
-#      ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
-        *solaris*)
-
-        # On Solaris (at least, for some versions), libc contains stubbed
-        # (non-functional) versions of the pthreads routines, so link-based
-        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
-        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
-        # a function called by this macro, so we could check for that, but
-        # who knows whether they'll stub that too in a future libc.)  So,
-        # we'll just look for -pthreads and -lpthread first:
-
-        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
-        ;;
-esac
-
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
-
-        case $flag in
-                none)
-                AC_MSG_CHECKING([whether pthreads work without any flags])
-                ;;
-
-                -pthread)
-                AC_MSG_CHECKING([whether pthreads work with $flag])
-                PTHREAD_CFLAGS="$flag"
-                ;;
-
-                -*)
-                AC_MSG_CHECKING([whether pthreads work with $flag])
-                PTHREAD_CFLAGS="$flag"
-                ;;
-
-		pthread-config)
-		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
-		if test x"$acx_pthread_config" = xno; then continue; fi
-		PTHREAD_CFLAGS="`pthread-config --cflags`"
-		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
-		;;
-
-                *)
-                AC_MSG_CHECKING([for the pthreads library -l$flag])
-                PTHREAD_LIBS="-l$flag"
-                ;;
-        esac
-
-        save_LIBS="$LIBS"
-        save_CFLAGS="$CFLAGS"
-        save_LDFLAGS="$LDFLAGS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-        LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
-
-        # Check for various functions.  We must include pthread.h,
-        # since some functions may be macros.  (On the Sequent, we
-        # need a special flag -Kthread to make this header compile.)
-        # We check for pthread_join because it is in -lpthread on IRIX
-        # while pthread_create is in libc.  We check for pthread_attr_init
-        # due to DEC craziness with -lpthreads.  We check for
-        # pthread_cleanup_push because it is one of the few pthread
-        # functions on Solaris that doesn't have a non-functional libc stub.
-        # We try pthread_create on general principles.
-        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t th; pthread_join(th, 0);
-                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ]])],[acx_pthread_ok=yes],[])
-
-        LIBS="$save_LIBS"
-        LDFLAGS="$save_LDFLAGS"
-        CFLAGS="$save_CFLAGS"
-
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test "x$acx_pthread_ok" = xyes; then
-                break;
-        fi
-
-        PTHREAD_LIBS=""
-        PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
-        save_LIBS="$LIBS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
-        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
-	AC_MSG_CHECKING([for joinable pthread attribute])
-	attr_name=unknown
-	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
-	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[int attr=$attr; return attr;]])],[attr_name=$attr; break],[])
-	done
-        AC_MSG_RESULT($attr_name)
-        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-            AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [${attr_name}],
-                               [Define to necessary symbol if this constant
-                                uses a non-standard name on your system.])
-        fi
-
-	# Solaris lossage: default is obsolete semantics for getpwnam_r,
-	# getpwuid_r, getgrgid_r, unless _POSIX_PTHREAD_SEMANTICS is defined
-        AC_MSG_CHECKING([if more special flags are required for pthreads])
-        flag=no
-        case "${host_cpu}-${host_os}" in
-            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
-            *-osf* | *-hpux*) flag="-D_REENTRANT";;
-	    *solaris*) flag="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
-        esac
-        AC_MSG_RESULT(${flag})
-        if test "x$flag" != xno; then
-            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
-        fi
-
-        # Detect PTHREAD_MUTEX_RECURSIVE
-	AC_MSG_CHECKING([for recursive mutexes])
-	mutex_recursive=no
-	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#define _XOPEN_SOURCE 500
-#include <pthread.h>]], [[
-pthread_mutexattr_t   mta;
-pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
-return 0;]])],[mutex_recursive=yes],[])
-	if test "x$mutex_recursive" = "xyes"
-	then
-	  AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if you have recursive mutexes.])
-	fi
-        AC_MSG_RESULT($mutex_recursive)
-
-        LIBS="$save_LIBS"
-        CFLAGS="$save_CFLAGS"
-
-        # More AIX lossage: must compile with xlc_r or cc_r
-	if test x"$GCC" != xyes; then
-          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
-        else
-          PTHREAD_CC=$CC
-	fi
-else
-        PTHREAD_CC="$CC"
-fi
-
-if test x"$acx_pthread_ok" = xyes; then
-   PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DUSE_MALLOC_LOCK=1"
-fi
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_LDFLAGS)
-AC_SUBST(PTHREAD_CC)
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
-        ifelse([$1],,AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.]),[$1])
-        :
-else
-        acx_pthread_ok=no
-        $2
-fi
-AC_LANG_RESTORE
-])dnl ACX_PTHREAD
-
-
-
-
-dnl Copyright Â© 2004 Loic Dachary <loic@senga.org>
-dnl
-dnl This program is free software; you can redistribute it and/or modify 
-dnl it under the terms of the GNU General Public License as published by 
-dnl the Free Software Foundation; either version 2 of the License, or (at 
-dnl your option) any later version.
-dnl
-dnl Use ZLIB_HOME instead of option
-
-AC_DEFUN([CHECK_ZLIB],[
-
-if test "x${ZLIB_HOME}" = "x"; then 
-	ZLIB_HOME=/usr/local
-	if test ! -f "${ZLIB_HOME}/include/zlib.h"
-	then
-        	ZLIB_HOME=/usr
-	fi
-fi
-
-zlib_found=no
-
-ZLIB_OLD_LDFLAGS=$LDFLAGS
-ZLIB_OLD_CPPFLAGS=$LDFLAGS
-if test "x${ZLIB_HOME}" = "x/usr"; then
-	:
-else
-	LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
-	CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
-fi
-AC_LANG_SAVE
-AC_LANG([C])
-AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
-AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
-AC_LANG_RESTORE
-if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
-then
-        #
-        # If both library and header were found, use them
-        #
-        AC_CHECK_LIB(z, inflateEnd)
-        AC_MSG_CHECKING([zlib in ${ZLIB_HOME}])
-        AC_MSG_RESULT(ok)
-	AC_CHECK_FUNCS([compressBound])
-	zlib_found=yes
-else
-        #
-        # If either header or library was not found, revert and bomb
-        #
-        AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
-        LDFLAGS="$ZLIB_OLD_LDFLAGS"
-        CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
-        AC_MSG_RESULT(failed)
-        AC_MSG_WARN([zlib not found in ZLIB_HOME, /usr/local, or /usr])
-fi
-
-])
-
-# SH_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([SH_PROG_LD],
-[
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-else
-  AC_MSG_CHECKING([for ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-        with_gnu_ld=yes
-        ;;
-      *)
-        with_gnu_ld=no
-        ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-# SH_STRFTIME_Z
-# -------------
-# check whether strftime supports %z
-AC_DEFUN([SH_STRFTIME_Z],
-[
-AC_MSG_CHECKING([whether strftime supports %z])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <time.h>
-#include <string.h>
-int main()
-{
-   struct tm tm;
-   char tt[64];
-   memset(&tm, 0, sizeof(tm));
-   strftime(tt, sizeof(tt), "%z", &tm);
-
-   if (strlen(tt) != 5) return 1;
-   return 0;
-}
-]])],[
-AC_MSG_RESULT([yes])
-AC_DEFINE([HAVE_STRFTIME_Z], [1], [strftime supports %z])
-],[
-AC_MSG_RESULT([no])
-],[
-AC_MSG_RESULT([no])
-])])
-
-AC_DEFUN([SH_GCC_VERSION], [
-  GCC_VERSION=""
-  gcc_VERSION_MAJOR=0
-  gcc_VERSION_MINOR=0
-  AC_MSG_CHECKING([for gcc version])
-  if test "x$GCC" = "xyes"
-  then
-	$CC -dumpversion >/dev/null 2>&1
-	if test $? -eq 0
-	then
-		GCC_VERSION=`$CC -dumpversion`
-      		gcc_VERSION_MAJOR=`echo $GCC_VERSION | cut -d'.' -f1`
-      		gcc_VERSION_MINOR=`echo $GCC_VERSION | cut -d'.' -f2`
-      		AC_DEFINE_UNQUOTED([GCC_VERSION_MAJOR], [${gcc_VERSION_MAJOR}], [gcc version major])
-      		AC_DEFINE_UNQUOTED([GCC_VERSION_MINOR], [${gcc_VERSION_MINOR}], [gcc version minor])
-		AC_MSG_RESULT([$GCC_VERSION])
-	else
-		AC_MSG_RESULT([$CC -dumpversion working])
-	fi
-  else
-	AC_MSG_RESULT([compiler is not gcc])
-  fi
-])
-
-
-
-dnl *-*wedit:notab*-*  Please keep this as the last line.
-
Index: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	(revision 1)
+++ trunk/aclocal.m4	(revision 1)
@@ -0,0 +1,1380 @@
+dnl aclocal.m4 generated automatically by aclocal 1.3
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+
+# serial 1
+
+#
+# Check to make sure that the build environment is sane.
+#
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[
+AC_REQUIRE([AM_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+
+# serial 1
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so.  This macro tries various
+# options that select ANSI C on some system or another.  It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+  AC_MSG_RESULT([none needed])
+else
+  AC_MSG_RESULT($am_cv_prog_cc_stdc)
+fi
+case "x$am_cv_prog_cc_stdc" in
+  x|xno) ;;
+  *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
+
+# Define a conditional.
+
+AC_DEFUN([AM_CONDITIONAL],
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+
+AC_DEFUN([sh_run_prog],
+[if test "$cross_compiling" = "yes"; then
+   AC_MSG_ERROR([Can not probe non-portable values when cross compiling])
+fi
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
+extern "C" void exit(int);
+#endif
+])
+[$1]
+EOF
+if AC_TRY_EVAL(ac_link) && test -s conftest && $2=`(./conftest 2>/dev/null)`
+then
+dnl Don't remove the temporary files here, so they can be examined.
+ifelse([$3], , :, [$3])
+else
+echo "configure: failed program was:" >&AC_FD_CC
+cat conftest.$ac_ext >&AC_FD_CC
+ifelse([$4], , , [  rm -fr conftest*
+  $4
+])
+fi
+rm -fr conftest* ])
+
+dnl fs type number of the proc filing system
+AC_DEFUN([sh_procfs_id],
+[AC_MSG_CHECKING([f_type of /proc])
+AC_CACHE_VAL([sh_cv_proc_fstype],
+[sh_run_prog(
+changequote(<<, >>)dnl
+<<#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifndef Q
+#define __Q(x) #x
+#define Q(x) __Q(x)
+#endif
+int main(void)
+{
+struct statfs fsbuf;
+long ft;
+if (statfs("/", &fsbuf)!=0)
+  exit(1);
+ft=fsbuf.f_type;
+if (statfs("/proc/1", &fsbuf)!=0)
+  exit(1);
+if (ft!=fsbuf.f_type)
+  printf("0x%08lx", fsbuf.f_type);
+else
+  puts("statfs useless");
+exit(0);
+} >>
+changequote([, ]), sh_cv_proc_fstype,, sh_cv_proc_fstype="a fatal error occured")])
+AC_MSG_RESULT($sh_cv_proc_fstype)
+if test "${sh_cv_proc_fstype}" = "a fatal error occured"; then
+  $1=$2
+  $4
+else if test "${sh_cv_proc_fstype}" = "statfs useless"; then
+  $1=$2
+  $4
+else
+  $1=$sh_cv_proc_fstype
+  $3
+fi; fi ])
+
+# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
+# is not called from uid 0 (not tested whether uid 0 works)
+dnl AC_CHECK_MLOCK
+dnl
+define([AC_CHECK_MLOCK],
+  [ AC_CHECK_FUNCS(mlock)
+    if test "$ac_cv_func_mlock" = "yes"; then
+        AC_MSG_CHECKING(whether mlock is broken)
+          AC_CACHE_VAL(ac_cv_have_broken_mlock,
+             AC_TRY_RUN([
+                #include <stdlib.h>
+                #include <unistd.h>
+                #include <errno.h>
+                #include <sys/mman.h>
+                #include <sys/types.h>
+                #include <fcntl.h>
+
+                int main()
+                {
+                    char *pool;
+                    int err;
+                    long int pgsize = getpagesize();
+
+                    pool = malloc( 4096 + pgsize );
+                    if( !pool )
+                        return 2;
+                    pool += (pgsize - ((long int)pool % pgsize));
+
+                    err = mlock( pool, 4096 );
+                    if( !err || errno == EPERM )
+                        return 0; /* okay */
+
+                    return 1;  /* hmmm */
+                }
+
+            ],
+            ac_cv_have_broken_mlock="no",
+            ac_cv_have_broken_mlock="yes",
+            ac_cv_have_broken_mlock="assume-no"
+           )
+         )
+         if test "$ac_cv_have_broken_mlock" = "yes"; then
+             AC_DEFINE(HAVE_BROKEN_MLOCK)
+             AC_MSG_RESULT(yes)
+         else
+            if test "$ac_cv_have_broken_mlock" = "no"; then
+                AC_MSG_RESULT(no)
+            else
+                AC_MSG_RESULT(assuming no)
+            fi
+         fi
+    fi
+  ])
+
+dnl @synopsis AC_FUNC_VSNPRINTF
+dnl
+dnl Check whether there is a reasonably sane vsnprintf() function installed.
+dnl "Reasonably sane" in this context means never clobbering memory beyond
+dnl the buffer supplied, and having a sensible return value.  It is
+dnl explicitly allowed not to NUL-terminate the return value, however.
+dnl
+dnl @version $Id: ac_func_vsnprintf.m4,v 1.1 2001/07/26 02:00:21 guidod Exp $
+dnl @author Gaute Strokkenes <gs234@cam.ac.uk>
+dnl
+AC_DEFUN([SL_CHECK_VSNPRINTF],
+[AC_CACHE_CHECK(for working vsnprintf,
+  ac_cv_func_vsnprintf,
+[AC_TRY_RUN(
+[#include <stdio.h>
+#include <stdarg.h>
+
+int
+doit(char * s, ...)
+{
+  char buffer[32];
+  va_list args;
+  int r;
+
+  buffer[5] = 'X';
+
+  va_start(args, s);
+  r = vsnprintf(buffer, 5, s, args);
+  va_end(args);
+
+  /* -1 is pre-C99, 7 is C99. R.W. 17.01.2003 disallow -1 */
+
+  if (r != 7)
+    exit(1);
+
+  /* We deliberately do not care if the result is NUL-terminated or
+     not, since this is easy to work around like this.  */
+
+  buffer[4] = 0;
+
+  /* Simple sanity check.  */
+
+  if (strcmp(buffer, "1234"))
+    exit(1);
+
+  if (buffer[5] != 'X')
+    exit(1);
+
+  exit(0);
+}
+
+int
+main(void)
+{
+  doit("1234567");
+  exit(1);
+}], ac_cv_func_vsnprintf=yes, ac_cv_func_vsnprintf=no, ac_cv_func_vsnprintf=no)])
+dnl Note that the default is to be pessimistic in the case 
+dnl of cross compilation.
+dnl If you know that the target has a sensible vsnprintf(), 
+dnl you can get around this
+dnl by setting ac_func_vsnprintf to yes, as described in the Autoconf manual.
+if test $ac_cv_func_vsnprintf = yes; then
+  :
+else
+  AC_DEFINE(HAVE_BROKEN_VSNPRINTF, 1,
+            [Define if you have a broken version of the `vsnprintf' function.])
+fi
+])# AC_FUNC_VSNPRINTF
+
+dnl SH_CHECK_TYPEDEF(TYPE, HAVE_NAME)
+dnl Check whether a typedef exists and create a #define $2 if it exists
+dnl
+AC_DEFUN([SH_CHECK_TYPEDEF],
+  [ AC_MSG_CHECKING(for $1 typedef)
+    sh_cv_typedef_foo=`echo sh_cv_typedef_$1 | sed -e 's% %_%g'`
+    AC_CACHE_VAL( $sh_cv_typedef_foo,
+    [AC_TRY_COMPILE([#include <stdlib.h>
+    #include <sys/types.h>], [
+    #undef $1
+    int a = sizeof($1);
+    ], sh_cv_typedef=yes, sh_cv_typedef=no )])
+    AC_MSG_RESULT($sh_cv_typedef)
+    if test "$sh_cv_typedef" = yes; then
+        AC_DEFINE($2)
+	sh_$2=yes
+    else
+	sh_$2=no
+    fi
+  ])
+
+
+
+dnl **********************
+dnl *** va_copy checks ***
+dnl **********************
+AC_DEFUN([SL_CHECK_VA_COPY],
+[AC_MSG_CHECKING(for va_copy())
+AC_CACHE_VAL(sh_cv_va_copy,[
+        AC_TRY_RUN([
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        va_copy (args2, args1);
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }],
+        sh_cv_va_copy=yes
+        ,
+        sh_cv_va_copy=no
+        ,
+	sh_cv_va_copy=no)
+])
+AC_MSG_RESULT($sh_cv_va_copy)
+AC_MSG_CHECKING(for __va_copy())
+AC_CACHE_VAL(sh_cv___va_copy,[
+        AC_TRY_RUN([
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        __va_copy (args2, args1);
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }],
+        sh_cv___va_copy=yes
+        ,
+        sh_cv___va_copy=no
+        ,
+	sh_cv___va_copy=no)
+])
+AC_MSG_RESULT($sh_cv___va_copy)
+AC_MSG_CHECKING(whether va_lists can be copied by value)
+AC_CACHE_VAL(sh_cv_va_val_copy,[
+        AC_TRY_RUN([
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        args2 = args1;
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }],
+        sh_cv_va_val_copy=yes
+        ,
+        sh_cv_va_val_copy=no
+        ,
+	sh_cv_va_val_copy=no)
+])
+if test "x$sh_cv_va_copy" = "xyes"; then
+  AC_DEFINE(VA_COPY, va_copy)
+else if test "x$sh_cv___va_copy" = "xyes"; then
+  AC_DEFINE(VA_COPY, __va_copy)
+fi
+fi
+if test "x$sh_cv_va_val_copy" = "xno"; then
+  AC_DEFINE(VA_COPY_AS_ARRAY)
+fi
+AC_MSG_RESULT($sh_cv_va_val_copy)
+])
+
+
+dnl SH_INIT_PARSE_ARGS()
+m4_define([SH_INIT_PARSE_ARGS],
+[
+m4_divert_push([PARSE_ARGS])dnl
+
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[[^_$as_cr_alnum]]%_%g"
+
+as_tr_sh="eval sed 'y%*+%pp%;s%[[^_$as_cr_alnum]]%_%g'"
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+AC_SUBST(exec_prefix, NONE)dnl
+no_create=
+no_recursion=
+AC_SUBST(prefix, NONE)dnl
+program_prefix=NONE
+program_suffix=NONE
+AC_SUBST(program_transform_name, [s,x,x,])dnl
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+DESTDIR=
+SH_ENABLE_OPTS="db-reload xml-log message-queue login-watch mounts-check userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp"
+SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+dnl Use braces instead of parens because sh, perl, etc. also accept them.
+sbindir='${exec_prefix}/sbin'
+sysconfdir='${prefix}/etc'
+localstatedir='${prefix}/var'
+mandir='${prefix}/share/man'
+
+AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
+AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
+AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
+AC_SUBST([mandir],         ['${prefix}/share/man'])dnl
+
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+changequote(, )dnl
+  *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+changequote([, ])dnl
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid feature name: $ac_feature])
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    ac_enable_check_opt=no
+    for f in ${SH_ENABLE_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_feature}"
+	then
+		ac_enable_check_opt=yes
+	fi
+    done
+    if test x${ac_enable_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid feature name: $ac_feature])
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    ac_enable_check_opt=no
+    for f in ${SH_ENABLE_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_feature}"
+	then
+		ac_enable_check_opt=yes
+	fi
+    done
+    if test x${ac_enable_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix 
+    ac_exec_prefix_set="yes"
+    ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" 
+    ac_exec_prefix_set="yes"
+    ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir 
+    ac_localstatedir_set="yes"
+    ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" 
+    ac_localstatedir_set="yes"
+    ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir 
+    ac_mandir_set="yes"
+    ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" 
+    ac_mandir_set="yes"
+    ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix
+    ac_prefix_set="yes" 
+    ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" 
+    ac_prefix_set="yes" 
+    ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir 
+    ac_sbindir_set="yes" 
+    ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" 
+    ac_sbindir_set="yes" 
+    ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi | --b)
+    echo "WARNING: bindir will be ignored, use sbindir" 
+    ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* \
+  | --bi=* | --b=*)
+    echo "WARNING: bindir will be ignored, use sbindir" 
+    ;;
+
+  -datadir | --datadir)
+    echo "WARNING: datadir will be ignored" 
+   ;;
+  -datadir=* | --datadir=*)
+    echo "WARNING: datadir will be ignored" 
+   ;;
+ 
+  -includedir | --includedir)
+    echo "WARNING: includedir will be ignored" 
+   ;;
+  -includedir=* | --includedir=*)
+    echo "WARNING: includedir will be ignored" 
+   ;;
+
+  -infodir | --infodir)
+    echo "WARNING: infodir will be ignored" 
+   ;;
+  -infodir=* | --infodir=*)
+    echo "WARNING: infodir will be ignored" 
+   ;;
+ 
+  -libdir | --libdir)
+    echo "WARNING: libdir will be ignored" 
+   ;;
+  -libdir=* | --libdir=*)
+    echo "WARNING: libdir will be ignored" 
+   ;;
+ 
+  -libexecdir | --libexecdir)
+    echo "WARNING: libexecdir will be ignored" 
+   ;;
+  -libexecdir=* | --libexecdir=*)
+    echo "WARNING: libexecdir will be ignored" 
+   ;;
+
+  -sharedstatedir | --sharedstatedir)
+    echo "WARNING: sharedstatedir will be ignored" 
+   ;;
+  -sharedstatedir=* | --sharedstatedir=*)
+    echo "WARNING: sharedstatedir will be ignored" 
+   ;;
+ 
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir 
+    ac_sysconfdir_set="yes" 
+    ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" 
+    ac_sysconfdir_set="yes" 
+    ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    ac_init_version=: ;;
+
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid package name: $ac_package])
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    ac_with_check_opt=no
+    for f in ${SH_WITH_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_package}"
+	then
+		ac_with_check_opt=yes
+	fi
+    done
+    if test x${ac_with_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid package name: $ac_package])
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    ac_with_check_opt=no
+    for f in ${SH_WITH_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_package}"
+	then
+		ac_with_check_opt=yes
+	fi
+    done
+    if test x${ac_with_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "with_$ac_package=no" ;;
+
+
+  -*) AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid variable name: $ac_envvar])
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    AC_MSG_WARN([you should use --build, --host, --target])
+    expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_WARN([invalid host type: $ac_option])
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
+fi
+
+# Be sure to have absolute paths.
+for ac_var in prefix exec_prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [[\\/$]]* | ?:[[\\/]]* | NONE | '' | OPT | USR ) ;;
+    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in sbindir sysconfdir localstatedir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [[\\/$]]* | ?:[[\\/]]* ) ;;
+    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used.])
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
+
+m4_divert_pop([PARSE_ARGS])dnl
+])# SH_INIT_PARSE_ARGS
+
+m4_define([SH_INIT_HELP],
+[m4_divert_push([HELP_BEGIN])dnl
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures m4_ifset([AC_PACKAGE_STRING],
+                        [AC_PACKAGE_STRING],
+                        [this package]) to adapt to many kinds of systems.
+
+Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
+
+[To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install binaries in \`/usr/local/sbin',
+the config file in \`/etc', manpage in \`/usr/local/share/man', and state
+data in \`/var/lib/INSTALL_NAME' (FSH layout).  You can specify other
+FSH compliant layouts with \`--prefix=OPT' or \`--prefix=USR', or you
+can specify a directory with \`--prefix=DIR' to install in \`DIR/sbin',
+\`DIR/etc', etc.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --mandir=DIR           man documentation [PREFIX/man]
+
+For even finer tuning, paths can be specified for individual files (see below)
+
+_ACEOF
+
+  cat <<\_ACEOF]
+m4_divert_pop([HELP_BEGIN])dnl
+dnl The order of the diversions here is
+dnl - HELP_BEGIN
+dnl   which may be prolongated by extra generic options such as with X or
+dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
+dnl
+dnl - HELP_CANON
+dnl   Support for cross compilation (--build, --host and --target).
+dnl   Display only in long --help.
+dnl
+dnl - HELP_ENABLE
+dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
+dnl   then implements the header of the non generic options.
+dnl
+dnl - HELP_WITH
+dnl
+dnl - HELP_VAR
+dnl
+dnl - HELP_VAR_END
+dnl
+dnl - HELP_END
+dnl   initialized below, in which we dump the trailer (handling of the
+dnl   recursion for instance).
+m4_divert_push([HELP_ENABLE])dnl
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+m4_ifset([AC_PACKAGE_STRING],
+[  case $ac_init_help in
+     short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
+   esac])
+  cat <<\_ACEOF
+m4_divert_pop([HELP_ENABLE])dnl
+m4_divert_push([HELP_END])dnl
+m4_ifset([AC_PACKAGE_BUGREPORT], [
+Report bugs to <AC_PACKAGE_BUGREPORT>.])
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    _AC_SRCPATHS(["$ac_dir"])
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+           test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      AC_MSG_WARN([no configuration information is in $ac_dir])
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+m4_divert_pop([HELP_END])dnl
+])# SH_INIT_HELP
+
+
+
+
+
+
+
+
+# Check whether sa_sigaction works.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+# serial 1
+
+AC_DEFUN([AM_SA_SIGACTION_WORKS],
+  [
+   am_cv_val_SA_SIGACTION=no
+   AC_CHECK_HEADER(signal.h,
+     [
+      AM_SI_USER
+      AM_SA_SIGINFO
+      if test $am_cv_val_SI_USER = yes && test $am_cv_val_SA_SIGINFO = yes
+      then
+        AC_TRY_RUN([
+#include <signal.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+volatile int xnum  = 0;
+volatile int xcode = 0; 
+jmp_buf      Buf;
+int          xsig  = SIGSEGV;
+
+void sighandler (int xsignam, siginfo_t * xsiginfo, void * xsigadd)
+{
+  static sigset_t x;
+
+  if (xsiginfo == NULL)
+    exit(__LINE__);
+  if (xsiginfo->si_signo != xsignam)
+    exit(__LINE__);
+  ++xnum;
+  xcode   = xsiginfo->si_code;
+  sigemptyset (&x);
+  sigprocmask(SIG_SETMASK, &x, NULL);
+  longjmp ( Buf, 1);
+}
+
+int main ()
+{
+  struct sigaction newact;
+
+  newact.sa_sigaction = sighandler;
+  sigemptyset (&newact.sa_mask);
+  newact.sa_flags = SA_SIGINFO;
+  if (0 != sigaction (xsig, &newact, NULL))
+    exit (__LINE__);
+  if(setjmp ( Buf)) {
+      if (xnum > 1)
+	goto Third;
+      goto Second;
+  }
+  memcpy((void *) 0x0, "test", 5);
+ Second:
+  if (xcode == SI_USER)
+    exit (__LINE__);
+  raise(xsig);
+ Third:
+  if (xcode != SI_USER)
+    exit (__LINE__);
+  if (xnum != 2)
+    exit (__LINE__);
+  return (0);
+}], am_cv_val_SA_SIGACTION=yes, am_cv_val_SA_SIGACTION=no, am_cv_val_SA_SIGACTION=no)
+   fi
+      ])
+     AC_MSG_CHECKING([whether sa_sigaction is supported])
+     if test $am_cv_val_SA_SIGACTION = yes
+     then
+       AC_MSG_RESULT(yes)
+       AC_DEFINE([SA_SIGACTION_WORKS], 1, [Define if sa_sigaction works])
+     else
+	AC_MSG_RESULT(no)
+     fi
+     ])
+
+# Check whether SI_USER is available in <signal.h>.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+# serial 1
+
+
+AC_DEFUN([AM_SI_USER],
+  [if test $ac_cv_header_signal_h = yes; then
+    AC_CACHE_CHECK([for SI_USER in signal.h], am_cv_val_SI_USER,
+      [AC_TRY_LINK([#include <signal.h>], [return SI_USER],
+       am_cv_val_SI_USER=yes, am_cv_val_SI_USER=no)])
+    if test $am_cv_val_SI_USER = yes; then
+      AC_DEFINE([HAVE_SI_USER], 1, [Define if you have SI_USER])
+    fi
+  fi])
+
+# Check whether SA_SIGINFO is available in <signal.h>.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+# serial 1
+
+
+AC_DEFUN([AM_SA_SIGINFO],
+  [if test $ac_cv_header_signal_h = yes; then
+    AC_CACHE_CHECK([for SA_SIGINFO in signal.h], am_cv_val_SA_SIGINFO,
+      [AC_TRY_LINK([#include <signal.h>], [return SA_SIGINFO],
+       am_cv_val_SA_SIGINFO=yes, am_cv_val_SA_SIGINFO=no)])
+    if test $am_cv_val_SA_SIGINFO = yes; then
+      AC_DEFINE([HAVE_SA_SIGINFO], 1, [Define if you have SA_SIGINFO])
+    fi
+  fi])
+
+dnl
+dnl Useful macros for autoconf to check for ssp-patched gcc
+dnl 1.0 - September 2003 - Tiago Sousa <mirage@kaotik.org>
+dnl
+dnl About ssp:
+dnl GCC extension for protecting applications from stack-smashing attacks
+dnl http://www.research.ibm.com/trl/projects/security/ssp/
+dnl
+dnl Usage:
+dnl After calling the correct AC_LANG_*, use the corresponding macro:
+dnl
+dnl GCC_STACK_PROTECT_CC
+dnl checks -fstack-protector with the C compiler, if it exists then updates
+dnl CFLAGS and defines ENABLE_SSP_CC
+dnl
+AC_DEFUN([GCC_STACK_PROTECT_CC],[
+  ssp_cc=yes
+  if test "X$GCC" = "Xyes"; then
+    AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
+    ssp_old_cflags="$CFLAGS"
+    CFLAGS="$CFLAGS -fstack-protector"
+    AC_TRY_COMPILE(,,, ssp_cc=no)
+    # echo $ssp_cc
+    if test "X$ssp_cc" = "Xno"; then
+      CFLAGS="$ssp_old_cflags"
+      AC_MSG_RESULT(no)
+    else
+      AC_MSG_RESULT(yes)
+      AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
+    fi
+  fi
+])
+
+AC_DEFUN([SAMHAIN_POSIX],[
+	AC_MSG_CHECKING([whether _POSIX_SOURCE is necessary])
+	AC_TRY_COMPILE([#include <stdio.h>
+void fileno(int);int fdopen(int, char *); ],,
+	[
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([_POSIX_SOURCE],1,[Define if POSIX functions are required])
+	],
+	[AC_MSG_RESULT(no)])
+])dnl
+
+dnl Autoconf macros for libprelude
+dnl $id$
+
+# Modified for LIBPRELUDE -- Yoann Vandoorselaere
+# Modified for LIBGNUTLS -- nmav
+# Configure paths for LIBGCRYPT
+# Shamelessly stolen from the one of XDELTA by Owen Taylor
+# Werner Koch   99-12-09
+
+dnl AM_PATH_LIBPRELUDE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for libprelude, and define LIBPRELUDE_PREFIX, LIBPRELUDE_CFLAGS, LIBPRELUDE_PTHREAD_CFLAGS, 
+dnl LIBPRELUDE_LDFLAGS, and LIBPRELUDE_LIBS
+dnl
+AC_DEFUN([AM_PATH_LIBPRELUDE],
+[dnl
+dnl Get the cflags and libraries from the libprelude-config script
+dnl
+dnl AC_ARG_WITH(libprelude-prefix,
+dnl          [  --with-libprelude-prefix=PFX   Prefix where libprelude is installed (optional)],
+dnl          libprelude_config_prefix="$withval", libprelude_config_prefix="")
+dnl
+dnl  if test x$libprelude_config_prefix != x ; then
+dnl     if test x${LIBPRELUDE_CONFIG+set} != xset ; then
+dnl        LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
+dnl     fi
+dnl  fi
+dnl
+dnl  AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
+  min_libprelude_version=ifelse([$1], ,0.1.0,$1)
+  AC_MSG_CHECKING(for libprelude - version >= $min_libprelude_version)
+  no_libprelude=""
+  if test "$LIBPRELUDE_CONFIG" = "no" ; then
+    no_libprelude=yes
+  else
+    LIBPRELUDE_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --cflags`
+    LIBPRELUDE_PTHREAD_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --pthread-cflags`
+    LIBPRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --ldflags`
+    LIBPRELUDE_LIBS=`$LIBPRELUDE_CONFIG $libprelude_config_args --libs`
+    LIBPRELUDE_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --prefix`
+    LIBPRELUDE_CONFIG_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --config-prefix`
+    libprelude_config_version=`$LIBPRELUDE_CONFIG $libprelude_config_args --version`
+
+
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LDFLAGS="$LDFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
+      LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
+      LIBS="$LIBS $LIBPRELUDE_LIBS"
+dnl
+dnl Now check if the installed libprelude is sufficiently new. Also sanity
+dnl checks the results of libprelude-config to some extent
+dnl
+      rm -f conf.libpreludetest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libprelude/prelude.h>
+
+int
+main ()
+{
+    system ("touch conf.libpreludetest");
+
+    if( strcmp( prelude_check_version(NULL), "$libprelude_config_version" ) )
+    {
+      printf("\n*** 'libprelude-config --version' returned %s, but LIBPRELUDE (%s)\n",
+             "$libprelude_config_version", prelude_check_version(NULL) );
+      printf("*** was found! If libprelude-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBPRELUDE. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libprelude-config was wrong, set the environment variable LIBPRELUDE_CONFIG\n");
+      printf("*** to point to the correct copy of libprelude-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(prelude_check_version(NULL), LIBPRELUDE_VERSION ) )
+    {
+      printf("\n*** LIBPRELUDE header file (version %s) does not match\n", LIBPRELUDE_VERSION);
+      printf("*** library (version %s)\n", prelude_check_version(NULL) );
+    }
+    else
+    {
+      if ( prelude_check_version( "$min_libprelude_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBPRELUDE (%s) was found.\n",
+                prelude_check_version(NULL) );
+        printf("*** You need a version of LIBPRELUDE newer than %s. The latest version of\n",
+               "$min_libprelude_version" );
+        printf("*** LIBPRELUDE is always available from http://www.prelude-ids.org/download/releases.\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libprelude-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBPRELUDE, but you can also set the LIBPRELUDE_CONFIG environment to point to the\n");
+        printf("*** correct copy of libprelude-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_libprelude=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+       LDFLAGS="$ac_save_LDFLAGS"
+  fi
+
+  if test "x$no_libprelude" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     if test -f conf.libpreludetest ; then
+        :
+     else
+        AC_MSG_RESULT(no)
+     fi
+     if test "$LIBPRELUDE_CONFIG" = "no" ; then
+       echo "*** The libprelude-config script installed by LIBPRELUDE could not be found"
+       echo "*** If LIBPRELUDE was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBPRELUDE_CONFIG environment variable to the"
+       echo "*** full path to libprelude-config."
+     else
+       if test -f conf.libpreludetest ; then
+        :
+       else
+          echo "*** Could not run libprelude test program, checking why..."
+          CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
+	  LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
+          LIBS="$LIBS $LIBPRELUDE_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libprelude/prelude.h>
+],      [ return !!prelude_check_version(NULL); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBPRELUDE or finding the wrong"
+          echo "*** version of LIBPRELUDE. If it is not finding LIBPRELUDE, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBPRELUDE was incorrectly installed"
+          echo "*** or that you have moved LIBPRELUDE since it was installed. In the latter case, you"
+          echo "*** may want to edit the libprelude-config script: $LIBPRELUDE_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+	  LDFLAGS="$ac_save_LDFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBPRELUDE_CFLAGS=""
+     LIBPRELUDE_LDFLAGS=""
+     LIBPRELUDE_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  rm -f conf.libpreludetest
+  AC_SUBST(LIBPRELUDE_CFLAGS)
+  AC_SUBST(LIBPRELUDE_PTHREAD_CFLAGS)
+  AC_SUBST(LIBPRELUDE_LDFLAGS)
+  AC_SUBST(LIBPRELUDE_LIBS)
+  AC_SUBST(LIBPRELUDE_PREFIX)
+  AC_SUBST(LIBPRELUDE_CONFIG_PREFIX)
+])
+
+dnl *-*wedit:notab*-*  Please keep this as the last line.
+
Index: trunk/c_random.sh
===================================================================
--- trunk/c_random.sh	(revision 591)
+++ trunk/c_random.sh	(revision 1)
@@ -16,5 +16,5 @@
   if test -c "/dev/urandom"; then
     dd if=/dev/urandom ibs=1 count=4 > my_random_file 2>/dev/null
-    nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
+    nsum=`sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
     if test x$nsum != x; then
       rnd_tst=yes
@@ -27,5 +27,5 @@
       if test -c "/dev/srandom"; then
         dd if=/dev/srandom ibs=1 count=4 > my_random_file 2>/dev/null
-        nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
+        nsum=`sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
        if test x$nsum != x; then
           rnd_tst=yes
@@ -218,16 +218,15 @@
     fi
 #
-    nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
+    nsum=`sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`
 #
 fi
 
 #
-# 'cksum' is more portable than 'sum', but 32 bit
+# 'sum' is portable, but only 16 bit
 #
 
 /bin/rm -f ./my_random_file 2>/dev/null
 
-final=`expr $nsum \% 65536`
-echo $final
-
-
+echo $nsum
+
+
Index: trunk/compile
===================================================================
--- trunk/compile	(revision 591)
+++ 	(revision )
@@ -1,348 +1,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2018-03-07.03; # UTC
-
-# Copyright (C) 1999-2021 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# 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, 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, see <https://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" ""	$nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
-  file=$1
-  case $file in
-    / | /[!/]*) # absolute file, and not a UNC file
-      if test -z "$file_conv"; then
-	# lazily determine how to convert abs files
-	case `uname -s` in
-	  MINGW*)
-	    file_conv=mingw
-	    ;;
-	  CYGWIN* | MSYS*)
-	    file_conv=cygwin
-	    ;;
-	  *)
-	    file_conv=wine
-	    ;;
-	esac
-      fi
-      case $file_conv/,$2, in
-	*,$file_conv,*)
-	  ;;
-	mingw/*)
-	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
-	  ;;
-	cygwin/* | msys/*)
-	  file=`cygpath -m "$file" || echo "$file"`
-	  ;;
-	wine/*)
-	  file=`winepath -w "$file" || echo "$file"`
-	  ;;
-      esac
-      ;;
-  esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
-  func_file_conv "$1"
-  if test -z "$lib_path"; then
-    lib_path=$file
-  else
-    lib_path="$lib_path;$file"
-  fi
-  linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
-  lib=$1
-  found=no
-  save_IFS=$IFS
-  IFS=';'
-  for dir in $lib_path $LIB
-  do
-    IFS=$save_IFS
-    if $shared && test -f "$dir/$lib.dll.lib"; then
-      found=yes
-      lib=$dir/$lib.dll.lib
-      break
-    fi
-    if test -f "$dir/$lib.lib"; then
-      found=yes
-      lib=$dir/$lib.lib
-      break
-    fi
-    if test -f "$dir/lib$lib.a"; then
-      found=yes
-      lib=$dir/lib$lib.a
-      break
-    fi
-  done
-  IFS=$save_IFS
-
-  if test "$found" != yes; then
-    lib=$lib.lib
-  fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
-  # Assume a capable shell
-  lib_path=
-  shared=:
-  linker_opts=
-  for arg
-  do
-    if test -n "$eat"; then
-      eat=
-    else
-      case $1 in
-	-o)
-	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
-	  eat=1
-	  case $2 in
-	    *.o | *.[oO][bB][jJ])
-	      func_file_conv "$2"
-	      set x "$@" -Fo"$file"
-	      shift
-	      ;;
-	    *)
-	      func_file_conv "$2"
-	      set x "$@" -Fe"$file"
-	      shift
-	      ;;
-	  esac
-	  ;;
-	-I)
-	  eat=1
-	  func_file_conv "$2" mingw
-	  set x "$@" -I"$file"
-	  shift
-	  ;;
-	-I*)
-	  func_file_conv "${1#-I}" mingw
-	  set x "$@" -I"$file"
-	  shift
-	  ;;
-	-l)
-	  eat=1
-	  func_cl_dashl "$2"
-	  set x "$@" "$lib"
-	  shift
-	  ;;
-	-l*)
-	  func_cl_dashl "${1#-l}"
-	  set x "$@" "$lib"
-	  shift
-	  ;;
-	-L)
-	  eat=1
-	  func_cl_dashL "$2"
-	  ;;
-	-L*)
-	  func_cl_dashL "${1#-L}"
-	  ;;
-	-static)
-	  shared=false
-	  ;;
-	-Wl,*)
-	  arg=${1#-Wl,}
-	  save_ifs="$IFS"; IFS=','
-	  for flag in $arg; do
-	    IFS="$save_ifs"
-	    linker_opts="$linker_opts $flag"
-	  done
-	  IFS="$save_ifs"
-	  ;;
-	-Xlinker)
-	  eat=1
-	  linker_opts="$linker_opts $2"
-	  ;;
-	-*)
-	  set x "$@" "$1"
-	  shift
-	  ;;
-	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
-	  func_file_conv "$1"
-	  set x "$@" -Tp"$file"
-	  shift
-	  ;;
-	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
-	  func_file_conv "$1" mingw
-	  set x "$@" "$file"
-	  shift
-	  ;;
-	*)
-	  set x "$@" "$1"
-	  shift
-	  ;;
-      esac
-    fi
-    shift
-  done
-  if test -n "$linker_opts"; then
-    linker_opts="-link$linker_opts"
-  fi
-  exec "$@" $linker_opts
-  exit 1
-}
-
-eat=
-
-case $1 in
-  '')
-     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "compile $scriptversion"
-    exit $?
-    ;;
-  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
-  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
-    func_cl_wrapper "$@"      # Doesn't return...
-    ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
-  if test -n "$eat"; then
-    eat=
-  else
-    case $1 in
-      -o)
-	# configure might choose to run compile as 'compile cc -o foo foo.c'.
-	# So we strip '-o arg' only if arg is an object.
-	eat=1
-	case $2 in
-	  *.o | *.obj)
-	    ofile=$2
-	    ;;
-	  *)
-	    set x "$@" -o "$2"
-	    shift
-	    ;;
-	esac
-	;;
-      *.c)
-	cfile=$1
-	set x "$@" "$1"
-	shift
-	;;
-      *)
-	set x "$@" "$1"
-	shift
-	;;
-    esac
-  fi
-  shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
-  # If no '-o' option was seen then we might have been invoked from a
-  # pattern rule where we don't need one.  That is ok -- this is a
-  # normal compilation that the losing compiler can handle.  If no
-  # '.c' file was seen then we are probably linking.  That is also
-  # ok.
-  exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file.  Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
-  if mkdir "$lockdir" >/dev/null 2>&1; then
-    break
-  fi
-  sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
-  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
-  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC0"
-# time-stamp-end: "; # UTC"
-# End:
Index: trunk/config.guess
===================================================================
--- trunk/config.guess	(revision 591)
+++ trunk/config.guess	(revision 1)
@@ -1,13 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2022 Free Software Foundation, Inc.
-
-# shellcheck disable=SC2006,SC2268 # see below for rationale
-
-timestamp='2022-01-09'
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-10-21'
 
 # This file 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 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
@@ -18,28 +17,22 @@
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <https://www.gnu.org/licenses/>.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program.  This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
-# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
 #
-# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
-#
-# Please send patches to <config-patches@gnu.org>.
-
-
-# The "shellcheck disable" line above the timestamp inhibits complaints
-# about features and limitations of the classic Bourne shell that were
-# superseded or lifted in POSIX.  However, this script identifies a wide
-# variety of pre-POSIX systems that do not have POSIX shells at all, and
-# even some reasonably current systems (Solaris 10 as case-in-point) still
-# have a pre-POSIX /bin/sh.
-
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,5 +43,5 @@
 Output the configuration name of the system \`$me' is run on.
 
-Options:
+Operation modes:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
@@ -61,5 +54,6 @@
 
 Originally written by Per Bothner.
-Copyright 1992-2022 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -73,9 +67,9 @@
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
@@ -95,6 +89,5 @@
 fi
 
-# Just in case it came from the environment.
-GUESS=
+trap 'exit 1' 1 2 15
 
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
@@ -106,40 +99,32 @@
 # use `HOST_CC' if defined, but it is deprecated.
 
-# Portable tmp directory creation inspired by the Autoconf team.
-
-tmp=
-# shellcheck disable=SC2172
-trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
-
-set_cc_for_build() {
-    # prevent multiple calls if $tmp is already set
-    test "$tmp" && return 0
-    : "${TMPDIR=/tmp}"
-    # shellcheck disable=SC2039,SC3028
-    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
-	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
-	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
-	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
-    dummy=$tmp/dummy
-    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
-	,,)    echo "int x;" > "$dummy.c"
-	       for driver in cc gcc c89 c99 ; do
-		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
-		       CC_FOR_BUILD=$driver
-		       break
-		   fi
-	       done
-	       if test x"$CC_FOR_BUILD" = x ; then
-		   CC_FOR_BUILD=no_compiler_found
-	       fi
-	       ;;
-	,,*)   CC_FOR_BUILD=$CC ;;
-	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-    esac
-}
+# This shell variable is my proudest work .. or something. --bje
+
+set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
+(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
+   || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
+dummy=$tmpdir/dummy ;
+files="$dummy.c $dummy.o $dummy.rel $dummy" ;
+trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $files ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ;
+unset files'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if test -f /.attbin/uname ; then
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
@@ -147,52 +132,13 @@
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case $UNAME_SYSTEM in
-Linux|GNU|GNU/*)
-	LIBC=unknown
-
-	set_cc_for_build
-	cat <<-EOF > "$dummy.c"
-	#include <features.h>
-	#if defined(__UCLIBC__)
-	LIBC=uclibc
-	#elif defined(__dietlibc__)
-	LIBC=dietlibc
-	#elif defined(__GLIBC__)
-	LIBC=gnu
-	#else
-	#include <stdarg.h>
-	/* First heuristic to detect musl libc.  */
-	#ifdef __DEFINED_va_list
-	LIBC=musl
-	#endif
-	#endif
-	EOF
-	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
-	eval "$cc_set_libc"
-
-	# Second heuristic to detect musl libc.
-	if [ "$LIBC" = unknown ] &&
-	   command -v ldd >/dev/null &&
-	   ldd --version 2>&1 | grep -q ^musl; then
-		LIBC=musl
-	fi
-
-	# If the system lacks a compiler, then just pick glibc.
-	# We could probably try harder.
-	if [ "$LIBC" = unknown ]; then
-		LIBC=gnu
-	fi
-	;;
-esac
-
 # Note: order is significant - the case branches are not exclusive.
 
-case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
@@ -203,32 +149,21 @@
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
-	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
-	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
-	    echo unknown)`
-	case $UNAME_MACHINE_ARCH in
-	    aarch64eb) machine=aarch64_be-unknown ;;
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
-	    earmv*)
-		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
-		machine=${arch}${endian}-unknown
-		;;
-	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
-	# to ELF recently (or will in the future) and ABI.
-	case $UNAME_MACHINE_ARCH in
-	    earm*)
-		os=netbsdelf
-		;;
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		set_cc_for_build
+		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep -q __ELF__
+			| grep __ELF__ >/dev/null
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
@@ -240,220 +175,178 @@
 		;;
 	    *)
-		os=netbsd
-		;;
-	esac
-	# Determine ABI tags.
-	case $UNAME_MACHINE_ARCH in
-	    earm*)
-		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+	        os=netbsd
 		;;
 	esac
 	# The OS release
-	# Debian GNU/NetBSD machines have a different userland, and
-	# thus, need a distinct triplet. However, they do not need
-	# kernel version information, so it can be replaced with a
-	# suitable tag, in the style of linux-gnu.
-	case $UNAME_VERSION in
-	    Debian*)
-		release='-gnu'
-		;;
-	    *)
-		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
-		;;
-	esac
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	GUESS=$machine-${os}${release}${abi-}
-	;;
-    *:Bitrig:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
-	;;
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
-	;;
-    *:SecBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
-	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
-	;;
-    *:LibertyBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
-	;;
-    *:MidnightBSD:*:*)
-	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
-	;;
-    *:ekkoBSD:*:*)
-	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
-	;;
-    *:SolidBSD:*:*)
-	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
-	;;
-    *:OS108:*:*)
-	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
-	;;
-    macppc:MirBSD:*:*)
-	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
-	;;
-    *:MirBSD:*:*)
-	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
-	;;
-    *:Sortix:*:*)
-	GUESS=$UNAME_MACHINE-unknown-sortix
-	;;
-    *:Twizzler:*:*)
-	GUESS=$UNAME_MACHINE-unknown-twizzler
-	;;
-    *:Redox:*:*)
-	GUESS=$UNAME_MACHINE-unknown-redox
-	;;
-    mips:OSF1:*.*)
-	GUESS=mips-dec-osf1
-	;;
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     alpha:OSF1:*:*)
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	trap '' 0
-	case $UNAME_RELEASE in
-	*4.0)
+	if test $UNAME_RELEASE = "V4.0"; then
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
-	# According to Compaq, /usr/sbin/psrinfo has been available on
-	# OSF/1 and Tru64 systems produced since 1995.  I hope that
-	# covers most systems running today.  This code pipes the CPU
-	# types through head -n 1, so we only detect the type of CPU 0.
-	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case $ALPHA_CPU_TYPE in
-	    "EV4 (21064)")
-		UNAME_MACHINE=alpha ;;
-	    "EV4.5 (21064)")
-		UNAME_MACHINE=alpha ;;
-	    "LCA4 (21066/21068)")
-		UNAME_MACHINE=alpha ;;
-	    "EV5 (21164)")
-		UNAME_MACHINE=alphaev5 ;;
-	    "EV5.6 (21164A)")
-		UNAME_MACHINE=alphaev56 ;;
-	    "EV5.6 (21164PC)")
-		UNAME_MACHINE=alphapca56 ;;
-	    "EV5.7 (21164PC)")
-		UNAME_MACHINE=alphapca57 ;;
-	    "EV6 (21264)")
-		UNAME_MACHINE=alphaev6 ;;
-	    "EV6.7 (21264A)")
-		UNAME_MACHINE=alphaev67 ;;
-	    "EV6.8CB (21264C)")
-		UNAME_MACHINE=alphaev68 ;;
-	    "EV6.8AL (21264B)")
-		UNAME_MACHINE=alphaev68 ;;
-	    "EV6.8CX (21264D)")
-		UNAME_MACHINE=alphaev68 ;;
-	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE=alphaev69 ;;
-	    "EV7 (21364)")
-		UNAME_MACHINE=alphaev7 ;;
-	    "EV7.9 (21364A)")
-		UNAME_MACHINE=alphaev79 ;;
-	esac
-	# A Pn.n version is a patched version.
+	fi
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
-	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
-	;;
+	eval $set_cc_for_build
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
+	.globl main
+	.align 4
+	.ent main
+main:
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
+	.end main
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
+	if test "$?" = 0 ; then
+		case `$dummy` in
+			0-0)
+				UNAME_MACHINE="alpha"
+				;;
+			1-0)
+				UNAME_MACHINE="alphaev5"
+				;;
+			1-1)
+				UNAME_MACHINE="alphaev56"
+				;;
+			1-101)
+				UNAME_MACHINE="alphapca56"
+				;;
+			2-303)
+				UNAME_MACHINE="alphaev6"
+				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
+			3-1307)
+				UNAME_MACHINE="alphaev7"
+				;;
+		esac
+	fi
+	rm -f $dummy.s $dummy && rmdir $tmpdir
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
-	GUESS=m68k-unknown-sysv4
-	;;
+	echo m68k-unknown-sysv4
+	exit 0;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	GUESS=$UNAME_MACHINE-unknown-amigaos
-	;;
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	GUESS=$UNAME_MACHINE-unknown-morphos
-	;;
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
     *:OS/390:*:*)
-	GUESS=i370-ibm-openedition
-	;;
-    *:z/VM:*:*)
-	GUESS=s390-ibm-zvmoe
-	;;
-    *:OS400:*:*)
-	GUESS=powerpc-ibm-os400
-	;;
+	echo i370-ibm-openedition
+	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	GUESS=arm-acorn-riscix$UNAME_RELEASE
-	;;
-    arm*:riscos:*:*|arm*:RISCOS:*:*)
-	GUESS=arm-unknown-riscos
-	;;
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	GUESS=hppa1.1-hitachi-hiuxmpp
-	;;
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	case `(/bin/universe) 2>/dev/null` in
-	    att) GUESS=pyramid-pyramid-sysv3 ;;
-	    *)   GUESS=pyramid-pyramid-bsd   ;;
-	esac
-	;;
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
     NILE*:*:*:dcosx)
-	GUESS=pyramid-pyramid-svr4
-	;;
-    DRS?6000:unix:4.0:6*)
-	GUESS=sparc-icl-nx6
-	;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) GUESS=sparc-icl-nx7 ;;
-	esac
-	;;
-    s390x:SunOS:*:*)
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
-	;;
+	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	esac ;;
     sun4H:SunOS:5.*:*)
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=sparc-hal-solaris2$SUN_REL
-	;;
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=sparc-sun-solaris2$SUN_REL
-	;;
-    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	GUESS=i386-pc-auroraux$UNAME_RELEASE
-	;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	set_cc_for_build
-	SUN_ARCH=i386
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if test "$CC_FOR_BUILD" != no_compiler_found; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH=x86_64
-	    fi
-	fi
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
-	;;
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=sparc-sun-solaris3$SUN_REL
-	;;
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
     sun4*:SunOS:*:*)
-	case `/usr/bin/arch -k` in
+	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
 		UNAME_RELEASE=`uname -v`
@@ -461,25 +354,24 @@
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
-	GUESS=sparc-sun-sunos$SUN_REL
-	;;
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
     sun3*:SunOS:*:*)
-	GUESS=m68k-sun-sunos$UNAME_RELEASE
-	;;
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
-	case `/bin/arch` in
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
 	    sun3)
-		GUESS=m68k-sun-sunos$UNAME_RELEASE
+		echo m68k-sun-sunos${UNAME_RELEASE}
 		;;
 	    sun4)
-		GUESS=sparc-sun-sunos$UNAME_RELEASE
+		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	;;
+	exit 0 ;;
     aushp:SunOS:*:*)
-	GUESS=sparc-auspex-sunos$UNAME_RELEASE
-	;;
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -491,42 +383,39 @@
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	GUESS=m68k-atari-mint$UNAME_RELEASE
-	;;
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	GUESS=m68k-atari-mint$UNAME_RELEASE
-	;;
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	GUESS=m68k-atari-mint$UNAME_RELEASE
-	;;
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	GUESS=m68k-milan-mint$UNAME_RELEASE
-	;;
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	GUESS=m68k-hades-mint$UNAME_RELEASE
-	;;
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	GUESS=m68k-unknown-mint$UNAME_RELEASE
-	;;
-    m68k:machten:*:*)
-	GUESS=m68k-apple-machten$UNAME_RELEASE
-	;;
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
     powerpc:machten:*:*)
-	GUESS=powerpc-apple-machten$UNAME_RELEASE
-	;;
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
     RISC*:Mach:*:*)
-	GUESS=mips-dec-mach_bsd4.3
-	;;
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
     RISC*:ULTRIX:*:*)
-	GUESS=mips-dec-ultrix$UNAME_RELEASE
-	;;
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
     VAX*:ULTRIX*:*:*)
-	GUESS=vax-dec-ultrix$UNAME_RELEASE
-	;;
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	GUESS=clipper-intergraph-clix$UNAME_RELEASE
-	;;
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	set_cc_for_build
-	sed 's/^	//' << EOF > "$dummy.c"
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
@@ -537,11 +426,11 @@
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
 	#endif
 	#endif
@@ -549,82 +438,81 @@
 	}
 EOF
-	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
-	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
-	    { echo "$SYSTEM_NAME"; exit; }
-	GUESS=mips-mips-riscos$UNAME_RELEASE
-	;;
+	$CC_FOR_BUILD -o $dummy $dummy.c \
+	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+	rm -f $dummy.c $dummy && rmdir $tmpdir
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
-	GUESS=powerpc-motorola-powermax
-	;;
+	echo powerpc-motorola-powermax
+	exit 0 ;;
     Motorola:*:4.3:PL8-*)
-	GUESS=powerpc-harris-powermax
-	;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	GUESS=powerpc-harris-powermax
-	;;
+	echo powerpc-harris-powermax
+	exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS)
+	echo powerpc-harris-powermax
+	exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
-	GUESS=powerpc-harris-powerunix
-	;;
+	echo powerpc-harris-powerunix
+	exit 0 ;;
     m88k:CX/UX:7*:*)
-	GUESS=m88k-harris-cxux7
-	;;
+	echo m88k-harris-cxux7
+	exit 0 ;;
     m88k:*:4*:R4*)
-	GUESS=m88k-motorola-sysv4
-	;;
+	echo m88k-motorola-sysv4
+	exit 0 ;;
     m88k:*:3*:R3*)
-	GUESS=m88k-motorola-sysv3
-	;;
+	echo m88k-motorola-sysv3
+	exit 0 ;;
     AViiON:dgux:*:*)
-	# DG/UX returns AViiON for all architectures
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
-	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
-	       test "$TARGET_BINARY_INTERFACE"x = x
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
 	    then
-		GUESS=m88k-dg-dgux$UNAME_RELEASE
+		echo m88k-dg-dgux${UNAME_RELEASE}
 	    else
-		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
 	    fi
 	else
-	    GUESS=i586-dg-dgux$UNAME_RELEASE
-	fi
-	;;
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	GUESS=m88k-dolphin-sysv3
-	;;
+	echo m88k-dolphin-sysv3
+	exit 0 ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
-	GUESS=m88k-motorola-sysv3
-	;;
+	echo m88k-motorola-sysv3
+	exit 0 ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	GUESS=m88k-tektronix-sysv3
-	;;
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	GUESS=m68k-tektronix-bsd
-	;;
+	echo m68k-tektronix-bsd
+	exit 0 ;;
     *:IRIX*:*:*)
-	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
-	GUESS=mips-sgi-irix$IRIX_REL
-	;;
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
-	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
-	GUESS=i386-ibm-aix
-	;;
+	echo i386-ibm-aix
+	exit 0 ;;
     ia64:AIX:*:*)
-	if test -x /usr/bin/oslevel ; then
+	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
-	fi
-	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
-	;;
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		set_cc_for_build
-		sed 's/^		//' << EOF > "$dummy.c"
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
 		#include <sys/systemcfg.h>
 
@@ -637,141 +525,117 @@
 			}
 EOF
-		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
-		then
-			GUESS=$SYSTEM_NAME
-		else
-			GUESS=rs6000-ibm-aix3.2.5
-		fi
+		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+		rm -f $dummy.c $dummy && rmdir $tmpdir
+		echo rs6000-ibm-aix3.2.5
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		GUESS=rs6000-ibm-aix3.2.4
+		echo rs6000-ibm-aix3.2.4
 	else
-		GUESS=rs6000-ibm-aix3.2
-	fi
-	;;
-    *:AIX:*:[4567])
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
 	fi
-	if test -x /usr/bin/lslpp ; then
-		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
-			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
-	fi
-	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
-	;;
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit 0 ;;
     *:AIX:*:*)
-	GUESS=rs6000-ibm-aix
-	;;
-    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
-	GUESS=romp-ibm-bsd4.4
-	;;
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
-	;;                                  # report: romp-ibm BSD 4.3
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
-	GUESS=rs6000-bull-bosx
-	;;
+	echo rs6000-bull-bosx
+	exit 0 ;;
     DPX/2?00:B.O.S.:*:*)
-	GUESS=m68k-bull-sysv3
-	;;
+	echo m68k-bull-sysv3
+	exit 0 ;;
     9000/[34]??:4.3bsd:1.*:*)
-	GUESS=m68k-hp-bsd
-	;;
+	echo m68k-hp-bsd
+	exit 0 ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	GUESS=m68k-hp-bsd4.4
-	;;
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
-	case $UNAME_MACHINE in
-	    9000/31?)            HP_ARCH=m68000 ;;
-	    9000/[34]??)         HP_ARCH=m68k ;;
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
-		if test -x /usr/bin/getconf; then
+		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case $sc_cpu_version in
-		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
-		      532)                      # CPU_PA_RISC2_0
-			case $sc_kernel_bits in
-			  32) HP_ARCH=hppa2.0n ;;
-			  64) HP_ARCH=hppa2.0w ;;
-			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
-			esac ;;
-		    esac
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
 		fi
-		if test "$HP_ARCH" = ""; then
-		    set_cc_for_build
-		    sed 's/^		//' << EOF > "$dummy.c"
-
-		#define _HPUX_SOURCE
-		#include <stdlib.h>
-		#include <unistd.h>
-
-		int main ()
-		{
-		#if defined(_SC_KERNEL_BITS)
-		    long bits = sysconf(_SC_KERNEL_BITS);
-		#endif
-		    long cpu  = sysconf (_SC_CPU_VERSION);
-
-		    switch (cpu)
-			{
-			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-			case CPU_PA_RISC2_0:
-		#if defined(_SC_KERNEL_BITS)
-			    switch (bits)
-				{
-				case 64: puts ("hppa2.0w"); break;
-				case 32: puts ("hppa2.0n"); break;
-				default: puts ("hppa2.0"); break;
-				} break;
-		#else  /* !defined(_SC_KERNEL_BITS) */
-			    puts ("hppa2.0"); break;
-		#endif
-			default: puts ("hppa1.0"); break;
-			}
-		    exit (0);
-		}
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
 EOF
-		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
-		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+		    rm -f $dummy.c $dummy && rmdir $tmpdir
 		fi ;;
 	esac
-	if test "$HP_ARCH" = hppa2.0w
-	then
-	    set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep -q __LP64__
-	    then
-		HP_ARCH=hppa2.0w
-	    else
-		HP_ARCH=hppa64
-	    fi
-	fi
-	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
-	;;
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
-	GUESS=ia64-hp-hpux$HPUX_REV
-	;;
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
     3050*:HI-UX:*:*)
-	set_cc_for_build
-	sed 's/^	//' << EOF > "$dummy.c"
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
 	#include <unistd.h>
 	int
@@ -798,36 +662,36 @@
 	}
 EOF
-	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
-		{ echo "$SYSTEM_NAME"; exit; }
-	GUESS=unknown-hitachi-hiuxwe2
-	;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
-	GUESS=hppa1.1-hp-bsd
-	;;
+	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+	rm -f $dummy.c $dummy && rmdir $tmpdir
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
     9000/8??:4.3bsd:*:*)
-	GUESS=hppa1.0-hp-bsd
-	;;
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	GUESS=hppa1.0-hp-mpeix
-	;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
-	GUESS=hppa1.1-hp-osf
-	;;
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
     hp8??:OSF1:*:*)
-	GUESS=hppa1.0-hp-osf
-	;;
+	echo hppa1.0-hp-osf
+	exit 0 ;;
     i*86:OSF1:*:*)
-	if test -x /usr/sbin/sysversion ; then
-	    GUESS=$UNAME_MACHINE-unknown-osf1mk
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
-	    GUESS=$UNAME_MACHINE-unknown-osf1
-	fi
-	;;
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
     parisc*:Lites*:*:*)
-	GUESS=hppa1.1-hp-lites
-	;;
+	echo hppa1.1-hp-lites
+	exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	GUESS=c1-convex-bsd
-	;;
+	echo c1-convex-bsd
+        exit 0 ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
@@ -835,148 +699,135 @@
 	else echo c2-convex-bsd
 	fi
-	exit ;;
+        exit 0 ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	GUESS=c34-convex-bsd
-	;;
+	echo c34-convex-bsd
+        exit 0 ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	GUESS=c38-convex-bsd
-	;;
+	echo c38-convex-bsd
+        exit 0 ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	GUESS=c4-convex-bsd
-	;;
+	echo c4-convex-bsd
+        exit 0 ;;
     CRAY*Y-MP:*:*:*)
-	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
-	GUESS=ymp-cray-unicos$CRAY_REL
-	;;
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
-	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     CRAY*TS:*:*:*)
-	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
-	GUESS=t90-cray-unicos$CRAY_REL
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*)
+	# Determine whether the default compiler uses glibc.
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#if __GLIBC__ >= 2
+	LIBC=gnu
+	#else
+	LIBC=
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	rm -f $dummy.c && rmdir $tmpdir
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    x86:Interix*:3*)
+	echo i386-pc-interix3
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i386-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	rm -f $dummy.c && rmdir $tmpdir
+	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 	;;
-    CRAY*T3E:*:*:*)
-	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
-	GUESS=alphaev5-cray-unicosmk$CRAY_REL
-	;;
-    CRAY*SV1:*:*:*)
-	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
-	GUESS=sv1-cray-unicos$CRAY_REL
-	;;
-    *:UNICOS/mp:*:*)
-	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
-	GUESS=craynv-cray-unicosmp$CRAY_REL
-	;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
-	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
-	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
-	;;
-    5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
-	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
-	;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
-	;;
-    sparc*:BSD/OS:*:*)
-	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
-	;;
-    *:BSD/OS:*:*)
-	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
-	;;
-    arm:FreeBSD:*:*)
-	UNAME_PROCESSOR=`uname -p`
-	set_cc_for_build
-	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_PCS_VFP
-	then
-	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
-	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
-	else
-	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
-	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
-	fi
-	;;
-    *:FreeBSD:*:*)
-	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case $UNAME_PROCESSOR in
-	    amd64)
-		UNAME_PROCESSOR=x86_64 ;;
-	    i386)
-		UNAME_PROCESSOR=i586 ;;
-	esac
-	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
-	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
-	;;
-    i*:CYGWIN*:*)
-	GUESS=$UNAME_MACHINE-pc-cygwin
-	;;
-    *:MINGW64*:*)
-	GUESS=$UNAME_MACHINE-pc-mingw64
-	;;
-    *:MINGW*:*)
-	GUESS=$UNAME_MACHINE-pc-mingw32
-	;;
-    *:MSYS*:*)
-	GUESS=$UNAME_MACHINE-pc-msys
-	;;
-    i*:PW*:*)
-	GUESS=$UNAME_MACHINE-pc-pw32
-	;;
-    *:SerenityOS:*:*)
-        GUESS=$UNAME_MACHINE-pc-serenity
-        ;;
-    *:Interix*:*)
-	case $UNAME_MACHINE in
-	    x86)
-		GUESS=i586-pc-interix$UNAME_RELEASE
-		;;
-	    authenticamd | genuineintel | EM64T)
-		GUESS=x86_64-unknown-interix$UNAME_RELEASE
-		;;
-	    IA64)
-		GUESS=ia64-unknown-interix$UNAME_RELEASE
-		;;
-	esac ;;
-    i*:UWIN*:*)
-	GUESS=$UNAME_MACHINE-pc-uwin
-	;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	GUESS=x86_64-pc-cygwin
-	;;
-    prep*:SunOS:5.*:*)
-	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
-	GUESS=powerpcle-unknown-solaris2$SUN_REL
-	;;
-    *:GNU:*:*)
-	# the GNU system
-	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
-	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
-	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
-	;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
-	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
-	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
-	;;
-    *:Minix:*:*)
-	GUESS=$UNAME_MACHINE-unknown-minix
-	;;
-    aarch64:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    aarch64_be:Linux:*:*)
-	UNAME_MACHINE=aarch64_be
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
     alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
 	  EV56)  UNAME_MACHINE=alphaev56 ;;
@@ -986,183 +837,85 @@
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    arm*:Linux:*:*)
-	set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	else
-	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
-		| grep -q __ARM_PCS_VFP
-	    then
-		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
-	    else
-		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
-	    fi
-	fi
-	;;
-    avr32*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    cris:Linux:*:*)
-	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
-	;;
-    crisv32:Linux:*:*)
-	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
-	;;
-    e2k:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    frv:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    hexagon:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
     i*86:Linux:*:*)
-	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
-	;;
-    ia64:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    k1om:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    m32r*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    m68*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    mips:Linux:*:* | mips64:Linux:*:*)
-	set_cc_for_build
-	IS_GLIBC=0
-	test x"${LIBC}" = xgnu && IS_GLIBC=1
-	sed 's/^	//' << EOF > "$dummy.c"
-	#undef CPU
-	#undef mips
-	#undef mipsel
-	#undef mips64
-	#undef mips64el
-	#if ${IS_GLIBC} && defined(_ABI64)
-	LIBCABI=gnuabi64
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
 	#else
-	#if ${IS_GLIBC} && defined(_ABIN32)
-	LIBCABI=gnuabin32
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
 	#else
-	LIBCABI=${LIBC}
-	#endif
-	#endif
-
-	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
-	CPU=mipsisa64r6
-	#else
-	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
-	CPU=mipsisa32r6
-	#else
-	#if defined(__mips64)
-	CPU=mips64
-	#else
-	CPU=mips
-	#endif
-	#endif
-	#endif
-
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	MIPS_ENDIAN=el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	MIPS_ENDIAN=
-	#else
-	MIPS_ENDIAN=
+	LIBC=gnuaout
 	#endif
 	#endif
 EOF
-	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
-	eval "$cc_set_vars"
-	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
-	;;
-    mips64el:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    openrisc*:Linux:*:*)
-	GUESS=or1k-unknown-linux-$LIBC
-	;;
-    or32:Linux:*:* | or1k*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    padre:Linux:*:*)
-	GUESS=sparc-unknown-linux-$LIBC
-	;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	GUESS=hppa64-unknown-linux-$LIBC
-	;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-	# Look for CPU level
-	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
-	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
-	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
-	esac
-	;;
-    ppc64:Linux:*:*)
-	GUESS=powerpc64-unknown-linux-$LIBC
-	;;
-    ppc:Linux:*:*)
-	GUESS=powerpc-unknown-linux-$LIBC
-	;;
-    ppc64le:Linux:*:*)
-	GUESS=powerpc64le-unknown-linux-$LIBC
-	;;
-    ppcle:Linux:*:*)
-	GUESS=powerpcle-unknown-linux-$LIBC
-	;;
-    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
-	;;
-    sh64*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    sh*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    tile*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
-	;;
-    vax:Linux:*:*)
-	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
-	;;
-    x86_64:Linux:*:*)
-	set_cc_for_build
-	LIBCABI=$LIBC
-	if test "$CC_FOR_BUILD" != no_compiler_found; then
-	    if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_X32 >/dev/null
-	    then
-		LIBCABI=${LIBC}x32
-	    fi
-	fi
-	GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
-	;;
-    xtensa*:Linux:*:*)
-	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	rm -f $dummy.c && rmdir $tmpdir
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 	;;
     i*86:DYNIX/ptx:4*:*)
@@ -1170,44 +923,23 @@
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
-	GUESS=i386-sequent-sysv4
-	;;
+	echo i386-sequent-sysv4
+	exit 0 ;;
     i*86:UNIX_SV:4.2MP:2.*)
-	# Unixware is an offshoot of SVR4, but it has its own version
-	# number series starting with 2...
-	# I am not positive that other SVR4 systems won't match this,
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-	# Use sysv4.2uw... so that sysv4* matches it.
-	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
-	;;
-    i*86:OS/2:*:*)
-	# If we were able to find `uname', then EMX Unix compatibility
-	# is probably installed.
-	GUESS=$UNAME_MACHINE-pc-os2-emx
-	;;
-    i*86:XTS-300:*:STOP)
-	GUESS=$UNAME_MACHINE-unknown-stop
-	;;
-    i*86:atheos:*:*)
-	GUESS=$UNAME_MACHINE-unknown-atheos
-	;;
-    i*86:syllable:*:*)
-	GUESS=$UNAME_MACHINE-pc-syllable
-	;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	GUESS=i386-unknown-lynxos$UNAME_RELEASE
-	;;
-    i*86:*DOS:*:*)
-	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
-	;;
-    i*86:*:4.*:*)
-	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 	else
-		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
-	fi
-	;;
-    i*86:*:5:[678]*)
-	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
@@ -1215,10 +947,10 @@
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	;;
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
@@ -1230,337 +962,216 @@
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 	else
-		GUESS=$UNAME_MACHINE-pc-sysv32
-	fi
-	;;
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
     pc:*:*:*)
 	# Left here for compatibility:
-	# uname -m prints for DJGPP always 'pc', but it prints nothing about
-	# the processor, so we play safe by assuming i586.
-	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configure will decide that
-	# this is a cross-build.
-	GUESS=i586-pc-msdosdjgpp
-	;;
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
     Intel:Mach:3*:*)
-	GUESS=i386-pc-mach3
-	;;
+	echo i386-pc-mach3
+	exit 0 ;;
     paragon:*:*:*)
-	GUESS=i860-intel-osf1
-	;;
+	echo i860-intel-osf1
+	exit 0 ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
-	fi
-	;;
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
-	GUESS=m68010-convergent-sysv
-	;;
+	echo m68010-convergent-sysv
+	exit 0 ;;
     mc68k:UNIX:SYSTEM5:3.51m)
-	GUESS=m68k-convergent-sysv
-	;;
-    M680?0:D-NIX:5.3:*)
-	GUESS=m68k-diab-dnix
-	;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	echo m68k-convergent-sysv
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-	OS_REL='.3'
-	test -r /etc/.relid \
-	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
-	;;
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
-	GUESS=m68k-atari-sysv4
-	;;
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
-	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
-	;;
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     rs6000:LynxOS:2.*:*)
-	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
-	;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
-	;;
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
     SM[BE]S:UNIX_SV:*:*)
-	GUESS=mips-dde-sysv$UNAME_RELEASE
-	;;
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
     RM*:ReliantUNIX-*:*:*)
-	GUESS=mips-sni-sysv4
-	;;
+	echo mips-sni-sysv4
+	exit 0 ;;
     RM*:SINIX-*:*:*)
-	GUESS=mips-sni-sysv4
-	;;
+	echo mips-sni-sysv4
+	exit 0 ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		GUESS=$UNAME_MACHINE-sni-sysv4
+		echo ${UNAME_MACHINE}-sni-sysv4
 	else
-		GUESS=ns32k-sni-sysv
-	fi
-	;;
-    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-			# says <Richard.M.Bartel@ccMail.Census.GOV>
-	GUESS=i586-unisys-sysv4
-	;;
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes@openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
-	GUESS=hppa1.1-stratus-sysv4
-	;;
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
     *:*:*:FTX*)
 	# From seanf@swdc.stratus.com.
-	GUESS=i860-stratus-sysv4
-	;;
-    i*86:VOS:*:*)
-	# From Paul.Green@stratus.com.
-	GUESS=$UNAME_MACHINE-stratus-vos
-	;;
+	echo i860-stratus-sysv4
+	exit 0 ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	GUESS=hppa1.1-stratus-vos
-	;;
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
     mc68*:A/UX:*:*)
-	GUESS=m68k-apple-aux$UNAME_RELEASE
-	;;
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
     news*:NEWS-OS:6*:*)
-	GUESS=mips-sony-newsos6
-	;;
+	echo mips-sony-newsos6
+	exit 0 ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if test -d /usr/nec; then
-		GUESS=mips-nec-sysv$UNAME_RELEASE
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
-		GUESS=mips-unknown-sysv$UNAME_RELEASE
-	fi
-	;;
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	GUESS=powerpc-be-beos
-	;;
+	echo powerpc-be-beos
+	exit 0 ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	GUESS=powerpc-apple-beos
-	;;
+	echo powerpc-apple-beos
+	exit 0 ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	GUESS=i586-pc-beos
-	;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	GUESS=i586-pc-haiku
-	;;
-    x86_64:Haiku:*:*)
-	GUESS=x86_64-unknown-haiku
-	;;
+	echo i586-pc-beos
+	exit 0 ;;
     SX-4:SUPER-UX:*:*)
-	GUESS=sx4-nec-superux$UNAME_RELEASE
-	;;
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
     SX-5:SUPER-UX:*:*)
-	GUESS=sx5-nec-superux$UNAME_RELEASE
-	;;
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
     SX-6:SUPER-UX:*:*)
-	GUESS=sx6-nec-superux$UNAME_RELEASE
-	;;
-    SX-7:SUPER-UX:*:*)
-	GUESS=sx7-nec-superux$UNAME_RELEASE
-	;;
-    SX-8:SUPER-UX:*:*)
-	GUESS=sx8-nec-superux$UNAME_RELEASE
-	;;
-    SX-8R:SUPER-UX:*:*)
-	GUESS=sx8r-nec-superux$UNAME_RELEASE
-	;;
-    SX-ACE:SUPER-UX:*:*)
-	GUESS=sxace-nec-superux$UNAME_RELEASE
-	;;
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
     Power*:Rhapsody:*:*)
-	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
-	;;
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
     *:Rhapsody:*:*)
-	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
-	;;
-    arm64:Darwin:*:*)
-	GUESS=aarch64-apple-darwin$UNAME_RELEASE
-	;;
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
     *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p`
-	case $UNAME_PROCESSOR in
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
-	if command -v xcode-select > /dev/null 2> /dev/null && \
-		! xcode-select --print-path > /dev/null 2> /dev/null ; then
-	    # Avoid executing cc if there is no toolchain installed as
-	    # cc will be a stub that puts up a graphical alert
-	    # prompting the user to install developer tools.
-	    CC_FOR_BUILD=no_compiler_found
-	else
-	    set_cc_for_build
-	fi
-	if test "$CC_FOR_BUILD" != no_compiler_found; then
-	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		   grep IS_64BIT_ARCH >/dev/null
-	    then
-		case $UNAME_PROCESSOR in
-		    i386) UNAME_PROCESSOR=x86_64 ;;
-		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		esac
-	    fi
-	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
-	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
-		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		   grep IS_PPC >/dev/null
-	    then
-		UNAME_PROCESSOR=powerpc
-	    fi
-	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # uname -m returns i386 or x86_64
-	    UNAME_PROCESSOR=$UNAME_MACHINE
-	fi
-	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
-	;;
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = x86; then
+	if test "$UNAME_PROCESSOR" = "x86"; then
 		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
-	;;
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit 0 ;;
     *:QNX:*:4*)
-	GUESS=i386-pc-qnx
-	;;
-    NEO-*:NONSTOP_KERNEL:*:*)
-	GUESS=neo-tandem-nsk$UNAME_RELEASE
-	;;
-    NSE-*:NONSTOP_KERNEL:*:*)
-	GUESS=nse-tandem-nsk$UNAME_RELEASE
-	;;
-    NSR-*:NONSTOP_KERNEL:*:*)
-	GUESS=nsr-tandem-nsk$UNAME_RELEASE
-	;;
-    NSV-*:NONSTOP_KERNEL:*:*)
-	GUESS=nsv-tandem-nsk$UNAME_RELEASE
-	;;
-    NSX-*:NONSTOP_KERNEL:*:*)
-	GUESS=nsx-tandem-nsk$UNAME_RELEASE
-	;;
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
     *:NonStop-UX:*:*)
-	GUESS=mips-compaq-nonstopux
-	;;
+	echo mips-compaq-nonstopux
+	exit 0 ;;
     BS2000:POSIX*:*:*)
-	GUESS=bs2000-siemens-sysv
-	;;
+	echo bs2000-siemens-sysv
+	exit 0 ;;
     DS/*:UNIX_System_V:*:*)
-	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
-	;;
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
 	# operating systems.
-	if test "${cputype-}" = 386; then
+	if test "$cputype" = "386"; then
 	    UNAME_MACHINE=i386
-	elif test "x${cputype-}" != x; then
-	    UNAME_MACHINE=$cputype
-	fi
-	GUESS=$UNAME_MACHINE-unknown-plan9
-	;;
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
     *:TOPS-10:*:*)
-	GUESS=pdp10-unknown-tops10
-	;;
+	echo pdp10-unknown-tops10
+	exit 0 ;;
     *:TENEX:*:*)
-	GUESS=pdp10-unknown-tenex
-	;;
+	echo pdp10-unknown-tenex
+	exit 0 ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	GUESS=pdp10-dec-tops20
-	;;
+	echo pdp10-dec-tops20
+	exit 0 ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	GUESS=pdp10-xkl-tops20
-	;;
+	echo pdp10-xkl-tops20
+	exit 0 ;;
     *:TOPS-20:*:*)
-	GUESS=pdp10-unknown-tops20
-	;;
+	echo pdp10-unknown-tops20
+	exit 0 ;;
     *:ITS:*:*)
-	GUESS=pdp10-unknown-its
-	;;
-    SEI:*:*:SEIUX)
-	GUESS=mips-sei-seiux$UNAME_RELEASE
-	;;
-    *:DragonFly:*:*)
-	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
-	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
-	;;
-    *:*VMS:*:*)
-	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case $UNAME_MACHINE in
-	    A*) GUESS=alpha-dec-vms ;;
-	    I*) GUESS=ia64-dec-vms ;;
-	    V*) GUESS=vax-dec-vms ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	GUESS=i386-pc-xenix
-	;;
-    i*86:skyos:*:*)
-	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
-	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
-	;;
-    i*86:rdos:*:*)
-	GUESS=$UNAME_MACHINE-pc-rdos
-	;;
-    i*86:Fiwix:*:*)
-	GUESS=$UNAME_MACHINE-pc-fiwix
-	;;
-    *:AROS:*:*)
-	GUESS=$UNAME_MACHINE-unknown-aros
-	;;
-    x86_64:VMkernel:*:*)
-	GUESS=$UNAME_MACHINE-unknown-esx
-	;;
-    amd64:Isilon\ OneFS:*:*)
-	GUESS=x86_64-unknown-onefs
-	;;
-    *:Unleashed:*:*)
-	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
-	;;
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
 esac
 
-# Do we have a guess based on uname results?
-if test "x$GUESS" != x; then
-    echo "$GUESS"
-    exit
-fi
-
-# No uname command or uname output not recognized.
-set_cc_for_build
-cat > "$dummy.c" <<EOF
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
-#include <sys/types.h>
-#include <sys/utsname.h>
-#endif
-#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
-#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
-#include <signal.h>
-#if defined(_SIZE_T_) || defined(SIGLOST)
-#include <sys/utsname.h>
-#endif
-#endif
+# include <sys/types.h>
+# include <sys/utsname.h>
 #endif
 main ()
@@ -1575,10 +1186,18 @@
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-  "4"
+          "4"
 #else
-  ""
-#endif
-  ); exit (0);
-#endif
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
 #endif
 
@@ -1622,52 +1241,37 @@
 
 #if defined (_SEQUENT_)
-  struct utsname un;
-
-  uname(&un);
-  if (strncmp(un.version, "V2", 2) == 0) {
-    printf ("i386-sequent-ptx2\n"); exit (0);
-  }
-  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-    printf ("i386-sequent-ptx1\n"); exit (0);
-  }
-  printf ("i386-sequent-ptx\n"); exit (0);
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
 #endif
 
 #if defined (vax)
-#if !defined (ultrix)
-#include <sys/param.h>
-#if defined (BSD)
-#if BSD == 43
-  printf ("vax-dec-bsd4.3\n"); exit (0);
-#else
-#if BSD == 199006
-  printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#else
-  printf ("vax-dec-bsd\n"); exit (0);
-#endif
-#endif
-#else
-  printf ("vax-dec-bsd\n"); exit (0);
-#endif
-#else
-#if defined(_SIZE_T_) || defined(SIGLOST)
-  struct utsname un;
-  uname (&un);
-  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
-#else
-  printf ("vax-dec-ultrix\n"); exit (0);
-#endif
-#endif
-#endif
-#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
-#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
-#if defined(_SIZE_T_) || defined(SIGLOST)
-  struct utsname *un;
-  uname (&un);
-  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
-#else
-  printf ("mips-dec-ultrix\n"); exit (0);
-#endif
-#endif
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
 #endif
 
@@ -1680,44 +1284,50 @@
 EOF
 
-$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
-	{ echo "$SYSTEM_NAME"; exit; }
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+rm -f $dummy.c $dummy && rmdir $tmpdir
 
 # Apollos put the system type in the environment.
-test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
-
-echo "$0: unable to guess system type" >&2
-
-case $UNAME_MACHINE:$UNAME_SYSTEM in
-    mips:Linux | mips64:Linux)
-	# If we got here on MIPS GNU/Linux, output extra information.
-	cat >&2 <<EOF
-
-NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
-the system type. Please install a C compiler and try again.
-EOF
-	;;
-esac
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
 
 cat >&2 <<EOF
-
-This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite *all*
-copies of config.guess and config.sub with the latest versions from:
-
-  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
-and
-  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
-EOF
-
-our_year=`echo $timestamp | sed 's,-.*,,'`
-thisyear=`date +%Y`
-# shellcheck disable=SC2003
-script_age=`expr "$thisyear" - "$our_year"`
-if test "$script_age" -lt 3 ; then
-   cat >&2 <<EOF
-
-If $0 has already been updated, send the following data and any
-information you think might be pertinent to config-patches@gnu.org to
-provide the necessary information to handle your system.
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
 
 config.guess timestamp = $timestamp
@@ -1738,15 +1348,14 @@
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = "$UNAME_MACHINE"
-UNAME_RELEASE = "$UNAME_RELEASE"
-UNAME_SYSTEM  = "$UNAME_SYSTEM"
-UNAME_VERSION = "$UNAME_VERSION"
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
 EOF
-fi
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
Index: trunk/config.sub
===================================================================
--- trunk/config.sub	(revision 591)
+++ trunk/config.sub	(revision 1)
@@ -1,32 +1,35 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2022 Free Software Foundation, Inc.
-
-# shellcheck disable=SC2006,SC2268 # see below for rationale
-
-timestamp='2022-01-03'
-
-# This file 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 3 of the License, or
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-09-05'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file 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.
+# 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, see <https://www.gnu.org/licenses/>.
-#
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program.  This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches to <config-patches@gnu.org>.
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
@@ -34,7 +37,4 @@
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
 
 # This file is supposed to be the same for all GNU packages
@@ -53,19 +53,13 @@
 # It is wrong to echo any other type of specification.
 
-# The "shellcheck disable" line above the timestamp inhibits complaints
-# about features and limitations of the classic Bourne shell that were
-# superseded or lifted in POSIX.  However, this script identifies a wide
-# variety of pre-POSIX systems that do not have POSIX shells at all, and
-# even some reasonably current systems (Solaris 10 as case-in-point) still
-# have a pre-POSIX /bin/sh.
-
 me=`echo "$0" | sed -e 's,.*/,,'`
 
 usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
 
 Canonicalize a configuration name.
 
-Options:
+Operation modes:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
@@ -77,5 +71,6 @@
 GNU config.sub ($timestamp)
 
-Copyright 1992-2022 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -89,9 +84,9 @@
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
@@ -99,11 +94,11 @@
        break ;;
     -* )
-       echo "$me: invalid option $1$help" >&2
+       echo "$me: invalid option $1$help"
        exit 1 ;;
 
     *local*)
        # First pass through any local machine types.
-       echo "$1"
-       exit ;;
+       echo $1
+       exit 0;;
 
     * )
@@ -120,1400 +115,1123 @@
 esac
 
-# Split fields of configuration type
-# shellcheck disable=SC2162
-saved_IFS=$IFS
-IFS="-" read field1 field2 field3 field4 <<EOF
-$1
-EOF
-IFS=$saved_IFS
-
-# Separate into logical components for further validation
-case $1 in
-	*-*-*-*-*)
-		echo Invalid configuration \`"$1"\': more than four components >&2
-		exit 1
-		;;
-	*-*-*-*)
-		basic_machine=$field1-$field2
-		basic_os=$field3-$field4
-		;;
-	*-*-*)
-		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
-		# parts
-		maybe_os=$field2-$field3
-		case $maybe_os in
-			nto-qnx* | linux-* | uclinux-uclibc* \
-			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
-			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
-			| storm-chaos* | os2-emx* | rtmk-nova*)
-				basic_machine=$field1
-				basic_os=$maybe_os
-				;;
-			android-linux)
-				basic_machine=$field1-unknown
-				basic_os=linux-android
-				;;
-			*)
-				basic_machine=$field1-$field2
-				basic_os=$field3
-				;;
-		esac
-		;;
-	*-*)
-		# A lone config we happen to match not fitting any pattern
-		case $field1-$field2 in
-			decstation-3100)
-				basic_machine=mips-dec
-				basic_os=
-				;;
-			*-*)
-				# Second component is usually, but not always the OS
-				case $field2 in
-					# Prevent following clause from handling this valid os
-					sun*os*)
-						basic_machine=$field1
-						basic_os=$field2
-						;;
-					zephyr*)
-						basic_machine=$field1-unknown
-						basic_os=$field2
-						;;
-					# Manufacturers
-					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
-					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
-					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
-					| convergent* | ncr* | news | 32* | 3600* | 3100* \
-					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
-					| ultra | tti* | harris | dolphin | highlevel | gould \
-					| cbm | ns | masscomp | apple | axis | knuth | cray \
-					| microblaze* | sim | cisco \
-					| oki | wec | wrs | winbond)
-						basic_machine=$field1-$field2
-						basic_os=
-						;;
-					*)
-						basic_machine=$field1
-						basic_os=$field2
-						;;
-				esac
-			;;
-		esac
-		;;
-	*)
-		# Convert single-component short-hands not valid as part of
-		# multi-component configurations.
-		case $field1 in
-			386bsd)
-				basic_machine=i386-pc
-				basic_os=bsd
-				;;
-			a29khif)
-				basic_machine=a29k-amd
-				basic_os=udi
-				;;
-			adobe68k)
-				basic_machine=m68010-adobe
-				basic_os=scout
-				;;
-			alliant)
-				basic_machine=fx80-alliant
-				basic_os=
-				;;
-			altos | altos3068)
-				basic_machine=m68k-altos
-				basic_os=
-				;;
-			am29k)
-				basic_machine=a29k-none
-				basic_os=bsd
-				;;
-			amdahl)
-				basic_machine=580-amdahl
-				basic_os=sysv
-				;;
-			amiga)
-				basic_machine=m68k-unknown
-				basic_os=
-				;;
-			amigaos | amigados)
-				basic_machine=m68k-unknown
-				basic_os=amigaos
-				;;
-			amigaunix | amix)
-				basic_machine=m68k-unknown
-				basic_os=sysv4
-				;;
-			apollo68)
-				basic_machine=m68k-apollo
-				basic_os=sysv
-				;;
-			apollo68bsd)
-				basic_machine=m68k-apollo
-				basic_os=bsd
-				;;
-			aros)
-				basic_machine=i386-pc
-				basic_os=aros
-				;;
-			aux)
-				basic_machine=m68k-apple
-				basic_os=aux
-				;;
-			balance)
-				basic_machine=ns32k-sequent
-				basic_os=dynix
-				;;
-			blackfin)
-				basic_machine=bfin-unknown
-				basic_os=linux
-				;;
-			cegcc)
-				basic_machine=arm-unknown
-				basic_os=cegcc
-				;;
-			convex-c1)
-				basic_machine=c1-convex
-				basic_os=bsd
-				;;
-			convex-c2)
-				basic_machine=c2-convex
-				basic_os=bsd
-				;;
-			convex-c32)
-				basic_machine=c32-convex
-				basic_os=bsd
-				;;
-			convex-c34)
-				basic_machine=c34-convex
-				basic_os=bsd
-				;;
-			convex-c38)
-				basic_machine=c38-convex
-				basic_os=bsd
-				;;
-			cray)
-				basic_machine=j90-cray
-				basic_os=unicos
-				;;
-			crds | unos)
-				basic_machine=m68k-crds
-				basic_os=
-				;;
-			da30)
-				basic_machine=m68k-da30
-				basic_os=
-				;;
-			decstation | pmax | pmin | dec3100 | decstatn)
-				basic_machine=mips-dec
-				basic_os=
-				;;
-			delta88)
-				basic_machine=m88k-motorola
-				basic_os=sysv3
-				;;
-			dicos)
-				basic_machine=i686-pc
-				basic_os=dicos
-				;;
-			djgpp)
-				basic_machine=i586-pc
-				basic_os=msdosdjgpp
-				;;
-			ebmon29k)
-				basic_machine=a29k-amd
-				basic_os=ebmon
-				;;
-			es1800 | OSE68k | ose68k | ose | OSE)
-				basic_machine=m68k-ericsson
-				basic_os=ose
-				;;
-			gmicro)
-				basic_machine=tron-gmicro
-				basic_os=sysv
-				;;
-			go32)
-				basic_machine=i386-pc
-				basic_os=go32
-				;;
-			h8300hms)
-				basic_machine=h8300-hitachi
-				basic_os=hms
-				;;
-			h8300xray)
-				basic_machine=h8300-hitachi
-				basic_os=xray
-				;;
-			h8500hms)
-				basic_machine=h8500-hitachi
-				basic_os=hms
-				;;
-			harris)
-				basic_machine=m88k-harris
-				basic_os=sysv3
-				;;
-			hp300 | hp300hpux)
-				basic_machine=m68k-hp
-				basic_os=hpux
-				;;
-			hp300bsd)
-				basic_machine=m68k-hp
-				basic_os=bsd
-				;;
-			hppaosf)
-				basic_machine=hppa1.1-hp
-				basic_os=osf
-				;;
-			hppro)
-				basic_machine=hppa1.1-hp
-				basic_os=proelf
-				;;
-			i386mach)
-				basic_machine=i386-mach
-				basic_os=mach
-				;;
-			isi68 | isi)
-				basic_machine=m68k-isi
-				basic_os=sysv
-				;;
-			m68knommu)
-				basic_machine=m68k-unknown
-				basic_os=linux
-				;;
-			magnum | m3230)
-				basic_machine=mips-mips
-				basic_os=sysv
-				;;
-			merlin)
-				basic_machine=ns32k-utek
-				basic_os=sysv
-				;;
-			mingw64)
-				basic_machine=x86_64-pc
-				basic_os=mingw64
-				;;
-			mingw32)
-				basic_machine=i686-pc
-				basic_os=mingw32
-				;;
-			mingw32ce)
-				basic_machine=arm-unknown
-				basic_os=mingw32ce
-				;;
-			monitor)
-				basic_machine=m68k-rom68k
-				basic_os=coff
-				;;
-			morphos)
-				basic_machine=powerpc-unknown
-				basic_os=morphos
-				;;
-			moxiebox)
-				basic_machine=moxie-unknown
-				basic_os=moxiebox
-				;;
-			msdos)
-				basic_machine=i386-pc
-				basic_os=msdos
-				;;
-			msys)
-				basic_machine=i686-pc
-				basic_os=msys
-				;;
-			mvs)
-				basic_machine=i370-ibm
-				basic_os=mvs
-				;;
-			nacl)
-				basic_machine=le32-unknown
-				basic_os=nacl
-				;;
-			ncr3000)
-				basic_machine=i486-ncr
-				basic_os=sysv4
-				;;
-			netbsd386)
-				basic_machine=i386-pc
-				basic_os=netbsd
-				;;
-			netwinder)
-				basic_machine=armv4l-rebel
-				basic_os=linux
-				;;
-			news | news700 | news800 | news900)
-				basic_machine=m68k-sony
-				basic_os=newsos
-				;;
-			news1000)
-				basic_machine=m68030-sony
-				basic_os=newsos
-				;;
-			necv70)
-				basic_machine=v70-nec
-				basic_os=sysv
-				;;
-			nh3000)
-				basic_machine=m68k-harris
-				basic_os=cxux
-				;;
-			nh[45]000)
-				basic_machine=m88k-harris
-				basic_os=cxux
-				;;
-			nindy960)
-				basic_machine=i960-intel
-				basic_os=nindy
-				;;
-			mon960)
-				basic_machine=i960-intel
-				basic_os=mon960
-				;;
-			nonstopux)
-				basic_machine=mips-compaq
-				basic_os=nonstopux
-				;;
-			os400)
-				basic_machine=powerpc-ibm
-				basic_os=os400
-				;;
-			OSE68000 | ose68000)
-				basic_machine=m68000-ericsson
-				basic_os=ose
-				;;
-			os68k)
-				basic_machine=m68k-none
-				basic_os=os68k
-				;;
-			paragon)
-				basic_machine=i860-intel
-				basic_os=osf
-				;;
-			parisc)
-				basic_machine=hppa-unknown
-				basic_os=linux
-				;;
-			psp)
-				basic_machine=mipsallegrexel-sony
-				basic_os=psp
-				;;
-			pw32)
-				basic_machine=i586-unknown
-				basic_os=pw32
-				;;
-			rdos | rdos64)
-				basic_machine=x86_64-pc
-				basic_os=rdos
-				;;
-			rdos32)
-				basic_machine=i386-pc
-				basic_os=rdos
-				;;
-			rom68k)
-				basic_machine=m68k-rom68k
-				basic_os=coff
-				;;
-			sa29200)
-				basic_machine=a29k-amd
-				basic_os=udi
-				;;
-			sei)
-				basic_machine=mips-sei
-				basic_os=seiux
-				;;
-			sequent)
-				basic_machine=i386-sequent
-				basic_os=
-				;;
-			sps7)
-				basic_machine=m68k-bull
-				basic_os=sysv2
-				;;
-			st2000)
-				basic_machine=m68k-tandem
-				basic_os=
-				;;
-			stratus)
-				basic_machine=i860-stratus
-				basic_os=sysv4
-				;;
-			sun2)
-				basic_machine=m68000-sun
-				basic_os=
-				;;
-			sun2os3)
-				basic_machine=m68000-sun
-				basic_os=sunos3
-				;;
-			sun2os4)
-				basic_machine=m68000-sun
-				basic_os=sunos4
-				;;
-			sun3)
-				basic_machine=m68k-sun
-				basic_os=
-				;;
-			sun3os3)
-				basic_machine=m68k-sun
-				basic_os=sunos3
-				;;
-			sun3os4)
-				basic_machine=m68k-sun
-				basic_os=sunos4
-				;;
-			sun4)
-				basic_machine=sparc-sun
-				basic_os=
-				;;
-			sun4os3)
-				basic_machine=sparc-sun
-				basic_os=sunos3
-				;;
-			sun4os4)
-				basic_machine=sparc-sun
-				basic_os=sunos4
-				;;
-			sun4sol2)
-				basic_machine=sparc-sun
-				basic_os=solaris2
-				;;
-			sun386 | sun386i | roadrunner)
-				basic_machine=i386-sun
-				basic_os=
-				;;
-			sv1)
-				basic_machine=sv1-cray
-				basic_os=unicos
-				;;
-			symmetry)
-				basic_machine=i386-sequent
-				basic_os=dynix
-				;;
-			t3e)
-				basic_machine=alphaev5-cray
-				basic_os=unicos
-				;;
-			t90)
-				basic_machine=t90-cray
-				basic_os=unicos
-				;;
-			toad1)
-				basic_machine=pdp10-xkl
-				basic_os=tops20
-				;;
-			tpf)
-				basic_machine=s390x-ibm
-				basic_os=tpf
-				;;
-			udi29k)
-				basic_machine=a29k-amd
-				basic_os=udi
-				;;
-			ultra3)
-				basic_machine=a29k-nyu
-				basic_os=sym1
-				;;
-			v810 | necv810)
-				basic_machine=v810-nec
-				basic_os=none
-				;;
-			vaxv)
-				basic_machine=vax-dec
-				basic_os=sysv
-				;;
-			vms)
-				basic_machine=vax-dec
-				basic_os=vms
-				;;
-			vsta)
-				basic_machine=i386-pc
-				basic_os=vsta
-				;;
-			vxworks960)
-				basic_machine=i960-wrs
-				basic_os=vxworks
-				;;
-			vxworks68)
-				basic_machine=m68k-wrs
-				basic_os=vxworks
-				;;
-			vxworks29k)
-				basic_machine=a29k-wrs
-				basic_os=vxworks
-				;;
-			xbox)
-				basic_machine=i686-pc
-				basic_os=mingw32
-				;;
-			ymp)
-				basic_machine=ymp-cray
-				basic_os=unicos
-				;;
-			*)
-				basic_machine=$1
-				basic_os=
-				;;
-		esac
-		;;
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
 esac
 
-# Decode 1-component or ad-hoc basic machines
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
-	# Here we handle the default manufacturer of certain CPU types.  It is in
-	# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		cpu=hppa1.1
-		vendor=winbond
-		;;
-	op50n)
-		cpu=hppa1.1
-		vendor=oki
-		;;
-	op60c)
-		cpu=hppa1.1
-		vendor=oki
-		;;
-	ibm*)
-		cpu=i370
-		vendor=ibm
-		;;
-	orion105)
-		cpu=clipper
-		vendor=highlevel
-		;;
-	mac | mpw | mac-mpw)
-		cpu=m68k
-		vendor=apple
-		;;
-	pmac | pmac-mpw)
-		cpu=powerpc
-		vendor=apple
-		;;
-
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		cpu=m68000
-		vendor=att
-		;;
-	3b*)
-		cpu=we32k
-		vendor=att
-		;;
-	bluegene*)
-		cpu=powerpc
-		vendor=ibm
-		basic_os=cnk
-		;;
-	decsystem10* | dec10*)
-		cpu=pdp10
-		vendor=dec
-		basic_os=tops10
-		;;
-	decsystem20* | dec20*)
-		cpu=pdp10
-		vendor=dec
-		basic_os=tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		cpu=m68k
-		vendor=motorola
-		;;
-	dpx2*)
-		cpu=m68k
-		vendor=bull
-		basic_os=sysv3
-		;;
-	encore | umax | mmax)
-		cpu=ns32k
-		vendor=encore
-		;;
-	elxsi)
-		cpu=elxsi
-		vendor=elxsi
-		basic_os=${basic_os:-bsd}
-		;;
-	fx2800)
-		cpu=i860
-		vendor=alliant
-		;;
-	genix)
-		cpu=ns32k
-		vendor=ns
-		;;
-	h3050r* | hiux*)
-		cpu=hppa1.1
-		vendor=hitachi
-		basic_os=hiuxwe2
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		cpu=hppa1.0
-		vendor=hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		cpu=m68000
-		vendor=hp
-		;;
-	hp9k3[2-9][0-9])
-		cpu=m68k
-		vendor=hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		cpu=hppa1.0
-		vendor=hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		cpu=hppa1.1
-		vendor=hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		cpu=hppa1.1
-		vendor=hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		cpu=hppa1.1
-		vendor=hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		cpu=hppa1.1
-		vendor=hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		cpu=hppa1.0
-		vendor=hp
-		;;
-	i*86v32)
-		cpu=`echo "$1" | sed -e 's/86.*/86/'`
-		vendor=pc
-		basic_os=sysv32
-		;;
-	i*86v4*)
-		cpu=`echo "$1" | sed -e 's/86.*/86/'`
-		vendor=pc
-		basic_os=sysv4
-		;;
-	i*86v)
-		cpu=`echo "$1" | sed -e 's/86.*/86/'`
-		vendor=pc
-		basic_os=sysv
-		;;
-	i*86sol2)
-		cpu=`echo "$1" | sed -e 's/86.*/86/'`
-		vendor=pc
-		basic_os=solaris2
-		;;
-	j90 | j90-cray)
-		cpu=j90
-		vendor=cray
-		basic_os=${basic_os:-unicos}
-		;;
-	iris | iris4d)
-		cpu=mips
-		vendor=sgi
-		case $basic_os in
-		    irix*)
-			;;
-		    *)
-			basic_os=irix4
-			;;
-		esac
-		;;
-	miniframe)
-		cpu=m68000
-		vendor=convergent
-		;;
-	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		cpu=m68k
-		vendor=atari
-		basic_os=mint
-		;;
-	news-3600 | risc-news)
-		cpu=mips
-		vendor=sony
-		basic_os=newsos
-		;;
-	next | m*-next)
-		cpu=m68k
-		vendor=next
-		case $basic_os in
-		    openstep*)
-		        ;;
-		    nextstep*)
-			;;
-		    ns2*)
-		      basic_os=nextstep2
-			;;
-		    *)
-		      basic_os=nextstep3
-			;;
-		esac
-		;;
-	np1)
-		cpu=np1
-		vendor=gould
-		;;
-	op50n-* | op60c-*)
-		cpu=hppa1.1
-		vendor=oki
-		basic_os=proelf
-		;;
-	pa-hitachi)
-		cpu=hppa1.1
-		vendor=hitachi
-		basic_os=hiuxwe2
-		;;
-	pbd)
-		cpu=sparc
-		vendor=tti
-		;;
-	pbb)
-		cpu=m68k
-		vendor=tti
-		;;
-	pc532)
-		cpu=ns32k
-		vendor=pc532
-		;;
-	pn)
-		cpu=pn
-		vendor=gould
-		;;
-	power)
-		cpu=power
-		vendor=ibm
-		;;
-	ps2)
-		cpu=i386
-		vendor=ibm
-		;;
-	rm[46]00)
-		cpu=mips
-		vendor=siemens
-		;;
-	rtpc | rtpc-*)
-		cpu=romp
-		vendor=ibm
-		;;
-	sde)
-		cpu=mipsisa32
-		vendor=sde
-		basic_os=${basic_os:-elf}
-		;;
-	simso-wrs)
-		cpu=sparclite
-		vendor=wrs
-		basic_os=vxworks
-		;;
-	tower | tower-32)
-		cpu=m68k
-		vendor=ncr
-		;;
-	vpp*|vx|vx-*)
-		cpu=f301
-		vendor=fujitsu
-		;;
-	w65)
-		cpu=w65
-		vendor=wdc
-		;;
-	w89k-*)
-		cpu=hppa1.1
-		vendor=winbond
-		basic_os=proelf
-		;;
-	none)
-		cpu=none
-		vendor=none
-		;;
-	leon|leon[3-9])
-		cpu=sparc
-		vendor=$basic_machine
-		;;
-	leon-*|leon[3-9]-*)
-		cpu=sparc
-		vendor=`echo "$basic_machine" | sed 's/-.*//'`
-		;;
-
-	*-*)
-		# shellcheck disable=SC2162
-		saved_IFS=$IFS
-		IFS="-" read cpu vendor <<EOF
-$basic_machine
-EOF
-		IFS=$saved_IFS
-		;;
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
 	i*86 | x86_64)
-		cpu=$basic_machine
-		vendor=pc
-		;;
-	# These rules are duplicated from below for sake of the special case above;
-	# i.e. things that normalized to x86 arches should also default to "pc"
-	pc98)
-		cpu=i386
-		vendor=pc
-		;;
-	x64 | amd64)
-		cpu=x86_64
-		vendor=pc
-		;;
-	# Recognize the basic CPU types without company name.
-	*)
-		cpu=$basic_machine
-		vendor=unknown
-		;;
-esac
-
-unset -v basic_machine
-
-# Decode basic machines in the full and proper CPU-Company form.
-case $cpu-$vendor in
-	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
-	# some cases the only manufacturer, in others, it is the most popular.
-	craynv-unknown)
-		vendor=cray
-		basic_os=${basic_os:-unicosmp}
-		;;
-	c90-unknown | c90-cray)
-		vendor=cray
-		basic_os=${Basic_os:-unicos}
-		;;
-	fx80-unknown)
-		vendor=alliant
-		;;
-	romp-unknown)
-		vendor=ibm
-		;;
-	mmix-unknown)
-		vendor=knuth
-		;;
-	microblaze-unknown | microblazeel-unknown)
-		vendor=xilinx
-		;;
-	rs6000-unknown)
-		vendor=ibm
-		;;
-	vax-unknown)
-		vendor=dec
-		;;
-	pdp11-unknown)
-		vendor=dec
-		;;
-	we32k-unknown)
-		vendor=att
-		;;
-	cydra-unknown)
-		vendor=cydrome
-		;;
-	i370-ibm*)
-		vendor=ibm
-		;;
-	orion-unknown)
-		vendor=highlevel
-		;;
-	xps-unknown | xps100-unknown)
-		cpu=xps100
-		vendor=honeywell
-		;;
-
-	# Here we normalize CPU types with a missing or matching vendor
-	armh-unknown | armh-alt)
-		cpu=armv7l
-		vendor=alt
-		basic_os=${basic_os:-linux-gnueabihf}
-		;;
-	dpx20-unknown | dpx20-bull)
-		cpu=rs6000
-		vendor=bull
-		basic_os=${basic_os:-bosx}
-		;;
-
-	# Here we normalize CPU types irrespective of the vendor
-	amd64-*)
-		cpu=x86_64
-		;;
-	blackfin-*)
-		cpu=bfin
-		basic_os=linux
-		;;
-	c54x-*)
-		cpu=tic54x
-		;;
-	c55x-*)
-		cpu=tic55x
-		;;
-	c6x-*)
-		cpu=tic6x
-		;;
-	e500v[12]-*)
-		cpu=powerpc
-		basic_os=${basic_os}"spe"
-		;;
-	mips3*-*)
-		cpu=mips64
-		;;
-	ms1-*)
-		cpu=mt
-		;;
-	m68knommu-*)
-		cpu=m68k
-		basic_os=linux
-		;;
-	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
-		cpu=s12z
-		;;
-	openrisc-*)
-		cpu=or32
-		;;
-	parisc-*)
-		cpu=hppa
-		basic_os=linux
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		cpu=i586
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
-		cpu=i686
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		cpu=i686
-		;;
-	pentium4-*)
-		cpu=i786
-		;;
-	pc98-*)
-		cpu=i386
-		;;
-	ppc-* | ppcbe-*)
-		cpu=powerpc
-		;;
-	ppcle-* | powerpclittle-*)
-		cpu=powerpcle
-		;;
-	ppc64-*)
-		cpu=powerpc64
-		;;
-	ppc64le-* | powerpc64little-*)
-		cpu=powerpc64le
-		;;
-	sb1-*)
-		cpu=mipsisa64sb1
-		;;
-	sb1el-*)
-		cpu=mipsisa64sb1el
-		;;
-	sh5e[lb]-*)
-		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
-		;;
-	spur-*)
-		cpu=spur
-		;;
-	strongarm-* | thumb-*)
-		cpu=arm
-		;;
-	tx39-*)
-		cpu=mipstx39
-		;;
-	tx39el-*)
-		cpu=mipstx39el
-		;;
-	x64-*)
-		cpu=x86_64
-		;;
-	xscale-* | xscalee[bl]-*)
-		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
-		;;
-	arm64-* | aarch64le-*)
-		cpu=aarch64
-		;;
-
-	# Recognize the canonical CPU Types that limit and/or modify the
-	# company names they are paired with.
-	cr16-*)
-		basic_os=${basic_os:-elf}
-		;;
-	crisv32-* | etraxfs*-*)
-		cpu=crisv32
-		vendor=axis
-		;;
-	cris-* | etrax*-*)
-		cpu=cris
-		vendor=axis
-		;;
-	crx-*)
-		basic_os=${basic_os:-elf}
-		;;
-	neo-tandem)
-		cpu=neo
-		vendor=tandem
-		;;
-	nse-tandem)
-		cpu=nse
-		vendor=tandem
-		;;
-	nsr-tandem)
-		cpu=nsr
-		vendor=tandem
-		;;
-	nsv-tandem)
-		cpu=nsv
-		vendor=tandem
-		;;
-	nsx-tandem)
-		cpu=nsx
-		vendor=tandem
-		;;
-	mipsallegrexel-sony)
-		cpu=mipsallegrexel
-		vendor=sony
-		;;
-	tile*-*)
-		basic_os=${basic_os:-linux-gnu}
-		;;
-
-	*)
-		# Recognize the canonical CPU types that are allowed with any
-		# company name.
-		case $cpu in
-			1750a | 580 \
-			| a29k \
-			| aarch64 | aarch64_be \
-			| abacus \
-			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
-			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
-			| alphapca5[67] | alpha64pca5[67] \
-			| am33_2.0 \
-			| amdgcn \
-			| arc | arceb | arc32 | arc64 \
-			| arm | arm[lb]e | arme[lb] | armv* \
-			| avr | avr32 \
-			| asmjs \
-			| ba \
-			| be32 | be64 \
-			| bfin | bpf | bs2000 \
-			| c[123]* | c30 | [cjt]90 | c4x \
-			| c8051 | clipper | craynv | csky | cydra \
-			| d10v | d30v | dlx | dsp16xx \
-			| e2k | elxsi | epiphany \
-			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
-			| h8300 | h8500 \
-			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-			| hexagon \
-			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
-			| ip2k | iq2000 \
-			| k1om \
-			| le32 | le64 \
-			| lm32 \
-			| loongarch32 | loongarch64 | loongarchx32 \
-			| m32c | m32r | m32rle \
-			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
-			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
-			| m88110 | m88k | maxq | mb | mcore | mep | metag \
-			| microblaze | microblazeel \
-			| mips | mipsbe | mipseb | mipsel | mipsle \
-			| mips16 \
-			| mips64 | mips64eb | mips64el \
-			| mips64octeon | mips64octeonel \
-			| mips64orion | mips64orionel \
-			| mips64r5900 | mips64r5900el \
-			| mips64vr | mips64vrel \
-			| mips64vr4100 | mips64vr4100el \
-			| mips64vr4300 | mips64vr4300el \
-			| mips64vr5000 | mips64vr5000el \
-			| mips64vr5900 | mips64vr5900el \
-			| mipsisa32 | mipsisa32el \
-			| mipsisa32r2 | mipsisa32r2el \
-			| mipsisa32r3 | mipsisa32r3el \
-			| mipsisa32r5 | mipsisa32r5el \
-			| mipsisa32r6 | mipsisa32r6el \
-			| mipsisa64 | mipsisa64el \
-			| mipsisa64r2 | mipsisa64r2el \
-			| mipsisa64r3 | mipsisa64r3el \
-			| mipsisa64r5 | mipsisa64r5el \
-			| mipsisa64r6 | mipsisa64r6el \
-			| mipsisa64sb1 | mipsisa64sb1el \
-			| mipsisa64sr71k | mipsisa64sr71kel \
-			| mipsr5900 | mipsr5900el \
-			| mipstx39 | mipstx39el \
-			| mmix \
-			| mn10200 | mn10300 \
-			| moxie \
-			| mt \
-			| msp430 \
-			| nds32 | nds32le | nds32be \
-			| nfp \
-			| nios | nios2 | nios2eb | nios2el \
-			| none | np1 | ns16k | ns32k | nvptx \
-			| open8 \
-			| or1k* \
-			| or32 \
-			| orion \
-			| picochip \
-			| pdp10 | pdp11 | pj | pjl | pn | power \
-			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
-			| pru \
-			| pyramid \
-			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
-			| rl78 | romp | rs6000 | rx \
-			| s390 | s390x \
-			| score \
-			| sh | shl \
-			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
-			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
-			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
-			| sparclite \
-			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
-			| spu \
-			| tahoe \
-			| thumbv7* \
-			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
-			| tron \
-			| ubicom32 \
-			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
-			| vax \
-			| visium \
-			| w65 \
-			| wasm32 | wasm64 \
-			| we32k \
-			| x86 | x86_64 | xc16x | xgate | xps100 \
-			| xstormy16 | xtensa* \
-			| ymp \
-			| z8k | z80)
-				;;
-
-			*)
-				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
-				exit 1
-				;;
-		esac
-		;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $vendor in
-	digital*)
-		vendor=dec
-		;;
-	commodore*)
-		vendor=cbm
-		;;
-	*)
-		;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if test x$basic_os != x
-then
-
-# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
-# set os.
-case $basic_os in
-	gnu/linux*)
-		kernel=linux
-		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
-		;;
-	os2-emx)
-		kernel=os2
-		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
-		;;
-	nto-qnx*)
-		kernel=nto
-		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
-		;;
-	*-*)
-		# shellcheck disable=SC2162
-		saved_IFS=$IFS
-		IFS="-" read kernel os <<EOF
-$basic_os
-EOF
-		IFS=$saved_IFS
-		;;
-	# Default OS when just kernel was specified
-	nto*)
-		kernel=nto
-		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
-		;;
-	linux*)
-		kernel=linux
-		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
-		;;
-	*)
-		kernel=
-		os=$basic_os
-		;;
-esac
-
-# Now, normalize the OS (knowing we just have one component, it's not a kernel,
-# etc.)
-case $os in
-	# First match some system type aliases that might get confused
-	# with valid system types.
-	# solaris* is a basic system type, with this one exception.
-	auroraux)
-		os=auroraux
-		;;
-	bluegene*)
-		os=cnk
-		;;
-	solaris1 | solaris1.*)
-		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
-		;;
-	solaris)
-		os=solaris2
-		;;
-	unixware*)
-		os=sysv4.2uw
-		;;
-	# es1800 is here to avoid being matched by es* (a different OS)
-	es1800*)
-		os=ose
-		;;
-	# Some version numbers need modification
-	chorusos*)
-		os=chorusos
-		;;
-	isc)
-		os=isc2.2
-		;;
-	sco6)
-		os=sco5v6
-		;;
-	sco5)
-		os=sco3.2v5
-		;;
-	sco4)
-		os=sco3.2v4
-		;;
-	sco3.2.[4-9]*)
-		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
-		;;
-	sco*v* | scout)
-		# Don't match below
-		;;
-	sco*)
-		os=sco3.2v2
-		;;
-	psos*)
-		os=psos
-		;;
-	qnx*)
-		os=qnx
-		;;
-	hiux*)
-		os=hiuxwe2
-		;;
-	lynx*178)
-		os=lynxos178
-		;;
-	lynx*5)
-		os=lynxos5
-		;;
-	lynxos*)
-		# don't get caught up in next wildcard
-		;;
-	lynx*)
-		os=lynxos
-		;;
-	mac[0-9]*)
-		os=`echo "$os" | sed -e 's|mac|macos|'`
-		;;
-	opened*)
-		os=openedition
-		;;
-	os400*)
-		os=os400
-		;;
-	sunos5*)
-		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
-		;;
-	sunos6*)
-		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
-		;;
-	wince*)
-		os=wince
-		;;
-	utek*)
-		os=bsd
-		;;
-	dynix*)
-		os=bsd
-		;;
-	acis*)
-		os=aos
-		;;
-	atheos*)
-		os=atheos
-		;;
-	syllable*)
-		os=syllable
-		;;
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* \
+	| m32r-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39 | mipstx39el \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
 	386bsd)
-		os=bsd
-		;;
-	ctix* | uts*)
-		os=sysv
-		;;
-	nova*)
-		os=rtmk-nova
-		;;
-	ns2)
-		os=nextstep2
-		;;
-	# Preserve the version number of sinix5.
-	sinix5.*)
-		os=`echo "$os" | sed -e 's|sinix|sysv|'`
-		;;
-	sinix*)
-		os=sysv4
-		;;
-	tpf*)
-		os=tpf
-		;;
-	triton*)
-		os=sysv3
-		;;
-	oss*)
-		os=sysv3
-		;;
-	svr4*)
-		os=sysv4
-		;;
-	svr3)
-		os=sysv3
-		;;
-	sysvr4)
-		os=sysv4
-		;;
-	ose*)
-		os=ose
-		;;
-	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
-		os=mint
-		;;
-	dicos*)
-		os=dicos
-		;;
-	pikeos*)
-		# Until real need of OS specific support for
-		# particular features comes up, bare metal
-		# configurations are quite functional.
-		case $cpu in
-		    arm*)
-			os=eabi
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
 			;;
 		    *)
-			os=elf
+			os=-irix4
 			;;
 		esac
 		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i686-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3d)
+		basic_machine=alpha-cray
+		os=-unicos
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+        tic4x | c4x*)
+		basic_machine=tic4x-unknown
+		os=-coff
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
 	*)
-		# No normalization, but not necessarily accepted, that comes below.
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
 		;;
 esac
 
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
 else
 
@@ -1528,361 +1246,223 @@
 # system, and we'll never get to this point.
 
-kernel=
-case $cpu-$vendor in
-	score-*)
-		os=elf
-		;;
-	spu-*)
-		os=elf
-		;;
+case $basic_machine in
 	*-acorn)
-		os=riscix1.2
+		os=-riscix1.2
 		;;
 	arm*-rebel)
-		kernel=linux
-		os=gnu
+		os=-linux
 		;;
 	arm*-semi)
-		os=aout
-		;;
-	c4x-* | tic4x-*)
-		os=coff
-		;;
-	c8051-*)
-		os=elf
-		;;
-	clipper-intergraph)
-		os=clix
-		;;
-	hexagon-*)
-		os=elf
-		;;
-	tic54x-*)
-		os=coff
-		;;
-	tic55x-*)
-		os=coff
-		;;
-	tic6x-*)
-		os=coff
+		os=-aout
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
-		os=tops20
+		os=-tops20
 		;;
 	pdp11-*)
-		os=none
+		os=-none
 		;;
 	*-dec | vax-*)
-		os=ultrix4.2
+		os=-ultrix4.2
 		;;
 	m68*-apollo)
-		os=domain
+		os=-domain
 		;;
 	i386-sun)
-		os=sunos4.0.2
+		os=-sunos4.0.2
 		;;
 	m68000-sun)
-		os=sunos3
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
 		;;
 	m68*-cisco)
-		os=aout
-		;;
-	mep-*)
-		os=elf
+		os=-aout
 		;;
 	mips*-cisco)
-		os=elf
+		os=-elf
 		;;
 	mips*-*)
-		os=elf
+		os=-elf
 		;;
 	or32-*)
-		os=coff
+		os=-coff
 		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=sysv3
+		os=-sysv3
 		;;
 	sparc-* | *-sun)
-		os=sunos4.1.1
-		;;
-	pru-*)
-		os=elf
+		os=-sunos4.1.1
 		;;
 	*-be)
-		os=beos
+		os=-beos
 		;;
 	*-ibm)
-		os=aix
-		;;
-	*-knuth)
-		os=mmixware
+		os=-aix
 		;;
 	*-wec)
-		os=proelf
+		os=-proelf
 		;;
 	*-winbond)
-		os=proelf
+		os=-proelf
 		;;
 	*-oki)
-		os=proelf
+		os=-proelf
 		;;
 	*-hp)
-		os=hpux
+		os=-hpux
 		;;
 	*-hitachi)
-		os=hiux
+		os=-hiux
 		;;
 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=sysv
+		os=-sysv
 		;;
 	*-cbm)
-		os=amigaos
+		os=-amigaos
 		;;
 	*-dg)
-		os=dgux
+		os=-dgux
 		;;
 	*-dolphin)
-		os=sysv3
+		os=-sysv3
 		;;
 	m68k-ccur)
-		os=rtu
+		os=-rtu
 		;;
 	m88k-omron*)
-		os=luna
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
 		;;
 	*-next)
-		os=nextstep
-		;;
-	*-sequent)
-		os=ptx
-		;;
-	*-crds)
-		os=unos
-		;;
-	*-ns)
-		os=genix
-		;;
-	i370-*)
-		os=mvs
+		os=-nextstep3
 		;;
 	*-gould)
-		os=sysv
+		os=-sysv
 		;;
 	*-highlevel)
-		os=bsd
+		os=-bsd
 		;;
 	*-encore)
-		os=bsd
+		os=-bsd
 		;;
 	*-sgi)
-		os=irix
+		os=-irix
 		;;
 	*-siemens)
-		os=sysv4
+		os=-sysv4
 		;;
 	*-masscomp)
-		os=rtu
+		os=-rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
-		os=uxpv
+		os=-uxpv
 		;;
 	*-rom68k)
-		os=coff
+		os=-coff
 		;;
 	*-*bug)
-		os=coff
+		os=-coff
 		;;
 	*-apple)
-		os=macos
+		os=-macos
 		;;
 	*-atari*)
-		os=mint
-		;;
-	*-wrs)
-		os=vxworks
+		os=-mint
 		;;
 	*)
-		os=none
+		os=-none
 		;;
 esac
-
 fi
-
-# Now, validate our (potentially fixed-up) OS.
-case $os in
-	# Sometimes we do "kernel-libc", so those need to count as OSes.
-	musl* | newlib* | relibc* | uclibc*)
-		;;
-	# Likewise for "kernel-abi"
-	eabi* | gnueabi*)
-		;;
-	# VxWorks passes extra cpu info in the 4th filed.
-	simlinux | simwindows | spe)
-		;;
-	# Now accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST end in a * to match a version number.
-	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
-	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
-	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
-	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
-	     | hiux* | abug | nacl* | netware* | windows* \
-	     | os9* | macos* | osx* | ios* \
-	     | mpw* | magic* | mmixware* | mon960* | lnews* \
-	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
-	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
-	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
-	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
-	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
-	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
-	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
-	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
-	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
-	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
-	     | chorusrdb* | cegcc* | glidix* | serenity* \
-	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
-	     | midipix* | mingw32* | mingw64* | mint* \
-	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
-	     | interix* | uwin* | mks* | rhapsody* | darwin* \
-	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
-	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
-	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
-	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
-	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
-	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
-	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
-	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
-	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
-	     | fiwix* )
-		;;
-	# This one is extra strict with allowed versions
-	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		;;
-	none)
-		;;
-	*)
-		echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
-		exit 1
-		;;
-esac
-
-# As a final step for OS-related things, validate the OS-kernel combination
-# (given a valid OS), if there is a kernel.
-case $kernel-$os in
-	linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
-		   | linux-musl* | linux-relibc* | linux-uclibc* )
-		;;
-	uclinux-uclibc* )
-		;;
-	-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
-		# These are just libc implementations, not actual OSes, and thus
-		# require a kernel.
-		echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
-		exit 1
-		;;
-	kfreebsd*-gnu* | kopensolaris*-gnu*)
-		;;
-	vxworks-simlinux | vxworks-simwindows | vxworks-spe)
-		;;
-	nto-qnx*)
-		;;
-	os2-emx)
-		;;
-	*-eabi* | *-gnueabi*)
-		;;
-	-*)
-		# Blank kernel with real OS is always fine.
-		;;
-	*-*)
-		echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
-		exit 1
-		;;
-esac
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-case $vendor in
-	unknown)
-		case $cpu-$os in
-			*-riscix*)
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
 				vendor=acorn
 				;;
-			*-sunos*)
+			-sunos*)
 				vendor=sun
 				;;
-			*-cnk* | *-aix*)
+			-aix*)
 				vendor=ibm
 				;;
-			*-beos*)
+			-beos*)
 				vendor=be
 				;;
-			*-hpux*)
+			-hpux*)
 				vendor=hp
 				;;
-			*-mpeix*)
+			-mpeix*)
 				vendor=hp
 				;;
-			*-hiux*)
+			-hiux*)
 				vendor=hitachi
 				;;
-			*-unos*)
+			-unos*)
 				vendor=crds
 				;;
-			*-dgux*)
+			-dgux*)
 				vendor=dg
 				;;
-			*-luna*)
+			-luna*)
 				vendor=omron
 				;;
-			*-genix*)
+			-genix*)
 				vendor=ns
 				;;
-			*-clix*)
-				vendor=intergraph
-				;;
-			*-mvs* | *-opened*)
+			-mvs* | -opened*)
 				vendor=ibm
 				;;
-			*-os400*)
-				vendor=ibm
-				;;
-			s390-* | s390x-*)
-				vendor=ibm
-				;;
-			*-ptx*)
+			-ptx*)
 				vendor=sequent
 				;;
-			*-tpf*)
-				vendor=ibm
-				;;
-			*-vxsim* | *-vxworks* | *-windiss*)
+			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
-			*-aux*)
+			-aux*)
 				vendor=apple
 				;;
-			*-hms*)
+			-hms*)
 				vendor=hitachi
 				;;
-			*-mpw* | *-macos*)
+			-mpw* | -macos*)
 				vendor=apple
 				;;
-			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
 				vendor=atari
 				;;
-			*-vos*)
+			-vos*)
 				vendor=stratus
 				;;
 		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo "$cpu-$vendor-${kernel:+$kernel-}$os"
-exit
+echo $basic_machine$os
+exit 0
 
 # Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac	(revision 591)
+++ trunk/configure.ac	(revision 1)
@@ -1,20 +1,41 @@
-dnl We want to override the standard _AC_INIT_PARSE_ARGS
-dnl
-AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS], [], [silent])
-dnl AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
-
-AC_INIT([samhain],[4.5.3])
-AC_CONFIG_SRCDIR(src/samhain.c)
-
-AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
+dnl We want to override the standard AC_INIT_PARSE_ARGS,
+dnl which requires replacing AC_INIT() with its expanded
+dnl content.
+dnl
+dnl include own macros
+dnl
+sinclude(acsite.m4)dnl
+sinclude(./aclocal.m4)dnl
+
+dnl
+dnl AC_INIT(samhain.c)
+dnl
+# Forbidden tokens and exceptions.
+m4_pattern_forbid([^_?A[CHUM]_])
+m4_pattern_forbid([_AC_])
+m4_pattern_forbid([^LIBOBJS$],
+                  [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs. LIBOBJS'])
+# Actually reserved by M4sh.
+m4_pattern_allow([^AS_FLAGS$])
+AS_INIT
+dnl m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
+_AC_INIT_DEFAULTS
+SH_INIT_PARSE_ARGS
+_AC_INIT_SRCDIR
+SH_INIT_HELP
+_AC_INIT_VERSION
+_AC_INIT_CONFIG_LOG
+_AC_INIT_PREPARE
+_AC_INIT_NOTICE
+_AC_INIT_COPYRIGHT
+m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
+
+AC_ARG_VAR([LIBS],
+            [libraries to link against, e.g. -lintl])
 
 dnl
 dnl start
 dnl
-dnl AM_INIT_AUTOMAKE
-m4_pattern_allow([AC_DEFINE])
-AC_DEFINE([SAMHAIN], 1, [Application is samhain])
-AC_DEFINE_UNQUOTED([VERSION], [_("${PACKAGE_VERSION}")], [Current version] )
-AC_DEFINE_UNQUOTED([PACKAGE], [_("${PACKAGE_NAME}")], [Application name] )
+AM_INIT_AUTOMAKE(samhain, 2.1.1)
 AC_CANONICAL_HOST
 
@@ -24,43 +45,22 @@
 
 AC_PROG_CC
-if test "$host" != "$build"; then
-   AC_CHECK_PROGS(BUILD_CC, gcc cc)
-else
-   BUILD_CC=$CC
-fi
 AC_PROG_CPP 
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_AWK
-SH_PROG_LD
 AC_PATH_PROG(cmd_hostname,hostname)
 AC_SUBST(cmd_hostname)
-AC_SUBST(BUILD_CC)
-
-
-if test "x$GCC" = "xyes"; then
-   SH_GCC_VERSION
-fi
-
-if test "x${gcc_VERSION_MAJOR}" != "x"
-then
-	AC_MSG_CHECKING([for gcc compiler issues])
-	if test ${gcc_VERSION_MAJOR} -ge 11
-	then
-		dnmalloc_ok=no
-		AC_MSG_RESULT([dnmalloc does not work with gcc 11])
-	else
-		dnmalloc_ok=yes
-		AC_MSG_RESULT([ok])
-	fi	
-else
-	dnmalloc_ok=yes
-fi
-
-
-AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
-
-
-AC_MSG_CHECKING([for OS specific issues])
+
+GCC_STACK_PROTECT_CC
+
+AC_HEADER_STDC
+dnl
+dnl first one is a dummy because of an autoconf bug
+dnl (no HAVE_... for first one)
+dnl 
+AC_CHECK_HEADERS([sys/ipc.h sys/msg.h sys/uio.h fcntl.h])
+
+
+AC_MSG_CHECKING([for host-specific issues])
 mydebugflag=no
 myneedg3=no
@@ -69,6 +69,4 @@
 mynetbsd=no
 sh_use_lcaps="undef"
-sh_use_pie=yes
-enable_asm_ok=yes
 
 case "$host_os" in
@@ -76,19 +74,15 @@
 	*linux*)
 	sh_use_lcaps="yes"
-	AC_DEFINE([HOST_IS_LINUX], [1], [] )
-        AC_DEFINE([HAVE_EXT2_IOCTLS], [1], [] )
-	AC_MSG_RESULT([use ioctl to get e2fs flags])
+	AC_DEFINE(HOST_IS_LINUX)
+        AC_DEFINE(HAVE_EXT2_IOCTLS)
+	AC_MSG_RESULT(LINUX use ioctl to get e2fs flags)
 	case "$host_cpu" in 
 	   i*86*)
-	   AC_DEFINE([HOST_IS_I86LINUX], [1], [] )
-	   ;;
-	   x86_64)
-	   AC_DEFINE([HOST_IS_64LINUX], [1], [Define if host OS is 64bit Linux])
+	   AC_DEFINE(HOST_IS_I86LINUX)
 	   ;;
 	   *)
 	   ;;
 	esac
-	LDFLAGS="${LDFLAGS} -Wl,--as-needed"
-	;;
+        ;;
 	
 	*osf*)
@@ -98,77 +92,46 @@
 	  CFLAGS="$CFLAGS -O2 -assume noaligned_objects"
 	  myneedg3=yes
-	  AC_MSG_RESULT([compiler needs assume noaligned_objects])
+	  AC_MSG_RESULT(OSF1 compiler needs assume noaligned_objects)
 	else
-	  AC_MSG_RESULT([none])
+	  AC_MSG_RESULT(none)
         fi
         ;;
 	
 	*cygwin*) 
-	AC_DEFINE([HOST_IS_CYGWIN], [1], [] )
-	AC_DEFINE([USE_REGISTRY_CHECK], 1, [Define for registry check])
-	dnmalloc_ok=no
-	enable_asm_ok=no
-	AC_MSG_RESULT([no trusted paths, no dnmalloc. no asm optimize])
+	AC_DEFINE(HOST_IS_CYGWIN)
+	AC_MSG_RESULT(CYGWIN do not check for trusted paths)
 	;;
 
-	*darwin*|*apple*) 
-	AC_DEFINE([HOST_IS_DARWIN], [1], [] )
-	dnmalloc_ok=no
-	AC_MSG_RESULT([check resource forks, no dnmalloc])
+	*darwin*) 
+	AC_DEFINE(HOST_IS_DARWIN)
+	AC_MSG_RESULT(DARWIN check resource forks)
 	;;
 
-	*freebsd7*)
-	AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
+	*freebsd*)
+	AC_DEFINE(HOST_IS_FREEBSD)
 	selectconfig=freebsd
-	case "$host_cpu" in
-		amd64|x86_64)
-		sh_use_pie=no
-		dnmalloc_ok=no
-		AC_MSG_RESULT([no dnmalloc and broken compiler toolchain])
-		;;
-		*)
-		AC_MSG_RESULT([none])
-		;;
-	esac
-	;;
-	
-	*freebsd*)
-	AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
-	selectconfig=freebsd
-	case "$host_cpu" in
-		amd64|x86_64)
-		dnmalloc_ok=no
-		AC_MSG_RESULT([no dnmalloc])
-		;;
-		*)
-		AC_MSG_RESULT([none])
-		;;
-	esac
-	AC_MSG_RESULT([none])
+	AC_MSG_RESULT(none)
 	;;
 	
 	*openbsd*)
-	AC_DEFINE([HOST_IS_OPENBSD], 1, [Define if host OS is OPENBSD])
 	selectconfig=freebsd
-	dnmalloc_ok=no
-	AC_MSG_RESULT([dnmalloc does not work with pthreads])
+	AC_MSG_RESULT(none)
 	;;
 
 	*netbsd*)
 	mynetbsd=yes
-	selectconfig=netbsd
-	AC_MSG_RESULT([bug with libresolve])
+	AC_MSG_RESULT(NETBSD bug with libresolve)
 	;;
 
         *solaris*)
 	selectconfig=solaris
-	AC_DEFINE([HOST_IS_SOLARIS], [1], [] )
+	AC_DEFINE(HOST_IS_SOLARIS)
 	case "$host_cpu" in
 		i*86)
-		AC_DEFINE([HOST_IS_I86SOLARIS], [1], [] )
-		AC_MSG_RESULT([vsnprintf prototype])
+		AC_DEFINE(HOST_IS_I86SOLARIS)
+		AC_MSG_RESULT(SOLARIS I86 vsnprintf prototype)
 		;;
 		*)
-		AC_MSG_RESULT([none])
+		AC_MSG_RESULT(none)
 		;;
 	esac
@@ -190,10 +153,10 @@
         *sun*)
 	selectconfig=solaris
-	AC_DEFINE([HOST_IS_SOLARIS], [1], [])
-	AC_MSG_RESULT([none])
+	AC_DEFINE(HOST_IS_SOLARIS)
+	AC_MSG_RESULT(none)
         ;;
 
 	*aix*)
-        AC_DEFINE([HOST_IS_AIX], [1], [aix])
+        AC_DEFINE(HOST_IS_AIX)
 	selectconfig=aix5.2.0
 	uid_cast="unsigned long"
@@ -208,19 +171,19 @@
     		CFLAGS="$CFLAGS -qstrict"
   	  fi
-          AC_MSG_RESULT([AIX size_t in the accept call and optimize O3 qstrict])
+          AC_MSG_RESULT(AIX size_t in the accept call and optimize O3 qstrict)
 	else
-          AC_MSG_RESULT([AIX size_t in the accept call])
+          AC_MSG_RESULT(AIX size_t in the accept call)
         fi
         ;;
 	
         *hpux*)
-        AC_MSG_RESULT([HPUX need _XOPEN_SOURCE_EXTENDED for h_errno])
-	AC_DEFINE([HOST_IS_HPUX], [1], [hpux])
+        AC_MSG_RESULT(HPUX has not always h_errno defined)
+	AC_DEFINE(HOST_IS_HPUX)
 	if test "x$GCC" != "xyes"; then
   	  if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
     		CFLAGS=`echo $CFLAGS | sed 's%\-g%%' `
   	  fi
-  	  if test -z "`echo "$CFLAGS" | grep "\+O2" 2> /dev/null`"; then
-    		CFLAGS="$CFLAGS +O2"
+  	  if test -z "`echo "$CFLAGS" | grep "\-fast" 2> /dev/null`"; then
+    		CFLAGS="$CFLAGS -fast"
   	  fi
 	fi
@@ -228,16 +191,15 @@
 
         *ultrix*)
-        AC_MSG_RESULT([ULTRIX getcwd uses popen])
-        AC_DEFINE([HAVE_BROKEN_GETCWD], [1], [bad implementation of getcwd])
+        AC_MSG_RESULT(ULTRIX getcwd uses popen)
+        AC_DEFINE(HAVE_BROKEN_GETCWD)
         ;;
 
         *)
-        AC_MSG_RESULT([none])
+        AC_MSG_RESULT(none)
         ;;
 esac
 
 AC_SUBST(selectconfig)
-AC_DEFINE_UNQUOTED([UID_CAST], [${uid_cast}], [basic type to which we can cast a uid])
-
+AC_DEFINE_UNQUOTED(UID_CAST, ${uid_cast})
 
 
@@ -250,25 +212,15 @@
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
-AC_CHECK_HEADERS([sys/time.h])
+AC_HEADER_TIME
 dnl used in minilzo.c
 AC_HEADER_STAT
-
-AC_CHECK_DECLS([sys_siglist], [], [],
-[#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-])
-
-AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \
-	sys/mman.h sys/param.h sys/inotify.h sys/sysmacros.h \
-	sys/vfs.h mntent.h \
-	sys/select.h sys/socket.h netinet/in.h ifaddrs.h \
-	regex.h glob.h fnmatch.h \
-	linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h asm/segment.h \
-	elf.h linux/elf.h auparse.h \
-	paths.h arpa/nameser.h arpa/nameser_compat.h \
-	rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
+AC_DECL_SYS_SIGLIST 
+
+AC_CHECK_HEADERS(stddef.h libgen.h sched.h \
+	sys/vfs.h \
+	sys/select.h sys/socket.h netinet/in.h \
+	regex.h glob.h \
+	linux/ext2_fs.h ext2fs/ext2_fs.h \
+	paths.h arpa/nameser.h arpa/nameser_compat.h,
 	[],
 	[],
@@ -279,90 +231,20 @@
 AC_CHECK_HEADER(utmpx.h, sh_utmpx="yes", sh_utmpx="no")
 if test "x$sh_utmpx" = "xyes"; then
-  AC_DEFINE([HAVE_UTMPX_H], [1], [whether we have utmpx.h])
-  AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
-  AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
-  AC_EGREP_HEADER(ut_addr_v6, utmpx.h, AC_DEFINE([HAVE_UTADDR_V6], [1], [] ))
-  AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE([HAVE_UTXTIME], [1], [] ))
-  AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
+  if cat "/usr/include/utmpx.h" 2>&5 |
+    	egrep "WTMPX_FILE" >/dev/null 2>&1; then
+  		AC_DEFINE(HAVE_UTMPX_H)
+  		AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE(HAVE_UTHOST) )
+  		AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE(HAVE_UTADDR) )
+  		AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE(HAVE_UTXTIME) )
+  		AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE(HAVE_UTTYPE) )
+  else
+  		AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UTADDR) )
+  		AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
+  		AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
+  fi
 else
-  AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
-  AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
-  AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
-fi
-
-dnl
-dnl figure out where acct.h lives
-dnl and whether fields are int/comp_t
-dnl
-dnl GNU Accounting Utilities
-dnl Copyright (C) 1993, 1996, 1997, 2003, 2005 Free Software Foundation, Inc.
-dnl The GNU Accounting Utilities are free software; you can redistribute
-dnl them and/or modify them under the terms of the GNU General Public
-dnl License as published by the Free Software Foundation; either version
-dnl 2, or (at your option) any later version.
-dnl
-AC_CHECK_HEADER(sys/acct.h,
-		AC_DEFINE(HAVE_SYS_ACCT_H, ,
-			  [Define if you have the <sys/acct.h> header file.])
-		AC_EGREP_HEADER(ac_utime, sys/acct.h,
-				AC_DEFINE(HAVE_ACUTIME, ,
-					  [Define if <sys/acct.h> has the AC_UTIME field.])
-				AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,
-						AC_DEFINE(ACUTIME_COMPT, ,
-							  [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
-		)
-		AC_EGREP_HEADER(ac_stime, sys/acct.h,
-				AC_DEFINE(HAVE_ACSTIME, ,
-					  [Define if <sys/acct.h> has the AC_STIME field.])
-				AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
-						AC_DEFINE(ACSTIME_COMPT, ,
-							  [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
-		)
-		AC_EGREP_HEADER(ac_etime, sys/acct.h,
-				AC_DEFINE(HAVE_ACETIME, ,
-					  [Define if <sys/acct.h> has the AC_ETIME field.])
-				AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
-						AC_DEFINE(ACETIME_COMPT, ,
-							  [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
-		)
-		AC_EGREP_HEADER(ac_io,    sys/acct.h,
-				AC_DEFINE(HAVE_ACIO, ,
-					  [Define if <sys/acct.h> has the AC_IO field.])
-				AC_EGREP_HEADER(comp_t.*ac_io,    sys/acct.h,
-						AC_DEFINE(ACIO_COMPT, ,
-							  [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
-		)
-		AC_EGREP_HEADER(ac_mem,   sys/acct.h,
-				AC_DEFINE(HAVE_ACMEM, ,
-					  [Define if <sys/acct.h> has the AC_MEM field.])
-				AC_EGREP_HEADER(comp_t.*ac_mem,   sys/acct.h,
-						AC_DEFINE(ACMEM_COMPT, ,
-							  [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
-		)
-		AC_EGREP_HEADER(ac_minflt,   sys/acct.h,
-				AC_EGREP_HEADER(ac_majflt,   sys/acct.h,
-						AC_EGREP_HEADER(ac_swaps,   sys/acct.h,
-								AC_DEFINE(HAVE_PAGING, ,
-									  [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
-								AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
-										AC_DEFINE(ACMINFLT_COMPT, ,
-											  [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
-								AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
-										AC_DEFINE(ACMAJFLT_COMPT, ,
-											  [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
-								AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
-										AC_DEFINE(ACSWAPS_COMPT, ,
-											  [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
-						)
-				)
-		)
-		AC_EGREP_HEADER(comp_t,   sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
-								[Define if <sys/acct.h> uses the COMP_T type.]))
-		AC_EGREP_HEADER([struct acct_v3],   sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
-								[Define if <sys/acct.h> has struct acct_v3.]))
-		AC_EGREP_HEADER([struct acctv2],    sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
-								[Define if <sys/acct.h> has struct acctv2.]))
-
- )
+  AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
+  AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
+fi
 
 dnl need to check because AIX 4.2 does not have it
@@ -397,67 +279,45 @@
 dnl *****************************************
 AC_FUNC_STRFTIME
-AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent fpurge \
-        explicit_memset explicit_bzero \
+AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent \
 	gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
 	seteuid setreuid setresuid lstat getwd getcwd ptrace \
 	usleep setpriority getpeereid nanosleep \
-	strptime basename sched_yield hasmntopt \
+	strptime basename sched_yield \
 	inet_aton gethostbyname setutent setrlimit gethostname uname \
-	initgroups getpagesize getutxent \
-	ttyname fchmod writev mmap tzset \
-	getsid getpriority getpgid statvfs \
-	strerror_r getgrgid_r getpwnam_r getpwuid_r \
-	gmtime_r localtime_r rand_r readdir_r strtok_r \
-	mincore posix_fadvise inotify_init1 scandir
-)
-AC_CHECK_FUNC([statfs], [
-			AC_DEFINE([HAVE_STATFS], [1], [have statfs func])
-			statfs="yes"
-			], [statfs="no"])
+	initgroups getpagesize \
+	ttyname fchmod
+)
+AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes",  statfs="no")
 SL_CHECK_VA_COPY
 AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
 AC_CHECK_MLOCK
-SH_STRFTIME_Z
 
 AC_MSG_CHECKING(how to get filesystem type)
 fstype=no
 # The order of these tests is important.
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statvfs.h>
-#include <sys/fstyp.h>
-]])], [
-      AC_DEFINE([FSTYPE_STATVFS], [1], [statvfs])
-      fstype=SVR4])
-
+AC_TRY_CPP([#include <sys/statvfs.h>
+#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
 if test $fstype = no; then
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
-#include <sys/fstyp.h>
-]])], [
-      AC_DEFINE([FSTYPE_USG_STATFS], [1], [usg])
-      fstype=SVR3])
-fi
-
+AC_TRY_CPP([#include <sys/statfs.h>
+#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
+fi
 if test $fstype = no; then
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
-#include <sys/vmount.h>
-]])], AC_DEFINE([FSTYPE_AIX_STATFS], [1], [aix]) fstype=AIX)
-fi
-
+AC_TRY_CPP([#include <sys/statfs.h>
+#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
+fi
 if test $fstype = no; then
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mntent.h>
-]])], AC_DEFINE([FSTYPE_MNTENT], [1], [mtent]) fstype=4.3BSD)
-fi
-
+AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
+fi
 if test $fstype = no; then
-AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE([FSTYPE_STATFS], [1], [statfs]) fstype=4.4BSD/OSF)
-fi
-
+AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF)
+fi
 if test $fstype = no; then
-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/mount.h>
-#include <sys/fs_types.h>
-]])], AC_DEFINE([FSTYPE_GETMNT], [1], [getmnt]) fstype=Ultrix)
+AC_TRY_CPP([#include <sys/mount.h>
+#include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
 fi
 AC_MSG_RESULT($fstype)
 
 sh_libsocket=
+
 dnl Solaris needs -lsocket and -lnsl. Unisys system includes
 dnl gethostbyname in libsocket but needs libnsl for socket.
@@ -494,18 +354,4 @@
   ]) 
 
-AC_CHECK_FUNCS( getnameinfo getaddrinfo )
-
-
-sh_auparse=no
-
-if test "x$ac_cv_header_auparse_h" = "xyes"
-then
-   AC_CHECK_LIB(auparse, auparse_find_field, [
-   			 LIBS="$LIBS -lauparse"
-			 sh_auparse=yes
-			 AC_DEFINE([HAVE_AUPARSE_LIB], [1], [Define if you have the auparse lib])
-			 ])
-fi
-
 dnl arguments for accept
 
@@ -519,6 +365,5 @@
 
 AC_MSG_CHECKING(for socklen_t)
-AC_COMPILE_IFELSE(
-[AC_LANG_PROGRAM([[
+AC_TRY_COMPILE([
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -528,12 +373,9 @@
 #endif
   socklen_t x;
-]], [[]])],
-[
+], [],[
   AC_MSG_RESULT(yes)
   AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
-  AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
 ],[
-  AC_COMPILE_IFELSE(
-	[AC_LANG_PROGRAM([[
+  AC_TRY_COMPILE([
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -543,6 +385,5 @@
 #endif
     int accept (int, struct sockaddr *, size_t *);
-    ]],[[]])],
-    [
+    ],[],[
       AC_MSG_RESULT(size_t)
       AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
@@ -554,24 +395,4 @@
 ])
 
-dnl *****************************************
-dnl     checks for extended attribute or ACL 
-dnl     support
-dnl *****************************************
-
-AC_ARG_ENABLE([selinux],
-	[AS_HELP_STRING([--enable-selinux], [support checking selinux attributes])],
-	[],
-	[enable_selinux=check])
-if test "x$enable_selinux" != xno; then
-   sh_CHECK_XATTR
-fi
-
-AC_ARG_ENABLE([posix-acl],
-	[AS_HELP_STRING([--enable-posix-acl], [support checking posix acls])],
-	[],
-	[enable_posix_acl=check])
-if test "x$enable_posix_acl" != xno; then
-   sh_CHECK_POSIX_ACL
-fi
 
 dnl *****************************************
@@ -579,14 +400,10 @@
 dnl *****************************************
 
-AC_TYPE_LONG_DOUBLE
+AC_C_LONG_DOUBLE
 SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
-SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
-SH_CHECK_TYPEDEF(uint32_t, HAVE_UINT32_T)
-SH_CHECK_TYPEDEF(uint64_t, HAVE_UINT64_T)
 if test "$sh_HAVE_LONG_LONG" = "yes"; then
    AC_CHECK_SIZEOF(unsigned long long, 4)
-   sh_sizeof_unsigned_long_long=`echo "$ac_cv_sizeof_unsigned_long_long" | sed 's%[^0-9]%%g'`
-   if test "$sh_sizeof_unsigned_long_long" = "8"; then
-      AC_DEFINE([HAVE_LONG_LONG_64], [1], [Define if you have 64bit long long])
+   if test "$ac_cv_sizeof_unsigned_long_long" = "8"; then
+      AC_DEFINE(HAVE_LONG_LONG_64, 1, [Define if you have 64bit long long])
    fi
 fi
@@ -598,29 +415,27 @@
 
 AC_CHECK_SIZEOF(unsigned long,  4)
-AC_CHECK_SIZEOF(unsigned int,   4)
+AC_CHECK_SIZEOF(unsigned int ,  4)
 AC_CHECK_SIZEOF(unsigned short, 2)
     
 
-sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
-if test "$sh_sizeof_unsigned_long"  = "4"; then
-	AC_DEFINE([HAVE_LONG_32], [1], [long32])
-fi
-if test "$sh_sizeof_unsigned_long"  = "8"; then
-	AC_DEFINE([HAVE_LONG_64], [1], [long64])
-fi
-sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
-if test "$sh_sizeof_unsigned_int"   = "4"; then
-	AC_DEFINE([HAVE_INT_32], [1], [int32])
-fi
-sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
-if test "$sh_sizeof_unsigned_short" = "4"; then
-	AC_DEFINE([HAVE_SHORT_32], [1], [short32])
-fi
-
-dnl 
-dnl check for 64 bit programming environment
-dnl
-SAMHAIN_64
-
+if test "$ac_cv_sizeof_unsigned_long" = "4"; then
+	AC_DEFINE(HAVE_LONG_32)
+fi
+if test "$ac_cv_sizeof_unsigned_long" = "8"; then
+	AC_DEFINE(HAVE_LONG_64)
+fi
+if test "$ac_cv_sizeof_unsigned_int" = "4"; then
+	AC_DEFINE(HAVE_INT_32)
+fi
+
+dnl
+dnl For Alpha
+dnl
+if test "$ac_cv_sizeof_unsigned_int_" = "4"; then
+	AC_DEFINE(HAVE_INT_32)
+fi
+if test "$ac_cv_sizeof_unsigned_short" = "4"; then
+	AC_DEFINE(HAVE_SHORT_32)
+fi
 
 dnl *****************************************
@@ -635,28 +450,19 @@
 AC_MSG_CHECKING(whether struct stat has a st_flags field)
 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
-        AC_COMPILE_IFELSE(
-		[AC_LANG_PROGRAM([[
-#include <sys/stat.h>
-]],
-                [[struct stat stat; stat.st_flags = 0;]])],
+        AC_TRY_COMPILE([#include <sys/stat.h>],
+                [struct stat stat; stat.st_flags = 0;],
                 [e2fsprogs_cv_struct_st_flags=yes],
-                [e2fsprogs_cv_struct_st_flags=no]
-		))
+                [e2fsprogs_cv_struct_st_flags=no]))
 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
-
 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
   AC_MSG_CHECKING(whether st_flags field is useful)
   AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
-        AC_COMPILE_IFELSE(
-		[AC_LANG_PROGRAM([[
-#include <sys/stat.h>
-]],
-                [[struct stat stat; stat.st_flags |= UF_IMMUTABLE;]])],
+        AC_TRY_COMPILE([#include <sys/stat.h>],
+                [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
                 [e2fsprogs_cv_struct_st_flags_immut=yes],
-                [e2fsprogs_cv_struct_st_flags_immut=no]
-		))
+                [e2fsprogs_cv_struct_st_flags_immut=no]))
   AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
   if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
-          AC_DEFINE([HAVE_STAT_FLAGS], [1], [Have stat flags])
+          AC_DEFINE(HAVE_STAT_FLAGS)
   fi
 fi
@@ -666,77 +472,59 @@
 dnl
 AC_MSG_CHECKING(for struct cmsgcred)
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[
+AC_TRY_COMPILE([
 #include <sys/types.h>
 #include <sys/socket.h>
-]],[[
+],[
 struct cmsgcred cred;
 
 cred.cmcred_pid = 0;
-]])],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
+],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
 AC_MSG_RESULT($sh_have_struct_cmsgcred)
 
 if test x$sh_have_struct_cmsgcred = xyes; then
-    AC_DEFINE([HAVE_STRUCT_CMSGCRED], [1], [Have cmsgcred structure])
+    AC_DEFINE(HAVE_STRUCT_CMSGCRED,1,[Have cmsgcred structure])
 fi
 
 AC_MSG_CHECKING(for struct fcred)
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[
+AC_TRY_COMPILE([
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ucred.h>
-]],[[
+],[
 struct fcred sockcred;
-]])],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
+],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
 AC_MSG_RESULT($sh_have_struct_fcred)
 
 if test x$sh_have_struct_fcred = xyes; then
-    AC_DEFINE([HAVE_STRUCT_FCRED], [1], [Have fcred structure])
+    AC_DEFINE(HAVE_STRUCT_FCRED,1,[Have fcred structure])
 fi
 
 AC_MSG_CHECKING(for struct sockcred)
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[
+AC_TRY_COMPILE([
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ucred.h>
-]],[[
+],[
 struct sockcred sockcred;
-]])],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
+],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
 AC_MSG_RESULT($sh_have_struct_sockcred)
 
 if test x$sh_have_struct_sockcred = xyes; then
-    AC_DEFINE([HAVE_STRUCT_SOCKCRED], [1], [Have sockcred structure])
+    AC_DEFINE(HAVE_STRUCT_SOCKCRED,1,[Have sockcred structure])
 fi
 
 AC_MSG_CHECKING(for SO_PEERCRED)
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[
+AC_TRY_COMPILE([
 #include <sys/types.h>
 #include <sys/socket.h>
-]],[[
+],[
 int test = SO_PEERCRED;
-]])],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
+],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
 AC_MSG_RESULT($sh_have_SO_PEERCRED)
 
 if test x$sh_have_SO_PEERCRED = xyes; then
-    AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have SO_PEERCRED define])
-fi
-
-AC_MSG_CHECKING(for union semun)
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-]],[[
-union semun foo;
-]])], [sh_have_semun=yes], [sh_have_semun=no])
-AC_MSG_RESULT($sh_have_semun)
-if test x$sh_have_semun = xyes
-then
-  AC_DEFINE([HAVE_UNION_SEMUN], [1], [union semun already defined in sys/ipc.h or sys/sem.h])
-fi
+    AC_DEFINE(HAVE_SO_PEERCRED,1,[Have SO_PEERCRED define])
+fi
+
 
 dnl *****************************************
@@ -746,29 +534,7 @@
 AC_C_CONST
 AC_C_BIGENDIAN
-AC_C_RESTRICT
 
 AM_SA_SIGACTION_WORKS
 
-AC_ARG_ENABLE(ssp,
-	[  --disable-ssp		disable the GCC stack protector],
-	[],
-	[enable_ssp=yes;]
-)
-
-if test "x$GCC" = "xyes"; then
-
-   if test x"${enable_ssp}" = xno; then
-      :
-   else
-	GCC_STACK_PROTECT_LIB
-   	GCC_STACK_PROTECT_CC
-	GCC_STACK_CHECK_CC
-	GCC_PIE_CC
-	GCC_FLAG_CHECK([-fexceptions])
-	GCC_FLAG_CHECK([-mcet -fcf-protection])
-   fi	
-
-fi
-
 dnl *****************************************
 dnl
@@ -776,12 +542,4 @@
 dnl
 dnl *****************************************
-
-dnl
-dnl check for /proc filesystem
-dnl
-if test -d "/proc/$$"
-then
-        AC_DEFINE([HAVE_PROCFS], [1], [Define if you have a proc fs])
-fi
 
 dnl
@@ -796,59 +554,8 @@
 then
 	# LIBS="-lgmp $LIBS"
-	AC_DEFINE([HAVE_LIBGMP], [1], [Have GNU gmp library])
+	AC_DEFINE(HAVE_LIBGMP, 1, [Have GNU gmp library])
 fi
 AC_CHECK_HEADERS(gmp.h)
 
-AC_MSG_CHECKING([for ps])
-PS=
-for ff in /usr/ucb /bin /usr/bin; do
-    if test -x "$ff/ps"; then
-       PS="$ff/ps"
-       AC_MSG_RESULT([$PS])
-       break
-    fi
-done
-if test x$PS = x
-then
-	AC_MSG_RESULT([no])
-	AC_MSG_ERROR([Cannot find ps in any of /usr/ucb /bin /usr/bin])
-fi
-AC_DEFINE_UNQUOTED([PSPATH], [_("$PS")], [Path to ps executable])
-
-AC_MSG_CHECKING([how to use ps])
-$PS ax >/dev/null 2>&1
-if test $? -eq 0; then
-   case "$host_os" in
-   *openbsd*)
-   one=`$PS akx | wc -l`
-   ;;
-   *)
-   one=`$PS ax | wc -l`
-   ;;
-   esac
-else
-   one=0
-fi
-$PS -e >/dev/null 2>&1
-if test $? -eq 0; then
-   two=`$PS -e | wc -l`
-else
-   two=0
-fi
-if test $one -ge $two 
-then
-   case "$host_os" in
-   *openbsd*)
-	PSARG="akx"
-	;;
-   *)
-	PSARG="ax"
-	;;
-   esac
-else
-	PSARG="-e"
-fi
-AC_DEFINE_UNQUOTED([PSARG], [_("$PSARG")], [Argument for ps])
-AC_MSG_RESULT([$PS $PSARG])
 
 dnl *****************************************
@@ -859,8 +566,8 @@
 
 AC_ARG_ENABLE(db-reload,
-	[  --enable-db-reload		enable database reload on SIGHUP [[no]]],
+	[  --enable-db-reload		enable database reload on SIGHUP [no]],
 	[
 	if test "x${enable_db_reload}" = xyes; then
-		AC_DEFINE([RELOAD_DATABASE], [1], [database reload on SIGHUP])
+		AC_DEFINE(RELOAD_DATABASE)
 	fi
 	]
@@ -871,5 +578,5 @@
 	[
 	if test "x${enable_xml_log}" = xyes; then
-		AC_DEFINE([SH_USE_XML], [1], [logfile in XML format])
+		AC_DEFINE(SH_USE_XML)
 	fi
 	]
@@ -883,29 +590,8 @@
 		:
 	else
-		AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])
+		AC_DEFINE(SH_WITH_MAIL)
 	fi
 	],
-	[AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])]
-)
-
-AC_ARG_ENABLE(suid,
-	[  --enable-suid		allow suid],
-	[
-	if test "x${enable_suid}" = xyes; then
-		AC_DEFINE(SH_ALLOW_SUID, [1], [Define if you want to allow suid execution for samhain])
-	fi
-	]
-)
-
-AC_ARG_ENABLE(shellexpand,
-	[  --disable-shellexpand		disable shell expansion in config file],
-	[
-	if test "x${enable_shellexpand}" = xno; then
-		:
-	else
-		AC_DEFINE(SH_EVAL_SHELL, [1], [Define if you want shell expansion in configuration file])
-	fi
-	],
-	[AC_DEFINE(SH_EVAL_SHELL, [1], [Define if you want shell expansion in configuration file])]
+	[AC_DEFINE(SH_WITH_MAIL)]
 )
 
@@ -916,8 +602,8 @@
                 :
 	else
-		AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])
+		AC_DEFINE(WITH_EXTERNAL)
         fi
         ],
-	[AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])]
+	[AC_DEFINE(WITH_EXTERNAL)]
 )
 
@@ -925,25 +611,15 @@
        [  --enable-message-queue[[=MODE]]	enable SysV message queue [[MODE=0700]]],
        [
-       if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
-	   if test "x${enable_message_queue}" = xyes; then
-	       AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
-	       AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [0700], [mode of message queue])
-	   elif test "x${enable_message_queue}" != xno; then
-	       echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-		   AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be numeric])
-	       echo "${enableval}" | \
-		   grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
-		   AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be an octal (0nnn) number])
-               AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
-               AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [${enable_message_queue}], [mode of message queue])
-           fi
-       else
-           echo
-	   echo "**********************************************"
-           echo
-           AC_MSG_WARN([sys/msg.h missing, --enable-message-queue disabled])
-           echo
-           echo "**********************************************"
-           echo
+       if test "x${enable_message_queue}" = xyes; then
+               AC_DEFINE(WITH_MESSAGE_QUEUE)
+               AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, 0700)
+       elif test "x${enable_message_queue}" != xno; then
+		echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
+			AC_MSG_ERROR([--enable-message-queue: MODE must be numeric])
+		echo "${enableval}" | \
+			grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
+			AC_MSG_ERROR([--enable-message-queue: MODE must be an octal (0nnn) number])
+               	AC_DEFINE(WITH_MESSAGE_QUEUE)
+               	AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, ${enable_message_queue})
        fi
        ]
@@ -975,5 +651,5 @@
 LIBWRAP_INC=""
 AC_ARG_WITH(libwrap,
-[  --with-libwrap[=PATH]		Compile in libwrap (TCP Wrappers) support],
+[ --with-libwrap[=PATH]	Compile in libwrap (TCP Wrappers) support],
 [ AC_MSG_RESULT($withval)
   case "$withval" in
@@ -1006,15 +682,10 @@
      AC_CHECK_HEADER(tcpd.h,
 		     [],
-		     [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You need to install tcp_wrappers.]) ])
-     AC_LINK_IFELSE(
-	[AC_LANG_PROGRAM([[
-#include <tcpd.h>
-]],[[
-int allow_severity;
-int deny_severity; 
-hosts_access((struct request_info *) 0); ]])],
-	[ AC_DEFINE([SH_USE_LIBWRAP], [1], [Build with tcp wrapper support]) ],
-	[ AC_MSG_ERROR([Could not find the libwrap library.]) ]
-	)
+		     [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You must first install tcp_wrappers]) ])
+     AC_TRY_LINK([ #include <tcpd.h>
+		   int allow_severity; int deny_severity; ],
+		 [ hosts_access((struct request_info *) 0); ],
+		 [ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],
+		 [ AC_MSG_ERROR([Could not find the libwrap library.]) ])
   fi ],
   AC_MSG_RESULT(no)
@@ -1022,184 +693,8 @@
 
 
-dnl
-dnl  NETWORK OPTIONS
-dnl
-AC_ARG_ENABLE(network,
-        [  --enable-network=[[client|server]]	compile client or server [[no]]],
-        [
-        if test "x$enable_network" = xclient; then
-                mytclient="-DSH_WITH_CLIENT"
-		yulectl_prg=
-		samhainadmin_prg=
-                setpwd_prg="samhain_setpwd"
-                sh_main_prg="samhain"
-		if test "x${sh_have_gmp}" = xyes
-		then
-			LIBS="-lgmp $LIBS"
-		fi
-dnl		AC_CHECK_HEADER(sys/capability.h, 
-dnl				[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
-dnl				[sh_use_lcaps="no"])
-	elif test "x$enable_network" = xserver; then
-                mytclient="-DSH_WITH_SERVER"
-		yulectl_prg="yulectl"
-		samhainadmin_prg="scripts/samhainadmin-gpg.pl scripts/samhainadmin-sig.pl"
-                setpwd_prg="samhain_setpwd"
-                sh_main_prg="yule"
-		if test "x${sh_have_gmp}" = xyes
-		then
-			LIBS="-lgmp $LIBS"
-		fi
-		sh_use_lcaps="undef"
-        elif test "x$enable_network" = xno; then
-                mytclient="-DSH_STANDALONE"
-		yulectl_prg=
-		samhainadmin_prg=
-                setpwd_prg=
-                sh_main_prg="samhain"
-dnl		AC_CHECK_HEADER(sys/capability.h, 
-dnl				[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
-dnl				[sh_use_lcaps="no"])
-	else
-		AC_MSG_ERROR([With --enable-network=WHAT, WHAT must be client, server, or no])
-        fi
-        ],
-        [
-        mytclient="-DSH_STANDALONE"
-	setpwd_prg=
-	yulectl_prg=
-	samhainadmin_prg=
-	sh_main_prg="samhain"
-dnl	AC_CHECK_HEADER(sys/capability.h, 
-dnl			[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
-dnl			[sh_use_lcaps="no"])
-        ],
-)
-
-AC_SUBST(setpwd_prg)
-AC_SUBST(yulectl_prg)
-AC_SUBST(samhainadmin_prg)
-AC_SUBST(sh_main_prg)
-AC_SUBST(mytclient)
-
-# needed for the rpm spec
-clmytclient=`echo ${mytclient} | sed s%\-%%`
-AC_SUBST(clmytclient)
-
-sh_no_gcc_static=no
-
-AC_ARG_ENABLE(static,
-        [  --enable-static		enable static linking [[no]]],
-        [
-        if test x$enable_static = xyes; then
-		if test x"$mynetbsd" = xyes
-		then
-		  tmp_LIBS=`echo $LIBS | sed 's%\-lresolv%%' `
-		  LIBS="${tmp_LIBS}"
-		fi
-		if test x"${sh_auparse}" = xyes
-		then
-		  tmp_LIBS=`echo $LIBS | sed 's%\-lauparse%%' `
-		  LIBS="${tmp_LIBS}"
-		  AC_MSG_WARN([--enable-static: no support for Linux Auditing System])
-		fi
-
-                if test "x$GCC" = "xyes"; 
-		then
-		   if test -n "`echo "$CFLAGS" | grep "\-flto" 2> /dev/null`"
-		   then
-			AC_MSG_ERROR([--enable-static: not compatible with link-time optimisation])
-		   fi
-		   case "$host_os" in
-
-		   	*solaris*)
-				AC_MSG_WARN([option --enable-static ignored on Solaris])
-				;;
-			
-			*)
-				AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
-		   		sh_no_gcc_static=no
-                        	LDFLAGS="$LDFLAGS -static"
-				;;
-		    esac
-                else
-		   AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
-		   sh_no_gcc_static=yes
-                   case "$host_os" in
-
-                        *aix*)
-                                LDFLAGS="$LDFLAGS -bnso -bI:/lib/syscalls.exp"
-                                ;;
-
-                        *hpux*)
-                                LDFLAGS="$LDFLAGS -Wl,-a,archive"
-                                ;;
-
-                        *osf*)
-                                LDFLAGS="$LDFLAGS -non_shared"
-                                ;;
-
-                        *irix*)
-                                LDFLAGS="$LDFLAGS -non_shared"
-                                ;;
-
-                        *sco*)
-                                LDFLAGS="$LDFLAGS -dn"
-                                ;;
-
-                        *sun*)
-                                LDFLAGS="$LDFLAGS -Bstatic"
-                                ;;
-
-                        *solaris*)
-                                LDFLAGS="$LDFLAGS -Bstatic"
-                                ;;
-
-                        *)
-                        echo "***********************************************"
-                        echo "*"
-                        echo "* Don't know how to enable static linking"
-                        echo "* with your compiler. Please set the environment"
-                        echo "* variable LDFLAGS to:"
-                        echo "*     ${LDFLAGS}   + the static linking flag"
-                        echo "* and run configure again"
-                        echo "*"
-                        echo "***********************************************"
-                        ;;
-
-                   esac
-                fi
-        fi
-        ]
-)
-
-if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
-then
-dnl For threaded modules
-	ACX_PTHREAD
-	CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-	LIBS="$PTHREAD_LIBS $LIBS"
-	LDFLAGS="$PTHREAD_CFLAGS $LDFLAGS"
-	CC="$PTHREAD_CC"
-dnl For MODI_TXT
-	CHECK_ZLIB()
-fi
-
-if test x$enable_static = xyes; then
-   :
-else
-   if test x$sh_use_pie = xyes; then
-      LDFLAGS="$LDFLAGS $PIE_LDFLAGS"
-      CFLAGS="$CFLAGS $PIE_CFLAGS"
-   fi
-fi
-AC_CHECK_FUNC(pmap_getmaps, 
-	AC_DEFINE([HAVE_PMAP_GETMAPS], [1], [Define if pmap_getmaps available]), [],[])
-
-	
 #
 # this is from the snort configure.in
 #
-AC_DEFUN([FAIL_MESSAGE],[
+AC_DEFUN(FAIL_MESSAGE,[
    echo 
    echo
@@ -1216,10 +711,10 @@
 
 AC_ARG_WITH(libprelude-prefix,
-          [  --with-libprelude-prefix=PFX	Prefix where libprelude is installed (optional)],
+          [  --with-libprelude-prefix=PFX   Prefix where libprelude is installed (optional)],
           libprelude_config_prefix="$withval", libprelude_config_prefix="")
 
 AC_MSG_CHECKING(whether to use prelude)
 AC_ARG_WITH(prelude,  
-        [  --with-prelude		Prelude IDS support [[no]]],
+        [  --with-prelude	Prelude IDS support [[no]]],
         [
         if test "x${withval}" = "xno"; then
@@ -1244,10 +739,16 @@
 	       case "$sh_libprelude_version" in
 	       0.8*)
-	        AC_MSG_ERROR([You have Libprelude 0.8, which is too old. Version 0.9.6 or higher is required.])
+		sh_prelude_libs=`$LIBPRELUDE_CONFIG --libs | sed 's,\(.*\)\( -L.* -lprelude$\),\2 \1,'`
+		sh_prelude_cflags=`$LIBPRELUDE_CONFIG --cflags`
+		LIBS="$LIBS ${sh_prelude_libs}"
+		CFLAGS="$CFLAGS ${sh_prelude_cflags}"
+		AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
+		AC_DEFINE(HAVE_LIBPRELUDE_8,1,[Have libprelude 0.8])
 	       ;;
 	       *)
-	       AM_PATH_LIBPRELUDE([0.9.6],
+	       AM_PATH_LIBPRELUDE([0.9.0],
 	       [
-		AC_DEFINE([HAVE_LIBPRELUDE], [1], [Have libprelude])
+		AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
+		AC_DEFINE(HAVE_LIBPRELUDE_9,1,[Have libprelude 0.9])
 		CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
 		LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
@@ -1255,10 +756,10 @@
 	       ],
 	       [
-		AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
+		AC_MSG_ERROR([Could not find libprelude.])
 	       ])
 	       ;;
 	       esac
 	     else
-	       AC_MSG_ERROR([Could not find libprelude-config.])
+	       AC_MSG_ERROR([Could not find libprelude.])
 	     fi
 	fi
@@ -1267,4 +768,87 @@
 		AC_MSG_RESULT(no)
 	]
+)
+
+dnl     AC_MSG_CHECKING(whether to use prelude)
+dnl     AC_ARG_WITH(prelude,  
+dnl	[  --with-prelude       Prelude IDS support [[no]]],
+dnl	[
+dnl	if test "x${withval}" = "xno"; then
+dnl	    AC_MSG_RESULT(no)
+dnl	else
+dnl	  AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
+dnl	  if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
+dnl		sh_prelude_libs=`libprelude-config --libs | sed 's,\(.*\)\( -L.* -lprelude$\),\2 \1,'`
+dnl		sh_prelude_cflags=`libprelude-config --cflags`
+dnl		LIBS="$LIBS ${sh_prelude_libs}"
+dnl		CFLAGS="$CFLAGS ${sh_prelude_cflags}"
+dnl		AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
+dnl	  else
+dnl	     AC_MSG_ERROR([Could not find libprelude-config. Did you specify a valid path?])
+dnl	  fi
+dnl     fi
+dnl	],
+dnl	AC_MSG_RESULT(no)
+dnl     )
+
+AC_ARG_ENABLE(static,
+        [  --enable-static		enable static linking (recommended) [[no]]],
+        [
+        if test x$enable_static = xyes; then
+		if test x"$mynetbsd" = xyes
+		then
+		  tmp_LIBS=`echo $LIBS | sed 's%\-lresolv%%' `
+		  LIBS="${tmp_LIBS}"
+		fi
+		AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
+                if test "x$GCC" = "xyes"; then
+                        LDFLAGS="$LDFLAGS -static"
+                else
+                   case "$host_os" in
+
+                        *aix*)
+                                LDFLAGS="$LDFLAGS -bnso -bI:/lib/syscalls.exp"
+                                ;;
+
+                        *hpux*)
+                                LDFLAGS="$LDFLAGS -Wl,-a,archive"
+                                ;;
+
+                        *osf*)
+                                LDFLAGS="$LDFLAGS -non_shared"
+                                ;;
+
+                        *irix*)
+                                LDFLAGS="$LDFLAGS -non_shared"
+                                ;;
+
+                        *sco*)
+                                LDFLAGS="$LDFLAGS -dn"
+                                ;;
+
+                        *sun*)
+                                LDFLAGS="$LDFLAGS -Bstatic"
+                                ;;
+
+                        *solaris*)
+                                LDFLAGS="$LDFLAGS -Bstatic"
+                                ;;
+
+                        *)
+                        echo "***********************************************"
+                        echo "*"
+                        echo "* Don't know how to enable static linking"
+                        echo "* with your compiler. Please set the environment"
+                        echo "* variable LDFLAGS to:"
+                        echo "*     ${LDFLAGS}   + the static linking flag"
+                        echo "* and run configure again"
+                        echo "*"
+                        echo "***********************************************"
+                        ;;
+
+                   esac
+                fi
+        fi
+        ]
 )
 
@@ -1275,25 +859,27 @@
         [  --with-database=[[mysql|postgresql|oracle|odbc]]	database support [[no]]],
         [
-        if test x"$enable_static" = xyes; then
-                AC_MSG_WARN([With --enable-static,  --with-database may fail to compile.])
-        fi
         if test x"$enable_xml_log" != xyes; then
-                AC_MSG_ERROR([With --with-database,  --enable-xml-log is required as well.])
+                AC_MSG_ERROR([--with-database:  --enable-xml-log required])
         fi
         if test "x${withval}" = "xmysql"; then
-	  if test "x$zlib_found" = "x"
-	  then
-		CHECK_ZLIB()
-	  fi
 	  AC_CHECK_PROG(HAVE_MYSQL_CONFIG, mysql_config, yes, no)
           if test "$HAVE_MYSQL_CONFIG" = "yes"; then
+                echo "mysql_config found"
 		sh_mysql_libs="`mysql_config --libs`"
+		# echo ${sh_mysql_libs}
 		sh_mysql_libs="`eval echo ${sh_mysql_libs}`"
+		# echo $mysql_libs
+		# save_libs="$LIBS"
+                # LIBS="$LIBS `mysql_config --libs`"
+		# echo $LIBS
 		LIBS="$LIBS ${sh_mysql_libs}"
+		echo $LIBS
 		sh_mysql_cflags="`mysql_config --cflags`"
 		sh_mysql_cflags="`eval echo ${sh_mysql_cflags}`"
+                # CFLAGS="$CFLAGS `mysql_config --cflags`"
+		# CFLAGS="$CFLAGS ${sh_mysql_cflags}"
 		CPPFLAGS="$CPPFLAGS ${sh_mysql_cflags}"
 	  else
-		AC_MSG_CHECKING([for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME])
+		AC_MSG_CHECKING(for MySQL in /usr /usr/local /usr/local/mysql MYSQL_HOME)
 		mysql_directory="/usr /usr/local /usr/local/mysql ${MYSQL_HOME}"
 
@@ -1359,25 +945,24 @@
 		CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
 	  fi  
-          AC_DEFINE([WITH_MYSQL], [1], [Use mysql as database])
-          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
-          if test "x$zlib_found" = "xyes"
+          AC_DEFINE(WITH_MYSQL)
+          AC_DEFINE(WITH_DATABASE)
+          AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
+	  AC_MSG_CHECKING(for zlib)
+          if test "$zlib_cv_libz" = "yes"
           then
                 LIBS="$LIBS -lz -lm"
+                AC_MSG_RESULT(ok)
           else
+		AC_MSG_RESULT(failed)
 		echo
-		
-		echo " Mysql library was not found or not useable."
-		echo " Possible reasons include:"
-		echo "  - an old, incompatible version compiled from source"
-		echo "  - on Solaris, libmysql is compiled with the Solaris"
-		echo "    compiler, thus the mysql_config script provides"
-		echo "    compiler options unsuitable for gcc (move"
-		echo "    mysql_config out of your PATH)"
-		echo " For other problems, check config.log for the error"
+		echo " Either the mysql or the zlib library was not found"
+		echo " or was unusable, maybe because an old, incompatible"
+		echo " version is installed on your system, eg compiled from"
+		echo " source long time ago. See config.log for the error"
 		echo " message from the compiler."
-		echo
-		echo " If your mysql libraries are installed in an"
-		echo " unusual place, use --with-libs=-L/path/to/libdirectory"
-		echo " where libdirectory is the directory holding libmysql."
+		echo " Please review your installed mysql and zlib libraries"
+		echo " and/or use --with-libs=-L/path/to/libdirectory"
+		echo " where libdirectory is the directory holding libmysql"
+		echo " or libz."
 		if test x"$enable_static" = xyes; then
 		  echo " Note that for compiling a static binary, you need"
@@ -1385,10 +970,10 @@
 		fi
 		echo
-		AC_MSG_ERROR([Could not find libmysql, or it is not useable.]) 
+		AC_MSG_ERROR([libmysql or zlib not found or unuseable]) 
           fi
 	  AC_CHECK_HEADERS(mysql/mysql.h)
         elif test "x${withval}" = "xpostgresql"; then
-          AC_DEFINE([WITH_POSTGRES], [1], [Use postgres as database])
-          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
+          AC_DEFINE(WITH_POSTGRES)
+          AC_DEFINE(WITH_DATABASE)
 	  #
 	  PGCONF="no"
@@ -1419,12 +1004,4 @@
             if test -z "$PGSQL_DIR"; then
   	      for i in $pgsql_directory; do 
-    	        if test -r $i/include/postgresql/libpq-fe.h; then
-                  PGSQL_INC_DIR=$i/include
-		  PGSQL_DIR=$i
-                fi
-              done
-	    fi
-            if test -z "$PGSQL_DIR"; then
-  	      for i in $pgsql_directory; do 
     	        if test -r $i/include/libpq-fe.h; then
                   PGSQL_INC_DIR=$i/include
@@ -1437,10 +1014,10 @@
               tmp=""
               for i in $pgsql_directory; do
-                tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql"
+                tmp="$tmp $i/include $i/include/pgsql"
               done
               FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
 	    fi
 
-	    for i in lib lib/pgsql lib/postgresql; do
+	    for i in lib lib/pgsql; do
       		str="$PGSQL_DIR/$i/libpq.*"
       		for j in `echo $str`; do
@@ -1454,5 +1031,5 @@
 	    if test -z "$PGSQL_LIB_DIR"; then
 	      for ff in $pgsql_directory; do
-		for i in lib lib/pgsql lib/postgresql; do
+		for i in lib lib/pgsql; do
       		  str="$ff/$i/libpq.*"
       		  for j in `echo $str`; do
@@ -1469,5 +1046,5 @@
 	       tmp=""
 	       for i in $pgsql_directory; do
-		   tmp="$i/lib $i/lib/pgsql $i/lib/postgresql"
+		   tmp="$i/lib $i/lib/pgsql"
 	       done
 	       FAIL_MESSAGE("postgresql library libpq", $tmp)
@@ -1485,5 +1062,4 @@
 	    CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
 	    AC_CHECK_HEADERS(pgsql/libpq-fe.h)
-	    AC_CHECK_HEADERS(postgresql/libpq-fe.h)
 	  else
 	    pg_lib_dir=`${PGCONF} --libdir`
@@ -1535,60 +1111,32 @@
           CPPFLAGS="${CPPFLAGS} -I${ODBC_INC_DIR}"
           LIBS="${LIBS} -L${ODBC_LIB_DIR} -l$ODBC_LIB"
-          AC_DEFINE([WITH_ODBC], [1], [Use odbc as database])
-          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
+          AC_DEFINE(WITH_ODBC)
+          AC_DEFINE(WITH_DATABASE)
 
 	elif test "x${withval}" = "xoracle"; then
-
-	  AC_MSG_CHECKING(for oracle in ORACLE_HOME /usr/local /usr)
-
+	  AC_MSG_CHECKING(for oracle in /usr /usr/local ORACLE_HOME)
 	  oracle_directory="/usr /usr/local ${ORACLE_HOME}"
   	  for i in $oracle_directory; do 
-
-	      ff=`find $i -name oci.h 2>/dev/null | tail -1`
-	      if test "x$ff" = "x"; then
-	      	 :
-	      else
-		 ORACLE_INC=`dirname $ff`
-	      fi
-
-	      fg=`find $i -name libclntsh.so 2>/dev/null | tail -1`
-	      if test "x$fg" = "x"; then
-	      	 :
-	      else
-		 ORACLE_LIB=`dirname $fg`
-	      fi
-
-           done
+    	    if test -r $i/rdbms/demo/oci.h; then
+            ORACLE_DIR=$i
+          fi  
+          done
 	  
-          if test -z "$ORACLE_INC"; then
-
+          if test -z "$ORACLE_DIR"; then
               tmp=""
               for i in $oracle_directory; do
-                tmp="$tmp $i"
+                tmp="$tmp $i/rdbms/demo"
               done
-              FAIL_MESSAGE("OCI header file (oci.h) please define ORACLE_INC directory where oci.h resides", $tmp)
-
-	  elif test -z "$ORACLE_LIB"; then
-
-              tmp=""
-              for i in $oracle_directory; do
-                tmp="$tmp $i"
-              done
-              FAIL_MESSAGE("OCI library file (libclntsh.so) please define ORACLE_LIB directory where libclntsh.so resides", $tmp)
-
-          else
-
-            ORACLE_CPP_FLAGS="-I$ORACLE_INC"
-            ORACLE_LIB_DIR="$ORACLE_LIB"
-
-            AC_MSG_RESULT([$ORACLE_INC $ORACLE_LIB])
+              FAIL_MESSAGE("OCI header file (oci.h)", $tmp)
+          else 
+            for i in rdbms/demo rdbms/public network/public; do
+              ORACLE_CPP_FLAGS="$ORACLE_CPP_FLAGS -I$ORACLE_DIR/$i"
+            done
+            ORACLE_LIB_DIR="$ORACLE_DIR/lib"
+            AC_MSG_RESULT(yes)
 
             CPPFLAGS="${CPPFLAGS} ${ORACLE_CPP_FLAGS}"
 
             ORACLE_LIBS="-lclntsh"
-
-	    if test -r $ORACLE_LIB_DIR/libnnz11.so; then
-	      ORACLE_LIBS="${ORACLE_LIBS} -lnnz11"
-	    fi
             if test -r $ORACLE_LIB_DIR/libwtc9.so; then
               ORACLE_LIBS="${ORACLE_LIBS} -lwtc9"
@@ -1597,13 +1145,10 @@
             fi
             LIBS="${LIBS} -L${ORACLE_LIB_DIR} ${ORACLE_LIBS}"
-	    if test "x$GCC" != "xyes"; then
-	      CFLAGS="${CFLAGS} -fno-strict-aliasing"
-	    fi
           fi
-          AC_DEFINE([WITH_ORACLE], [1], [Use oracle as database])
-          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
+          AC_DEFINE(WITH_ORACLE)
+          AC_DEFINE(WITH_DATABASE)
 
         else
-          AC_MSG_ERROR([Option --with-database=database used with unsupported database ${withval}])
+          AC_MSG_ERROR([--with-database:  unsupported database ${withval}])
         fi
         ]
@@ -1611,14 +1156,14 @@
 
 AC_ARG_WITH(console,
-        [  --with-console=PATH           set path to console device [[/dev/console]]],
+        [  --with-console=PATH          set path to console device [[/dev/console]]],
         [
 	if test "x${withval}" != xno; then
         	mycons="$withval"
-        	AC_DEFINE_UNQUOTED([DEFAULT_CONSOLE], [_("${mycons}")], [] )
+        	AC_DEFINE_UNQUOTED(DEFAULT_CONSOLE, _("${mycons}") )
 	fi
         ])
 
 AC_ARG_WITH(altconsole,
-        [  --with-altconsole=PATH        set path to second console device [[none]]],
+        [  --with-altconsole=PATH       set path to second console device [[none]]],
         [
 	if test "x${withval}" != xno; then
@@ -1629,12 +1174,12 @@
 	],
         [myaltcons="NULL"])
-AC_DEFINE_UNQUOTED([ALT_CONSOLE], [_("${myaltcons}")], [] )
+AC_DEFINE_UNQUOTED(ALT_CONSOLE, _("${myaltcons}") )
 
 AC_ARG_WITH(timeserver,
-        [  --with-timeserver=HOST        set host address for time server [[none]]],
+        [  --with-timeserver=HOST       set host address for time server [[none]]],
         [
 	if test "x${withval}" != xno; then
         	mytimeserv="$withval"
-        	AC_DEFINE([HAVE_NTIME], [1], [use time server])
+        	AC_DEFINE(HAVE_NTIME)
 	else
 		mytimeserv="NULL"
@@ -1642,12 +1187,12 @@
         ],
         mytimeserv="NULL")
-AC_DEFINE_UNQUOTED([DEFAULT_TIMESERVER], [_("${mytimeserv}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_TIMESERVER, _("${mytimeserv}") )
 
 AC_ARG_WITH(alttimeserver,
-        [  --with-alttimeserver=HOST     set address for backup time server [[none]]],
+        [  --with-alttimeserver=HOST    set address for backup time server [[none]]],
         [
 	if test "x${withval}" != xno; then
         	myalttimeserv="$withval"
-        	AC_DEFINE([HAVE_NTIME], [1], [use time server])
+        	AC_DEFINE(HAVE_NTIME)
 	else
 		myalttimeserv="NULL"
@@ -1655,5 +1200,5 @@
         ],
         myalttimeserv="NULL")
-AC_DEFINE_UNQUOTED([ALT_TIMESERVER], [_("${myalttimeserv}")], []  )
+AC_DEFINE_UNQUOTED(ALT_TIMESERVER, _("${myalttimeserv}") )
 
 AC_ARG_ENABLE(login-watch,
@@ -1661,5 +1206,5 @@
         [
         if test "x${enable_login_watch}" = xyes; then
-                AC_DEFINE([SH_USE_UTMP], [1], [watch for login/logout])
+                AC_DEFINE(SH_USE_UTMP)
         fi
         ]
@@ -1667,70 +1212,17 @@
 
 AC_ARG_ENABLE(mounts-check,
-        [  --enable-mounts-check		check mount options on filesystems [[no]]],
+        [  --enable-mounts-check       check mount options on filesystems [[no]]],
         [
         if test "x${enable_mounts_check}" = xyes; then
-                AC_DEFINE([SH_USE_MOUNTS], [1], [check mount options])
+                AC_DEFINE(SH_USE_MOUNTS)
         fi
         ]
 )
 
-AC_ARG_ENABLE(logfile-monitor,
-        [  --enable-logfile-monitor		monitor logfiles [[no]]],
-        [
-        if test "x${enable_logfile_monitor}" = xyes; then
-	   cflags_store="$CFLAGS"
-	   CFLAGS="$CFLAGS -DPCRE2_CODE_UNIT_WIDTH=8"
-	   AC_CHECK_HEADER(pcre2.h,
-                           [ 
-			   AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
-			   LIBS="-lpcre2-8 $LIBS"
-			   ],
-			   [
-				AC_CHECK_HEADER(pcre2/pcre2.h,
-			   	[
-			   	AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
-				AC_DEFINE([HAVE_PCRE2_PCRE2_H], [1], [Define if you have pcre2/pcre2.h.])
-			   	LIBS="-lpcre2-8 $LIBS"
-			   	],
-	                   	[AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])]
-				)
-			  ]
-	   )
-	  CFLAGS="$cflags_store"
-        fi
-        ]
-)
-
-
-AC_ARG_ENABLE(process-check,
-        [  --enable-process-check	check processes [[no]]],
-        [
-        if test "x${enable_process_check}" = xyes; then
-	  	AC_CHECK_LIB([rt], [sched_getparam], sh_lrt=yes, sh_lrt=no)
-		if test x"$sh_lrt" = xyes; then
-		   LIBRT=-lrt
-		else
-		   LIBRT=
-		fi
-		LIBS="$LIBS $LIBRT"
-                AC_DEFINE([SH_USE_PROCESSCHECK], [1], [Define if you want to check processes])
-        fi
-        ]
-)
-
-AC_ARG_ENABLE(port-check,
-        [  --enable-port-check		check ports [[no]]],
-        [
-        if test "x${enable_port_check}" = xyes; then
-                AC_DEFINE([SH_USE_PORTCHECK], [1], [Define if you want to check ports])
-        fi
-        ]
-)
-
 AC_ARG_ENABLE(userfiles,
-       [  --enable-userfiles		check for users' config files [[no]]],
+       [  --enable-userfiles           check for users' config files [[no]]],
        [
        if test "x${enableval}" = "xyes"; then
-               AC_DEFINE([SH_USE_USERFILES], [1], [check user files])
+               AC_DEFINE(SH_USE_USERFILES)
        fi
        ]
@@ -1742,11 +1234,9 @@
         if test "x${enable_debug}" = "xyes"; then
                 if test "x${mydebugflag}" != "xyes"; then
-                        AC_DEFINE([MEM_DEBUG], [1], [] )
+                        AC_DEFINE(MEM_DEBUG)
                 fi
-                AC_DEFINE([WITH_TPT], [1], [] )
-                AC_DEFINE([SL_DEBUG], [1], [] )
-		AC_DEFINE([DNMALLOC_CHECKS], [1], [Debug dnmalloc])
-		AC_DEFINE([PARANOIA], [0], [Paranoia level for dnmalloc])
-                AC_DEFINE([SL_FAIL_ON_ERROR], [1], [] )
+                AC_DEFINE(WITH_TPT)
+                AC_DEFINE(SL_DEBUG)
+                AC_DEFINE(SL_FAIL_ON_ERROR)
                 if test "x${myneedg3}" = "xyes"; then
                         mydebugdef="-g3"
@@ -1755,21 +1245,4 @@
                 fi
                 mydebugit="yes"
-	elif test "x${enable_debug}" = "xmem"; then
-                AC_DEFINE([MEM_DEBUG], [1], [] )
-		AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
-                if test "x${myneedg3}" = "xyes"; then
-                        mydebugdef="-g3"
-                else
-                        mydebugdef="-g"
-                fi
-		mydebugit="yes"
-	elif test "x${enable_debug}" = "xgdb"; then
-	     	AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
-                if test "x${myneedg3}" = "xyes"; then
-                        mydebugdef="-g3"
-                else
-                        mydebugdef="-g"
-                fi
-		mydebugit="yes"
         fi
         ]
@@ -1777,71 +1250,4 @@
 AC_SUBST(mydebugdef)
 
-if test "x${enable_asm_ok}" = "xyes"; then
-   sh_enable_asm=yes
-else
-   sh_enable_asm=no
-fi
-AC_ARG_ENABLE(asm,
-        [  --disable-asm			disable asm inline code],
-        [
-        if test "x${enable_asm}" = xno; then
-	    sh_enable_asm=no
-	fi
-	]
-)
-
-if test "x${samhain_64_asm}" = xyes; then
-   	if test "x${sh_enable_asm}" = xyes; then
-	   AC_DEFINE([TIGER_OPT_ASM], [1], [Define to use tiger x86_64 optimized assembly])
-	fi
-fi
-
-AC_ARG_ENABLE(ipv6,
-        [  --disable-ipv6			disable ipv6 support],
-        [
-        if test "x${enable_ipv6}" = xno; then
-		AC_DEFINE([USE_IPV4], [1], [Define if you do not want IPv6])
-        fi
-        ]
-)
-
-if test "x${dnmalloc_ok}" = "xyes"; then
-   sh_dnmalloc_enabled=yes
-else
-   sh_dnmalloc_enabled=no
-fi
-
-AC_ARG_ENABLE(dnmalloc,
-        [  --disable-dnmalloc			disable dnmalloc],
-        [
-        if test "x${enable_dnmalloc}" = xno; then
-		sh_dnmalloc_enabled=no
-	else
-		sh_dnmalloc_enabled=yes	
-        fi
-        ]
-)
-
-dnl Handle the problem that static linking against libc.a on Linux
-dnl produces the error "multiple definitions of malloc"
-dnl
-if test "x$sh_dnmalloc_enabled" = "xyes"; then
-   if test x$enable_static = xyes; then
-      if test "x$sh_no_gcc_static" = "xyes"; then
-      	 sh_dnmalloc_enabled=no
-      else
-	 if test "x$with_gnu_ld" = "xyes"; then
-      	   LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition"
-	 else
-           sh_dnmalloc_enabled=no
-	 fi
-      fi
-   fi
-fi
-
-if test "x${sh_dnmalloc_enabled}" = xno; then
-   AC_DEFINE([USE_SYSTEM_MALLOC], [1], [Define if you want to use the system malloc])
-fi
-
 AC_ARG_ENABLE(ptrace,
         [  --enable-ptrace		use anti-debugger options [[no]]],
@@ -1849,5 +1255,5 @@
         if test "x${enable_ptrace}" = xyes; then
                 if test "x$mydebugit" != "xyes"; then
-                        AC_DEFINE([SCREW_IT_UP], [1], [anti debug])
+                        AC_DEFINE(SCREW_IT_UP)
                 fi
         fi
@@ -1861,16 +1267,10 @@
   fi
 
-dnl  -W is the older name for -Wextra
-
-  
+dnl  if test ! -z "`echo "$CFLAGS" | grep "\-O2" 2> /dev/null`" ; then
+dnl    CFLAGS=`echo $CFLAGS | sed 's%\-O2%\-O3%' `
+dnl  fi
+
   if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
-     case "$host_os" in
-     	*solaris*)
-	   CFLAGS="$CFLAGS -Wall -W -Wno-missing-braces "
-	   ;;
-	*)
-	   CFLAGS="$CFLAGS -Wall -W -Werror=implicit-function-declaration "
-	   ;;
-     esac
+    CFLAGS="$CFLAGS -Wall -W "
   fi
 
@@ -1879,5 +1279,5 @@
    if test -z "`echo "$CFLAGS" | grep "\-fno\-strength\-reduce" 2> /dev/null`" 
    then
-	GCC_FLAG_CHECK([-fno-strength-reduce])
+        CFLAGS="$CFLAGS -fno-strength-reduce"
    fi
   fi
@@ -1887,19 +1287,9 @@
    if test -z "`echo "$CFLAGS" | grep "\-fno\-omit\-frame\-pointer" 2> /dev/null`" 
    then
-        GCC_FLAG_CHECK([-fno-omit-frame-pointer])
+        CFLAGS="$CFLAGS -fno-omit-frame-pointer"
    fi
   fi
 
 fi
-
-dnl Test whether gcc supports -Wno-empty-body
-dnl Suppresses warnings from glibc pthread_cleanup_pop
-dnl
-GCC_FLAG_CHECK([-Wno-empty-body])
-
-dnl This one is for clang
-dnl
-GCC_FLAG_CHECK([-Wno-invalid-source-encoding])
-
 
 AC_MSG_CHECKING([which random module to use])
@@ -1918,13 +1308,12 @@
     * )
       AC_MSG_RESULT([invalid argument])
-      AC_MSG_ERROR([Option --with-rnd=module used with unsupported module ${use_static_rnd}])
+      AC_MSG_ERROR([--with-rnd: there is no random module ${use_static_rnd}])
       ;;
 esac
 
-dnl for entropy gathering daemon
 AC_ARG_WITH(egd-socket,
     [  --with-egd-socket=NAME  	EGD socket name],
             egd_socket_name="$withval", egd_socket_name="" )
-AC_DEFINE_UNQUOTED([EGD_SOCKET_NAME], [_("$egd_socket_name")], []  )
+AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, _("$egd_socket_name") )
 
 dnl
@@ -1938,9 +1327,9 @@
   ;;
 egd)
-  AC_DEFINE([HAVE_EGD_RANDOM], [1], [entropy gathering daemon])
+  AC_DEFINE(HAVE_EGD_RANDOM)
   try_dev_random=no
   ;;
 unix)
-  AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
+  AC_DEFINE(HAVE_UNIX_RANDOM)
   try_dev_random=no
   ;;
@@ -1951,21 +1340,21 @@
   AC_MSG_CHECKING(whether /dev/random exists)
     if test -r "/dev/srandom" && test -c "/dev/srandom"; then
-        AC_DEFINE([HAVE_URANDOM], [1], [] )
-        AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/srandom")], []  )
+        AC_DEFINE(HAVE_URANDOM)
+        AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/srandom") )
         AC_MSG_RESULT(yes)
         if test -r "/dev/urandom" && test -c "/dev/urandom"; then
-          AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], []  )
+          AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
         fi
     else
         if test -r "/dev/random" && test -c "/dev/random"; then
-                AC_DEFINE([HAVE_URANDOM], [1], [] )
-                AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/random")], []  )
+                AC_DEFINE(HAVE_URANDOM)
+                AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/random") )
                 AC_MSG_RESULT(yes)
                 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
-                   AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], []  )
+                   AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
                 fi
         else
                 AC_MSG_RESULT(no)
-                AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
+                AC_DEFINE(HAVE_UNIX_RANDOM)
         fi
     fi
@@ -1973,9 +1362,70 @@
 
 
+dnl
+dnl  NETWORK OPTIONS
+dnl
+
+
+AC_ARG_ENABLE(network,
+        [  --enable-network=[[client|server]]	compile client or server [[no]]],
+        [
+        if test "x$enable_network" = xclient; then
+                mytclient="-DSH_WITH_CLIENT"
+		yulectl_prg=
+                setpwd_prg="samhain_setpwd"
+                sh_main_prg="samhain"
+		if test "x${sh_have_gmp}" = xyes
+		then
+			LIBS="-lgmp $LIBS"
+		fi
+dnl		AC_CHECK_HEADER(sys/capability.h, 
+dnl				[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
+dnl				[sh_use_lcaps="no"])
+	elif test "x$enable_network" = xserver; then
+                mytclient="-DSH_WITH_SERVER"
+		yulectl_prg="yulectl"
+                setpwd_prg="samhain_setpwd"
+                sh_main_prg="yule"
+		if test "x${sh_have_gmp}" = xyes
+		then
+			LIBS="-lgmp $LIBS"
+		fi
+		sh_use_lcaps="undef"
+        elif test "x$enable_network" = xno; then
+                mytclient="-DSH_STANDALONE"
+		yulectl_prg=
+                setpwd_prg=
+                sh_main_prg="samhain"
+dnl		AC_CHECK_HEADER(sys/capability.h, 
+dnl				[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
+dnl				[sh_use_lcaps="no"])
+	else
+		AC_MSG_ERROR([--enable-network=WHAT: WHAT must be client, server, or no])
+        fi
+        ],
+        [
+        mytclient="-DSH_STANDALONE"
+	setpwd_prg=
+	yulectl_prg=
+	sh_main_prg="samhain"
+dnl	AC_CHECK_HEADER(sys/capability.h, 
+dnl			[AC_CHECK_LIB(cap, cap_get_proc,,sh_use_lcaps="no")],
+dnl			[sh_use_lcaps="no"])
+        ],
+)
+AC_SUBST(setpwd_prg)
+AC_SUBST(yulectl_prg)
+AC_SUBST(sh_main_prg)
+AC_SUBST(mytclient)
+
+# needed for the rpm spec
+clmytclient=`echo ${mytclient} | sed s%\-%%`
+AC_SUBST(clmytclient)
+
 AC_ARG_ENABLE(udp,
         [  --enable-udp			server can listen on port 514/udp [[no]]],
         [
         if test "x${enable_udp}" = xyes; then
-                AC_DEFINE([INET_SYSLOG], [1], [server may listen on 514/udp for syslog reports])
+                AC_DEFINE(INET_SYSLOG)
         fi
         ]
@@ -1988,10 +1438,14 @@
         if test "x${enable_encrypt}" = xno; then
 	   myencrypt=no
+	elif test "x${enable_encrypt}" = "x1"; then
+	   myencrypt=1  
         fi
         ]
 )
 if test "x${myencrypt}" = "xyes"; then
-        AC_DEFINE([SH_ENCRYPT], [1], [client/server encryption])
-        AC_DEFINE([SH_ENCRYPT_2], [1], [client/server encryption v2])
+        AC_DEFINE(SH_ENCRYPT)
+        AC_DEFINE(SH_ENCRYPT_2)
+elif test "x${myencrypt}" = "x1"; then
+        AC_DEFINE(SH_ENCRYPT)
 fi
 
@@ -2006,5 +1460,5 @@
 )
 if test "x${sh_use_srp_proto}" = xyes; then
-        AC_DEFINE([USE_SRP_PROTOCOL], [1], [auth with SRP])
+        AC_DEFINE(USE_SRP_PROTOCOL)
 fi
 
@@ -2013,9 +1467,9 @@
         [
 	echo "${withval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-		AC_MSG_ERROR([For --with-port=PORT, PORT must be numeric.])
+		AC_MSG_ERROR([--with-port: PORT must be numeric])
 	myport=${withval}
 	],
 	[myport="49777"])
-AC_DEFINE_UNQUOTED([SH_DEFAULT_PORT], [${myport}], [TCP port for client/server connection])
+AC_DEFINE_UNQUOTED(SH_DEFAULT_PORT, ${myport})
 AC_SUBST(myport)
 
@@ -2033,5 +1487,5 @@
 	],
         [mylogsrv="NULL"])
-AC_DEFINE_UNQUOTED([DEFAULT_LOGSERVER], [_("${mylogsrv}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_LOGSERVER, _("${mylogsrv}") )
 AC_SUBST(mylogsrv)
 
@@ -2049,5 +1503,5 @@
 	],
         [myaltlogsrv="NULL"])
-AC_DEFINE_UNQUOTED([ALT_LOGSERVER], [_("${myaltlogsrv}")], [] )
+AC_DEFINE_UNQUOTED(ALT_LOGSERVER, _("${myaltlogsrv}"))
 
 
@@ -2062,30 +1516,29 @@
         [
 	if test "x${enableval}" != "x"; then
-		AC_DEFINE([SH_STEALTH_NOCL], [1], [restrict CL parsing])
+		AC_DEFINE(SH_STEALTH_NOCL)
 	fi
 	if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
-	  AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
+	  AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
 	fi
 	if test "x${enableval}" = "xreload" || test "x${enableval}" = "xrestart"; then
-	  AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
+	  AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
 	fi
 	if test "x${enableval}" = "xstatus"; then
-	  AC_MSG_ERROR([For --enable-nocl=PW start/stop/reload/restart/status are reserved words.])
+	  AC_MSG_ERROR([--enable-nocl: start/stop/reload/restart/status are reserved words])
 	fi
 	if test "x${enableval}" = "xno"; then
-	  AC_MSG_ERROR([With --enable-nocl=PW, the use of --enable-nocl=no is ambiguous.])
+	  AC_MSG_ERROR([--enable-nocl: use of --enable-nocl=no is ambiguous])
 	fi
 	nocl_code="${enable_nocl}"
 	]
 )
-AC_DEFINE_UNQUOTED([NOCL_CODE], [_("${nocl_code}")], [code to enable CL parsing] )
+AC_DEFINE_UNQUOTED(NOCL_CODE, _("${nocl_code}") )
 AC_SUBST(nocl_code)
 AC_ARG_ENABLE(stealth,
         [  --enable-stealth=XOR_VAL	enable stealth mode [[no]]],
-        [
-	AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
+        [AC_DEFINE(SH_STEALTH)
 	if test "x${enableval}" != "xyes"; then
 		echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-			AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be numeric.])
+			AC_MSG_ERROR([--enable-stealth: XOR_VAL must be numeric])
 		if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
 			if test x"${enableval}" = x0
@@ -2093,5 +1546,5 @@
 				:
 			else
-				AC_MSG_ERROR([For --enable-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
+				AC_MSG_ERROR([--enable-stealth: XOR_VAL must be in the range 127 to 255])
 			fi
 		fi
@@ -2109,9 +1562,9 @@
         [  --enable-micro-stealth=XOR_VAL	enable micro stealth mode [[no]]],
         [
-	AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
-	AC_DEFINE([SH_STEALTH_MICRO], [1], [enable micro stealth mode])
+	AC_DEFINE(SH_STEALTH)
+	AC_DEFINE(SH_STEALTH_MICRO)
 	if test "x${enableval}" != "xyes"; then
 		echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-			AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be numeric.])
+			AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be numeric])
 		if test "${enableval}" -lt 127 || test "${enableval}" -gt 255; then
 			if test x"${enableval}" = x0
@@ -2119,5 +1572,5 @@
 				:
 			else
-				AC_MSG_ERROR([For --enable-micro-stealth=XOR_VAL, XOR_VAL must be in the range 127 to 255.])
+				AC_MSG_ERROR([--enable-micro-stealth: XOR_VAL must be in the range 127 to 255])
 			fi
 		fi
@@ -2159,9 +1612,9 @@
 	fi
 	echo "${myident}" | grep ['[^0123456789]'] >/dev/null 2>&1 || \
-		AC_MSG_ERROR([With --enable-identity=USER, please supply a username, not a UID.])
+		AC_MSG_ERROR([--enable-identity: need username, not UID])
 	myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
 	  grep "^${myident}:" | awk -F: '{ print $3; }'`
 	if test x"${myident_uid}" = x; then
-	  AC_MSG_WARN([Option --enable-identity used, user ${myident} will be added upon install.])
+	  AC_MSG_WARN([--enable-identity: user ${myident} will be added upon install])
 	  need_user_install=1
 	fi
@@ -2185,8 +1638,85 @@
 	fi
 	])
-AC_DEFINE_UNQUOTED([DEFAULT_IDENT], [_("${myident}")], [use this as install name] )
+AC_DEFINE_UNQUOTED(DEFAULT_IDENT, _("${myident}") )
 AC_SUBST(myident)
 AC_SUBST(need_user_install)
 
+sh_insmod_cmd=": # no kernel module"
+sh_lkm=""
+lkm_inc=""
+khidemap="/boot/System.map"
+sh_syscalltable="0x0"
+AC_ARG_ENABLE(khide,
+	[  --enable-khide=SYSTEM_MAP		use kernel module to hide (Linux only)[[/boot/System.map]]],
+	[
+	if test "x${enable_khide}" != xno; then
+	   if test "x${enableval}" != "xyes"; then
+		khidemap="${enableval}"
+	   fi
+	   sh_syscalltable=`grep 'D sys_call_table' ${khidemap} | awk '{print $1}'`
+	   if test x"$sh_syscalltable" = x; then
+		sh_syscalltable=`grep 'd sys_call_table' ${khidemap} | awk '{print $1}'`
+		if test x"$sh_syscalltable" = x; then
+			AC_MSG_ERROR([--enable-khide: symbol sys_call_table not found in ${khidemap}])
+		fi
+	   fi
+	   sh_syscalltable="0x${sh_syscalltable}"
+	   install_name_len=`echo ${install_name} | awk '{ print(length()); }'`
+	   if test "${install_name_len}" -gt 15 ; then
+		AC_MSG_ERROR([--enable-khide: install_name exceeds 15 char length limit])
+	   fi
+	   AC_DEFINE(SH_USE_LKM)
+	   AC_DEFINE_UNQUOTED(SH_MAGIC_HIDE, "${install_name}")
+
+	   # -- NEW --
+	   kernel_version=`uname -r | sed s,2.6.*,LINUX26,`
+	   if test x"$kernel_version" = xLINUX26
+	   then
+		sh_modlist_lock=`egrep ['[bd] modlist_lock$'] ${khidemap} | awk '{print $1}'` 
+		if test x"$sh_modlist_lock" = x; then
+			AC_MSG_ERROR([--enable-khide: symbol modlist_lock not found in ${khidemap}])
+		fi
+		sh_modlist_lock="0x${sh_modlist_lock}"
+		AC_DEFINE_UNQUOTED(SH_MODLIST_LOCK, ${sh_modlist_lock}, [The address of the modules list spinlock])
+
+		sh_list_modules=`egrep 'd modules$' ${khidemap} | awk '{print $1}'` 
+		if test x"$sh_list_modules" = x; then
+			AC_MSG_ERROR([--enable-khide: symbol modules not found in ${khidemap}])
+		fi
+		sh_list_modules="0x${sh_list_modules}"
+		AC_DEFINE_UNQUOTED(SH_LIST_MODULES, ${sh_list_modules}, [The address of the modules list])
+
+		AC_DEFINE(LINUX26, 1, [Define if kernel is 2.6])
+	   	sh_insmod_cmd="modprobe ${install_name}_hide"
+	   	sh_lkm="samhain_hide.ko"
+	   else
+		sh_insmod_cmd="insmod ${install_name}_hide; insmod ${install_name}_erase; rmmod ${install_name}_erase"
+		sh_lkm="samhain_hide.o samhain_erase.o"
+	   fi
+	   # -- END NEW --
+
+	   kvers=`uname -r`
+	   if test -f /lib/modules/${kvers}/build/include/linux/kernel.h; then
+		lkm_inc="-I/lib/modules/${kvers}/build/include"
+	   else
+		AC_MSG_WARN([--enable-khide: /lib/modules/${kvers}/build/include/linux not found])
+		AC_MSG_WARN([--enable-khide: You may need to install the kernel-source])
+		AC_MSG_WARN([--enable-khide: headers for the currently-running kernel.])
+	   fi
+	   sh_is_vanilla_kernel=yes
+	   if test -f /lib/modules/${kvers}/build/include/linux/sched.h; then
+		grep 'next_task,' /lib/modules/${kvers}/build/include/linux/sched.h  >/dev/null 2>&1 || sh_is_vanilla_kernel=no
+	   fi
+	   if test x"${sh_is_vanilla_kernel}" = xno; then
+		echo "This is not a 2.4 vanilla kernel"
+	   else
+		AC_DEFINE(SH_VANILLA_KERNEL)
+	   fi
+	fi
+	]
+)
+AC_SUBST(lkm_inc)
+AC_SUBST(sh_lkm)
+AC_SUBST(sh_insmod_cmd)
 AC_SUBST(install_name)
 AC_SUBST(INSTALL_NAME)
@@ -2194,5 +1724,6 @@
 AC_SUBST(xor_code)
 
-AC_DEFINE_UNQUOTED([XOR_CODE], [${xor_code}], [] )
+AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
+AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
 
 
@@ -2201,7 +1732,7 @@
 exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
 
-AC_DEFINE_UNQUOTED([EXEPACK_STATE_0], [${exepack_state0}], [exepack init key p1])
-AC_DEFINE_UNQUOTED([EXEPACK_STATE_1], [${exepack_state1}], [exepack init key p2])
-AC_DEFINE_UNQUOTED([EXEPACK_STATE_2], [${exepack_state2}], [exepack init key p3])
+AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
+AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
+AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
 
 
@@ -2210,9 +1741,37 @@
 	[
 	if test "x${enableval}" = "xyes"; then 
-		AC_DEFINE([SH_USE_SUIDCHK], [1], [check for suid/sgid files])
+		AC_DEFINE(SH_USE_SUIDCHK)
 	fi
 	]
 )
 
+
+systemmap="/boot/System.map"
+sh_libkvm=""
+AC_ARG_WITH(kcheck,
+	[  --with-kcheck=SYSTEM_MAP	check Linux kernel integrity [[/boot/System.map]]],
+	[
+	if test "x${withval}" != "xno"; then 
+		AC_DEFINE(SH_USE_KERN)
+		kernelversion=`uname -r`
+		AC_DEFINE_UNQUOTED(SH_KERNEL_VERSION, _("${kernelversion}"), [Define the kernel version])
+		if test "x${withval}" != "xyes"; then
+			systemmap="${withval}"
+		fi
+		if test "x${cross_compiling}" = xyes; then
+			:
+		elif test "x$selectconfig" = "xfreebsd"; then
+			LIBS="$LIBS -lkvm"
+			sh_libkvm="-lkvm"
+		elif test -f "${systemmap}"; then 
+			:
+		else
+			AC_MSG_ERROR([--with-kcheck: cannot find system map ${systemmap}])
+		fi
+	fi
+	]
+)
+AC_SUBST(systemmap)
+AC_SUBST(sh_libkvm)
 
 AC_ARG_ENABLE(base,
@@ -2224,13 +1783,13 @@
         AC_MSG_RESULT(${my_key_A} ${my_key_B})
 	if test "x${my_key_A}" = x; then
-		AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid first base key (zero length).])
+		AC_MSG_ERROR([--enable-base: first base key has zero length])
 	fi
 	if test "x${my_key_B}" = x; then
-		AC_MSG_ERROR([Option --enable-base=B1,B2 used with invalid second base key (zero length).])
+		AC_MSG_ERROR([--enable-base: second base key has zero length])
 	fi
 	echo "${my_key_A}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-		AC_MSG_ERROR([For --enable-base=B1,B2,  B1 and B2 must be numeric in the range 0 to 2147483647.])
+		AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
 	echo "${my_key_B}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-		AC_MSG_ERROR([For --enable-base=B1,B2,  B1 and B2 must be numeric in the range 0 to 2147483647.])
+		AC_MSG_ERROR([--enable-base: base key must be numeric in the range 0 to 2147483647])
         ],
         [
@@ -2281,107 +1840,18 @@
 pos_tf=`expr $pos_tf_2 + 1`
 AC_MSG_RESULT(${pos_tf})
-AC_DEFINE_UNQUOTED([POS_TF], [${pos_tf}], []  )
+AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
 
 mykeybase=`echo ${my_key_A},${my_key_B}`
-AC_DEFINE_UNQUOTED([DEFKEY], [${mykeybase}], []  )
+AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
 AC_SUBST(mykeybase)
 
 
 dnl
-dnl  Signify/GnuPG options
+dnl  GPG/PGP options
 dnl 
-
-AC_ARG_WITH(signify,
-        [  --with-signify=PATH 		use OpenBSD signify to verify database/config [[no]]],
-        [
-	if test "x${withval}" != "xno"; then
-	  if test "x${cross_compiling}" = xyes; then
-		mysignify="${withval}"
-	  else
-		if test -f "${withval}"; then
-		  mysignify="${withval}"
-		  mychk0=`gpg --load-extension tiger --print-md TIGER192 ${withval} 2>/dev/null`
-		  if test "x$?" != "x0"; then
-		    mychktest=no
-		    for sam_pre in ./samhain ./yule /usr/local/sbin/samhain /usr/local/bin/samhain /usr/bin/samhain /usr/sbin/samhain /usr/local/sbin/yule /usr/local/bin/yule /usr/bin/yule /usr/sbin/yule; do
-		      if test x"${mychktest}" = xyes
-		      then
-			:
-		      else
-		        if test -f ${sam_pre}
-		        then
-			  echo "use existing ${sam_pre} for signify checksum"
-			  mychk0=`${sam_pre} -H ${withval} 2>/dev/null`
-			  if test "x$?" != "x0"; then
-			    if test "x${nocl_code}" != "x"; then
-			       mychk0=`echo -H ${withval} | ${sam_pre} ${nocl_code} 2>/dev/null`
-			       if test "x$?" != "x0"; then
-			       	  :
-			       else
-			          mychk="${mychk0}"
-				  mychktest=yes
-			       fi 
-			    fi
-			  else
-			    mychk="${mychk0}"
-			    mychktest=yes
-			  fi
-		        fi
-		      fi
-		    done
-		    if test x${mychktest} = xno; then
-		      AC_MSG_WARN([--with-signify: cannot determine TIGER192 checksum of ${withval}])
-		      echo "-------------------------------------------------------------"
-		      echo " I cannot find an existing GnuPG or samhain binary to use."
-		      echo " You can:"
-		      echo "   (a) run make to compile a samhain binary, then repeat"
-		      echo "       ./configure and make"
-		      echo "   (b) ignore the failure. The checksum of the signify binary"
-		      echo "       will not get compiled in, thus allowing an attacker"
-		      echo "       to replace signify with a trojan and subverting the"
-		      echo "       signature verification of configure and database files."
-		      echo
-		      echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
-		      echo "-------------------------------------------------------------"
-		    fi
-		  else
-		    mychk="${mychk0}"
-		  fi
-		else
-		  AC_MSG_ERROR([--with-signify: cannot find signify PATH=${withval}])
-		fi
-	  fi
-	  AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
-	  AC_DEFINE([WITH_SIGNIFY], [1], [Define if using OpenBSD signify for signature checking.])
-	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mysignify}")], [Define as path to signing binary])
-	  AC_SUBST(mysignify)
-	fi
-	]
-)
-
-AC_ARG_WITH(pubkey-checksum,
-        [  --with-pubkey-checksum=CHKSUM	compile in TIGER192 checksum of signify public key [[no]]],
-        [
-	if test "x${withval}" != "xno"; then
-		if test "x${withval}" == "xyes"; then
-		   	AC_MSG_ERROR([Option --with-pubkey-checksum=CHKSUM: checksum CHKSUM of signify public key not specified.])
-		else
-			if test "x${withval}" = "x"; then
-				AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signify public key not specified.])
-			fi
-		fi
-		AC_DEFINE([HAVE_SIG_KEY_HASH], [1], [Define if signing binary checksum available.])
-		AC_DEFINE_UNQUOTED([SIG_KEY_HASH], [_("${withval}")], [Define as the signify public key checksum.] )
-	fi
-	]
-)
-
 
 AC_ARG_WITH(gpg,
         [  --with-gpg=PATH 		use GnuPG to verify database/config [[no]]],
         [
-	if test "x${mysignify}" != "x"; then
-	   AC_MSG_ERROR([--with-gpg: already using --with-signify])
-	fi
 	if test "x${withval}" != "xno"; then
 	  if test "x${cross_compiling}" = xyes; then
@@ -2403,13 +1873,5 @@
 			  mychk0=`${sampre} -H ${withval} 2>/dev/null`
 			  if test "x$?" != "x0"; then
-			    if test "x${nocl_code}" != "x"; then
-			       mychk0=`echo -H ${withval} | ${sampre} ${nocl_code} 2>/dev/null`
-			       if test "x$?" != "x0"; then
-			       	  :
-			       else
-			          mychk="${mychk0}"
-				  mychktest=yes
-			       fi 
-			    fi
+			    :
 			  else
 			    mychk="${mychk0}"
@@ -2431,6 +1893,4 @@
 		      echo "       to replace gpg with a trojan and subverting the gpg"
 		      echo "       signature verification of configure and database files."
-		      echo
-		      echo " PLEASE IGNORE THIS MESSAGE IF YOU ALSO USE --with-checksum"
 		      echo "-------------------------------------------------------------"
 		    fi
@@ -2439,10 +1899,9 @@
 		  fi
 		else
-		  AC_MSG_ERROR([--with-gpg: cannot find GnuPG PATH=${withval}])
+		  AC_MSG_WARN([--with-gpg: cannot find GnuPG PATH=${withval}])
 		fi
 	  fi
-	  AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
-	  AC_DEFINE([WITH_GPG], [1], [] )
-	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mygpg}")], [Define as path to signing binary])
+	  AC_DEFINE(WITH_GPG)
+	  AC_DEFINE_UNQUOTED(DEFAULT_GPG_PATH, _("${mygpg}") )
 	  AC_SUBST(mygpg)
 	fi
@@ -2450,27 +1909,13 @@
 )
 
-
-
-AC_ARG_WITH(keyid,
-	[  --with-keyid=KEYID		specify KeyID (0x...) for GPG/PGP functions [[none]]],
-	[
-	if test "x${withval}" != "x"; then
-		echo "${withval}" | awk '{if((length($0)==10)||(length($0)==18)){exit 2}else{exit 0}}' &&
-		AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
-		echo "${withval}" | grep ['[^0][^x][^0123456789ABCDEFabcdef]'] >/dev/null 2>&1 &&
-		AC_MSG_ERROR([--with-keyid:${withval} must be "0x" + 8|16 hex digits])
-		mykeyid="$withval"
-		mykeytag="--default-key"
-	else
-		mykeyid=""
-		mykeytag=""
-	fi
-	AC_SUBST(mykeyid)
-	AC_SUBST(mykeytag)
-	]
-)
+dnl AC_ARG_WITH(pgp,
+dnl        [  --with-pgp=PATH		Use PGP to verify database/config (no).],
+dnl         [myppg="$withval"
+dnl 	AC_DEFINE(WITH_PGP)
+dnl 	AC_DEFINE_UNQUOTED(DEFAULT_PGP_PATH, _("${myppg}") )
+dnl 	])
 
 AC_ARG_WITH(checksum,
-        [  --with-checksum=CHKSUM	compile in checksum of signing binary (e.g. gpg) [[yes]]],
+        [  --with-checksum=CHKSUM	compile in gpg/pgp checksum [[yes]]],
         [
 	if test "x${withval}" != "xno"; then
@@ -2478,5 +1923,5 @@
 			if test "x${mychk}" != "x"; then
 				if test "x${mychk}" != "x${withval}"; then
-					AC_MSG_WARN([--with-checksum: possible signing binary CHKSUM problem])
+					AC_MSG_WARN([--with-checksum: possible gpg CHKSUM problem])
 					AC_MSG_WARN([--with-checksum: CHKSUM=${withval}])
 					AC_MSG_WARN([--with-checksum: autodetected=${mychk}])
@@ -2486,19 +1931,18 @@
 		else
 			if test "x${mychk}" = "x"; then
-				AC_MSG_ERROR([Option --with-checksum=CHKSUM: checksum CHKSUM of the signing binary not specified.])
+				AC_MSG_ERROR([--with-checksum: gpg CHKSUM not specified])
 			fi
 		fi
-		AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
-		AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
-		echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h 
+		AC_DEFINE(HAVE_GPG_CHECKSUM)
+		AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
+		echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char gpgchk[50];"; for (i=1; i <= m; i++) printf "gpgchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_gpg_chksum.h 
 	fi
 	],
 	[
-	if test "x${mygpg}" != "x" || test "x${mysignify}" != "x"
-	then
+	if test "x${mygpg}" != "x"; then
 		if test "x${mychk}" != "x"; then
-		   	AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
-			AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
-			echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h 
+			AC_DEFINE(HAVE_GPG_CHECKSUM)
+			AC_DEFINE_UNQUOTED(GPG_HASH, _("${mychk}") )
+			echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char gpgchk[50];"; for (i=1; i <= m; i++) printf "gpgchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_gpg_chksum.h 
 		fi
 	fi
@@ -2514,5 +1958,5 @@
 			echo "${withval0}" | \
 			grep ['[^0123456789abcdefABCDEF]'] >/dev/null 2>&1 &&
-			AC_MSG_ERROR([In option --with-fp=FINGERPRINT, there is an invalid character(s) in FINGERPRINT=${withval0}.])
+			AC_MSG_ERROR([--with-fp: invalid character(s) in FINGERPRINT=${withval0}])
 			sh_len=`echo ${withval0} | wc -c | sed 's% %%g'`
 			sh_len0=`expr ${sh_len} \- 1`
@@ -2520,12 +1964,12 @@
 			then
 				myfp="${withval0}"
-				AC_DEFINE([USE_FINGERPRINT], [1], [] )
-				AC_DEFINE_UNQUOTED([SH_GPG_FP], [_("${myfp}")], []  )
+				AC_DEFINE(USE_FINGERPRINT)
+				AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
 				echo "${myfp}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef FINGERPRINT_H"; print "#define FINGERPRINT_H"; printf "char gpgfp[%d];\n", m+1; for (i=1; i <= m; i++) printf "gpgfp[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgfp[%d] = %c%c0%c;\n", m, 39, 92, 39; print "#endif"; }' > sh_gpg_fp.h 
 			else
-				AC_MSG_ERROR([In option --with-fp=FINGERPRINT, the length (${sh_len0}) of FINGERPRINT ${withval0} is incorrect.])
+				AC_MSG_ERROR([--with-fp: length (${sh_len0}) of FINGERPRINT ${withval0} incorrect])
 			fi
 		else
-			AC_MSG_ERROR([For option --with-fp=FINGERPRINT, FINGERPRINT=yes is invalid, please specify a valid key fingerprint.])
+			AC_MSG_ERROR([--with-fp: usage error ... FINGERPRINT=yes])
 		fi
 	fi
@@ -2544,15 +1988,13 @@
 	do
 		case ${sh_item} in
-		*@localhost)
-		;;
 		*@*.*)
 		sh_tmp=`echo ${sh_item} | awk '{ if ($1 ~ [/^[a-zA-Z0-9][a-zA-Z0-9\-_\.]*@[a-zA-Z0-9\-\.]+\.([a-zA-Z]+|[0-9]+)$/]) {print 1; } else { print 0}}'`
 		if test "x${sh_tmp}" != "x1"
 		then
-			AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
+			AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
 		fi 
 		;;
 		*)
-		AC_MSG_ERROR([Option --with-recipient=ADDR used with invalid mail address ${sh_item}.])
+		AC_MSG_ERROR([--with-recipient: invalid mail address ${sh_item}])
 		;;
 		esac
@@ -2561,5 +2003,5 @@
 	],
         [myrcp="NULL"])
-AC_DEFINE_UNQUOTED([DEFAULT_MAILADDRESS], [_("${myrcp}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
 
 
@@ -2572,5 +2014,5 @@
 	mysender="daemon"
 	])
-AC_DEFINE_UNQUOTED([DEFAULT_SENDER], [_("${mysender}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
 
 
@@ -2587,5 +2029,5 @@
 	do
 		echo "${sh_tmp1}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
-			AC_MSG_ERROR([Option --with-trusted=UID used with non-numeric UID in ${withval}.])
+			AC_MSG_ERROR([--with-trusted: non-numeric UID in ${withval}])
 		if test "x${sh_tmp1}" = "x0"
 		then
@@ -2600,8 +2042,6 @@
 	],
         [mytrust="0"] )
-AC_DEFINE_UNQUOTED([SL_ALWAYS_TRUSTED], [${mytrust}], [UIDs of trusted users] )
+AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
 AC_SUBST(mytrust)
-
-mytmpdir=
 
 AC_ARG_WITH(tmp-dir,
@@ -2609,21 +2049,15 @@
         [
 	if test "x${cross_compiling}" = xyes; then
-		mytmpdir="$withval"
-		AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
+		:
 	else
 		if test -d "${withval}"; then
-			mytmpdir="$withval"
-			AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
+			my_tmp_dir="$withval"
+			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
 		else
-			mytmpdir="$withval"
-			AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
-			AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
+			AC_MSG_ERROR([--with-tmp-dir: tmp directory ${withval} does not exist])
 		fi
 	fi
 	]
 )
-
-AC_SUBST(mytmpdir)
-
 
 dnl
@@ -2717,5 +2151,5 @@
 	]
 )
-AC_DEFINE_UNQUOTED([DEFAULT_CONFIGFILE], [_("${myconffile}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
 AC_SUBST(myconffile)
 AC_SUBST(myrpmconffile)
@@ -2739,6 +2173,6 @@
 	]
 )
-AC_DEFINE_UNQUOTED([DEFAULT_ERRFILE], [_("${mylogfile}")], []  )
-AC_DEFINE_UNQUOTED([DEFAULT_LOGDIR], [_("${mylogdir}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
+AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
 AC_SUBST(mylogfile)
 AC_SUBST(mylogdir)
@@ -2753,15 +2187,10 @@
 	],
 	[
-	if test -h /var/run && test -d /run; then
-		mylockfile="/run/${install_name}.pid"
-		mylockdir="/run"
-	else
-		mylockfile="${localstatedir}/run/${install_name}.pid"
-		mylockdir="${localstatedir}/run"
-	fi
+	mylockfile="${localstatedir}/run/${install_name}.pid"
+	mylockdir="${localstatedir}/run"
 	]
 )
-AC_DEFINE_UNQUOTED([DEFAULT_ERRLOCK], [_("${mylockfile}")], []  )
-AC_DEFINE_UNQUOTED([DEFAULT_PIDDIR], [_("${mylockdir}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
+AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
 AC_SUBST(mylockfile)
 AC_SUBST(mylockdir)
@@ -2793,5 +2222,5 @@
 			echo "It should be REQ_FROM_SERVER/some/local/path"
 		fi
-		AC_MSG_ERROR([Option --with-data-file=FILE used with invalid path ${withval}.])
+		AC_MSG_ERROR([--with-data-file: invalid path ${withval}])
 	fi
 	],
@@ -2800,12 +2229,12 @@
 	myrpmdatafile="${mydatafile}"
 	])
-AC_DEFINE_UNQUOTED([DEFAULT_DATA_FILE], [_("${mydatafile}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
 AC_SUBST(mydatafile)
 AC_SUBST(myrpmdatafile)
 
-AC_DEFINE_UNQUOTED([DEFAULT_DATAROOT], [_("${mydataroot}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
 AC_SUBST(mydataroot)
 
-AC_DEFINE_UNQUOTED([DEFAULT_QDIR], [_("${mydataroot}/.quarantine")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
 AC_SUBST(myqdir)
 
@@ -2819,5 +2248,5 @@
         myhtmlfile="${mylogdir}/${install_name}.html"
 	])
-AC_DEFINE_UNQUOTED([DEFAULT_HTML_FILE], [_("${myhtmlfile}")], []  )
+AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
 AC_SUBST(myhtmlfile)
 
@@ -2835,31 +2264,16 @@
 
 
-AC_DEFINE_UNQUOTED([SH_INSTALL_DIR],  [_("${sbindir}")], [] )
-AC_DEFINE_UNQUOTED([SH_INSTALL_PATH], [_("${sbindir}/${install_name}")], [] )
-AC_DEFINE_UNQUOTED([SH_INSTALL_NAME], [_("${install_name}")], [] )
-
-AH_TOP([
-#ifndef SH_CONFIG_H
-#define SH_CONFIG_H
-])
-AH_BOTTOM([
-#ifdef SH_STEALTH
-char * globber(const char * string);
-#define _(string) globber(string) 
-#define N_(string) string
-#else
-#define _(string)  string 
-#define N_(string) string
-#endif
-
-#endif
-])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([
+AC_DEFINE_UNQUOTED(SH_INSTALL_DIR,  _("${sbindir}"))
+AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
+AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
+
+AC_CONFIG_HEADER(config.h)
+
+AC_OUTPUT(
+[
 Makefile
 samhain-install.sh
 init/samhain.startLSB
 init/samhain.startLinux
-init/samhain.startSystemd
 init/samhain.startGentoo
 init/samhain.startFreeBSD
@@ -2867,42 +2281,25 @@
 init/samhain.startHPUX
 init/samhain.startIRIX
-init/samhain.startMACOSX
 samhain.spec
 rules.deb
 rules.deb-light
 hp_ux.psf
-scripts/logrotate
 scripts/samhain.spec
 scripts/redhat_i386.client.spec
 scripts/samhain.ebuild
 scripts/samhain.ebuild-light
-scripts/samhainadmin-gpg.pl
-scripts/samhainadmin-sig.pl
-scripts/yuleadmin.pl
+scripts/samhainadmin.pl
 scripts/check_samhain.pl
 deploy.sh
-])
-AC_CONFIG_COMMANDS([stamp-h],[
+],
+[
 echo timestamp > stamp-h
 chmod +x samhain-install.sh
-chmod +x scripts/samhainadmin-gpg.pl
-chmod +x scripts/samhainadmin-sig.pl
-chmod +x scripts/yuleadmin.pl
+chmod +x scripts/samhainadmin.pl
 chmod +x scripts/check_samhain.pl
 ]
 )
-AC_OUTPUT
 
 chmod +x deploy.sh
-
-if test "x${mysignify}" != x
-then
-	cp -a scripts/samhainadmin-sig.pl scripts/samhainadmin.pl
-fi 
-if test "x${mygpg}" != x
-then
-	cp -a scripts/samhainadmin-gpg.pl scripts/samhainadmin.pl
-fi 
-
 
 if test "x${cross_compiling}" = xyes
@@ -2919,5 +2316,5 @@
 echo "ac_cv_sizeof_char_p         size of pointer to char ${ac_cv_sizeof_char_p}"
 echo "ac_cv_sizeof_char_p         size of size_t          ${ac_cv_sizeof_size_t}"
-echo "ac_cv_sizeof_unsigned_int   size of unsigned int    ${ac_cv_sizeof_unsigned_int}"
+echo "ac_cv_sizeof_unsigned_int_  size of unsigned int    ${ac_cv_sizeof_unsigned_int_}"
 echo "ac_cv_sizeof_unsigned_long  size of unsigned long   ${ac_cv_sizeof_unsigned_long}"
 echo "ac_cv_sizeof_unsigned_short size of unsigned short  ${ac_cv_sizeof_unsigned_short}"
@@ -2945,13 +2342,8 @@
 	echo "  Configuration file: ${myconffile}"
 	echo "        Manual pages: ${mandir}"
-	echo "      Data directory: ${mydataroot}"
-	echo "       Database file: ${mydatafile}"
+	echo "                Data: ${mydataroot}"
 	echo "            PID file: ${mylockfile}"
 	echo "            Log file: ${mylogfile}"
 	echo "            Base key: ${mykeybase}"
-	if test x"$mykeyid" != x
-	then
-	    echo "  target GPG/PGP key: ${mykeyid}"
-	fi
 	echo
 	if test x"$mytclient" = x"-DSH_WITH_SERVER"
Index: trunk/depend.dep
===================================================================
--- trunk/depend.dep	(revision 591)
+++ trunk/depend.dep	(revision 1)
@@ -1,38 +1,38 @@
 
 # DO NOT DELETE THIS LINE
-samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_restrict.h $(srcinc)/sh_nmail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_mem.h $(srcinc)/sh_xfer.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_sem.h sh_MK.h $(srcinc)/sh_schedule.h 
-sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_restrict.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_pthread.h $(srcinc)/sh_sem.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/zAVLTree.h $(srcinc)/sh_subuid.h $(srcinc)/sh_ignore.h 
-sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h $(srcinc)/sh_pthread.h 
-sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_nmail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_prelude.h $(srcinc)/sh_pthread.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h $(srcinc)/sh_checksum.h 
-sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_inotify.h $(srcinc)/zAVLTree.h $(srcinc)/sh_dbIO.h $(srcinc)/CuTest.h 
-sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbCheck.h $(srcinc)/sh_dbCreate.h $(srcinc)/sh_sem.h $(srcinc)/sh_extern.h 
-sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_calls.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_xfer.h $(srcinc)/sh_sig.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_ignore.h $(srcinc)/sh_database.h $(srcinc)/sh_mail.h $(srcinc)/sh_modules.h $(srcinc)/sh_nmail.h $(srcinc)/sh_prelink.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tiger.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/sh_socket.h 
-sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_checksum.h 
+samhain.o: $(srcsrc)/samhain.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_getopt.h $(srcinc)/sh_readconf.h $(srcinc)/sh_hash.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_mem.h $(srcinc)/sh_forward.h $(srcinc)/sh_tools.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h sh_MK.h $(srcinc)/sh_schedule.h 
+sh_unix.o: $(srcsrc)/sh_unix.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_hash.h $(srcinc)/sh_tools.h $(srcinc)/sh_tiger.h $(srcinc)/sh_prelink.h $(srcinc)/sh_static.h $(srcinc)/sh_prelude.h $(srcinc)/sh_ignore.h 
+sh_utils.o: $(srcsrc)/sh_utils.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_entropy.h 
+sh_error.o: $(srcsrc)/sh_error.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_database.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_prelude.h $(srcinc)/sh_tools.h $(srcinc)/sh_extern.h 
+sh_files.o: $(srcsrc)/sh_files.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/zAVLTree.h 
+sh_getopt.o: $(srcsrc)/sh_getopt.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_getopt.h $(srcinc)/sh_files.h $(srcinc)/sh_utils.h $(srcinc)/sh_mail.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h $(srcinc)/sh_extern.h 
+sh_readconf.o: $(srcsrc)/sh_readconf.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_database.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_files.h $(srcinc)/sh_mail.h $(srcinc)/sh_calls.h $(srcinc)/sh_tiger.h $(srcinc)/sh_forward.h $(srcinc)/sh_modules.h $(srcinc)/sh_gpg.h $(srcinc)/sh_hash.h $(srcinc)/sh_ignore.h $(srcinc)/sh_prelink.h $(srcinc)/sh_extern.h $(srcinc)/sh_database.h $(srcinc)/sh_prelude.h 
+sh_tiger0.o: $(srcsrc)/sh_tiger0.c Makefile config_xor.h $(srcinc)/sh_tiger.h $(srcinc)/sh_unix.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_tiger1.o: $(srcsrc)/sh_tiger1.c Makefile config_xor.h 
 sh_tiger2.o: $(srcsrc)/sh_tiger2.c Makefile config_xor.h 
 sh_tiger1_64.o: $(srcsrc)/sh_tiger1_64.c Makefile config_xor.h 
 sh_tiger2_64.o: $(srcsrc)/sh_tiger2_64.c Makefile config_xor.h 
-sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_hash.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_sig.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_pthread.h $(srcinc)/sh_xfer.h $(srcinc)/sh_hash.h $(srcinc)/sh_checksum.h 
-sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_pthread.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/sh_nmail.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
-sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_pthread.h 
-sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
-sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_portcheck.h $(srcinc)/sh_logmon.h $(srcinc)/sh_registry.h $(srcinc)/sh_fInotify.h 
-sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h 
-sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 
-sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h $(srcinc)/zAVLTree.h 
-sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h $(srcinc)/CuTest.h 
-sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_fifo.h $(srcinc)/CuTest.h 
-sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
-sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_xfer.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
-sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_gpg.h 
+sh_hash.o: $(srcsrc)/sh_hash.c Makefile config_xor.h $(srcinc)/sh_hash.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_gpg.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h $(srcinc)/sh_forward.h $(srcinc)/sh_hash.h 
+sh_mail.o: $(srcsrc)/sh_mail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mail.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_static.h $(srcinc)/sh_tools.h 
+sh_mem.o: $(srcsrc)/sh_mem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h 
+sh_entropy.o: $(srcsrc)/sh_entropy.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+sh_forward.o: $(srcsrc)/sh_forward.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_forward.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_mail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
+sh_modules.o: $(srcsrc)/sh_modules.c Makefile config_xor.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h $(srcinc)/sh_mounts.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_kern.h $(srcinc)/sh_suidchk.h 
+sh_utmp.o: $(srcsrc)/sh_utmp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_utmp.h 
+sh_kern.o: $(srcsrc)/sh_kern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_kern.h sh_ks_xor.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h 
+sh_suidchk.o: $(srcsrc)/sh_suidchk.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_suidchk.h $(srcinc)/sh_hash.h $(srcinc)/sh_unix.h $(srcinc)/sh_files.h $(srcinc)/sh_schedule.h $(srcinc)/sh_calls.h 
+sh_srp.o: $(srcsrc)/sh_srp.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/sh_srp.h $(srcinc)/bignum.h 
+sh_fifo.o: $(srcsrc)/sh_fifo.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_unix.h 
+sh_tools.o: $(srcsrc)/sh_tools.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h $(srcinc)/rijndael-api-fst.h 
+sh_html.o: $(srcsrc)/sh_html.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_forward.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_html.h $(srcinc)/zAVLTree.h 
+sh_gpg.o: $(srcsrc)/sh_gpg.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h 
 sh_cat.o: $(srcsrc)/sh_cat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_cat.h 
-sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_sub.h $(srcinc)/sh_utils.h 
-sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_filter.h $(srcinc)/sh_static.h 
+sh_calls.o: $(srcsrc)/sh_calls.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_calls.h 
+sh_extern.o: $(srcsrc)/sh_extern.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
 sh_database.o: $(srcsrc)/sh_database.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_log.o: $(srcsrc)/sh_err_log.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_tiger.h 
-sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h $(srcinc)/sh_sem.h 
+sh_err_console.o: $(srcsrc)/sh_err_console.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_utils.h 
 sh_err_syslog.o: $(srcsrc)/sh_err_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h 
-sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_schedule.h 
+sh_schedule.o: $(srcsrc)/sh_schedule.c Makefile config_xor.h $(srcinc)/sh_mem.h $(srcinc)/sh_schedule.h 
 bignum.o: $(srcsrc)/bignum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/bignum.h 
 mkhdr.o: $(srcsrc)/mkhdr.c Makefile config.h 
@@ -40,64 +40,22 @@
 samhain_stealth.o: $(srcsrc)/samhain_stealth.c Makefile config_xor.h 
 encode.o: $(srcsrc)/encode.c Makefile 
-sstrip.o: $(srcsrc)/sstrip.c Makefile config.h 
-trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
+sstrip.o: $(srcsrc)/sstrip.c Makefile 
+trustfile.o: $(srcsrc)/trustfile.c Makefile config_xor.h $(srcinc)/sh_calls.h $(srcinc)/slib.h $(srcinc)/sh_static.h 
 exepack.o: $(srcsrc)/exepack.c Makefile config.h $(srcinc)/minilzo.h $(srcinc)/exepack.data 
 exepack_fill.o: $(srcsrc)/exepack_fill.c Makefile config.h config.h $(srcinc)/minilzo.h 
 exepack_mkdata.o: $(srcsrc)/exepack_mkdata.c Makefile config.h $(srcinc)/minilzo.h 
 minilzo.o: $(srcsrc)/minilzo.c Makefile $(srcinc)/minilzo.h 
-slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h 
-rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h 
-rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-api-fst.h 
+slib.o: $(srcsrc)/slib.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_calls.h $(srcinc)/sh_static.h 
+rijndael-alg-fst.o: $(srcsrc)/rijndael-alg-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-boxes-fst.h 
+rijndael-api-fst.o: $(srcsrc)/rijndael-api-fst.c Makefile config_xor.h $(srcinc)/rijndael-alg-fst.h $(srcinc)/rijndael-api-fst.h 
 zAVLTree.o: $(srcsrc)/zAVLTree.c Makefile $(srcinc)/zAVLTree.h 
-sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_guid.h $(srcinc)/sh_fifo.h $(srcinc)/sh_utils.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h $(srcinc)/CuTest.h 
-sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h $(srcinc)/CuTest.h 
+sh_socket.o: $(srcsrc)/sh_socket.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_socket.h $(srcinc)/sh_error.h $(srcinc)/sh_unix.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/zAVLTree.h $(srcinc)/sh_html.h $(srcinc)/sh_tools.h 
+sh_ignore.o: $(srcsrc)/sh_ignore.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error.h 
 yulectl.o: $(srcsrc)/yulectl.c Makefile config_xor.h 
 sh_mounts.o: $(srcsrc)/sh_mounts.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_modules.h $(srcinc)/sh_mounts.h 
-sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
-sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
+sh_userfiles.o: $(srcsrc)/sh_userfiles.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_userfiles.h $(srcinc)/sh_utils.h $(srcinc)/sh_schedule.h $(srcinc)/sh_error.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h 
+sh_prelude.o: $(srcsrc)/sh_prelude.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h 
 sh_prelink.o: $(srcsrc)/sh_prelink.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h 
-sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h $(srcinc)/sh_pthread.h 
-sh_portcheck.o: $(srcsrc)/sh_portcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_mem.h $(srcinc)/sh_calls.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_processcheck.o: $(srcsrc)/sh_processcheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_modules.h $(srcinc)/sh_processcheck.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_calls.h $(srcinc)/sh_pthread.h $(srcinc)/CuTest.h 
-sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h 
-sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h 
+sh_static.o: $(srcsrc)/sh_static.c Makefile config_xor.h 
 kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 
-sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h 
-dnmalloc-1.0.beta5-rw.o: $(srcsrc)/dnmalloc-1.0.beta5-rw.c Makefile 
-t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 
-dnmalloc-portable.o: $(srcsrc)/dnmalloc-portable.c Makefile config.h 
-dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 
-sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_parse_apache.o: $(srcsrc)/sh_log_parse_apache.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h 
-sh_log_evalrule.o: $(srcsrc)/sh_log_evalrule.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/zAVLTree.h 
-sh_log_check.o: $(srcsrc)/sh_log_check.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/sh_log_correlate.h $(srcinc)/sh_log_mark.h $(srcinc)/sh_log_repeat.h $(srcinc)/sh_extern.h $(srcinc)/sh_modules.h 
-sh_log_parse_samba.o: $(srcsrc)/sh_log_parse_samba.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h 
-sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h 
-sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/sh_utils.h $(srcinc)/slib.h $(srcinc)/zAVLTree.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/CuTest.h 
-sh_log_correlate.o: $(srcsrc)/sh_log_correlate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_log_mark.o: $(srcsrc)/sh_log_mark.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_string.h $(srcinc)/sh_error_min.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h $(srcinc)/zAVLTree.h 
-sh_log_repeat.o: $(srcsrc)/sh_log_repeat.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h $(srcinc)/sh_log_check.h $(srcinc)/sh_log_evalrule.h 
-sh_log_parse_generic.o: $(srcsrc)/sh_log_parse_generic.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_log_check.h $(srcinc)/sh_string.h 
-sh_login_track.o: $(srcsrc)/sh_login_track.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_string.h $(srcinc)/sh_tools.h $(srcinc)/sh_ipvx.h $(srcinc)/sh_error_min.h $(srcinc)/CuTest.h $(srcinc)/CuTest.h 
-sh_audit.o: $(srcsrc)/sh_audit.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error.h $(srcinc)/sh_extern.h $(srcinc)/sh_utils.h 
-sh_registry.o: $(srcsrc)/sh_registry.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_modules.h $(srcinc)/sh_hash.h $(srcinc)/sh_tiger.h 
-sh_ipvx.o: $(srcsrc)/sh_ipvx.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_static.h $(srcinc)/sh_pthread.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h $(srcinc)/CuTest.h 
-sh_restrict.o: $(srcsrc)/sh_restrict.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_restrict.h $(srcinc)/CuTest.h 
-sh_filetype.o: $(srcsrc)/sh_filetype.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_mem.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h 
-sh_sub.o: $(srcsrc)/sh_sub.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h 
-sh_fInotify.o: $(srcsrc)/sh_fInotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_modules.h $(srcinc)/sh_pthread.h $(srcinc)/sh_inotify.h $(srcinc)/sh_unix.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_files.h $(srcinc)/sh_ignore.h 
-sh_checksum.o: $(srcsrc)/sh_checksum.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_checksum.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_guid.o: $(srcsrc)/sh_guid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/CuTest.h 
-sh_dbIO.o: $(srcsrc)/sh_dbIO.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_hash.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_sig.h $(srcinc)/sh_tiger.h $(srcinc)/sh_xfer.h $(srcinc)/sh_pthread.h $(srcinc)/sh_socket.h $(srcinc)/sh_files.h $(srcinc)/zAVLTree.h 
-sh_dbCheck.o: $(srcsrc)/sh_dbCheck.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_tiger.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h 
-sh_dbCreate.o: $(srcsrc)/sh_dbCreate.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_hash.h $(srcinc)/sh_files.h $(srcinc)/sh_dbIO.h $(srcinc)/sh_dbIO_int.h $(srcinc)/sh_pthread.h $(srcinc)/sh_guid.h 
-sh_xfer_client.o: $(srcsrc)/sh_xfer_client.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/rijndael-api-fst.h 
-sh_xfer_server.o: $(srcsrc)/sh_xfer_server.c Makefile config_xor.h $(srcinc)/sh_ipvx.h $(srcinc)/samhain.h $(srcinc)/sh_tiger.h $(srcinc)/sh_utils.h $(srcinc)/sh_unix.h $(srcinc)/sh_xfer.h $(srcinc)/sh_srp.h $(srcinc)/sh_fifo.h $(srcinc)/sh_tools.h $(srcinc)/sh_entropy.h $(srcinc)/sh_html.h $(srcinc)/sh_nmail.h $(srcinc)/sh_socket.h $(srcinc)/sh_static.h $(srcinc)/sh_guid.h $(srcinc)/rijndael-api-fst.h $(srcinc)/sh_readconf.h $(srcinc)/zAVLTree.h $(srcinc)/sh_extern.h 
-sh_xfer_syslog.o: $(srcsrc)/sh_xfer_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_tools.h $(srcinc)/sh_utils.h $(srcinc)/sh_ipvx.h 
-sh_xload_client.o: $(srcsrc)/sh_xload_client.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_guid.h 
-sh_sem.o: $(srcsrc)/sh_sem.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_sem.h $(srcinc)/sh_error_min.h 
-sh_subuid.o: $(srcsrc)/sh_subuid.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_unix.h 
-sh_sig.o: $(srcsrc)/sh_sig.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error.h $(srcinc)/sh_tiger.h $(srcinc)/sh_static.h $(srcinc)/sh_sig.h 
+sh_prelude_old.o: $(srcsrc)/sh_prelude_old.c Makefile config_xor.h $(srcinc)/slib.h $(srcinc)/sh_mem.h $(srcinc)/sh_cat.h $(srcinc)/sh_error_min.h $(srcinc)/sh_prelude.h $(srcinc)/sh_static.h 
Index: trunk/depend.sum
===================================================================
--- trunk/depend.sum	(revision 591)
+++ trunk/depend.sum	(revision 1)
@@ -1,1 +1,1 @@
-3600310821
+1152497988
Index: trunk/deploy.sh.in
===================================================================
--- trunk/deploy.sh.in	(revision 591)
+++ trunk/deploy.sh.in	(revision 1)
@@ -1,22 +1,3 @@
 #! /bin/sh
-
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 #VERSION2.0
@@ -168,9 +149,4 @@
 yule_data="@mydataroot@"
 
-# The temporary directory to use. Default is '/tmp', but some
-# sites may mount this 'noexec'.
-#
-temp_dir="/tmp"
-
 #__END_CUT__
 
@@ -224,5 +200,4 @@
 export yule_conf
 export yule_data
-export temp_dir
 
 # dialog
@@ -250,9 +225,4 @@
 host=
 export host
-
-# hostgroup; empty default
-#
-hostgroup=
-export hostgroup
 
 
@@ -335,5 +305,4 @@
     echo
     echo " --host=<hostname>      The host where you want to uninstall."
-    echo " --tmpdir=<path>        Temporary directory to use on the this host."
     echo
     { (exit 0); exit 0; }
@@ -429,5 +398,4 @@
     echo " --user=<username>      Login as <username> to the build host (root)."
     echo " --add-path=<path>      Append 'path' to the PATH variable on the build host."
-    echo " --tmpdir=<path>        Temporary directory to use on the build host."
     { (exit 0); exit 0; }
 }
@@ -445,5 +413,4 @@
     echo
     echo " --host=<FQDN>          The host where you want to install."
-    echo " --group=<group>        Optional group the host belongs to."
     echo " --arch=<arch>          The architecture/operating system of this host."
     echo "        This is used to get the correct binary package."
@@ -459,5 +426,4 @@
     echo " --local=<path>         Local command (executed twice: "
     echo "                        after config installation and before client startup)."
-    echo " --tmpdir=<path>        Temporary directory to use on the this host."
     { (exit 0); exit 0; }
 }
@@ -571,12 +537,4 @@
     ;;
 
-  --group | -group)
-    opt_prev=hostgroup
-    ;;
-
-  --group=* | -group=*)
-    hostgroup="$optarg"; export hostgroup
-    ;;
-
   # Build
 
@@ -649,11 +607,4 @@
   --arch=* | -arch=*)
     arch="$optarg"; export arch
-    ;;
-
-  --tmpdir | -tmpdir)
-    opt_prev=temp_dir
-    ;;
-  --tmpdir=* | -tmpdir=*)
-    temp_dir="$optarg"; export temp_dir
     ;;
 
Index: trunk/docs/BUGS
===================================================================
--- trunk/docs/BUGS	(revision 591)
+++ trunk/docs/BUGS	(revision 1)
@@ -1,13 +1,2 @@
-AIX:
----
-
-Samhain must either be compiled as 32bit application, or with the --disable-dnmalloc
-configure flag, because the OS provides no way to enforce usage of 32bit address space.
-
-MacOS X:
--------
-
-(1)  Pointed out by David: static linking is not supported on MacOS X,
-     see http://developer.apple.com/qa/qa2001/qa1118.html
 
 Solaris:
Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 591)
+++ trunk/docs/Changelog	(revision 1)
@@ -1,1187 +1,6 @@
-4.5.3:
-	* fix inadvertent inclusion of scripts/logrotate and init/samhain.startSystemd
-	(reported by kjd)
-	* fix annoying message from systemd about read permissions for service file
-	(reported by kjd)
-	* fix compiler warnings about unused variables
-	* move logfile monitor module from PCRE to PCRE2 (PCRE is end of life and no
-	longer actively maintained)
-	* fix obsolete gpg option --secret-keyring used in samhainadmin script
-	* fix some more warnings, mostly false positives from cppcheck
-
-4.5.2 (02-01-2025):
-	* fix segfault with --enable-static on unresolvable host name
-	* fix autoreconf (problem reported by Pascal de Bruijn)
-	* add missing items to distclean Makefile target (problem
-	reported by Pascal de Bruijn)
-
-4.5.1  (08-09-2024):
-	* fix for regression in SHELL option for log file monitoring
-	  (issue reported by ssha)
-
-4.5.0  (31-10-2023):
-	* fix for reading file attributes on Linux file systems
-	* new option UseAttributesCheck (boolean, default=yes)
-
-4.4.10 (14-05-2023):
-	* fix for (very minor) memleak in sh_unix.c: sh_check_rotated_log()
-	* fix for memleak in sh_files.c: sh_files_checkdir(), not all cases for
-	scandir() covered (issue reported by T. Greulich)
-
-4.4.9 (10-05-2022):
-	* fix for double newline stripping when reading from database
-
-4.4.8 (01-05-2022):
-	* new server option Alias=alias@hostname (based on
-	patch by A. Hofland)
-
-4.4.7 (07-03-2022):
-	* fix compile error on MacOS
-        * disable dnmalloc for gcc 11 (regexec does not work)
-	* fix minor compile issues with gcc 11.2
-	* fix problem with login/logout monitoring on MacOS (reported
-	by Peter)
-	* fix problem caused by switch from pubkey.gpg to pubkey.kbx
-	(reported by A. Hofland)
-
-4.4.6 (05-10-2021):
-	* fix Debian 10 compile problem in dnmalloc (mallinfo2),
-	reported by A. Hofland and others
-	* fix compile problem on Ubuntu 20 with 'make deb'
-	(Debian optimization CFLAGS clash with ASM for Tiger)
-	* fix 'make deb' issue when compiling as client
-	(reported by A. Hofland)
-	* fix issue with inotify (reported by Thorsten)
-
-4.4.5 (01-07-2021):
-	* fix a memory leak introduced in 4.4.4
-
-4.4.4 (30-06-2021):
-	* fix more gcc 10 compiler warnings
-	* fix bug with signify-openbsd in client/server setup (reported
-	by Sdoba)
-	* patch by K. Hacene for reproducible database generation
-	* fix recognition of invalid compiler options in configure.ac
-
-4.4.3 (31-10-2020):
-	* allow console logging to a unix domain socket
-	* fix spurious cppcheck warnings
-	* fix gcc 10 compiler warning in sh_audit.c
-	* fix gcc 10 compiler warning in sh_ipvx.c
-	* fix gcc 10 compile problem in sh_tiger1_64.c
-	* fix gcc 10 compiler warning in sh_portcheck.c
-
-4.4.2 (01-08-2020):
-	* re-enabled reading options from option group [samhain] in my.cnf
-	* fix server install in configure.ac: samhainadmin.pl <-> ..-gpg.pl, ..-sig.pl
-	* add more verbosity to portable binary installer, fix minor issues
-
-4.4.1 (27-02-2020):
-	* fix compatibility problem with older (version 2.0.x) GnuPG
-
-4.4.0 (31-10-2019):
-	* support for OpenBSD signify as alternative to GnuPG
-
-4.3.3 (11-07-2019):
-	* fix broken 'make deb' makefile target
-	* eliminate obsolete 'sstrip' utility
-	* systemd support
-	* fix broken rpm specfile (patch by Franky Van L.)
-	* fix broken mysql init script
-	* fix some issues with link-time optimisation (option -flto with
-	recent gcc versions)
-	* fix compiler warning in sh_prelude.c
-	* add patch (by Kamel H.) to init for alternative root fs)
-
-4.3.2 (07-01-2019):
-	* fix compile failure on OpenBSD (reported by Mithrond)
-
-4.3.1 (25-09.2018):
-	* fix compile failure on non-Linux systems (reported by Romain and Tim)
-	* provide more information for error message about bad baseline
-	  database file (issue raised by Romain)
-
-4.3.0 (10-09-2018):
-	* add support for /etc/subuid, /etc/subgid maps
-	* fix compiler warning on Ubuntu 18.04
-
-4.2.4 (21-12-2017):
-	* fix 'clobbered by..' compiler warning is src/sh_portcheck.c
-	* fix compiler warning because of deprecated _BSD_SOURCE macro
-	* fix 'make deb' for Debian stretch (reported by Alasdair)
-	* add RPM spec file patch for SLES12 (by Pirmin)
-	* better fix for RPMTOP detection
-	* fix missing entry for yuleadmin.pl in RPM spec file
-	* fix bug in static dns resolver (reported by Piotr G.)
-
-4.2.3 (31-10-2017):
-	* fix order of search directories for 'make rpm' (issue reported by
-	Z. Drableg)
-
-4.2.2 (03-07-2017):
-	* fix bug with PortCheckSkip: for any given port, only first interface
-	specified in config is checked (reported by A. Hofland)
-	* fix PortCheck bug that occasionally causes spurious detections of
-	open ports (patch by A. Hofland)
-	* add success/failure message for closing baseline database at init
-
-4.2.1 (06-04-2017):
-	* fix for broken SetSocketPassword authentication
-	(reported by Todd Stansell)
-	* fix compile issue on Solaris 11 (reported by Rolf)
-	* fix alignment problem with semget() (reported by Rolf)
-	* fix dependency on chkconfig package on Redhat/CentOS: search
-	/etc/init.d/functions also under /etc/rc.d/init.d/functions
-	(issue reported by Ernie)
-	* fix build issue with musl libc (report & patch by A. Kuster)
-	* fix case sensitivity (tcp vs TCP, udp vs UDP) in portcheck
-	directives (reported by A. Hofland)
-	* fix documentation typo ('make deploy-install' ->
-	'make install-deploy', reported by Ben)
-	* fix dsys/funcINSTALL: proper error message if no binary
-	packages built yet (problem reported by Ben)
-	* fix install-data: make datadir chmod conditional and
-	align with documentation
-
-4.2.0 (31-10-2016):
-	* fix handle tracefs (permission for stat denied) when running
-	suidcheck without root privilege (for testing)
-	* fix compiler warnings on gcc 6.2
-	* fix incorrect mandir option in Install.sh (reported by David)
-	* add option 'SetAuditdFlags = r|w|x|a' to (re-)define flags supplied
-	to auditd (request by David)
-	* fix minor bug in error message (tf_trust_errfile needs copy to
-	keep relevant value).
-	* fix SH_DEADFILE (too big, some architectures have nlink_t
-	as uint16, e.g. FreeBSD).
-	* add portcheck option 'PortCheckDevice = device' to monitor a
-	device regardless of address assigned to it (patch by A. Hofland, plus
-	some additions)
-	* fix case sensitivity of severity/class options (issue raised by
-	A. Hofland).
-	* clarify restrictions for ProcessCheckPSArg (user manual)
-
-4.1.5 (09-08-2016):
-	* fix memory leak in server (reported by C. Doerr).
-
-4.1.4 (02-06-2016):
-	* fix problems with wildcard pattern re-evaluation (reported by
-	A. Ansari):
-	- not stored if no match at startup
-	- only one (the first) stored if same pattern for file and dir
-	* fix problems with directory creation in inotify watched tree
-	(reported by A. Ansari):
-	- recursive depth not decreased
-	- watched as directory even when recursion depth should drop below zero
-
-4.1.3 (19-04-2016):
-	* on Cygwin, the AvoidBlock function is now off by default
-	(problem reported by Fred C)
-	* tighter sanity checks in sh_static.c
-	* fix regression with '--enable-static' in sh_static.c
-	(reported by amaiket).
-
-4.1.2 (21-12-2015):
-	* add options --enable-selinux and --enable-posix-acl for "hard fail"
-	if libraries aren't found (requested feature)
-	* fix wrong policy assignment when inotify is active and change occurs
-	during a reload (reported by Bond)
-	* fix failure to detect open UDP port for some daemons
-	(reported by James)
-	* fix broken 'rpm' and 'rpm-light' makefile targets
-	(reported by Bond)
-	* fix message for self-check
-
-4.1.1 (01-11-2015):
-	* fix problem with timezone calculation on month rollover for
-	negative timezones (west of GMT; reported by Bond)
-	* fix problem with rotated logfiles when content is always constant,
-	i.e. checksum does not change (reported by Bond).
-	* fix problem with baseline update on FreeBSD and probably other
-	non-GNU/Linux systems (reported by L.Vasiliev)
-	* fix bad check_libwrap() call in sh_xfer_server.c
-	(reported by L.Vasiliev)
-
-4.1.0 (24-09-2015):
-	* fix quirks with Linux audit support
-	* implement 'silent check' (requested feature)
-	* fix call of self_check for exit on sigterm
-	* fix safe_logger() - uses the logger utility with a non-posix option
-	* fix missing reporting on shell expansion capability in --version
-	* fix missing error message on invalid list for skipchecksum
-	(reported by Bond)
-	* fix missing definition for a sh_dummy_ var on BSD et al.
-	(reported by Andrew)
-
-4.0.0 (20-07-2015):
-	* fix and document default settings for mounts check
-	* new -w CL option to wait on scan completion
-	* new option ReportCheckflags
-	* enhance testsuite to cover new functionality
-	* implement draft for change control integration:
-	  * new database format to store change flags
-	  * refactoring of db I/O and client/server code
-	  * option StartupLoadDelay
-	  * --create-database CL option
-	  * --outfile CL option
-	  * --binary, --list-filter CL options
-	  * --verify-database CL option
-	  * yulectl -c DELTA:<uuid> command
-	  * option SetDeltaRetryCount
-	  * option SetDeltaRetryInterval
-	  * update documentation
-	* remove old/unused code
-	* fix compiler warnings with gcc 5.1.0
-	* update config.sub, config.guess
-
-3.1.6 (08-06-2015):
-	* Modify testcompile.sh to remove 'smatch' and use 'clang'
-	  instead.
-	* Fix compile problems with clang.
-	* Modify testcompile.sh to remove 'uno' and use 'cppcheck'
-	  for static checking
-	* Move AC_CHECK_FUNCS( getnameinfo getaddrinfo ) behind
-	  the check for libsocket to have them found on Solaris
-	* Fix IPv4-only bug in bind_addr use in retry_connect()
-	* Add more debug code in connect_port()
-
-3.1.5 (26-03-2015):
-	* Fix IPv6 issue with portcheck (need to be able to specify
-	  IPv6 interfaces).
-	* Fix minor issues with bugs in testing code
-	* Add command line option '--server-host' to set the log server
-	* In samhain.startLinux.in start script template, add code to read
-	  options from /etc/sysconfig/${NAME} for RedHat
-
-3.1.4 (17-02-2015):
-	* Add non-existent file to the regression test config
-	* Fix erroneous call to sh_hash_init when a missing file
-	  is specified in the configuration
-	* Fix buffer allocation for getgrnam_r for large groups
-	  (problem reported by Sergio B)
-	* Search RPM in $HOME/rpmbuild if test -d _topdir fails (CentOS
-	  recommends '%(echo $HOME)/topdir', reported by E. Taft)
-
-3.1.3 (01-11-2014):
-	* Remove initgroups() from the popen call in unix entropy gatherer
-	* Add error message for update mode if local baseline cannot be found
-
-3.1.2 (07-08-2014):
-	* Fixed incorrect memset in sh_checksum.c (sha256)
-	* Circumvent a gcc compiler bug with inline asm (gcc 4.8)
-	* Allow multiple exclusions for SUID check
-	* Use calloc instead of malloc
-	* Add overflow check in minilzo.c (but the potential integer
-	  overflow [CVE-2014-4607,LMS-2014-06-16-1] is irrelevant anyway
-	  because the function is never used on external data).
-	* Fixed a minor bug in exepack_fill.c that was unearthed by the minilzo
-	  overflow check (the required buffer length information for the check
-	  wasn't provided)
-	* Fixed incorrect logic in setting the ALLIGNORE flag (more specific
-	  directory / file directives were ignored)
-	* Fix for tickets #358 (repetitive lstat warning about deleted
-	  directory) and #359 (reporting of deleted/added top level directory)
-	* Fix a free() on NULL (harmless but avoids spurious warning)
-
-3.1.1 (01-05-2014):
-	* Disable inline asm on Cygwin (issue reported by Erik)
-	* Fix sh_ipvx_is_ipv4 such that numeric hostnames are not
-	  incorrectly recognised as IP address (reported by A. Hofland)
-	* Fix sh_ipvx_is_ipv6
-
-3.1.0 (31-10-2013):
-	* Add support for SHA2-256 checksum function
-	* Drop support for --enable-khide on kernel version 3.x and above
-	* Fix IgnoreAdded to anchor regex at beginning of path (reported by
-	  R.Lindner)
-	* Add check to detect availability of pmap_getmaps() (missing in
-	  static library on recent Linux systems as reported by Ian Baldwin)
-	* Fixes for Ubuntu 13.4:
-	  - no error msg for failing stat on /run/user/Username/gvfs in
-	    suidcheck
-	  - no error message for failing hardlink check on /run/user/Username
-	  - eliminate compiler warnings
-	* Add option '--disable-asm' to work around a gcc issue in Debian
-	  unstable (reported by micah)
-	* Remove option '-i' from mkitab in samhain-install.sh.in (reported
-	  by N. Kerski)
-
-3.0.13 (11-06-2013):
-	* Fix detection of nonfunctional /dev/kmem
-	* Fix race condition in GrowingLogfiles policy that
-	  causes spurious reports (problem noticed by J. Daubert)
-
-3.0.12 (16-05-2013):
-	* Fix compiler warning in bignum.c (unused parameter)
-	* Detect if /var/run is a symlink and /run exists
-	* Fix for broken support for audit subsystem (reported
-	  by isquish)
-	* Fix for incorrect use of sh_inotify_add_watch_later
-	  which causes a steady increase in memory usage
-	  (issue reported by Maxime V)
-	* Fix for potential minor memory leak
-	* Fix for bug in negated conditionals for config file
-	  (reported by M. Ward)
-
-3.0.11 (08-04-2013):
-	* Fix for compile error on HP-UX (reported by P. Alves)
-	* Propagate ERANGE error from getgrxxx_r (issue raised by C. Feikes)
-	* Fix reconnecting to database for Oracle
-	* Add better logrotate handling for the GrowingLogs policy (search
-	  rotated log and verify it, don't report if this succeeds)
-	* Add ability to create debian packages with preset password (use
-	  env var PASSWORD)
-	* Add option KernelCheckProc (bool) to suppress kernel /proc test
-	* Add option IgnoreModified to cover transient files that
-	  not only get added/deleted but also modified
-
-3.0.10 (13-01-2013):
-	* Revert to previous logic in samhain.c because it will block
-	  otherwise (reported by Alexandr Sabitov)
-
-3.0.9 (21-12-2012):
-	* Fixed a Cygwin compile warning
-	* Change logic in samhain.c to make sure inotify doesn't cause
-	  excessive full scans
-	* Add option IgnoreTimestampsOnly in Windows registry check (ignore
-	  changes if only timestamp has changed)
-	* Fix the probe command (misses clients if their startup message
-	  has been missed)
-	* Fix the RPM spec file for --enable-network=client and no password
-	  (reported by Mitch St Martin)
-	* Fix build error with Linux audit (reported by Andy Jack)
-	* Fix detection of utmpx.h (reported by D. Thiel)
-
-3.0.8 (01-11-2012):
-	* rename to 3.0.8 for release
-	* useful exit status for samhainadmin.pl --examine
-
-3.0.7a (25-12-2012):
-	* add ability to create RPM with preset password (use
-	  env var PASSWORD)
-	* fix the rpm-light makefile target
-	* fix minor bug in samhain_setpwd.c (incorrect error message)
-
-3.0.7 (25-10-2012):
-	* update documentation for prelude
-	* fix configure to properly search for Oracle Instantclient SDK
-	* pass through TNS_ADMIN environment variable for Oracle
-	* optimize audit rules automatically
-	* zero out the html status file at server exit
-	* don't check for assembly optimization unless linux or *BSD
-
-3.0.6 (01-09-2012):
-	* install logrotate script if /etc/logrotate.d is detected
-	* new option --enable-suid for nagios
-	* fix for --enable-ptrace: make the save_tv variable thread specific
-	* fix bug in inotify code which made it follow symlinks (by [anonymous])
-	* fix two missing SH_MUTEX_LOCK(mutex_thread_nolog) (by [anonymous])
-	* fix for 'no such process' message from sh_fInotify_init_internal()
-	  (by [anonymous])
-	* fix for --enable-ptrace with threads (by [anonymous])
-	* option SetReportFile for writing out summary after file check
-
-3.0.5 (11-07-2012):
-	* fix xml format templates for registry check
-	* fix database download on registry check init (reported by ldieu)
-
-3.0.4 (01-05-2012):
-	* fix verbosity of message for alerts on already deleted watches
-	  (set it to debug - suggested by xrx)
-	* fix extraneous error messages about file not found from
-	  sh_fInotify_init_internal() (bug reports by xrx and aj)
-
-3.0.3 (28-03-2012):
-	* fix potential deadlock in sh_ext_popen()
-	* make sure sh_processes_readps cannot hang forever
-	* fix for deadlock if sh_processes_readps hangs
-	* fix for deadlock if suid check and inotify are used together
-	  (reported by A. Jack)
-	* fixed problem with samhain_stealth.c (handle input config
-	  files that don't end with a newline)
-	* fixed compiler warnings for yulectl.c with stealth
-	* fixed lacking support for O_NOATIME on 64bit linux
-
-3.0.2a (23-02-2012):
-	* Fix compile error on Solaris 10
-
-3.0.2 (16-02-2012):
-	* change sql init scripts to make bigint fields unsigned (problem
-	  reported by A. Sabitov)
-	* patch by Andy Jack for issue with the --with-gpg option (hangs with
-          high cpu load at startup)
-	* call ./samhain-install.sh as /bin/sh ./samhain-install.sh in the
-	  RPM spec file, because /var might be mounted noexec (reported by GC)
-	* fixed configure.ac for the case that --with-gpg and --enable-nocl are
-	  used (./samhain for gpg checksum; problem report by Andy Jack)
-	* fixed a potential NULL pointer dereference in sh_inotify.c on
-	  systems where inotify is not available (reported by <anonymous>)
-	* fixed: the config file template mentions (in a comment) the
-	  non-existent directive SetLockPath instead of the correct
-	  SetLockfilePath (reported by Curtis).
-	* fixed: the definition of O_NOATIME isn't seen in sh_files.c.
-
-3.0.1 (07-12-2011):
-	* fix a memory leak (reported by C. Westlake)
-	* fix an uninitialized variable in the suidcheck code (problem
-	  reports by T- Luettgert and Kai)
-	* fix a bug in the port check with --disable-ipv6 (reported
-	  by C. Westlake)
-	* fix potential deadlock in sh_files.c (reported by S. Mirolo)
-	* change Makefile.in to stop on compile error rather than at link stage
-	  (suggested by S. Mirolo)
-	* fix compile errors caused by missing #define (pthread disabled) and
-	  wrong function call (OSX specific code), reported by S. Mirolo
-	* fix warning by the llvm/clang static checker
-	* fix compile issues on freebsd
-	* handle (ignore) SIGPIPE more thoroughly
-	* update config.guess, config.sub
-
-3.0.0a (06-10-2011):
-	* Fix compile-time issues on RHEL5 (reported by Thomas)
-
-3.0.0 (01-11-2011):
-	* Add support for the inotify API
-	* If --disable-shellexpand is used, also disable setting
-	  the prelink/ps paths
-	* Fix missing check_mask storage for glob pattern
-	* Add support for integer keys in zAVL
-	* Fix compiler warnings with gcc 4.6.1 (variables that get set
-	  but then remain unused)
-	* Add more server-side debugging for IPv6
-	* Make kern_head compile with 3.x kernels
-
-2.8.6 (20-09-2011):
-	* Manual updated.
-	* Added an option LogmonDeadtime to avoid repetitive reporting
-	  on correlated events.
-	* Fix problems with timestamp handling in logfile correlation
-	  (problem reported by D. Dearmore)
-	* List the policy under which a directory/file is checked
-	* Option to use a textfile with a list of files for update
-	* Fix --enable-db-reload option (reported by David L.)
-	* Fix samhain_kmem compilation, need to compile under chosen
-	  name if --enable-install-name is used (reported by David L.)
-	* Fix uninitialized string in error message (reported by mimox)
-
-2.8.5a (16-06-2011):
-	* Fix autolocal.m4 for new configure option
-
-2.8.5 (15-06-2011):
-	* Detect non-working /dev/kmem in configure script, and fix
-	  a bug in the samhain_kmem kernel module.
-	* Fix wrong handler for LogmonMarkSeverity (reported by S. Chittenden)
-	* Better protection against the 'intruder on server' scenario
-	  pointed out by xrx. Add option to disable shell expansion in
-	  configuration files, and check gpg signature earlier.
-	* Support /opt/local/bin in the Unix entropy gatherer (suggestion
-	  by Sean Chittenden)
-	* Cache timeserver response for one second (suggestion by
-	  Sean Chittenden)
-
-2.8.4a (11-05-2011):
-	* Fix for compile error with --with-prelude 
-	  (reported by Sean Chittenden), missing regression test added
-	* Fix for compile error with --enable-udp (reported by Sean Chittenden),
-	  missing regression test added
-
-2.8.4 (30-04-2011):
-	* Fix another reload bug in the log monitoring module
-	* Add unit tests for IgnoreAdded/IgnoreDeleted configuration directives
-	* Fix deadlock after reload when compiled with --enable-login-watch
-	  (reported by M. Teege and O. Cobanoglu)
-	* Fix compile error for samhain_hide.ko with recent kernel
-	* Include patch by J. Graumann to specify the location of the 
-	  secret keyring with samhainadmin.pl
-	* Fix potential timeout problem in sh_sub_stat_int() and propagate the
-	  error (issue reported by mtg)
-	* Add support for X-Forwarded-For in apache logfile parser, add
-	  option 'RE{regex}' to insert arbitrary regex
-	* New options PortcheckMinPort, PortcheckMaxPort for the open ports
-	  check
-
-2.8.3a (23-03-2011):
-	* Fix two 'label at end of compound statement' errors on FreeBSD
-	  (reported by David E. Thiel)
-
-2.8.3 (22-03-2011):
-	* init scripts: load samhain_kmem.ko before samhain starts
-	* slib.c: eliminate mutex from sl_create_ticket()
-	* sh_entropy.c: move pthread usage out of child
-	* sh_hash.c, sh_pthread.c, sh_pthread.h: sh_hash_hashdelete()
-	  needs deadlock detection, may be called from within sh_hash_init()
-	  via atexit handler on error condition
-	* sh_suidchk.c, sh_calls.c, sh_calls.h: need a nosub version of lstat()
-	  to use with relative path after chdir()
-	* samhain.c, sh_calls.c, sh_calls.h: only run (l)stat() in subprocess
-	  after reading config file (to allow disabling)
-	* sh_unix.c: run sh_sub_kill() in parent after forking the daemon
-	* fix zeroing of result from getnameinfo() (problem reported by Richard)
-	* fix spurious warnings about unsupported address family (reported
-	  by N Silverman)
-	* option to run lstat/stat in subprocess to avoid hanging on NFS mounts
-	  (off by default)
-	* fix Windows/Cygwin compile error (reported by A. Schmidt)
-
-2.8.2 (16-02-2011):
-	* add function to skip checksumming
-	* Fix missing check for recursion depth >= 0 if not IgnoreAll
-	* Fix hardcoded path for temp directory in deployment scripts
-	* Fix bad compile on CentOS 4.8 with gcc 4.1.2
-	* Fix minor bug in check_samhain.pl (pointed out by J.-S. Eon long ago)
-
-2.8.1 (17-11-2010):
-	* Document handling of missing files with secondary schedule
-	* Fix incorrect handling of missing files when secondary schedule
-	  is used (reported by Sergey)
-	* Fix null pointer dereference in config parse handler for SetMailAlias
-	  (reported by Sergey)
-	* Fix incorrect memset() in sh_kern.c (passed struct by value...),
-	  reported by Roman and Stefan
-	* Fix 'make install' to create user-defined directory
-	* fix minor issues noticed by T. Luettgert (test code assumes port 
-	  0/tcp is unused, wrong ifdef order (without impact on compilation))
-	* fix compile error on AIX 5.3 with --enable-login-watch,
-	  reported by M. El Nahass (time.h missing in src/sh_login_track.c)
-
-2.8.0 (01-11-2010):
-	* Support IPv6
-	* Add registry checking
-	* Use auditd records to find out who did it
-
-2.7.2c (23-09-2010):
-        * Fix uppercase hostname problem in client/server communication
-
-
-2.7.2b (05-09-2010):
-	* Fix compile errors on Solaris 10 (reported by A. Saheba)
-
-2.7.2a (23-08-2010):
-	* rewrote rijndaelKeySched() in a more conservative way to fix
-	  compile problem on SLES 11.
-
-2.7.2 (16-08-2010):
-	* sh_utils.c: fixed an endianess issue that prevented cross-verification
-	  of email signatures (reported by A. Zangerl)
-	* sh_login_track.c: fix compiler warning (ignored return value 
-	  of fwrite)
-	* sh_readconf.c: fix comparison of SeverityUserX string 
-	  (reported by max__)
-	* sh_processcheck.c: sh_prochk_set_maxpid: set retval on success
-	  (reported by max__)
-	* fixed some compiler warnings on cygwin
-	* sh_extern.c: As reported by T. Luettgert, gcc 4.4.4 on Fedora 13 
-	  will throw a warning if execve is called with a NULL argv pointer. 
-	  Need to provide a dummy argp[].
-
-2.7.1 (07-06-2010):
-	* samhain_kmem.c: fix compile problems
-	* fix problems with config file parser: increase max. line length,
-	  support quoting/escaping of filenames (as in 'ls --quoting-style=c')
-	* check for pcre_dfa_exec (not available in old versions
-	  of libpcre, reported by Shinoj)
-	* patch to allow server to log client reports to prelude
-	  (by J. Ventura)
-
-2.7.0a (09-05-2010):
-	* fix /dev/kmem detection (reported by S. Clormann)
-	
-2.7.0 (01-05-2010):
-	* sh_utmp.c, sh_login_track.c: additional login checks
-	* sh_unix.c: use SIGTTIN as alternative for SIGABRT
-	  (SIGABRT seems not to work on AIX, reported by Peter)
-	* sh_utmp.c: fix compile error without pthreads (inotify_watch used)
-	* sh_kern.c, kern_head.c: fix some 64bit issues
-	* dnmalloc.c: fix compiler warning (ignored ret value)
-	* Fix LSB init script for kernel module
-	* samhain_kmem kernel module for /proc/kmem added
-
-2.6.4 (22-03-2010):
-        * Don't read proc_root_iops in sh_kern.c (Problem report
-          by H. R.)
-        * Logfile check can check output of shell commands
-        * Use data directory as default for logfile checkpoints
-        * Fix broken checkpoint save/restore for logfiles
-
-2.6.3 (10-03-2010):
-	* Fix bug in mail module, recipients incorrectly flagged
-	  as aliases, which breaks immediate mail for 'alert'
-	  (reported by Jesse)
-	
-2.6.2 (28-01-2010):
-	* Makefile.in: fix problem in deploy system caused
-	  by adding build number for debs in 2.5.9 (reported
-	  by roman)
-	* add option for per-rule email alias in log monitoring 
-	  module
-	* sh_readconf.c: make keywords case-independent
-	* sh_mail.c: on error, report full reply of mail server
-	* sh_mail.c: report smtp transcript at debug level
-	* make sure mail aliases are not emailed twice, and
-	  recipients cannot be defined after aliasing them
-	* handle named pipes in log monitoring module
-	  (open in nonblocking mode, ignore read error if empty)
-	* fix bug in the server function to probe for necessity
-	  of configuration reload for client
-
-2.6.1b (23-12-2009):
-	* fix missing include for sh_inotify.h in sh_inotify.c
-	  (reported by Ack)
-	
-2.6.1a (22-12-2009):
-	* fix typo in code for older inotify versions without
-	  inotify_init1(), reported by Forll
-
-2.6.1 (21-12-2009):
-	* add a routine to log monitoring module to guess the proper year 
-	  for timestamps without year (standard syslog)
-	* add feature to automatically detect and report bursts of
-	  similar messages in log monitoring module
-	* add feature to check for missing heartbeat messages in
-	  log monitoring module
-	* cache UIDs/GIDs to reduce the number of lookups
-	* use inotify to track login/logout (sh_inotify.c, sh_utmp.c)
-	* support event correlation in log monitoring module
-	* make sure host matching is done in a case insensitive way
-	  (reported by Tracy)
-	* fix invalid use of mutex_mlock in src/sh_unix.c, function 
-	  sh_unix_count_mlock() (reported by Remco Landegge).
-	
-2.6.0 (01-11-2009):
-	* don't use statvfs() for process checking on FreeBSD
-	* fix bug with parallel compilation of cutest in Makefile 
-	* sh_mem.c: fix deadlock in debug-only code
-	* Evaluate glob patterns for each run of file check
-	* Add compile option to disable compiling with SSP
-	* Run SUID check in separate thread
-	* By default disable scanning ..namedfork/rsrc (deprecated by Apple)
-
-2.5.10 (12-10-2009):
-	* sh_suidchk.c: handle $HOME/.gvfs mount gracefully
-	* slib.c: fix race condition caused by closing a stream and the fd
-
-2.5.9c (01-10-2009):
-	* move stale file record error message closer to problem zone
-	* sh_port2proc.c: fix flawed logic for interpreting /proc/net/udp,tcp
-	
-2.5.9b (22-09-2009):
-	* remove stale file record when creating handle, and raise diagnostic
-	  error to find origin of stale record
-	* sh_port2proc.c: check /proc/net/upd6 for IPv6-only UDP sockets
-
-2.5.9a (17-09-2009):
-	* fixed a race condition in closing of file handles
-
-2.5.9 (11-09-2009):
-	* added code to generate directory for pid file, since it
-	  would get cleaned if /var/run is a tmpfs mount (problem
-	  reported by M. Athanasiou)
-	* fixed a bug that prevented reporting of user/executable path
-	  for open UDP ports (issue reported by N. Rath)
-	* added more debugging code
-
-2.5.8a (18-08-2009):
-	* fixed a bug in sh_files.c that would prevent samhain from
-	  running on MacOS X (reported by David)
-
-2.5.8 (06-08-2009):
-	* fixed a bug in the MX resolver routine which causes it to fail 
-	  sometimes (issue reported by N. Rath).
-	* fixed deadlock with mutex_listall in sh_nmail_test_recipients() if 
-	  error occurs within sh_nmail_flush (problem reported by N. Rath)
-	
-2.5.7 (21-07-2009):
-	* sh_userfiles.c: set userUids = NULL at reconfiguration (issue
-	  reported by U. Melzer)
-	* if available, use %z to print timezone as hour offset from GMT
-	  in email date headers (problem reported by NP, solution suggested
-	  by TimB).
-	* eliminate C99-style comments (problem reported by
-	  venkat)
-	* fix bad variable name for AC_CACHE_CHECK
-	* fix potential deadlock when external programm is called
-	  (problem reported by A. Dunkel)
-	
-2.5.6 (09-06-2009):
-	* recognize fdesc filesystem on MacOS X for suid check (Problem
-	  reported by David)
-
-2.5.5 (01-05-2009):
-	* fix some warnings from gcc 4.4 (strict aliasing)
-	* fix minor memory leak in process check
-	* t-test1.c: change function names because of clashes with an 
-	  AIX system header file
-	* fix warnings with -fstack-check (too large stack frames)
-	* fix for incorrect handling of hostnames in database insertion
-	  (reported by byron)
-	
-2.5.4 (04-03-2009):
-	* fix for incorrect input check in SRP implementation (discovered
-	  by Thomas Ptacek)
-	* option KernelCheckPCI to switch off check of PCI expansion ROMs
-	
-2.5.3 (25-02-2009):
-	* disable dnmalloc on MacOS X, doesn't work properly
-	* stat -> lstat in sh_unix_file_exists (OS X nameforks, report
-	  by David)
-	* Fix problem in standalone trustfile, does not work correctly on
-	  group-writeable files (reported by David).
-	* Option SetThrottle to throttle throughput for db download
-	* Option SetConnectionTimeout to configure the client connection 
-	  timeout configurable
-	* Provide getrpcbynumber, getservbyname implementations
-	  to avoid dependencies with static linkage
-	* Fix missing sh.host.(system|release|machine) on FreeBSD,
-	  reported by D.Lowry
-	* New option SetMailPort to allow setting of SMTP port (patch
-	  by lucas sizzo org)
-	* allow POSIX regexes for filters
-	* consolidate filtering code from sh_extern.c, sh_(n)mail.c
-	* rewrite mail subsystem to allow individual filtering
-	  for recipients
-	* allow shell expansion for values of config file options
-	* allow list as value for option PortCheckInterface
-	* fix bug in trustfile.c (with slapping on "/../" for symlinks)
-	* lock baseline database upon writing
-	
-2.5.2b (29-01-2009):
-	* turn warnings into errors in the compile test suite
-	* fix missing define in sh_portcheck.c to eliminate compiler warning
-	  (reported by joerg)
-
-2.5.2a (26-01-2009):
-	* fix problem building deb package (bit rot; reported by joerg)
-
-2.5.2 (22-01-2009):
-	* samhain.c: report module failure with positive offset
-	* sh_database.c: parse numerical fields into ulong
-	* fix regression test script for postgresql
-	* fix regression test script for SELinux/ACL test
-	* fix reporting of user for open ports to prelude
-	* report process pid for open ports
-	* replace _exit() by raise(SIGKILL) b/o pthread problem
-	* new option LooseDirCheck ([false]/true), request by 
-	  Alexander
-	* improved help output of samhain_stealth (as suggested
-	  by Michael Athanasiou)
-	* new option ProcessCheckIsOpenVZ ([false]/true)
-	
-2.5.1 (07-12-2008):
-	* workaround for freebsd7 amd64 lossage (compiler toolchain, 
-	  no mmap to 32bit address space)
-	* samhain-install.sh: check for presence of stealth_template.ps 
-	  before trying to create it
-	* use -Wno-empty-body if supported to suppress warnings about
-	  glibc pthread_cleanup_pop implementation
-	* fix text relocations for i386 in src/sh_tiger1.s
-	* implement server->client SCAN command to initiate file check
-	* implement @if / @else conditionals with more tests in config file
-	* new option SetDropCache to drop checksummed files from cache
-	* report process/user for open ports on FreeBSD (code
-	  lifted from FreeBSD sockstat.c)
-	* fix for config reload issue with stealth mode (reported by
-	  siim)
-	* add -fstack-protector flags to LDFLAGS
-	* cygwin fix: don't use dnmalloc, doesn't work with pthreads
-	* cygwin fix: make trust check in samhain-install.sh return zero
-	* improved diagnostics for file read errors
-	* fixed script permissions (754 -> 755), reported by Christoph
-	* constness patch by Joe MacDonald
-	* GnuPG key ID patch by Jim Dutton
-	* sh_kern.c: more error checking for reads from kernel
-	
-2.5.0 (01-11-2008):
-	* dnmalloc.c: fix inconsistent chunksize on 64bit systems
-	* fix improved error reporting for failed fstat in checksumming
-	* report process/user for open ports (Linux only currently)
-	* fix deadlock on exit in sh_hash_init()
-	* fix --enable-mounts-check for FreeBSD 7.0 (no MNT_NODEV anymore)
-	* log monitoring support
-	* fixed constness in trustfile interface
-	* remove libprelude 0.8 support (obsolete)
-	* sh_forward.c: increase TIME_OUT_DEF to 900 secs
-	* dnmalloc.c: initialize rc in dnmalloc_fork_child(),
-	  reported by B. Podlipnik
-	
-2.4.6a (09-10-2008):
-	* fix compile problem on Fedora 9 (reported by pierpaolo),
-	  'struct ucred' in sh_socket.c requires _GNU_SOURCE 
-	
-2.4.6 (27-08-2008):
-	* fix compile failure on win2k/cygwin (sh_unix_mlock prototype),
-	  reported by jhamilton
-	* fix potential deadlock with dnmalloc upon fork()
-	* fix non-portable use of 'hostname -f' in regression test suite
-	  (reported by Borut Podlipnik)
-
-2.4.5a (18-08-2008):
-	* fix compile problem in dnmalloc.c (remove prototypes for
-	  memset/memcpy), problem reported by Juergen Daubert
-	
-2.4.5 (07-08-2008):
-	* testscripts: 'chmod -R' -> 'chmod -f -R', since Solaris 10
-	  bails out on a chmod on a dangling link
-	* fix bug in check_samhain.pl nagios script (J.-S. Eon)
-	* use the UNO static checker
-	* compile as position independent executable (PIE)
-	* handle EINPROGRESS error (Windows/cygwin issue)
-	* make sure every function uses less than one page of stack
-	  (proactive security against gap jumping, Gael Delalleau) 
-	* use dnmalloc instead of system malloc
-	  (proactive security against heap buffer overflows)
-	* fix dnmalloc bugs and portability problems
-	* check for compressBound, since older zlibs don't have it
- 
-2.4.4 (30-04-2008):
-	* sh_database.c: fix maximum size of sql query string, maximum 
-	  size of strings in struct dbins_
-	* sh_hash.c: fix maximum size of message string
-	* fix typo in the base64 decoder
-	* fix 'make cutest' for parallel compiling
-	* fix compile warnings with -Wstrict-prototypes
-	* sh_static.c: override getgrgid, getpwuid for libacl
-	* fix more warnings about variables clobbered by 'longjmp'
-	  or 'vfork' (due to library internal handling of mutexes)
-	* fix configure warning about unused datarootdir
-	* configure.ac: warn, but accept nonexistent tmp dir
-          (Problem reported by Brian)
-	* sh_unix.c: undef P_ALL, P_PID, P_PGID before including 
-          sys/wait.h (compile problem reported by Reputation)
-	* syslog function tested ok with Syslog Fuzzer v0.1 
-          by Jaime Blasco (c) 2008
-	* slib.c: call fflush when writing trace to file
-	* sh_readconf.c: don't set OnlyStderr to false if gpg (problem
-	  reported by Irene Reed)
-	* fix unconditional removal of pid file in atexit handler (bug
-	  reported by Brian)
-	* fix invalid free() in sh_unix_checksum_size()
-	* sh_processcheck.c: workaround for stupid OpenBSD bug (returns
-	  ENODEV instead of EAGAIN, because fgetc does 
-          fcntl(0,F_SETFL,O_NONBLOCK) [ENODEV] internally), problem
-	  reported by Roman R.
-	* fix buf that cause incomplete reporting of modified symlink if
-	  symlink has changed and both old and new paths are >48 bytes
-	* fix bug that prevented mount check from running in one-shot mode
-	* enable mount check for openbsd
-	* fix processcheck default options and test script for openbsd
-	* option --list-file to list content of file (if saved)
-	* sh_tools.c: use strcasecmp in reverse lookup since DNS is case
-	  insensitive (bug reported by Phil)
-	* fill content if MODI_TXT, zlib compress, base64 encode and add 
-	  as link_path in sh_unix.c; add to report in sh_hash.c
-	* testsuite: add test for gpg fingerprint option
-	* sh_extern.c: add 'CloseCommand' for syntactic sugar, 
-	  add in testsuite
-
-2.4.3a (12-02-2008):
-	* fix compile error caused by open() with O_CREAT and no third argument
-	  (reported by J.-S. Eon)
-
-2.4.3 (31-01-2008):
-	* sh_kern.c: don't require asm/segment.h for kernel check module
-	* use global var with pid of initial thread instead of getpid(),
-	  since LinuxThreads returns different value in each thread (problem
-	  reported by Steffen Mueller)
-	* sh_kern.c: no inode check for pci rom (creates spurious messages)
-	* slib.c: eliminate prototype for vsnprintf (compile problem reported
-	  by eddy_cs)
-	* Makefile.in: fix missing dependency on 'encode' for $(OBJECTS)
-	  (reported by Matthias Ehrmann)
-
-2.4.2 (17-01-2008):
-	* fix broken option --with-checksum (reported by halosfan),
-	  regression test added
-	* change HP-UX default optimization to +O2 since +O3 breaks 
-	  cutest unit testing framework
-	* put result vector of rng in skey struct
-	* fix more compiler warnings, and a potential (compiler-dependent)
-	  NULL dereference in the unix entropy collector
-	* fix some compiler warnings
-	* use -D_FORTIFY_SOURCE=1 -fstack-protector-all instead
-	  of -fstack-protector
-	* always add PTHREAD_CFLAGS to LDFLAGS
-	* sh_tiger0.c: checksum functions return length of file hashed,
-	  needed to fix GrowingLogfile bug (researched by 
-	  siim at p6drad dash teel dot net)
-	* sh_static.c: fix more 'label at end of compound statement'
-	  (SH_MUTEX_UNLOCK closing brace; reported anonymously)
-	* make sh_hash.c thread-safe
-	* remove plenty of tiny allocations
-	* improve sh_mem_dump
-	* modify port check to run as thread
-	* new option PortCheckSkip to skip ports
-	* fix unsetting of sh_thread_pause_flag (was too early)
-
-2.4.1a (28-11-2007):
-	* fix overwrite of ErrFlags (functionality bug)
-
-2.4.1 (26-11-2007):
-	* security fix: regression in the seeding routine for the PRNG 
-	  (detected by C. Mueller)
-	* regression test added for PRNG seeding routine
-	* fix problem with PCI ROM check (spurious messages about modified
-	  timestamps, reported by S. Clormann)
-
-2.4.0a (08-11-2007):
-	* fix compile failure with --enable-static (reported by S. Clormann)
-	* fix potential deadlock if SIGHUP is received while suspended
-
-2.4.0 (01-11-2007):
-	* eliminate alarm() for I/O timeout (replaced by select)
-	* use getgrgid_r, getpwnam_r, getpwuid_r, gmtime_r, localtime_r, 
-	  rand_r, strtok_r if available
-	* protect readdir(), getpwent(), gethostname() with mutexes 
-	  (readdir_r considered harmful)
-	* make checksum/hash, entropy, rng functions reentrant
-	* use thread-specific conversion buffer for globber()
-	* fixed compile problems and problems with test suite
-	* modify login watch to run as thread
-	* modify process check to run as thread
-
-2.3.8 (03-10-2007):
-	* new option PortCheckIgnore = interface:portlist
-
-2.3.7 (13-09-2007):
-	* Makefile.in: fix 'make deb' target, wrong name of config file
-	  written to debian/conffiles (reported by marc)
-	* configure.ac: fix incorrect order of with-prelude, enable-static
-	  (libprelude test was always without -static)
-
-2.3.6 (06-09-2007):
-	* added yuleadmin.pl script contributed by Riccardo Murri
-	* fix compile error with -f-stack-protector on some systems (reported
-	  by marc); we now check for libssp
-	* fix local DoS attack on BSD systems lacking getpeereid() (reported
-	  by Rob Holland).
-	* fix yulectl password reading from $HOME/.yulectl_cred, erroneously
-	  rejected passwords with exactly 14 chars (reported by Jerry Brown)
-	* introduce 'fflags' flag for suid files to detect new files already 
-	  found in regular file check (problem reported by J. Crutchfield); 
-	  also add regression test to ascertain that files in baseline 
-	  database are not quarantined erroneously
-	* sh_hash.c: replace check for prefix 'K' with check for not prefix'/'
-	  to allow for arbitrary module-specific store/lookup in db
-	* replace 'visited', 'reported', 'allignore' with generic 'fflags' field
-	* sh_cat.c: reduce priority of MSG_TCP_RESET to avoid spamming if
-	  port checking is used on same host as server (reported by kadafax)
-	* Install.sh: don't use --separate-output with non-checklist
-	  widgets (problem discovered by D. Denton)
-	* sh_gpg.c, sh_userfiles.c: use sh_getpwnam et al. wrappers
-
-2.3.5 (20-06-2007):
-	* sh_portcheck.c: try to tear down connections more gracefully
-	  (request by S. Petersen)
-	* fix incorrect handling of files with zero size in GrowingLogFiles
-	  (problem reported by S. Petersen)
-	* fix incorrect encoding of null checksums in stealth mode
-	* sh_hash.c: fix repeated printing of acl/attributes in database dump
-	* sh_unix.c: fix option useaclcheck ignored if both useaclcheck and 
-	  useselinuxcheck are supported
-
-2.3.4 (01-05-2007):
-	* sh_processcheck.c: fix missing init of sh_prochk_res array before 
-	  check (leads to degrading functionality over time and 'fake pid'
-	  warnings; reported by D. Ossenbrueggen and 
-	  soren dot petersen at musiker dot nu)
-	* sh_processcheck.c: fix memory leak 
-	* sh_kern.c: for 2.6.21+ don't check proc_root_lookup (not possible 
-	  anymore? proc_root_inode.lookup != proc_root_lookup)
-	* sh_extern.c: flush streams before forking (problem if [Prelink]
-	  used together with prelude logging, reported by M. deJong)
-	* fixed compilation of kern_head (regression cause by cross-compiling
-	  fix; problem reported by S. Clormann)
-	* more typos fixed (reported by John Horne)
-
-2.3.3 (27-03-2007):
-	* fixed typos in configure.ac and manual (reported by John Horne)
-	* don't use mysql_options on x86_64, since libmysql is broken
-	* fixed cross-compiling (patch by Joe MacDonald)
-	* refactor sh_kern.c, sh_suidchk.c
-	* fix bug with leading slashes in linked path of symlinks within
-	  the root directory
-	* sh_kern.c: check PCI ROM (Linux), refactor code
-	* move file descriptor closing more towards program startup
-	* kernel check: support OpenBSD 4.0 (wishlist)
-	* fix samhain_hide module (in-)compatibility with recent kernels
-	  (reported by Jonny Halfmoon)
-
-2.3.2 (29-01-2007):
-	* fix regression in full stealth mode (incorrect comparison of
-	  bytes read vs. maximum capacity), reported by B. Fleming
-
-2.3.1a (21-01-2007):
-	* fix incorrect use of sh_gpg_fill_startup if option --with-fp is used
-	  (reported by zeroXten)
- 
-2.3.1 (21-01-2007):
-	* fix bug that may cause accidental closure of yule TCP socket
-	  (problem reported by B. Masuda)
-	* fix sh_kern.c for kernel 2.6.19 (reported by S. Clormann)
-	* don't use sstrip in 'make deb', since dh_shlibdeps uses objdump
-	  (reported by B. Masuda)
-	* rm report.pl from rules.deb.in (reported by B. Masuda)
-	* samhainctl(): longer timeout (bad status reporting at startup,
-	  reported by Phil and by Dan Track)
-	* sh_portcheck.c: make connect errors more descriptive
-	* sh_portcheck.c: fix ignored setting of PortCheckActive
-	* sh_processcheck.c: add statvfs, and wrap for EINTR
-	* sh_portcheck.c: add wrappers for EINTR
-	* report user and executable for hidden processes
-	* fix update failure if reportonlyonce = false (reported
-	  by D. Strine)
-	* fix compile error in sh_portcheck.c (problem on cygwin
-	  reported by J. D. Fiori)
-	* check filenames ending in space (also for utf8 spaces)
-	* check and escape csv formatted db listing
-	* cache results of sl_trustfile_euid()
-	* trustfile: use 4096 for MAXFILENAME, switch to strncpy
-	* CL option -v|--version for info on version and compiled-in options
-	
-2.3.0a (01-11-2006):
-	* fix compile failure with portcheck + stealth (reported by lucas)
-
-2.3.0 (01-11-2006):
-	* fix concurrency for inserts in oracle db
-	* add acl_(new|old) to database schema
-	* check for selix attributes and/or posix acl
-	* new option UseSelinuxCheck (bool) 
-	* new option UseAclCheck (bool)
-	* regression tests for above
-	* add module to check for open ports
-	* add module to check processes (hidden/fake/missing)
-	* use const char* for argument of module configuration callbacks
- 
-2.2.6 (31-10-2006):
-        * fix missing support for MacOX X init script (reported
-	  by Daniel Kowalewski)
-	* fix error about non-readable file with no checksum required
-        * fix server warning about 'no server name known'
-        * fix 'make deb' makefile target
-        * fix default export severity for server
-			
-2.2.5 (05-10-2006):
-	* fix broken Install.sh, reported by Alexander Kraemer
-	* workaround for glob(3) sillyness on MacOS X (reported by David)
-	* fix for broken resorce fork check (reported by David)
-	* fix for broken compilation on cygwin (reported by Elias)
-
-2.2.4 (03-09-2006):
-	* add regression test for the GrowingLogFiles issue to test suite
-	* fixed sh_unix.c: bug in database init if GrowingLogFiles used
-	  with signed database (reported by Timothy Stotts)
-	* bug in manual fixed (incorrect documentation of --enable-user,
-	  noticed by M. Brown)
-	* rc.subr compatible init script for FreeBSD/NetBSD
-	* improve routine to find rpm after build
-	* add netbsd rc file from Brian Seklecki (taken from pkgsrc-wip)
-	* fix error in manual (location of lock file)
-	* fix bug with SuidExclude (files in directory were still checked)
-
-2.2.3 (31-07-2006):
-	* fix samhainadmin.pl: check for gpg-agent running if use-agent is set
-	  (ticket #28 by anonymous)
-	* fix stealth mode (regression in parser), problem reported by 
-	  Joschi Kuphal
-	* fix minor typo in sh_database.c (compile problem reported by
-	  Joschi Kuphal)
-
-2.2.2 (17-07-2006)
-	* minor fixes for regression test scripts
-	* minor updates to the manual (suggested by Brian A. Seklecki)
-	* fix sh_kern.c, kern_head.c: kernel rootkit detection for 2.6.17+
-	  (problem reported by Leonhard Maylein)
-	* fix samhain_hide.c for 2.6.17+: use module_param() if MODULE_PARM
-	  is not defined
-
-2.2.1c (11-07-2006)
-	* fix sh_extern.c: sh_ext_add_default() cast to (void) was too early
-	  (Solaris 8 build failure reported by Jesse)
-	* fix sh_unix.c: wrong prototype for sh_unix_mlock() 
-	  if HAVE_BROKEN_MLOCK (AIX 5.2 build failure reported by
-          Jonathan Kaufman) 
-
-2.2.1b (20-06-2006):
-	* fix compile error on SuSE 10.1 (reported by Leonhard Maylein)
-
-2.2.1a (15-06-2006):
-	* fix compile error on i686/MacOS X (reported by Andreas Neth)
-
-2.2.1 (13-06-2006):
-	* fix gcc 4 warnings and build failure on x86_64 (debian bug #370808)
-	* fix compiling with Oracle (noticed by Colapinto Giovanni)
-	* fix configure.ac for most recent autoconf version
-	  (debian bug #369503)
-	* fix a regression that would make impossible local updates w/clients
-	* fix a few missing '\n' in sh_getopt.c
-	* sh_kern.c: fall back on mmap() if read() fails on /dev/kmem
-	* fix Solaris package creation
-	* recognize Solaris doors and event ports
-	* fix the idmef_inode_t patch: provide required info to avoid stat()
-	* fix bug on database update: fill in dev and rdev fields
-	* fix get_file_infos() in sh_prelude.c: avoid premature return	
-	* GCC_STACK_PROTECT_CC: AC_TRY_COMPILE -> AC_TRY_LINK
-	* deploy.sh: allow to set a group for hosts upon installation
-	* patch by Yoann: fix an issue when setting the idmef_inode_t object
-	* fix memory leaks in error paths in sh_prelude.c
-	* fix concurrent inserts with postgres in sh_database.c
-	* code cleanup
-	* fix manual version in spec file, first noticed by Imre Gergely
-	
-2.2.0 (01-05-2006):
-	* patch by Jim Simmons for samhainadmin.pl.in
-	* fix testsuite portability problems
-	* fix md5 endianess problem detected on HP-UX 11i / PA-RISC 8700 
-	* fix potential NULL dereference in sh_utmp_endutent()
-	* patch by Neil Gorsuch for suidchk.c (do not scan lustre, afs, mmfs)
-	* fix sh_ext_popen (OpenBSD needs non-null argv[0] in execve)
-	* fix make_tests.sh portability (echo '"\n"' does not work on OpenBSD)
-	* fix bug in sh_utils_obscurename (check isascii)
-	* scan h_aliases for FQDN if h_name is not
-	* add copyright/license info to test scripts
-	* add copyright/license info to deployment system scripts
-	* support server-to-server relay
-	* new CL option --server-port 
-	* minor improvements in manual
-	* patch by Yoann Vandoorselaere for sh_prelude.c
-	* allow --longopt arg as well as --longopt=arg
-	* verify checksum of growing log files (up to previous size)
-	* rewrite of the test suite
-	* added a bit of unit testing
-	* minor optimizations in various places
-	* optimized implementation of tiger checksum algorithm
-	* read in 64k blocks (faster than 4k)
-	* sh_unix.c, sh_hash.c: support file flags on *BSD, update Linux
-	  file attribute code
-	* kern_head: fix compilation of kernel check module on OpenBSD
-	* updated samhainrc.linux, samhainrc.freebsd
-	* sh_unix.c: fix setrlimit (RLIMIT_NOFILE, ..)
-	* sh_files.c: fix missing use of flag_err_info
-	* sh_tiger0.c: remove repetitive use of mlock
-	* slib.c: remove fcntl's from sl_read_timeout (caller sets O_NONBLOCK),
-	  add function sl_read_timeout_prep
-
-2.1.3 (13-03-2006):
-	* fix compile problem in slib.c (reported by Lawrence Bowie)
-        * fix bug with combination of one-shot update mode and file check 
-	  schedule (reportedby Dan Track)
-	* improved the windows howto according to suggestions by 
-	  Jorge Morgado
-	* fix samhain_hide kernel module for new linux kernel versions
-	* fix minor problem with dead client detection (problem reported
-	  by Michal Kustosik)
-
-2.1.2 (10-01-2006):
-        * fix startup error with combination of gpg+prelude
-
-2.1.1a (22-12-2005):
-	* fixed a stupid bug in sh_files.c (break if file = dir)
-
-2.1.1 (21-12-2005):
-	* sh_calls.c: protect sh_calls_set_bind_addr against overriding
-	* comINSTALL, updateDB: use locking
-	* samhainadmin.pl: use locking
+2.1.1:
 	* fix typos in samhainrc.solaris (noticed by Robby Cauwerts)
 	* improve zAVLSearch (remove redundant strcmp)
-	* use AVL tree in sh_files.c instead of linked list (better scaling)
+	* use AVL tree in sh_files.c instead of linked list (scales way better)
 	* fix bug with suidcheck (no update/check in one-shot mode with
 	  schedule instead of check interval; noticed by R. Rati)
@@ -1561,5 +380,5 @@
 	  on solaris - noticed by Bob Bloom)
 	* sh_suidcheck: don't truncate quarantined file if nlink > 1 
-	* fix Install.sh (no --separate-output with --radiolist); patch by
+	* fix Install.sh (no --seperate-output with --radiolist); patch by
 	  Greg Kimberly
 
Index: trunk/docs/FAQ.html
===================================================================
--- trunk/docs/FAQ.html	(revision 591)
+++ trunk/docs/FAQ.html	(revision 1)
@@ -31,5 +31,4 @@
 div.warnblock {
 	background: #b6c5f2; color: #000;
-        background: #ffffcc; color: #000;
 	margin: 1em; padding: 0 1em 0 1em;
 	border-width: 1px;
@@ -130,14 +129,5 @@
 <br><center><h2>Rainer Wichmann</h2></center>
 <hr>
-<div class="warnblock">
-<ul>
-  <li>If you encounter problems after installing samhain, disable daemon
-      mode and run it in the foreground with 
-      <tt>samhain --foreground [more options]</tt> for debugging.</li>
-  <li>If you have problems getting client/server mode to work, please check
-      the <a href="http://www.la-samhna.de/samhain/HOWTO-client+server-troubleshooting.html">HOWTO client+server troubleshooting</a> document.</li>
-</ul>
-</div>
-<p><i>FAQ Revised: Monday 17 September 2018 15:13:17</i></p>
+<p><i>FAQ Revised: Saturday 17 September 2005 09:10:07</i></p>
 <hr><h2>Table of Contents</h2>
 <dl>
@@ -147,19 +137,16 @@
 <li><a href="#Most frequently1">1.2. samhain exits with the message &quot;Untrusted path&quot; for config/log/pid/database files</a></li>
 <li><a href="#Most frequently2">1.3. It does not log anything / Can't stop logging to console</a></li>
-<li><a href="#Most frequently3">1.4. samhain exits with the message &quot;Record with bad version number in file signature database&quot;</a></li>
-<li><a href="#Most frequently4">1.5. Client cannot self-resolve, but nslookup works fine</a></li>
-<li><a href="#Most frequently5">1.6. Server logs hostname instead of FQDN (or vice versa)</a></li>
+<li><a href="#Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></li>
 </ul></dd>
 <dt><b>2. Build and install</b></dt>
 <dd><ul>
-<li><a href="#Build and install0">2.1. &quot;make&quot; loops infinitely !</a></li>
-<li><a href="#Build and install1">2.2. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></li>
-<li><a href="#Build and install2">2.3. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></li>
-<li><a href="#Build and install3">2.4. The executable is corrupted after installation</a></li>
-<li><a href="#Build and install4">2.5. --enable-xml-log has no effect</a></li>
-<li><a href="#Build and install5">2.6. ./install-sh: strip: not found (Solaris)</a></li>
-<li><a href="#Build and install6">2.7. What is sh_tiger1.s?</a></li>
-<li><a href="#Build and install7">2.8. Why does static compiling (<code>--enable-static</code>) on MaxOS X fail ?</a></li>
-<li><a href="#Build and install8">2.9. Why does compiling with MySQL fail on Solaris ?</a></li>
+<li><a href="#Build and install0">2.1. [Fedora Core] Cannot compile with --enable-khide</a></li>
+<li><a href="#Build and install1">2.2. [Fedora Core] Cannot compile with --with-kcheck</a></li>
+<li><a href="#Build and install2">2.3. &quot;make&quot; loops infinitely !</a></li>
+<li><a href="#Build and install3">2.4. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></li>
+<li><a href="#Build and install4">2.5. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></li>
+<li><a href="#Build and install5">2.6. The executable is corrupted after installation</a></li>
+<li><a href="#Build and install6">2.7. --enable-xml-log has no effect</a></li>
+<li><a href="#Build and install7">2.8. ./install-sh: strip: not found (Solaris)</a></li>
 </ul></dd>
 <dt><b>3. File checking</b></dt>
@@ -221,5 +208,4 @@
 <li><a href="#Database2">7.3. I don't want the client TIMESTAMP messages in the SQL database</a></li>
 <li><a href="#Database3">7.4. What does the log_ref field mean ?</a></li>
-<li><a href="#Database4">7.5. How can I check what is in the database ?</a></li>
 </ul></dd>
 </dl>
@@ -281,9 +267,5 @@
 is a bad idea, because samhain will open the device and write (i.e. it is
 a very inefficient method).<br><br></dd>
-<dt><b><a name="Most frequently3">1.4. samhain exits with the message &quot;Record with bad version number in file signature database&quot;</a></b></dt>
-<dd>This typically happens when the initialisation of the database has been
-done repeatedly, i.e. by using '-t init' multiple times, without (re)moving
-the previous database first before an initialisation.<br><br></dd>
-<dt><b><a name="Most frequently4">1.5. Client cannot self-resolve, but nslookup works fine</a></b></dt>
+<dt><b><a name="Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></b></dt>
 <dd><ul>
 <li>Nslookup is  a program to query Internet domain name servers.
@@ -336,15 +318,16 @@
         xxx.xxx.xxx.xxx myhost.mydomain.tld  myhost
 </pre></div><br><br></dd>
-<dt><b><a name="Most frequently5">1.6. Server logs hostname instead of FQDN (or vice versa)</a></b></dt>
-<dd>The default is to log the hostname only, if you want the FQDN
-then there is an option for the server configuration:
-<div class="block"><pre>
-        [Misc]
-	SetStripDomain = true / false
-</pre></div><br><br></dd>
 </dl>
 <hr><h2>2. Build and install</h2>
 <dl>
-<dt><b><a name="Build and install0">2.1. &quot;make&quot; loops infinitely !</a></b></dt>
+<dt><b><a name="Build and install0">2.1. [Fedora Core] Cannot compile with --enable-khide</a></b></dt>
+<dd>The Fedora Core kernel is patched to unconditionally deny reading
+from /dev/kmem. Compiling the stealth kernel modules is not possible
+under these circumstances.<br><br></dd>
+<dt><b><a name="Build and install1">2.2. [Fedora Core] Cannot compile with --with-kcheck</a></b></dt>
+<dd>The Fedora Core kernel is patched to unconditionally deny reading
+from /dev/kmem. Checking the kernel for the presence of rootkits is
+not possible under these circumstances.<br><br></dd>
+<dt><b><a name="Build and install2">2.3. &quot;make&quot; loops infinitely !</a></b></dt>
 <dd>This may happen (e.g. when building via NFS for multiple architectures) 
    if the relative timestamps in the source directory are
@@ -353,9 +336,9 @@
    &quot;touch * &amp;&amp; make distclean&quot; in the source directory
    to recover.<br><br></dd>
-<dt><b><a name="Build and install1">2.2. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></b></dt>
+<dt><b><a name="Build and install3">2.4. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></b></dt>
 <dd>Ingo Rogalsky has provided the following information: It isn't possible 
    to link Samhain statically with Solaris. This
    is a Solaris issue (see Sun Infodoc ID12624) and not a samhain problem.<br><br></dd>
-<dt><b><a name="Build and install2">2.3. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></b></dt>
+<dt><b><a name="Build and install4">2.5. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></b></dt>
 <dd>For Linux, this is a known problem with --enable-static if you compile
      in MySQL support. The problem is that the 
@@ -373,5 +356,5 @@
      <i>client_libs</i> variable, and remove all instances 
      of <i>-lnss_files</i> and <i>-lnss_dns</i>.<br><br></dd>
-<dt><b><a name="Build and install3">2.4. The executable is corrupted after installation</a></b></dt>
+<dt><b><a name="Build and install5">2.6. The executable is corrupted after installation</a></b></dt>
 <dd>The executable will get stripped during the installation. On
         suitable systems (i386 Linux/FreeBSD currently), additionally 
@@ -383,40 +366,11 @@
         executable, therefore trying to strip manually after installation
         will corrupt the executable.<br><br></dd>
-<dt><b><a name="Build and install4">2.5. --enable-xml-log has no effect</a></b></dt>
+<dt><b><a name="Build and install6">2.7. --enable-xml-log has no effect</a></b></dt>
 <dd>If you have compiled for stealth, you won't see much, because if
         obfuscated, then both a 'normal' and an XML logfile look,
         well ... obfuscated. Use <code>samhain -jL /path/to/logfile</code>
         to view the logfile.<br><br></dd>
-<dt><b><a name="Build and install5">2.6. ./install-sh: strip: not found (Solaris)</a></b></dt>
+<dt><b><a name="Build and install7">2.8. ./install-sh: strip: not found (Solaris)</a></b></dt>
 <dd>Install the SUNWbtool package.<br><br></dd>
-<dt><b><a name="Build and install6">2.7. What is sh_tiger1.s?</a></b></dt>
-<dd>This is a precompiled assembly file for the i386 architecture 
-generated from sh_tiger1.c using gcc 3.4.0 with the following options,
-that were found to generate the fastest code:
-<pre>
- -O1 -fno-delayed-branch -fexpensive-optimizations -fstrength-reduce 
-     -fpeephole2 -fschedule-insns2 -fregmove -frename-registers -fweb 
-     -momit-leaf-frame-pointer -funroll-loops
-</pre>
-These options were determined using 
-<a href="http://www.coyotegulch.com/products/acovea/">acovea</a> 5.1.1 
-by  Scott Robert Ladd. The file is provided as precompiled assembly 
-because different versions of gcc can have very different performance, 
-require different options to compile optimal code, and
-it would be impossible to maintain a library of optimal compile options
-for every version of gcc.<br><br></dd>
-<dt><b><a name="Build and install7">2.8. Why does static compiling (<code>--enable-static</code>) on MaxOS X fail ?</a></b></dt>
-<dd>Static linking is not supported on MacOS X, see 
-<a href="http://developer.apple.com/qa/qa2001/qa1118.html">Technical Q&A QA1118</a>. 
-This is a MacOS X issue and not a bug in samhain.<br><br></dd>
-<dt><b><a name="Build and install8">2.9. Why does compiling with MySQL fail on Solaris ?</a></b></dt>
-<dd>The reason is often the shell script 'mysql_config' that comes as part
-of MySQL. This script is intended to print appropriate compiler flags for
-compiling applications that use MySQL. Unfortunately, since Sun compiles
-MySQL with the Solaris compiler, this script outputs options for the Solaris 
-compiler (i.e. unsuitable for gcc). To solve this problem, you need to move
-this script (i.e. 'mysql_config') out of your PATH before running 
-<tt>./configure</tt> (unless of course you are using the Solaris compiler
-rather than gcc).<br><br></dd>
 </dl>
 <hr><h2>3. File checking</h2>
@@ -482,5 +436,5 @@
 as &quot;localhost&quot; to the server, thus the server 
 needs to trust the client name
-as reported by the client itself, and suppress all errors on resolving
+as reported by the client itself, and suppress all eroors on resolving
 this name to the apparent address. In the server configuration:
 
@@ -600,6 +554,5 @@
      <p>
      Alternatively, you can <code>scp</code> the database
-     to the client, run <code>samhain -t update -l none --foreground</code> 
-     (you
+     to the client, run <code>samhain -t update -l none</code> (you
      need to avoid logging because otherwise you will get in conflict with
      the running samhain daemon), and then <code>scp</code> the 
@@ -790,5 +743,5 @@
 
         2.) In your client or server configuration file, you are using
-        the option for a custom message header, but without paying attention
+        the option for a custum message header, but without paying attention
         to preserving the XML format.
 </pre></div><br><br></dd>
@@ -800,5 +753,5 @@
 
      This will enable/disable logging of the server timestamp for client
-     messages. The server timestamp will be written to a separate record,
+     messages. The server timestamp will be written to a seperate record,
      with <i>log_ref</i> set to the value of 
      <i>log_index</i> of the corresponding client message.<br><br></dd>
@@ -840,13 +793,4 @@
         number of the corresponding client message). Zero indicates a message
         by the server itself (e.g. the server's start message).<br><br></dd>
-<dt><b><a name="Database4">7.5. How can I check what is in the database ?</a></b></dt>
-<dd>Use a command line client to login to the database and query it:
-<div class="block"><pre>
-     sh$ mysql -u &lt;user_name&gt; -p &lt;database_name&gt;
-     Enter password: ****
-     mysql&gt; SELECT log_index,log_ref,log_host,log_sev,log_msg,path FROM &lt;table_name&gt; WHERE entry_status = 'NEW' ORDER BY log_index;
-     ....
-     mysql&gt; \q 
-</pre></div><br><br></dd>
 </dl>
 <hr>
Index: trunk/docs/HOWTO-client+server-troubleshooting.html
===================================================================
--- trunk/docs/HOWTO-client+server-troubleshooting.html	(revision 591)
+++ trunk/docs/HOWTO-client+server-troubleshooting.html	(revision 1)
@@ -30,5 +30,4 @@
 div.warnblock {
 	background: #b6c5f2; color: #000;
-	background: #ffffcc; color: #000;
 	margin: 1em; padding: 0 1em 0 1em;
 	border-width: 1px;
@@ -132,29 +131,4 @@
 <br>
 <hr>
-<div class="warnblock">
-<ul>
-  <li>Almost all problems can only be diagnosed correctly by checking the 
-      <b>server logs</b>.</li>
-  <li>
-    If the server does not write logs, <b>fix this first</b>. For debugging, 
-    stop the server, then run it in the foreground with 
-    <tt>yule -p info --foreground</tt>
-    <ul>
-      <li>
-	By default, the server logs to the file 
-	<tt>/var/log/yule/yule_log</tt>, and since the server drops 
-	root privileges on startup, the directory <tt>/var/log/yule</tt>
-	must be writable for the nonprivileged user the server runs 
-	as (the first existing out of: yule, daemon, nobody).
-      </li>
-      <li>
-	Logging to the logfile must be enabled in the
-	<tt>/etc/yulerc</tt> config file (e.g. LogSeverity=mark, or 
-	LogSeverity=info for enhanced verbosity).
-      </li>
-    </ul>
-  </li>
-</ul>
-</div>
 <p>
 This document aims to explain how to diagnose and fix common problems that
@@ -273,25 +247,13 @@
      <p>
      <p>
-     This does not work for a number of people because
-     <ol>
-       <li>
-	 the
-	 <tt>/etc/hosts</tt> file on the client machine has errors 
-	 (yes, there are plenty machines with a completely 
-	 messed up <tt>/etc/hosts</tt> file),
-       </li>
-       <li>
-	 the
-	 server cannot resolve the client address because the local DNS is
-	 misconfigured, or 
-       </li>
-       <li> 
-	 the client machine has multiple network interfaces, and
-	 the interface used is not the one the client name resolves to.
-       </li>
-     </ol>
-     </p>
-
-     <p>
+     This does not work for a number of people because (1) the
+     <tt>/etc/hosts</tt> file on the client machine has errors 
+     (yes, there are plenty machines with a completely 
+     messed up <tt>/etc/hosts</tt> file), (2) the
+     server cannot resolve the client address because the local DNS is
+     f***ed up, or (3) the client machine has multiple network interfaces, and
+     the interface used is not the one the client name resolves to.
+     </p>
+       <p>
        If the client uses the wrong interface on a multi-interface machine, 
        there is a config file option 
@@ -299,30 +261,29 @@
        that allows to choose the interface the client will use for
        outgoing connections.
-     </p>
-     <p>
+       </p>
+       <p>
        If you want to download the config file from the server, you
-       should instead use the corresponding command line option
+       should instead use the corresponding command line
        <tt>--bind-address=</tt><i>IP address</i>
        to select the interface.
-     </p>
-
-     <p>
-       If you encounter problems, you may (1) fix your 
-       <tt>/etc/hosts</tt> file(s), (2) fix your local DNS, or
-       (3) switch to the second method.
-     </p>
-     <p>
-       Error messages related to name resolving/cross-checking can be 
-       suppressed by setting a 
-       very low severity (lower than the logging threshold), e.g.
-     </p>
-     <p>
-       <tt>SeverityLookup=</tt><i>debug</i>
-     </p>
-     <p>
-       in the <i>Misc</i> section of the server configuration,
-       if you prefer running <i>unsafe</i> at any speed 
-       instead of fixing the problem (you have been warned). Doing so will
-       allow an attacker to pose as the client.
+       </p>
+
+     <p>
+     If you encounter problems, you may (1) fix your 
+     <tt>/etc/hosts</tt> file(s), (2) fix your local DNS, or
+     (3) switch to the second method.
+     </p>
+     <p>
+     Errors in name resolving/cross-checking can be avoided by setting a 
+     very low severity (lower than the logging threshold), e.g.
+     </p>
+     <p>
+     <tt>SeverityLookup=</tt><i>debug</i>
+     </p>
+     <p>
+     in the <i>Misc</i> section of the server configuration,
+     if you prefer running <i>unsafe</i> at any speed 
+     instead of fixing the problem (you have been warned). Doing so will
+     allow an attacker to pose as the client.
      </p>
   </li>
@@ -353,6 +314,5 @@
 <p>
 The client does <i>not</i> tell the server the path to the requested
-file - it just tells the <em>type</em> of the file, i.e. 
-either a configuration file or a database file. It is entirely the
+file - it just requests a config or a database file. It's entirely the
 responsibility of the server to locate the correct file and send it.
 </p>
@@ -385,15 +345,4 @@
 To fix: put the file in the correct location, make sure the permissions
 are ok.
-<ul>
-  <li>
-    Note that <em>the server drops root privileges at startup</em> and
-    runs as an unprivileged user (the first existing out of: 
-    yule, daemon, nobody).
-  </li>
-  <li>
-    Also remember that to access a file, at least execute permission is required
-    <em>for every directory in the path</em>.
-  </li>
-</ul>
 </p>
 
Index: trunk/docs/HOWTO-client+server.html
===================================================================
--- trunk/docs/HOWTO-client+server.html	(revision 591)
+++ trunk/docs/HOWTO-client+server.html	(revision 1)
@@ -144,5 +144,5 @@
 Client and server are 
 <b>distict applications</b>, and must be
-built separately. By default, installation names and paths (e.g.
+built seperately. By default, installation names and paths (e.g.
 the configuration file) are
 different. Do not blame us if you abuse './configure' options to 
Index: trunk/docs/HOWTO-samhain+GnuPG.html
===================================================================
--- trunk/docs/HOWTO-samhain+GnuPG.html	(revision 591)
+++ trunk/docs/HOWTO-samhain+GnuPG.html	(revision 1)
@@ -329,5 +329,5 @@
 emails signed by them).
 </p><p>
-So which is the correct file? Here we have to consider two separate
+So which is the correct file? Here we have to consider two seperate
 cases:
 </p>
Index: trunk/docs/HOWTO-samhain-on-windows.html
===================================================================
--- trunk/docs/HOWTO-samhain-on-windows.html	(revision 591)
+++ trunk/docs/HOWTO-samhain-on-windows.html	(revision 1)
@@ -135,6 +135,5 @@
 <b>Cygwin</b> POSIX emulation layer, and how to install it as a service. 
 These instructions have been written by Kris Dom,
-who has tested this on WinXP Professional, with additions by Geries Handal
-and Jorge Morgado.
+who has tested this on WinXP Professional.
 </p>
 <div class="block">
@@ -151,6 +150,5 @@
 logging) because Interix does not provide some of the required functionality 
 to build the email module. This issue should be fixed as of samhain 
-version 2.0.7 (not tested).<br />
-[Based on information kindly provided by Geries Handal].
+version 2.0.7 (not tested).<br />[Based on information kindly provided by Geries Handal].
 </p>
 </div>
@@ -194,21 +192,4 @@
 </li>
 </ul>
-<div class="block">
-<p>
-You don't need to download and install All packages. It is enough to keep
-the Default and then add the following additional packages:
-</p>
-<p>
-  Category Devel -> gcc: C compiler upgrade helper<br/>
-  Category Devel -> make: The GNU version of the 'make' utility<br/>
-  Category Libs  -> minires: A simple synchronous non caching stub resolver<br/>
-</p>
-<p>
-When selecting these packages, Cygwin installer will automatically add
-other packages based on their dependencies.
-The package minires is only necessary for a minimal Cygwin installation
-(below). [Kindly pointed out by Jorge Morgado].
-</p>
-</div>
 
 <h3>Cygwin installation</h3>
@@ -273,12 +254,4 @@
 <li>Configure:<br />
 &nbsp; &nbsp;<tt>$ ./configure --enable-xml-log=yes --with-tmp-dir=/usr/local/tmp --with-config-file=/usr/local/etc/samhainrc --with-log-file=/usr/local/log/samhain.log --with-pid-file=/usr/local/var/samhain.pid --with-state-dir=/usr/local/var</tt><br />
-<div class="block">
-<p>
-In my experience, the paths given in the 'configure' command should refer to
-the Cygwin filesystem view, i.e. <tt>/cygdrive/c/...</tt>, otherwise
-samhain may not work from a pure DOS shell, and may not run as a Windows 
-service [Rainer Wichmann].
-</p>
-</div>
 </li>
 <li>Make the binary:<br />
@@ -328,28 +301,4 @@
  </li>
  </ul>
-</li>
-<li>
-Files needed from c:\Cygwin\bin to create the /etc/passwd and /etc/group files:
- <ul>
- <li>
- mkpasswd.exe
- </li>
- <li>
- mkgroup.exe
- </li>
- </ul>
-<p>
-To generate these files on a minimal Cygwin installation execute - on a
-Windows Command Prompt:
-</p><p>
-&nbsp; &nbsp;<tt>mkdir c:\etc</tt><br />
-&nbsp; &nbsp;<tt>path\to\mkpasswd.exe -l > c:\etc\passwd</tt><br />
-&nbsp; &nbsp;<tt>path\to\mkgroup.exe -l > c:\etc\group</tt>
-</p><p>
-IMPORTANT NOTE: You should re-create these two files, each time the
-Windows users and groups accounts database changes. Failing to do this
-might generate critical log messages (depending on your configuration
-file).
-</p>
 </li>
 <li>
@@ -382,6 +331,6 @@
   </li>
   <li>Under the newly created &quot;Parameters&quot; key, add a new String 
-  value called &quot;Application&quot;.<br />
-  &nbsp; &nbsp;The value for &quot;Application&quot;
+  value called &quot;Applications&quot;.<br />
+  &nbsp; &nbsp;The value for &quot;Applications&quot;
   should be &quot;c:\usr\local\sbin\samhain.exe&quot;.</li>
   </ul>
@@ -399,28 +348,4 @@
 </li>
 </ul>
-<div class="block">
-<p>
-It seems that start/stop/restart the service does not work if samhain 
-is configured to run as a daemon, because the Windows service manager
-cannot track the forked daemon process.
-</p>
-<p>Therefore, if you run Samhain as a Windows service, it might be better
-to configure it as a 'normal' process which does not fork a daemon:
-<ul>
-  <li>
-    Set 'Daemon = no' in the samhainrc configuration file.
-  </li>
-  <li>
-    Edit the key HKEY_LOCAL_MACHINE-&gt;SYSTEM-&gt;CurrentControlSet-&gt;Services-&gt;Samhain->Parameters to add a string value named 'AppParameters', with
-    the value '--forever'.
-  </li>
-</ul>
-[Rainer Wichmann].
-</p>
-</div>
-<p>
-Also see <a href="http://support.microsoft.com/kb/q137890/">http://support.microsoft.com/kb/q137890/</a> for information regarding the creation of a 
-user-defined service.
-</p>
 <p>
 Note: the first time I tried to install samhain as an NT service, I first
@@ -429,67 +354,4 @@
 Samhain as a service.
 </p>
-
-
-<h2>Troubleshooting samhain</h2>
-
-<p>
-[Rainer Wichmann] I had some problems at first getting it to run as a 
-Windows service. Some tips:
-<ul>
-  <li>
-    Running samhain from a pure DOS shell (outside the Cygwin environment) 
-    helps to identify problems, in particular if it refuses to start
-    as a Windows service.
-  </li>
-  <li>
-    I found it neccessary to put the <tt>cygwin1.dll</tt> DLL into the
-    same directory as the <tt>samhain.exe</tt> executable. Also, you
-    can use the command <tt>ldd ./samhain.exe</tt> to identify further
-    Cygwin-specific DLL that may be required (if any).
-  </li>
-  <li>
-    Also, I found it neccessary to use Cygwin-style paths 
-    (<tt>/cygdrive/c/...</tt>) in the './configure ..' command when
-    compiling samhain.
-  </li>
-</ul>
-</p>
-    
-<p>
-[Tip from Jorge Morgado] If you, like me, have a Windows server not part of any domain and (for
-security reasons) you even turn off DNS resolution, you might probably get
-the following error when initializing the baseline database:
-</p>
-<pre>
-  ---------   sh_unix.c  ---   1487 ---------
-  According to uname, your nodename is yourcomputername, but your resolver
-  library cannot resolve this nodename to a FQDN.
-  Rather, it resolves this to yourcomputername.
-  For more information, see the entry about self-resolving under
-  'Most frequently' in the FAQ that you will find in the docs/ subdirectory
-  ----------------------------------------------
-</pre>
-<p>
-To fix this problem open the Registry Editor and create the following
-entries under the key
-HKLM\System\CurrentControlSet\Services\Tcpip\Parameters
-</p>
-<p>
-<tt>
-Name: Domain<br/>
-Type: REG_SZ<br/>
-Data: your.domain.name
-</tt>
-</p><p>
-<tt>
-Name: NV Domain<br/>
-Type: REG_SZ<br/>
-Data: your.domain.name
-</tt>
-</p><p>
-The NV Domain registry value contains the computer's primary DNS suffix
-while the Domain registry value contains the computer's primary DNS
-domain. This will make the warning message go away.
-</p>
 </div>
 </body>
Index: trunk/docs/HOWTO-write-modules.html
===================================================================
--- trunk/docs/HOWTO-write-modules.html	(revision 591)
+++ trunk/docs/HOWTO-write-modules.html	(revision 1)
@@ -662,7 +662,6 @@
 When checking files, samhain will walk the database to find files that
 are in the database, but have been deleted from the disk. If you enter
-data, you need to mark it as such by using a key that
-starts with something else but '/', otherwise samhain will complain
-if it has not been checked during the file check.
+non-file data, you need to mark it as such by using a key that
+starts with a 'K'.
 </p>
 <pre>
@@ -683,5 +682,5 @@
 (max. (PATH_MAX-1)/2). As noted
 above, you need to supply a key (stored as the 'filepath', which should
-start with a character different from '/'). To retrieve data, you can use
+start with the character 'K'). To retrieve data, you can use
 'sh_hash_db2pop'. The return value is either NULL (if no string was
 stored under this key), or the stored string (length returned in 'size').
Index: trunk/docs/MANUAL-2_0.ps
===================================================================
--- trunk/docs/MANUAL-2_0.ps	(revision 1)
+++ trunk/docs/MANUAL-2_0.ps	(revision 1)
@@ -0,0 +1,49475 @@
+%!PS-Adobe-2.0
+%%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software
+%%Title: MANUAL-2_0.dvi
+%%Pages: 134
+%%PageOrder: Ascend
+%%BoundingBox: 0 0 596 842
+%%DocumentFonts: Helvetica-Bold Times-Roman Times-Italic Times-Bold
+%%+ Helvetica Courier Courier-Bold Helvetica-Oblique Courier-BoldOblique
+%%+ Courier-Oblique
+%%EndComments
+%DVIPSWebPage: (www.radicaleye.com)
+%DVIPSCommandLine: dvips -O 0cm,1cm MANUAL-2_0.dvi
+%DVIPSParameters: dpi=600, compressed
+%DVIPSSource:  TeX output 2005.10.31:2204
+%%BeginProcSet: texc.pro
+%!
+/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
+N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72
+mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0
+0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{
+landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize
+mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[
+matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round
+exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{
+statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0]
+N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin
+/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array
+/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2
+array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N
+df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A
+definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get
+}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub}
+B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr
+1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3
+1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx
+0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx
+sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{
+rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp
+gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B
+/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{
+/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{
+A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy
+get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse}
+ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp
+fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17
+{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add
+chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{
+1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop}
+forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn
+/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put
+}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{
+bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A
+mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{
+SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{
+userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X
+1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4
+index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N
+/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{
+/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT)
+(LaserWriter 16/600)]{A length product length le{A length product exch 0
+exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse
+end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask
+grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot}
+imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round
+exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto
+fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p
+delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M}
+B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{
+p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S
+rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end
+
+%%EndProcSet
+%%BeginProcSet: 8r.enc
+% File  8r.enc as of 2002-03-12 for PSNFSS 9
+%
+% This is the encoding vector for Type1 and TrueType fonts to be used
+% with TeX.  This file is part of the PSNFSS bundle, version 9
+% 
+% Authors: S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry, W. Schmidt
+%
+% Idea is to have all the characters normally included in Type 1 fonts
+% available for typesetting. This is effectively the characters in Adobe
+% Standard Encoding + ISO Latin 1 + extra characters from Lucida + Euro.
+% 
+% Character code assignments were made as follows:
+% 
+% (1) the Windows ANSI characters are almost all in their Windows ANSI
+% positions, because some Windows users cannot easily reencode the
+% fonts, and it makes no difference on other systems. The only Windows
+% ANSI characters not available are those that make no sense for
+% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen
+% (173). quotesingle and grave are moved just because it's such an
+% irritation not having them in TeX positions.
+% 
+% (2) Remaining characters are assigned arbitrarily to the lower part
+% of the range, avoiding 0, 10 and 13 in case we meet dumb software.
+% 
+% (3) Y&Y Lucida Bright includes some extra text characters; in the
+% hopes that other PostScript fonts, perhaps created for public
+% consumption, will include them, they are included starting at 0x12.
+% 
+% (4) Remaining positions left undefined are for use in (hopefully)
+% upward-compatible revisions, if someday more characters are generally
+% available.
+% 
+% (5) hyphen appears twice for compatibility with both ASCII and Windows.
+%
+% (6) /Euro is assigned to 128, as in Windows ANSI
+% 
+/TeXBase1Encoding [
+% 0x00 (encoded characters from Adobe Standard not in Windows 3.1)
+  /.notdef /dotaccent /fi /fl
+  /fraction /hungarumlaut /Lslash /lslash
+  /ogonek /ring /.notdef
+  /breve /minus /.notdef 
+% These are the only two remaining unencoded characters, so may as
+% well include them.
+  /Zcaron /zcaron 
+% 0x10
+ /caron /dotlessi 
+% (unusual TeX characters available in, e.g., Lucida Bright)
+ /dotlessj /ff /ffi /ffl 
+ /.notdef /.notdef /.notdef /.notdef
+ /.notdef /.notdef /.notdef /.notdef
+ % very contentious; it's so painful not having quoteleft and quoteright
+ % at 96 and 145 that we move the things normally found there down to here.
+ /grave /quotesingle 
+% 0x20 (ASCII begins)
+ /space /exclam /quotedbl /numbersign
+ /dollar /percent /ampersand /quoteright
+ /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
+% 0x30
+ /zero /one /two /three /four /five /six /seven
+ /eight /nine /colon /semicolon /less /equal /greater /question
+% 0x40
+ /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O
+% 0x50
+ /P /Q /R /S /T /U /V /W
+ /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+% 0x60
+ /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o
+% 0x70
+ /p /q /r /s /t /u /v /w
+ /x /y /z /braceleft /bar /braceright /asciitilde
+ /.notdef % rubout; ASCII ends
+% 0x80
+ /Euro /.notdef /quotesinglbase /florin
+ /quotedblbase /ellipsis /dagger /daggerdbl
+ /circumflex /perthousand /Scaron /guilsinglleft
+ /OE /.notdef /.notdef /.notdef
+% 0x90
+ /.notdef /.notdef /.notdef /quotedblleft
+ /quotedblright /bullet /endash /emdash
+ /tilde /trademark /scaron /guilsinglright
+ /oe /.notdef /.notdef /Ydieresis
+% 0xA0
+ /.notdef % nobreakspace
+ /exclamdown /cent /sterling
+ /currency /yen /brokenbar /section
+ /dieresis /copyright /ordfeminine /guillemotleft
+ /logicalnot
+ /hyphen % Y&Y (also at 45); Windows' softhyphen
+ /registered
+ /macron
+% 0xD0
+ /degree /plusminus /twosuperior /threesuperior
+ /acute /mu /paragraph /periodcentered
+ /cedilla /onesuperior /ordmasculine /guillemotright
+ /onequarter /onehalf /threequarters /questiondown
+% 0xC0
+ /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+ /Egrave /Eacute /Ecircumflex /Edieresis
+ /Igrave /Iacute /Icircumflex /Idieresis
+% 0xD0
+ /Eth /Ntilde /Ograve /Oacute
+ /Ocircumflex /Otilde /Odieresis /multiply
+ /Oslash /Ugrave /Uacute /Ucircumflex
+ /Udieresis /Yacute /Thorn /germandbls
+% 0xE0
+ /agrave /aacute /acircumflex /atilde
+ /adieresis /aring /ae /ccedilla
+ /egrave /eacute /ecircumflex /edieresis
+ /igrave /iacute /icircumflex /idieresis
+% 0xF0
+ /eth /ntilde /ograve /oacute
+ /ocircumflex /otilde /odieresis /divide
+ /oslash /ugrave /uacute /ucircumflex
+ /udieresis /yacute /thorn /ydieresis
+] def
+
+%%EndProcSet
+%%BeginProcSet: texps.pro
+%!
+TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2
+index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll
+exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0
+ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{
+pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get
+div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type
+/nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end
+definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup
+sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll
+mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[
+exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if}
+forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def
+end
+
+%%EndProcSet
+%%BeginProcSet: special.pro
+%!
+TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N
+/vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N
+/rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N
+/@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{
+/hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho
+X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B
+/@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{
+/urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known
+{userdict/md get type/dicttype eq{userdict begin md length 10 add md
+maxlength ge{/md md dup length 20 add dict copy def}if end md begin
+/letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S
+atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{
+itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll
+transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll
+curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf
+pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}
+if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1
+-1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3
+get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip
+yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub
+neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{
+noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop
+90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get
+neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr
+1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr
+2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4
+-1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S
+TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{
+Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale
+}if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState
+save N userdict maxlength dict begin/magscale true def normalscale
+currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts
+/psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x
+psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx
+psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub
+TR/showpage{}N/erasepage{}N/setpagedevice{pop}N/copypage{}N/p 3 def
+@MacSetUp}N/doclip{psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll
+newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto
+closepath clip newpath moveto}N/endTexFig{end psf$SavedState restore}N
+/@beginspecial{SDict begin/SpecialSave save N gsave normalscale
+currentpoint TR @SpecialDefaults count/ocount X/dcount countdictstack N}
+N/@setspecial{CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs
+neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate
+rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse
+scale llx neg lly neg TR}{rhiSeen{rhi ury lly sub div dup scale llx neg
+lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx
+ury lineto llx ury lineto closepath clip}if/showpage{}N/erasepage{}N
+/setpagedevice{pop}N/copypage{}N newpath}N/@endspecial{count ocount sub{
+pop}repeat countdictstack dcount sub{end}repeat grestore SpecialSave
+restore end}N/@defspecial{SDict begin}N/@fedspecial{end}B/li{lineto}B
+/rl{rlineto}B/rc{rcurveto}B/np{/SaveX currentpoint/SaveY X N 1
+setlinecap newpath}N/st{stroke SaveX SaveY moveto}N/fil{fill SaveX SaveY
+moveto}N/ellipse{/endangle X/startangle X/yrad X/xrad X/savematrix
+matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc
+savematrix setmatrix}N end
+
+%%EndProcSet
+%%BeginProcSet: color.pro
+%!
+TeXDict begin/setcmykcolor where{pop}{/setcmykcolor{dup 10 eq{pop
+setrgbcolor}{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll
+}repeat setrgbcolor pop}ifelse}B}ifelse/TeXcolorcmyk{setcmykcolor}def
+/TeXcolorrgb{setrgbcolor}def/TeXcolorgrey{setgray}def/TeXcolorgray{
+setgray}def/TeXcolorhsb{sethsbcolor}def/currentcmykcolor where{pop}{
+/currentcmykcolor{currentrgbcolor 10}B}ifelse/DC{exch dup userdict exch
+known{pop pop}{X}ifelse}B/GreenYellow{0.15 0 0.69 0 setcmykcolor}DC
+/Yellow{0 0 1 0 setcmykcolor}DC/Goldenrod{0 0.10 0.84 0 setcmykcolor}DC
+/Dandelion{0 0.29 0.84 0 setcmykcolor}DC/Apricot{0 0.32 0.52 0
+setcmykcolor}DC/Peach{0 0.50 0.70 0 setcmykcolor}DC/Melon{0 0.46 0.50 0
+setcmykcolor}DC/YellowOrange{0 0.42 1 0 setcmykcolor}DC/Orange{0 0.61
+0.87 0 setcmykcolor}DC/BurntOrange{0 0.51 1 0 setcmykcolor}DC
+/Bittersweet{0 0.75 1 0.24 setcmykcolor}DC/RedOrange{0 0.77 0.87 0
+setcmykcolor}DC/Mahogany{0 0.85 0.87 0.35 setcmykcolor}DC/Maroon{0 0.87
+0.68 0.32 setcmykcolor}DC/BrickRed{0 0.89 0.94 0.28 setcmykcolor}DC/Red{
+0 1 1 0 setcmykcolor}DC/OrangeRed{0 1 0.50 0 setcmykcolor}DC/RubineRed{
+0 1 0.13 0 setcmykcolor}DC/WildStrawberry{0 0.96 0.39 0 setcmykcolor}DC
+/Salmon{0 0.53 0.38 0 setcmykcolor}DC/CarnationPink{0 0.63 0 0
+setcmykcolor}DC/Magenta{0 1 0 0 setcmykcolor}DC/VioletRed{0 0.81 0 0
+setcmykcolor}DC/Rhodamine{0 0.82 0 0 setcmykcolor}DC/Mulberry{0.34 0.90
+0 0.02 setcmykcolor}DC/RedViolet{0.07 0.90 0 0.34 setcmykcolor}DC
+/Fuchsia{0.47 0.91 0 0.08 setcmykcolor}DC/Lavender{0 0.48 0 0
+setcmykcolor}DC/Thistle{0.12 0.59 0 0 setcmykcolor}DC/Orchid{0.32 0.64 0
+0 setcmykcolor}DC/DarkOrchid{0.40 0.80 0.20 0 setcmykcolor}DC/Purple{
+0.45 0.86 0 0 setcmykcolor}DC/Plum{0.50 1 0 0 setcmykcolor}DC/Violet{
+0.79 0.88 0 0 setcmykcolor}DC/RoyalPurple{0.75 0.90 0 0 setcmykcolor}DC
+/BlueViolet{0.86 0.91 0 0.04 setcmykcolor}DC/Periwinkle{0.57 0.55 0 0
+setcmykcolor}DC/CadetBlue{0.62 0.57 0.23 0 setcmykcolor}DC
+/CornflowerBlue{0.65 0.13 0 0 setcmykcolor}DC/MidnightBlue{0.98 0.13 0
+0.43 setcmykcolor}DC/NavyBlue{0.94 0.54 0 0 setcmykcolor}DC/RoyalBlue{1
+0.50 0 0 setcmykcolor}DC/Blue{1 1 0 0 setcmykcolor}DC/Cerulean{0.94 0.11
+0 0 setcmykcolor}DC/Cyan{1 0 0 0 setcmykcolor}DC/ProcessBlue{0.96 0 0 0
+setcmykcolor}DC/SkyBlue{0.62 0 0.12 0 setcmykcolor}DC/Turquoise{0.85 0
+0.20 0 setcmykcolor}DC/TealBlue{0.86 0 0.34 0.02 setcmykcolor}DC
+/Aquamarine{0.82 0 0.30 0 setcmykcolor}DC/BlueGreen{0.85 0 0.33 0
+setcmykcolor}DC/Emerald{1 0 0.50 0 setcmykcolor}DC/JungleGreen{0.99 0
+0.52 0 setcmykcolor}DC/SeaGreen{0.69 0 0.50 0 setcmykcolor}DC/Green{1 0
+1 0 setcmykcolor}DC/ForestGreen{0.91 0 0.88 0.12 setcmykcolor}DC
+/PineGreen{0.92 0 0.59 0.25 setcmykcolor}DC/LimeGreen{0.50 0 1 0
+setcmykcolor}DC/YellowGreen{0.44 0 0.74 0 setcmykcolor}DC/SpringGreen{
+0.26 0 0.76 0 setcmykcolor}DC/OliveGreen{0.64 0 0.95 0.40 setcmykcolor}
+DC/RawSienna{0 0.72 1 0.45 setcmykcolor}DC/Sepia{0 0.83 1 0.70
+setcmykcolor}DC/Brown{0 0.81 1 0.60 setcmykcolor}DC/Tan{0.14 0.42 0.56 0
+setcmykcolor}DC/Gray{0 0 0 0.50 setcmykcolor}DC/Black{0 0 0 1
+setcmykcolor}DC/White{0 0 0 0 setcmykcolor}DC end
+
+%%EndProcSet
+TeXDict begin @defspecial
+
+ /DvipsToPDF { 72.27 mul Resolution div } def /PDFToDvips { 72.27 div
+Resolution mul } def /HyperBorder { 1 PDFToDvips } def /H.V {pdf@hoff
+pdf@voff null} def /H.B {/Rect[pdf@llx pdf@lly pdf@urx pdf@ury]} def
+/H.S { currentpoint HyperBorder add /pdf@lly exch def dup DvipsToPDF
+/pdf@hoff exch def HyperBorder sub /pdf@llx exch def } def /H.L { 2
+sub dup /HyperBasePt exch def PDFToDvips /HyperBaseDvips exch def currentpoint
+HyperBaseDvips sub /pdf@ury exch def /pdf@urx exch def } def /H.A {
+H.L currentpoint exch pop vsize 72 sub exch DvipsToPDF HyperBasePt
+sub sub /pdf@voff exch def } def /H.R { currentpoint HyperBorder sub
+/pdf@ury exch def HyperBorder add /pdf@urx exch def currentpoint exch
+pop vsize 72 sub exch DvipsToPDF sub /pdf@voff exch def } def systemdict
+/pdfmark known not {userdict /pdfmark systemdict /cleartomark get put}
+if
+ 
+@fedspecial end TeXDict begin
+39158280 55380996 1000 600 600 (MANUAL-2_0.dvi) @start
+/Fa 106[21 149[{ TeXBase1Encoding ReEncodeFont }1 59.7758
+/Times-Roman rf /Fb 139[33 1[33 2[33 5[33 33 3[33 33
+51[33 47[{ TeXBase1Encoding ReEncodeFont }8 54.4708 /Courier-BoldOblique
+rf /Fc 139[45 1[45 2[45 5[45 45 2[45 17[45 14[45 45 5[45
+61[{ TeXBase1Encoding ReEncodeFont }10 74.7198 /Courier-Bold
+rf /Fd 137[36 1[36 36 36 2[36 36 4[36 36 2[36 36 36 51[36
+47[{ TeXBase1Encoding ReEncodeFont }12 60.523 /Courier-BoldOblique
+rf /Fe 106[23 149[{ TeXBase1Encoding ReEncodeFont }1
+66.4176 /Helvetica rf
+%DVIPSBitmapFont: Ff cmmi10 10 2
+/Ff 2 63 df<EF0380EF0FC0173FEFFF80933803FE00EE0FF8EE3FE0EEFF80DB03FEC7FC
+ED0FF8ED3FE0EDFF80DA03FEC8FCEC0FF8EC3FE0ECFF80D903FEC9FCEB0FF8EB3FE0EBFF
+80D803FECAFCEA0FF8EA3FE0EA7F8000FECBFCA2EA7F80EA3FE0EA0FF8EA03FEC66C7EEB
+3FE0EB0FF8EB03FE903800FF80EC3FE0EC0FF8EC03FE913800FF80ED3FE0ED0FF8ED03FE
+923800FF80EE3FE0EE0FF8EE03FE933800FF80EF3FC0170FEF0380323279AD41>60
+D<126012FCB4FCEA7FC0EA1FF0EA07FCEA01FF38007FC0EB1FF0EB07FCEB01FF9038007F
+C0EC1FF0EC07FCEC01FF9138007FC0ED1FF0ED07FCED01FF9238007FC0EE1FF0EE07FCEE
+01FF9338007F80EF1FC0A2EF7F80933801FF00EE07FCEE1FF0EE7FC04B48C7FCED07FCED
+1FF0ED7FC04A48C8FCEC07FCEC1FF0EC7FC04948C9FCEB07FCEB1FF0EB7FC04848CAFCEA
+07FCEA3FF0EA7FC048CBFC12FC1270323279AD41>62 D E
+%EndDVIPSBitmapFont
+/Fg 134[40 1[40 1[40 40 40 40 1[40 40 40 40 40 3[40 2[40
+40 1[40 40 1[40 47[40 47[{ TeXBase1Encoding ReEncodeFont }18
+67.2479 /Courier-Oblique rf
+%DVIPSBitmapFont: Fh cmmi9 9 2
+/Fh 2 63 df<171C177EEE01FEEE07FCEE1FF0EE7FC0923801FF00ED07FCED1FF0ED7FC0
+4A48C7FCEC07FCEC1FF0EC7FC04948C8FCEB07FCEB1FF0EB7FC04848C9FCEA07FCEA1FF0
+EA7FC048CAFCA2EA7FC0EA1FF0EA07FCEA01FF38007FC0EB1FF0EB07FCEB01FF9038007F
+C0EC1FF0EC07FCEC01FF9138007FC0ED1FF0ED07FCED01FF9238007FC0EE1FF0EE07FCEE
+01FEEE007E171C2F2E7AA93C>60 D<127012FCB4FCEA7FC0EA1FF0EA07FCEA01FF38007F
+C0EB1FF0EB07FCEB01FF9038007FC0EC1FF0EC07FCEC01FF9138007FC0ED1FF0ED07FCED
+01FF9238007FC0EE1FF0EE07FCEE01FEA2EE07FCEE1FF0EE7FC0923801FF00ED07FCED1F
+F0ED7FC04A48C7FCEC07FCEC1FF0EC7FC04948C8FCEB07FCEB1FF0EB7FC04848C9FCEA07
+FCEA1FF0EA7FC048CAFC12FC12702F2E7AA93C>62 D E
+%EndDVIPSBitmapFont
+%DVIPSBitmapFont: Fi cmmi8 8 2
+/Fi 2 63 df<EE01C01607161FEE7F00ED01FCED07F0ED1FC0037FC7FCEC01FCEC07F0EC
+0FC0023FC8FC14FCEB03F8EB0FE0EB3F8001FEC9FCEA03F8EA0FE0EA3F8000FECAFC12F8
+12FEEA3F80EA0FE0EA03F8EA00FEEB3F80EB0FE0EB03F8EB00FC143FEC0FC0EC07F0EC01
+FCEC007FED1FC0ED07F0ED01FCED007FEE1FC0160716012A2B7AA537>60
+D<12E012F812FEEA3F80EA0FE0EA03F8EA00FEEB3F80EB0FE0EB03F8EB00FC143FEC0FC0
+EC07F0EC01FCEC007FED1FC0ED07F0ED01FCED007FEE1FC01607161FEE7F00ED01FCED07
+F0ED1FC0037FC7FCEC01FCEC07F0EC0FC0023FC8FC14FCEB03F8EB0FE0EB3F8001FEC9FC
+EA03F8EA0FE0EA3F8000FECAFC12F812E02A2B7AA537>62 D E
+%EndDVIPSBitmapFont
+/Fj 134[55 55 1[55 61 33 55 39 1[61 61 61 89 28 55 1[28
+61 61 33 55 61 55 61 55 12[61 66 72 1[66 2[83 5[78 3[72
+1[72 7[55 55 55 55 55 55 55 55 55 55 28 28 33 42[61 2[{
+ TeXBase1Encoding ReEncodeFont }44 99.6264 /Helvetica-Bold
+rf /Fk 134[45 4[45 45 45 2[45 45 45 45 2[45 2[45 45 45
+45 45 45 97[{ TeXBase1Encoding ReEncodeFont }15 74.7198
+/Courier-Oblique rf /Fl 129[45 1[45 2[45 45 45 45 45
+45 45 45 1[45 45 45 45 45 45 45 45 45 45 45 45 45 45
+45 45 1[45 1[45 45 45 1[45 45 2[45 45 45 45 1[45 45 45
+45 45 45 1[45 45 45 45 45 45 45 45 45 45 1[45 45 3[45
+45 45 45 45 45 1[45 45 45 45 45 45 45 45 1[45 45 2[45
+2[45 34[{ TeXBase1Encoding ReEncodeFont }72 74.7198 /Courier-BoldOblique
+rf /Fm 134[40 40 1[40 40 40 40 40 1[40 40 40 40 40 2[40
+40 40 40 40 40 40 40 40 8[40 9[40 40 7[40 3[40 17[40
+1[40 1[40 43[{ TeXBase1Encoding ReEncodeFont }29 67.2479
+/Courier-BoldOblique rf /Fn 134[36 2[36 36 36 36 36 1[36
+36 36 36 36 2[36 36 36 1[36 36 1[36 36 36 48[36 36 36
+45[{ TeXBase1Encoding ReEncodeFont }22 60.523 /Courier-Bold
+rf /Fo 140[36 10[36 5[36 36 60[36 36[{ TeXBase1Encoding ReEncodeFont }5
+60.523 /Courier rf /Fp 133[60 66 66 93 66 73 40 66 47
+73 73 73 73 106 33 66 1[33 73 73 40 66 73 66 73 66 8[80
+113 80 86 73 80 86 93 80 93 86 100 73 2[33 86 93 73 80
+86 86 86 86 1[73 4[40 66 66 66 66 66 66 66 66 66 66 33
+33 40 3[40 40 37[73 2[{ TeXBase1Encoding ReEncodeFont }65
+119.552 /Helvetica-Bold rf /Fq 133[37 37 37 54 37 42
+21 37 25 42 42 42 42 62 17 37 1[17 42 42 21 42 42 37
+42 42 3[21 1[21 1[50 50 2[54 46 50 3[58 54 62 42 50 1[21
+54 58 1[50 54 54 50 50 3[44 4[42 42 2[42 1[42 42 42 21
+21 25 3[25 25 17 36[37 2[{ TeXBase1Encoding ReEncodeFont }59
+74.7198 /Helvetica-Oblique rf /Fr 129[45 45 45 45 45
+45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
+45 45 45 45 45 45 45 45 45 1[45 45 45 1[45 45 45 45 45
+45 45 45 45 45 45 45 45 45 45 1[45 45 45 45 45 45 45
+45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
+45 45 45 45 45 45 45 45 45 45 1[45 45 45 45 45 33[{
+ TeXBase1Encoding ReEncodeFont }90 74.7198 /Courier rf
+/Fs 131[40 1[40 40 40 40 40 40 40 40 40 1[40 40 40 40
+40 40 1[40 40 40 40 40 40 40 40 40 40 40 1[40 1[40 1[40
+40 40 1[40 40 40 40 1[40 40 40 40 3[40 40 1[40 40 40
+40 40 40 40 1[40 40 2[40 40 40 40 40 40 40 40 40 40 40
+40 40 40 40 6[40 40 1[40 34[{ TeXBase1Encoding ReEncodeFont }69
+67.2479 /Courier-Bold rf /Ft 129[40 1[40 1[40 40 40 40
+40 40 40 40 40 1[40 40 40 40 40 40 1[40 40 40 40 40 40
+40 40 40 1[40 1[40 40 40 6[40 40 40 2[40 1[40 3[40 40
+2[40 3[40 1[40 1[40 1[40 40 40 6[40 40 40 40 40 40 40
+1[40 40 40 3[40 40 40 34[{ TeXBase1Encoding ReEncodeFont }57
+67.2479 /Courier rf /Fu 133[72 80 80 112 80 88 48 80
+56 88 88 88 88 128 40 80 1[40 88 88 48 80 88 80 88 80
+9[135 96 104 88 96 104 112 96 112 1[120 88 104 1[40 104
+112 88 96 104 104 104 104 6[48 80 80 80 80 80 80 80 80
+80 80 40 40 48 40 2[48 48 40 104 35[88 2[{
+ TeXBase1Encoding ReEncodeFont }66 143.462 /Helvetica-Bold
+rf /Fv 104[75 2[25 25 24[37 37 37 54 37 42 21 37 25 42
+42 42 42 62 17 37 17 17 42 42 21 42 42 37 42 42 1[42
+1[21 1[21 46 50 50 71 50 54 46 50 54 58 50 58 54 62 42
+50 1[21 54 58 46 50 54 54 50 50 2[44 44 1[21 21 42 42
+42 42 42 42 1[42 42 42 21 21 25 21 44 29 25 25 17 1[66
+2[27 21 30[37 2[{ TeXBase1Encoding ReEncodeFont }83 74.7198
+/Helvetica rf /Fw 133[37 42 1[58 42 46 25 42 29 1[46
+46 46 66 21 42 21 21 46 46 25 42 46 42 46 42 1[42 1[25
+1[25 1[50 50 1[50 54 46 50 54 58 50 58 54 62 46 54 1[21
+54 1[46 50 54 54 1[54 3[44 2[25 9[42 21 21 25 3[25 25
+21 36[46 2[{ TeXBase1Encoding ReEncodeFont }58 74.7198
+/Helvetica-Bold rf /Fx 104[74 25[33 1[33 32 37 37 55
+37 42 23 32 32 42 42 42 42 60 23 37 23 23 42 42 23 37
+42 37 42 42 1[42 1[32 1[32 2[51 1[51 60 46 42 51 60 51
+60 55 69 46 55 1[28 60 60 51 51 60 55 51 51 76 2[56 2[28
+42 42 42 42 42 42 42 42 42 42 23 21 28 21 40[42 42 2[{
+ TeXBase1Encoding ReEncodeFont }73 83.022 /Times-Italic
+rf /Fy 104[83 26[18 1[37 42 42 60 42 46 28 32 37 46 46
+42 46 69 23 46 28 23 46 42 28 37 46 37 46 42 1[42 1[28
+23 28 1[60 60 1[60 60 55 46 60 65 51 65 60 78 55 65 1[32
+65 65 51 55 60 60 55 60 77 2[47 1[28 28 42 42 42 42 42
+42 42 42 42 42 23 21 28 21 47 1[28 28 28 69 1[42 42 46
+28 30[46 2[{ TeXBase1Encoding ReEncodeFont }83 83.022
+/Times-Bold rf /Fz 104[172 29[96 96 1[96 105 57 96 67
+1[105 105 105 153 48 96 1[48 105 105 57 96 105 96 105
+96 12[105 115 2[115 3[105 2[48 124 134 105 115 124 124
+124 124 7[96 96 96 96 96 96 96 96 96 96 48 48 1[48 41[105
+2[{ TeXBase1Encoding ReEncodeFont }50 172.154 /Helvetica-Bold
+rf /FA 138[33 18 26 26 2[33 33 48 3[18 3[29 1[29 1[33
+11[48 6[44 1[37 4[48 41 1[48 68[{ TeXBase1Encoding ReEncodeFont }17
+66.4176 /Times-Italic rf /FB 106[23 27[33 33 48 33 33
+18 26 22 1[33 33 33 52 18 33 1[18 33 33 22 29 33 29 33
+29 7[48 1[63 48 48 41 37 2[37 2[59 3[22 2[37 2[44 44
+48 6[18 33 1[33 1[33 1[33 33 33 33 18 17 22 17 2[22 22
+40[{ TeXBase1Encoding ReEncodeFont }51 66.4176 /Times-Roman
+rf /FC 86[63 17[83 2[37 37 20[45 1[17 1[37 42 42 60 42
+42 23 32 28 42 42 42 42 65 23 42 23 23 42 42 28 37 42
+37 42 37 1[42 39 28 1[28 51 60 60 78 60 60 51 46 55 60
+46 60 60 74 51 60 32 28 60 60 46 51 60 55 55 60 76 37
+47 47 47 23 23 42 42 42 42 42 42 42 42 42 42 23 21 28
+21 47 42 28 28 28 65 69 42 42 34 28 29[46 46 2[{
+ TeXBase1Encoding ReEncodeFont }96 83.022 /Times-Roman
+rf /FD 134[46 2[46 51 28 46 32 1[51 51 51 74 23 2[23
+51 51 28 46 51 46 51 46 13[55 2[55 2[69 51 2[23 2[51
+1[60 60 64[51 2[{ TeXBase1Encoding ReEncodeFont }29 83.022
+/Helvetica-Bold rf /FE 145[126 184 3[57 126 6[115 13[138
+83[{ TeXBase1Encoding ReEncodeFont }6 206.584 /Helvetica-Bold
+rf end
+%%EndProlog
+%%BeginSetup
+%%Feature: *Resolution 600dpi
+TeXDict begin
+%%PaperSize: A4
+ end
+%%EndSetup
+%%Page: 1 1
+TeXDict begin 1 0 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a -600 -364
+a
+SDict begin [ /Title () /Subject () /Creator (LaTeX with hyperref package)
+/Author () /Producer (dvips + Distiller) /Keywords () /DOCINFO pdfmark
+end
+ -600 -364 a Black 0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a
+0 TeXcolorgray 0 TeXcolorgray -2 134 a
+SDict begin H.R end
+ -2 134 a -2 134
+a
+SDict begin [ /View [/XYZ H.V] /Dest (page.1) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226 a
+SDict begin [ /Count -0 /Dest (1.0) cvn /Title (Samhain) /OUT pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (2.0) cvn /Title (Table of Contents)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (3.0) cvn /Title (Chapter 1. Introduction)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -10 /Dest (4.0) cvn /Title (Chapter 2. Compiling and installing)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.1.1) cvn /Title (2.1. Overview) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.2.1) cvn /Title (2.2. Requirements)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.3.1) cvn /Title (2.3. Download and extract)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.4.1) cvn /Title (2.4. Configuring the source)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.5.1) cvn /Title (2.5. Build) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (4.6.1) cvn /Title (2.6. Install) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.6.1.2) cvn /Title (2.6.1. Important make targets)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.7.1) cvn /Title (2.7. Customize) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.8.1) cvn /Title (2.8. Initialize the baseline database)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.9.1) cvn /Title (2.9. Run samhain)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -4 /Dest (4.10.1) cvn /Title (2.10. Files and directory layout)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.2.2) cvn /Title (2.10.1. Trusted users and trusted paths)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.3.2) cvn /Title (2.10.2. Directory layout)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (4.10.4.2) cvn /Title (2.10.3. Runtime files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.4.1.3) cvn /Title (2.10.3.1. Standalone or client)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.4.2.3) cvn /Title (2.10.3.2. Server)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (4.10.5.2) cvn /Title (2.10.4. Installed files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.5.3.3) cvn /Title (2.10.4.1. Standalone or client)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (4.10.5.4.3) cvn /Title (2.10.4.2. Server)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -10 /Dest (5.0) cvn /Title (Chapter 3. General usage notes)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.11.1) cvn /Title (3.1. How to invoke)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.12.1) cvn /Title (3.2. Using daemontool \(or similar utilities\))
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.13.1) cvn /Title (3.3. Controlling the daemon)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.14.1) cvn /Title (3.4. Signals) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.15.1) cvn /Title (3.5. PID file) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.16.1) cvn /Title (3.6. Log file rotation)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.17.1) cvn /Title (3.7. Updating the file signature database)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.18.1) cvn /Title (3.8. Improving the signaltonoise ratio)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.19.1) cvn /Title (3.9. Runtime options: commandline configuration file)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (5.20.1) cvn /Title (3.10. Support / Bugs / Problems)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -12 /Dest (6.0) cvn /Title (Chapter 4. Configuration of logging facilities)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (6.21.1) cvn /Title (4.1. Severity levels and classes of log messages)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.21.6.2) cvn /Title (4.1.1. Severity levels)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.21.7.2) cvn /Title (4.1.2. Classes)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.22.1) cvn /Title (4.2. Overview of logging facilities)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.23.1) cvn /Title (4.3. Activating logging facilities and filtering messages)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (6.24.1) cvn /Title (4.4. Email) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.24.8.2) cvn /Title (4.4.1. Email reports and their integrity)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (6.25.1) cvn /Title (4.5. Log file) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.25.9.2) cvn /Title (4.5.1. The log file and its integrity)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (6.26.1) cvn /Title (4.6. Log server)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.26.10.2) cvn /Title (4.6.1. Details)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.27.1) cvn /Title (4.7. External facilities)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.28.1) cvn /Title (4.8. Console) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -2 /Dest (6.29.1) cvn /Title (4.9. Prelude) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.29.11.2) cvn /Title (4.9.1. Registering to a Prelude 0.9 manager)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.29.12.2) cvn /Title (4.9.2. Registering to a Prelude 0.8 manager)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.30.1) cvn /Title (4.10. Using samhain with nagios)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.31.1) cvn /Title (4.11. Syslog) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (6.32.1) cvn /Title (4.12. SQL Database)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -15 /Dest (7.0) cvn /Title (Chapter 5. Configuration samhain, the file monitor)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.33.1) cvn /Title (5.1. Usage overview)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.34.1) cvn /Title (5.2. Available checksum functions)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.35.1) cvn /Title (5.3. File signatures)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -9 /Dest (7.36.1) cvn /Title (5.4. Defining which files/directories to monitor)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.13.2) cvn /Title (5.4.1. Monitoring policies)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (7.36.14.2) cvn /Title (5.4.2. File/directory specification)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.14.5.3) cvn /Title (5.4.2.1. Rules)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.15.2) cvn /Title (5.4.3. Suppress messages about new/deleted files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.16.2) cvn /Title (5.4.4. Dynamic database update \(modified/disappeared/new files\))
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.17.2) cvn /Title (5.4.5. Recursion depth\(s\))
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (7.36.18.2) cvn /Title (5.4.6. Hardlink check)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.18.6.3) cvn /Title (5.4.6.1. Specify exceptions for the hardlink check)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.19.2) cvn /Title (5.4.7. Check for weird filenames)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.20.2) cvn /Title (5.4.8. Support for prelink)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.36.21.2) cvn /Title (5.4.9. Codes in messages about reported files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.37.1) cvn /Title (5.5. Excluding files and/or subdirectories \(All except \))
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (7.38.1) cvn /Title (5.6. Timing file checks)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.38.22.2) cvn /Title (5.6.1. Using a second schedule)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.39.1) cvn /Title (5.7. Initializing, updating, or checking)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.40.1) cvn /Title (5.8. The file signature database)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -2 /Dest (7.41.1) cvn /Title (5.9. Checking the file system for SUID/SGID binaries)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.41.23.2) cvn /Title (5.9.1. Quarantine SUID/SGID files)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.41.24.2) cvn /Title (5.9.2. Configuration)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -4 /Dest (7.42.1) cvn /Title (5.10. Detecting Kernel rootkits)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.42.25.2) cvn /Title (5.10.1. Configuration)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.42.26.2) cvn /Title (5.10.2. What is a kernel rootkit ?)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.42.27.2) cvn /Title (5.10.3. Implemented integrity checks)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.42.28.2) cvn /Title (5.10.4. Error messages)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.43.1) cvn /Title (5.11. Monitoring login/logout events)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.44.1) cvn /Title (5.12. Checking mounted filesystem policies)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.45.1) cvn /Title (5.13. Checking sensitive files owned by users)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.46.1) cvn /Title (5.14. Modules) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (7.47.1) cvn /Title (5.15. Performance tuning)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -13 /Dest (8.0) cvn /Title (Chapter 6. yule, the log server)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.48.1) cvn /Title (6.1. General) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.49.1) cvn /Title (6.2. Important installation notes)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.50.1) cvn /Title (6.3. Registering a client)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.51.1) cvn /Title (6.4. Enabling logging to the server)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -2 /Dest (8.52.1) cvn /Title (6.5. Enabling baseline database / configuration file download from the server)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.52.29.2) cvn /Title (6.5.1. Configuration file)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.52.30.2) cvn /Title (6.5.2. Database file)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.53.1) cvn /Title (6.6. Rules for logging of client messages)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.54.1) cvn /Title (6.7. Detecting 'dead' clients)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.55.1) cvn /Title (6.8. The HTML server status page)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.56.1) cvn /Title (6.9. Chroot) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.57.1) cvn /Title (6.10. Restrict access with libwrap \(tcp wrappers\))
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (8.58.1) cvn /Title (6.11. Sending commands to clients)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.58.31.2) cvn /Title (6.11.1. Communicating with the server)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.58.32.2) cvn /Title (6.11.2. Authenticating to the server)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.59.1) cvn /Title (6.12. Syslog logging)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (8.60.1) cvn /Title (6.13. Performance tuning)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -3 /Dest (9.0) cvn /Title (Chapter 7. Hooks for External Programs)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (9.61.1) cvn /Title (7.1. Pipes) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (9.62.1) cvn /Title (7.2. System V message queue)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (9.63.1) cvn /Title (7.3. Calling external programs)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (9.63.33.2) cvn /Title (7.3.1. Example setup for paging)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (10.0) cvn /Title (Chapter 8. Additional Features Signed Configuration/Database Files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (10.64.1) cvn /Title (8.1. The samhainadmin script)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (11.0) cvn /Title (Chapter 9. Additional Features Stealth)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (11.65.1) cvn /Title (9.1. Hiding the executable)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (11.65.34.2) cvn /Title (9.1.1. Using kernel modules to hide samhain \(Linux/ix86 only\))
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (11.66.1) cvn /Title (9.2. Packing the executable)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -2 /Dest (12.0) cvn /Title (Chapter 10. Deployment to remote hosts)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -12 /Dest (12.67.1) cvn /Title (10.1. Method A: The deployment system)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.35.2) cvn /Title (10.1.1. Requirements)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -2 /Dest (12.67.36.2) cvn /Title (10.1.2. Layout of the deployment system)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.36.7.3) cvn /Title (10.1.2.1. The configs subdirectory)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.36.8.3) cvn /Title (10.1.2.2. The archpkg subdirectory)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -4 /Dest (12.67.37.2) cvn /Title (10.1.3. Customizing the system)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.37.9.3) cvn /Title (10.1.3.1. Setting default options)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.37.10.3) cvn /Title (10.1.3.2. Adding support for an architecture)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.37.11.3) cvn /Title (10.1.3.3. Perarchitecture pre/postinstallation scripts)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.37.12.3) cvn /Title (10.1.3.4. Perhost runtime configuration)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.38.2) cvn /Title (10.1.4. Using the deploy.sh script)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.38.13.3) cvn /Title (10.1.4.1. General options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.39.2) cvn /Title (10.1.5. deploy.sh info)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.39.14.3) cvn /Title (10.1.5.1. Specific options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.40.2) cvn /Title (10.1.6. deploy.sh clean)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.40.15.3) cvn /Title (10.1.6.1. Specific options)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.41.2) cvn /Title (10.1.7. deploy.sh download)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.41.16.3) cvn /Title (10.1.7.1. Specific options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.42.2) cvn /Title (10.1.8. deploy.sh checksrc)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.42.17.3) cvn /Title (10.1.8.1. Specific options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.43.2) cvn /Title (10.1.9. deploy.sh build)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.43.18.3) cvn /Title (10.1.9.1. Specific options)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.44.2) cvn /Title (10.1.10. deploy.sh install)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.44.19.3) cvn /Title (10.1.10.1. Specific options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -1 /Dest (12.67.45.2) cvn /Title (10.1.11. deploy.sh uninstall)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.45.20.3) cvn /Title (10.1.11.1. Specific options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.67.46.2) cvn /Title (10.1.12. Usage notes)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -5 /Dest (12.68.1) cvn /Title (10.2. Method B: The native package manager)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -2 /Dest (12.68.47.2) cvn /Title (10.2.1. Building an RPM)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.47.21.3) cvn /Title (10.2.1.1. Custom RPM)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.47.22.3) cvn /Title (10.2.1.2. Singlehost)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.48.2) cvn /Title (10.2.2. Building an HPUX package)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.49.2) cvn /Title (10.2.3. Building a Solaris package)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.50.2) cvn /Title (10.2.4. Building a Gentoo Linux package)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (12.68.51.2) cvn /Title (10.2.5. Building a Debian package)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -5 /Dest (13.0) cvn /Title (Chapter 11. Security Design)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (13.69.1) cvn /Title (11.1. Usage) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (13.70.1) cvn /Title (11.2. Integrity of the executable)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (13.71.1) cvn /Title (11.3. Client executable integrity)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (13.72.1) cvn /Title (11.4. The server)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (13.73.1) cvn /Title (11.5. General)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -5 /Dest (14.0) cvn /Title (Appendix A. List of options for the ./configure script)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (14.74.1) cvn /Title (A.1. General) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (14.75.1) cvn /Title (A.2. Optional modules to perfor additional checks)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (14.76.1) cvn /Title (A.3. OpenPGP Signatures on Configuration/Database Files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (14.77.1) cvn /Title (A.4. Client/Server Connectivity)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (14.78.1) cvn /Title (A.5. Paths) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -3 /Dest (15.0) cvn /Title (Appendix B. List of command line options)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (15.79.1) cvn /Title (B.1. General) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (15.80.1) cvn /Title (B.2. samhain) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (15.81.1) cvn /Title (B.3. yule) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -13 /Dest (16.0) cvn /Title (Appendix C. List of configuration file options)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -1 /Dest (16.82.1) cvn /Title (C.1. General) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.82.52.2) cvn /Title (C.1.1. Conditionals)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.83.1) cvn /Title (C.2. Files to check)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.84.1) cvn /Title (C.3. Severity of events)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.85.1) cvn /Title (C.4. Logging thresholds)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.86.1) cvn /Title (C.5. Watching login/logout events)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.87.1) cvn /Title (C.6. Checking for kernel module rootkits)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.88.1) cvn /Title (C.7. Checking for SUID/SGID files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.89.1) cvn /Title (C.8. Checking for mount options)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.90.1) cvn /Title (C.9. Checking for user files)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.91.1) cvn /Title (C.10. Database)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.92.1) cvn /Title (C.11. Miscellaneous)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.93.1) cvn /Title (C.12. External)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (16.94.1) cvn /Title (C.13. Clients)
+/OUT pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -3 /Dest (17.0) cvn /Title (Appendix D. List of database fields)
+/OUT pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Count -0 /Dest (17.95.1) cvn /Title (D.1. General) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (17.96.1) cvn /Title (D.2. Modules) /OUT
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ /Count -0 /Dest (17.97.1) cvn /Title (D.3. Syslog) /OUT
+pdfmark end
+ -2
+226 a -2 226 a
+SDict begin [ /Page 1 /View [ /Fit ] /PageMode /UseOutlines  /DOCVIEW
+pdfmark end
+ -2 226 a -2 226 a
+SDict begin [ {Catalog} << /ViewerPreferences << >> >> /PUT pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+ -2
+226 a -2 226 a
+SDict begin 12 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (Doc-Start) cvn H.B /DEST pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+ -2
+226 a -2 226 a
+SDict begin 12 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INDEX) cvn H.B /DEST pdfmark
+end
+ -2 226 a 1441 376 a
+FE(Samhain)2302 376 y
+SDict begin H.S end
+ 2302 376 a 2302 376 a
+SDict begin 32.348 H.A end
+ 2302 376
+a 2302 376 a
+SDict begin [ /View [/XYZ H.V] /Dest (1.0) cvn H.B /DEST pdfmark end
+ 2302 376 a Black Black eop end
+%%Page: 2 2
+TeXDict begin 2 1 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.2) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black 175 x
+FD(Samhain)-2 417 y FC(Cop)o(yright)18 b(\251)j(2002-2005)c(Rainer)j(W)
+m(ichmann)-2 608 y FB(Permission)e(is)e(granted)j(to)f(cop)o(y)l(,)f
+(distrib)o(ute)i(and/or)f(modify)g(this)f(document)i(under)f(the)g
+(terms)f(of)g(the)g FA(GNU)g(F)l(r)n(ee)g(Documentation)j(License)p
+FB(,)e(V)-7 b(ersion)18 b(1.1)-2 716 y(or)f(an)o(y)g(later)i(v)o
+(ersion)f(published)h(by)e(the)h(Free)f(Softw)o(are)i(F)o(oundation)g
+(with)f(no)f(In)m(v)n(ariant)j(Sections,)e(no)f(Front-Co)o(v)o(er)i(T)
+-5 b(e)o(xts,)17 b(and)h(no)f(Back-Co)o(v)o(er)i(T)-5
+b(e)o(xts.)-2 823 y(Y)e(ou)16 b(may)h(obtain)i(a)e(cop)o(y)h(of)f(the)h
+FA(GNU)f(F)l(r)n(ee)g(Documentation)j(License)e FB(from)f(the)h(Free)f
+(Softw)o(are)i(F)o(oundation)g(by)e(visiting)i(their)g(W)-5
+b(eb)16 b(site)-2 931 y(\(http://www)l(.fsf.or)o(g\))i(or)f(by)g
+(writing)i(to:)f(Free)f(Softw)o(are)i(F)o(oundation,)g(Inc.,)d(59)h(T)
+-5 b(emple)18 b(Place)h(-)e(Suite)h(330,)e(Boston,)i(MA)f(02111-1307,)h
+(USA.)p Black Black eop end
+%%Page: 3 3
+TeXDict begin 3 2 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.3) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black 217 x
+Fz(T)-14 b(ab)n(le)48 b(of)g(Contents)1435 351 y
+SDict begin H.S end
+ 1435
+351 a 1435 351 a
+SDict begin 26.957 H.A end
+ 1435 351 a 1435 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (2.0) cvn H.B /DEST pdfmark end
+ 1435 351 a 0 TeXcolorgray
+396 494 a
+SDict begin H.S end
+ 396 494 a Fy(1.)20 b(Intr)o(oduction)931 494
+y
+SDict begin 13 H.L end
+ 931 494 a 931 494 a
+SDict begin [ /Subtype /Link /Dest (0:INTRO) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 931 494 a Black Black 1 w Fy(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black 0 TeXcolorgray 3703 494 a
+SDict begin H.S end
+
+3703 494 a Fy(1)3745 494 y
+SDict begin 13 H.L end
+ 3745 494 a 3745 494 a
+SDict begin [ /Subtype /Link /Dest (0:INTRO) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+494 a Black 0 TeXcolorgray 396 621 a
+SDict begin H.S end
+ 396 621 a Fy(2.)g(Compiling)h(and)
+f(installing)1356 621 y
+SDict begin 13 H.L end
+ 1356 621 a 1356 621 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1356 621
+a Black Black 12 w Fy(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black 0 TeXcolorgray 3703 621 a
+SDict begin H.S end
+ 3703 621 a Fy(2)3745
+621 y
+SDict begin 13 H.L end
+ 3745 621 a 3745 621 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 621 a Black 0 TeXcolorgray
+596 749 a
+SDict begin H.S end
+ 596 749 a FC(2.1.)f(Ov)o(ervie)n(w)1067 749
+y
+SDict begin 13 H.L end
+ 1067 749 a 1067 749 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-OVERVIEW) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1067 749 a Black Black 10 w FC(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black 0 TeXcolorgray 3703 749 a
+SDict begin H.S end
+ 3703 749 a FC(2)3745
+749 y
+SDict begin 13 H.L end
+ 3745 749 a 3745 749 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-OVERVIEW) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 749 a Black 0 TeXcolorgray
+596 857 a
+SDict begin H.S end
+ 596 857 a FC(2.2.)g(Requirements)1204 857 y
+SDict begin 13 H.L end
+
+1204 857 a 1204 857 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-REQUIREMENTS) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1204 857 a Black Black 18 w FC(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3703 857 a
+SDict begin H.S end
+ 3703 857 a FC(3)3745 857 y
+SDict begin 13 H.L end
+
+3745 857 a 3745 857 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-REQUIREMENTS) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 857 a Black 0 TeXcolorgray
+596 965 a
+SDict begin H.S end
+ 596 965 a FC(2.3.)g(Do)n(wnload)f(and)i(e)o(xtract)1472
+965 y
+SDict begin 13 H.L end
+ 1472 965 a 1472 965 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-DOWNLOAD) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1472 965 a Black Black -1
+w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black 0 TeXcolorgray 3703 965 a
+SDict begin H.S end
+ 3703 965 a FC(3)3745
+965 y
+SDict begin 13 H.L end
+ 3745 965 a 3745 965 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-DOWNLOAD) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 965 a Black 0 TeXcolorgray
+596 1073 a
+SDict begin H.S end
+ 596 1073 a FC(2.4.)f(Con\002guring)f(the)i(source)1503
+1073 y
+SDict begin 13 H.L end
+ 1503 1073 a 1503 1073 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-CONFIGURE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1503 1073 a Black Black
+10 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3703
+1073 a
+SDict begin H.S end
+ 3703 1073 a FC(4)3745 1073 y
+SDict begin 13 H.L end
+ 3745 1073 a 3745
+1073 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-CONFIGURE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1073 a Black 0 TeXcolorgray 596 1181 a
+SDict begin H.S end
+ 596
+1181 a FC(2.5.)f(Build)926 1181 y
+SDict begin 13 H.L end
+ 926 1181 a 926 1181
+a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-BUILD) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 926 1181 a Black Black 6 w FC(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3703 1181 a
+SDict begin H.S end
+ 3703 1181 a FC(6)3745
+1181 y
+SDict begin 13 H.L end
+ 3745 1181 a 3745 1181 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-BUILD) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1181 a Black 0 TeXcolorgray
+596 1289 a
+SDict begin H.S end
+ 596 1289 a FC(2.6.)g(Install)949 1289 y
+SDict begin 13 H.L end
+ 949
+1289 a 949 1289 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-INSTALL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 949 1289 a Black Black 4 w FC(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3703 1289 a
+SDict begin H.S end
+ 3703 1289 a FC(6)3745
+1289 y
+SDict begin 13 H.L end
+ 3745 1289 a 3745 1289 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-INSTALL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1289 a Black 0 TeXcolorgray
+596 1397 a
+SDict begin H.S end
+ 596 1397 a FC(2.7.)g(Customize)1097 1397 y
+SDict begin 13 H.L end
+
+1097 1397 a 1097 1397 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-CUSTOMIZE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1097 1397 a Black Black 1 w FC(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3703 1397 a
+SDict begin H.S end
+ 3703 1397 a FC(8)3745 1397
+y
+SDict begin 13 H.L end
+ 3745 1397 a 3745 1397 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-CUSTOMIZE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1397 a Black 0 TeXcolorgray
+596 1505 a
+SDict begin H.S end
+ 596 1505 a FC(2.8.)g(Initialize)h(the)g(baseline)g(database)
+1759 1505 y
+SDict begin 13 H.L end
+ 1759 1505 a 1759 1505 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-INITIALIZE) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1759 1505 a Black
+Black 3 w FC(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3703 1505 a
+SDict begin H.S end
+ 3703 1505 a FC(8)3745 1505
+y
+SDict begin 13 H.L end
+ 3745 1505 a 3745 1505 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-INITIALIZE) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1505 a Black 0 TeXcolorgray
+596 1613 a
+SDict begin H.S end
+ 596 1613 a FC(2.9.)f(Run)h(samhain)1178 1613
+y
+SDict begin 13 H.L end
+ 1178 1613 a 1178 1613 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-RUNNING) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1178 1613 a Black Black 3 w
+FC(.)p Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3703
+1613 a
+SDict begin H.S end
+ 3703 1613 a FC(9)3745 1613 y
+SDict begin 13 H.L end
+ 3745 1613 a 3745
+1613 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-RUNNING) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1613 a Black 0 TeXcolorgray 596 1721 a
+SDict begin H.S end
+ 596
+1721 a FC(2.10.)e(Files)k(and)d(directory)g(layout)1635
+1721 y
+SDict begin 13 H.L end
+ 1635 1721 a 1635 1721 a
+SDict begin [ /Subtype /Link /Dest (0:LAYOUT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1635 1721 a Black Black
+2 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3703
+1721 a
+SDict begin H.S end
+ 3703 1721 a FC(9)3745 1721 y
+SDict begin 13 H.L end
+ 3745 1721 a 3745
+1721 a
+SDict begin [ /Subtype /Link /Dest (0:LAYOUT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1721 a Black 0 TeXcolorgray 396 1849 a
+SDict begin H.S end
+ 396
+1849 a Fy(3.)h(General)g(usage)g(notes)1190 1849 y
+SDict begin 13 H.L end
+ 1190
+1849 a 1190 1849 a
+SDict begin [ /Subtype /Link /Dest (0:USAGE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1190 1849 a Black Black 12 w Fy(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1849 a
+SDict begin H.S end
+ 3661 1849 a Fy(13)3745 1849 y
+SDict begin 13 H.L end
+ 3745 1849 a
+3745 1849 a
+SDict begin [ /Subtype /Link /Dest (0:USAGE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1849 a Black 0 TeXcolorgray 596 1976
+a
+SDict begin H.S end
+ 596 1976 a FC(3.1.)f(Ho)n(w)h(to)g(in)m(v)n(ok)o(e)1228
+1976 y
+SDict begin 13 H.L end
+ 1228 1976 a 1228 1976 a
+SDict begin [ /Subtype /Link /Dest (0:HOW-TO-INVOKE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1228 1976 a Black Black
+15 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 1976 a
+SDict begin H.S end
+ 3661 1976 a FC(13)3745
+1976 y
+SDict begin 13 H.L end
+ 3745 1976 a 3745 1976 a
+SDict begin [ /Subtype /Link /Dest (0:HOW-TO-INVOKE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1976 a Black 0 TeXcolorgray
+596 2084 a
+SDict begin H.S end
+ 596 2084 a FC(3.2.)f(Using)h(daemontool)e(\(or)h(similar)i
+(utilities\))2019 2084 y
+SDict begin 13 H.L end
+ 2019 2084 a 2019 2084 a
+SDict begin [ /Subtype /Link /Dest (0:DAEMONTOOL) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2019
+2084 a Black Black 13 w FC(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 2084 a
+SDict begin H.S end
+ 3661
+2084 a FC(13)3745 2084 y
+SDict begin 13 H.L end
+ 3745 2084 a 3745 2084 a
+SDict begin [ /Subtype /Link /Dest (0:DAEMONTOOL) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+2084 a Black 0 TeXcolorgray 596 2192 a
+SDict begin H.S end
+ 596 2192 a FC(3.3.)e
+(Controlling)f(the)j(daemon)1532 2192 y
+SDict begin 13 H.L end
+ 1532 2192 a 1532
+2192 a
+SDict begin [ /Subtype /Link /Dest (0:CONTROLLING-THE-DAEMON) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1532 2192 a Black Black 2 w FC(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 2192 a
+SDict begin H.S end
+ 3661 2192
+a FC(13)3745 2192 y
+SDict begin 13 H.L end
+ 3745 2192 a 3745 2192 a
+SDict begin [ /Subtype /Link /Dest (0:CONTROLLING-THE-DAEMON) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2192
+a Black 0 TeXcolorgray 596 2300 a
+SDict begin H.S end
+ 596 2300 a FC(3.4.)e(Signals)986
+2300 y
+SDict begin 13 H.L end
+ 986 2300 a 986 2300 a
+SDict begin [ /Subtype /Link /Dest (0:SIGNALS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 986 2300 a Black Black 8
+w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 2300 a
+SDict begin H.S end
+ 3661 2300 a FC(14)3745 2300
+y
+SDict begin 13 H.L end
+ 3745 2300 a 3745 2300 a
+SDict begin [ /Subtype /Link /Dest (0:SIGNALS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2300 a Black 0 TeXcolorgray
+596 2408 a
+SDict begin H.S end
+ 596 2408 a FC(3.5.)g(PID)h(\002le)1001 2408
+y
+SDict begin 13 H.L end
+ 1001 2408 a 1001 2408 a
+SDict begin [ /Subtype /Link /Dest (0:PID-FILE) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1001 2408 a Black Black 14
+w FC(.)p Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 2408
+a
+SDict begin H.S end
+ 3661 2408 a FC(15)3745 2408 y
+SDict begin 13 H.L end
+ 3745 2408 a 3745 2408
+a
+SDict begin [ /Subtype /Link /Dest (0:PID-FILE) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2408 a Black 0 TeXcolorgray 596 2516 a
+SDict begin H.S end
+ 596 2516
+a FC(3.6.)f(Log)g(\002le)i(rotation)1282 2516 y
+SDict begin 13 H.L end
+ 1282
+2516 a 1282 2516 a
+SDict begin [ /Subtype /Link /Dest (0:LOG-FILE-ROTATION) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1282 2516 a Black Black 3 w FC(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 2516 a
+SDict begin H.S end
+ 3661
+2516 a FC(15)3745 2516 y
+SDict begin 13 H.L end
+ 3745 2516 a 3745 2516 a
+SDict begin [ /Subtype /Link /Dest (0:LOG-FILE-ROTATION) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+2516 a Black 0 TeXcolorgray 596 2624 a
+SDict begin H.S end
+ 596 2624 a FC(3.7.)e(Updating)g
+(the)h(\002le)h(signature)e(database)1932 2624 y
+SDict begin 13 H.L end
+ 1932
+2624 a 1932 2624 a
+SDict begin [ /Subtype /Link /Dest (0:UPDATING-THE-FILE-SIGNATURE-DATABASE)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1932 2624 a Black Black 17 w FC(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 2624 a
+SDict begin H.S end
+ 3661 2624 a FC(16)3745
+2624 y
+SDict begin 13 H.L end
+ 3745 2624 a 3745 2624 a
+SDict begin [ /Subtype /Link /Dest (0:UPDATING-THE-FILE-SIGNATURE-DATABASE)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2624 a Black 0 TeXcolorgray
+596 2732 a
+SDict begin H.S end
+ 596 2732 a FC(3.8.)g(Impro)o(ving)e(the)j(signal-to-noise)e
+(ratio)1900 2732 y
+SDict begin 13 H.L end
+ 1900 2732 a 1900 2732 a
+SDict begin [ /Subtype /Link /Dest (0:IMPROVING-THE-SIGNAL-TO-NOISE-RATIO)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1900 2732
+a Black Black 7 w FC(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 2732 a
+SDict begin H.S end
+ 3661 2732 a FC(17)3745
+2732 y
+SDict begin 13 H.L end
+ 3745 2732 a 3745 2732 a
+SDict begin [ /Subtype /Link /Dest (0:IMPROVING-THE-SIGNAL-TO-NOISE-RATIO)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2732 a Black 0 TeXcolorgray
+596 2840 a
+SDict begin H.S end
+ 596 2840 a FC(3.9.)h(Runtime)h(options:)f(command-line)e(&)k
+(con\002guration)c(\002le)2491 2840 y
+SDict begin 13 H.L end
+ 2491 2840 a 2491
+2840 a
+SDict begin [ /Subtype /Link /Dest (0:OPTIONS-CONFIGURATION-FILE) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2491 2840 a Black Black 18 w FC(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 2840 a
+SDict begin H.S end
+ 3661 2840 a FC(17)3745
+2840 y
+SDict begin 13 H.L end
+ 3745 2840 a 3745 2840 a
+SDict begin [ /Subtype /Link /Dest (0:OPTIONS-CONFIGURATION-FILE) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2840 a Black 0 TeXcolorgray
+596 2948 a
+SDict begin H.S end
+ 596 2948 a FC(3.10.)h(Support)h(/)i(Bugs)f(/)h(Problems)1660
+2948 y
+SDict begin 13 H.L end
+ 1660 2948 a 1660 2948 a
+SDict begin [ /Subtype /Link /Dest (0:SUPPORT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1660 2948 a Black Black
+19 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 2948 a
+SDict begin H.S end
+ 3661
+2948 a FC(17)3745 2948 y
+SDict begin 13 H.L end
+ 3745 2948 a 3745 2948 a
+SDict begin [ /Subtype /Link /Dest (0:SUPPORT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+2948 a Black 0 TeXcolorgray 396 3076 a
+SDict begin H.S end
+ 396 3076 a Fy(4.)f
+(Con\002guration)f(of)h(logging)f(facilities)1663 3076
+y
+SDict begin 13 H.L end
+ 1663 3076 a 1663 3076 a
+SDict begin [ /Subtype /Link /Dest (0:BASIC-CONFIGURATION) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1663 3076 a Black Black 16
+w Fy(.)p Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 3076 a
+SDict begin H.S end
+ 3661 3076
+a Fy(19)3745 3076 y
+SDict begin 13 H.L end
+ 3745 3076 a 3745 3076 a
+SDict begin [ /Subtype /Link /Dest (0:BASIC-CONFIGURATION) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3076
+a Black 0 TeXcolorgray 596 3203 a
+SDict begin H.S end
+ 596 3203 a FC(4.1.)g(Se)n(v)o(erity)g
+(le)n(v)o(els)h(and)g(classes)h(of)f(log)g(messages)2169
+3203 y
+SDict begin 13 H.L end
+ 2169 3203 a 2169 3203 a
+SDict begin [ /Subtype /Link /Dest (0:LOGDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2169 3203 a Black Black
+8 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 3203 a
+SDict begin H.S end
+ 3661 3203 a FC(19)3745 3203 y
+SDict begin 13 H.L end
+ 3745 3203 a
+3745 3203 a
+SDict begin [ /Subtype /Link /Dest (0:LOGDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3203 a Black 0 TeXcolorgray 596 3311
+a
+SDict begin H.S end
+ 596 3311 a FC(4.2.)f(Ov)o(ervie)n(w)g(of)h(logging)e(f)o(acilities)
+1735 3311 y
+SDict begin 13 H.L end
+ 1735 3311 a 1735 3311 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFACILITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1735 3311 a Black
+Black 6 w FC(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 3311
+a
+SDict begin H.S end
+ 3661 3311 a FC(21)3745 3311 y
+SDict begin 13 H.L end
+ 3745 3311 a 3745 3311
+a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFACILITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3311 a Black 0 TeXcolorgray 596 3419 a
+SDict begin H.S end
+ 596 3419
+a FC(4.3.)h(Acti)n(v)n(ating)g(logging)f(f)o(acilities)j(and)f
+(\002ltering)g(messages)2427 3419 y
+SDict begin 13 H.L end
+ 2427 3419 a 2427
+3419 a
+SDict begin [ /Subtype /Link /Dest (0:THRESHOLDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2427 3419 a Black Black -1 w FC(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 3419 a
+SDict begin H.S end
+ 3661
+3419 a FC(22)3745 3419 y
+SDict begin 13 H.L end
+ 3745 3419 a 3745 3419 a
+SDict begin [ /Subtype /Link /Dest (0:THRESHOLDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+3419 a Black 0 TeXcolorgray 596 3527 a
+SDict begin H.S end
+ 596 3527 a FC(4.4.)f(E-mail)968
+3527 y
+SDict begin 13 H.L end
+ 968 3527 a 968 3527 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-EMAIL) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 968 3527 a Black Black 5
+w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 3527 a
+SDict begin H.S end
+ 3661 3527
+a FC(24)3745 3527 y
+SDict begin 13 H.L end
+ 3745 3527 a 3745 3527 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-EMAIL) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3527
+a Black 0 TeXcolorgray 596 3635 a
+SDict begin H.S end
+ 596 3635 a FC(4.5.)g(Log)g(\002le)
+1001 3635 y
+SDict begin 13 H.L end
+ 1001 3635 a 1001 3635 a
+SDict begin [ /Subtype /Link /Dest (0:TRUSTEDEXAMPLE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1001 3635 a Black
+Black 14 w FC(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 3635 a
+SDict begin H.S end
+ 3661 3635 a FC(28)3745 3635 y
+SDict begin 13 H.L end
+ 3745 3635 a
+3745 3635 a
+SDict begin [ /Subtype /Link /Dest (0:TRUSTEDEXAMPLE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3635 a Black 0 TeXcolorgray 596 3743
+a
+SDict begin H.S end
+ 596 3743 a FC(4.6.)g(Log)g(serv)o(er)1098 3743 y
+SDict begin 13 H.L end
+ 1098
+3743 a 1098 3743 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-LOGSERVER) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1098 3743 a Black Black FC(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 3743 a
+SDict begin H.S end
+ 3661 3743 a FC(30)3745
+3743 y
+SDict begin 13 H.L end
+ 3745 3743 a 3745 3743 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-LOGSERVER) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3743 a Black 0 TeXcolorgray
+596 3851 a
+SDict begin H.S end
+ 596 3851 a FC(4.7.)g(External)g(f)o(acilities)1328
+3851 y
+SDict begin 13 H.L end
+ 1328 3851 a 1328 3851 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-EXTERNAL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1328 3851 a Black Black
+19 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 3851
+a
+SDict begin H.S end
+ 3661 3851 a FC(31)3745 3851 y
+SDict begin 13 H.L end
+ 3745 3851 a 3745 3851
+a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGURATION-EXTERNAL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3851 a Black 0 TeXcolorgray 596 3959 a
+SDict begin H.S end
+ 596 3959
+a FC(4.8.)g(Console)1014 3959 y
+SDict begin 13 H.L end
+ 1014 3959 a 1014 3959
+a
+SDict begin [ /Subtype /Link /Dest (0:CONSOLEDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1014 3959 a Black Black 1 w FC(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 3959 a
+SDict begin H.S end
+ 3661 3959
+a FC(31)3745 3959 y
+SDict begin 13 H.L end
+ 3745 3959 a 3745 3959 a
+SDict begin [ /Subtype /Link /Dest (0:CONSOLEDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3959
+a Black 0 TeXcolorgray 596 4067 a
+SDict begin H.S end
+ 596 4067 a FC(4.9.)g(Prelude)996
+4067 y
+SDict begin 13 H.L end
+ 996 4067 a 996 4067 a
+SDict begin [ /Subtype /Link /Dest (0:PRELUDEDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 996 4067 a Black Black 19
+w FC(.)p Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 4067
+a
+SDict begin H.S end
+ 3661 4067 a FC(31)3745 4067 y
+SDict begin 13 H.L end
+ 3745 4067 a 3745 4067
+a
+SDict begin [ /Subtype /Link /Dest (0:PRELUDEDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4067 a Black 0 TeXcolorgray 596 4175 a
+SDict begin H.S end
+ 596 4175
+a FC(4.10.)f(Using)i(samhain)g(with)g(nagios)1685 4175
+y
+SDict begin 13 H.L end
+ 1685 4175 a 1685 4175 a
+SDict begin [ /Subtype /Link /Dest (0:NAGIOS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1685 4175 a Black Black 15
+w FC(.)p Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 4175 a
+SDict begin H.S end
+ 3661 4175 a FC(35)3745 4175
+y
+SDict begin 13 H.L end
+ 3745 4175 a 3745 4175 a
+SDict begin [ /Subtype /Link /Dest (0:NAGIOS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4175 a Black 0 TeXcolorgray
+596 4283 a
+SDict begin H.S end
+ 596 4283 a FC(4.11.)e(Syslog)1009 4283 y
+SDict begin 13 H.L end
+ 1009
+4283 a 1009 4283 a
+SDict begin [ /Subtype /Link /Dest (0:SYSLOGDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1009 4283 a Black Black 6 w FC(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 4283
+a
+SDict begin H.S end
+ 3661 4283 a FC(36)3745 4283 y
+SDict begin 13 H.L end
+ 3745 4283 a 3745 4283
+a
+SDict begin [ /Subtype /Link /Dest (0:SYSLOGDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4283 a Black 0 TeXcolorgray 596 4391 a
+SDict begin H.S end
+ 596 4391
+a FC(4.12.)g(SQL)j(Database)1265 4391 y
+SDict begin 13 H.L end
+ 1265 4391 a 1265
+4391 a
+SDict begin [ /Subtype /Link /Dest (0:SQLDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1265 4391 a Black Black 20 w FC(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 4391 a
+SDict begin H.S end
+ 3661 4391 a FC(36)3745
+4391 y
+SDict begin 13 H.L end
+ 3745 4391 a 3745 4391 a
+SDict begin [ /Subtype /Link /Dest (0:SQLDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4391 a Black 0 TeXcolorgray
+396 4519 a
+SDict begin H.S end
+ 396 4519 a Fy(5.)f(Con\002guration)f(\227)i(samhain,)f(the)h
+(\002le)g(monitor)1989 4519 y
+SDict begin 13 H.L end
+ 1989 4519 a 1989 4519 a
+SDict begin [ /Subtype /Link /Dest (0:FILE-MONITOR) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+1989 4519 a Black Black 1 w Fy(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 4519 a
+SDict begin H.S end
+ 3661 4519 a Fy(39)3745 4519
+y
+SDict begin 13 H.L end
+ 3745 4519 a 3745 4519 a
+SDict begin [ /Subtype /Link /Dest (0:FILE-MONITOR) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4519 a Black 0 TeXcolorgray
+596 4646 a
+SDict begin H.S end
+ 596 4646 a FC(5.1.)e(Usage)h(o)o(v)o(ervie)n(w)1276
+4646 y
+SDict begin 13 H.L end
+ 1276 4646 a 1276 4646 a
+SDict begin [ /Subtype /Link /Dest (0:BASCLT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1276 4646 a Black Black
+9 w FC(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 4646
+a
+SDict begin H.S end
+ 3661 4646 a FC(39)3745 4646 y
+SDict begin 13 H.L end
+ 3745 4646 a 3745 4646
+a
+SDict begin [ /Subtype /Link /Dest (0:BASCLT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4646 a Black 0 TeXcolorgray 596 4754 a
+SDict begin H.S end
+ 596 4754
+a FC(5.2.)f(A)-6 b(v)n(ailable)19 b(checksum)g(functions)1740
+4754 y
+SDict begin 13 H.L end
+ 1740 4754 a 1740 4754 a
+SDict begin [ /Subtype /Link /Dest (0:HASH-FUNCTION) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1740 4754 a Black Black
+1 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 4754 a
+SDict begin H.S end
+ 3661
+4754 a FC(40)3745 4754 y
+SDict begin 13 H.L end
+ 3745 4754 a 3745 4754 a
+SDict begin [ /Subtype /Link /Dest (0:HASH-FUNCTION) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+4754 a Black 0 TeXcolorgray 596 4862 a
+SDict begin H.S end
+ 596 4862 a FC(5.3.)g(File)i
+(signatures)1229 4862 y
+SDict begin 13 H.L end
+ 1229 4862 a 1229 4862 a
+SDict begin [ /Subtype /Link /Dest (0:FILE-SIGNATURES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1229
+4862 a Black Black 14 w FC(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 4862
+a
+SDict begin H.S end
+ 3661 4862 a FC(40)3745 4862 y
+SDict begin 13 H.L end
+ 3745 4862 a 3745 4862
+a
+SDict begin [ /Subtype /Link /Dest (0:FILE-SIGNATURES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4862 a Black 0 TeXcolorgray 596 4970 a
+SDict begin H.S end
+ 596 4970
+a FC(5.4.)e(De\002ning)g(which)h(\002les/directories)f(to)i(monitor)
+2159 4970 y
+SDict begin 13 H.L end
+ 2159 4970 a 2159 4970 a
+SDict begin [ /Subtype /Link /Dest (0:FILEDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2159 4970 a Black
+Black 18 w FC(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 4970 a
+SDict begin H.S end
+ 3661 4970 a FC(41)3745 4970 y
+SDict begin 13 H.L end
+ 3745 4970 a
+3745 4970 a
+SDict begin [ /Subtype /Link /Dest (0:FILEDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 4970 a Black 0 TeXcolorgray 596 5078
+a
+SDict begin H.S end
+ 596 5078 a FC(5.5.)e(Excluding)f(\002les)j(and/or)e(subdirectories)f
+(\(All)j(e)o(xcept)e(.)12 b(.)g(.)g(\))2499 5078 y
+SDict begin 13 H.L end
+ 2499
+5078 a 2499 5078 a
+SDict begin [ /Subtype /Link /Dest (0:ALL-EXCEPT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2499 5078 a Black Black 10 w FC(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 5078 a
+SDict begin H.S end
+ 3661
+5078 a FC(48)3745 5078 y
+SDict begin 13 H.L end
+ 3745 5078 a 3745 5078 a
+SDict begin [ /Subtype /Link /Dest (0:ALL-EXCEPT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+5078 a Black 0 TeXcolorgray 596 5186 a
+SDict begin H.S end
+ 596 5186 a FC(5.6.)19
+b(T)m(iming)g(\002le)i(checks)1357 5186 y
+SDict begin 13 H.L end
+ 1357 5186 a
+1357 5186 a
+SDict begin [ /Subtype /Link /Dest (0:TIMING-FILE-CHECKS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1357 5186 a Black Black 11 w FC(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 5186 a
+SDict begin H.S end
+ 3661 5186 a FC(49)3745 5186
+y
+SDict begin 13 H.L end
+ 3745 5186 a 3745 5186 a
+SDict begin [ /Subtype /Link /Dest (0:TIMING-FILE-CHECKS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 5186 a Black 0 TeXcolorgray
+596 5294 a
+SDict begin H.S end
+ 596 5294 a FC(5.7.)e(Initializing,)g(updating,)f(or)i
+(checking)1871 5294 y
+SDict begin 13 H.L end
+ 1871 5294 a 1871 5294 a
+SDict begin [ /Subtype /Link /Dest (0:INITIALIZING-UPDATING-CHECKING)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1871 5294
+a Black Black 16 w FC(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 5294
+a
+SDict begin H.S end
+ 3661 5294 a FC(50)3745 5294 y
+SDict begin 13 H.L end
+ 3745 5294 a 3745 5294
+a
+SDict begin [ /Subtype /Link /Dest (0:INITIALIZING-UPDATING-CHECKING)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 5294 a Black 0 TeXcolorgray 596 5402 a
+SDict begin H.S end
+ 596 5402
+a FC(5.8.)f(The)h(\002le)h(signature)e(database)1630
+5402 y
+SDict begin 13 H.L end
+ 1630 5402 a 1630 5402 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASEFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1630 5402 a Black Black
+7 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 5402 a
+SDict begin H.S end
+ 3661 5402 a FC(50)3745 5402
+y
+SDict begin 13 H.L end
+ 3745 5402 a 3745 5402 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASEFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 5402 a Black Black 3675
+5805 a Fx(iii)p Black eop end
+%%Page: 4 4
+TeXDict begin 4 3 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.4) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black 0 TeXcolorgray
+596 309 a
+SDict begin H.S end
+ 596 309 a FC(5.9.)19 b(Checking)g(the)h(\002le)h(system)f
+(for)g(SUID/SGID)g(binaries)2393 309 y
+SDict begin 13 H.L end
+ 2393 309 a 2393
+309 a
+SDict begin [ /Subtype /Link /Dest (0:SUIDCHK) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2393 309 a Black Black 12 w FC(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 309 a
+SDict begin H.S end
+ 3661 309 a FC(51)3745 309 y
+SDict begin 13 H.L end
+ 3745 309 a 3745
+309 a
+SDict begin [ /Subtype /Link /Dest (0:SUIDCHK) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 309 a Black 0 TeXcolorgray 596 417 a
+SDict begin H.S end
+ 596 417
+a FC(5.10.)e(Detecting)i(K)n(ernel)f(rootkits)1625 417
+y
+SDict begin 13 H.L end
+ 1625 417 a 1625 417 a
+SDict begin [ /Subtype /Link /Dest (0:KERNELDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1625 417 a Black Black 12 w FC(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 417 a
+SDict begin H.S end
+ 3661 417 a FC(53)3745 417 y
+SDict begin 13 H.L end
+ 3745 417 a 3745
+417 a
+SDict begin [ /Subtype /Link /Dest (0:KERNELDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 417 a Black 0 TeXcolorgray 596 525 a
+SDict begin H.S end
+ 596 525
+a FC(5.11.)f(Monitoring)g(login/logout)g(e)n(v)o(ents)1818
+525 y
+SDict begin 13 H.L end
+ 1818 525 a 1818 525 a
+SDict begin [ /Subtype /Link /Dest (0:MONDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1818 525 a Black Black 6
+w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 525 a
+SDict begin H.S end
+ 3661 525 a FC(57)3745
+525 y
+SDict begin 13 H.L end
+ 3745 525 a 3745 525 a
+SDict begin [ /Subtype /Link /Dest (0:MONDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 525 a Black 0 TeXcolorgray
+596 632 a
+SDict begin H.S end
+ 596 632 a FC(5.12.)g(Checking)h(mounted)g(\002lesystem)h
+(policies)2049 632 y
+SDict begin 13 H.L end
+ 2049 632 a 2049 632 a
+SDict begin [ /Subtype /Link /Dest (0:MOUNTCHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2049 632 a
+Black Black 4 w FC(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 632 a
+SDict begin H.S end
+ 3661 632 a FC(58)3745 632 y
+SDict begin 13 H.L end
+ 3745 632 a 3745
+632 a
+SDict begin [ /Subtype /Link /Dest (0:MOUNTCHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 632 a Black 0 TeXcolorgray 596 740 a
+SDict begin H.S end
+ 596 740
+a FC(5.13.)e(Checking)h(sensiti)n(v)o(e)h(\002les)h(o)n(wned)e(by)h
+(users)2103 740 y
+SDict begin 13 H.L end
+ 2103 740 a 2103 740 a
+SDict begin [ /Subtype /Link /Dest (0:USERCHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2103 740 a Black
+Black 12 w FC(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 740 a
+SDict begin H.S end
+ 3661 740 a FC(58)3745 740 y
+SDict begin 13 H.L end
+ 3745 740 a 3745
+740 a
+SDict begin [ /Subtype /Link /Dest (0:USERCHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 740 a Black 0 TeXcolorgray 596 848 a
+SDict begin H.S end
+ 596 848
+a FC(5.14.)e(Modules)1074 848 y
+SDict begin 13 H.L end
+ 1074 848 a 1074 848 a
+SDict begin [ /Subtype /Link /Dest (0:MODULES) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+1074 848 a Black Black 3 w FC(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 848 a
+SDict begin H.S end
+ 3661 848 a FC(59)3745
+848 y
+SDict begin 13 H.L end
+ 3745 848 a 3745 848 a
+SDict begin [ /Subtype /Link /Dest (0:MODULES) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 848 a Black 0 TeXcolorgray
+596 956 a
+SDict begin H.S end
+ 596 956 a FC(5.15.)g(Performance)g(tuning)1441
+956 y
+SDict begin 13 H.L end
+ 1441 956 a 1441 956 a
+SDict begin [ /Subtype /Link /Dest (0:PERFORMANCE-TUNING) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1441 956 a Black Black 10
+w FC(.)p Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 956 a
+SDict begin H.S end
+ 3661 956 a FC(59)3745 956 y
+SDict begin 13 H.L end
+ 3745 956 a 3745
+956 a
+SDict begin [ /Subtype /Link /Dest (0:PERFORMANCE-TUNING) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 956 a Black 0 TeXcolorgray 396 1084 a
+SDict begin H.S end
+ 396
+1084 a Fy(6.)i(yule,)g(the)h(log)f(ser)o(v)o(er)1147
+1084 y
+SDict begin 13 H.L end
+ 1147 1084 a 1147 1084 a
+SDict begin [ /Subtype /Link /Dest (0:YULE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1147 1084 a Black Black
+13 w Fy(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 1084 a
+SDict begin H.S end
+ 3661
+1084 a Fy(62)3745 1084 y
+SDict begin 13 H.L end
+ 3745 1084 a 3745 1084 a
+SDict begin [ /Subtype /Link /Dest (0:YULE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+1084 a Black 0 TeXcolorgray 596 1212 a
+SDict begin H.S end
+ 596 1212 a FC(6.1.)f(General)
+1005 1212 y
+SDict begin 13 H.L end
+ 1005 1212 a 1005 1212 a
+SDict begin [ /Subtype /Link /Dest (0:GENERAL) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1005 1212 a Black
+Black 10 w FC(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1212 a
+SDict begin H.S end
+ 3661 1212 a FC(62)3745 1212 y
+SDict begin 13 H.L end
+ 3745 1212 a
+3745 1212 a
+SDict begin [ /Subtype /Link /Dest (0:GENERAL) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1212 a Black 0 TeXcolorgray 596 1320
+a
+SDict begin H.S end
+ 596 1320 a FC(6.2.)g(Important)f(installation)i(notes)1655
+1320 y
+SDict begin 13 H.L end
+ 1655 1320 a 1655 1320 a
+SDict begin [ /Subtype /Link /Dest (0:DROPROOT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1655 1320 a Black Black
+3 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1320 a
+SDict begin H.S end
+ 3661 1320 a FC(63)3745 1320 y
+SDict begin 13 H.L end
+ 3745 1320 a
+3745 1320 a
+SDict begin [ /Subtype /Link /Dest (0:DROPROOT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1320 a Black 0 TeXcolorgray 596 1428
+a
+SDict begin H.S end
+ 596 1428 a FC(6.3.)f(Re)o(gistering)g(a)i(client)1386
+1428 y
+SDict begin 13 H.L end
+ 1386 1428 a 1386 1428 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENTS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1386 1428 a Black Black
+2 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1428 a
+SDict begin H.S end
+ 3661 1428 a FC(64)3745 1428 y
+SDict begin 13 H.L end
+ 3745 1428 a
+3745 1428 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENTS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1428 a Black 0 TeXcolorgray 596 1536
+a
+SDict begin H.S end
+ 596 1536 a FC(6.4.)e(Enabling)f(logging)h(to)h(the)g(serv)o(er)1746
+1536 y
+SDict begin 13 H.L end
+ 1746 1536 a 1746 1536 a
+SDict begin [ /Subtype /Link /Dest (0:ENABLING-LOGGING-TO-THE-SERVER)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1746 1536 a Black Black
+16 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 1536 a
+SDict begin H.S end
+ 3661 1536 a FC(65)3745
+1536 y
+SDict begin 13 H.L end
+ 3745 1536 a 3745 1536 a
+SDict begin [ /Subtype /Link /Dest (0:ENABLING-LOGGING-TO-THE-SERVER)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1536 a Black 0 TeXcolorgray
+596 1644 a
+SDict begin H.S end
+ 596 1644 a FC(6.5.)f(Enabling)f(baseline)i(database)g(/)h
+(con\002guration)c(\002le)k(do)n(wnload)d(from)h(the)h(serv)o(er)3148
+1644 y
+SDict begin 13 H.L end
+ 3148 1644 a 3148 1644 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE-CONFIGURATION-FILE-DOWNLOAD)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3148 1644 a Black Black
+5 w FC(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1644 a
+SDict begin H.S end
+ 3661 1644 a FC(66)3745 1644 y
+SDict begin 13 H.L end
+ 3745 1644 a
+3745 1644 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE-CONFIGURATION-FILE-DOWNLOAD)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1644 a Black 0 TeXcolorgray 596 1752
+a
+SDict begin H.S end
+ 596 1752 a FC(6.6.)f(Rules)i(for)e(logging)g(of)h(client)g(messages)
+1952 1752 y
+SDict begin 13 H.L end
+ 1952 1752 a 1952 1752 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-LOGGING) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1952 1752 a Black
+Black 18 w FC(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 1752 a
+SDict begin H.S end
+ 3661 1752 a FC(68)3745
+1752 y
+SDict begin 13 H.L end
+ 3745 1752 a 3745 1752 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-LOGGING) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1752 a Black 0 TeXcolorgray
+596 1860 a
+SDict begin H.S end
+ 596 1860 a FC(6.7.)f(Detecting)g(')l(dead')g(clients)1530
+1860 y
+SDict begin 13 H.L end
+ 1530 1860 a 1530 1860 a
+SDict begin [ /Subtype /Link /Dest (0:GCM) cvn /H /I /Border [0 0 0]
+/Color [1 0 0] H.B /ANN pdfmark end
+ 1530 1860 a Black Black
+4 w FC(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 1860 a
+SDict begin H.S end
+ 3661 1860 a FC(68)3745 1860 y
+SDict begin 13 H.L end
+ 3745 1860 a
+3745 1860 a
+SDict begin [ /Subtype /Link /Dest (0:GCM) cvn /H /I /Border [0 0 0]
+/Color [1 0 0] H.B /ANN pdfmark end
+ 3745 1860 a Black 0 TeXcolorgray 596 1967
+a
+SDict begin H.S end
+ 596 1967 a FC(6.8.)g(The)h(HTML)g(serv)o(er)f(status)i(page)1737
+1967 y
+SDict begin 13 H.L end
+ 1737 1967 a 1737 1967 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-STATUS-INFORMATION) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1737 1967 a Black Black
+4 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 1967 a
+SDict begin H.S end
+ 3661
+1967 a FC(69)3745 1967 y
+SDict begin 13 H.L end
+ 3745 1967 a 3745 1967 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-STATUS-INFORMATION) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+1967 a Black 0 TeXcolorgray 596 2075 a
+SDict begin H.S end
+ 596 2075 a FC(6.9.)e(Chroot)973
+2075 y
+SDict begin 13 H.L end
+ 973 2075 a 973 2075 a
+SDict begin [ /Subtype /Link /Dest (0:CHROOT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 973 2075 a Black Black FC(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black 0 TeXcolorgray 3661 2075 a
+SDict begin H.S end
+ 3661 2075 a FC(70)3745
+2075 y
+SDict begin 13 H.L end
+ 3745 2075 a 3745 2075 a
+SDict begin [ /Subtype /Link /Dest (0:CHROOT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2075 a Black 0 TeXcolorgray
+596 2183 a
+SDict begin H.S end
+ 596 2183 a FC(6.10.)f(Restrict)j(access)g(with)g(libwrap)e
+(\(tcp)h(wrappers\))2221 2183 y
+SDict begin 13 H.L end
+ 2221 2183 a 2221 2183
+a
+SDict begin [ /Subtype /Link /Dest (0:LIBWRAP) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2221 2183 a Black Black 18 w FC(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 2183 a
+SDict begin H.S end
+ 3661 2183
+a FC(72)3745 2183 y
+SDict begin 13 H.L end
+ 3745 2183 a 3745 2183 a
+SDict begin [ /Subtype /Link /Dest (0:LIBWRAP) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2183
+a Black 0 TeXcolorgray 596 2291 a
+SDict begin H.S end
+ 596 2291 a FC(6.11.)e(Sending)h
+(commands)g(to)h(clients)1758 2291 y
+SDict begin 13 H.L end
+ 1758 2291 a 1758
+2291 a
+SDict begin [ /Subtype /Link /Dest (0:SEND-COMMANDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1758 2291 a Black Black 4 w FC(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 2291 a
+SDict begin H.S end
+ 3661 2291 a FC(72)3745 2291 y
+SDict begin 13 H.L end
+ 3745 2291 a
+3745 2291 a
+SDict begin [ /Subtype /Link /Dest (0:SEND-COMMANDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2291 a Black 0 TeXcolorgray 596 2399
+a
+SDict begin H.S end
+ 596 2399 a FC(6.12.)e(Syslog)i(logging)1285 2399 y
+SDict begin 13 H.L end
+
+1285 2399 a 1285 2399 a
+SDict begin [ /Subtype /Link /Dest (0:UDP) cvn /H /I /Border [0 0 0]
+/Color [1 0 0] H.B /ANN pdfmark end
+ 1285 2399 a Black Black FC(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black 0 TeXcolorgray 3661 2399 a
+SDict begin H.S end
+ 3661
+2399 a FC(73)3745 2399 y
+SDict begin 13 H.L end
+ 3745 2399 a 3745 2399 a
+SDict begin [ /Subtype /Link /Dest (0:UDP) cvn /H /I /Border [0 0 0]
+/Color [1 0 0] H.B /ANN pdfmark end
+ 3745
+2399 a Black 0 TeXcolorgray 596 2507 a
+SDict begin H.S end
+ 596 2507 a FC(6.13.)e
+(Performance)g(tuning)1441 2507 y
+SDict begin 13 H.L end
+ 1441 2507 a 1441 2507
+a
+SDict begin [ /Subtype /Link /Dest (0:PERFORMANCE-TUNING-SERVER) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1441 2507 a Black Black 10 w FC(.)p Black Black -1
+w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 2507
+a
+SDict begin H.S end
+ 3661 2507 a FC(74)3745 2507 y
+SDict begin 13 H.L end
+ 3745 2507 a 3745 2507
+a
+SDict begin [ /Subtype /Link /Dest (0:PERFORMANCE-TUNING-SERVER) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2507 a Black 0 TeXcolorgray 396 2635 a
+SDict begin H.S end
+ 396 2635
+a Fy(7.)i(Hooks)g(f)n(or)g(Exter)o(nal)f(Pr)o(ograms)1530
+2635 y
+SDict begin 13 H.L end
+ 1530 2635 a 1530 2635 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1530 2635 a Black Black
+4 w Fy(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 2635 a
+SDict begin H.S end
+ 3661 2635 a Fy(76)3745 2635 y
+SDict begin 13 H.L end
+ 3745 2635 a
+3745 2635 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2635 a Black 0 TeXcolorgray 596 2763
+a
+SDict begin H.S end
+ 596 2763 a FC(7.1.)g(Pipes)921 2763 y
+SDict begin 13 H.L end
+ 921 2763 a 921
+2763 a
+SDict begin [ /Subtype /Link /Dest (0:PIPES) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 921 2763 a Black Black 11 w FC(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 2763
+a
+SDict begin H.S end
+ 3661 2763 a FC(76)3745 2763 y
+SDict begin 13 H.L end
+ 3745 2763 a 3745 2763
+a
+SDict begin [ /Subtype /Link /Dest (0:PIPES) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2763 a Black 0 TeXcolorgray 596 2871 a
+SDict begin H.S end
+ 596 2871
+a FC(7.2.)g(System)h(V)h(message)f(queue)1589 2871 y
+SDict begin 13 H.L end
+
+1589 2871 a 1589 2871 a
+SDict begin [ /Subtype /Link /Dest (0:SYSTEM-V-MESSAGE-QUEUE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1589 2871 a Black Black 7 w FC(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 2871
+a
+SDict begin H.S end
+ 3661 2871 a FC(76)3745 2871 y
+SDict begin 13 H.L end
+ 3745 2871 a 3745 2871
+a
+SDict begin [ /Subtype /Link /Dest (0:SYSTEM-V-MESSAGE-QUEUE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2871 a Black 0 TeXcolorgray 596 2979 a
+SDict begin H.S end
+ 596 2979
+a FC(7.3.)f(Calling)h(e)o(xternal)f(programs)1609 2979
+y
+SDict begin 13 H.L end
+ 1609 2979 a 1609 2979 a
+SDict begin [ /Subtype /Link /Dest (0:CALLING-EXTERNAL-PROGRAMS) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1609 2979 a Black Black 8 w
+FC(.)p Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 2979 a
+SDict begin H.S end
+ 3661 2979
+a FC(76)3745 2979 y
+SDict begin 13 H.L end
+ 3745 2979 a 3745 2979 a
+SDict begin [ /Subtype /Link /Dest (0:CALLING-EXTERNAL-PROGRAMS) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 2979
+a Black 0 TeXcolorgray 396 3107 a
+SDict begin H.S end
+ 396 3107 a Fy(8.)h(Additional)g(F)n
+(eatur)o(es)f(\227)i(Signed)g(Con\002guration/Database)c(Files)2604
+3107 y
+SDict begin 13 H.L end
+ 2604 3107 a 2604 3107 a
+SDict begin [ /Subtype /Link /Dest (0:SIGNED-FILES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2604 3107 a Black Black
+9 w Fy(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 3107 a
+SDict begin H.S end
+ 3661 3107 a Fy(79)3745 3107
+y
+SDict begin 13 H.L end
+ 3745 3107 a 3745 3107 a
+SDict begin [ /Subtype /Link /Dest (0:SIGNED-FILES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3107 a Black 0 TeXcolorgray
+596 3234 a
+SDict begin H.S end
+ 596 3234 a FC(8.1.)i(The)h(samhainadmin)e(script)1581
+3234 y
+SDict begin 13 H.L end
+ 1581 3234 a 1581 3234 a
+SDict begin [ /Subtype /Link /Dest (0:SAMHAINADMIN) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1581 3234 a Black Black
+15 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black 0 TeXcolorgray
+3661 3234 a
+SDict begin H.S end
+ 3661 3234 a FC(80)3745 3234 y
+SDict begin 13 H.L end
+ 3745 3234 a
+3745 3234 a
+SDict begin [ /Subtype /Link /Dest (0:SAMHAINADMIN) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3234 a Black 0 TeXcolorgray 396 3362
+a
+SDict begin H.S end
+ 396 3362 a Fy(9.)i(Additional)g(F)n(eatur)o(es)f(\227)i(Stealth)1558
+3362 y
+SDict begin 13 H.L end
+ 1558 3362 a 1558 3362 a
+SDict begin [ /Subtype /Link /Dest (0:STEALTHMODE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1558 3362 a Black Black
+17 w Fy(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 3362 a
+SDict begin H.S end
+ 3661 3362 a Fy(82)3745 3362
+y
+SDict begin 13 H.L end
+ 3745 3362 a 3745 3362 a
+SDict begin [ /Subtype /Link /Dest (0:STEALTHMODE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3362 a Black 0 TeXcolorgray
+596 3490 a
+SDict begin H.S end
+ 596 3490 a FC(9.1.)e(Hiding)g(the)h(e)o(x)o(ecutable)1469
+3490 y
+SDict begin 13 H.L end
+ 1469 3490 a 1469 3490 a
+SDict begin [ /Subtype /Link /Dest (0:HIDING-THE-EXECUTABLE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1469 3490 a Black Black
+2 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 3490
+a
+SDict begin H.S end
+ 3661 3490 a FC(82)3745 3490 y
+SDict begin 13 H.L end
+ 3745 3490 a 3745 3490
+a
+SDict begin [ /Subtype /Link /Dest (0:HIDING-THE-EXECUTABLE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3490 a Black 0 TeXcolorgray 596 3598 a
+SDict begin H.S end
+ 596 3598
+a FC(9.2.)f(P)o(acking)g(the)h(e)o(x)o(ecutable)1505
+3598 y
+SDict begin 13 H.L end
+ 1505 3598 a 1505 3598 a
+SDict begin [ /Subtype /Link /Dest (0:PACKING-THE-EXECUTABLE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1505 3598 a Black Black
+8 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 3598 a
+SDict begin H.S end
+ 3661 3598 a FC(85)3745 3598
+y
+SDict begin 13 H.L end
+ 3745 3598 a 3745 3598 a
+SDict begin [ /Subtype /Link /Dest (0:PACKING-THE-EXECUTABLE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3598 a Black 0 TeXcolorgray
+396 3726 a
+SDict begin H.S end
+ 396 3726 a Fy(10.)g(Deployment)f(to)h(r)o(emote)g(hosts)1509
+3726 y
+SDict begin 13 H.L end
+ 1509 3726 a 1509 3726 a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOYMENT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1509 3726 a Black Black
+4 w Fy(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+0 TeXcolorgray 3661 3726 a
+SDict begin H.S end
+ 3661 3726 a Fy(87)3745 3726
+y
+SDict begin 13 H.L end
+ 3745 3726 a 3745 3726 a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOYMENT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3726 a Black 0 TeXcolorgray
+596 3854 a
+SDict begin H.S end
+ 596 3854 a FC(10.1.)e(Method)h(A:)i(The)f(deplo)o(yment)e
+(system)1958 3854 y
+SDict begin 13 H.L end
+ 1958 3854 a 1958 3854 a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOY.SH) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1958 3854
+a Black Black 12 w FC(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black 0 TeXcolorgray 3661 3854 a
+SDict begin H.S end
+ 3661 3854
+a FC(87)3745 3854 y
+SDict begin 13 H.L end
+ 3745 3854 a 3745 3854 a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOY.SH) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3854
+a Black 0 TeXcolorgray 596 3962 a
+SDict begin H.S end
+ 596 3962 a FC(10.2.)g(Method)h(B:)j
+(The)d(nati)n(v)o(e)h(package)e(manager)2111 3962 y
+SDict begin 13 H.L end
+ 2111
+3962 a 2111 3962 a
+SDict begin [ /Subtype /Link /Dest (0:NATIVE-PACKAGES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2111 3962 a Black Black 4 w FC(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black 0 TeXcolorgray 3661 3962
+a
+SDict begin H.S end
+ 3661 3962 a FC(97)3745 3962 y
+SDict begin 13 H.L end
+ 3745 3962 a 3745 3962
+a
+SDict begin [ /Subtype /Link /Dest (0:NATIVE-PACKAGES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3745 3962 a Black 0 TeXcolorgray 396 4090 a
+SDict begin H.S end
+ 396 4090
+a Fy(11.)i(Security)g(Design)1077 4090 y
+SDict begin 13 H.L end
+ 1077 4090 a
+1077 4090 a
+SDict begin [ /Subtype /Link /Dest (0:SECURITY-DESIGN) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1077 4090 a Black Black Fy(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+4090 a
+SDict begin H.S end
+ 3620 4090 a Fy(101)3746 4090 y
+SDict begin 13 H.L end
+ 3746 4090 a 3746
+4090 a
+SDict begin [ /Subtype /Link /Dest (0:SECURITY-DESIGN) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4090 a Black 0 TeXcolorgray 596 4217 a
+SDict begin H.S end
+ 596
+4217 a FC(11.1.)e(Usage)990 4217 y
+SDict begin 13 H.L end
+ 990 4217 a 990 4217
+a
+SDict begin [ /Subtype /Link /Dest (0:SECURITY-USAGE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 990 4217 a Black Black 4 w FC(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray
+3620 4217 a
+SDict begin H.S end
+ 3620 4217 a FC(101)3746 4217 y
+SDict begin 13 H.L end
+ 3746 4217
+a 3746 4217 a
+SDict begin [ /Subtype /Link /Dest (0:SECURITY-USAGE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4217 a Black 0 TeXcolorgray 596 4325
+a
+SDict begin H.S end
+ 596 4325 a FC(11.2.)g(Inte)o(grity)h(of)h(the)g(e)o(x)o(ecutable)1655
+4325 y
+SDict begin 13 H.L end
+ 1655 4325 a 1655 4325 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1655 4325 a Black Black
+3 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 4325 a
+SDict begin H.S end
+ 3620 4325 a FC(101)3746
+4325 y
+SDict begin 13 H.L end
+ 3746 4325 a 3746 4325 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4325 a Black 0 TeXcolorgray
+596 4433 a
+SDict begin H.S end
+ 596 4433 a FC(11.3.)e(Client)j(e)o(x)o(ecutable)d(inte)o
+(grity)1661 4433 y
+SDict begin 13 H.L end
+ 1661 4433 a 1661 4433 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENT-INTEGRITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1661 4433
+a Black Black 18 w FC(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 4433 a
+SDict begin H.S end
+ 3620 4433 a FC(103)3746
+4433 y
+SDict begin 13 H.L end
+ 3746 4433 a 3746 4433 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENT-INTEGRITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4433 a Black 0 TeXcolorgray
+596 4541 a
+SDict begin H.S end
+ 596 4541 a FC(11.4.)g(The)i(serv)o(er)1135
+4541 y
+SDict begin 13 H.L end
+ 1135 4541 a 1135 4541 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-SECURITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1135 4541 a Black Black
+4 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 4541 a
+SDict begin H.S end
+ 3620 4541 a FC(103)3746
+4541 y
+SDict begin 13 H.L end
+ 3746 4541 a 3746 4541 a
+SDict begin [ /Subtype /Link /Dest (0:SERVER-SECURITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4541 a Black 0 TeXcolorgray
+596 4649 a
+SDict begin H.S end
+ 596 4649 a FC(11.5.)e(General)1046 4649 y
+SDict begin 13 H.L end
+
+1046 4649 a 1046 4649 a
+SDict begin [ /Subtype /Link /Dest (0:DESIGN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1046 4649 a Black Black 10 w
+FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black 0 TeXcolorgray 3620 4649 a
+SDict begin H.S end
+ 3620
+4649 a FC(103)3746 4649 y
+SDict begin 13 H.L end
+ 3746 4649 a 3746 4649 a
+SDict begin [ /Subtype /Link /Dest (0:DESIGN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+4649 a Black 0 TeXcolorgray 396 4777 a
+SDict begin H.S end
+ 396 4777 a Fy(A.)j(List)g(of)f
+(options)g(f)n(or)g(the)g(./con\002gur)o(e)f(script)1880
+4777 y
+SDict begin 13 H.L end
+ 1880 4777 a 1880 4777 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-OPTIONS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1880 4777 a Black Black
+7 w Fy(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+4777 a
+SDict begin H.S end
+ 3620 4777 a Fy(105)3746 4777 y
+SDict begin 13 H.L end
+ 3746 4777 a 3746
+4777 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-OPTIONS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 4777 a Black 0 TeXcolorgray 596 4905 a
+SDict begin H.S end
+ 596
+4905 a FC(A.1.)g(General)1023 4905 y
+SDict begin 13 H.L end
+ 1023 4905 a 1023
+4905 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-OPTIONS-GENERAL)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1023 4905 a Black Black 13 w FC(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black 0 TeXcolorgray 3620 4905 a
+SDict begin H.S end
+ 3620
+4905 a FC(105)3746 4905 y
+SDict begin 13 H.L end
+ 3746 4905 a 3746 4905 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-OPTIONS-GENERAL)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+4905 a Black 0 TeXcolorgray 596 5013 a
+SDict begin H.S end
+ 596 5013 a FC(A.2.)g(Optional)h
+(modules)f(to)h(perfor)f(additional)f(checks)2261 5013
+y
+SDict begin 13 H.L end
+ 2261 5013 a 2261 5013 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-CHECKS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2261 5013 a Black Black 20
+w FC(.)p Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black 0 TeXcolorgray 3620 5013 a
+SDict begin H.S end
+ 3620
+5013 a FC(107)3746 5013 y
+SDict begin 13 H.L end
+ 3746 5013 a 3746 5013 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-CHECKS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+5013 a Black 0 TeXcolorgray 596 5121 a
+SDict begin H.S end
+ 596 5121 a FC(A.3.)h(OpenPGP)h
+(Signatures)f(on)h(Con\002guration/Database)d(Files)2557
+5121 y
+SDict begin 13 H.L end
+ 2557 5121 a 2557 5121 a
+SDict begin [ /Subtype /Link /Dest (0:OPENPGP-SIGNATURES) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2557 5121 a Black Black
+14 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 5121 a
+SDict begin H.S end
+ 3620 5121 a FC(107)3746 5121
+y
+SDict begin 13 H.L end
+ 3746 5121 a 3746 5121 a
+SDict begin [ /Subtype /Link /Dest (0:OPENPGP-SIGNATURES) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 5121 a Black 0 TeXcolorgray
+596 5229 a
+SDict begin H.S end
+ 596 5229 a FC(A.4.)i(Client/Serv)o(er)g(Connecti)n(vity)1650
+5229 y
+SDict begin 13 H.L end
+ 1650 5229 a 1650 5229 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENT-SERVER-CONNECTIVITY) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1650 5229 a Black Black
+8 w FC(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 5229 a
+SDict begin H.S end
+ 3620 5229 a FC(108)3746
+5229 y
+SDict begin 13 H.L end
+ 3746 5229 a 3746 5229 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENT-SERVER-CONNECTIVITY) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 5229 a Black 0 TeXcolorgray
+596 5337 a
+SDict begin H.S end
+ 596 5337 a FC(A.5.)g(P)o(aths)938 5337 y
+SDict begin 13 H.L end
+ 938
+5337 a 938 5337 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 938 5337 a Black Black 15 w FC(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 5337 a
+SDict begin H.S end
+ 3620 5337 a FC(109)3746 5337
+y
+SDict begin 13 H.L end
+ 3746 5337 a 3746 5337 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 5337 a Black Black 3684
+5805 a Fx(iv)p Black eop end
+%%Page: 5 5
+TeXDict begin 5 4 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.5) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black 0 TeXcolorgray
+396 309 a
+SDict begin H.S end
+ 396 309 a Fy(B.)21 b(List)g(of)f(command)g(line)h(options)
+1522 309 y
+SDict begin 13 H.L end
+ 1522 309 a 1522 309 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1522 309 a Black Black
+12 w Fy(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 309 a
+SDict begin H.S end
+ 3620 309 a Fy(111)3746
+309 y
+SDict begin 13 H.L end
+ 3746 309 a 3746 309 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 309 a Black 0 TeXcolorgray
+596 437 a
+SDict begin H.S end
+ 596 437 a FC(B.1.)f(General)1019 437 y
+SDict begin 13 H.L end
+ 1019
+437 a 1019 437 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE-GENERAL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1019 437 a Black Black 17 w FC(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black 0 TeXcolorgray 3620 437 a
+SDict begin H.S end
+
+3620 437 a FC(111)3746 437 y
+SDict begin 13 H.L end
+ 3746 437 a 3746 437 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE-GENERAL) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+437 a Black 0 TeXcolorgray 596 544 a
+SDict begin H.S end
+ 596 544 a FC(B.2.)g(samhain)1033
+544 y
+SDict begin 13 H.L end
+ 1033 544 a 1033 544 a
+SDict begin [ /Subtype /Link /Dest (0:SAMHAIN-COMMAND-LINE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1033 544 a Black Black 3
+w FC(.)p Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+544 a
+SDict begin H.S end
+ 3620 544 a FC(112)3746 544 y
+SDict begin 13 H.L end
+ 3746 544 a 3746 544
+a
+SDict begin [ /Subtype /Link /Dest (0:SAMHAIN-COMMAND-LINE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 544 a Black 0 TeXcolorgray 596 652 a
+SDict begin H.S end
+ 596 652 a
+FC(B.3.)g(yule)899 652 y
+SDict begin 13 H.L end
+ 899 652 a 899 652 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE-YULE) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 899 652
+a Black Black 12 w FC(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 652 a
+SDict begin H.S end
+ 3620 652 a FC(112)3746 652
+y
+SDict begin 13 H.L end
+ 3746 652 a 3746 652 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE-YULE) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 652 a Black 0 TeXcolorgray
+396 780 a
+SDict begin H.S end
+ 396 780 a Fy(C.)h(List)g(of)f(con\002guration)f(\002le)i
+(options)1629 780 y
+SDict begin 13 H.L end
+ 1629 780 a 1629 780 a
+SDict begin [ /Subtype /Link /Dest (0:THE-CONFIGURATION-FILE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1629 780 a
+Black Black 8 w Fy(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+780 a
+SDict begin H.S end
+ 3620 780 a Fy(113)3746 780 y
+SDict begin 13 H.L end
+ 3746 780 a 3746 780
+a
+SDict begin [ /Subtype /Link /Dest (0:THE-CONFIGURATION-FILE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 780 a Black 0 TeXcolorgray 596 908 a
+SDict begin H.S end
+ 596 908 a
+FC(C.1.)f(General)1019 908 y
+SDict begin 13 H.L end
+ 1019 908 a 1019 908 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1019
+908 a Black Black 17 w FC(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 908 a
+SDict begin H.S end
+ 3620 908 a FC(113)3746
+908 y
+SDict begin 13 H.L end
+ 3746 908 a 3746 908 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 908 a Black 0 TeXcolorgray
+596 1016 a
+SDict begin H.S end
+ 596 1016 a FC(C.2.)g(Files)h(to)f(check)1217
+1016 y
+SDict begin 13 H.L end
+ 1217 1016 a 1217 1016 a
+SDict begin [ /Subtype /Link /Dest (0:FILES-TO-CHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1217 1016 a Black Black
+5 w FC(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray
+3620 1016 a
+SDict begin H.S end
+ 3620 1016 a FC(114)3746 1016 y
+SDict begin 13 H.L end
+ 3746 1016
+a 3746 1016 a
+SDict begin [ /Subtype /Link /Dest (0:FILES-TO-CHECK) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1016 a Black 0 TeXcolorgray 596 1124
+a
+SDict begin H.S end
+ 596 1124 a FC(C.3.)g(Se)n(v)o(erity)f(of)h(e)n(v)o(ents)1349
+1124 y
+SDict begin 13 H.L end
+ 1349 1124 a 1349 1124 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITY-OF-EVENTS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1349 1124 a Black Black
+19 w FC(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+1124 a
+SDict begin H.S end
+ 3620 1124 a FC(114)3746 1124 y
+SDict begin 13 H.L end
+ 3746 1124 a 3746
+1124 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITY-OF-EVENTS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1124 a Black 0 TeXcolorgray 596 1232 a
+SDict begin H.S end
+ 596
+1232 a FC(C.4.)g(Logging)e(thresholds)1400 1232 y
+SDict begin 13 H.L end
+ 1400
+1232 a 1400 1232 a
+SDict begin [ /Subtype /Link /Dest (0:LOGGING-THRESHOLDS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1400 1232 a Black Black 9 w FC(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray
+3620 1232 a
+SDict begin H.S end
+ 3620 1232 a FC(115)3746 1232 y
+SDict begin 13 H.L end
+ 3746 1232
+a 3746 1232 a
+SDict begin [ /Subtype /Link /Dest (0:LOGGING-THRESHOLDS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1232 a Black 0 TeXcolorgray 596 1340
+a
+SDict begin H.S end
+ 596 1340 a FC(C.5.)i(W)-7 b(atching)20 b(login/logout)d(e)n(v)o(ents)
+1728 1340 y
+SDict begin 13 H.L end
+ 1728 1340 a 1728 1340 a
+SDict begin [ /Subtype /Link /Dest (0:WATCHING-LOGIN-LOGOUT-EVENTS)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1728 1340 a Black
+Black 13 w FC(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 1340 a
+SDict begin H.S end
+ 3620 1340 a FC(116)3746 1340
+y
+SDict begin 13 H.L end
+ 3746 1340 a 3746 1340 a
+SDict begin [ /Subtype /Link /Dest (0:WATCHING-LOGIN-LOGOUT-EVENTS)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1340 a Black 0 TeXcolorgray
+596 1448 a
+SDict begin H.S end
+ 596 1448 a FC(C.6.)j(Checking)f(for)g(k)o(ernel)h(module)e
+(rootkits)1963 1448 y
+SDict begin 13 H.L end
+ 1963 1448 a 1963 1448 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-FOR-KERNEL-MODULE-ROOTKITS)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1963 1448
+a Black Black 7 w FC(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black 0 TeXcolorgray 3620 1448 a
+SDict begin H.S end
+
+3620 1448 a FC(117)3746 1448 y
+SDict begin 13 H.L end
+ 3746 1448 a 3746 1448
+a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-FOR-KERNEL-MODULE-ROOTKITS)
+cvn /H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1448 a Black 0 TeXcolorgray 596 1556 a
+SDict begin H.S end
+ 596 1556
+a FC(C.7.)i(Checking)f(for)g(SUID/SGID)h(\002les)1780
+1556 y
+SDict begin 13 H.L end
+ 1780 1556 a 1780 1556 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-FOR-SUID-FILES) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1780 1556 a Black Black
+3 w FC(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black 0 TeXcolorgray 3620 1556 a
+SDict begin H.S end
+ 3620 1556 a
+FC(117)3746 1556 y
+SDict begin 13 H.L end
+ 3746 1556 a 3746 1556 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-FOR-SUID-FILES) cvn
+/H /I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1556
+a Black 0 TeXcolorgray 596 1664 a
+SDict begin H.S end
+ 596 1664 a FC(C.8.)g(Checking)f(for)g
+(mount)g(options)1690 1664 y
+SDict begin 13 H.L end
+ 1690 1664 a 1690 1664 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-MOUNTS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+1690 1664 a Black Black 10 w FC(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 1664 a
+SDict begin H.S end
+ 3620 1664 a FC(118)3746 1664
+y
+SDict begin 13 H.L end
+ 3746 1664 a 3746 1664 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-MOUNTS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1664 a Black 0 TeXcolorgray
+596 1772 a
+SDict begin H.S end
+ 596 1772 a FC(C.9.)h(Checking)f(for)g(user)h(\002les)1508
+1772 y
+SDict begin 13 H.L end
+ 1508 1772 a 1508 1772 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-USERFILES) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1508 1772 a Black Black
+5 w FC(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black 0 TeXcolorgray 3620 1772 a
+SDict begin H.S end
+ 3620
+1772 a FC(118)3746 1772 y
+SDict begin 13 H.L end
+ 3746 1772 a 3746 1772 a
+SDict begin [ /Subtype /Link /Dest (0:CHECKING-USERFILES) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+1772 a Black 0 TeXcolorgray 596 1879 a
+SDict begin H.S end
+ 596 1879 a FC(C.10.)f(Database)
+1101 1879 y
+SDict begin 13 H.L end
+ 1101 1879 a 1101 1879 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1101 1879 a Black
+Black 18 w FC(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+1879 a
+SDict begin H.S end
+ 3620 1879 a FC(119)3746 1879 y
+SDict begin 13 H.L end
+ 3746 1879 a 3746
+1879 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1879 a Black 0 TeXcolorgray 596 1987 a
+SDict begin H.S end
+ 596
+1987 a FC(C.11.)g(Miscellaneous)1277 1987 y
+SDict begin 13 H.L end
+ 1277 1987
+a 1277 1987 a
+SDict begin [ /Subtype /Link /Dest (0:MISCELLANEOUS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1277 1987 a Black Black 8 w FC(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+1987 a
+SDict begin H.S end
+ 3620 1987 a FC(120)3746 1987 y
+SDict begin 13 H.L end
+ 3746 1987 a 3746
+1987 a
+SDict begin [ /Subtype /Link /Dest (0:MISCELLANEOUS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 1987 a Black 0 TeXcolorgray 596 2095 a
+SDict begin H.S end
+ 596
+2095 a FC(C.12.)g(External)1079 2095 y
+SDict begin 13 H.L end
+ 1079 2095 a 1079
+2095 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERNAL) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1079 2095 a Black Black 19 w FC(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black 0 TeXcolorgray 3620 2095 a
+SDict begin H.S end
+ 3620
+2095 a FC(125)3746 2095 y
+SDict begin 13 H.L end
+ 3746 2095 a 3746 2095 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERNAL) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746
+2095 a Black 0 TeXcolorgray 596 2203 a
+SDict begin H.S end
+ 596 2203 a FC(C.13.)g(Clients)
+1031 2203 y
+SDict begin 13 H.L end
+ 1031 2203 a 1031 2203 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE-CLIENTS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1031 2203 a Black
+Black 5 w FC(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 2203 a
+SDict begin H.S end
+ 3620 2203 a FC(125)3746 2203
+y
+SDict begin 13 H.L end
+ 3746 2203 a 3746 2203 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE-CLIENTS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 2203 a Black 0 TeXcolorgray
+396 2331 a
+SDict begin H.S end
+ 396 2331 a Fy(D.)i(List)g(of)f(database)f(\002elds)1265
+2331 y
+SDict begin 13 H.L end
+ 1265 2331 a 1265 2331 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1265 2331 a Black Black
+20 w Fy(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 2331 a
+SDict begin H.S end
+ 3620 2331 a Fy(127)3746 2331
+y
+SDict begin 13 H.L end
+ 3746 2331 a 3746 2331 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASE-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 2331 a Black 0 TeXcolorgray
+596 2459 a
+SDict begin H.S end
+ 596 2459 a FC(D.1.)g(General)1023 2459 y
+SDict begin 13 H.L end
+ 1023
+2459 a 1023 2459 a
+SDict begin [ /Subtype /Link /Dest (0:GEN-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1023 2459 a Black Black 13 w FC(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black 0 TeXcolorgray 3620
+2459 a
+SDict begin H.S end
+ 3620 2459 a FC(127)3746 2459 y
+SDict begin 13 H.L end
+ 3746 2459 a 3746
+2459 a
+SDict begin [ /Subtype /Link /Dest (0:GEN-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 2459 a Black 0 TeXcolorgray 596 2567 a
+SDict begin H.S end
+ 596
+2567 a FC(D.2.)g(Modules)1051 2567 y
+SDict begin 13 H.L end
+ 1051 2567 a 1051
+2567 a
+SDict begin [ /Subtype /Link /Dest (0:MOD-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1051 2567 a Black Black 5 w FC(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+0 TeXcolorgray 3620 2567 a
+SDict begin H.S end
+ 3620 2567 a FC(129)3746 2567
+y
+SDict begin 13 H.L end
+ 3746 2567 a 3746 2567 a
+SDict begin [ /Subtype /Link /Dest (0:MOD-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 2567 a Black 0 TeXcolorgray
+596 2675 a
+SDict begin H.S end
+ 596 2675 a FC(D.3.)g(Syslog)986 2675 y
+SDict begin 13 H.L end
+ 986
+2675 a 986 2675 a
+SDict begin [ /Subtype /Link /Dest (0:SYS-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 986 2675 a Black Black 8 w FC(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black Black(.)p Black Black(.)p Black Black(.)p Black
+Black -1 w(.)p Black Black(.)p Black Black(.)p Black
+Black(.)p Black Black -1 w(.)p Black Black(.)p Black
+Black(.)p Black Black(.)p Black Black -1 w(.)p Black
+Black(.)p Black Black(.)p Black Black(.)p Black Black
+-1 w(.)p Black Black(.)p Black Black(.)p Black Black(.)p
+Black Black -1 w(.)p Black Black(.)p Black Black(.)p
+Black Black(.)p Black Black -1 w(.)p Black Black(.)p
+Black Black(.)p Black Black(.)p Black Black -1 w(.)p
+Black 0 TeXcolorgray 3620 2675 a
+SDict begin H.S end
+ 3620 2675 a FC(129)3746
+2675 y
+SDict begin 13 H.L end
+ 3746 2675 a 3746 2675 a
+SDict begin [ /Subtype /Link /Dest (0:SYS-DB-FIELDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3746 2675 a Black Black
+3707 5805 a Fx(v)p Black eop end
+%%Page: 1 6
+TeXDict begin 1 5 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.1) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INTRO) cvn H.B /DEST pdfmark
+end
+ -2 226 a 125 x
+Fz(Chapter)48 b(1.)f(Intr)m(oduction)1887 351 y
+SDict begin H.S end
+ 1887
+351 a 1887 351 a
+SDict begin 26.957 H.A end
+ 1887 351 a 1887 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (3.0) cvn H.B /DEST pdfmark end
+ 1887 351 a -2
+607 a
+SDict begin H.S end
+ -2 607 a -2 607 a
+SDict begin 13 H.A end
+ -2 607 a -2 607 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:14) cvn H.B /DEST pdfmark end
+ -2 607 a -2
+607 a
+SDict begin H.S end
+ -2 607 a -2 607 a
+SDict begin 13 H.A end
+ -2 607 a -2 607 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:15) cvn H.B /DEST pdfmark end
+ -2 607 a 396
+679 a FC(samhain)20 b(is)h(a)f(data)h(inte)o(grity)d(and)i(intrusion)f
+(alert)h(system)h(that)f(can)g(be)g(used)g(on)g(single)g(hosts)g(as)h
+(well)g(as)g(for)396 787 y(lar)o(ge,)e(UNIX-based)g(netw)o(orks.)1392
+787 y
+SDict begin H.S end
+ 1392 787 a 1392 787 a
+SDict begin 13 H.A end
+ 1392 787 a 1392 787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:16) cvn H.B /DEST pdfmark end
+ 1392
+787 a FC(samhain)h(of)n(fers)f(se)n(v)o(eral)g(features)h(to)g(support)
+f(and)h(f)o(acilitate)g(centralized)396 895 y(monitoring.)-2
+1079 y
+SDict begin H.S end
+ -2 1079 a -2 1079 a
+SDict begin 13 H.A end
+ -2 1079 a -2 1079 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:17) cvn H.B /DEST pdfmark end
+ -2 1079
+a 396 1169 a FC(In)g(particular)m(,)843 1169 y
+SDict begin H.S end
+ 843 1169
+a 843 1169 a
+SDict begin 13 H.A end
+ 843 1169 a 843 1169 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:18) cvn H.B /DEST pdfmark end
+ 843 1169 a FC(samhain)f(can)h
+(optionally)e(be)j(used)f(as)g(a)h(client/serv)o(er)e(system)h(with)h
+(monitoring)c(clients)k(on)396 1277 y(indi)n(vidual)e(hosts,)h(and)g(a)
+g(central)g(log)g(serv)o(er)f(that)h(collects)h(the)f(messages)g(of)g
+(all)h(clients.)-2 1461 y
+SDict begin H.S end
+ -2 1461 a -2 1461 a
+SDict begin 13 H.A end
+ -2 1461
+a -2 1461 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:19) cvn H.B /DEST pdfmark end
+ -2 1461 a 396 1551 a FC(The)e(con\002guration)d(and)i
+(database)g(\002les)h(for)f(each)h(client)f(can)h(be)f(stored)h
+(centrally)e(and)h(do)n(wnloaded)e(by)j(clients)396 1659
+y(from)g(the)i(log)e(serv)o(er)-5 b(.)20 b(Using)g(conditionals)f
+(\(based)g(on)h(hostname,)f(machine)g(type,)g(OS,)i(and)e(OS)i
+(release,)f(all)396 1767 y(with)h(re)o(gular)d(e)o(xpresions\))g(a)j
+(single)f(con\002guration)e(\002le)j(for)e(all)i(hosts)f(on)g(the)g
+(netw)o(ork)f(can)h(be)g(constructed.)-2 1951 y
+SDict begin H.S end
+ -2 1951
+a -2 1951 a
+SDict begin 13 H.A end
+ -2 1951 a -2 1951 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:20) cvn H.B /DEST pdfmark end
+ -2 1951 a 396 2041 a
+FC(The)g(client)g(\(or)g(standalone\))e(part)i(is)h(called)1717
+2041 y
+SDict begin H.S end
+ 1717 2041 a 1717 2041 a
+SDict begin 13 H.A end
+ 1717 2041 a 1717 2041
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:21) cvn H.B /DEST pdfmark end
+ 1717 2041 a FC(samhain,)f(while)g(the)g(serv)o(er)f(is)i(referred)e
+(to)h(as)3120 2041 y
+SDict begin H.S end
+ 3120 2041 a 3120 2041 a
+SDict begin 13 H.A end
+ 3120 2041
+a 3120 2041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:22) cvn H.B /DEST pdfmark end
+ 3120 2041 a FC(yule.)g(Both)g(can)g(run)396
+2149 y(as)h(daemon)e(processes.)p Black 3703 5805 a Fx(1)p
+Black eop end
+%%Page: 2 7
+TeXDict begin 2 6 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.2) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(2.)f(Compiling)i(and)f(installing)2887
+351 y
+SDict begin H.S end
+ 2887 351 a 2887 351 a
+SDict begin 26.957 H.A end
+ 2887 351 a 2887 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.0) cvn H.B /DEST pdfmark end
+ 2887
+351 a -2 443 a
+SDict begin H.S end
+ -2 443 a -2 443 a
+SDict begin 11.7 H.A end
+ -2 443 a -2 443 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:25) cvn H.B /DEST pdfmark end
+ -2
+443 a -2 568 a
+SDict begin H.S end
+ -2 568 a -2 568 a
+SDict begin 11.7 H.A end
+ -2 568 a -2 568 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:27) cvn H.B /DEST pdfmark end
+ -2
+568 a 562 627 a Fw(Samhain)20 b(as)f(a)i(c)o(lient/ser)q(ver)16
+b(system:)j Fv(This)h(chapter)f(f)n(ocuses)h(on)g(b)o(uilding)d(a)j
+(standalone)d(samhain)562 724 y(e)n(x)n(ecutab)o(le)o(.)g(F)n(or)j(a)g
+(client/ser)r(v)n(er)f(system,)i(client)e(and)h(ser)r(v)n(er)g(e)n(x)n
+(ecutab)o(le)d(are)j(b)o(uilt)f(from)h(the)f(same)562
+821 y(source)o(,)h(b)o(ut)f(with)h(diff)n(erent)d(options)i(f)n(or)h
+(the)f('con\002gure')f(scr)q(ipt)j(\(see)p 0 TeXcolorgray
+2612 821 a
+SDict begin H.S end
+ 2612 821 a Fv(Section)e(2.4)2987 821 y
+SDict begin 11.7 H.L end
+ 2987
+821 a 2987 821 a
+SDict begin [ /Subtype /Link /Dest (0:INSTALLATION-CONFIGURE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2987 821 a Black -1 w Fv(>\).)-2 879
+y
+SDict begin H.S end
+ -2 879 a -2 879 a
+SDict begin 11.7 H.A end
+ -2 879 a -2 879 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:29) cvn H.B /DEST pdfmark end
+ -2 879 a 562 960
+a Fv(Please)g(ref)n(er)h(to)g(the)f(chapter)p 0 TeXcolorgray
+1461 960 a
+SDict begin H.S end
+ 1461 960 a Fv(Chapter)g(6)1790 960 y
+SDict begin 11.7 H.L end
+ 1790
+960 a 1790 960 a
+SDict begin [ /Subtype /Link /Dest (0:YULE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1790 960 a Black 20 w Fv(f)n(or)h(an)g(e)n(xplanation)
+c(of)k(the)g(client/ser)r(v)n(er)f(setup)m(.)39 1109
+y
+SDict begin H.S end
+ 39 1109 a 39 1109 a
+SDict begin 13 H.A end
+ 39 1109 a 39 1109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-OVERVIEW) cvn
+H.B /DEST pdfmark end
+ 39 1109 a -2
+1486 a Fu(2.1.)39 b(Over)q(vie)n(w)916 1486 y
+SDict begin H.S end
+ 916 1486
+a 916 1486 a
+SDict begin 22.464 H.A end
+ 916 1486 a 916 1486 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.1.1) cvn H.B /DEST pdfmark
+end
+ 916 1486 a -2 1654
+a
+SDict begin H.S end
+ -2 1654 a -2 1654 a
+SDict begin 13 H.A end
+ -2 1654 a -2 1654 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:33) cvn H.B /DEST pdfmark end
+ -2 1654 a 396
+1760 a FC(Do)n(wnload:)-2 1844 y
+SDict begin H.S end
+ -2 1844 a -2 1844 a
+SDict begin 11.7 H.A end
+
+-2 1844 a -2 1844 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:34) cvn H.B /DEST pdfmark end
+ -2 1844 a 531 1940 a
+SDict begin H.S end
+ 531 1940 a 531
+1940 a
+SDict begin 11.7 H.A end
+ 531 1940 a 531 1940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:35) cvn H.B /DEST pdfmark end
+ 531 1940 a Ft(sh$)692 1940
+y
+SDict begin H.S end
+ 692 1940 a 692 1940 a
+SDict begin 11.7 H.A end
+ 692 1940 a 692 1940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:36) cvn H.B /DEST pdfmark end
+ 692 1940
+a Fs(wget)j(http://la-samhna.de)q(/sa)q(mha)q(in/)q(sam)q(hai)q(n-c)q
+(urr)q(en)q(t.t)q(ar.)q(gz)-2 2394 y
+SDict begin H.S end
+ -2 2394 a -2 2394
+a
+SDict begin 13 H.A end
+ -2 2394 a -2 2394 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:37) cvn H.B /DEST pdfmark end
+ -2 2394 a 396 2502 a FC(Extract)20
+b(\(and)f(v)o(erify)g(PGP)i(signature\):)-2 2603 y
+SDict begin H.S end
+ -2
+2603 a -2 2603 a
+SDict begin 11.7 H.A end
+ -2 2603 a -2 2603 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:38) cvn H.B /DEST pdfmark end
+ -2 2603 a 531 2683
+a
+SDict begin H.S end
+ 531 2683 a 531 2683 a
+SDict begin 11.7 H.A end
+ 531 2683 a 531 2683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:39) cvn H.B /DEST pdfmark end
+ 531 2683
+a Ft(sh$)692 2683 y
+SDict begin H.S end
+ 692 2683 a 692 2683 a
+SDict begin 11.7 H.A end
+ 692 2683 a
+692 2683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:40) cvn H.B /DEST pdfmark end
+ 692 2683 a Fs(gunzip)43 b(-c)e(samhain-current.tar.)q(gz)47
+b(|)40 b(tar)i(xvf)f(-)531 2780 y
+SDict begin H.S end
+ 531 2780 a 531 2780
+a
+SDict begin 11.7 H.A end
+ 531 2780 a 531 2780 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:41) cvn H.B /DEST pdfmark end
+ 531 2780 a Ft(sh$)692 2780 y
+SDict begin H.S end
+
+692 2780 a 692 2780 a
+SDict begin 11.7 H.A end
+ 692 2780 a 692 2780 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:42) cvn H.B /DEST pdfmark end
+ 692 2780
+a Fs(gpg)h(--verify)h(samhain-N.N.N.tar.gz)q(.as)q(c)j
+(samhain-N.N.N.tar)531 2877 y
+SDict begin H.S end
+ 531 2877 a 531 2877 a
+SDict begin 11.7 H.A end
+ 531
+2877 a 531 2877 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:43) cvn H.B /DEST pdfmark end
+ 531 2877 a Ft(sh$)692 2877 y
+SDict begin H.S end
+ 692 2877
+a 692 2877 a
+SDict begin 11.7 H.A end
+ 692 2877 a 692 2877 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:44) cvn H.B /DEST pdfmark end
+ 692 2877 a Fs(gunzip)d
+(samhain-N.N.N.tar.gz)k(|)41 b(tar)g(xvf)g(-)531 2974
+y
+SDict begin H.S end
+ 531 2974 a 531 2974 a
+SDict begin 11.7 H.A end
+ 531 2974 a 531 2974 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:45) cvn H.B /DEST pdfmark end
+ 531 2974
+a Ft(sh$)692 2974 y
+SDict begin H.S end
+ 692 2974 a 692 2974 a
+SDict begin 11.7 H.A end
+ 692 2974 a
+692 2974 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:46) cvn H.B /DEST pdfmark end
+ 692 2974 a Fs(cd)g(samhain-N.N.N)-2 3428 y
+SDict begin H.S end
+
+-2 3428 a -2 3428 a
+SDict begin 13 H.A end
+ -2 3428 a -2 3428 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:47) cvn H.B /DEST pdfmark end
+ -2 3428 a 396
+3536 a FC(Con\002gure:)-2 3637 y
+SDict begin H.S end
+ -2 3637 a -2 3637 a
+SDict begin 11.7 H.A end
+
+-2 3637 a -2 3637 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:48) cvn H.B /DEST pdfmark end
+ -2 3637 a 531 3716 a
+SDict begin H.S end
+ 531 3716 a 531
+3716 a
+SDict begin 11.7 H.A end
+ 531 3716 a 531 3716 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:49) cvn H.B /DEST pdfmark end
+ 531 3716 a Ft(sh$)692 3716
+y
+SDict begin H.S end
+ 692 3716 a 692 3716 a
+SDict begin 11.7 H.A end
+ 692 3716 a 692 3716 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:50) cvn H.B /DEST pdfmark end
+ 692 3716
+a Fs(./configure)-2 4170 y
+SDict begin H.S end
+ -2 4170 a -2 4170 a
+SDict begin 13 H.A end
+ -2 4170
+a -2 4170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:51) cvn H.B /DEST pdfmark end
+ -2 4170 a 396 4278 a FC(Compile:)-2 4379
+y
+SDict begin H.S end
+ -2 4379 a -2 4379 a
+SDict begin 11.7 H.A end
+ -2 4379 a -2 4379 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:52) cvn H.B /DEST pdfmark end
+ -2 4379 a 531
+4458 a
+SDict begin H.S end
+ 531 4458 a 531 4458 a
+SDict begin 11.7 H.A end
+ 531 4458 a 531 4458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:53) cvn H.B /DEST pdfmark end
+ 531
+4458 a Ft(sh$)692 4458 y
+SDict begin H.S end
+ 692 4458 a 692 4458 a
+SDict begin 11.7 H.A end
+ 692 4458
+a 692 4458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:54) cvn H.B /DEST pdfmark end
+ 692 4458 a Fs(make)-2 4913 y
+SDict begin H.S end
+ -2 4913 a -2
+4913 a
+SDict begin 13 H.A end
+ -2 4913 a -2 4913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:55) cvn H.B /DEST pdfmark end
+ -2 4913 a 396 5020 a FC(Install:)-2
+5104 y
+SDict begin H.S end
+ -2 5104 a -2 5104 a
+SDict begin 11.7 H.A end
+ -2 5104 a -2 5104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:56) cvn H.B /DEST pdfmark end
+ -2 5104
+a 531 5201 a
+SDict begin H.S end
+ 531 5201 a 531 5201 a
+SDict begin 11.7 H.A end
+ 531 5201 a 531 5201
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:57) cvn H.B /DEST pdfmark end
+ 531 5201 a Ft(sh$)692 5201 y
+SDict begin H.S end
+ 692 5201 a 692 5201 a
+SDict begin 11.7 H.A end
+
+692 5201 a 692 5201 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:58) cvn H.B /DEST pdfmark end
+ 692 5201 a Fs(make)h(install)p
+Black -2 5805 a
+SDict begin H.S end
+ -2 5805 a -2 5805 a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:59) cvn H.B /DEST pdfmark end
+ -2 5805 a 3703 5874 a Fx(2)p Black eop end
+%%Page: 3 8
+TeXDict begin 3 7 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.3) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+396 583 a FC(Customize:)531 763 y Ft(sh$)692 763 y
+SDict begin H.S end
+ 692
+763 a 692 763 a
+SDict begin 11.7 H.A end
+ 692 763 a 692 763 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:62) cvn H.B /DEST pdfmark end
+ 692 763 a Fs(vi)41
+b(/etc/samhainrc)-2 1217 y
+SDict begin H.S end
+ -2 1217 a -2 1217 a
+SDict begin 13 H.A end
+ -2 1217
+a -2 1217 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:63) cvn H.B /DEST pdfmark end
+ -2 1217 a 396 1325 a FC(Initialize)20 b(the)g(baseline)g
+(database:)-2 1409 y
+SDict begin H.S end
+ -2 1409 a -2 1409 a
+SDict begin 11.7 H.A end
+ -2 1409 a -2
+1409 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:64) cvn H.B /DEST pdfmark end
+ -2 1409 a 531 1505 a
+SDict begin H.S end
+ 531 1505 a 531 1505 a
+SDict begin 11.7 H.A end
+ 531
+1505 a 531 1505 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:65) cvn H.B /DEST pdfmark end
+ 531 1505 a Ft(sh$)692 1505 y
+SDict begin H.S end
+ 692 1505
+a 692 1505 a
+SDict begin 11.7 H.A end
+ 692 1505 a 692 1505 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:66) cvn H.B /DEST pdfmark end
+ 692 1505 a Fs(samhain)43
+b(-t)e(init)-2 1959 y
+SDict begin H.S end
+ -2 1959 a -2 1959 a
+SDict begin 13 H.A end
+ -2 1959 a -2
+1959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:67) cvn H.B /DEST pdfmark end
+ -2 1959 a 396 2067 a FC(Start)21 b(the)f(samhain)g(daemon:)-2
+2151 y
+SDict begin H.S end
+ -2 2151 a -2 2151 a
+SDict begin 11.7 H.A end
+ -2 2151 a -2 2151 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:68) cvn H.B /DEST pdfmark end
+ -2 2151
+a 531 2247 a
+SDict begin H.S end
+ 531 2247 a 531 2247 a
+SDict begin 11.7 H.A end
+ 531 2247 a 531 2247
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:69) cvn H.B /DEST pdfmark end
+ 531 2247 a Ft(sh$)692 2247 y
+SDict begin H.S end
+ 692 2247 a 692 2247 a
+SDict begin 11.7 H.A end
+
+692 2247 a 692 2247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:70) cvn H.B /DEST pdfmark end
+ 692 2247 a Fs(samhain)43 b(-t)e(check)h(-D)-2
+2545 y
+SDict begin H.S end
+ -2 2545 a -2 2545 a
+SDict begin 13 H.A end
+ -2 2545 a -2 2545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-REQUIREMENTS)
+cvn H.B /DEST pdfmark end
+ -2 2545
+a 378 x Fu(2.2.)d(Requirements)1237 2923 y
+SDict begin H.S end
+ 1237 2923
+a 1237 2923 a
+SDict begin 22.464 H.A end
+ 1237 2923 a 1237 2923 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.2.1) cvn H.B /DEST pdfmark
+end
+ 1237 2923 a -2
+3119 a
+SDict begin H.S end
+ -2 3119 a -2 3119 a
+SDict begin 13 H.A end
+ -2 3119 a -2 3119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:73) cvn H.B /DEST pdfmark end
+ -2 3119
+a -2 3119 a
+SDict begin H.S end
+ -2 3119 a -2 3119 a
+SDict begin 13 H.A end
+ -2 3119 a -2 3119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:74) cvn H.B /DEST pdfmark end
+ -2
+3119 a -2 3243 a
+SDict begin H.S end
+ -2 3243 a -2 3243 a
+SDict begin 13 H.A end
+ -2 3243 a -2 3243
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:76) cvn H.B /DEST pdfmark end
+ -2 3243 a 396 3321 a FC(POSIX)21 b(en)m(vironment)-2
+3322 y
+SDict begin H.S end
+ -2 3322 a -2 3322 a
+SDict begin 13 H.A end
+ -2 3322 a -2 3322 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:77) cvn H.B /DEST pdfmark end
+ -2 3322
+a Black Black 562 3471 a
+SDict begin H.S end
+ 562 3471 a 562 3471 a
+SDict begin 13 H.A end
+ 562 3471
+a 562 3471 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:78) cvn H.B /DEST pdfmark end
+ 562 3471 a 562 3471 a
+SDict begin H.S end
+ 562 3471 a 562 3471
+a
+SDict begin 13 H.A end
+ 562 3471 a 562 3471 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:79) cvn H.B /DEST pdfmark end
+ 562 3471 a FC(Samhain)f(will)h(only)e(compile)g
+(and)h(run)f(in)i(a)1895 3471 y
+SDict begin H.S end
+ 1895 3471 a 1895 3471
+a
+SDict begin 13 H.A end
+ 1895 3471 a 1895 3471 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:80) cvn H.B /DEST pdfmark end
+ 1895 3471 a Fx(POSIX)i FC(operating)18
+b(system,)j(or)f(an)g(emulation)f(thereof)f(\(e.g.)562
+3579 y(the)j(free)834 3579 y
+SDict begin H.S end
+ 834 3579 a 834 3579 a
+SDict begin 13 H.A end
+ 834
+3579 a 834 3579 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:81) cvn H.B /DEST pdfmark end
+ 834 3579 a FC(Cygwin)f(POSIX)h(emulation)d(for)i(W)m
+(indo)n(ws)g(XP/2000\).)-2 3680 y
+SDict begin H.S end
+ -2 3680 a -2 3680 a
+SDict begin 13 H.A end
+
+-2 3680 a -2 3680 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:83) cvn H.B /DEST pdfmark end
+ -2 3680 a 396 3770 a FC(ANSI)h(C)g(compiler)e(and)g
+(b)n(uild)h(system)-2 3788 y
+SDict begin H.S end
+ -2 3788 a -2 3788 a
+SDict begin 13 H.A end
+ -2 3788
+a -2 3788 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:84) cvn H.B /DEST pdfmark end
+ -2 3788 a Black Black 562 3919 a
+SDict begin H.S end
+ 562 3919
+a 562 3919 a
+SDict begin 13 H.A end
+ 562 3919 a 562 3919 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:85) cvn H.B /DEST pdfmark end
+ 562 3919 a FC(Y)-9
+b(ou)20 b(need)f(an)994 3919 y
+SDict begin H.S end
+ 994 3919 a 994 3919 a
+SDict begin 13 H.A end
+
+994 3919 a 994 3919 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:86) cvn H.B /DEST pdfmark end
+ 994 3919 a Fx(ANSI)h(C)h(compiler)g
+FC(to)g(compile)e(samhain.)g(The)2425 3919 y
+SDict begin H.S end
+ 2425 3919
+a 2425 3919 a
+SDict begin 13 H.A end
+ 2425 3919 a 2425 3919 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:87) cvn H.B /DEST pdfmark end
+ 2425 3919 a FC(GNU)i(C)g
+(compiler)e(\(GCC\))562 4027 y(\(http://www)-5 b(.gnu.or)o(g/softw)o
+(are/gcc)o(/gcc.)o(html\))14 b(from)19 b(the)2349 4027
+y
+SDict begin H.S end
+ 2349 4027 a 2349 4027 a
+SDict begin 13 H.A end
+ 2349 4027 a 2349 4027 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:88) cvn H.B /DEST pdfmark end
+ 2349
+4027 a FC(Free)h(Softw)o(are)f(F)o(oundation)f(\(FSF\))562
+4135 y(\(http://www)-5 b(.gnu.or)o(g/\))16 b(is)21 b(\002ne.)f(If)g
+(your)f(v)o(endor')-5 b(s)18 b(compiler)h(is)i(ANSI)g(compliant,)d(you)
+h(should)h(gi)n(v)o(e)f(it)i(a)562 4243 y(try)-5 b(,)20
+b(since)g(it)h(might)e(produce)g(f)o(aster)h(code.)f(Also)i(you)e(will)
+i(need)f(to)g(ha)n(v)o(e)f(standard)g(tools)i(lik)o(e)3393
+4243 y
+SDict begin H.S end
+ 3393 4243 a 3393 4243 a
+SDict begin 13 H.A end
+ 3393 4243 a 3393 4243
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:89) cvn H.B /DEST pdfmark end
+ 3393 4243 a FC(mak)o(e)f(in)562 4351 y(your)f(P)-8
+b(A)f(TH)21 b(\(the)f(POSIX)g(standard)f(actually)h(mandates)f(the)i
+(presence)e(of)h(the)2932 4351 y
+SDict begin H.S end
+ 2932 4351 a 2932 4351
+a
+SDict begin 13 H.A end
+ 2932 4351 a 2932 4351 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:90) cvn H.B /DEST pdfmark end
+ 2932 4351 a FC(mak)o(e)g(utility\).)-2
+4452 y
+SDict begin H.S end
+ -2 4452 a -2 4452 a
+SDict begin 13 H.A end
+ -2 4452 a -2 4452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:92) cvn H.B /DEST pdfmark end
+ -2 4452
+a 396 4542 a FC([OPTION)m(AL])f(GnuPG)-2 4555 y
+SDict begin H.S end
+ -2 4555
+a -2 4555 a
+SDict begin 13 H.A end
+ -2 4555 a -2 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:93) cvn H.B /DEST pdfmark end
+ -2 4555 a Black Black
+562 4691 a
+SDict begin H.S end
+ 562 4691 a 562 4691 a
+SDict begin 13 H.A end
+ 562 4691 a 562 4691
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:94) cvn H.B /DEST pdfmark end
+ 562 4691 a FC(If)h(you)g(w)o(ant)g(to)g(use)h(signed)e
+(con\002guration)f(and)h(database)h(\002les)h(\(this)g(is)g(an)f
+(optional)f(feature\),)3425 4691 y
+SDict begin H.S end
+ 3425 4691 a 3425 4691
+a
+SDict begin 13 H.A end
+ 3425 4691 a 3425 4691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:95) cvn H.B /DEST pdfmark end
+ 3425 4691 a FC(GnuPG)562 4799
+y(\(gpg\))g(must)h(be)g(installed.)-2 4959 y
+SDict begin H.S end
+ -2 4959
+a -2 4959 a
+SDict begin 13 H.A end
+ -2 4959 a -2 4959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-DOWNLOAD) cvn
+H.B /DEST pdfmark end
+ -2 4959 a Black 3703
+5805 a Fx(3)p Black eop end
+%%Page: 4 9
+TeXDict begin 4 8 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.4) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+-2 327 a Fu(2.3.)39 b(Do)n(wnload)e(and)i(e)n(xtract)1765
+327 y
+SDict begin H.S end
+ 1765 327 a 1765 327 a
+SDict begin 22.464 H.A end
+ 1765 327 a 1765 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.3.1) cvn H.B /DEST pdfmark
+end
+ 1765
+327 a -2 495 a
+SDict begin H.S end
+ -2 495 a -2 495 a
+SDict begin 13 H.A end
+ -2 495 a -2 495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:98) cvn H.B /DEST pdfmark end
+ -2
+495 a 396 601 a FC(The)20 b(current)f(v)o(ersion)g(of)1156
+601 y
+SDict begin H.S end
+ 1156 601 a 1156 601 a
+SDict begin 13 H.A end
+ 1156 601 a 1156 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:99) cvn H.B /DEST pdfmark end
+ 1156
+601 a FC(samhain)g(can)h(be)g(do)n(wnloaded)e(from)396
+709 y
+SDict begin H.S end
+ 396 709 a 396 709 a
+SDict begin 13 H.A end
+ 396 709 a 396 709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:100) cvn H.B /DEST pdfmark
+end
+ 396 709
+a FC(http://www)-5 b(.la-samhna.de/samhain/samhain-)o(cur)o(ren)o
+(t.tar)g(.gz)o(.)15 b(Older)20 b(v)o(ersions)f(of)2933
+709 y
+SDict begin H.S end
+ 2933 709 a 2933 709 a
+SDict begin 13 H.A end
+ 2933 709 a 2933 709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:101) cvn H.B /DEST pdfmark
+end
+ 2933
+709 a FC(samhain)g(are)h(a)n(v)n(ailable)396 817 y(from)f(the)701
+817 y
+SDict begin H.S end
+ 701 817 a 701 817 a
+SDict begin 13 H.A end
+ 701 817 a 701 817 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:102) cvn H.B /DEST pdfmark
+end
+ 701 817
+a FC(online)g(archi)n(v)o(e)g(\(http://www)-5 b
+(.la-samhna.de/samhain/arch)o(i)n(v)n(e.h)o(tml\).)14
+b(Y)-9 b(ou)20 b(should)f(al)o(w)o(ays)i(mak)o(e)396
+925 y(sure)f(that)h(you)e(ha)n(v)o(e)h(a)g(complete)f(and)h
+(unmodi\002ed)e(v)o(ersion)h(of)2297 925 y
+SDict begin H.S end
+ 2297 925 a
+2297 925 a
+SDict begin 13 H.A end
+ 2297 925 a 2297 925 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:103) cvn H.B /DEST pdfmark
+end
+ 2297 925 a FC(samhain.)g(This)h(can)g
+(be)g(done)g(by)f(v)o(erifying)f(the)396 1033 y(PGP)j(signature)e
+(\(see)i(belo)n(w\).)-2 1217 y
+SDict begin H.S end
+ -2 1217 a -2 1217 a
+SDict begin 13 H.A end
+ -2
+1217 a -2 1217 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:104) cvn H.B /DEST pdfmark
+end
+ -2 1217 a 396 1307 a FC(The)f(do)n(wnloaded)e(tarball)
+h(will)i(contain)f(e)o(xactly)f(tw)o(o)h(\002les:)2225
+1307 y
+SDict begin H.S end
+ 2225 1307 a 2225 1307 a
+SDict begin 13 H.A end
+ 2225 1307 a 2225 1307
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:105) cvn H.B /DEST pdfmark
+end
+ 2225 1307 a -2 1335 a
+SDict begin H.S end
+ -2 1335 a -2 1335 a
+SDict begin 13 H.A end
+ -2 1335 a
+-2 1335 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:106) cvn H.B /DEST pdfmark
+end
+ -2 1335 a Black 463 1477 a FC(1.)p Black 546
+1477 a
+SDict begin H.S end
+ 546 1477 a 546 1477 a
+SDict begin 13 H.A end
+ 546 1477 a 546 1477 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:107) cvn H.B /DEST pdfmark
+end
+ 546
+1477 a FC(A)g(tarball)g(named)f(samhain-N.N.N.tar)-5
+b(.gz)18 b(\(N.N.N)h(is)j(the)e(v)o(ersion)f(number\))f(containing)g
+(the)i(source)546 1585 y(tree,)g(and)-2 1597 y
+SDict begin H.S end
+ -2 1597
+a -2 1597 a
+SDict begin 13 H.A end
+ -2 1597 a -2 1597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:108) cvn H.B /DEST pdfmark
+end
+ -2 1597 a Black 463 1734
+a FC(2.)p Black 546 1734 a
+SDict begin H.S end
+ 546 1734 a 546 1734 a
+SDict begin 13 H.A end
+ 546
+1734 a 546 1734 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:109) cvn H.B /DEST pdfmark
+end
+ 546 1734 a FC(the)g(PGP)h(signature)e(for)h(this)g
+(tarball,)g(i.e.)g(a)h(\002le)g(named)e(samhain-N.N.N.tar)-5
+b(.gz.asc.)-2 1835 y
+SDict begin H.S end
+ -2 1835 a -2 1835 a
+SDict begin 11.7 H.A end
+ -2 1835 a -2
+1835 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:110) cvn H.B /DEST pdfmark
+end
+ -2 1835 a -2 1835 a
+SDict begin H.S end
+ -2 1835 a -2 1835 a
+SDict begin 11.7 H.A end
+ -2 1835
+a -2 1835 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:111) cvn H.B /DEST pdfmark
+end
+ -2 1835 a 396 1915 a Ft(sh$)558 1915 y
+SDict begin H.S end
+ 558
+1915 a 558 1915 a
+SDict begin 11.7 H.A end
+ 558 1915 a 558 1915 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:112) cvn H.B /DEST pdfmark
+end
+ 558 1915 a Fs(wget)41
+b(http://la-samhna.d)q(e/s)q(amh)q(ain)q(/s)q(amh)q(ain)q(-cu)q(rre)q
+(nt.)q(tar)q(.gz)-2 1924 y
+SDict begin H.S end
+ -2 1924 a -2 1924 a
+SDict begin 11.7 H.A end
+ -2 1924
+a -2 1924 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:113) cvn H.B /DEST pdfmark
+end
+ -2 1924 a 396 2012 a Ft(sh$)558 2012 y
+SDict begin H.S end
+ 558
+2012 a 558 2012 a
+SDict begin 11.7 H.A end
+ 558 2012 a 558 2012 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:114) cvn H.B /DEST pdfmark
+end
+ 558 2012 a Fs(gunzip)h
+(samhain-current.tar)q(.gz)47 b(|)41 b(tar)g(tvf)h(-)396
+2109 y Fr(-rw-r--r--)h(500/100)268 b(920753)44 b(2004-05-24)f(19:57:55)
+h(samhain-1.8.8.tar.gz)396 2206 y(-rw-r--r--)f(500/100)403
+b(189)44 b(2004-05-24)f(19:58:29)h(samhain-1.8.8.tar.gz.asc)-2
+2563 y
+SDict begin H.S end
+ -2 2563 a -2 2563 a
+SDict begin 13 H.A end
+ -2 2563 a -2 2563 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:115) cvn H.B /DEST pdfmark
+end
+ -2 2563
+a 396 2671 a FC(Y)-9 b(ou)20 b(might)f(wish)i(to)f(v)o(erify)f(the)h
+(PGP)h(signature)e(no)n(w)-5 b(,)19 b(in)i(order)e(to)h(mak)o(e)g(sure)
+g(that)g(you)f(ha)n(v)o(e)h(recei)n(v)o(ed)f(a)396 2779
+y(complete)g(and)h(unmodi\002ed)e(v)o(ersion)h(of)1615
+2779 y
+SDict begin H.S end
+ 1615 2779 a 1615 2779 a
+SDict begin 13 H.A end
+ 1615 2779 a 1615 2779
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:116) cvn H.B /DEST pdfmark
+end
+ 1615 2779 a FC(samhain.)g(All)2060 2779 y
+SDict begin H.S end
+ 2060 2779
+a 2060 2779 a
+SDict begin 13 H.A end
+ 2060 2779 a 2060 2779 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:117) cvn H.B /DEST pdfmark
+end
+ 2060 2779 a FC(samhain)g
+(releases)i(are)f(signed)g(with)g(the)g(k)o(e)o(y)396
+2887 y(0F571F6C)f(\(Rainer)h(W)m(ichmann\).)-2 3068 y
+SDict begin H.S end
+
+-2 3068 a -2 3068 a
+SDict begin 13 H.A end
+ -2 3068 a -2 3068 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:118) cvn H.B /DEST pdfmark
+end
+ -2 3068 a 396
+3161 a FC(K)n(e)o(y)g(\002ngerprint)e(=)j(EF6C)f(EF54)g(701A)f(0AFD)i
+(B86A)f(F4C3)g(1AAD)g(26C8)g(0F57)f(1F6C)-2 3262 y
+SDict begin H.S end
+ -2
+3262 a -2 3262 a
+SDict begin 11.7 H.A end
+ -2 3262 a -2 3262 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:119) cvn H.B /DEST pdfmark
+end
+ -2 3262 a -2 3262
+a
+SDict begin H.S end
+ -2 3262 a -2 3262 a
+SDict begin 11.7 H.A end
+ -2 3262 a -2 3262 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:120) cvn H.B /DEST pdfmark
+end
+ -2 3262 a 396
+3341 a Ft(sh$)558 3341 y
+SDict begin H.S end
+ 558 3341 a 558 3341 a
+SDict begin 11.7 H.A end
+ 558 3341
+a 558 3341 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:121) cvn H.B /DEST pdfmark
+end
+ 558 3341 a Fs(gpg)41 b(--keyserver)j(blackhole.pca.dfn.)q
+(de)j(--recv-keys)d(0F571F6C)-2 3350 y
+SDict begin H.S end
+ -2 3350 a -2 3350
+a
+SDict begin 11.7 H.A end
+ -2 3350 a -2 3350 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:122) cvn H.B /DEST pdfmark
+end
+ -2 3350 a 396 3438 a Ft(sh$)558
+3438 y
+SDict begin H.S end
+ 558 3438 a 558 3438 a
+SDict begin 11.7 H.A end
+ 558 3438 a 558 3438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:123) cvn H.B /DEST pdfmark
+end
+ 558
+3438 a Fs(gpg)d(--verify)i(samhain-N.N.N.tar.g)q(z.)q(asc)k
+(samhain-1.8.8.tar.g)q(z)-2 3613 y
+SDict begin H.S end
+ -2 3613 a -2 3613
+a
+SDict begin 13 H.A end
+ -2 3613 a -2 3613 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:124) cvn H.B /DEST pdfmark
+end
+ -2 3613 a 396 3712 a FC(No)n(w)20
+b(you)g(can)g(proceed)e(to)i(e)o(xtract)g(the)g(source)g(tarball:)-2
+3813 y
+SDict begin H.S end
+ -2 3813 a -2 3813 a
+SDict begin 11.7 H.A end
+ -2 3813 a -2 3813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:125) cvn H.B /DEST pdfmark
+end
+ -2 3813
+a -2 3813 a
+SDict begin H.S end
+ -2 3813 a -2 3813 a
+SDict begin 11.7 H.A end
+ -2 3813 a -2 3813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:126) cvn H.B /DEST pdfmark
+end
+ -2
+3813 a 396 3892 a Ft(sh$)558 3892 y
+SDict begin H.S end
+ 558 3892 a 558 3892
+a
+SDict begin 11.7 H.A end
+ 558 3892 a 558 3892 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:127) cvn H.B /DEST pdfmark
+end
+ 558 3892 a Fs(gunzip)42 b(samhain-N.N.N.tar.g)q
+(z)k(|)41 b(tar)h(tvf)f(-)-2 4075 y
+SDict begin H.S end
+ -2 4075 a -2 4075
+a
+SDict begin 13 H.A end
+ -2 4075 a -2 4075 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:128) cvn H.B /DEST pdfmark
+end
+ -2 4075 a 396 4166 a FC(This)21
+b(will)g(create)e(a)i(ne)n(w)f(subdirectory)1584 4166
+y
+SDict begin H.S end
+ 1584 4166 a 1584 4166 a
+SDict begin 13 H.A end
+ 1584 4166 a 1584 4166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:129) cvn H.B /DEST pdfmark
+end
+ 1584
+4166 a Fr(samhain-N.N.N)e FC(under)h(your)g(current)g(directory)-5
+b(.)18 b(Y)-9 b(ou)19 b(should)3559 4166 y
+SDict begin H.S end
+ 3559 4166
+a 3559 4166 a
+SDict begin 13 H.A end
+ 3559 4166 a 3559 4166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:130) cvn H.B /DEST pdfmark
+end
+ 3559 4166 a Fy(cd)396
+4274 y FC(into)h(this)h(subdirectory)d(to)i(proceed)f(with)h
+(con\002guring)d(the)k(source:)-2 4375 y
+SDict begin H.S end
+ -2 4375 a -2
+4375 a
+SDict begin 11.7 H.A end
+ -2 4375 a -2 4375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:131) cvn H.B /DEST pdfmark
+end
+ -2 4375 a -2 4375 a
+SDict begin H.S end
+ -2 4375
+a -2 4375 a
+SDict begin 11.7 H.A end
+ -2 4375 a -2 4375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:132) cvn H.B /DEST pdfmark
+end
+ -2 4375 a 396 4454 a
+Ft(sh$)558 4454 y
+SDict begin H.S end
+ 558 4454 a 558 4454 a
+SDict begin 11.7 H.A end
+ 558 4454 a 558
+4454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:133) cvn H.B /DEST pdfmark
+end
+ 558 4454 a Fs(cd)41 b(samhain-N.N.N)-2 4545 y
+SDict begin H.S end
+
+-2 4545 a -2 4545 a
+SDict begin 13 H.A end
+ -2 4545 a -2 4545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-CONFIGURE) cvn
+H.B /DEST pdfmark end
+ -2 4545 a 369
+x Fu(2.4.)e(Con\002guring)e(the)i(sour)m(ce)1854 4914
+y
+SDict begin H.S end
+ 1854 4914 a 1854 4914 a
+SDict begin 22.464 H.A end
+ 1854 4914 a 1854 4914 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.4.1) cvn H.B /DEST pdfmark
+end
+ 1854
+4914 a -2 5112 a
+SDict begin H.S end
+ -2 5112 a -2 5112 a
+SDict begin 13 H.A end
+ -2 5112 a -2 5112
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:136) cvn H.B /DEST pdfmark
+end
+ -2 5112 a 396 5188 a FC(Before)20 b(you)f(can)h(start)h(to)f
+(compile,)f(it)i(is)g(neccessary)f(to)g(con\002gure)e(the)j(source)e
+(for)h(your)e(particular)h(platform)396 5296 y(and)h(your)f(personal)g
+(requirements.)f(This)i(is)h(done)e(by)h(running)e(the)2418
+5296 y
+SDict begin H.S end
+ 2418 5296 a 2418 5296 a
+SDict begin 13 H.A end
+ 2418 5296 a 2418 5296
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:137) cvn H.B /DEST pdfmark
+end
+ 2418 5296 a Fr(configure)i FC(in)g(the)g(source)g(directory)-5
+b(.)18 b(If)396 5404 y(you)i(type)705 5404 y
+SDict begin H.S end
+ 705 5404
+a 705 5404 a
+SDict begin 13 H.A end
+ 705 5404 a 705 5404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:138) cvn H.B /DEST pdfmark
+end
+ 705 5404 a Fy(./con\002gur)o(e)f
+FC(with)i(no)f(options,)f(the)h(source)f(will)i(get)f(con\002gured)e
+(with)j(the)f(def)o(ault)f(options.)g(In)p Black 3703
+5805 a Fx(4)p Black eop end
+%%Page: 5 10
+TeXDict begin 5 9 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black 0
+TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.5) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+396 309 a FC(particular)m(,)f(a)h(standalone)f(v)o(ersion)g(of)1540
+309 y
+SDict begin H.S end
+ 1540 309 a 1540 309 a
+SDict begin 13 H.A end
+ 1540 309 a 1540 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:139) cvn H.B /DEST pdfmark
+end
+ 1540
+309 a FC(samhain)g(will)i(get)f(b)n(uilt)h(which)f(uses)g(the)g
+(Filesystem)h(Hierarchy)396 417 y(Standard)e(\(FHS\))h(for)g
+(\002le/directory)f(layout.)g(This)h(is)2001 417 y
+SDict begin H.S end
+ 2001
+417 a 2001 417 a
+SDict begin 13 H.A end
+ 2001 417 a 2001 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:140) cvn H.B /DEST pdfmark
+end
+ 2001 417 a Fx(not)i
+FC(the)e(standard)f(GNU)h(layout)g(of)g('e)n(v)o(erything)d(under)396
+525 y(/usr/local'.)-2 691 y
+SDict begin H.S end
+ -2 691 a -2 691 a
+SDict begin 13 H.A end
+ -2 691
+a -2 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:141) cvn H.B /DEST pdfmark
+end
+ -2 691 a 396 799 a FC(T)-7 b(o)21 b(change)d(the)j(def)o
+(aults,)1184 799 y
+SDict begin H.S end
+ 1184 799 a 1184 799 a
+SDict begin 13 H.A end
+ 1184 799 a 1184
+799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:142) cvn H.B /DEST pdfmark
+end
+ 1184 799 a Fy(./con\002gur)o(e)e FC(accepts)h(a)h(v)n(ariety)e
+(of)h(command-line)e(options)h(and)h(en)m(vironment)396
+906 y(v)n(ariables)g(\(use)874 906 y
+SDict begin H.S end
+ 874 906 a 874 906
+a
+SDict begin 13 H.A end
+ 874 906 a 874 906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:143) cvn H.B /DEST pdfmark
+end
+ 874 906 a Fy(./con\002gur)o(e)f(--help)h
+FC(for)g(a)g(complete)f(list\).)i(The)f(a)n(v)n(ailable)g(command)e
+(line)i(options)f(are)i(listed)396 1014 y(and)f(e)o(xplained)e(in)p
+0 TeXcolorgray 965 1014 a
+SDict begin H.S end
+ 965 1014 a FC(Appendix)g(A)1373
+1014 y
+SDict begin 13 H.L end
+ 1373 1014 a 1373 1014 a
+SDict begin [ /Subtype /Link /Dest (0:COMPILATION-OPTIONS) cvn /H /I
+/Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1373 1014 a Black FC(>.)-2
+1032 y
+SDict begin H.S end
+ -2 1032 a -2 1032 a
+SDict begin 11.7 H.A end
+ -2 1032 a -2 1032 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:145) cvn H.B /DEST pdfmark
+end
+ -2 1032
+a -2 1157 a
+SDict begin H.S end
+ -2 1157 a -2 1157 a
+SDict begin 11.7 H.A end
+ -2 1157 a -2 1157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:147) cvn H.B /DEST pdfmark
+end
+ -2
+1157 a 562 1236 a Fw(P)n(aths:)h Fv(\(A\))930 1236 y
+SDict begin H.S end
+
+930 1236 a 930 1236 a
+SDict begin 11.7 H.A end
+ 930 1236 a 930 1236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:148) cvn H.B /DEST pdfmark
+end
+ 930 1236
+a Fv(samhain)g(is)h(a)h(Filesystem)e(Hier)o(arch)n(y)h(Standard)e
+(\(FHS\))i(compliant)e(application.)f(Thus)j(the)562
+1333 y(def)n(ault)e(director)r(y)i(la)n(y)o(out)e(is)1406
+1333 y
+SDict begin H.S end
+ 1406 1333 a 1406 1333 a
+SDict begin 11.7 H.A end
+ 1406 1333 a 1406 1333
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:149) cvn H.B /DEST pdfmark
+end
+ 1406 1333 a Fq(not)26 b Fv(the)20 b(standard)e(GNU)j(la)n(y)o(out)d
+(\(see)p 0 TeXcolorgray 2543 1333 a
+SDict begin H.S end
+ 2543 1333 a Fv(Section)g(2.10)2959
+1333 y
+SDict begin 11.7 H.L end
+ 2959 1333 a 2959 1333 a
+SDict begin [ /Subtype /Link /Dest (0:LAYOUT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2959 1333 a Black -1 w
+Fv(>\).)-2 1390 y
+SDict begin H.S end
+ -2 1390 a -2 1390 a
+SDict begin 11.7 H.A end
+ -2 1390 a -2 1390
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:151) cvn H.B /DEST pdfmark
+end
+ -2 1390 a 562 1472 a Fv(\(B\))683 1472 y
+SDict begin H.S end
+ 683 1472 a
+683 1472 a
+SDict begin 11.7 H.A end
+ 683 1472 a 683 1472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:152) cvn H.B /DEST pdfmark
+end
+ 683 1472 a Fv(samhain)h(has)h(a)g
+(concept)g(of)1555 1472 y
+SDict begin H.S end
+ 1555 1472 a 1555 1472 a
+SDict begin 11.7 H.A end
+ 1555
+1472 a 1555 1472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:153) cvn H.B /DEST pdfmark
+end
+ 1555 1472 a Fq(tr)q(usted)f(users)r
+Fv(,)i(and)e(will)g(refuse)h(to)g(r)q(un)g(if)g(the)g(path)f(to)h(cr)q
+(itical)f(\002les)i(is)562 1569 y(wr)q(iteab)o(le)d(b)o(y)i(users)g
+(not)g(in)g(its)g(list)g(of)g(tr)q(usted)g(users)g(\(def)n(ault:)e
+(root,)h(and)g(the)h(user)g(who)g(has)g(star)s(ted)562
+1666 y
+SDict begin H.S end
+ 562 1666 a 562 1666 a
+SDict begin 11.7 H.A end
+ 562 1666 a 562 1666 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:154) cvn H.B /DEST pdfmark
+end
+ 562
+1666 a Fv(samhain\).)f(Please)g(read)p 0 TeXcolorgray
+1331 1666 a
+SDict begin H.S end
+ 1331 1666 a Fv(Section)g(2.10.1)1811 1666
+y
+SDict begin 11.7 H.L end
+ 1811 1666 a 1811 1666 a
+SDict begin [ /Subtype /Link /Dest (0:DEFTRUST) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1811 1666 a Black -3 w Fv(>)i(f)n(or)e
+(details)o(.)-2 1982 y
+SDict begin H.S end
+ -2 1982 a -2 1982 a
+SDict begin 13 H.A end
+ -2 1982 a
+-2 1982 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:156) cvn H.B /DEST pdfmark
+end
+ -2 1982 a 396 2090 a FC(Also,)i(if)f(you)f(w)o(ant)i(to)f
+(use)g(an)o(y)g(options/modules)e(that)i(are)g(not)g(enabled)f(by)h
+(def)o(ault)f(\(e.g.)g(because)h(the)o(y)396 2197 y(require)f
+(additional)g(programs)f(and/or)h(libraries\),)g(at)i(this)g(point)e
+(you)h(need)f(to)h(specify)g(them.)f(This)i(is)g(true)f(in)396
+2305 y(particular)f(if)h(you)f(w)o(ant)g(to)h(use)g(signed)f
+(con\002guration)e(and)j(database)f(\002les)h(\(see)p
+0 TeXcolorgray 2806 2305 a
+SDict begin H.S end
+ 2806 2305 a FC(Chapter)g(8)3132
+2305 y
+SDict begin 13 H.L end
+ 3132 2305 a 3132 2305 a
+SDict begin [ /Subtype /Link /Dest (0:SIGNED-FILES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3132 2305 a Black FC(>\),)f(use)h(the)g
+(options)396 2413 y(for)g(a)g(stealth)h(mode)e(of)h(operation)e(\(see)p
+0 TeXcolorgray 1593 2413 a
+SDict begin H.S end
+ 1593 2413 a FC(Chapter)h(9)1918
+2413 y
+SDict begin 13 H.L end
+ 1918 2413 a 1918 2413 a
+SDict begin [ /Subtype /Link /Dest (0:STEALTHMODE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1918 2413 a Black FC(>\),)h(log)g(to)g
+(a)h(relational)e(database)h(\(--enable-xml-log)396 2521
+y(--with-database=[mysql|postgresql|o)o(rac)o(le|od)o(bc)o(]\),)14
+b(w)o(atch)20 b(for)g(login/logout)e(e)n(v)o(ents)396
+2629 y(\(--enable-login-w)o(atch\),)d(check)20 b(the)g(disk)g(for)g
+(rogue)f(SUID/SGID)h(\002les)h(\(--enable-suidcheck\))16
+b(and/or)i(check)396 2737 y(for)i(k)o(ernel)f(rootkits)h(\(on)f
+(Linux/FreeBSD;)g(--with-kcheck=SYSTEM_MAP\).)-2 2918
+y
+SDict begin H.S end
+ -2 2918 a -2 2918 a
+SDict begin 13 H.A end
+ -2 2918 a -2 2918 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:159) cvn H.B /DEST pdfmark
+end
+ -2 2918 a 396
+3011 a FC(T)-7 b(o)21 b(con\002gure)d(a)j(standalone)d(v)o(ersion)h(of)
+1624 3011 y
+SDict begin H.S end
+ 1624 3011 a 1624 3011 a
+SDict begin 13 H.A end
+ 1624 3011 a 1624
+3011 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:160) cvn H.B /DEST pdfmark
+end
+ 1624 3011 a FC(samhain:)-2 3112 y
+SDict begin H.S end
+ -2 3112 a -2
+3112 a
+SDict begin 11.7 H.A end
+ -2 3112 a -2 3112 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:161) cvn H.B /DEST pdfmark
+end
+ -2 3112 a -2 3112 a
+SDict begin H.S end
+ -2 3112
+a -2 3112 a
+SDict begin 11.7 H.A end
+ -2 3112 a -2 3112 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:162) cvn H.B /DEST pdfmark
+end
+ -2 3112 a 396 3191 a
+Ft(sh$)558 3191 y
+SDict begin H.S end
+ 558 3191 a 558 3191 a
+SDict begin 11.7 H.A end
+ 558 3191 a 558
+3191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:163) cvn H.B /DEST pdfmark
+end
+ 558 3191 a Fs(./configure)44 b([more)e(options])-2
+3548 y
+SDict begin H.S end
+ -2 3548 a -2 3548 a
+SDict begin 13 H.A end
+ -2 3548 a -2 3548 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:164) cvn H.B /DEST pdfmark
+end
+ -2 3548
+a 396 3656 a FC(T)-7 b(o)21 b(con\002gure)d(a)j(client)f(v)o(ersion)f
+(of)1454 3656 y
+SDict begin H.S end
+ 1454 3656 a 1454 3656 a
+SDict begin 13 H.A end
+ 1454 3656 a 1454
+3656 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:165) cvn H.B /DEST pdfmark
+end
+ 1454 3656 a FC(samhain)g(that)h(can)g(connect)f(to)i(a)f
+(central)g(serv)o(er:)-2 3757 y
+SDict begin H.S end
+ -2 3757 a -2 3757 a
+SDict begin 11.7 H.A end
+ -2
+3757 a -2 3757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:166) cvn H.B /DEST pdfmark
+end
+ -2 3757 a -2 3757 a
+SDict begin H.S end
+ -2 3757 a -2 3757
+a
+SDict begin 11.7 H.A end
+ -2 3757 a -2 3757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:167) cvn H.B /DEST pdfmark
+end
+ -2 3757 a 396 3836 a Ft(sh$)558
+3836 y
+SDict begin H.S end
+ 558 3836 a 558 3836 a
+SDict begin 11.7 H.A end
+ 558 3836 a 558 3836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:168) cvn H.B /DEST pdfmark
+end
+ 558
+3836 a Fs(./configure)44 b(--enable-network=cli)q(en)q(t)i([more)c
+(options])-2 4193 y
+SDict begin H.S end
+ -2 4193 a -2 4193 a
+SDict begin 13 H.A end
+ -2 4193 a -2
+4193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:169) cvn H.B /DEST pdfmark
+end
+ -2 4193 a 396 4301 a FC(T)-7 b(o)21 b(con\002gure)d(a)j(serv)o
+(er)e(v)o(ersion)g(of)1471 4301 y
+SDict begin H.S end
+ 1471 4301 a 1471 4301
+a
+SDict begin 13 H.A end
+ 1471 4301 a 1471 4301 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:170) cvn H.B /DEST pdfmark
+end
+ 1471 4301 a FC(samhain)g(that)h(will)h(act)g
+(as)g(a)f(central)g(log)g(serv)o(er:)-2 4402 y
+SDict begin H.S end
+ -2 4402
+a -2 4402 a
+SDict begin 11.7 H.A end
+ -2 4402 a -2 4402 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:171) cvn H.B /DEST pdfmark
+end
+ -2 4402 a -2 4402 a
+SDict begin H.S end
+ -2
+4402 a -2 4402 a
+SDict begin 11.7 H.A end
+ -2 4402 a -2 4402 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:172) cvn H.B /DEST pdfmark
+end
+ -2 4402 a 396 4481
+a Ft(sh$)558 4481 y
+SDict begin H.S end
+ 558 4481 a 558 4481 a
+SDict begin 11.7 H.A end
+ 558 4481 a
+558 4481 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:173) cvn H.B /DEST pdfmark
+end
+ 558 4481 a Fs(./configure)44 b(--enable-network=ser)q(ve)q
+(r)i([more)c(options])-2 4490 y
+SDict begin H.S end
+ -2 4490 a -2 4490 a
+SDict begin 11.7 H.A end
+ -2
+4490 a -2 4490 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:174) cvn H.B /DEST pdfmark
+end
+ -2 4490 a Black 3703 5805 a Fx(5)p Black
+eop end
+%%Page: 6 11
+TeXDict begin 6 10 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.6) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:212) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2538 104 a Fx(Chapter)20
+b(2.)g(Compiling)f(and)h(installing)p Black 977 242 2668
+17 v 977 1212 17 970 v 1945 437 a Fp(IMPOR)n(T)-11 b(ANT)-5
+b(:)1019 605 y
+SDict begin H.S end
+ 1019 605 a 1019 605 a
+SDict begin 11.7 H.A end
+ 1019 605 a 1019
+605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:176) cvn H.B /DEST pdfmark
+end
+ 1019 605 a 96 x Fv(Please)19 b(read)p 0 TeXcolorgray
+1438 701 a
+SDict begin H.S end
+ 1438 701 a Fv(Chapter)g(6)1767 701 y
+SDict begin 11.7 H.L end
+ 1767
+701 a 1767 701 a
+SDict begin [ /Subtype /Link /Dest (0:YULE) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1767 701 a Black -1 w Fv(>)i(if)f(y)o(ou)g(intend)e
+(to)i(use)2477 701 y
+SDict begin H.S end
+ 2477 701 a 2477 701 a
+SDict begin 11.7 H.A end
+ 2477 701 a
+2477 701 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:178) cvn H.B /DEST pdfmark
+end
+ 2477 701 a Fv(samhain)f(as)i(a)f(client/ser)r(v)n(er)1019
+798 y(system.)h(Things)e(will)h(not)f(w)o(or)q(k)i(automagically)d
+(just)i(because)f(y)o(ou)h(compiled)e(a)j(client)1019
+895 y(and)e(a)i(ser)r(v)n(er)f(v)n(ersion)g(of)1798 895
+y
+SDict begin H.S end
+ 1798 895 a 1798 895 a
+SDict begin 11.7 H.A end
+ 1798 895 a 1798 895 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:179) cvn H.B /DEST pdfmark
+end
+ 1798 895
+a Fv(samhain.)f(In)h(par)s(ticular)l(,)e(clients)i(need)f(to)3056
+895 y
+SDict begin H.S end
+ 3056 895 a 3056 895 a
+SDict begin 11.7 H.A end
+ 3056 895 a 3056 895 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:180) cvn H.B /DEST pdfmark
+end
+ 3056
+895 a Fq(authenticate)1019 992 y Fv(themselv)n(es)h(to)g(the)f(ser)r(v)
+n(er)l(,)i(and)f(special)f(con\002gure)g(options)g(are)g(required)f(if)
+i(y)o(ou)1019 1089 y(w)o(ant)f(to)h(k)o(eep)g(the)f(con\002gur)o(ation)
+f(\002le\(s\))j(and)e(the)h(baseline)e(database\(s\))g(on)i(the)1019
+1186 y(centr)o(al)f(ser)r(v)n(er)l(.)p 3628 1212 17 970
+v 977 1229 2668 17 v -2 1398 a
+SDict begin H.S end
+ -2 1398 a -2 1398 a
+SDict begin 13 H.A end
+ -2
+1398 a -2 1398 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-BUILD) cvn H.B
+/DEST pdfmark end
+ -2 1398 a 377 x Fu(2.5.)39 b(Build)637
+1775 y
+SDict begin H.S end
+ 637 1775 a 637 1775 a
+SDict begin 22.464 H.A end
+ 637 1775 a 637 1775 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.5.1) cvn H.B /DEST pdfmark
+end
+ 637
+1775 a -2 1943 a
+SDict begin H.S end
+ -2 1943 a -2 1943 a
+SDict begin 13 H.A end
+ -2 1943 a -2 1943
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:183) cvn H.B /DEST pdfmark
+end
+ -2 1943 a 396 2049 a FC(After)20 b(con\002guring)e(the)i(source,)f
+(to)i(b)n(uild)1651 2049 y
+SDict begin H.S end
+ 1651 2049 a 1651 2049 a
+SDict begin 13 H.A end
+ 1651
+2049 a 1651 2049 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:184) cvn H.B /DEST pdfmark
+end
+ 1651 2049 a FC(samhain)f(you)f(just)i(ha)n(v)o(e)e
+(to)i(type)e(the)i(command:)-2 2150 y
+SDict begin H.S end
+ -2 2150 a -2 2150
+a
+SDict begin 11.7 H.A end
+ -2 2150 a -2 2150 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:185) cvn H.B /DEST pdfmark
+end
+ -2 2150 a -2 2150 a
+SDict begin H.S end
+ -2 2150 a -2
+2150 a
+SDict begin 11.7 H.A end
+ -2 2150 a -2 2150 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:186) cvn H.B /DEST pdfmark
+end
+ -2 2150 a 396 2229 a Ft(sh$)558
+2229 y
+SDict begin H.S end
+ 558 2229 a 558 2229 a
+SDict begin 11.7 H.A end
+ 558 2229 a 558 2229 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:187) cvn H.B /DEST pdfmark
+end
+ 558
+2229 a Fs(make)-2 2586 y
+SDict begin H.S end
+ -2 2586 a -2 2586 a
+SDict begin 13 H.A end
+ -2 2586
+a -2 2586 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:188) cvn H.B /DEST pdfmark
+end
+ -2 2586 a 396 2694 a FC(The)f(standalone/client)f(e)o(x)o
+(ecutable)f(\()1531 2694 y
+SDict begin H.S end
+ 1531 2694 a 1531 2694 a
+SDict begin 13 H.A end
+ 1531
+2694 a 1531 2694 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:189) cvn H.B /DEST pdfmark
+end
+ 1531 2694 a FC(samhain\))h(and)g(the)h(log)g(serv)o
+(er)g(\()2496 2694 y
+SDict begin H.S end
+ 2496 2694 a 2496 2694 a
+SDict begin 13 H.A end
+ 2496 2694
+a 2496 2694 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:190) cvn H.B /DEST pdfmark
+end
+ 2496 2694 a FC(yule\))f(cannnot)f(be)i(compiled)396
+2802 y(simultaneously)-5 b(.)18 b(Y)-9 b(ou)20 b(need)f(to)i(run)1484
+2802 y
+SDict begin H.S end
+ 1484 2802 a 1484 2802 a
+SDict begin 13 H.A end
+ 1484 2802 a 1484 2802
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:191) cvn H.B /DEST pdfmark
+end
+ 1484 2802 a Fy(./con\002gur)o(e)e(&&)i(mak)o(e)g FC(separately)e(for)
+h(both.)-2 2986 y
+SDict begin H.S end
+ -2 2986 a -2 2986 a
+SDict begin 13 H.A end
+ -2 2986 a -2 2986
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:192) cvn H.B /DEST pdfmark
+end
+ -2 2986 a 396 3076 a FC(If)g(you)g(w)o(ant)g(to)g(use)h(your)e(nati)n
+(v)o(e)g(package)g(manager)f(for)i(installation,)f(you)h(might)f
+(rather)h(w)o(ant)g(to)g(b)n(uild)g(a)396 3184 y(binary)f(package.)943
+3184 y
+SDict begin H.S end
+ 943 3184 a 943 3184 a
+SDict begin 13 H.A end
+ 943 3184 a 943 3184 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:193) cvn H.B /DEST pdfmark
+end
+ 943
+3184 a FC(samhain)g(has)i(support)d(for)i(RPM)h(\(rpm\),)e(Debian)g
+(\(deb\),)g(Gentoo)g(\(tbz2\),)g(HP-UX)h(\(depot\),)396
+3292 y(and)g(Solaris)g(packages.)f(Instead)h(of)g(simply)f(typing)1964
+3292 y
+SDict begin H.S end
+ 1964 3292 a 1964 3292 a
+SDict begin 13 H.A end
+ 1964 3292 a 1964 3292
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:194) cvn H.B /DEST pdfmark
+end
+ 1964 3292 a Fy(mak)o(e)p FC(,)i(you)e(need)g(to)i(type:)-2
+3393 y
+SDict begin H.S end
+ -2 3393 a -2 3393 a
+SDict begin 11.7 H.A end
+ -2 3393 a -2 3393 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:195) cvn H.B /DEST pdfmark
+end
+ -2 3393
+a -2 3393 a
+SDict begin H.S end
+ -2 3393 a -2 3393 a
+SDict begin 11.7 H.A end
+ -2 3393 a -2 3393 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:196) cvn H.B /DEST pdfmark
+end
+ -2
+3393 a 396 3472 a Ft(sh$)558 3472 y
+SDict begin H.S end
+ 558 3472 a 558 3472
+a
+SDict begin 11.7 H.A end
+ 558 3472 a 558 3472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:197) cvn H.B /DEST pdfmark
+end
+ 558 3472 a Fs(make)41 b(rpm|deb|tbz2|depot)q
+(|so)q(lar)q(is-)q(pk)q(g)-2 3655 y
+SDict begin H.S end
+ -2 3655 a -2 3655
+a
+SDict begin 13 H.A end
+ -2 3655 a -2 3655 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:198) cvn H.B /DEST pdfmark
+end
+ -2 3655 a 396 3746 a FC(This)21
+b(will)g(create)e(a)i(custom)f(binary)f(package)f(according)g(to)j(the)
+f(options)f(that)i(you)e(used)h(when)f(con\002guring)396
+3854 y(the)h(source)g(\(see)g(pre)n(vious)f(section\).)g(F)o(or)h(more)
+f(details,)i(see)p 0 TeXcolorgray 2231 3854 a
+SDict begin H.S end
+ 2231 3854
+a FC(Section)e(10.2)2647 3854 y
+SDict begin 13 H.L end
+ 2647 3854 a 2647 3854
+a
+SDict begin [ /Subtype /Link /Dest (0:NATIVE-PACKAGES) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2647 3854 a Black -1 w FC(>.)-2 4038 y
+SDict begin H.S end
+ -2 4038 a -2
+4038 a
+SDict begin 13 H.A end
+ -2 4038 a -2 4038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:200) cvn H.B /DEST pdfmark
+end
+ -2 4038 a 396 4128 a FC(If)h(you)g(don')o(t)
+e(w)o(ant)i(to)h(include)e(documentation,)e(you)i(can)h(instead)g(use:)
+-2 4229 y
+SDict begin H.S end
+ -2 4229 a -2 4229 a
+SDict begin 11.7 H.A end
+ -2 4229 a -2 4229 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:201) cvn H.B /DEST pdfmark
+end
+ -2
+4229 a -2 4229 a
+SDict begin H.S end
+ -2 4229 a -2 4229 a
+SDict begin 11.7 H.A end
+ -2 4229 a -2 4229
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:202) cvn H.B /DEST pdfmark
+end
+ -2 4229 a 396 4308 a Ft(sh$)558 4308 y
+SDict begin H.S end
+ 558 4308 a 558
+4308 a
+SDict begin 11.7 H.A end
+ 558 4308 a 558 4308 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:203) cvn H.B /DEST pdfmark
+end
+ 558 4308 a Fs(make)41 b
+(rpm-light|deb-ligh)q(t|d)q(epo)q(t-l)q(ig)q(ht|)q(tbz)q(2-l)q(igh)q
+(t|s)q(ola)q(ris)q(-p)q(kg-)q(lig)q(ht)-2 4491 y
+SDict begin H.S end
+ -2 4491
+a -2 4491 a
+SDict begin 13 H.A end
+ -2 4491 a -2 4491 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:204) cvn H.B /DEST pdfmark
+end
+ -2 4491 a 396 4582 a
+FC(Finally)-5 b(,)20 b(the)g(Mak)o(e\002le)g(supports)f(b)n(uilding)g
+(a)i(portable)d(\(Unix\))h(binary)g(installer)i(package)d(based)i(on)g
+(the)396 4690 y
+SDict begin H.S end
+ 396 4690 a 396 4690 a
+SDict begin 13 H.A end
+ 396 4690 a 396
+4690 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:205) cvn H.B /DEST pdfmark
+end
+ 396 4690 a FC(mak)o(eself)g(installer)g(\(\(c\))g(1998-2004)c
+(Stephane)j(Peter\).)h(There)f(will)i(be)f(no)g(documentation)d
+(included.)i(Just)396 4798 y(type:)-2 4899 y
+SDict begin H.S end
+ -2 4899
+a -2 4899 a
+SDict begin 11.7 H.A end
+ -2 4899 a -2 4899 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:206) cvn H.B /DEST pdfmark
+end
+ -2 4899 a -2 4899 a
+SDict begin H.S end
+ -2
+4899 a -2 4899 a
+SDict begin 11.7 H.A end
+ -2 4899 a -2 4899 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:207) cvn H.B /DEST pdfmark
+end
+ -2 4899 a 396 4978
+a Ft(sh$)558 4978 y
+SDict begin H.S end
+ 558 4978 a 558 4978 a
+SDict begin 11.7 H.A end
+ 558 4978 a
+558 4978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:208) cvn H.B /DEST pdfmark
+end
+ 558 4978 a Fs(make)41 b(run)-2 5069 y
+SDict begin H.S end
+ -2 5069
+a -2 5069 a
+SDict begin 13 H.A end
+ -2 5069 a -2 5069 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-INSTALL) cvn H.B
+/DEST pdfmark end
+ -2 5069 a Black 3701
+5805 a Fx(6)p Black eop end
+%%Page: 7 12
+TeXDict begin 7 11 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.7) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:254) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2538 104 a Fx(Chapter)20
+b(2.)g(Compiling)f(and)h(installing)p Black -2 327 a
+Fu(2.6.)39 b(Install)693 327 y
+SDict begin H.S end
+ 693 327 a 693 327 a
+SDict begin 22.464 H.A end
+ 693
+327 a 693 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.6.1) cvn H.B /DEST pdfmark
+end
+ 693 327 a -2 495 a
+SDict begin H.S end
+ -2 495 a -2 495 a
+SDict begin 13 H.A end
+
+-2 495 a -2 495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:211) cvn H.B /DEST pdfmark
+end
+ -2 495 a 396 601 a FC(After)20 b(successful)g
+(compilation,)e(you)i(can)g(install)g(samhain)g(by)g(typing:)396
+781 y Ft(sh$)558 781 y
+SDict begin H.S end
+ 558 781 a 558 781 a
+SDict begin 11.7 H.A end
+ 558 781 a
+558 781 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:214) cvn H.B /DEST pdfmark
+end
+ 558 781 a Fs(make)41 b(install)-2 955 y
+SDict begin H.S end
+ -2
+955 a -2 955 a
+SDict begin 13 H.A end
+ -2 955 a -2 955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:215) cvn H.B /DEST pdfmark
+end
+ -2 955 a 396 1055 a
+FC(The)20 b(installation)g(routine)f(will)i(not)f(o)o(v)o(erwrite)e
+(your)h(con\002guration)e(\002le)k(from)e(a)i(pre)n(vious)e
+(installation.)-2 1239 y
+SDict begin H.S end
+ -2 1239 a -2 1239 a
+SDict begin 13 H.A end
+ -2 1239
+a -2 1239 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:216) cvn H.B /DEST pdfmark
+end
+ -2 1239 a 396 1329 a FC(Ex)o(ecutables)g(will)i(be)f
+(stripped)f(upon)g(installation.)h(On)g(Linux)f(i386)g(and)h(FreeBSD)h
+(i386,)e(the)3243 1329 y
+SDict begin H.S end
+ 3243 1329 a 3243 1329 a
+SDict begin 13 H.A end
+ 3243
+1329 a 3243 1329 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:217) cvn H.B /DEST pdfmark
+end
+ 3243 1329 a Fy(sstrip)i FC(utility)396
+1437 y(\(cop)o(yright)d(1999)h(by)h(Brian)g(Raiter)m(,)g(under)f(the)h
+(GNU)h(GPL\))f(will)h(be)f(used)g(to)g(strip)g(the)h(e)o(x)o(ecutable)d
+(e)n(v)o(en)396 1545 y(more,)h(to)i(pre)n(v)o(ent)d(deb)n(ugging)g
+(with)i(the)g(GNU)1821 1545 y
+SDict begin H.S end
+ 1821 1545 a 1821 1545 a
+SDict begin 13 H.A end
+
+1821 1545 a 1821 1545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:218) cvn H.B /DEST pdfmark
+end
+ 1821 1545 a Fy(gdb)g FC(deb)n(ugger)-5
+b(.)-2 1729 y
+SDict begin H.S end
+ -2 1729 a -2 1729 a
+SDict begin 13 H.A end
+ -2 1729 a -2 1729 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:219) cvn H.B /DEST pdfmark
+end
+
+-2 1729 a 396 1819 a FC(After)20 b(installation,)g(you)f(will)i(be)f
+(of)n(fered)e(to)j(run)1872 1819 y
+SDict begin H.S end
+ 1872 1819 a 1872 1819
+a
+SDict begin 13 H.A end
+ 1872 1819 a 1872 1819 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:220) cvn H.B /DEST pdfmark
+end
+ 1872 1819 a Fy(mak)o(e)g(install-boot)e
+FC(in)h(order)f(to)i(install)f(the)g(init)h(scripts)f(that)396
+1927 y(are)g(required)f(to)h(start)1065 1927 y
+SDict begin H.S end
+ 1065 1927
+a 1065 1927 a
+SDict begin 13 H.A end
+ 1065 1927 a 1065 1927 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:221) cvn H.B /DEST pdfmark
+end
+ 1065 1927 a FC(samhain)f
+(automatically)g(when)h(your)f(system)h(\(re-\)boots.)e(F)o(or)i(man)o
+(y)f(operating)396 2035 y(systems)i(\(Linux,)d(FreeBSD,)j(Solaris,)f
+(HP-UX,)g(IRIX\),)2105 2035 y
+SDict begin H.S end
+ 2105 2035 a 2105 2035 a
+SDict begin 13 H.A end
+
+2105 2035 a 2105 2035 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:222) cvn H.B /DEST pdfmark
+end
+ 2105 2035 a Fy(con\002gur)o(e)f
+FC(will)i(generate)e(init)i(scripts,)f(and)3439 2035
+y
+SDict begin H.S end
+ 3439 2035 a 3439 2035 a
+SDict begin 13 H.A end
+ 3439 2035 a 3439 2035 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:223) cvn H.B /DEST pdfmark
+end
+ 3439
+2035 a Fy(mak)o(e)396 2143 y(install-boot)f FC(will)i(\002gure)f(out)g
+(which)f(of)h(them)g(to)g(install,)h(and)e(where)h(\(if)g(the)g
+(correct)g(distrib)n(ution)f(cannot)g(be)396 2251 y(determined,)f(none)
+h(of)h(them)g(will)h(be)f(installed\).)-2 2349 y
+SDict begin H.S end
+ -2 2349
+a -2 2349 a
+SDict begin 11.7 H.A end
+ -2 2349 a -2 2349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:224) cvn H.B /DEST pdfmark
+end
+ -2 2349 a -2 2349 a
+SDict begin H.S end
+ -2
+2349 a -2 2349 a
+SDict begin 11.7 H.A end
+ -2 2349 a -2 2349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:225) cvn H.B /DEST pdfmark
+end
+ -2 2349 a 396 2431
+a Ft(sh$)558 2431 y
+SDict begin H.S end
+ 558 2431 a 558 2431 a
+SDict begin 11.7 H.A end
+ 558 2431 a
+558 2431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:226) cvn H.B /DEST pdfmark
+end
+ 558 2431 a Fs(make)41 b(install-boot)-2 2439
+y
+SDict begin H.S end
+ -2 2439 a -2 2439 a
+SDict begin 13 H.A end
+ -2 2439 a -2 2439 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:TARGETS) cvn H.B /DEST pdfmark
+end
+ -2 2439 a 396
+2759 a Fp(2.6.1.)36 b(Impor)r(tant)d(make)i(tar)n(g)q(ets)2051
+2759 y
+SDict begin H.S end
+ 2051 2759 a 2051 2759 a
+SDict begin 18.72 H.A end
+ 2051 2759 a 2051 2759
+a
+SDict begin [ /View [/XYZ H.V] /Dest (4.6.1.2) cvn H.B /DEST pdfmark
+end
+ 2051 2759 a -2 2869 a
+SDict begin H.S end
+ -2 2869 a -2 2869 a
+SDict begin 11.7 H.A end
+ -2 2869 a
+-2 2869 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:229) cvn H.B /DEST pdfmark
+end
+ -2 2869 a -2 2869 a
+SDict begin H.S end
+ -2 2869 a -2 2869 a
+SDict begin 11.7 H.A end
+ -2
+2869 a -2 2869 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:230) cvn H.B /DEST pdfmark
+end
+ -2 2869 a 396 2939 a Ft(sh$)558 2939
+y
+SDict begin H.S end
+ 558 2939 a 558 2939 a
+SDict begin 11.7 H.A end
+ 558 2939 a 558 2939 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:231) cvn H.B /DEST pdfmark
+end
+ 558 2939
+a Fs(make)41 b(install)-2 3113 y
+SDict begin H.S end
+ -2 3113 a -2 3113 a
+SDict begin 13 H.A end
+
+-2 3113 a -2 3113 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:232) cvn H.B /DEST pdfmark
+end
+ -2 3113 a 396 3213 a FC(Create)21
+b(the)f(required)e(directories)h(\(if)i(not)e(e)o(xisting)h(already\),)
+e(and)i(install)h(the)f(compiled)f(e)o(x)o(ecutable)f(and)i(the)396
+3321 y(con\002guration)e(\002le.)-2 3422 y
+SDict begin H.S end
+ -2 3422 a
+-2 3422 a
+SDict begin 11.7 H.A end
+ -2 3422 a -2 3422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:233) cvn H.B /DEST pdfmark
+end
+ -2 3422 a -2 3422 a
+SDict begin H.S end
+ -2
+3422 a -2 3422 a
+SDict begin 11.7 H.A end
+ -2 3422 a -2 3422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:234) cvn H.B /DEST pdfmark
+end
+ -2 3422 a 396 3501
+a Ft(bash$)638 3501 y
+SDict begin H.S end
+ 638 3501 a 638 3501 a
+SDict begin 11.7 H.A end
+ 638 3501
+a 638 3501 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:235) cvn H.B /DEST pdfmark
+end
+ 638 3501 a Fs(make)42 b(DESTDIR=/somedir)k(install)-2
+3675 y
+SDict begin H.S end
+ -2 3675 a -2 3675 a
+SDict begin 13 H.A end
+ -2 3675 a -2 3675 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:236) cvn H.B /DEST pdfmark
+end
+ -2 3675
+a 396 3775 a FC(Install)21 b(as)f(if)786 3775 y
+SDict begin H.S end
+ 786 3775
+a 786 3775 a
+SDict begin 13 H.A end
+ 786 3775 a 786 3775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:237) cvn H.B /DEST pdfmark
+end
+ 786 3775 a Fr(/somedir)f
+FC(is)j(the)e(root)f(directory)-5 b(.)18 b(Useful)i(for)g(creating)f
+(packages)g(or)h(installing)g(for)f(chroot)396 3883 y(\(serv)o(er\).)-2
+3981 y
+SDict begin H.S end
+ -2 3981 a -2 3981 a
+SDict begin 11.7 H.A end
+ -2 3981 a -2 3981 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:238) cvn H.B /DEST pdfmark
+end
+ -2 3981
+a -2 3981 a
+SDict begin H.S end
+ -2 3981 a -2 3981 a
+SDict begin 11.7 H.A end
+ -2 3981 a -2 3981 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:239) cvn H.B /DEST pdfmark
+end
+ -2
+3981 a 396 4063 a Ft(sh$)558 4063 y
+SDict begin H.S end
+ 558 4063 a 558 4063
+a
+SDict begin 11.7 H.A end
+ 558 4063 a 558 4063 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:240) cvn H.B /DEST pdfmark
+end
+ 558 4063 a Fs(make)41 b(install-boot)-2
+4237 y
+SDict begin H.S end
+ -2 4237 a -2 4237 a
+SDict begin 13 H.A end
+ -2 4237 a -2 4237 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:241) cvn H.B /DEST pdfmark
+end
+ -2 4237
+a 396 4337 a FC(Install)21 b(runle)n(v)o(el)d(start/stop)i(scripts)h
+(or)f(create)g(inittab)g(entry)f(\(AIX\))h(in)g(order)f(to)h(start)h
+(the)f(daemon)f(upon)396 4445 y(system)i(boot.)e(Supported)f(on)i
+(Linux,)e(FreeBSD,)j(Solaris\(*\),)e(HP-UX\(*\),)g(AIX\(*\),)g
+(IRIX\(*\))g([\(*\))g(untested].)-2 4546 y
+SDict begin H.S end
+ -2 4546 a
+-2 4546 a
+SDict begin 11.7 H.A end
+ -2 4546 a -2 4546 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:242) cvn H.B /DEST pdfmark
+end
+ -2 4546 a -2 4546 a
+SDict begin H.S end
+ -2
+4546 a -2 4546 a
+SDict begin 11.7 H.A end
+ -2 4546 a -2 4546 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:243) cvn H.B /DEST pdfmark
+end
+ -2 4546 a 396 4625
+a Ft(sh$)558 4625 y
+SDict begin H.S end
+ 558 4625 a 558 4625 a
+SDict begin 11.7 H.A end
+ 558 4625 a
+558 4625 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:244) cvn H.B /DEST pdfmark
+end
+ 558 4625 a Fs(make)41 b(uninstall)-2 4799
+y
+SDict begin H.S end
+ -2 4799 a -2 4799 a
+SDict begin 13 H.A end
+ -2 4799 a -2 4799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:245) cvn H.B /DEST pdfmark
+end
+ -2 4799 a 396
+4899 a FC(Uninstall)20 b(the)h(e)o(x)o(ecutable)d(and)i(remo)o(v)o(e)e
+(directories)h(if)h(empty)-5 b(.)19 b(Does)i(not)e(uninstall)h(the)g
+(con\002guration)e(\002le.)-2 5000 y
+SDict begin H.S end
+ -2 5000 a -2 5000
+a
+SDict begin 11.7 H.A end
+ -2 5000 a -2 5000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:246) cvn H.B /DEST pdfmark
+end
+ -2 5000 a -2 5000 a
+SDict begin H.S end
+ -2 5000 a -2
+5000 a
+SDict begin 11.7 H.A end
+ -2 5000 a -2 5000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:247) cvn H.B /DEST pdfmark
+end
+ -2 5000 a 396 5080 a Ft(sh$)558
+5080 y
+SDict begin H.S end
+ 558 5080 a 558 5080 a
+SDict begin 11.7 H.A end
+ 558 5080 a 558 5080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:248) cvn H.B /DEST pdfmark
+end
+ 558
+5080 a Fs(make)41 b(purge)-2 5255 y
+SDict begin H.S end
+ -2 5255 a -2 5255
+a
+SDict begin 13 H.A end
+ -2 5255 a -2 5255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:249) cvn H.B /DEST pdfmark
+end
+ -2 5255 a 396 5354 a FC(As)509
+5354 y
+SDict begin H.S end
+ 509 5354 a 509 5354 a
+SDict begin 13 H.A end
+ 509 5354 a 509 5354 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:250) cvn H.B /DEST pdfmark
+end
+ 509
+5354 a Fy(mak)o(e)21 b(uninstall)p FC(,)g(b)n(ut)f(also)g(remo)o(v)o(e)
+e(the)j(the)f(con\002guration)d(\002le.)p Black 3700
+5805 a Fx(7)p Black eop end
+%%Page: 8 13
+TeXDict begin 8 12 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.8) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:297) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2538 104 a Fx(Chapter)20
+b(2.)g(Compiling)f(and)h(installing)p Black -2 226 a
+SDict begin H.S end
+
+-2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:251) cvn H.B /DEST pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+
+-2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:252) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309
+a Ft(sh$)558 309 y
+SDict begin H.S end
+ 558 309 a 558 309 a
+SDict begin 11.7 H.A end
+ 558 309 a 558
+309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:253) cvn H.B /DEST pdfmark
+end
+ 558 309 a Fs(make)41 b(uninstall-boot)396 583 y
+FC(Uninstall)20 b(the)h(runle)n(v)o(el)d(start/stop)i(scripts.)-2
+601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 11.7 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:255) cvn H.B /DEST pdfmark
+end
+ -2 601 a -2
+725 a
+SDict begin H.S end
+ -2 725 a -2 725 a
+SDict begin 11.7 H.A end
+ -2 725 a -2 725 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:257) cvn H.B /DEST pdfmark
+end
+ -2 725 a 562
+804 a Fw(TIP:)g Fv(Y)-10 b(ou)19 b(can)i(sa)o(v)n(e)f(the)g(scr)q(ipt)
+1509 804 y
+SDict begin H.S end
+ 1509 804 a 1509 804 a
+SDict begin 11.7 H.A end
+ 1509 804 a 1509 804
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:258) cvn H.B /DEST pdfmark
+end
+ 1509 804 a Fv(samhain-install.sh)d(and)i(use)h(it)g(f)n(or)g
+(uninstalling)d(if)j(y)o(ou)f(e)n(v)n(er)h(w)o(ant)g(to)562
+901 y(remo)o(v)n(e)g(samhain:)-2 985 y
+SDict begin H.S end
+ -2 985 a -2 985
+a
+SDict begin 10.53 H.A end
+ -2 985 a -2 985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:259) cvn H.B /DEST pdfmark
+end
+ -2 985 a -2 985 a
+SDict begin H.S end
+ -2 985 a -2 985
+a
+SDict begin 10.53 H.A end
+ -2 985 a -2 985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:260) cvn H.B /DEST pdfmark
+end
+ -2 985 a 562 1072 a Fo(sh$)708 1072
+y
+SDict begin H.S end
+ 708 1072 a 708 1072 a
+SDict begin 10.53 H.A end
+ 708 1072 a 708 1072 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:261) cvn H.B /DEST pdfmark
+end
+ 708 1072
+a Fn(samhain-install.sh)42 b(purge)-2 1080 y
+SDict begin H.S end
+ -2 1080
+a -2 1080 a
+SDict begin 10.53 H.A end
+ -2 1080 a -2 1080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:262) cvn H.B /DEST pdfmark
+end
+ -2 1080 a 562 1159 a
+Fo(sh$)708 1159 y
+SDict begin H.S end
+ 708 1159 a 708 1159 a
+SDict begin 10.53 H.A end
+ 708 1159 a 708
+1159 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:263) cvn H.B /DEST pdfmark
+end
+ 708 1159 a Fn(samhain-install.sh)g(uninstall-boot)-2
+1655 y
+SDict begin H.S end
+ -2 1655 a -2 1655 a
+SDict begin 13 H.A end
+ -2 1655 a -2 1655 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-CUSTOMIZE) cvn
+H.B /DEST pdfmark end
+ -2 1655
+a 377 x Fu(2.7.)d(Customiz)q(e)1006 2032 y
+SDict begin H.S end
+ 1006 2032
+a 1006 2032 a
+SDict begin 22.464 H.A end
+ 1006 2032 a 1006 2032 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.7.1) cvn H.B /DEST pdfmark
+end
+ 1006 2032 a -2
+2200 a
+SDict begin H.S end
+ -2 2200 a -2 2200 a
+SDict begin 13 H.A end
+ -2 2200 a -2 2200 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:266) cvn H.B /DEST pdfmark
+end
+ -2 2200
+a -2 2200 a
+SDict begin H.S end
+ -2 2200 a -2 2200 a
+SDict begin 13 H.A end
+ -2 2200 a -2 2200 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:267) cvn H.B /DEST pdfmark
+end
+ -2
+2200 a 396 2306 a FC(samhain)20 b(comes)g(with)g(def)o(ault)f
+(con\002guration)f(\002les)j(for)f(se)n(v)o(eral)f(operating)g
+(systems:)2979 2306 y
+SDict begin H.S end
+ 2979 2306 a 2979 2306 a
+SDict begin 13 H.A end
+ 2979 2306
+a 2979 2306 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:268) cvn H.B /DEST pdfmark
+end
+ 2979 2306 a Fr(samhainrc.linux)p FC(,)396
+2414 y
+SDict begin H.S end
+ 396 2414 a 396 2414 a
+SDict begin 13 H.A end
+ 396 2414 a 396 2414 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:269) cvn H.B /DEST pdfmark
+end
+ 396
+2414 a Fr(samhainrc.solaris)p FC(,)1200 2414 y
+SDict begin H.S end
+ 1200 2414
+a 1200 2414 a
+SDict begin 13 H.A end
+ 1200 2414 a 1200 2414 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:270) cvn H.B /DEST pdfmark
+end
+ 1200 2414 a Fr(samhainrc.freebsd)
+p FC(,)2004 2414 y
+SDict begin H.S end
+ 2004 2414 a 2004 2414 a
+SDict begin 13 H.A end
+ 2004 2414
+a 2004 2414 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:271) cvn H.B /DEST pdfmark
+end
+ 2004 2414 a Fr(samhainrc.aix5.2.0)e FC(\(and)3000
+2414 y
+SDict begin H.S end
+ 3000 2414 a 3000 2414 a
+SDict begin 13 H.A end
+ 3000 2414 a 3000 2414
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:272) cvn H.B /DEST pdfmark
+end
+ 3000 2414 a Fr(yulerc)i FC(for)h(the)396 2522 y(serv)o(er\).)f(The)h
+(installation)g(routine)f(will)i(choose)e(the)h(one)g(matching)e
+(closest)j(your)e(system,)h(or)g(f)o(all)h(back)e(to)396
+2630 y
+SDict begin H.S end
+ 396 2630 a 396 2630 a
+SDict begin 13 H.A end
+ 396 2630 a 396 2630 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:273) cvn H.B /DEST pdfmark
+end
+ 396
+2630 a Fr(samhainrc.linux)p FC(,)f(if)h(no)g(good)f(match)h(could)g(be)
+g(found.)f(Ho)n(we)n(v)o(er)m(,)f(all)j(these)g(con\002guration)c
+(\002les)21 b(are)e(k)o(ept)396 2738 y(v)o(ery)g(general,)g(and)h(most)
+g(probably)e(you)h(w)o(ant)i(to)f(adjust)g(settings)g(lik)o(e:)2582
+2738 y
+SDict begin H.S end
+ 2582 2738 a 2582 2738 a
+SDict begin 13 H.A end
+ 2582 2738 a 2582 2738
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:274) cvn H.B /DEST pdfmark
+end
+ 2582 2738 a -2 2784 a
+SDict begin H.S end
+ -2 2784 a -2 2784 a
+SDict begin 13 H.A end
+ -2 2784 a
+-2 2784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:275) cvn H.B /DEST pdfmark
+end
+ -2 2784 a Black 396 2945 a FB(\225)p Black
+479 2945 a
+SDict begin H.S end
+ 479 2945 a 479 2945 a
+SDict begin 13 H.A end
+ 479 2945 a 479 2945
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:276) cvn H.B /DEST pdfmark
+end
+ 479 2945 a FC(which)g(\002les/directories)g(should)f(be)h(check)o(ed)
+-2 2946 y
+SDict begin H.S end
+ -2 2946 a -2 2946 a
+SDict begin 13 H.A end
+ -2 2946 a -2 2946 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:277) cvn H.B /DEST pdfmark
+end
+ -2
+2946 a Black 396 3094 a FB(\225)p Black 479 3094 a
+SDict begin H.S end
+ 479
+3094 a 479 3094 a
+SDict begin 13 H.A end
+ 479 3094 a 479 3094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:278) cvn H.B /DEST pdfmark
+end
+ 479 3094 a FC(which)g(logging)e
+(f)o(acilities)j(should)e(be)i(used)396 3243 y(The)f(def)o(ault)g
+(location)f(of)h(the)g(con\002guration)d(\002le)k(is)1963
+3243 y
+SDict begin H.S end
+ 1963 3243 a 1963 3243 a
+SDict begin 13 H.A end
+ 1963 3243 a 1963 3243
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:279) cvn H.B /DEST pdfmark
+end
+ 1963 3243 a Fr(/etc/samhainrc)e FC(\(see)p 0 TeXcolorgray
+2766 3243 a
+SDict begin H.S end
+ 2766 3243 a FC(Section)h(2.10)3183 3243 y
+SDict begin 13 H.L end
+
+3183 3243 a 3183 3243 a
+SDict begin [ /Subtype /Link /Dest (0:LAYOUT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3183 3243 a Black -2 w FC(>\).)g(T)-7
+b(o)396 3351 y(customize,)19 b(type:)-2 3452 y
+SDict begin H.S end
+ -2 3452
+a -2 3452 a
+SDict begin 11.7 H.A end
+ -2 3452 a -2 3452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:281) cvn H.B /DEST pdfmark
+end
+ -2 3452 a -2 3452 a
+SDict begin H.S end
+ -2
+3452 a -2 3452 a
+SDict begin 11.7 H.A end
+ -2 3452 a -2 3452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:282) cvn H.B /DEST pdfmark
+end
+ -2 3452 a 396 3532
+a Ft(sh$)558 3532 y
+SDict begin H.S end
+ 558 3532 a 558 3532 a
+SDict begin 11.7 H.A end
+ 558 3532 a
+558 3532 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:283) cvn H.B /DEST pdfmark
+end
+ 558 3532 a Fs(vi)41 b(/etc/samhainrc)-2 3705
+y
+SDict begin H.S end
+ -2 3705 a -2 3705 a
+SDict begin 13 H.A end
+ -2 3705 a -2 3705 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:284) cvn H.B /DEST pdfmark
+end
+ -2 3705 a 396
+3806 a FC(The)20 b(def)o(ault)g(con\002guration)d(\002le)k(is)g(hea)n
+(vily)f(commented)e(to)i(help)g(you.)f(F)o(or)h(a)g(list)i(of)d(all)i
+(runtime)396 3913 y(con\002guration)d(directi)n(v)o(es,)h(please)h(ha)n
+(v)o(e)g(a)g(look)g(at)p 0 TeXcolorgray 1930 3913 a
+SDict begin H.S end
+ 1930
+3913 a FC(Appendix)e(C)2333 3913 y
+SDict begin 13 H.L end
+ 2333 3913 a 2333 3913
+a
+SDict begin [ /Subtype /Link /Dest (0:THE-CONFIGURATION-FILE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2333 3913 a Black 1 w FC(>.)-2 4097 y
+SDict begin H.S end
+ -2 4097 a -2
+4097 a
+SDict begin 13 H.A end
+ -2 4097 a -2 4097 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:286) cvn H.B /DEST pdfmark
+end
+ -2 4097 a 396 4187 a FC(If)i(you)g(ha)n(v)o
+(e)f(an)o(y)h(typos)f(or)h(other)g(errors)f(in)h(your)f
+(con\002guration)f(\002le,)2497 4187 y
+SDict begin H.S end
+ 2497 4187 a 2497
+4187 a
+SDict begin 13 H.A end
+ 2497 4187 a 2497 4187 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:287) cvn H.B /DEST pdfmark
+end
+ 2497 4187 a FC(samhain)i(will)h(log)f(w)
+o(arning)f(messages)396 4295 y(upon)g(startup)h(including)e(the)i
+(corresponding)d(line)j(number)f(of)h(the)g(con\002guration)d(\002le.)
+-2 4324 y
+SDict begin H.S end
+ -2 4324 a -2 4324 a
+SDict begin 13 H.A end
+ -2 4324 a -2 4324 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-INITIALIZE) cvn
+H.B /DEST pdfmark end
+ -2
+4324 a 359 x Fu(2.8.)39 b(Initializ)q(e)f(the)h(baseline)f(database)
+2377 4683 y
+SDict begin H.S end
+ 2377 4683 a 2377 4683 a
+SDict begin 22.464 H.A end
+ 2377 4683 a 2377
+4683 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.8.1) cvn H.B /DEST pdfmark
+end
+ 2377 4683 a -2 4851 a
+SDict begin H.S end
+ -2 4851 a -2 4851 a
+SDict begin 13 H.A end
+ -2 4851
+a -2 4851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:290) cvn H.B /DEST pdfmark
+end
+ -2 4851 a -2 4851 a
+SDict begin H.S end
+ -2 4851 a -2 4851 a
+SDict begin 13 H.A end
+ -2
+4851 a -2 4851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:291) cvn H.B /DEST pdfmark
+end
+ -2 4851 a 396 4957 a FC(samhain)20 b(w)o(orks)g(by)f
+(comparing)f(the)i(present)g(state)h(of)f(the)g(\002lesystem)g(agains)g
+(a)h(baseline)e(database.)h(Of)396 5065 y(course,)f(this)i(baseline)f
+(database)g(must)g(be)g(initialized)g(\002rst)h(\(and)e(preferably)f
+(from)h(a)i(kno)n(wn)d(good)h(state)i(!\).)f(T)-7 b(o)396
+5173 y(perform)18 b(the)j(initialization)e(\(i.e.)h(create)g(the)g
+(baseline)g(database\),)f(type:)-2 5274 y
+SDict begin H.S end
+ -2 5274 a -2
+5274 a
+SDict begin 11.7 H.A end
+ -2 5274 a -2 5274 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:292) cvn H.B /DEST pdfmark
+end
+ -2 5274 a -2 5274 a
+SDict begin H.S end
+ -2 5274
+a -2 5274 a
+SDict begin 11.7 H.A end
+ -2 5274 a -2 5274 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:293) cvn H.B /DEST pdfmark
+end
+ -2 5274 a 396 5353 a
+Ft(sh$)558 5353 y
+SDict begin H.S end
+ 558 5353 a 558 5353 a
+SDict begin 11.7 H.A end
+ 558 5353 a 558
+5353 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:294) cvn H.B /DEST pdfmark
+end
+ 558 5353 a Fs(samhain)42 b(-t)f(init)h(-p)f(info)p
+Black 3703 5805 a Fx(8)p Black eop end
+%%Page: 9 14
+TeXDict begin 9 13 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.9) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+-2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:295) cvn H.B /DEST pdfmark
+end
+ -2 226 a
+396 309 a FC(\(with)592 309 y
+SDict begin H.S end
+ 592 309 a 592 309 a
+SDict begin 13 H.A end
+ 592
+309 a 592 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:296) cvn H.B /DEST pdfmark
+end
+ 592 309 a Fx(-p)g(info)p FC(,)g(messages)g(of)g(se)n(v)
+o(erity)f('info')g(or)h(higher)f(will)i(be)f(printed)f(to)h(your)f
+(terminal/console\).)396 583 y(If)h(the)h(database)e(\002le)i(already)e
+(e)o(xists,)h Fy(samhain)h(-t)f(init)h FC(will)2210 583
+y
+SDict begin H.S end
+ 2210 583 a 2210 583 a
+SDict begin 13 H.A end
+ 2210 583 a 2210 583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:299) cvn H.B /DEST pdfmark
+end
+ 2210 583
+a Fx(append)f FC(to)h(it.)f(This)h(is)g(a)f(feature)g(that)g(is)h
+(intended)396 691 y(to)g(help)e(you)h(operating)1125
+691 y
+SDict begin H.S end
+ 1125 691 a 1125 691 a
+SDict begin 13 H.A end
+ 1125 691 a 1125 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:300) cvn H.B /DEST pdfmark
+end
+ 1125
+691 a FC(samhain)f(in)i(a)f(slightly)g(more)g(stealthy)f(w)o(ay:)i(you)
+e(can)h(append)e(the)j(database)e(e.g.)h(to)g(a)396 799
+y(JPEG)h(picture)e(\(and)h(the)g(picture)f(will)i(still)h(display)d
+(normally)g(-)h(JPEG)h(ignores)e(appended)f('garbage'\).)-2
+817 y
+SDict begin H.S end
+ -2 817 a -2 817 a
+SDict begin 11.7 H.A end
+ -2 817 a -2 817 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:301) cvn H.B /DEST pdfmark
+end
+ -2 817 a -2
+941 a
+SDict begin H.S end
+ -2 941 a -2 941 a
+SDict begin 11.7 H.A end
+ -2 941 a -2 941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:303) cvn H.B /DEST pdfmark
+end
+ -2 941 a 562
+1020 a Fw(NO)m(TE::)i Fv(It)h(is)f(usually)g(an)g(error)f(to)h(r)q(un)
+1723 1020 y
+SDict begin H.S end
+ 1723 1020 a 1723 1020 a
+SDict begin 11.7 H.A end
+ 1723 1020 a 1723
+1020 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:304) cvn H.B /DEST pdfmark
+end
+ 1723 1020 a Fw(samhain)f(-t)i(init)e Fv(twice)o(,)h(because)f
+(\(a\))h(it)g(will)3059 1020 y
+SDict begin H.S end
+ 3059 1020 a 3059 1020
+a
+SDict begin 11.7 H.A end
+ 3059 1020 a 3059 1020 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:305) cvn H.B /DEST pdfmark
+end
+ 3059 1020 a Fq(append)25 b
+Fv(a)20 b(second)562 1117 y(baseline)e(database)g(to)j(the)e(e)n
+(xisting)g(one)o(,)g(and)g(\(b\))i(only)e(the)h(\002rst)h(baseline)d
+(database)g(will)i(be)g(used.)f(Use)562 1214 y
+SDict begin H.S end
+ 562 1214
+a 562 1214 a
+SDict begin 11.7 H.A end
+ 562 1214 a 562 1214 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:306) cvn H.B /DEST pdfmark
+end
+ 562 1214 a Fw(samhain)g(-t)i(update)
+d Fv(f)n(or)i(updating)e(the)h(baseline)f(database)o(.)g(Delete)h(or)h
+(rename)f(the)h(baseline)e(database)562 1312 y(\002le)j(if)f(y)o(ou)f
+(really)h(w)o(ant)f(to)h(r)q(un)1466 1312 y
+SDict begin H.S end
+ 1466 1312
+a 1466 1312 a
+SDict begin 11.7 H.A end
+ 1466 1312 a 1466 1312 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:307) cvn H.B /DEST pdfmark
+end
+ 1466 1312 a Fw(samhain)f(-t)i
+(init)e Fv(a)i(second)e(time)o(.)-2 1544 y
+SDict begin H.S end
+ -2 1544 a
+-2 1544 a
+SDict begin 13 H.A end
+ -2 1544 a -2 1544 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-RUNNING) cvn H.B
+/DEST pdfmark end
+ -2 1544 a 377 x Fu(2.9.)39
+b(Run)g(samhain)1180 1921 y
+SDict begin H.S end
+ 1180 1921 a 1180 1921 a
+SDict begin 22.464 H.A end
+ 1180
+1921 a 1180 1921 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.9.1) cvn H.B /DEST pdfmark
+end
+ 1180 1921 a -2 2089 a
+SDict begin H.S end
+ -2 2089 a -2
+2089 a
+SDict begin 13 H.A end
+ -2 2089 a -2 2089 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:310) cvn H.B /DEST pdfmark
+end
+ -2 2089 a 396 2195 a FC(After)20
+b(successful)g(initialization)g(of)g(the)g(baseline)g(database,)f(you)g
+(can)h(run)2640 2195 y
+SDict begin H.S end
+ 2640 2195 a 2640 2195 a
+SDict begin 13 H.A end
+ 2640 2195
+a 2640 2195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:311) cvn H.B /DEST pdfmark
+end
+ 2640 2195 a FC(samhain)f(in)h('check')f(mode)g(by)396
+2303 y(typing:)-2 2404 y
+SDict begin H.S end
+ -2 2404 a -2 2404 a
+SDict begin 11.7 H.A end
+ -2 2404
+a -2 2404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:312) cvn H.B /DEST pdfmark
+end
+ -2 2404 a -2 2404 a
+SDict begin H.S end
+ -2 2404 a -2 2404 a
+SDict begin 11.7 H.A end
+ -2
+2404 a -2 2404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:313) cvn H.B /DEST pdfmark
+end
+ -2 2404 a 396 2483 a Ft(sh$)558 2483
+y
+SDict begin H.S end
+ 558 2483 a 558 2483 a
+SDict begin 11.7 H.A end
+ 558 2483 a 558 2483 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:314) cvn H.B /DEST pdfmark
+end
+ 558 2483
+a Fs(samhain)42 b(-t)f(check)-2 2657 y
+SDict begin H.S end
+ -2 2657 a -2 2657
+a
+SDict begin 13 H.A end
+ -2 2657 a -2 2657 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:315) cvn H.B /DEST pdfmark
+end
+ -2 2657 a 396 2757 a FC(T)-7 b(o)21
+b(run)634 2757 y
+SDict begin H.S end
+ 634 2757 a 634 2757 a
+SDict begin 13 H.A end
+ 634 2757 a 634
+2757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:316) cvn H.B /DEST pdfmark
+end
+ 634 2757 a FC(samhain)f(as)g(a)h(daemon,)d(you)i(can)g(either)f
+(use)i(the)f(command)e(line)j(option)e('-D',)g(or)h(set)h(daemon)d
+(mode)396 2865 y(in)j(the)f(con\002guration)d(\002le)k(with)g(the)f
+(option)f('Daemon=yes'.)-2 2893 y
+SDict begin H.S end
+ -2 2893 a -2 2893 a
+SDict begin 13 H.A end
+
+-2 2893 a -2 2893 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LAYOUT) cvn H.B /DEST pdfmark
+end
+ -2 2893 a 360 x Fu(2.10.)39 b(Files)g(and)f
+(director)q(y)h(la)m(y)l(out)2091 3253 y
+SDict begin H.S end
+ 2091 3253 a
+2091 3253 a
+SDict begin 22.464 H.A end
+ 2091 3253 a 2091 3253 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.1) cvn H.B /DEST pdfmark
+end
+ 2091 3253 a -2 3282
+a
+SDict begin H.S end
+ -2 3282 a -2 3282 a
+SDict begin 11.7 H.A end
+ -2 3282 a -2 3282 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:319) cvn H.B /DEST pdfmark
+end
+ -2 3282 a -2
+3407 a
+SDict begin H.S end
+ -2 3407 a -2 3407 a
+SDict begin 11.7 H.A end
+ -2 3407 a -2 3407 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:321) cvn H.B /DEST pdfmark
+end
+ -2 3407
+a 562 3474 a Fw(TIP:)724 3474 y
+SDict begin H.S end
+ 724 3474 a 724 3474 a
+SDict begin 11.7 H.A end
+
+724 3474 a 724 3474 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:322) cvn H.B /DEST pdfmark
+end
+ 724 3474 a Fv(samhain)19 b(has)i(its)f(o)o(wn)g
+(set)g(of)1624 3474 y
+SDict begin H.S end
+ 1624 3474 a 1624 3474 a
+SDict begin 11.7 H.A end
+ 1624 3474
+a 1624 3474 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:323) cvn H.B /DEST pdfmark
+end
+ 1624 3474 a Fq(tr)q(usted)g(users)r Fv(.)g(P)m(aths)g(to)
+g(cr)q(itical)f(\002les)i(\(e)o(.g.)e(the)h(con\002gur)o(ation)e
+(\002le\))562 3571 y(m)o(ust)i(be)e(wr)q(iteab)o(le)e(b)o(y)i(tr)q
+(usted)g(users)h(only)-7 b(.)17 b(F)l(ailure)g(to)h(ensure)g(this)g
+(\(e)o(.g.)g(b)o(y)g(compiling)f(in)h(an)g(appropr)q(iate)562
+3669 y(set)j(of)f(tr)q(usted)f(users\))h(is)1319 3669
+y
+SDict begin H.S end
+ 1319 3669 a 1319 3669 a
+SDict begin 11.7 H.A end
+ 1319 3669 a 1319 3669 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:324) cvn H.B /DEST pdfmark
+end
+ 1319
+3669 a Fq(one)g(of)g(the)f(most)i(frequent)d(reasons)h(f)n(or)h(prob)o
+(lems)r Fv(.)f(See)g(belo)o(w)g(f)n(or)h(details)o(.)39
+3818 y
+SDict begin H.S end
+ 39 3818 a 39 3818 a
+SDict begin 13 H.A end
+ 39 3818 a 39 3818 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEFTRUST) cvn H.B /DEST pdfmark
+end
+ 39 3818
+a 396 4146 a Fp(2.10.1.)36 b(T)-10 b(rusted)34 b(user)n(s)h(and)e
+(trusted)h(paths)2610 4146 y
+SDict begin H.S end
+ 2610 4146 a 2610 4146 a
+SDict begin 18.72 H.A end
+
+2610 4146 a 2610 4146 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.2.2) cvn H.B /DEST pdfmark
+end
+ 2610 4146 a -2 4171 a
+SDict begin H.S end
+ -2 4171
+a -2 4171 a
+SDict begin 13 H.A end
+ -2 4171 a -2 4171 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:327) cvn H.B /DEST pdfmark
+end
+ -2 4171 a -2 4195 a
+SDict begin H.S end
+ -2
+4195 a -2 4195 a
+SDict begin 13 H.A end
+ -2 4195 a -2 4195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:328) cvn H.B /DEST pdfmark
+end
+ -2 4195 a Black
+396 4343 a FB(\225)p Black 479 4343 a
+SDict begin H.S end
+ 479 4343 a 479
+4343 a
+SDict begin 13 H.A end
+ 479 4343 a 479 4343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:329) cvn H.B /DEST pdfmark
+end
+ 479 4343 a 479 4343 a
+SDict begin H.S end
+ 479
+4343 a 479 4343 a
+SDict begin 13 H.A end
+ 479 4343 a 479 4343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:330) cvn H.B /DEST pdfmark
+end
+ 479 4343 a Fx(T)-5
+b(rusted)21 b(user)o(s)g FC(are)1066 4343 y
+SDict begin H.S end
+ 1066 4343
+a 1066 4343 a
+SDict begin 13 H.A end
+ 1066 4343 a 1066 4343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:331) cvn H.B /DEST pdfmark
+end
+ 1066 4343 a Fx(r)l(oot)h
+FC(and)e(the)1486 4343 y
+SDict begin H.S end
+ 1486 4343 a 1486 4343 a
+SDict begin 13 H.A end
+ 1486
+4343 a 1486 4343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:332) cvn H.B /DEST pdfmark
+end
+ 1486 4343 a Fx(ef)o(fective)g(user)j
+FC(of)d(the)g(process)g(\(usually)-5 b(,)18 b(the)i(ef)n(fecti)n(v)o(e)
+f(user)h(will)h(be)f(root)479 4451 y(herself\).)f(Additional)g(trusted)
+h(users)g(can)g(be)g(de\002ned)g(in)g(the)g(con\002guration)e(\002le)j
+(\(see)f(Sect.)p 0 TeXcolorgray 3225 4451 a
+SDict begin H.S end
+ 3225 4451
+a FC(Section)g(4.5)3600 4451 y
+SDict begin 13 H.L end
+ 3600 4451 a 3600 4451
+a
+SDict begin [ /Subtype /Link /Dest (0:TRUSTEDEXAMPLE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3600 4451 a Black 20 w FC(for)479 4559 y(an)g(e)o(xample\),)f(or)h
+(at)g(compile)f(time,)i(with)f(the)g(option)-2 4619 y
+SDict begin H.S end
+
+-2 4619 a -2 4619 a
+SDict begin 11.7 H.A end
+ -2 4619 a -2 4619 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:334) cvn H.B /DEST pdfmark
+end
+ -2 4619 a -2
+4619 a
+SDict begin H.S end
+ -2 4619 a -2 4619 a
+SDict begin 11.7 H.A end
+ -2 4619 a -2 4619 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:335) cvn H.B /DEST pdfmark
+end
+ -2 4619
+a 479 4698 a Ft(bash$)679 4698 y
+SDict begin H.S end
+ 679 4698 a 679 4698
+a
+SDict begin 11.7 H.A end
+ 679 4698 a 679 4698 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:336) cvn H.B /DEST pdfmark
+end
+ 679 4698 a Fs(./configure)46
+b(--with-trusted=0,..)q(.)-2 4707 y
+SDict begin H.S end
+ -2 4707 a -2 4707
+a
+SDict begin 13 H.A end
+ -2 4707 a -2 4707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:337) cvn H.B /DEST pdfmark
+end
+ -2 4707 a Black 396 4847 a FB(\225)p
+Black 479 4847 a
+SDict begin H.S end
+ 479 4847 a 479 4847 a
+SDict begin 13 H.A end
+ 479 4847 a 479
+4847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:338) cvn H.B /DEST pdfmark
+end
+ 479 4847 a FC(A)560 4847 y
+SDict begin H.S end
+ 560 4847 a 560 4847
+a
+SDict begin 13 H.A end
+ 560 4847 a 560 4847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:339) cvn H.B /DEST pdfmark
+end
+ 560 4847 a Fx(trusted)20 b(path)g
+FC(is)h(a)f(path)g(with)h(all)f(elements)g(writeable)g(only)f(by)h
+(trusted)g(users.)2926 4847 y
+SDict begin H.S end
+ 2926 4847 a 2926 4847 a
+SDict begin 13 H.A end
+
+2926 4847 a 2926 4847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:340) cvn H.B /DEST pdfmark
+end
+ 2926 4847 a FC(samhain)f(requires)h(the)479
+4955 y(paths)g(to)h(the)f(con\002guration)d(and)j(log)g(\002le)h(to)f
+(be)g(trusted)g(paths,)g(as)h(well)f(as)h(the)f(path)g(to)h(the)f(pid)g
+(\002le.)p Black 3703 5805 a Fx(9)p Black eop end
+%%Page: 10 15
+TeXDict begin 10 14 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.10) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+-2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:341) cvn H.B /DEST pdfmark
+end
+ -2 226 a
+396 309 a FC(If)g(a)h(path)f(element)f(is)i(group)e(writeable,)g(all)i
+(group)d(members)i(must)g(be)g(trusted.)f(If)h(the)h(path)e(to)i(the)
+396 417 y(con\002guration)d(\002le)j(itself)f(is)i(writeable)d(by)h
+(other)f(users)i(than)2229 417 y
+SDict begin H.S end
+ 2229 417 a 2229 417
+a
+SDict begin 13 H.A end
+ 2229 417 a 2229 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:342) cvn H.B /DEST pdfmark
+end
+ 2229 417 a Fx(r)l(oot)h FC(and)e(the)2649
+417 y
+SDict begin H.S end
+ 2649 417 a 2649 417 a
+SDict begin 13 H.A end
+ 2649 417 a 2649 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:343) cvn H.B /DEST pdfmark
+end
+ 2649
+417 a Fx(ef)o(fective)g(user)j FC(these)d(must)g(be)396
+525 y(de\002ned)f(as)i(trusted)f(already)f(at)i(compile)e(time.)-2
+543 y
+SDict begin H.S end
+ -2 543 a -2 543 a
+SDict begin 11.7 H.A end
+ -2 543 a -2 543 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:344) cvn H.B /DEST pdfmark
+end
+ -2 543 a -2
+667 a
+SDict begin H.S end
+ -2 667 a -2 667 a
+SDict begin 11.7 H.A end
+ -2 667 a -2 667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:346) cvn H.B /DEST pdfmark
+end
+ -2 667 a 562
+746 a Fw(NO)m(TE:)i Fv(The)e(list)h(of)g(g)o(roup)f(members)h(in)1779
+746 y
+SDict begin H.S end
+ 1779 746 a 1779 746 a
+SDict begin 11.7 H.A end
+ 1779 746 a 1779 746 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:347) cvn H.B /DEST pdfmark
+end
+ 1779
+746 a Ft(/etc/group)25 b Fv(ma)n(y)20 b(be)g(incomplete)e(or)i(e)n(v)n
+(en)g(empty)-7 b(.)3353 746 y
+SDict begin H.S end
+ 3353 746 a 3353 746 a
+SDict begin 11.7 H.A end
+ 3353
+746 a 3353 746 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:348) cvn H.B /DEST pdfmark
+end
+ 3353 746 a Fv(samhain)562 843 y(will)20
+b(chec)o(k)901 843 y
+SDict begin H.S end
+ 901 843 a 901 843 a
+SDict begin 11.7 H.A end
+ 901 843 a 901
+843 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:349) cvn H.B /DEST pdfmark
+end
+ 901 843 a Ft(/etc/passwd)25 b Fv(\(where)19 b(each)h(user)g(has)g
+(a)g(GID)h(\002eld\))f(in)g(addition)d(to)2948 843 y
+SDict begin H.S end
+
+2948 843 a 2948 843 a
+SDict begin 11.7 H.A end
+ 2948 843 a 2948 843 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:350) cvn H.B /DEST pdfmark
+end
+ 2948 843
+a Ft(/etc/group)24 b Fv(to)c(\002nd)h(all)562 940 y(members)f(of)h(a)f
+(g)o(roup)m(.)-2 1173 y
+SDict begin H.S end
+ -2 1173 a -2 1173 a
+SDict begin 13 H.A end
+ -2 1173 a
+-2 1173 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LAYOUT-DETAILS) cvn H.B /DEST
+pdfmark end
+ -2 1173 a 396 1501 a Fp(2.10.2.)36 b(Director)q(y)e(la)n(y)m
+(out)1700 1501 y
+SDict begin H.S end
+ 1700 1501 a 1700 1501 a
+SDict begin 18.72 H.A end
+ 1700 1501 a
+1700 1501 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.3.2) cvn H.B /DEST pdfmark
+end
+ 1700 1501 a -2 1692 a
+SDict begin H.S end
+ -2 1692 a -2 1692 a
+SDict begin 13 H.A end
+
+-2 1692 a -2 1692 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:353) cvn H.B /DEST pdfmark
+end
+ -2 1692 a -2 1692 a
+SDict begin H.S end
+ -2 1692 a -2
+1692 a
+SDict begin 13 H.A end
+ -2 1692 a -2 1692 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:354) cvn H.B /DEST pdfmark
+end
+ -2 1692 a 396 1775 a FC(samhain)20
+b(conforms)e(to)i(the)h(FHS,)f(which)g(mandates)f(a)i(directory)d
+(layout)i(that)g(is)h(dif)n(ferent)e(from)g(the)h(def)o(ault)396
+1883 y(GNU)h(layout)e(\(e)n(v)o(erything)e(in)k(subdirectories)d(under)
+2007 1883 y
+SDict begin H.S end
+ 2007 1883 a 2007 1883 a
+SDict begin 13 H.A end
+ 2007 1883 a 2007
+1883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:355) cvn H.B /DEST pdfmark
+end
+ 2007 1883 a Fr(/etc/local)p FC(\).)-2 1901 y
+SDict begin H.S end
+ -2
+1901 a -2 1901 a
+SDict begin 11.7 H.A end
+ -2 1901 a -2 1901 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:356) cvn H.B /DEST pdfmark
+end
+ -2 1901 a -2 2025
+a
+SDict begin H.S end
+ -2 2025 a -2 2025 a
+SDict begin 11.7 H.A end
+ -2 2025 a -2 2025 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:358) cvn H.B /DEST pdfmark
+end
+ -2 2025 a 562
+2105 a Fw(TIP:)i Fv(There)f(is)i(an)f(option)1343 2105
+y
+SDict begin H.S end
+ 1343 2105 a 1343 2105 a
+SDict begin 11.7 H.A end
+ 1343 2105 a 1343 2105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:359) cvn H.B /DEST pdfmark
+end
+ 1343
+2105 a Fw(./con\002gure)e(--enab)o(le-install-name=)2542
+2105 y
+SDict begin H.S end
+ 2542 2105 a 2542 2105 a
+SDict begin 11.7 H.A end
+ 2542 2105 a 2542 2105
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:360) cvn H.B /DEST pdfmark
+end
+ 2542 2105 a Fm(NAME)5 b Fv(.)16 b(When)j(this)h(option)e(is)j(used,)e
+(not)562 2202 y(only)h(the)g(e)n(x)n(ecutab)o(le)d(is)k(installed)c(as)
+1690 2202 y
+SDict begin H.S end
+ 1690 2202 a 1690 2202 a
+SDict begin 11.7 H.A end
+ 1690 2202 a 1690
+2202 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:361) cvn H.B /DEST pdfmark
+end
+ 1690 2202 a Fq(NAME)7 b Fv(,)21 b(b)o(ut)e(also)h(in)f(all)h
+(the)g(paths)o(,)2758 2202 y
+SDict begin H.S end
+ 2758 2202 a 2758 2202 a
+SDict begin 11.7 H.A end
+
+2758 2202 a 2758 2202 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:362) cvn H.B /DEST pdfmark
+end
+ 2758 2202 a Fq(samhain)g Fv(is)h(replaced)d
+(with)562 2299 y
+SDict begin H.S end
+ 562 2299 a 562 2299 a
+SDict begin 11.7 H.A end
+ 562 2299 a 562
+2299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:363) cvn H.B /DEST pdfmark
+end
+ 562 2299 a Fq(NAME)7 b Fv(.)39 2438 y
+SDict begin H.S end
+ 39 2438
+a 39 2438 a
+SDict begin 11.7 H.A end
+ 39 2438 a 39 2438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:364) cvn H.B /DEST pdfmark
+end
+ 39 2438 a -2 2604 a
+SDict begin H.S end
+ -2
+2604 a -2 2604 a
+SDict begin 11.7 H.A end
+ -2 2604 a -2 2604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:366) cvn H.B /DEST pdfmark
+end
+ -2 2604 a 562 2701
+a Fw(NO)m(TE:)21 b Fv(F)n(or)e(the)1068 2701 y
+SDict begin H.S end
+ 1068 2701
+a 1068 2701 a
+SDict begin 11.7 H.A end
+ 1068 2701 a 1068 2701 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:367) cvn H.B /DEST pdfmark
+end
+ 1068 2701 a Fv(yule)h(ser)r(v)n
+(er)l(,)g(replace)1737 2701 y
+SDict begin H.S end
+ 1737 2701 a 1737 2701 a
+SDict begin 11.7 H.A end
+
+1737 2701 a 1737 2701 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:368) cvn H.B /DEST pdfmark
+end
+ 1737 2701 a Fq(samhain)g Fv(with)2195
+2701 y
+SDict begin H.S end
+ 2195 2701 a 2195 2701 a
+SDict begin 11.7 H.A end
+ 2195 2701 a 2195 2701
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:369) cvn H.B /DEST pdfmark
+end
+ 2195 2701 a Fq(yule)i Fv(in)d(the)h(paths)g(e)n(xplained)d(belo)o(w)l
+(.)-2 3016 y
+SDict begin H.S end
+ -2 3016 a -2 3016 a
+SDict begin 13 H.A end
+ -2 3016 a -2 3016 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:370) cvn H.B /DEST pdfmark
+end
+
+-2 3016 a 396 3124 a FC(The)j(follo)n(wing)f(table)h(e)o(xplains)f
+(which)h(directory)e(layout)h(results)i(from)2558 3124
+y
+SDict begin H.S end
+ 2558 3124 a 2558 3124 a
+SDict begin 13 H.A end
+ 2558 3124 a 2558 3124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:371) cvn H.B /DEST pdfmark
+end
+ 2558
+3124 a Fy(./con\002gur)o(e)e(--pr)o(e\002x=)3263 3124
+y
+SDict begin H.S end
+ 3263 3124 a 3263 3124 a
+SDict begin 13 H.A end
+ 3263 3124 a 3263 3124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:372) cvn H.B /DEST pdfmark
+end
+ 3263
+3124 a Fl(PREFIX)-2 3142 y
+SDict begin H.S end
+ -2 3142 a -2 3142 a
+SDict begin 13 H.A end
+ -2 3142
+a -2 3142 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:373) cvn H.B /DEST pdfmark
+end
+ -2 3142 a -2 3236 a
+SDict begin H.S end
+ -2 3236 a -2 3236 a
+SDict begin 13 H.A end
+ -2
+3236 a -2 3236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:374) cvn H.B /DEST pdfmark
+end
+ -2 3236 a -2 3236 a
+SDict begin H.S end
+ -2 3236 a -2 3236
+a
+SDict begin 13 H.A end
+ -2 3236 a -2 3236 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.1) cvn H.B /DEST pdfmark
+end
+ -2 3236 a 396 3239 3365 4 v 396
+3239 V 396 3363 4 125 v 424 3338 a FD(sbindir)p 1237
+3363 V 564 w(mandir)p 2077 3363 V 563 w(sysconfdir)p
+2917 3363 V 420 w(localstatedir)p 3758 3363 V 396 3367
+3365 4 v 396 3367 V 396 3491 4 125 v 424 3466 a FC(PREFIX)p
+1237 3491 V 555 w(\(none\))p 2077 3491 V 2917 3491 V
+3758 3491 V 396 3495 3365 4 v 396 3495 V 396 3619 4 125
+v 424 3594 a(/usr/local/sbin)p 1237 3619 V 369 w(/usr/local/man)p
+2077 3619 V 363 w(/etc)p 2917 3619 V 720 w(/v)n(ar)p
+3758 3619 V 396 3622 3365 4 v 396 3622 V 396 3747 4 125
+v 424 3722 a(PREFIX)p 1237 3747 V 555 w(USR)i(\(all)f(capital\))p
+2077 3747 V 2917 3747 V 3758 3747 V 396 3750 3365 4 v
+396 3750 V 396 3875 4 125 v 424 3850 a(/usr/sbin)p 1237
+3875 V 554 w(/usr/share/man)p 2077 3875 V 349 w(/etc)p
+2917 3875 V 720 w(/v)n(ar)p 3758 3875 V 396 3878 3365
+4 v 396 3878 V 396 4003 4 125 v 424 3978 a(PREFIX)p 1237
+4003 V 555 w(OPT)g(\(all)h(capital\))p 2077 4003 V 2917
+4003 V 3758 4003 V 396 4006 3365 4 v 396 4006 V 396 4130
+4 125 v 424 4106 a(/opt/samhain/bin)p 1237 4130 V 280
+w(/opt/samhain/man)p 2077 4130 V 242 w(/etc/opt)p 2917
+4130 V 590 w(/v)n(ar/opt/samhain)p 3758 4130 V 396 4134
+3365 4 v 396 4134 V 396 4258 4 125 v 424 4233 a(PREFIX)p
+1237 4258 V 555 w(/other)p 2077 4258 V 2917 4258 V 3758
+4258 V 396 4262 3365 4 v 396 4262 V 396 4386 4 125 v
+424 4361 a(/other/sbin)p 1237 4386 V 484 w(/other/share/man)p
+2077 4386 V 279 w(/other/etc)p 2917 4386 V 525 w(/other/v)n(ar)p
+3758 4386 V 396 4390 3365 4 v 396 4390 V -2 4556 a
+SDict begin H.S end
+ -2
+4556 a -2 4556 a
+SDict begin 13 H.A end
+ -2 4556 a -2 4556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:422) cvn H.B /DEST pdfmark
+end
+ -2 4556 a 396 4639
+a FC(The)f(\002le)h(signature)e(database)h(will)h(be)f(written)g(to)
+1895 4639 y
+SDict begin H.S end
+ 1895 4639 a 1895 4639 a
+SDict begin 13 H.A end
+ 1895 4639 a 1895
+4639 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:423) cvn H.B /DEST pdfmark
+end
+ 1895 4639 a Fk(localstatedir)s FC(/lib/samhain/samhain_\002le,)
+15 b(the)20 b(pid)g(\002le)396 4747 y(to)482 4747 y
+SDict begin H.S end
+ 482
+4747 a 482 4747 a
+SDict begin 13 H.A end
+ 482 4747 a 482 4747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:424) cvn H.B /DEST pdfmark
+end
+ 482 4747 a Fk(localstatedir)s
+FC(/run/samhain.pid,)14 b(and)20 b(the)g(log)g(\002le)h(to)2271
+4747 y
+SDict begin H.S end
+ 2271 4747 a 2271 4747 a
+SDict begin 13 H.A end
+ 2271 4747 a 2271 4747
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:425) cvn H.B /DEST pdfmark
+end
+ 2271 4747 a Fk(localstatedir)s FC(/log/samhain_log.)15
+b(In)396 4854 y(addition,)710 4854 y
+SDict begin H.S end
+ 710 4854 a 710 4854
+a
+SDict begin 13 H.A end
+ 710 4854 a 710 4854 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:426) cvn H.B /DEST pdfmark
+end
+ 710 4854 a FC(yule)20 b(writes)g(an)g(HTML)g
+(status)h(\002le)g(to)1874 4854 y
+SDict begin H.S end
+ 1874 4854 a 1874 4854
+a
+SDict begin 13 H.A end
+ 1874 4854 a 1874 4854 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:427) cvn H.B /DEST pdfmark
+end
+ 1874 4854 a Fk(localstatedir)s
+FC(/log/yule/yule.html)-2 5038 y
+SDict begin H.S end
+ -2 5038 a -2 5038 a
+SDict begin 13 H.A end
+
+-2 5038 a -2 5038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:428) cvn H.B /DEST pdfmark
+end
+ -2 5038 a 396 5128 a FC(T)-7 b(o)21
+b(get)f(a)g(more)g(\002ne-grained)e(control)h(on)g(the)i(layout,)e(the)
+h(follo)n(wing)2490 5128 y
+SDict begin H.S end
+ 2490 5128 a 2490 5128 a
+SDict begin 13 H.A end
+ 2490
+5128 a 2490 5128 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:429) cvn H.B /DEST pdfmark
+end
+ 2490 5128 a Fy(con\002gur)o(e)g FC(options)f(are)h
+(pro)o(vided)3565 5128 y
+SDict begin H.S end
+ 3565 5128 a 3565 5128 a
+SDict begin 13 H.A end
+ 3565
+5128 a 3565 5128 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:430) cvn H.B /DEST pdfmark
+end
+ 3565 5128 a -2 5157 a
+SDict begin H.S end
+ -2 5157 a -2
+5157 a
+SDict begin 13 H.A end
+ -2 5157 a -2 5157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:431) cvn H.B /DEST pdfmark
+end
+ -2 5157 a Black 396 5299 a
+FB(\225)p Black 479 5299 a
+SDict begin H.S end
+ 479 5299 a 479 5299 a
+SDict begin 13 H.A end
+ 479
+5299 a 479 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:432) cvn H.B /DEST pdfmark
+end
+ 479 5299 a 479 5299 a
+SDict begin H.S end
+ 479 5299 a 479
+5299 a
+SDict begin 13 H.A end
+ 479 5299 a 479 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:433) cvn H.B /DEST pdfmark
+end
+ 479 5299 a Fx(--with-con\002g-\002le=FILE)
+e FC(\227)j(The)f(path)g(of)f(the)i(con\002guration)c(\002le.)-2
+5317 y
+SDict begin H.S end
+ -2 5317 a -2 5317 a
+SDict begin 13 H.A end
+ -2 5317 a -2 5317 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:434) cvn H.B /DEST pdfmark
+end
+ -2 5317
+a Black 3661 5805 a Fx(10)p Black eop end
+%%Page: 11 16
+TeXDict begin 11 15 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.11) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+Black 396 309 a FB(\225)p Black 479 309 a
+SDict begin H.S end
+ 479 309 a 479
+309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:435) cvn H.B /DEST pdfmark
+end
+ 479 309 a 479 309 a
+SDict begin H.S end
+ 479 309
+a 479 309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:436) cvn H.B /DEST pdfmark
+end
+ 479 309 a Fx(--with-lo)o(g-\002le=FILE)
+g FC(\227)g(The)g(path)g(of)g(the)g(log)g(\002le.)-2
+327 y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:437) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black
+396 458 a FB(\225)p Black 479 458 a
+SDict begin H.S end
+ 479 458 a 479 458
+a
+SDict begin 13 H.A end
+ 479 458 a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:438) cvn H.B /DEST pdfmark
+end
+ 479 458 a 479 458 a
+SDict begin H.S end
+ 479 458 a 479
+458 a
+SDict begin 13 H.A end
+ 479 458 a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:439) cvn H.B /DEST pdfmark
+end
+ 479 458 a Fx(--with-pid-\002le=FILE)f
+FC(\227)i(The)f(path)g(of)g(the)g(pid)g(\002le.)-2 476
+y
+SDict begin H.S end
+ -2 476 a -2 476 a
+SDict begin 13 H.A end
+ -2 476 a -2 476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:440) cvn H.B /DEST pdfmark
+end
+ -2 476 a Black
+396 608 a FB(\225)p Black 479 608 a
+SDict begin H.S end
+ 479 608 a 479 608
+a
+SDict begin 13 H.A end
+ 479 608 a 479 608 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:441) cvn H.B /DEST pdfmark
+end
+ 479 608 a 479 608 a
+SDict begin H.S end
+ 479 608 a 479
+608 a
+SDict begin 13 H.A end
+ 479 608 a 479 608 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:442) cvn H.B /DEST pdfmark
+end
+ 479 608 a Fx(--with-data-\002le=FILE)f
+FC(\227)i(The)f(path)f(of)h(the)g(\002le)h(signature)e(database)h
+(\002le.)-2 626 y
+SDict begin H.S end
+ -2 626 a -2 626 a
+SDict begin 13 H.A end
+ -2 626 a -2 626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:443) cvn H.B /DEST pdfmark
+end
+
+-2 626 a Black 396 757 a FB(\225)p Black 479 757 a
+SDict begin H.S end
+ 479
+757 a 479 757 a
+SDict begin 13 H.A end
+ 479 757 a 479 757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:444) cvn H.B /DEST pdfmark
+end
+ 479 757 a 479 757
+a
+SDict begin H.S end
+ 479 757 a 479 757 a
+SDict begin 13 H.A end
+ 479 757 a 479 757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:445) cvn H.B /DEST pdfmark
+end
+ 479 757 a Fx
+(--with-html-\002le=FILE)g FC(\227)h(The)f(path)f(of)h(the)g(HTML)g
+(status)h(\002le)g(\(serv)o(er)e(only\).)-2 916 y
+SDict begin H.S end
+ -2
+916 a -2 916 a
+SDict begin 13 H.A end
+ -2 916 a -2 916 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:RUNTIME-FILES) cvn H.B /DEST
+pdfmark end
+ -2 916 a 396 1245 a
+Fp(2.10.3.)36 b(Runtime)f(\002les)1545 1245 y
+SDict begin H.S end
+ 1545 1245
+a 1545 1245 a
+SDict begin 18.72 H.A end
+ 1545 1245 a 1545 1245 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.4.2) cvn H.B /DEST pdfmark
+end
+ 1545 1245 a -2
+1246 a
+SDict begin H.S end
+ -2 1246 a -2 1246 a
+SDict begin 13 H.A end
+ -2 1246 a -2 1246 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:RUNTIME-CLIENT) cvn H.B /DEST
+pdfmark end
+ -2 1246
+a 396 1532 a Fj(2.10.3.1.)29 b(Standalone)f(or)g(c)n(lient)1762
+1532 y
+SDict begin H.S end
+ 1762 1532 a 1762 1532 a
+SDict begin 15.6 H.A end
+ 1762 1532 a 1762 1532
+a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.4.1.3) cvn H.B /DEST pdfmark
+end
+ 1762 1532 a -2 1533 a
+SDict begin H.S end
+ -2 1533 a -2 1533 a
+SDict begin 13 H.A end
+ -2 1533 a
+-2 1533 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:450) cvn H.B /DEST pdfmark
+end
+ -2 1533 a -2 1636 a
+SDict begin H.S end
+ -2 1636 a -2 1636 a
+SDict begin 13 H.A end
+ -2
+1636 a -2 1636 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:451) cvn H.B /DEST pdfmark
+end
+ -2 1636 a -2 1636 a
+SDict begin H.S end
+ -2 1636 a -2 1636
+a
+SDict begin 13 H.A end
+ -2 1636 a -2 1636 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.2) cvn H.B /DEST pdfmark
+end
+ -2 1636 a 396 1640 3359 4 v 396
+1640 V 396 1764 4 125 v 424 1739 a FD(Purpose)p 2074
+1764 V 1346 w(Director)q(y)p 3751 1764 V 396 1768 3359
+4 v 396 1768 V 396 1892 4 125 v 424 1867 a FC(Log\002les)p
+2074 1892 V 1405 w Fk(localstatedir)s FC(/log/)p 3751
+1892 V 396 1895 3359 4 v 396 1895 V 396 2020 4 125 v
+424 1995 a(Data)21 b(\002les)p 2074 2020 V 1362 w Fk(localstatedir)s
+FC(/lib/samhain/)p 3751 2020 V 396 2023 3359 4 v 396
+2023 V 396 2148 4 125 v 424 2123 a(Pid)g(\002le)p 2074
+2148 V 1440 w Fk(localstatedir)s FC(/run/)p 3751 2148
+V 396 2151 3359 4 v 396 2151 V -2 2234 a
+SDict begin H.S end
+ -2 2234 a -2
+2234 a
+SDict begin 13 H.A end
+ -2 2234 a -2 2234 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:RUNTIME-SERVER) cvn H.B /DEST
+pdfmark end
+ -2 2234 a 396 2505 a Fj(2.10.3.2.)29
+b(Ser)q(ver)1122 2505 y
+SDict begin H.S end
+ 1122 2505 a 1122 2505 a
+SDict begin 15.6 H.A end
+ 1122
+2505 a 1122 2505 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.4.2.3) cvn H.B /DEST pdfmark
+end
+ 1122 2505 a -2 2506 a
+SDict begin H.S end
+ -2 2506 a -2
+2506 a
+SDict begin 11.7 H.A end
+ -2 2506 a -2 2506 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:471) cvn H.B /DEST pdfmark
+end
+ -2 2506 a -2 2631 a
+SDict begin H.S end
+ -2 2631
+a -2 2631 a
+SDict begin 11.7 H.A end
+ -2 2631 a -2 2631 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:473) cvn H.B /DEST pdfmark
+end
+ -2 2631 a 562 2726 a
+Fw(NO)m(TE:)21 b Fv(The)e(ser)r(v)n(er)i(will)e(drop)h(root)f(pr)q
+(ivileges)f(after)i(star)s(tup)m(.)f(I)i(does)e(not)h(need)f(wr)q(ite)h
+(access)h(to)f(the)g(data)562 2824 y(\002les)o(,)g(thus)g(the)f(data)g
+(\002le)h(director)r(y)f(is)i(chmod)e(555)g(on)h(installation.)c(It)k
+(does)g(need)e(wr)q(ite)i(access)h(to)e(the)h(log)562
+2921 y(\002le)h(director)r(y)-7 b(.)18 b(As)j(the)f(system)h(log\002le)
+e(director)r(y)h(usually)f(is)i(o)o(wned)e(b)o(y)h(root,)f(the)h
+(install)e(scr)q(ipt)j(will)e(b)o(y)562 3018 y(def)n(ault)f(create)i(a)
+g(subdirector)r(y)f(and)g(cho)o(wn)h(it)g(to)g(the)g(unpr)q(ivileged)c
+(yule)k(user)l(.)g(The)g(PID)g(\002le)g(is)h(wr)q(itten)562
+3115 y(bef)n(ore)e(dropping)e(root.)39 3264 y
+SDict begin H.S end
+ 39 3264
+a 39 3264 a
+SDict begin 13 H.A end
+ 39 3264 a 39 3264 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:474) cvn H.B /DEST pdfmark
+end
+ 39 3264 a -2 3430 a
+SDict begin H.S end
+ -2
+3430 a -2 3430 a
+SDict begin 13 H.A end
+ -2 3430 a -2 3430 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:475) cvn H.B /DEST pdfmark
+end
+ -2 3430 a -2 3430
+a
+SDict begin H.S end
+ -2 3430 a -2 3430 a
+SDict begin 13 H.A end
+ -2 3430 a -2 3430 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.3) cvn H.B /DEST pdfmark
+end
+ -2 3430 a 396
+3434 3359 4 v 396 3434 V 396 3558 4 125 v 424 3533 a
+FD(Purpose)p 2074 3558 V 1346 w(Director)q(y)p 3751 3558
+V 396 3562 3359 4 v 396 3562 V 396 3686 4 125 v 424 3661
+a FC(Log\002les)p 2074 3686 V 1405 w Fk(localstatedir)s
+FC(/log/yule/)p 3751 3686 V 396 3690 3359 4 v 396 3690
+V 396 3814 4 125 v 424 3789 a(Data)k(\002les)p 2074 3814
+V 1362 w Fk(localstatedir)s FC(/lib/yule/)p 3751 3814
+V 396 3817 3359 4 v 396 3817 V 396 3942 4 125 v 424 3917
+a(Pid)g(\002le)p 2074 3942 V 1440 w Fk(localstatedir)s
+FC(/run/)p 3751 3942 V 396 3945 3359 4 v 396 3945 V -2
+4111 a
+SDict begin H.S end
+ -2 4111 a -2 4111 a
+SDict begin 13 H.A end
+ -2 4111 a -2 4111 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLATION-FILES) cvn H.B
+/DEST pdfmark end
+ -2 4111
+a 396 4414 a Fp(2.10.4.)36 b(Installed)f(\002les)1551
+4414 y
+SDict begin H.S end
+ 1551 4414 a 1551 4414 a
+SDict begin 18.72 H.A end
+ 1551 4414 a 1551 4414
+a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.5.2) cvn H.B /DEST pdfmark
+end
+ 1551 4414 a -2 4415 a
+SDict begin H.S end
+ -2 4415 a -2 4415 a
+SDict begin 13 H.A end
+ -2 4415 a
+-2 4415 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLED-CLIENT) cvn H.B /DEST
+pdfmark end
+ -2 4415 a 396 4702 a Fj(2.10.4.1.)29 b(Standalone)f(or)g(c)n
+(lient)1762 4702 y
+SDict begin H.S end
+ 1762 4702 a 1762 4702 a
+SDict begin 15.6 H.A end
+ 1762 4702
+a 1762 4702 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.5.3.3) cvn H.B /DEST pdfmark
+end
+ 1762 4702 a -2 4703 a
+SDict begin H.S end
+ -2 4703 a -2 4703
+a
+SDict begin 13 H.A end
+ -2 4703 a -2 4703 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:497) cvn H.B /DEST pdfmark
+end
+ -2 4703 a -2 4806 a
+SDict begin H.S end
+ -2 4806 a -2
+4806 a
+SDict begin 13 H.A end
+ -2 4806 a -2 4806 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:498) cvn H.B /DEST pdfmark
+end
+ -2 4806 a -2 4806 a
+SDict begin H.S end
+ -2 4806
+a -2 4806 a
+SDict begin 13 H.A end
+ -2 4806 a -2 4806 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.4) cvn H.B /DEST pdfmark
+end
+ -2 4806 a 396 4809 3362
+4 v 396 4809 V 396 4934 4 125 v 424 4909 a FD(File)p
+1516 4934 V 977 w(Installed)23 b(to)p 2635 4934 V 680
+w(Mode)p 3754 4934 V 396 4937 3362 4 v 396 4937 V 396
+5062 4 125 v 424 5037 a FC(samhain)p 1516 5062 V 842
+w Fk(sbindir)s FC(/samhain)p 2635 5062 V 500 w(700)p
+3754 5062 V 396 5065 3362 4 v 396 5065 V 396 5189 4 125
+v 424 5165 a(samhainrc)p 1516 5189 V 777 w Fk(sysconfdir)s
+FC(/samhainrc)p 2635 5189 V 300 w(600)p 3754 5189 V 396
+5193 3362 4 v 396 5193 V 396 5317 4 125 v 424 5292 a(samhain.8)p
+1516 5317 V 779 w Fk(mandir)s FC(/man8/samhain.8)p 2635
+5317 V 273 w(644)p 3754 5317 V 396 5321 3362 4 v Black
+3661 5805 a Fx(11)p Black eop end
+%%Page: 12 17
+TeXDict begin 12 16 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.12) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2538 104 a
+Fx(Chapter)20 b(2.)g(Compiling)f(and)h(installing)p Black
+396 229 3362 4 v 396 229 V 396 354 4 125 v 424 329 a
+FD(File)p 1516 354 V 977 w(Installed)j(to)p 2635 354
+V 680 w(Mode)p 3754 354 V 396 354 3362 4 v 396 478 4
+125 v 424 453 a FC(samhainrc.5)p 1516 478 V 714 w Fk(mandir)s
+FC(/man5/samhainrc.5)p 2635 478 V 208 w(644)p 3754 478
+V 396 481 3362 4 v 396 481 V 396 606 4 125 v 424 581
+a(\(samhain_setpwd\))p 1516 606 V 508 w Fk(sbindir)s
+FC(/samhain_setpwd)p 2635 606 V 222 w(700)p 3754 606
+V 396 609 3362 4 v 396 609 V 396 734 4 125 v 424 709
+a(\(samhain_stealth\))p 1516 734 V 527 w Fk(sbindir)s
+FC(/samhain_stealth)p 2635 734 V 241 w(700)p 3754 734
+V 396 737 3362 4 v 396 737 V -2 820 a
+SDict begin H.S end
+ -2 820 a -2 820
+a
+SDict begin 13 H.A end
+ -2 820 a -2 820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INSTALLED-SERVER) cvn H.B /DEST
+pdfmark end
+ -2 820 a 396 1091 a Fj(2.10.4.2.)29
+b(Ser)q(ver)1122 1091 y
+SDict begin H.S end
+ 1122 1091 a 1122 1091 a
+SDict begin 15.6 H.A end
+ 1122
+1091 a 1122 1091 a
+SDict begin [ /View [/XYZ H.V] /Dest (4.10.5.4.3) cvn H.B /DEST pdfmark
+end
+ 1122 1091 a -2 1092 a
+SDict begin H.S end
+ -2 1092 a -2
+1092 a
+SDict begin 13 H.A end
+ -2 1092 a -2 1092 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:537) cvn H.B /DEST pdfmark
+end
+ -2 1092 a -2 1195 a
+SDict begin H.S end
+ -2 1195
+a -2 1195 a
+SDict begin 13 H.A end
+ -2 1195 a -2 1195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:538) cvn H.B /DEST pdfmark
+end
+ -2 1195 a -2 1195 a
+SDict begin H.S end
+ -2
+1195 a -2 1195 a
+SDict begin 13 H.A end
+ -2 1195 a -2 1195 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.5) cvn H.B /DEST pdfmark
+end
+ -2 1195 a 396 1198
+3362 4 v 396 1198 V 396 1323 4 125 v 424 1298 a FD(File)p
+1516 1323 V 977 w(Installed)23 b(to)p 2635 1323 V 680
+w(Mode)p 3754 1323 V 396 1326 3362 4 v 396 1326 V 396
+1451 4 125 v 424 1426 a FC(yule)p 1516 1451 V 976 w Fk(sbindir)s
+FC(/yule)p 2635 1451 V 634 w(700)p 3754 1451 V 396 1454
+3362 4 v 396 1454 V 396 1579 4 125 v 424 1554 a(yulectl)p
+1516 1579 V 893 w Fk(sbindir)s FC(/yulectl)p 2635 1579
+V 551 w(700)p 3754 1579 V 396 1582 3362 4 v 396 1582
+V 396 1706 4 125 v 424 1681 a(yulerc)p 1516 1706 V 911
+w Fk(sysconfdir)s FC(/yulerc)p 2635 1706 V 434 w(600)p
+3754 1706 V 396 1710 3362 4 v 396 1710 V 396 1834 4 125
+v 424 1809 a(samhain.8)p 1516 1834 V 779 w Fk(mandir)s
+FC(/man8/yule.8)p 2635 1834 V 407 w(644)p 3754 1834 V
+396 1838 3362 4 v 396 1838 V 396 1962 4 125 v 424 1937
+a(samhainrc.5)p 1516 1962 V 714 w Fk(mandir)s FC(/man5/yulerc.5)p
+2635 1962 V 342 w(644)p 3754 1962 V 396 1965 3362 4 v
+396 1965 V 396 2090 4 125 v 424 2065 a(samhain_setpwd)p
+1516 2090 V 564 w Fk(sbindir)s FC(/yule_setpwd)p 2635
+2090 V 356 w(700)p 3754 2090 V 396 2093 3362 4 v 396
+2093 V Black 3661 5805 a Fx(12)p Black eop end
+%%Page: 13 18
+TeXDict begin 13 17 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.13) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:USAGE) cvn H.B /DEST pdfmark
+end
+ -2 226 a 125 x
+Fz(Chapter)48 b(3.)f(General)g(usa)n(g)r(e)h(notes)2581
+351 y
+SDict begin H.S end
+ 2581 351 a 2581 351 a
+SDict begin 26.957 H.A end
+ 2581 351 a 2581 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.0) cvn H.B /DEST pdfmark end
+ 2581
+351 a -2 443 a
+SDict begin H.S end
+ -2 443 a -2 443 a
+SDict begin 13 H.A end
+ -2 443 a -2 443 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HOW-TO-INVOKE) cvn H.B /DEST
+pdfmark end
+ -2
+443 a 339 x Fu(3.1.)39 b(Ho)n(w)g(to)g(in)-6 b(v)l(oke)1239
+782 y
+SDict begin H.S end
+ 1239 782 a 1239 782 a
+SDict begin 22.464 H.A end
+ 1239 782 a 1239 782 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.11.1) cvn H.B /DEST pdfmark
+end
+ 1239
+782 a -2 950 a
+SDict begin H.S end
+ -2 950 a -2 950 a
+SDict begin 13 H.A end
+ -2 950 a -2 950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:579) cvn H.B /DEST pdfmark
+end
+ -2
+950 a -2 950 a
+SDict begin H.S end
+ -2 950 a -2 950 a
+SDict begin 13 H.A end
+ -2 950 a -2 950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:580) cvn H.B /DEST pdfmark
+end
+ -2
+950 a 396 1056 a Fx(F)h(r)l(om)21 b(the)f(command)f(line)-2
+1057 y
+SDict begin H.S end
+ -2 1057 a -2 1057 a
+SDict begin 13 H.A end
+ -2 1057 a -2 1057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:581) cvn H.B /DEST pdfmark
+end
+ -2 1057
+a -2 1067 a
+SDict begin H.S end
+ -2 1067 a -2 1067 a
+SDict begin 13 H.A end
+ -2 1067 a -2 1067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:582) cvn H.B /DEST pdfmark
+end
+ -2
+1067 a Black 396 1226 a FB(\225)p Black 479 1226 a
+SDict begin H.S end
+ 479
+1226 a 479 1226 a
+SDict begin 13 H.A end
+ 479 1226 a 479 1226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:583) cvn H.B /DEST pdfmark
+end
+ 479 1226 a 479
+1226 a
+SDict begin H.S end
+ 479 1226 a 479 1226 a
+SDict begin 13 H.A end
+ 479 1226 a 479 1226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:584) cvn H.B /DEST pdfmark
+end
+ 479
+1226 a Fy(samhain)i(-t)f(init)h([mor)o(e)e(options])h
+FC(\227)h(T)-7 b(o)20 b(initialize)g(the)g(database)-2
+1243 y
+SDict begin H.S end
+ -2 1243 a -2 1243 a
+SDict begin 13 H.A end
+ -2 1243 a -2 1243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:585) cvn H.B /DEST pdfmark
+end
+ -2 1243
+a Black 396 1376 a FB(\225)p Black 479 1376 a
+SDict begin H.S end
+ 479 1376
+a 479 1376 a
+SDict begin 13 H.A end
+ 479 1376 a 479 1376 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:586) cvn H.B /DEST pdfmark
+end
+ 479 1376 a 479 1376
+a
+SDict begin H.S end
+ 479 1376 a 479 1376 a
+SDict begin 13 H.A end
+ 479 1376 a 479 1376 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:587) cvn H.B /DEST pdfmark
+end
+ 479 1376
+a Fy(samhain)h(-t)f(check)h([mor)o(e)e(options])h FC(\227)g(T)-7
+b(o)21 b(check)e(against)h(the)g(database)-2 1560 y
+SDict begin H.S end
+ -2
+1560 a -2 1560 a
+SDict begin 13 H.A end
+ -2 1560 a -2 1560 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:588) cvn H.B /DEST pdfmark
+end
+ -2 1560 a 396 1650
+a FC(By)h(def)o(ault,)785 1650 y
+SDict begin H.S end
+ 785 1650 a 785 1650
+a
+SDict begin 13 H.A end
+ 785 1650 a 785 1650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:589) cvn H.B /DEST pdfmark
+end
+ 785 1650 a FC(samhain)f(will)1233
+1650 y
+SDict begin H.S end
+ 1233 1650 a 1233 1650 a
+SDict begin 13 H.A end
+ 1233 1650 a 1233 1650
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:590) cvn H.B /DEST pdfmark
+end
+ 1233 1650 a Fx(not)h FC(become)e(a)h(daemon,)f(b)n(ut)h(stay)h(in)f
+(the)g(fore)o(ground.)c(Daemon)j(mode)g(must)i(be)396
+1758 y(set)g(in)g(the)f(con\002guration)d(\002le)k(or)f(on)g(the)g
+(command)e(line.)i(Also)h(by)f(def)o(ault,)2690 1758
+y
+SDict begin H.S end
+ 2690 1758 a 2690 1758 a
+SDict begin 13 H.A end
+ 2690 1758 a 2690 1758 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:591) cvn H.B /DEST pdfmark
+end
+ 2690
+1758 a FC(samhain)f(will)3137 1758 y
+SDict begin H.S end
+ 3137 1758 a 3137
+1758 a
+SDict begin 13 H.A end
+ 3137 1758 a 3137 1758 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:592) cvn H.B /DEST pdfmark
+end
+ 3137 1758 a Fx(neither)j
+FC(initialize)396 1866 y(its)f(\002le)g(system)g(database)1180
+1866 y
+SDict begin H.S end
+ 1180 1866 a 1180 1866 a
+SDict begin 13 H.A end
+ 1180 1866 a 1180 1866
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:593) cvn H.B /DEST pdfmark
+end
+ 1180 1866 a Fx(nor)h FC(check)e(the)g(\002le)h(system)f(against)g
+(it.)g(The)g(desired)g(mode)f(must)h(be)g(set)h(in)g(the)396
+1974 y(con\002guration)d(\002le)j(or)f(on)f(the)i(command)d(line.)i(A)g
+(complete)g(list)h(of)f(command)e(line)i(options)f(is)j(gi)n(v)o(en)d
+(in)h(the)396 2081 y(appendix.)-2 2265 y
+SDict begin H.S end
+ -2 2265 a -2
+2265 a
+SDict begin 13 H.A end
+ -2 2265 a -2 2265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:594) cvn H.B /DEST pdfmark
+end
+ -2 2265 a -2 2265 a
+SDict begin H.S end
+ -2 2265
+a -2 2265 a
+SDict begin 13 H.A end
+ -2 2265 a -2 2265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:595) cvn H.B /DEST pdfmark
+end
+ -2 2265 a 396 2355 a
+Fx(T)-8 b(o)21 b(start)g(as)g(daemon)d(during)h(the)i(boot)e(sequence)
+-2 2538 y
+SDict begin H.S end
+ -2 2538 a -2 2538 a
+SDict begin 13 H.A end
+ -2 2538 a -2 2538 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:596) cvn H.B /DEST pdfmark
+end
+ -2
+2538 a 396 2629 a FC(F)o(or)h(Linux)f(\(Debian,)g(Redhat,)h(Gentoo,)f
+(and)g(SuSE\),)h(FreeBSD,)h(Solaris,)f(HP-UX,)g(AIX,)g(IRIX)3314
+2629 y
+SDict begin H.S end
+ 3314 2629 a 3314 2629 a
+SDict begin 13 H.A end
+ 3314 2629 a 3314 2629
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:597) cvn H.B /DEST pdfmark
+end
+ 3314 2629 a Fy(mak)o(e)396 2737 y(install-boot)f FC(will)i(setup)f
+(your)f(system)i(for)e(starting)h(the)g(daemon)f(upon)g(system)h(boot)f
+(\(if)h(the)h(correct)396 2845 y(OS/distrib)n(ution)e(cannot)h(be)g
+(determined,)e(nothing)g(will)j(be)f(done\).)-2 3029
+y
+SDict begin H.S end
+ -2 3029 a -2 3029 a
+SDict begin 13 H.A end
+ -2 3029 a -2 3029 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:598) cvn H.B /DEST pdfmark
+end
+ -2 3029 a 396
+3119 a FC(F)o(or)g(an)o(y)f(other)h(system,)g(you)f(need)h(to)g
+(\002gure)g(out)f(by)h(yourself)f(ho)n(w)h(to)g(start)2691
+3119 y
+SDict begin H.S end
+ 2691 3119 a 2691 3119 a
+SDict begin 13 H.A end
+ 2691 3119 a 2691 3119
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:599) cvn H.B /DEST pdfmark
+end
+ 2691 3119 a FC(samhain)f(during)g(the)h(boot)396 3227
+y(sequence.)-2 3256 y
+SDict begin H.S end
+ -2 3256 a -2 3256 a
+SDict begin 13 H.A end
+ -2 3256 a -2
+3256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DAEMONTOOL) cvn H.B /DEST pdfmark
+end
+ -2 3256 a 359 x Fu(3.2.)39 b(Using)f(daemontool)f(\(or)i
+(similar)g(utilities\))2854 3615 y
+SDict begin H.S end
+ 2854 3615 a 2854 3615
+a
+SDict begin 22.464 H.A end
+ 2854 3615 a 2854 3615 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.12.1) cvn H.B /DEST pdfmark
+end
+ 2854 3615 a -2 3813 a
+SDict begin H.S end
+ -2 3813
+a -2 3813 a
+SDict begin 13 H.A end
+ -2 3813 a -2 3813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:602) cvn H.B /DEST pdfmark
+end
+ -2 3813 a -2 3813 a
+SDict begin H.S end
+ -2
+3813 a -2 3813 a
+SDict begin 13 H.A end
+ -2 3813 a -2 3813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:603) cvn H.B /DEST pdfmark
+end
+ -2 3813 a 396 3889
+a FC(samhain)20 b(does)g(not)g(auto-background)15 b(itself)21
+b(\(to)f(become)f(a)h(daemon\))e(unless)j(e)o(xplicitely)e(speci\002ed)
+h(in)g(the)396 3997 y(con\002g)g(\002le)g(or)g(on)g(the)g(command)f
+(line.)h(Ho)n(we)n(v)o(er)m(,)e(normally)g(it)j(runs)f(in)g
+(single-shot)f(mode)h(if)g(not)g(used)g(as)396 4105 y(daemon.)e(T)-7
+b(o)20 b(cause)1011 4105 y
+SDict begin H.S end
+ 1011 4105 a 1011 4105 a
+SDict begin 13 H.A end
+ 1011
+4105 a 1011 4105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:604) cvn H.B /DEST pdfmark
+end
+ 1011 4105 a FC(samhain)f(to)h(enter)g(the)f(main)h
+(loop)f(while)h(running)e(in)i(the)f(fore)o(ground)d(\(as)21
+b(required)d(if)i(you)396 4212 y(w)o(ant)h(to)f(use)794
+4212 y
+SDict begin H.S end
+ 794 4212 a 794 4212 a
+SDict begin 13 H.A end
+ 794 4212 a 794 4212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:605) cvn H.B /DEST pdfmark
+end
+ 794
+4212 a FC(daemontool\),)e(you)h(need)g(to)i(start)f(with)h(the)f
+(option)2351 4212 y
+SDict begin H.S end
+ 2351 4212 a 2351 4212 a
+SDict begin 13 H.A end
+ 2351 4212
+a 2351 4212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:606) cvn H.B /DEST pdfmark
+end
+ 2351 4212 a Fx(-f)33 b FC(or)2524 4212
+y
+SDict begin H.S end
+ 2524 4212 a 2524 4212 a
+SDict begin 13 H.A end
+ 2524 4212 a 2524 4212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:607) cvn H.B /DEST pdfmark
+end
+ 2524
+4212 a Fx(--for)m(e)o(ver)r FC(.)20 b(Note)g(that)3186
+4212 y
+SDict begin H.S end
+ 3186 4212 a 3186 4212 a
+SDict begin 13 H.A end
+ 3186 4212 a 3186 4212
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:608) cvn H.B /DEST pdfmark
+end
+ 3186 4212 a FC(yule,)f(the)i(serv)o(er)m(,)396 4320
+y(will)g(al)o(w)o(ays)g(loop.)-2 4349 y
+SDict begin H.S end
+ -2 4349 a -2
+4349 a
+SDict begin 13 H.A end
+ -2 4349 a -2 4349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONTROLLING-THE-DAEMON) cvn
+H.B /DEST pdfmark end
+ -2 4349 a 359 x Fu(3.3.)39
+b(Contr)m(olling)e(the)i(daemon)1886 4708 y
+SDict begin H.S end
+ 1886 4708
+a 1886 4708 a
+SDict begin 22.464 H.A end
+ 1886 4708 a 1886 4708 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.13.1) cvn H.B /DEST pdfmark
+end
+ 1886 4708 a -2
+4906 a
+SDict begin H.S end
+ -2 4906 a -2 4906 a
+SDict begin 13 H.A end
+ -2 4906 a -2 4906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:611) cvn H.B /DEST pdfmark
+end
+ -2 4906
+a 396 4982 a FC(As)21 b(part)f(of)g(their)g(boot)f(concept,)g(some)h
+(systems)h(ha)n(v)o(e)e(indi)n(vidual)g(start/stop)h(scripts)g(for)g
+(each)g(service)396 5090 y(\(daemon\).)e(As)j(a)g(minimum,)d(these)i
+(scripts)h(tak)o(e)f(either)g(')-5 b(start')20 b(or)g(')-5
+b(stop')20 b(as)h(ar)o(gument,)d(sometimes)i(also)g(e.g.)396
+5198 y(')l(reload')f(\(to)h(reload)f(the)h(con\002guration\),)d(')l
+(restart',)i(or)h(')-5 b(status')21 b(\(check)e(whether)g(the)h(daemon)
+f(is)i(running\).)396 5306 y(While)g(this)g(is)g(con)m(v)o(enient,)c
+(there)j(are)g(also)g(a)h(number)d(of)i(problems:)p Black
+3661 5805 a Fx(13)p Black eop end
+%%Page: 14 19
+TeXDict begin 14 18 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.14) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2689 104 a
+Fx(Chapter)20 b(3.)g(Gener)o(al)f(usa)o(g)o(e)h(notes)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:612) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:613) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:614) cvn H.B /DEST pdfmark
+end
+ -2
+226 a Black 396 309 a FB(\225)p Black 479 309 a
+SDict begin H.S end
+ 479 309
+a 479 309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:615) cvn H.B /DEST pdfmark
+end
+ 479 309 a FC(Some)g(systems)h(do)f(not)
+f(ha)n(v)o(e)h(such)g(start/stop)g(scripts.)-2 327 y
+SDict begin H.S end
+
+-2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:616) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black 396
+458 a FB(\225)p Black 479 458 a
+SDict begin H.S end
+ 479 458 a 479 458 a
+SDict begin 13 H.A end
+ 479
+458 a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:617) cvn H.B /DEST pdfmark
+end
+ 479 458 a FC(There)g(is)h(no)f(standard)f(for)g(the)h
+(location)g(of)g(these)g(scripts.)-2 476 y
+SDict begin H.S end
+ -2 476 a -2
+476 a
+SDict begin 13 H.A end
+ -2 476 a -2 476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:618) cvn H.B /DEST pdfmark
+end
+ -2 476 a Black 396 608 a FB(\225)p
+Black 479 608 a
+SDict begin H.S end
+ 479 608 a 479 608 a
+SDict begin 13 H.A end
+ 479 608 a 479 608
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:619) cvn H.B /DEST pdfmark
+end
+ 479 608 a FC(There)g(is)h(no)f(standard)f(for)g(the)h(ar)o(guments)e
+(such)i(a)h(script)f(may)g(tak)o(e,)g(neither)f(for)h(their)g
+(interpretation)e(\(e.g.:)479 716 y(on)i(Linux)f(distrib)n(ution)g
+(XYZ,)h(do)g(the)g(start/stop)g(scripts)h(tak)o(e)f(')-5
+b(status')21 b(as)g(ar)o(gument,)c(and)j(if,)g(is)h(the)g(status)479
+823 y(reported)e(by)g(printing)g(a)i(message)f(or)g(by)f(the)i(e)o(xit)
+f(status)h(?\))-2 1139 y
+SDict begin H.S end
+ -2 1139 a -2 1139 a
+SDict begin 13 H.A end
+ -2 1139
+a -2 1139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:620) cvn H.B /DEST pdfmark
+end
+ -2 1139 a 396 1247 a FC(T)-7 b(o)21 b(pro)o(vide)d(a)i
+(portable)f(interf)o(ace)h(for)f(controlling)f(the)2061
+1247 y
+SDict begin H.S end
+ 2061 1247 a 2061 1247 a
+SDict begin 13 H.A end
+ 2061 1247 a 2061 1247
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:621) cvn H.B /DEST pdfmark
+end
+ 2061 1247 a FC(samhain)i(daemon,)e(the)i(e)o(x)o(ecutable)f(itself)i
+(can)e(serv)o(e)396 1355 y(for)h(this)h(purpose)d(\()966
+1355 y
+SDict begin H.S end
+ 966 1355 a 966 1355 a
+SDict begin 13 H.A end
+ 966 1355 a 966 1355 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:622) cvn H.B /DEST pdfmark
+end
+ 966
+1355 a Fx(only)i(if)g(in)m(vok)o(ed)f(by)h(the)h(superuser)r
+FC(\))e(The)h(supported)e(actions,)i(which)g(must)g(be)g(gi)n(v)o(en)f
+(as)396 1463 y
+SDict begin H.S end
+ 396 1463 a 396 1463 a
+SDict begin 13 H.A end
+ 396 1463 a 396 1463
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:623) cvn H.B /DEST pdfmark
+end
+ 396 1463 a Fx(\002r)o(st)i(ar)m(gument)g FC(on)f(the)g(command)e
+(line,)i(are:)-2 1646 y
+SDict begin H.S end
+ -2 1646 a -2 1646 a
+SDict begin 13 H.A end
+ -2 1646 a
+-2 1646 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:624) cvn H.B /DEST pdfmark
+end
+ -2 1646 a -2 1646 a
+SDict begin H.S end
+ -2 1646 a -2 1646 a
+SDict begin 13 H.A end
+ -2
+1646 a -2 1646 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:625) cvn H.B /DEST pdfmark
+end
+ -2 1646 a -2 1656 a
+SDict begin H.S end
+ -2 1656 a -2 1656
+a
+SDict begin 13 H.A end
+ -2 1656 a -2 1656 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:626) cvn H.B /DEST pdfmark
+end
+ -2 1656 a Black 396 1799 a FB(\225)p
+Black 479 1799 a
+SDict begin H.S end
+ 479 1799 a 479 1799 a
+SDict begin 13 H.A end
+ 479 1799 a 479
+1799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:627) cvn H.B /DEST pdfmark
+end
+ 479 1799 a 479 1799 a
+SDict begin H.S end
+ 479 1799 a 479 1799 a
+SDict begin 13 H.A end
+ 479
+1799 a 479 1799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:628) cvn H.B /DEST pdfmark
+end
+ 479 1799 a Fx(start)j FC(Start)831
+1799 y
+SDict begin H.S end
+ 831 1799 a 831 1799 a
+SDict begin 13 H.A end
+ 831 1799 a 831 1799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:629) cvn H.B /DEST pdfmark
+end
+ 831
+1799 a FC(samhain.)d(Ar)o(guments)e(after)i(')-5 b(start')20
+b(are)g(passed)g(to)h(the)f(process.)f(Daemon)g(mode)h(will)h(be)479
+1907 y(enforced,)d(as)j(well)g(as)g(running)d(in)i('check')f(mode,)g
+(irrespecti)n(v)o(e)f(of)i(command)f(line)h(or)g(con\002g)f(\002le)i
+(settings.)-2 1925 y
+SDict begin H.S end
+ -2 1925 a -2 1925 a
+SDict begin 13 H.A end
+ -2 1925 a -2
+1925 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:630) cvn H.B /DEST pdfmark
+end
+ -2 1925 a Black 396 2056 a FB(\225)p Black 479
+2056 a
+SDict begin H.S end
+ 479 2056 a 479 2056 a
+SDict begin 13 H.A end
+ 479 2056 a 479 2056 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:631) cvn H.B /DEST pdfmark
+end
+ 479
+2056 a 479 2056 a
+SDict begin H.S end
+ 479 2056 a 479 2056 a
+SDict begin 13 H.A end
+ 479 2056 a 479
+2056 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:632) cvn H.B /DEST pdfmark
+end
+ 479 2056 a Fx(stop)f FC(Stop)g(the)h(daemon.)d(On)i(Linux)f(and)
+h(Solaris,)g(actually)g(all)g(running)f(instances)h(of)3074
+2056 y
+SDict begin H.S end
+ 3074 2056 a 3074 2056 a
+SDict begin 13 H.A end
+ 3074 2056 a 3074 2056
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:633) cvn H.B /DEST pdfmark
+end
+ 3074 2056 a FC(samhain)f(are)479 2164 y(stopped,)g(e)n(v)o(en)g(if)i
+(no)f(pid)f(\002le)i(is)g(a)n(v)n(ailable.)-2 2182 y
+SDict begin H.S end
+
+-2 2182 a -2 2182 a
+SDict begin 13 H.A end
+ -2 2182 a -2 2182 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:634) cvn H.B /DEST pdfmark
+end
+ -2 2182 a Black
+396 2314 a FB(\225)p Black 479 2314 a
+SDict begin H.S end
+ 479 2314 a 479
+2314 a
+SDict begin 13 H.A end
+ 479 2314 a 479 2314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:635) cvn H.B /DEST pdfmark
+end
+ 479 2314 a 479 2314 a
+SDict begin H.S end
+ 479
+2314 a 479 2314 a
+SDict begin 13 H.A end
+ 479 2314 a 479 2314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:636) cvn H.B /DEST pdfmark
+end
+ 479 2314 a Fx(r)m(estart)i
+FC(Stop)d(and)g(start.)-2 2332 y
+SDict begin H.S end
+ -2 2332 a -2 2332 a
+SDict begin 13 H.A end
+
+-2 2332 a -2 2332 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:637) cvn H.B /DEST pdfmark
+end
+ -2 2332 a Black 396 2463 a FB(\225)p
+Black 479 2463 a
+SDict begin H.S end
+ 479 2463 a 479 2463 a
+SDict begin 13 H.A end
+ 479 2463 a 479
+2463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:638) cvn H.B /DEST pdfmark
+end
+ 479 2463 a 479 2463 a
+SDict begin H.S end
+ 479 2463 a 479 2463 a
+SDict begin 13 H.A end
+ 479
+2463 a 479 2463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:639) cvn H.B /DEST pdfmark
+end
+ 479 2463 a Fx(r)m(eload)g(or)g(for)m(ce-r)m(eload)h
+FC(Reload)f(the)g(con\002guration)e(\002le.)-2 2481 y
+SDict begin H.S end
+
+-2 2481 a -2 2481 a
+SDict begin 13 H.A end
+ -2 2481 a -2 2481 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:640) cvn H.B /DEST pdfmark
+end
+ -2 2481 a Black
+396 2613 a FB(\225)p Black 479 2613 a
+SDict begin H.S end
+ 479 2613 a 479
+2613 a
+SDict begin 13 H.A end
+ 479 2613 a 479 2613 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:641) cvn H.B /DEST pdfmark
+end
+ 479 2613 a 479 2613 a
+SDict begin H.S end
+ 479
+2613 a 479 2613 a
+SDict begin 13 H.A end
+ 479 2613 a 479 2613 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:642) cvn H.B /DEST pdfmark
+end
+ 479 2613 a Fx(status)j
+FC(Check)f(whether)f(the)h(daemon)f(is)i(running.)-2
+2928 y
+SDict begin H.S end
+ -2 2928 a -2 2928 a
+SDict begin 13 H.A end
+ -2 2928 a -2 2928 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:643) cvn H.B /DEST pdfmark
+end
+ -2 2928
+a 396 3036 a FC(Success/f)o(ailure)f(is)h(reported)d(via)j(the)f(e)o
+(xit)g(status)h(as)g(follo)n(ws:)2271 3036 y
+SDict begin H.S end
+ 2271 3036
+a 2271 3036 a
+SDict begin 13 H.A end
+ 2271 3036 a 2271 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:644) cvn H.B /DEST pdfmark
+end
+ 2271 3036 a Fx(0)g
+FC(Success.)f(\(On)g(Linux/Solaris,)3281 3036 y
+SDict begin H.S end
+ 3281
+3036 a 3281 3036 a
+SDict begin 13 H.A end
+ 3281 3036 a 3281 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:645) cvn H.B /DEST pdfmark
+end
+ 3281 3036
+a Fx(stop)h FC(will)396 3144 y(al)o(w)o(ays)g(be)f(successful,)g(on)g
+(other)f(systems)i(only)e(if)h(the)h(pid)e(\002le)i(is)g(found.\))2661
+3144 y
+SDict begin H.S end
+ 2661 3144 a 2661 3144 a
+SDict begin 13 H.A end
+ 2661 3144 a 2661 3144
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:646) cvn H.B /DEST pdfmark
+end
+ 2661 3144 a Fx(1)g FC(Unspeci\002ed)e(error)-5 b(.)3339
+3144 y
+SDict begin H.S end
+ 3339 3144 a 3339 3144 a
+SDict begin 13 H.A end
+ 3339 3144 a 3339 3144
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:647) cvn H.B /DEST pdfmark
+end
+ 3339 3144 a Fx(4)20 b FC(User)h(had)396 3252 y(insuf)n(\002cient)f
+(pri)n(vile)o(ge.)1122 3252 y
+SDict begin H.S end
+ 1122 3252 a 1122 3252 a
+SDict begin 13 H.A end
+
+1122 3252 a 1122 3252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:648) cvn H.B /DEST pdfmark
+end
+ 1122 3252 a Fx(5)g FC(Program)f(is)i(not)f
+(installed.)2017 3252 y
+SDict begin H.S end
+ 2017 3252 a 2017 3252 a
+SDict begin 13 H.A end
+ 2017
+3252 a 2017 3252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:649) cvn H.B /DEST pdfmark
+end
+ 2017 3252 a Fx(7)j FC(Program)c(is)i(not)f(running.)
+-2 3436 y
+SDict begin H.S end
+ -2 3436 a -2 3436 a
+SDict begin 13 H.A end
+ -2 3436 a -2 3436 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:650) cvn H.B /DEST pdfmark
+end
+ -2
+3436 a 396 3526 a FC(If)g(the)595 3526 y
+SDict begin H.S end
+ 595 3526 a 595
+3526 a
+SDict begin 13 H.A end
+ 595 3526 a 595 3526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:651) cvn H.B /DEST pdfmark
+end
+ 595 3526 a Fx(status)g FC(command)e(is)j
+(gi)n(v)o(en:)1458 3526 y
+SDict begin H.S end
+ 1458 3526 a 1458 3526 a
+SDict begin 13 H.A end
+ 1458
+3526 a 1458 3526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:652) cvn H.B /DEST pdfmark
+end
+ 1458 3526 a Fx(0)g FC(Program)d(is)j(running.)2203
+3526 y
+SDict begin H.S end
+ 2203 3526 a 2203 3526 a
+SDict begin 13 H.A end
+ 2203 3526 a 2203 3526
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:653) cvn H.B /DEST pdfmark
+end
+ 2203 3526 a Fx(1)f FC(Program)f(is)i(dead)f(and)f(/v)n(ar/run)g(pid)h
+(\002le)h(e)o(xists.)396 3634 y
+SDict begin H.S end
+ 396 3634 a 396 3634 a
+SDict begin 13 H.A end
+
+396 3634 a 396 3634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:654) cvn H.B /DEST pdfmark
+end
+ 396 3634 a Fx(3)g FC(Program)d(is)j(stopped.)1141
+3634 y
+SDict begin H.S end
+ 1141 3634 a 1141 3634 a
+SDict begin 13 H.A end
+ 1141 3634 a 1141 3634
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:655) cvn H.B /DEST pdfmark
+end
+ 1141 3634 a Fx(4)f FC(Program)f(status)i(is)g(unkno)n(wn.)-2
+3818 y
+SDict begin H.S end
+ -2 3818 a -2 3818 a
+SDict begin 13 H.A end
+ -2 3818 a -2 3818 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:656) cvn H.B /DEST pdfmark
+end
+ -2 3818
+a 396 3908 a FC(I.e.,)f(this)h(interf)o(ace)e(beha)n(v)o(es)g(as)i
+(mandated)e(by)g(the)i(LSB)g(Standard)d(for)i(init)h(scripts.)-2
+3936 y
+SDict begin H.S end
+ -2 3936 a -2 3936 a
+SDict begin 13 H.A end
+ -2 3936 a -2 3936 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SIGNALS) cvn H.B /DEST pdfmark
+end
+ -2 3936
+a 359 x Fu(3.4.)39 b(Signals)789 4295 y
+SDict begin H.S end
+ 789 4295 a 789
+4295 a
+SDict begin 22.464 H.A end
+ 789 4295 a 789 4295 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.14.1) cvn H.B /DEST pdfmark
+end
+ 789 4295 a -2 4493 a
+SDict begin H.S end
+ -2
+4493 a -2 4493 a
+SDict begin 13 H.A end
+ -2 4493 a -2 4493 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:659) cvn H.B /DEST pdfmark
+end
+ -2 4493 a 396 4569
+a FC(On)20 b(startup,)g(all)h(signals)f(will)h(be)f(reset)h(to)f(their)
+g(def)o(ault.)f(Then)h(a)g(signal)g(handler)f(will)i(be)f(installed)g
+(for)g(all)396 4677 y(signals)h(that)f(\(i\))g(can)g(be)g(trapped)f(by)
+h(a)g(process)g(and)g(\(ii\))g(whose)g(def)o(ault)f(action)h(w)o(ould)f
+(be)i(to)f(stop,)g(abort,)f(or)396 4785 y(terminate)h(the)g(process,)f
+(to)i(allo)n(w)f(for)f(graceful)g(termination.)-2 4969
+y
+SDict begin H.S end
+ -2 4969 a -2 4969 a
+SDict begin 13 H.A end
+ -2 4969 a -2 4969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:660) cvn H.B /DEST pdfmark
+end
+ -2 4969 a 396
+5059 a FC(F)o(or)h(SIGSEGV)-11 b(,)20 b(SIGILL,)g(SIGB)o(US,)h(and)e
+(SIGFPE,)i(a)f('f)o(ast')g(termination)f(will)i(occur)m(,)d(with)j
+(only)e(minimal)396 5167 y(cleanup)g(that)i(may)e(result)h(in)h(a)f
+(stale)h(pid)f(\002le)h(being)e(left.)p Black 3661 5805
+a Fx(14)p Black eop end
+%%Page: 15 20
+TeXDict begin 15 19 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.15) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2689 104 a
+Fx(Chapter)20 b(3.)g(Gener)o(al)f(usa)o(g)o(e)h(notes)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:661) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(If)g(the)h(operating)d(system)i(supports)f(the)1605
+309 y
+SDict begin H.S end
+ 1605 309 a 1605 309 a
+SDict begin 13 H.A end
+ 1605 309 a 1605 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:662) cvn H.B /DEST pdfmark
+end
+ 1605
+309 a Fx(siginfo_t)h FC(parameter)f(for)h(the)g(signal)g(handling)e
+(routine)h(\(see)3451 309 y
+SDict begin H.S end
+ 3451 309 a 3451 309 a
+SDict begin 13 H.A end
+ 3451
+309 a 3451 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:663) cvn H.B /DEST pdfmark
+end
+ 3451 309 a Fy(man)396 417 y(sigaction)p
+FC(\),)g(the)h(origin)f(of)h(the)g(signal)h(will)g(be)f(check)o(ed.)-2
+601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:664) cvn H.B /DEST pdfmark
+end
+ -2 601 a 396
+691 a FC(The)g(follo)n(wing)f(signals)h(can)g(be)g(sent)h(to)f(the)g
+(process)g(to)g(control)f(it:)-2 875 y
+SDict begin H.S end
+ -2 875 a -2 875
+a
+SDict begin 13 H.A end
+ -2 875 a -2 875 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:665) cvn H.B /DEST pdfmark
+end
+ -2 875 a -2 875 a
+SDict begin H.S end
+ -2 875 a -2 875
+a
+SDict begin 13 H.A end
+ -2 875 a -2 875 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:666) cvn H.B /DEST pdfmark
+end
+ -2 875 a -2 885 a
+SDict begin H.S end
+ -2 885 a -2 885
+a
+SDict begin 13 H.A end
+ -2 885 a -2 885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:667) cvn H.B /DEST pdfmark
+end
+ -2 885 a Black 396 1027 a FB(\225)p
+Black 479 1027 a
+SDict begin H.S end
+ 479 1027 a 479 1027 a
+SDict begin 13 H.A end
+ 479 1027 a 479
+1027 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:668) cvn H.B /DEST pdfmark
+end
+ 479 1027 a 479 1027 a
+SDict begin H.S end
+ 479 1027 a 479 1027 a
+SDict begin 13 H.A end
+ 479
+1027 a 479 1027 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:669) cvn H.B /DEST pdfmark
+end
+ 479 1027 a Fx(SIGUSR1)g FC(Switch)h(on/of)n(f)f
+(maximally)g(v)o(erbose)f(output)h(to)i(the)f(console.)-2
+1045 y
+SDict begin H.S end
+ -2 1045 a -2 1045 a
+SDict begin 13 H.A end
+ -2 1045 a -2 1045 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:670) cvn H.B /DEST pdfmark
+end
+ -2 1045
+a Black 396 1176 a FB(\225)p Black 479 1176 a
+SDict begin H.S end
+ 479 1176
+a 479 1176 a
+SDict begin 13 H.A end
+ 479 1176 a 479 1176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:671) cvn H.B /DEST pdfmark
+end
+ 479 1176 a 479 1176
+a
+SDict begin H.S end
+ 479 1176 a 479 1176 a
+SDict begin 13 H.A end
+ 479 1176 a 479 1176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:672) cvn H.B /DEST pdfmark
+end
+ 479 1176
+a Fx(SIGUSR2)f FC(Suspend/continue)e(the)j(process,)g(and)f(\(on)h
+(suspend\))f(send)h(a)g(message)g(to)h(the)f(serv)o(er)-5
+b(.)19 b(This)479 1284 y(message)h(has)h(the)f(same)g(priority)f(as)i
+(timestamps.)f(This)g(signal)g(allo)n(ws)h(to)f(run)2845
+1284 y
+SDict begin H.S end
+ 2845 1284 a 2845 1284 a
+SDict begin 13 H.A end
+ 2845 1284 a 2845 1284
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:673) cvn H.B /DEST pdfmark
+end
+ 2845 1284 a Fy(samhain)h(-t)f(init)h(-e)f(none)h FC(on)479
+1392 y(the)f(client)g(to)f(re)o(generate)f(the)i(database,)f(with)g(do)
+n(wnload)f(of)h(the)h(con\002guration)d(\002le)j(from)f(the)h(serv)o
+(er)m(,)e(while)479 1500 y(the)i(daemon)f(is)i(suspended)e(\(normally)f
+(you)h(w)o(ould)h(get)g(errors)f(because)h(of)g(concurrent)e(access)i
+(to)h(the)479 1608 y(serv)o(er)f(by)f(tw)o(o)i(processes)f(from)f(the)
+1593 1608 y
+SDict begin H.S end
+ 1593 1608 a 1593 1608 a
+SDict begin 13 H.A end
+ 1593 1608 a 1593
+1608 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:674) cvn H.B /DEST pdfmark
+end
+ 1593 1608 a Fx(same)h(host)q FC(\).)-2 1626 y
+SDict begin H.S end
+
+-2 1626 a -2 1626 a
+SDict begin 13 H.A end
+ -2 1626 a -2 1626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:675) cvn H.B /DEST pdfmark
+end
+ -2 1626 a Black
+396 1757 a FB(\225)p Black 479 1757 a
+SDict begin H.S end
+ 479 1757 a 479
+1757 a
+SDict begin 13 H.A end
+ 479 1757 a 479 1757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:676) cvn H.B /DEST pdfmark
+end
+ 479 1757 a 479 1757 a
+SDict begin H.S end
+ 479
+1757 a 479 1757 a
+SDict begin 13 H.A end
+ 479 1757 a 479 1757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:677) cvn H.B /DEST pdfmark
+end
+ 479 1757 a Fx(SIGTERM)j
+FC(T)-6 b(erminate)19 b(the)i(process.)-2 1775 y
+SDict begin H.S end
+ -2 1775
+a -2 1775 a
+SDict begin 13 H.A end
+ -2 1775 a -2 1775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:678) cvn H.B /DEST pdfmark
+end
+ -2 1775 a Black 396 1907
+a FB(\225)p Black 479 1907 a
+SDict begin H.S end
+ 479 1907 a 479 1907 a
+SDict begin 13 H.A end
+ 479
+1907 a 479 1907 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:679) cvn H.B /DEST pdfmark
+end
+ 479 1907 a 479 1907 a
+SDict begin H.S end
+ 479 1907 a 479
+1907 a
+SDict begin 13 H.A end
+ 479 1907 a 479 1907 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:680) cvn H.B /DEST pdfmark
+end
+ 479 1907 a Fx(SIGQ)o(UIT)26
+b FC(T)-6 b(erminate)20 b(the)g(serv)o(er)f(process)h(after)g
+(processing)f(all)h(currently)f(pending)f(requests)i(from)479
+2015 y(clients.)h(T)-6 b(erminate)19 b(the)h(client)g(process)g(after)g
+(\002nishing)f(the)h(current)f(task)i(\(from)e(the)h(terminal,)3358
+2015 y
+SDict begin H.S end
+ 3358 2015 a 3358 2015 a
+SDict begin 13 H.A end
+ 3358 2015 a 3358 2015
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:681) cvn H.B /DEST pdfmark
+end
+ 3358 2015 a Fx(SIGQ)o(UIT)479 2123 y FC(usually)g(is)816
+2123 y
+SDict begin H.S end
+ 816 2123 a 816 2123 a
+SDict begin 13 H.A end
+ 816 2123 a 816 2123 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:682) cvn H.B /DEST pdfmark
+end
+ 816
+2123 a 816 2123 a
+SDict begin H.S end
+ 816 2123 a 816 2123 a
+SDict begin 13 H.A end
+ 816 2123 a 816
+2123 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:683) cvn H.B /DEST pdfmark
+end
+ 816 2123 a Fy(Ctrl)p FC(-)992 2123 y
+SDict begin H.S end
+ 992 2123
+a 992 2123 a
+SDict begin 13 H.A end
+ 992 2123 a 992 2123 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:684) cvn H.B /DEST pdfmark
+end
+ 992 2123 a Fy(\\)p
+FC(\).)-2 2141 y
+SDict begin H.S end
+ -2 2141 a -2 2141 a
+SDict begin 13 H.A end
+ -2 2141 a -2 2141
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:685) cvn H.B /DEST pdfmark
+end
+ -2 2141 a Black 396 2272 a FB(\225)p Black 479 2272
+a
+SDict begin H.S end
+ 479 2272 a 479 2272 a
+SDict begin 13 H.A end
+ 479 2272 a 479 2272 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:686) cvn H.B /DEST pdfmark
+end
+ 479 2272
+a 479 2272 a
+SDict begin H.S end
+ 479 2272 a 479 2272 a
+SDict begin 13 H.A end
+ 479 2272 a 479 2272
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:687) cvn H.B /DEST pdfmark
+end
+ 479 2272 a Fx(SIGHUP)g FC(Re-read)f(the)h(con\002guration)e(\002le.)j
+(Note)f(that)g(it)h(is)g(not)f(possible)g(to)g(o)o(v)o(erride)e
+(command-line)479 2380 y(options)i(gi)n(v)o(en)e(at)j(startup.)-2
+2398 y
+SDict begin H.S end
+ -2 2398 a -2 2398 a
+SDict begin 13 H.A end
+ -2 2398 a -2 2398 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:688) cvn H.B /DEST pdfmark
+end
+ -2 2398
+a Black 396 2530 a FB(\225)p Black 479 2530 a
+SDict begin H.S end
+ 479 2530
+a 479 2530 a
+SDict begin 13 H.A end
+ 479 2530 a 479 2530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:689) cvn H.B /DEST pdfmark
+end
+ 479 2530 a 479 2530
+a
+SDict begin H.S end
+ 479 2530 a 479 2530 a
+SDict begin 13 H.A end
+ 479 2530 a 479 2530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:690) cvn H.B /DEST pdfmark
+end
+ 479 2530
+a Fx(SIGABRT)26 b FC(Unlock)19 b(the)h(log)g(\002le,)h(w)o(ait)g(three)
+e(seconds,)h(then)f(proceed.)g(At)h(the)h(ne)o(xt)e(access,)i(the)f
+(log)g(\002le)479 2637 y(will)h(be)f(lock)o(ed)g(again)f(and)g(a)i
+(fresh)f(audit)g(trail)g(--)g(with)g(a)h(fresh)f(signature)f(k)o(e)o(y)
+g(--)i(will)f(be)h(started.)e(This)479 2745 y(allo)n(ws)i(log)f
+(rotation)f(without)g(splitting)h(an)g(audit)g(trail.)g(See)h(Sect.~)p
+0 TeXcolorgray 2499 2745 a
+SDict begin H.S end
+ 2499 2745 a FC(Section)e(4.5.1)2936
+2745 y
+SDict begin 13 H.L end
+ 2936 2745 a 2936 2745 a
+SDict begin [ /Subtype /Link /Dest (0:LOGFILE) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2936 2745 a Black -2 w
+FC(.)-2 2763 y
+SDict begin H.S end
+ -2 2763 a -2 2763 a
+SDict begin 13 H.A end
+ -2 2763 a -2 2763
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:692) cvn H.B /DEST pdfmark
+end
+ -2 2763 a Black 396 2895 a FB(\225)p Black 479 2895
+a
+SDict begin H.S end
+ 479 2895 a 479 2895 a
+SDict begin 13 H.A end
+ 479 2895 a 479 2895 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:693) cvn H.B /DEST pdfmark
+end
+ 479 2895
+a 479 2895 a
+SDict begin H.S end
+ 479 2895 a 479 2895 a
+SDict begin 13 H.A end
+ 479 2895 a 479 2895
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:694) cvn H.B /DEST pdfmark
+end
+ 479 2895 a Fx(SIGTT)o(OU)k FC(Perform)c(a)i(\002le)g(check.)e(Only)h
+(client/standalone,)e(and)h(only)h(in)g(daemon)f(mode.)-2
+3054 y
+SDict begin H.S end
+ -2 3054 a -2 3054 a
+SDict begin 13 H.A end
+ -2 3054 a -2 3054 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PID-FILE) cvn H.B /DEST pdfmark
+end
+ -2 3054
+a 378 x Fu(3.5.)39 b(PID)g(\002le)764 3432 y
+SDict begin H.S end
+ 764 3432
+a 764 3432 a
+SDict begin 22.464 H.A end
+ 764 3432 a 764 3432 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.15.1) cvn H.B /DEST pdfmark
+end
+ 764 3432 a -2 3600
+a
+SDict begin H.S end
+ -2 3600 a -2 3600 a
+SDict begin 13 H.A end
+ -2 3600 a -2 3600 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:697) cvn H.B /DEST pdfmark
+end
+ -2 3600 a -2
+3600 a
+SDict begin H.S end
+ -2 3600 a -2 3600 a
+SDict begin 13 H.A end
+ -2 3600 a -2 3600 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:698) cvn H.B /DEST pdfmark
+end
+ -2 3600
+a 396 3706 a FC(samhain)20 b(generates)f(a)i(PID)f(\002le)h(if)f(it)h
+(is)g(run)f(as)h(a)f(daemon)f(process.)h(Y)-9 b(ou)19
+b(can)h(con\002gure)e(the)j(path)e(to)i(the)f(PID)396
+3814 y(\002le)h(at)g(compile)e(time,)h(either)g(e)o(xplicitely)f(using)
+h(the)1984 3814 y
+SDict begin H.S end
+ 1984 3814 a 1984 3814 a
+SDict begin 13 H.A end
+ 1984 3814 a
+1984 3814 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:699) cvn H.B /DEST pdfmark
+end
+ 1984 3814 a Fy(./con\002gur)o(e)f(--with-pid-\002le=FILE)i
+FC(option,)e(or)g(via)i(the)396 3922 y
+SDict begin H.S end
+ 396 3922 a 396
+3922 a
+SDict begin 13 H.A end
+ 396 3922 a 396 3922 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:700) cvn H.B /DEST pdfmark
+end
+ 396 3922 a Fy(./con\002gur)o(e)e(--pr)o
+(e\002x=PREFIX)h FC(option.)-2 3950 y
+SDict begin H.S end
+ -2 3950 a -2 3950
+a
+SDict begin 13 H.A end
+ -2 3950 a -2 3950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LOG-FILE-ROTATION) cvn H.B
+/DEST pdfmark end
+ -2 3950 a 359 x Fu(3.6.)39 b(Log)g(\002le)g(r)m
+(otation)1360 4309 y
+SDict begin H.S end
+ 1360 4309 a 1360 4309 a
+SDict begin 22.464 H.A end
+ 1360 4309
+a 1360 4309 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.16.1) cvn H.B /DEST pdfmark
+end
+ 1360 4309 a -2 4507 a
+SDict begin H.S end
+ -2 4507 a -2 4507
+a
+SDict begin 13 H.A end
+ -2 4507 a -2 4507 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:703) cvn H.B /DEST pdfmark
+end
+ -2 4507 a -2 4507 a
+SDict begin H.S end
+ -2 4507 a -2
+4507 a
+SDict begin 13 H.A end
+ -2 4507 a -2 4507 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:704) cvn H.B /DEST pdfmark
+end
+ -2 4507 a 396 4583 a FC(samhain)20
+b(locks)g(the)g(log\002le)g(using)g(a)g(lock)g(\002le.)h(This)f(lock)g
+(\002le)g(has)h(the)f(same)g(path)g(as)h(the)f(log)g(\002le,)h(with)
+3537 4583 y
+SDict begin H.S end
+ 3537 4583 a 3537 4583 a
+SDict begin 13 H.A end
+ 3537 4583 a 3537
+4583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:705) cvn H.B /DEST pdfmark
+end
+ 3537 4583 a Fx(.loc)n(k)396 4691 y FC(appended.)d(After)i
+(sending)f(SIGABR)-5 b(T)21 b(to)f(the)1809 4691 y
+SDict begin H.S end
+ 1809
+4691 a 1809 4691 a
+SDict begin 13 H.A end
+ 1809 4691 a 1809 4691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:706) cvn H.B /DEST pdfmark
+end
+ 1809 4691
+a FC(samhain)g(daemon,)e(it)j(will)g(\002rst)g(\002nish)f(its)h
+(current)e(tast)i(\(this)396 4799 y(may)f(tak)o(e)g(some)g(time\),)g
+(then)g(unlock)e(the)j(log)f(\002le)g(\(i.e.)g(remo)o(v)o(e)e(the)2457
+4799 y
+SDict begin H.S end
+ 2457 4799 a 2457 4799 a
+SDict begin 13 H.A end
+ 2457 4799 a 2457 4799
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:707) cvn H.B /DEST pdfmark
+end
+ 2457 4799 a Fr(logfile.lock)g FC(\002le\),)j(w)o(ait)g(three)396
+4907 y(seconds,)d(then)g(proceed.)f(Thus,)h(to)h(rotate)f(the)h(log)f
+(\002le,)h(you)f(should)f(use)i(something)e(lik)o(e)i(the)g(follo)n
+(wing)e(script:)-2 5008 y
+SDict begin H.S end
+ -2 5008 a -2 5008 a
+SDict begin 11.7 H.A end
+ -2 5008
+a -2 5008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:708) cvn H.B /DEST pdfmark
+end
+ -2 5008 a 396 5087 a Fr(#!)45 b(/bin/sh)396
+5281 y(if)g(test)f(-f)g(/usr/local/var/run/samhain.pid;)c(then)k(\\)845
+5378 y(PIN=`cat)f(/usr/local/var/run/samhain.pid`;)d(\\)p
+Black 3661 5805 a Fx(15)p Black eop end
+%%Page: 16 21
+TeXDict begin 16 20 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.16) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2689 104 a
+Fx(Chapter)20 b(3.)g(Gener)o(al)f(usa)o(g)o(e)h(notes)p
+Black 845 309 a Fr(/bin/kill)43 b(-ABRT)h($PIN;)g(\\)845
+406 y(sleep)g(1;)g(\\)845 503 y(AA=0;)g(\\)845 600 y(while)g(test)g
+("x$AA")g(!=)g("x120";)g(do)g(\\)889 697 y(let)h("AA)f(=)h($AA)f(+)h
+(1";)f(\\)889 794 y(if)h(test)f(-f)h
+(/usr/local/var/log/samhain_log.lock;)38 b(then)45 b(\\)979
+892 y(sleep)f(1;)h(\\)889 989 y(else)g(\\)979 1086 y(break;)f(\\)889
+1183 y(fi)h(\\)845 1280 y(done;)f(\\)441 1377 y(fi)755
+1474 y(mv)g(/usr/local/var/log/samhain_log)c(/usr/local/var/log/oldlog)
+-2 1652 y
+SDict begin H.S end
+ -2 1652 a -2 1652 a
+SDict begin 13 H.A end
+ -2 1652 a -2 1652 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:709) cvn H.B /DEST pdfmark
+end
+ -2
+1652 a 396 1748 a FC(If)20 b(you)g(use)g(the)g(')o(logrotate')f(tool,)g
+(you)h(could)f(use)h(the)g(follo)n(wing)f(\(untested\):)-2
+1849 y
+SDict begin H.S end
+ -2 1849 a -2 1849 a
+SDict begin 11.7 H.A end
+ -2 1849 a -2 1849 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:710) cvn H.B /DEST pdfmark
+end
+ -2 1849
+a 396 1928 a Fr(/usr/local/var/log/samhain_log)40 b({)576
+2026 y(size)k(100k)576 2123 y(nocreate)576 2220 y(compress)576
+2317 y(mail)g(root@localhost)576 2414 y(maillast)396
+2608 y(prerotate)755 2706 y(if)g(test)h(-f)f
+(/usr/local/var/run/samhain.pid;)c(then)k(\\)845 2803
+y(PIN=`cat)f(/usr/local/var/run/samhain.pid`;)d(\\)845
+2900 y(/bin/kill)j(-ABRT)h($PIN;)g(\\)845 2997 y(sleep)g(1;)g(\\)845
+3094 y(AA=0;)g(\\)845 3191 y(while)g(test)g("x$AA")g(!=)g("x120";)g(do)
+g(\\)889 3288 y(let)h("AA)f(=)h($AA)f(+)h(1";)f(\\)889
+3385 y(if)h(test)f(-f)h(/usr/local/var/log/samhain_log.lock;)38
+b(then)45 b(\\)979 3483 y(sleep)f(1;)h(\\)889 3580 y(else)g(\\)979
+3677 y(break;)f(\\)889 3774 y(fi)h(\\)845 3871 y(done;)f(\\)755
+3968 y(fi)576 4065 y(endscript)396 4163 y(})-2 4254 y
+SDict begin H.S end
+
+-2 4254 a -2 4254 a
+SDict begin 13 H.A end
+ -2 4254 a -2 4254 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:UPDATING-THE-FILE-SIGNATURE-DATABASE)
+cvn H.B /DEST pdfmark end
+ -2 4254 a 369
+x Fu(3.7.)39 b(Updating)e(the)i(\002le)h(signature)d(database)2750
+4623 y
+SDict begin H.S end
+ 2750 4623 a 2750 4623 a
+SDict begin 22.464 H.A end
+ 2750 4623 a 2750 4623
+a
+SDict begin [ /View [/XYZ H.V] /Dest (5.17.1) cvn H.B /DEST pdfmark
+end
+ 2750 4623 a -2 4821 a
+SDict begin H.S end
+ -2 4821 a -2 4821 a
+SDict begin 13 H.A end
+ -2 4821 a
+-2 4821 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:713) cvn H.B /DEST pdfmark
+end
+ -2 4821 a 396 4897 a FC(The)546 4897 y
+SDict begin H.S end
+ 546
+4897 a 546 4897 a
+SDict begin 13 H.A end
+ 546 4897 a 546 4897 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:714) cvn H.B /DEST pdfmark
+end
+ 546 4897 a FC(samhain)20
+b(daemon)e(only)i(reads)f(the)i(\002le)g(signature)e(database)g(on)h
+(startup)g(\(also)g(see)p 0 TeXcolorgray 3032 4897 a
+SDict begin H.S end
+
+3032 4897 a FC(Section)g(5.4.4)3470 4897 y
+SDict begin 13 H.L end
+ 3470 4897
+a 3470 4897 a
+SDict begin [ /Subtype /Link /Dest (0:DYNUP) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3470 4897 a Black 18 w FC(on)396 5005 y(this\).)g(Y)-9
+b(ou)20 b(can)g(update)f(the)h(database)g(while)g(the)g(daemon)f(is)i
+(running,)d(as)j(long)e(as)i(you)e(don')o(t)g(interfere)g(with)396
+5113 y(its)i(logging)e(\(i.e.)h(you)f(should)g(run)1439
+5113 y
+SDict begin H.S end
+ 1439 5113 a 1439 5113 a
+SDict begin 13 H.A end
+ 1439 5113 a 1439 5113
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:716) cvn H.B /DEST pdfmark
+end
+ 1439 5113 a Fy(samhain)h(-t)g(update)h(-l)f(none)h
+FC(to)f(mak)o(e)g(sure)g(the)g(log)g(\002le)h(is)g(not)f(accessed\).)
+396 5220 y(Interacti)n(v)o(e)f(updates)g(are)h(supported)e(with)j(the)f
+(command)e(line)i(\003ag)2443 5220 y
+SDict begin H.S end
+ 2443 5220 a 2443
+5220 a
+SDict begin 13 H.A end
+ 2443 5220 a 2443 5220 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:717) cvn H.B /DEST pdfmark
+end
+ 2443 5220 a Fy(--interacti)o(v)o(e)p
+Black 3660 5805 a Fx(16)p Black eop end
+%%Page: 17 22
+TeXDict begin 17 21 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.17) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2689 104 a
+Fx(Chapter)20 b(3.)g(Gener)o(al)f(usa)o(g)o(e)h(notes)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:718) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(If)g(you)g(are)g(using)940 309 y
+SDict begin H.S end
+ 940
+309 a 940 309 a
+SDict begin 13 H.A end
+ 940 309 a 940 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:719) cvn H.B /DEST pdfmark
+end
+ 940 309 a FC(samhain)g(in)g
+(client/serv)o(er)f(mode)1958 309 y
+SDict begin H.S end
+ 1958 309 a 1958 309
+a
+SDict begin 13 H.A end
+ 1958 309 a 1958 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:720) cvn H.B /DEST pdfmark
+end
+ 1958 309 a Fx(and)j FC(k)o(eep)e(the)g
+(baseline)g(database)f(on)h(the)g(serv)o(er)m(,)f(then)396
+417 y(there)h(are)g(tw)o(o)h(w)o(ays)f(to)g(update)g(the)g(database:)-2
+435 y
+SDict begin H.S end
+ -2 435 a -2 435 a
+SDict begin 13 H.A end
+ -2 435 a -2 435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:721) cvn H.B /DEST pdfmark
+end
+ -2 435 a -2
+445 a
+SDict begin H.S end
+ -2 445 a -2 445 a
+SDict begin 13 H.A end
+ -2 445 a -2 445 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:722) cvn H.B /DEST pdfmark
+end
+ -2 445 a Black
+396 587 a FB(\225)p Black 479 587 a
+SDict begin H.S end
+ 479 587 a 479 587
+a
+SDict begin 13 H.A end
+ 479 587 a 479 587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:723) cvn H.B /DEST pdfmark
+end
+ 479 587 a FC(The)g(preferred)e(method)h(is)i(to)f
+(use)h(the)f(web-based)f(\(PHP4\))2285 587 y
+SDict begin H.S end
+ 2285 587
+a 2285 587 a
+SDict begin 13 H.A end
+ 2285 587 a 2285 587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:724) cvn H.B /DEST pdfmark
+end
+ 2285 587 a FC(beltane)g
+(\(http://www)-5 b(.la-samhna.de/beltane/\))479 695 y(frontend,)18
+b(which)i(allo)n(ws)g(to)h(re)n(vie)n(w)e(client)h(messages)h(and)e(to)
+i(perform)2643 695 y
+SDict begin H.S end
+ 2643 695 a 2643 695 a
+SDict begin 13 H.A end
+ 2643 695 a
+2643 695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:725) cvn H.B /DEST pdfmark
+end
+ 2643 695 a Fx(server)n(-side)g FC(updates)e(of)h(baseline)
+479 803 y(databases.)-2 804 y
+SDict begin H.S end
+ -2 804 a -2 804 a
+SDict begin 13 H.A end
+ -2 804
+a -2 804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:726) cvn H.B /DEST pdfmark
+end
+ -2 804 a Black 396 952 a FB(\225)p Black 479
+952 a
+SDict begin H.S end
+ 479 952 a 479 952 a
+SDict begin 13 H.A end
+ 479 952 a 479 952 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:727) cvn H.B /DEST pdfmark
+end
+ 479 952
+a FC(T)-6 b(emporarily)909 952 y
+SDict begin H.S end
+ 909 952 a 909 952 a
+SDict begin 13 H.A end
+
+909 952 a 909 952 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:728) cvn H.B /DEST pdfmark
+end
+ 909 952 a Fy(scp)21 b FC(the)g(baseline)e(database)
+h(to)g(the)g(client,)g(run)2332 952 y
+SDict begin H.S end
+ 2332 952 a 2332
+952 a
+SDict begin 13 H.A end
+ 2332 952 a 2332 952 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:729) cvn H.B /DEST pdfmark
+end
+ 2332 952 a Fy(samhain)h(-t)f(update)p
+FC(,)g(and)3155 952 y
+SDict begin H.S end
+ 3155 952 a 3155 952 a
+SDict begin 13 H.A end
+ 3155 952
+a 3155 952 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:730) cvn H.B /DEST pdfmark
+end
+ 3155 952 a Fy(scp)h FC(the)g(baseline)479
+1060 y(database)f(back)f(to)i(the)f(serv)o(er)-5 b(.)19
+b(If)i(you)e(w)o(ant)h(to)g(k)o(eep)g(the)g(client)h(daemon)d(running)g
+(during)h(the)h(update,)f(you)479 1168 y(need)h(to)g(a)n(v)n(oid)g
+(concurrent)e(access)j(to)f(the)g(log)g(\002le)h(\(use)f('-l)g(none')f
+(for)g(the)i(update)e(process\).)g(Also,)h(you)479 1276
+y(need)g(to)g(a)n(v)n(oid)g(concurrent)e(access)j(to)f(the)g(serv)o(er)
+f(\(use)i('-e)e(none')g(for)h(the)g(update)f(process\).)-2
+1460 y
+SDict begin H.S end
+ -2 1460 a -2 1460 a
+SDict begin 13 H.A end
+ -2 1460 a -2 1460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:731) cvn H.B /DEST pdfmark
+end
+ -2 1460
+a 479 1550 a FC(If)h(you)701 1550 y
+SDict begin H.S end
+ 701 1550 a 701 1550
+a
+SDict begin 13 H.A end
+ 701 1550 a 701 1550 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:732) cvn H.B /DEST pdfmark
+end
+ 701 1550 a Fx(must)i FC(access)e(the)h(serv)o
+(er)e(concurrently)e(\(e.g.)j(to)g(do)n(wnload)e(the)i(con\002guration)
+e(\002le)j(for)e(the)h(update)479 1658 y(process\),)f(you)h(need)f(to)i
+(suspend)e(the)h(client)g(daemon)f(process)h(temporarily)e(using)h
+(SIGUSR2)i(\(note)e(that)479 1766 y(SIGST)o(OP/SIGCONT)h(will)h(not)f
+(do)g(what)g(you)f(w)o(ant,)h(because)g(the)g(daemon)e(must)j(inform)d
+(the)j(serv)o(er)e(that)479 1874 y(it)i(is)g(about)f(to)g(suspend\).)f
+(Use)h(SIGUSR2)h(again)e(to)h(w)o(ak)o(e)h(up)e(the)i(daemon)d(from)h
+(suspend)h(mode.)-2 2033 y
+SDict begin H.S end
+ -2 2033 a -2 2033 a
+SDict begin 13 H.A end
+ -2 2033
+a -2 2033 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:IMPROVING-THE-SIGNAL-TO-NOISE-RATIO)
+cvn H.B /DEST pdfmark end
+ -2 2033 a 378 x Fu(3.8.)39 b(Impr)m(o)m(ving)f(the)h
+(signal-to-noise)d(ratio)2632 2411 y
+SDict begin H.S end
+ 2632 2411 a 2632
+2411 a
+SDict begin 22.464 H.A end
+ 2632 2411 a 2632 2411 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.18.1) cvn H.B /DEST pdfmark
+end
+ 2632 2411 a -2 2609 a
+SDict begin H.S end
+
+-2 2609 a -2 2609 a
+SDict begin 13 H.A end
+ -2 2609 a -2 2609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:735) cvn H.B /DEST pdfmark
+end
+ -2 2609 a 396
+2685 a FC(T)-7 b(o)21 b(get)f(a)g(good)f(signal-to-noise)f(ratio)i
+(\(i.e.)g(fe)n(w)g(f)o(alse)h(alerts\),)f(you)f(need)h(to)g(kno)n(w)f
+(which)h(\002les)h(should)e(be)396 2793 y(check)o(ed,)g(and)h(which)f
+(not)h(\(looking)e(at)j(the)f(')o(last)h(modi\002ed')e(timestamp)g(may)
+h(be)g(helpful,)f(if)h(in)h(doubt\).)-2 2977 y
+SDict begin H.S end
+ -2 2977
+a -2 2977 a
+SDict begin 13 H.A end
+ -2 2977 a -2 2977 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:736) cvn H.B /DEST pdfmark
+end
+ -2 2977 a 396 3066 a
+FC(T)-7 b(o)21 b(see)f(ho)n(w)g(to)g(set)h(recursion)e(depths,)g
+(implement)g('check)g(all)i(b)n(ut)f(xxx')f(policies)h(etc.,)g(ha)n(v)o
+(e)g(a)g(look)g(at)p 0 TeXcolorgray 396 3174 a
+SDict begin H.S end
+ 396 3174
+a FC(Section)g(5.4.1)834 3174 y
+SDict begin 13 H.L end
+ 834 3174 a 834 3174 a
+SDict begin [ /Subtype /Link /Dest (0:POLICY) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+834 3174 a Black -2 w FC(.)-2 3341 y
+SDict begin H.S end
+ -2 3341 a -2 3341
+a
+SDict begin 13 H.A end
+ -2 3341 a -2 3341 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:738) cvn H.B /DEST pdfmark
+end
+ -2 3341 a 396 3448 a FC(As)509
+3448 y
+SDict begin H.S end
+ 509 3448 a 509 3448 a
+SDict begin 13 H.A end
+ 509 3448 a 509 3448 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:739) cvn H.B /DEST pdfmark
+end
+ 509
+3448 a FC(samhain)g(runs)f(a)i(a)g(daemon,)d(it)j(is)g(capable)e(to)i
+(')l(remember')c(all)k(\002le)g(system)f(changes,)f(thus)h(you)g(w)o
+(on')o(t)f(get)396 3556 y(bothered)g(twice)h(about)f(the)i(same)f
+(problem.)-2 3585 y
+SDict begin H.S end
+ -2 3585 a -2 3585 a
+SDict begin 13 H.A end
+ -2 3585 a -2
+3585 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:OPTIONS-CONFIGURATION-FILE)
+cvn H.B /DEST pdfmark end
+ -2 3585 a 359 x Fu(3.9.)39 b(Runtime)f(options:)f(command-line)g
+(&)i(con\002guration)-2 4130 y(\002le)206 4130 y
+SDict begin H.S end
+ 206
+4130 a 206 4130 a
+SDict begin 22.464 H.A end
+ 206 4130 a 206 4130 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.19.1) cvn H.B /DEST pdfmark
+end
+ 206 4130 a -2
+4298 a
+SDict begin H.S end
+ -2 4298 a -2 4298 a
+SDict begin 13 H.A end
+ -2 4298 a -2 4298 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:742) cvn H.B /DEST pdfmark
+end
+ -2 4298
+a 396 4404 a FC(All)21 b(command)d(line)j(options)e(are)h(described)f
+(in)p 0 TeXcolorgray 1828 4404 a
+SDict begin H.S end
+ 1828 4404 a FC(Appendix)f(B)2231
+4404 y
+SDict begin 13 H.L end
+ 2231 4404 a 2231 4404 a
+SDict begin [ /Subtype /Link /Dest (0:COMMAND-LINE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2231 4404 a Black 1 w
+FC(>.)i(Note)g(that)h(depending)c(on)j(the)3240 4404
+y
+SDict begin H.S end
+ 3240 4404 a 3240 4404 a
+SDict begin 13 H.A end
+ 3240 4404 a 3240 4404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:744) cvn H.B /DEST pdfmark
+end
+ 3240
+4404 a Fy(./con\002gur)o(e)396 4512 y FC(options)g(used)f(for)h
+(compiling,)e(not)i(all)h(options)e(may)h(be)g(a)n(v)n(ailable.)f(Y)-9
+b(ou)20 b(can)g(get)g(a)h(list)g(of)f(v)n(alid)g(options)f(with)396
+4620 y
+SDict begin H.S end
+ 396 4620 a 396 4620 a
+SDict begin 13 H.A end
+ 396 4620 a 396 4620 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:745) cvn H.B /DEST pdfmark
+end
+ 396
+4620 a Fy(samhain)i(--help)p FC(.)-2 4803 y
+SDict begin H.S end
+ -2 4803 a
+-2 4803 a
+SDict begin 13 H.A end
+ -2 4803 a -2 4803 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:746) cvn H.B /DEST pdfmark
+end
+ -2 4803 a 396 4894 a FC(All)g(settings)g
+(in)f(the)g(con\002guration)e(\002le,)i(are)g(described)f(in)p
+0 TeXcolorgray 2163 4894 a
+SDict begin H.S end
+ 2163 4894 a FC(Appendix)f(C)2566
+4894 y
+SDict begin 13 H.L end
+ 2566 4894 a 2566 4894 a
+SDict begin [ /Subtype /Link /Dest (0:THE-CONFIGURATION-FILE) cvn /H
+/I /Border [0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2566 4894 a Black FC(>.)j(Note)f(that)g
+(depending)e(on)h(the)396 5002 y
+SDict begin H.S end
+ 396 5002 a 396 5002
+a
+SDict begin 13 H.A end
+ 396 5002 a 396 5002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:748) cvn H.B /DEST pdfmark
+end
+ 396 5002 a Fy(./con\002gur)o(e)g
+FC(options)h(used)g(for)f(compiling,)f(not)i(all)h(options)e(may)h(be)g
+(a)n(v)n(ailable.)g(If)g(you)f(are)h(using)396 5110 y(unsupported)d
+(options,)1113 5110 y
+SDict begin H.S end
+ 1113 5110 a 1113 5110 a
+SDict begin 13 H.A end
+ 1113 5110
+a 1113 5110 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:749) cvn H.B /DEST pdfmark
+end
+ 1113 5110 a FC(samhain)j(will)h(log)f(w)o(arning)f
+(messages)h(upon)f(startup,)g(including)g(the)h(line)g(number)f(of)396
+5218 y(the)h(of)n(fending)e(line)i(in)h(the)f(con\002guration)d
+(\002le.)-2 5246 y
+SDict begin H.S end
+ -2 5246 a -2 5246 a
+SDict begin 13 H.A end
+ -2 5246 a -2 5246
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUPPORT) cvn H.B /DEST pdfmark
+end
+ -2 5246 a Black 3658 5805 a Fx(17)p Black eop end
+%%Page: 18 23
+TeXDict begin 18 22 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.18) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2689 104 a
+Fx(Chapter)20 b(3.)g(Gener)o(al)f(usa)o(g)o(e)h(notes)p
+Black -2 330 a Fu(3.10.)39 b(Suppor)s(t)e(/)j(Bugs)f(/)g(Pr)m(ob)o
+(lems)2159 330 y
+SDict begin H.S end
+ 2159 330 a 2159 330 a
+SDict begin 22.464 H.A end
+ 2159 330 a 2159
+330 a
+SDict begin [ /View [/XYZ H.V] /Dest (5.20.1) cvn H.B /DEST pdfmark
+end
+ 2159 330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a
+-2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:752) cvn H.B /DEST pdfmark
+end
+ -2 528 a 396 604 a FC(If)20 b(you)g(ha)n(v)o(e)f(problems)g
+(getting)1373 604 y
+SDict begin H.S end
+ 1373 604 a 1373 604 a
+SDict begin 13 H.A end
+ 1373 604 a
+1373 604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:753) cvn H.B /DEST pdfmark
+end
+ 1373 604 a FC(samhain)h(to)g(run,)f(or)h(think)g(that)g(you)
+f(ha)n(v)o(e)h(encountered)d(a)k(b)n(ug,)e(then)h(please)396
+712 y(check)g(the)g(F)-6 b(A)h(Q)21 b(\002rst.)-2 893
+y
+SDict begin H.S end
+ -2 893 a -2 893 a
+SDict begin 13 H.A end
+ -2 893 a -2 893 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:754) cvn H.B /DEST pdfmark
+end
+ -2 893 a 396 986
+a FC(If)f(your)f(problem)g(is)i(not)f(anwered)f(there,)g(you)g(can)h
+(visit)h(the)2222 986 y
+SDict begin H.S end
+ 2222 986 a 2222 986 a
+SDict begin 13 H.A end
+ 2222 986
+a 2222 986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:755) cvn H.B /DEST pdfmark
+end
+ 2222 986 a FC(user)f(forum)f
+(\(http://la-samhna.de/forum\))396 1094 y(\(which)h(is)724
+1094 y
+SDict begin H.S end
+ 724 1094 a 724 1094 a
+SDict begin 13 H.A end
+ 724 1094 a 724 1094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:756) cvn H.B /DEST pdfmark
+end
+ 724
+1094 a Fx(sear)m(c)o(hable)p FC(,)e(by)i(the)g(w)o(ay\))g(and)g(ask)g
+(there)g(for)f(help)h(\(recommended)d(for)i(questions)h(of)g(probably)
+396 1202 y(general)f(interest\),)h(or)g(send)g(email)g(to)1528
+1202 y
+SDict begin H.S end
+ 1528 1202 a 1528 1202 a
+SDict begin 13 H.A end
+ 1528 1202 a 1528 1202
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:757) cvn H.B /DEST pdfmark
+end
+ 1528 1202 a FC(<)p Fr(support@la-samhna.de)p FC(>.)-2
+1386 y
+SDict begin H.S end
+ -2 1386 a -2 1386 a
+SDict begin 13 H.A end
+ -2 1386 a -2 1386 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:758) cvn H.B /DEST pdfmark
+end
+ -2 1386
+a 396 1476 a FC(Please)h(remember)d(that)j(a)f(useful)g(problem)e
+(report)h(should)h(at)g(least)h(include)e(the)i(follo)n(wing)d(three)i
+(items:)-2 1660 y
+SDict begin H.S end
+ -2 1660 a -2 1660 a
+SDict begin 13 H.A end
+ -2 1660 a -2 1660
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:759) cvn H.B /DEST pdfmark
+end
+ -2 1660 a -2 1660 a
+SDict begin H.S end
+ -2 1660 a -2 1660 a
+SDict begin 13 H.A end
+ -2 1660 a -2
+1660 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:760) cvn H.B /DEST pdfmark
+end
+ -2 1660 a -2 1670 a
+SDict begin H.S end
+ -2 1670 a -2 1670 a
+SDict begin 13 H.A end
+ -2 1670
+a -2 1670 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:761) cvn H.B /DEST pdfmark
+end
+ -2 1670 a Black 396 1812 a FB(\225)p Black
+479 1812 a
+SDict begin H.S end
+ 479 1812 a 479 1812 a
+SDict begin 13 H.A end
+ 479 1812 a 479 1812
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:762) cvn H.B /DEST pdfmark
+end
+ 479 1812 a FC(What)h(did)f(you)f(do)h(?)-2 1830 y
+SDict begin H.S end
+ -2
+1830 a -2 1830 a
+SDict begin 13 H.A end
+ -2 1830 a -2 1830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:763) cvn H.B /DEST pdfmark
+end
+ -2 1830 a Black
+396 1962 a FB(\225)p Black 479 1962 a
+SDict begin H.S end
+ 479 1962 a 479
+1962 a
+SDict begin 13 H.A end
+ 479 1962 a 479 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:764) cvn H.B /DEST pdfmark
+end
+ 479 1962 a FC(What)h(result)f(did)g(you)f
+(e)o(xpect)g(?)-2 1980 y
+SDict begin H.S end
+ -2 1980 a -2 1980 a
+SDict begin 13 H.A end
+ -2 1980
+a -2 1980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:765) cvn H.B /DEST pdfmark
+end
+ -2 1980 a Black 396 2111 a FB(\225)p Black
+479 2111 a
+SDict begin H.S end
+ 479 2111 a 479 2111 a
+SDict begin 13 H.A end
+ 479 2111 a 479 2111
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:766) cvn H.B /DEST pdfmark
+end
+ 479 2111 a FC(What)i(result)f(did)g(you)f(obtain)h(instead)f(?)-2
+2427 y
+SDict begin H.S end
+ -2 2427 a -2 2427 a
+SDict begin 13 H.A end
+ -2 2427 a -2 2427 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:767) cvn H.B /DEST pdfmark
+end
+ -2 2427
+a -2 2427 a
+SDict begin H.S end
+ -2 2427 a -2 2427 a
+SDict begin 13 H.A end
+ -2 2427 a -2 2427 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:768) cvn H.B /DEST pdfmark
+end
+ -2
+2427 a 396 2535 a Fx(Please)h(be)g(sur)m(e)h(to)f(pr)l(o)o(vide)g(r)m
+(ele)o(vant)g(details,)g(suc)o(h)f(as:)-2 2718 y
+SDict begin H.S end
+ -2 2718
+a -2 2718 a
+SDict begin 13 H.A end
+ -2 2718 a -2 2718 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:769) cvn H.B /DEST pdfmark
+end
+ -2 2718 a -2 2718 a
+SDict begin H.S end
+ -2
+2718 a -2 2718 a
+SDict begin 13 H.A end
+ -2 2718 a -2 2718 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:770) cvn H.B /DEST pdfmark
+end
+ -2 2718 a -2 2728
+a
+SDict begin H.S end
+ -2 2728 a -2 2728 a
+SDict begin 13 H.A end
+ -2 2728 a -2 2728 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:771) cvn H.B /DEST pdfmark
+end
+ -2 2728 a Black
+396 2871 a FB(\225)p Black 479 2871 a
+SDict begin H.S end
+ 479 2871 a 479
+2871 a
+SDict begin 13 H.A end
+ 479 2871 a 479 2871 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:772) cvn H.B /DEST pdfmark
+end
+ 479 2871 a FC(your)g(operating)g(system,)h
+(its)h(release)f(v)o(ersion,)f(and)g(the)i(machine)e(\()2487
+2871 y
+SDict begin H.S end
+ 2487 2871 a 2487 2871 a
+SDict begin 13 H.A end
+ 2487 2871 a 2487 2871
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:773) cvn H.B /DEST pdfmark
+end
+ 2487 2871 a Fy(uname)h(-srm)p FC(\).)-2 2889 y
+SDict begin H.S end
+ -2 2889
+a -2 2889 a
+SDict begin 13 H.A end
+ -2 2889 a -2 2889 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:774) cvn H.B /DEST pdfmark
+end
+ -2 2889 a Black 396 3020
+a FB(\225)p Black 479 3020 a
+SDict begin H.S end
+ 479 3020 a 479 3020 a
+SDict begin 13 H.A end
+ 479
+3020 a 479 3020 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:775) cvn H.B /DEST pdfmark
+end
+ 479 3020 a FC(your)f(operating)g(system,)h(its)h
+(release)f(v)o(ersion,)f(and)g(the)i(machine)e(\()2487
+3020 y
+SDict begin H.S end
+ 2487 3020 a 2487 3020 a
+SDict begin 13 H.A end
+ 2487 3020 a 2487 3020
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:776) cvn H.B /DEST pdfmark
+end
+ 2487 3020 a Fy(uname)h(-srm)p FC(\).)-2 3038 y
+SDict begin H.S end
+ -2 3038
+a -2 3038 a
+SDict begin 13 H.A end
+ -2 3038 a -2 3038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:777) cvn H.B /DEST pdfmark
+end
+ -2 3038 a Black 396 3170
+a FB(\225)p Black 479 3170 a
+SDict begin H.S end
+ 479 3170 a 479 3170 a
+SDict begin 13 H.A end
+ 479
+3170 a 479 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:778) cvn H.B /DEST pdfmark
+end
+ 479 3170 a FC(the)g(v)o(ersion)f(of)955
+3170 y
+SDict begin H.S end
+ 955 3170 a 955 3170 a
+SDict begin 13 H.A end
+ 955 3170 a 955 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:779) cvn H.B /DEST pdfmark
+end
+ 955
+3170 a FC(samhain)h(that)g(you)f(are)h(using,)g(and)g(the)g(options)f
+(that)h(you)g(ha)n(v)o(e)f(supplied)g(to)3268 3170 y
+SDict begin H.S end
+
+3268 3170 a 3268 3170 a
+SDict begin 13 H.A end
+ 3268 3170 a 3268 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:780) cvn H.B /DEST pdfmark
+end
+ 3268
+3170 a Fy(con\002gur)o(e)p FC(.)-2 3188 y
+SDict begin H.S end
+ -2 3188 a -2
+3188 a
+SDict begin 13 H.A end
+ -2 3188 a -2 3188 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:781) cvn H.B /DEST pdfmark
+end
+ -2 3188 a Black 396 3319 a
+FB(\225)p Black 479 3319 a
+SDict begin H.S end
+ 479 3319 a 479 3319 a
+SDict begin 13 H.A end
+ 479
+3319 a 479 3319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:782) cvn H.B /DEST pdfmark
+end
+ 479 3319 a FC(If)h(you)g(think)f(you)g(ha)n(v)o(e)h
+(encountered)d(a)k(b)n(ug,)e(it)i(is)g(usually)2264 3319
+y
+SDict begin H.S end
+ 2264 3319 a 2264 3319 a
+SDict begin 13 H.A end
+ 2264 3319 a 2264 3319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:783) cvn H.B /DEST pdfmark
+end
+ 2264
+3319 a Fx(very)g(helpful)e FC(if)i(you)e(run)3027 3319
+y
+SDict begin H.S end
+ 3027 3319 a 3027 3319 a
+SDict begin 13 H.A end
+ 3027 3319 a 3027 3319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:784) cvn H.B /DEST pdfmark
+end
+ 3027
+3319 a FC(samhain)3325 3319 y
+SDict begin H.S end
+ 3325 3319 a 3325 3319 a
+SDict begin 13 H.A end
+
+3325 3319 a 3325 3319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:785) cvn H.B /DEST pdfmark
+end
+ 3325 3319 a Fx(in)h(the)479 3427
+y(for)m(e)m(gr)l(ound)h FC(\(i.e.)f(not)f(as)i(daemon\))e(with)h(the)g
+(command)e(line)j(switch)2565 3427 y
+SDict begin H.S end
+ 2565 3427 a 2565
+3427 a
+SDict begin 13 H.A end
+ 2565 3427 a 2565 3427 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:786) cvn H.B /DEST pdfmark
+end
+ 2565 3427 a Fy(-p)g(deb)n(ug)g
+FC(to)f(get)g(some)g(more)479 3535 y(information)e(about)h(the)i
+(problem.)-2 3719 y
+SDict begin H.S end
+ -2 3719 a -2 3719 a
+SDict begin 13 H.A end
+ -2 3719 a -2
+3719 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:787) cvn H.B /DEST pdfmark
+end
+ -2 3719 a 479 3809 a FC(It)g(w)o(ould)e(be)877
+3809 y
+SDict begin H.S end
+ 877 3809 a 877 3809 a
+SDict begin 13 H.A end
+ 877 3809 a 877 3809 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:788) cvn H.B /DEST pdfmark
+end
+ 877
+3809 a Fx(e)o(ven)h(mor)m(e)g(helpful)g FC(if)g(you)g(\002rst)g
+(re-compile)2236 3809 y
+SDict begin H.S end
+ 2236 3809 a 2236 3809 a
+SDict begin 13 H.A end
+ 2236
+3809 a 2236 3809 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:789) cvn H.B /DEST pdfmark
+end
+ 2236 3809 a FC(samhain)f(with)2702
+3809 y
+SDict begin H.S end
+ 2702 3809 a 2702 3809 a
+SDict begin 13 H.A end
+ 2702 3809 a 2702 3809
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:790) cvn H.B /DEST pdfmark
+end
+ 2702 3809 a Fy(con\002gur)o(e)g(--enable-deb)n(ug)p
+FC(,)g(and)479 3917 y(then)h(run)f(it)i(with)g(the)f(command)e(line)i
+(switch)1863 3917 y
+SDict begin H.S end
+ 1863 3917 a 1863 3917 a
+SDict begin 13 H.A end
+ 1863 3917
+a 1863 3917 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:791) cvn H.B /DEST pdfmark
+end
+ 1863 3917 a Fy(-p)g(deb)n(ug)h FC(\(again,)e(not)h(as)h
+(daemon,)d(b)n(ut)3088 3917 y
+SDict begin H.S end
+ 3088 3917 a 3088 3917 a
+SDict begin 13 H.A end
+
+3088 3917 a 3088 3917 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:792) cvn H.B /DEST pdfmark
+end
+ 3088 3917 a Fx(in)j(the)f(for)m(e)m(gr)l(ound)r
+FC(\).)-2 4101 y
+SDict begin H.S end
+ -2 4101 a -2 4101 a
+SDict begin 13 H.A end
+ -2 4101 a -2 4101
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:793) cvn H.B /DEST pdfmark
+end
+ -2 4101 a 479 4191 a FC(Please)h(compress)e(the)i(output)e(using)1602
+4191 y
+SDict begin H.S end
+ 1602 4191 a 1602 4191 a
+SDict begin 13 H.A end
+ 1602 4191 a 1602 4191
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:794) cvn H.B /DEST pdfmark
+end
+ 1602 4191 a Fy(gzip)p FC(,)h(and)g(send)g(it)h(as)g(attachment)e(to)
+2732 4191 y
+SDict begin H.S end
+ 2732 4191 a 2732 4191 a
+SDict begin 13 H.A end
+ 2732 4191 a 2732
+4191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:795) cvn H.B /DEST pdfmark
+end
+ 2732 4191 a FC(<)p Fr(support@la-samhna.de)p FC(>.)p
+Black 3661 5805 a Fx(18)p Black eop end
+%%Page: 19 24
+TeXDict begin 19 23 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.19) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:BASIC-CONFIGURATION) cvn H.B
+/DEST pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(4.)f(Con\002guration)j(of)e(log)n(ging)h(facilities)
+3632 351 y
+SDict begin H.S end
+ 3632 351 a 3632 351 a
+SDict begin 26.957 H.A end
+ 3632 351 a 3632 351
+a
+SDict begin [ /View [/XYZ H.V] /Dest (6.0) cvn H.B /DEST pdfmark end
+ 3632 351 a -2 609 a
+SDict begin H.S end
+ -2 609 a -2 609 a
+SDict begin 13 H.A end
+ -2 609 a -2 609
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:798) cvn H.B /DEST pdfmark
+end
+ -2 609 a 396 679 a FC(The)20 b(con\002guration)e(\002le)i(for)1254
+679 y
+SDict begin H.S end
+ 1254 679 a 1254 679 a
+SDict begin 13 H.A end
+ 1254 679 a 1254 679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:799) cvn H.B /DEST pdfmark
+end
+ 1254
+679 a FC(samhain)g(is)h(named)1870 679 y
+SDict begin H.S end
+ 1870 679 a 1870
+679 a
+SDict begin 13 H.A end
+ 1870 679 a 1870 679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:800) cvn H.B /DEST pdfmark
+end
+ 1870 679 a Fr(samhainrc)e
+FC(by)h(def)o(ault.)f(Also)i(by)e(def)o(ault,)h(it)g(is)i(placed)d(in)
+396 787 y
+SDict begin H.S end
+ 396 787 a 396 787 a
+SDict begin 13 H.A end
+ 396 787 a 396 787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:801) cvn H.B /DEST pdfmark
+end
+ 396
+787 a Fr(/etc)p FC(.)h(\(Name)g(and)f(location)h(is)h(con\002gurable)d
+(at)i(compile)f(time\).)h(The)g(distrib)n(ution)f(package)g(comes)h
+(with)g(a)396 895 y(commented)e(sample)i(con\002guration)e(\002le.)i
+(The)g(layout)g(of)g(the)g(con\002guration)d(\002le)k(is)g(described)e
+(in)h(more)396 1003 y(details)h(in)p 0 TeXcolorgray 719
+1003 a
+SDict begin H.S end
+ 719 1003 a FC(Section)f(C.1)1107 1003 y
+SDict begin 13 H.L end
+ 1107 1003
+a 1107 1003 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1107 1003 a Black FC(.)-2 1004 y
+SDict begin H.S end
+ -2 1004
+a -2 1004 a
+SDict begin 13 H.A end
+ -2 1004 a -2 1004 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LOGDEF) cvn H.B /DEST pdfmark
+end
+ -2 1004 a 376 x Fu(4.1.)39
+b(Se)n(verity)f(le)n(vels)g(and)h(c)m(lasses)g(of)g(log)g(messa)o(g)q
+(es)3286 1380 y
+SDict begin H.S end
+ 3286 1380 a 3286 1380 a
+SDict begin 22.464 H.A end
+ 3286 1380 a 3286
+1380 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.21.1) cvn H.B /DEST pdfmark
+end
+ 3286 1380 a -2 1578 a
+SDict begin H.S end
+ -2 1578 a -2 1578 a
+SDict begin 13 H.A end
+ -2 1578
+a -2 1578 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:805) cvn H.B /DEST pdfmark
+end
+ -2 1578 a -2 1578 a
+SDict begin H.S end
+ -2 1578 a -2 1578 a
+SDict begin 13 H.A end
+ -2
+1578 a -2 1578 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:806) cvn H.B /DEST pdfmark
+end
+ -2 1578 a 396 1654 a Fx(Events)20 b
+FC(\(e.g.)g(unauthorized)d(modi\002cations)i(of)h(\002les)h(monitored)d
+(by)2449 1654 y
+SDict begin H.S end
+ 2449 1654 a 2449 1654 a
+SDict begin 13 H.A end
+ 2449 1654 a 2449
+1654 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:807) cvn H.B /DEST pdfmark
+end
+ 2449 1654 a FC(samhain\))h(will)i(generate)3226
+1654 y
+SDict begin H.S end
+ 3226 1654 a 3226 1654 a
+SDict begin 13 H.A end
+ 3226 1654 a 3226 1654
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:808) cvn H.B /DEST pdfmark
+end
+ 3226 1654 a Fx(messa)o(g)o(es)f FC(of)396 1762 y(some)592
+1762 y
+SDict begin H.S end
+ 592 1762 a 592 1762 a
+SDict begin 13 H.A end
+ 592 1762 a 592 1762 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:809) cvn H.B /DEST pdfmark
+end
+ 592
+1762 a Fx(se)o(verity)p FC(.)g(These)g(messages)g(will)h(be)f(logged)e
+(to)i(all)h(logging)d(f)o(acilities,)i(whose)2960 1762
+y
+SDict begin H.S end
+ 2960 1762 a 2960 1762 a
+SDict begin 13 H.A end
+ 2960 1762 a 2960 1762 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:810) cvn H.B /DEST pdfmark
+end
+ 2960
+1762 a Fx(thr)m(eshold)h FC(is)g(equal)e(to,)h(or)396
+1870 y(lo)n(wer)g(than,)f(the)i(se)n(v)o(erity)e(of)h(the)g(message.)-2
+1888 y
+SDict begin H.S end
+ -2 1888 a -2 1888 a
+SDict begin 13 H.A end
+ -2 1888 a -2 1888 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SEVERITYDEF) cvn H.B /DEST
+pdfmark end
+ -2 1888
+a 396 2198 a Fp(4.1.1.)36 b(Se)n(verity)e(le)n(vels)1553
+2198 y
+SDict begin H.S end
+ 1553 2198 a 1553 2198 a
+SDict begin 18.72 H.A end
+ 1553 2198 a 1553 2198
+a
+SDict begin [ /View [/XYZ H.V] /Dest (6.21.6.2) cvn H.B /DEST pdfmark
+end
+ 1553 2198 a -2 2389 a
+SDict begin H.S end
+ -2 2389 a -2 2389 a
+SDict begin 13 H.A end
+ -2 2389 a
+-2 2389 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:813) cvn H.B /DEST pdfmark
+end
+ -2 2389 a 396 2472 a FC(The)20 b(follo)n(wing)f(se)n(v)o
+(erity)g(le)n(v)o(els)h(are)g(de\002ned:)1810 2472 y
+SDict begin H.S end
+
+1810 2472 a 1810 2472 a
+SDict begin 13 H.A end
+ 1810 2472 a 1810 2472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:814) cvn H.B /DEST pdfmark
+end
+ 1810
+2472 a -2 2597 a
+SDict begin H.S end
+ -2 2597 a -2 2597 a
+SDict begin 13 H.A end
+ -2 2597 a -2 2597
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:815) cvn H.B /DEST pdfmark
+end
+ -2 2597 a -2 2597 a
+SDict begin H.S end
+ -2 2597 a -2 2597 a
+SDict begin 13 H.A end
+ -2 2597 a -2
+2597 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.6) cvn H.B /DEST pdfmark
+end
+ -2 2597 a 396 2600 3359 4 v 396 2600 V 396 2725
+4 125 v 424 2700 a FD(Le)o(vel)p 2074 2725 V 1467 w(Signi\002cance)p
+3751 2725 V 396 2728 3359 4 v 396 2728 V 396 2852 4 125
+v 424 2828 a FC(none)p 2074 2852 V 1515 w(Not)g(logged.)p
+3751 2852 V 396 2856 3359 4 v 396 2856 V 396 2980 4 125
+v 424 2955 a(deb)n(ug)p 2074 2980 V 1475 w(Deb)n(ugging-le)n(v)o(el)d
+(messages.)p 3751 2980 V 396 2984 3359 4 v 396 2984 V
+396 3108 4 125 v 424 3083 a(info)p 2074 3108 V 1543 w(Informational)g
+(message.)p 3751 3108 V 396 3111 3359 4 v 396 3111 V
+396 3236 4 125 v 424 3211 a(notice)p 2074 3236 V 1474
+w(Normal)i(conditions.)p 3751 3236 V 396 3239 3359 4
+v 396 3239 V 396 3364 4 125 v 424 3339 a(w)o(arn)p 2074
+3364 V 1512 w(W)-7 b(arning)19 b(conditions.)p 3751 3364
+V 396 3367 3359 4 v 396 3367 V 396 3492 4 125 v 424 3467
+a(mark)p 2074 3492 V 1506 w(T)m(imestamps.)p 3751 3492
+V 396 3495 3359 4 v 396 3495 V 396 3620 4 125 v 424 3595
+a(err)p 2074 3620 V 1585 w(Error)g(conditions.)p 3751
+3620 V 396 3623 3359 4 v 396 3623 V 396 3747 4 125 v
+424 3723 a(crit)p 2074 3747 V 1567 w(Critical)i(conditions.)p
+3751 3747 V 396 3751 3359 4 v 396 3751 V 396 3983 4 233
+v 424 3850 a(alert)p 2074 3983 V 1530 w(Program)e(startup/normal)f(e)o
+(xit,)h(or)h(f)o(atal)h(error)m(,)2102 3958 y(causing)e(abnormal)g
+(program)f(termination.)p 3751 3983 V 396 3987 3359 4
+v 396 3987 V 396 4111 4 125 v 424 4086 a(inet)p 2074
+4111 V 1553 w(Incoming)g(messages)i(from)f(clients)i(\(serv)o(er)e
+(only\).)p 3751 4111 V 396 4114 3359 4 v 396 4114 V -2
+4446 a
+SDict begin H.S end
+ -2 4446 a -2 4446 a
+SDict begin 13 H.A end
+ -2 4446 a -2 4446 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:851) cvn H.B /DEST pdfmark
+end
+ -2 4446
+a 396 4554 a FC(Most)i(e)n(v)o(ents)e(\(e.g.)h(timestamps,)f(internal)h
+(errors,)f(program)f(startup/e)o(xit\))h(ha)n(v)o(e)2812
+4554 y
+SDict begin H.S end
+ 2812 4554 a 2812 4554 a
+SDict begin 13 H.A end
+ 2812 4554 a 2812 4554
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:852) cvn H.B /DEST pdfmark
+end
+ 2812 4554 a Fx(\002xed)j FC(se)n(v)o(erities.)e(The)396
+4662 y(follo)n(wing)f(e)n(v)o(ents)g(ha)n(v)o(e)1142
+4662 y
+SDict begin H.S end
+ 1142 4662 a 1142 4662 a
+SDict begin 13 H.A end
+ 1142 4662 a 1142 4662
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:853) cvn H.B /DEST pdfmark
+end
+ 1142 4662 a Fx(con\002gur)o(able)e FC(se)n(v)o(erities:)-2
+4846 y
+SDict begin H.S end
+ -2 4846 a -2 4846 a
+SDict begin 13 H.A end
+ -2 4846 a -2 4846 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:854) cvn H.B /DEST pdfmark
+end
+ -2 4846
+a -2 4846 a
+SDict begin H.S end
+ -2 4846 a -2 4846 a
+SDict begin 13 H.A end
+ -2 4846 a -2 4846 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:855) cvn H.B /DEST pdfmark
+end
+ -2
+4846 a -2 4856 a
+SDict begin H.S end
+ -2 4856 a -2 4856 a
+SDict begin 13 H.A end
+ -2 4856 a -2 4856
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:856) cvn H.B /DEST pdfmark
+end
+ -2 4856 a Black 396 4999 a FB(\225)p Black 479 4999
+a
+SDict begin H.S end
+ 479 4999 a 479 4999 a
+SDict begin 13 H.A end
+ 479 4999 a 479 4999 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:857) cvn H.B /DEST pdfmark
+end
+ 479 4999
+a FC(\(serv)o(er)i(only\))g(f)o(ailure)h(to)g(resolv)o(e)g(a)g(client)g
+(address)g(\(section)2323 4999 y
+SDict begin H.S end
+ 2323 4999 a 2323 4999
+a
+SDict begin 13 H.A end
+ 2323 4999 a 2323 4999 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:858) cvn H.B /DEST pdfmark
+end
+ 2323 4999 a Fx([Misc])p FC(,)h(option)2823
+4999 y
+SDict begin H.S end
+ 2823 4999 a 2823 4999 a
+SDict begin 13 H.A end
+ 2823 4999 a 2823 4999
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:859) cvn H.B /DEST pdfmark
+end
+ 2823 4999 a Fx(Se)o(verityLookup)p FC(\))-2 5017 y
+SDict begin H.S end
+
+-2 5017 a -2 5017 a
+SDict begin 13 H.A end
+ -2 5017 a -2 5017 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:860) cvn H.B /DEST pdfmark
+end
+ -2 5017 a Black
+396 5148 a FB(\225)p Black 479 5148 a
+SDict begin H.S end
+ 479 5148 a 479
+5148 a
+SDict begin 13 H.A end
+ 479 5148 a 479 5148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:861) cvn H.B /DEST pdfmark
+end
+ 479 5148 a FC(polic)o(y)e(violations)h
+(\(for)f(monitored)f(\002les\))-2 5166 y
+SDict begin H.S end
+ -2 5166 a -2
+5166 a
+SDict begin 13 H.A end
+ -2 5166 a -2 5166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:862) cvn H.B /DEST pdfmark
+end
+ -2 5166 a Black 396 5297 a
+FB(\225)p Black 479 5297 a
+SDict begin H.S end
+ 479 5297 a 479 5297 a
+SDict begin 13 H.A end
+ 479
+5297 a 479 5297 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:863) cvn H.B /DEST pdfmark
+end
+ 479 5297 a FC(access)j(errors)e(for)h(\002les)-2
+5298 y
+SDict begin H.S end
+ -2 5298 a -2 5298 a
+SDict begin 13 H.A end
+ -2 5298 a -2 5298 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:864) cvn H.B /DEST pdfmark
+end
+ -2 5298
+a Black 3661 5805 a Fx(19)p Black eop end
+%%Page: 20 25
+TeXDict begin 20 24 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.20) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black Black 396 309 a FB(\225)p Black 479
+309 a
+SDict begin H.S end
+ 479 309 a 479 309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:865) cvn H.B /DEST pdfmark
+end
+ 479 309
+a FC(access)j(errors)e(for)h(directories)-2 310 y
+SDict begin H.S end
+ -2
+310 a -2 310 a
+SDict begin 13 H.A end
+ -2 310 a -2 310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:866) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black 396 458
+a FB(\225)p Black 479 458 a
+SDict begin H.S end
+ 479 458 a 479 458 a
+SDict begin 13 H.A end
+ 479 458
+a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:867) cvn H.B /DEST pdfmark
+end
+ 479 458 a FC(obscure)f(\002le)i(names)f(\(with)g
+(non-printable)d(characters\))i(and/or)g(in)m(v)n(alid)g(UIDs/GIDs)h
+(\(no)g(such)g(user/group\))-2 476 y
+SDict begin H.S end
+ -2 476 a -2 476
+a
+SDict begin 13 H.A end
+ -2 476 a -2 476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:868) cvn H.B /DEST pdfmark
+end
+ -2 476 a Black 396 608 a FB(\225)p
+Black 479 608 a
+SDict begin H.S end
+ 479 608 a 479 608 a
+SDict begin 13 H.A end
+ 479 608 a 479 608
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:869) cvn H.B /DEST pdfmark
+end
+ 479 608 a FC(login/logout)e(e)n(v)o(ents)i(\(if)1235
+608 y
+SDict begin H.S end
+ 1235 608 a 1235 608 a
+SDict begin 13 H.A end
+ 1235 608 a 1235 608 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:870) cvn H.B /DEST pdfmark
+end
+ 1235
+608 a FC(samhain)f(is)i(con\002gured)d(to)i(monitor)f(them\))-2
+923 y
+SDict begin H.S end
+ -2 923 a -2 923 a
+SDict begin 13 H.A end
+ -2 923 a -2 923 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:871) cvn H.B /DEST pdfmark
+end
+ -2 923 a 396
+1031 a FC(Se)n(v)o(erity)g(le)n(v)o(els)i(for)e(e)n(v)o(ents)h(\(see)p
+0 TeXcolorgray 1403 1031 a
+SDict begin H.S end
+ 1403 1031 a FC(Section)g(4.1.1)1841
+1031 y
+SDict begin 13 H.L end
+ 1841 1031 a 1841 1031 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1841 1031 a Black -2 w
+FC(>\))g(are)g(set)h(in)g(the)2377 1031 y
+SDict begin H.S end
+ 2377 1031 a
+2377 1031 a
+SDict begin 13 H.A end
+ 2377 1031 a 2377 1031 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:873) cvn H.B /DEST pdfmark
+end
+ 2377 1031 a Fx(EventSe)o(verity)e
+FC(and)g(\(for)h(login/logout)396 1139 y(e)n(v)o(ents\))f(the)776
+1139 y
+SDict begin H.S end
+ 776 1139 a 776 1139 a
+SDict begin 13 H.A end
+ 776 1139 a 776 1139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:874) cvn H.B /DEST pdfmark
+end
+ 776
+1139 a Fx(Utmp)h FC(sections)g(of)g(the)g(con\002guration)e(\002le.)-2
+1323 y
+SDict begin H.S end
+ -2 1323 a -2 1323 a
+SDict begin 13 H.A end
+ -2 1323 a -2 1323 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:875) cvn H.B /DEST pdfmark
+end
+ -2 1323
+a 396 1413 a FC(In)i(the)g(con\002guration)e(\002le,)j(these)f(can)g
+(be)g(set)h(as)g(follo)n(ws:)-2 1514 y
+SDict begin H.S end
+ -2 1514 a -2 1514
+a
+SDict begin 11.7 H.A end
+ -2 1514 a -2 1514 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:876) cvn H.B /DEST pdfmark
+end
+ -2 1514 a 486 1593 a Fr([EventSeverity])486
+1690 y(#)486 1787 y(#)45 b(these)f(are)g(policies)486
+1884 y(#)486 1982 y(SeverityReadOnly=crit)486 2079 y
+(SeverityLogFiles=crit)486 2176 y(SeverityGrowingLogs=warn)486
+2273 y(SeverityIgnoreNone=crit)486 2370 y(SeverityIgnoreAll=info)486
+2467 y(#)486 2564 y(#)h(these)f(are)g(access)g(errors)486
+2662 y(#)486 2759 y(SeverityFiles=err)486 2856 y(SeverityDirs=err)486
+2953 y(#)486 3050 y(#)h(these)f(are)g(obscure)g(file)g(names)486
+3147 y(#)h(and/or)e(invalid)h(UIDs/GIDs)f(\(no)i(such)f(user/group\))
+486 3244 y(#)486 3341 y(SeverityNames=info)486 3439 y(#)486
+3536 y(#)h(This)f(is)g(the)h(section)e(for)i(login/logout)d(monitoring)
+486 3633 y(#)486 3730 y([Utmp])486 3827 y(SeverityLogin=notice)486
+3924 y(SeverityLogout=notice)486 4021 y(#)j(multiple)e(logins)h(by)g
+(same)h(user)486 4119 y(SeverityLoginMulti=err)-2 4213
+y
+SDict begin H.S end
+ -2 4213 a -2 4213 a
+SDict begin 13 H.A end
+ -2 4213 a -2 4213 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CLASSES) cvn H.B /DEST pdfmark
+end
+ -2 4213 a 396
+4530 a Fp(4.1.2.)36 b(Classes)1178 4530 y
+SDict begin H.S end
+ 1178 4530 a
+1178 4530 a
+SDict begin 18.72 H.A end
+ 1178 4530 a 1178 4530 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.21.7.2) cvn H.B /DEST pdfmark
+end
+ 1178 4530 a -2 4697
+a
+SDict begin H.S end
+ -2 4697 a -2 4697 a
+SDict begin 13 H.A end
+ -2 4697 a -2 4697 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:879) cvn H.B /DEST pdfmark
+end
+ -2 4697 a -2
+4697 a
+SDict begin H.S end
+ -2 4697 a -2 4697 a
+SDict begin 13 H.A end
+ -2 4697 a -2 4697 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:880) cvn H.B /DEST pdfmark
+end
+ -2 4697
+a 396 4804 a Fx(Events)20 b FC(of)g(related)g(type)g(are)g(grouped)e
+(into)1704 4804 y
+SDict begin H.S end
+ 1704 4804 a 1704 4804 a
+SDict begin 13 H.A end
+ 1704 4804 a
+1704 4804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:881) cvn H.B /DEST pdfmark
+end
+ 1704 4804 a Fx(classes)p FC(.)i(F)o(or)g(each)g(logging)e
+(f)o(acility)-5 b(,)20 b(it)h(is)g(possible)f(to)g(restrict)396
+4912 y(logging)f(to)h(a)h(subset)f(of)g(these)g(classes)i(\(see)p
+0 TeXcolorgray 1729 4912 a
+SDict begin H.S end
+ 1729 4912 a FC(Section)e(4.3)2104
+4912 y
+SDict begin 13 H.L end
+ 2104 4912 a 2104 4912 a
+SDict begin [ /Subtype /Link /Dest (0:THRESHOLDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2104 4912 a Black -1 w
+FC(>\).)g(The)f(a)n(v)n(ailable)h(classes)h(are:)-2 5096
+y
+SDict begin H.S end
+ -2 5096 a -2 5096 a
+SDict begin 13 H.A end
+ -2 5096 a -2 5096 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:883) cvn H.B /DEST pdfmark
+end
+ -2 5096 a -2
+5096 a
+SDict begin H.S end
+ -2 5096 a -2 5096 a
+SDict begin 13 H.A end
+ -2 5096 a -2 5096 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:884) cvn H.B /DEST pdfmark
+end
+ -2 5096
+a -2 5189 a
+SDict begin H.S end
+ -2 5189 a -2 5189 a
+SDict begin 13 H.A end
+ -2 5189 a -2 5189 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:885) cvn H.B /DEST pdfmark
+end
+ -2
+5189 a -2 5189 a
+SDict begin H.S end
+ -2 5189 a -2 5189 a
+SDict begin 13 H.A end
+ -2 5189 a -2 5189
+a
+SDict begin [ /View [/XYZ H.V] /Dest (table.7) cvn H.B /DEST pdfmark
+end
+ -2 5189 a 396 5192 3359 4 v 396 5192 V 396 5317 4 125
+v 424 5292 a FD(Class)p 2074 5317 V 1457 w(Signi\002cance)p
+3751 5317 V 396 5320 3359 4 v Black 3661 5805 a Fx(20)p
+Black eop end
+%%Page: 21 26
+TeXDict begin 21 25 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.21) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 396 229 3359 4 v 396 229 V 396 354
+4 125 v 424 329 a FD(Class)p 2074 354 V 1457 w(Signi\002cance)p
+3751 354 V 396 354 3359 4 v 396 586 4 233 v 424 453 a
+FC(EVENT)p 2074 586 V 1405 w(Ev)o(ents)h(to)i(be)f(reported)e(\(i.e.)i
+(polic)o(y)f(violations,)2102 561 y(login/logout\).)p
+3751 586 V 396 589 3359 4 v 396 589 V 396 714 4 125 v
+424 689 a(ST)-8 b(AR)j(T)p 2074 714 V 1428 w(Startup/stop)19
+b(messages.)p 3751 714 V 396 717 3359 4 v 396 717 V 396
+842 4 125 v 424 817 a(ST)-8 b(AMP)p 2074 842 V 1409 w(T)m(imestamp)19
+b(\(heartbeat\))g(messages.)p 3751 842 V 396 845 3359
+4 v 396 845 V 396 970 4 125 v 424 945 a(LOGKEY)p 2074
+970 V 1336 w(The)h(k)o(e)o(y)f(to)i(v)o(erify)d(the)j(signed)e(log)h
+(\002le.)p 3751 970 V 396 973 3359 4 v 396 973 V 396
+1097 4 125 v 424 1072 a(ERR)m(OR)p 2074 1097 V 1405 w(Error)f
+(messages.)p 3751 1097 V 396 1101 3359 4 v 396 1101 V
+396 1225 4 125 v 424 1200 a(O)m(THER)p 2074 1225 V 1404
+w(Ev)o(erything)e(else)k(\(e.g.)e(informational)f(messages\).)p
+3751 1225 V 396 1229 3359 4 v 396 1229 V 396 1353 4 125
+v 424 1328 a(A)-5 b(UD)p 2074 1353 V 1503 w(System)20
+b(calls)h(\(for)e(deb)n(ugging\).)p 3751 1353 V 396 1356
+3359 4 v 396 1356 V -2 1689 a
+SDict begin H.S end
+ -2 1689 a -2 1689 a
+SDict begin 13 H.A end
+ -2
+1689 a -2 1689 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:912) cvn H.B /DEST pdfmark
+end
+ -2 1689 a 396 1796 a FC(The)h(aforementioned)d
+(classes)k(represent)e(a)i(ne)n(w)-5 b(,)19 b(simpli\002ed)h
+(classi\002cation)g(scheme)g(since)h(v)o(ersion)d(1.8.2.)396
+1904 y(The)i(pre)n(vious)f(scheme)g(\(listed)i(belo)n(w\))e(will)i
+(still)g(w)o(ork,)f(and)f(both)h(can)g(be)g(mix)o(ed.)-2
+2088 y
+SDict begin H.S end
+ -2 2088 a -2 2088 a
+SDict begin 13 H.A end
+ -2 2088 a -2 2088 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:913) cvn H.B /DEST pdfmark
+end
+ -2 2088
+a -2 2088 a
+SDict begin H.S end
+ -2 2088 a -2 2088 a
+SDict begin 13 H.A end
+ -2 2088 a -2 2088 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:914) cvn H.B /DEST pdfmark
+end
+ -2
+2088 a -2 2182 a
+SDict begin H.S end
+ -2 2182 a -2 2182 a
+SDict begin 13 H.A end
+ -2 2182 a -2 2182
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:915) cvn H.B /DEST pdfmark
+end
+ -2 2182 a -2 2182 a
+SDict begin H.S end
+ -2 2182 a -2 2182 a
+SDict begin 13 H.A end
+ -2 2182 a -2
+2182 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.8) cvn H.B /DEST pdfmark
+end
+ -2 2182 a 396 2185 3359 4 v 396 2185 V 396 2310
+4 125 v 424 2285 a FD(Class)p 2074 2310 V 1457 w(Signi\002cance)p
+3751 2310 V 396 2313 3359 4 v 396 2313 V 396 2438 4 125
+v 424 2413 a FC(A)-5 b(UD)p 2074 2438 V 1503 w(System)20
+b(calls.)p 3751 2438 V 396 2441 3359 4 v 396 2441 V 396
+2565 4 125 v 424 2540 a(R)m(UN)p 2074 2565 V 1506 w(Normal)f(run)h
+(messages)g(\(e.g.)f(startup,)h(e)o(xit,)g(...\))p 3751
+2565 V 396 2569 3359 4 v 396 2569 V 396 2693 4 125 v
+424 2668 a(ST)-8 b(AMP)p 2074 2693 V 1409 w(T)m(imestamps)20
+b(and)f(alik)o(e.)p 3751 2693 V 396 2697 3359 4 v 396
+2697 V 396 2821 4 125 v 424 2796 a(FIL)p 2074 2821 V
+1553 w(Messages)h(related)g(to)g(\002le)h(inte)o(grity)e(checking.)p
+3751 2821 V 396 2824 3359 4 v 396 2824 V 396 2949 4 125
+v 424 2924 a(TCP)p 2074 2949 V 1526 w(Messages)h(from)g(the)g
+(client/serv)o(er)f(subsystem.)p 3751 2949 V 396 2952
+3359 4 v 396 2952 V 396 3077 4 125 v 424 3052 a(P)-8
+b(ANIC)p 2074 3077 V 1437 w(F)o(atal)20 b(errors,)g(leading)f(to)h
+(program)e(termination.)p 3751 3077 V 396 3080 3359 4
+v 396 3080 V 396 3205 4 125 v 424 3180 a(ERR)p 2074 3205
+V 1517 w(Error)h(messages)h(\(general\).)p 3751 3205
+V 396 3208 3359 4 v 396 3208 V 396 3332 4 125 v 424 3308
+a(ENET)p 2074 3332 V 1465 w(Error)f(messages)h(\(netw)o(ork\).)p
+3751 3332 V 396 3336 3359 4 v 396 3336 V 396 3460 4 125
+v 424 3435 a(EINPUT)p 2074 3460 V 1382 w(Error)f(messages)h(\(input,)f
+(e.g.)h(con\002guration)d(\002le\).)p 3751 3460 V 396
+3464 3359 4 v 396 3464 V -2 3723 a
+SDict begin H.S end
+ -2 3723 a -2 3723
+a
+SDict begin 13 H.A end
+ -2 3723 a -2 3723 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGFACILITY) cvn H.B /DEST
+pdfmark end
+ -2 3723 a 377 x Fu(4.2.)39 b(Over)q(vie)n(w)f(of)
+h(log)o(ging)f(facilities)2262 4100 y
+SDict begin H.S end
+ 2262 4100 a 2262
+4100 a
+SDict begin 22.464 H.A end
+ 2262 4100 a 2262 4100 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.22.1) cvn H.B /DEST pdfmark
+end
+ 2262 4100 a -2 4298 a
+SDict begin H.S end
+
+-2 4298 a -2 4298 a
+SDict begin 13 H.A end
+ -2 4298 a -2 4298 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:950) cvn H.B /DEST pdfmark
+end
+ -2 4298 a -2
+4298 a
+SDict begin H.S end
+ -2 4298 a -2 4298 a
+SDict begin 13 H.A end
+ -2 4298 a -2 4298 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:951) cvn H.B /DEST pdfmark
+end
+ -2 4298
+a 396 4374 a FC(samhain)20 b(supports)f(the)h(follo)n(wing)f(f)o
+(acilities)h(for)g(logging:)-2 4558 y
+SDict begin H.S end
+ -2 4558 a -2 4558
+a
+SDict begin 13 H.A end
+ -2 4558 a -2 4558 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:952) cvn H.B /DEST pdfmark
+end
+ -2 4558 a -2 4558 a
+SDict begin H.S end
+ -2 4558 a -2
+4558 a
+SDict begin 13 H.A end
+ -2 4558 a -2 4558 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:953) cvn H.B /DEST pdfmark
+end
+ -2 4558 a -2 4568 a
+SDict begin H.S end
+ -2 4568
+a -2 4568 a
+SDict begin 13 H.A end
+ -2 4568 a -2 4568 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:954) cvn H.B /DEST pdfmark
+end
+ -2 4568 a Black 396 4710
+a FB(\225)p Black 479 4710 a
+SDict begin H.S end
+ 479 4710 a 479 4710 a
+SDict begin 13 H.A end
+ 479
+4710 a 479 4710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:955) cvn H.B /DEST pdfmark
+end
+ 479 4710 a 479 4710 a
+SDict begin H.S end
+ 479 4710 a 479
+4710 a
+SDict begin 13 H.A end
+ 479 4710 a 479 4710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:956) cvn H.B /DEST pdfmark
+end
+ 479 4710 a Fx(e-mail)g FC(\227)816
+4710 y
+SDict begin H.S end
+ 816 4710 a 816 4710 a
+SDict begin 13 H.A end
+ 816 4710 a 816 4710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:957) cvn H.B /DEST pdfmark
+end
+ 816
+4710 a FC(samhain)f(uses)i(b)n(uilt-in)f(SMTP)g(code,)g(rather)f(than)h
+(an)g(e)o(xternal)f(mailer)h(program.)d(E-mails)j(are)479
+4818 y(signed)g(to)g(pre)n(v)o(ent)f(for)o(ging.)-2 4836
+y
+SDict begin H.S end
+ -2 4836 a -2 4836 a
+SDict begin 13 H.A end
+ -2 4836 a -2 4836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:958) cvn H.B /DEST pdfmark
+end
+ -2 4836 a Black
+396 4968 a FB(\225)p Black 479 4968 a
+SDict begin H.S end
+ 479 4968 a 479
+4968 a
+SDict begin 13 H.A end
+ 479 4968 a 479 4968 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:959) cvn H.B /DEST pdfmark
+end
+ 479 4968 a 479 4968 a
+SDict begin H.S end
+ 479
+4968 a 479 4968 a
+SDict begin 13 H.A end
+ 479 4968 a 479 4968 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:960) cvn H.B /DEST pdfmark
+end
+ 479 4968 a Fx(syslo)o(g)i
+FC(\227)g(The)e(system)i(logging)d(utility)-5 b(.)-2
+4986 y
+SDict begin H.S end
+ -2 4986 a -2 4986 a
+SDict begin 13 H.A end
+ -2 4986 a -2 4986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:961) cvn H.B /DEST pdfmark
+end
+ -2 4986
+a Black 396 5117 a FB(\225)p Black 479 5117 a
+SDict begin H.S end
+ 479 5117
+a 479 5117 a
+SDict begin 13 H.A end
+ 479 5117 a 479 5117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:962) cvn H.B /DEST pdfmark
+end
+ 479 5117 a 479 5117
+a
+SDict begin H.S end
+ 479 5117 a 479 5117 a
+SDict begin 13 H.A end
+ 479 5117 a 479 5117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:963) cvn H.B /DEST pdfmark
+end
+ 479 5117
+a Fx(console)20 b FC(\227)g(If)g(running)f(as)h(daemon,)1607
+5117 y
+SDict begin H.S end
+ 1607 5117 a 1607 5117 a
+SDict begin 13 H.A end
+ 1607 5117 a 1607 5117
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:964) cvn H.B /DEST pdfmark
+end
+ 1607 5117 a Fr(/dev/console)f FC(is)i(used,)e(otherwise)h(stderr)-5
+b(.)3005 5117 y
+SDict begin H.S end
+ 3005 5117 a 3005 5117 a
+SDict begin 13 H.A end
+ 3005 5117 a 3005
+5117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:965) cvn H.B /DEST pdfmark
+end
+ 3005 5117 a Fr(/dev/console)19 b FC(can)479 5225
+y(be)h(replaced)f(by)h(other)g(de)n(vices,)f(including)f(a)j(FIFO.)-2
+5243 y
+SDict begin H.S end
+ -2 5243 a -2 5243 a
+SDict begin 13 H.A end
+ -2 5243 a -2 5243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:966) cvn H.B /DEST pdfmark
+end
+ -2 5243
+a Black 396 5375 a FB(\225)p Black 479 5375 a
+SDict begin H.S end
+ 479 5375
+a 479 5375 a
+SDict begin 13 H.A end
+ 479 5375 a 479 5375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:967) cvn H.B /DEST pdfmark
+end
+ 479 5375 a 479 5375
+a
+SDict begin H.S end
+ 479 5375 a 479 5375 a
+SDict begin 13 H.A end
+ 479 5375 a 479 5375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:968) cvn H.B /DEST pdfmark
+end
+ 479 5375
+a Fx(lo)o(g)f(\002le)h FC(\227)f(Entries)g(are)g(signed)g(to)g(pro)o
+(vide)e(tamper)n(-resistance.)-2 5393 y
+SDict begin H.S end
+ -2 5393 a -2
+5393 a
+SDict begin 13 H.A end
+ -2 5393 a -2 5393 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:969) cvn H.B /DEST pdfmark
+end
+ -2 5393 a Black 3661 5805
+a Fx(21)p Black eop end
+%%Page: 22 27
+TeXDict begin 22 26 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.22) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1015) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2239 104 a Fx(Chapter)20
+b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d(facilities)p
+Black Black 396 309 a FB(\225)p Black 479 309 a
+SDict begin H.S end
+ 479 309
+a 479 309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:970) cvn H.B /DEST pdfmark
+end
+ 479 309 a 479 309 a
+SDict begin H.S end
+ 479
+309 a 479 309 a
+SDict begin 13 H.A end
+ 479 309 a 479 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:971) cvn H.B /DEST pdfmark
+end
+ 479 309 a Fx(lo)o(g)h(server)j
+FC(\227)936 309 y
+SDict begin H.S end
+ 936 309 a 936 309 a
+SDict begin 13 H.A end
+ 936 309 a 936 309
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:972) cvn H.B /DEST pdfmark
+end
+ 936 309 a FC(samhain)c(uses)i(TCP/IP)f(with)h(strong)e
+(authentication)f(and)h(signed)h(and)f(encrypted)f(messages.)-2
+327 y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:973) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black
+396 458 a FB(\225)p Black 479 458 a
+SDict begin H.S end
+ 479 458 a 479 458
+a
+SDict begin 13 H.A end
+ 479 458 a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:974) cvn H.B /DEST pdfmark
+end
+ 479 458 a 479 458 a
+SDict begin H.S end
+ 479 458 a 479
+458 a
+SDict begin 13 H.A end
+ 479 458 a 479 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:975) cvn H.B /DEST pdfmark
+end
+ 479 458 a Fx(e)n(xternal)k
+FC(\227)874 458 y
+SDict begin H.S end
+ 874 458 a 874 458 a
+SDict begin 13 H.A end
+ 874 458 a 874 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:976) cvn H.B /DEST pdfmark
+end
+ 874 458 a FC(samhain)f(can)g(be)g(con\002gured)e(to)i(in)m(v)n(ok)o
+(e)f(e)o(xternal)g(programs)f(for)i(logging)e(and/or)h(taking)479
+566 y(some)h(action)g(upon)f(certain)g(conditions.)-2
+584 y
+SDict begin H.S end
+ -2 584 a -2 584 a
+SDict begin 13 H.A end
+ -2 584 a -2 584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:977) cvn H.B /DEST pdfmark
+end
+ -2 584 a Black
+396 716 a FB(\225)p Black 479 716 a
+SDict begin H.S end
+ 479 716 a 479 716
+a
+SDict begin 13 H.A end
+ 479 716 a 479 716 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:978) cvn H.B /DEST pdfmark
+end
+ 479 716 a 479 716 a
+SDict begin H.S end
+ 479 716 a 479
+716 a
+SDict begin 13 H.A end
+ 479 716 a 479 716 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:979) cvn H.B /DEST pdfmark
+end
+ 479 716 a Fx(SQL)i(db)e FC(\227)i(Currently)
+1194 716 y
+SDict begin H.S end
+ 1194 716 a 1194 716 a
+SDict begin 13 H.A end
+ 1194 716 a 1194 716
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:980) cvn H.B /DEST pdfmark
+end
+ 1194 716 a FC(samhain)f(supports)f(MySQL,)g(PostgreSQL,)h(Oracle,)g
+(and)f(unixODBC.)-2 733 y
+SDict begin H.S end
+ -2 733 a -2 733 a
+SDict begin 13 H.A end
+ -2 733 a
+-2 733 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:981) cvn H.B /DEST pdfmark
+end
+ -2 733 a Black 396 865 a FB(\225)p Black 479
+865 a
+SDict begin H.S end
+ 479 865 a 479 865 a
+SDict begin 13 H.A end
+ 479 865 a 479 865 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:982) cvn H.B /DEST pdfmark
+end
+ 479 865
+a 479 865 a
+SDict begin H.S end
+ 479 865 a 479 865 a
+SDict begin 13 H.A end
+ 479 865 a 479 865 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:983) cvn H.B /DEST pdfmark
+end
+ 479
+865 a Fx(Pr)m(elude)h FC(\227)864 865 y
+SDict begin H.S end
+ 864 865 a 864
+865 a
+SDict begin 13 H.A end
+ 864 865 a 864 865 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:984) cvn H.B /DEST pdfmark
+end
+ 864 865 a FC(samhain)f(can)h(be)g(compiled)f
+(with)h(support)f(for)h(the)g(Prelude)f(IDS,)i(i.e.)f(it)h(can)f(be)g
+(used)g(as)h(a)479 973 y(Prelude)f(sensor)-5 b(.)-2 1288
+y
+SDict begin H.S end
+ -2 1288 a -2 1288 a
+SDict begin 13 H.A end
+ -2 1288 a -2 1288 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:985) cvn H.B /DEST pdfmark
+end
+ -2 1288 a 396
+1396 a FC(Each)20 b(of)g(these)g(logging)f(f)o(acilities)i(has)f(to)g
+(be)g(acti)n(v)n(ated)g(by)g(setting)g(an)g(appropriate)e(threshold)g
+(on)i(the)396 1504 y(messages)h(to)f(be)g(logged)f(by)h(this)g(f)o
+(acility)-5 b(.)-2 1522 y
+SDict begin H.S end
+ -2 1522 a -2 1522 a
+SDict begin 11.7 H.A end
+ -2 1522
+a -2 1522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:986) cvn H.B /DEST pdfmark
+end
+ -2 1522 a -2 1647 a
+SDict begin H.S end
+ -2 1647 a -2 1647 a
+SDict begin 11.7 H.A end
+ -2
+1647 a -2 1647 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:988) cvn H.B /DEST pdfmark
+end
+ -2 1647 a 562 1726 a Fw(NO)m(TE:)21
+b Fv(In)f(addition,)d(some)j(of)g(these)g(f)n(acilities)e(require)g
+(proper)h(settings)g(in)h(the)g(con\002gur)o(ation)e(\002le)i(\(see)562
+1823 y(ne)n(xt)g(sections\).)-2 2055 y
+SDict begin H.S end
+ -2 2055 a -2 2055
+a
+SDict begin 13 H.A end
+ -2 2055 a -2 2055 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:THRESHOLDS) cvn H.B /DEST pdfmark
+end
+ -2 2055 a 378 x Fu(4.3.)39 b(Activ)m(ating)e(log)
+o(ging)h(facilities)g(and)h(\002ltering)f(messa)o(g)q(es)3735
+2433 y
+SDict begin H.S end
+ 3735 2433 a 3735 2433 a
+SDict begin 22.464 H.A end
+ 3735 2433 a 3735 2433
+a
+SDict begin [ /View [/XYZ H.V] /Dest (6.23.1) cvn H.B /DEST pdfmark
+end
+ 3735 2433 a -2 2631 a
+SDict begin H.S end
+ -2 2631 a -2 2631 a
+SDict begin 13 H.A end
+ -2 2631 a
+-2 2631 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:991) cvn H.B /DEST pdfmark
+end
+ -2 2631 a 396 2707 a FC(All)21 b(messages)f(ha)n(v)o(e)g(a)
+1090 2707 y
+SDict begin H.S end
+ 1090 2707 a 1090 2707 a
+SDict begin 13 H.A end
+ 1090 2707 a 1090
+2707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:992) cvn H.B /DEST pdfmark
+end
+ 1090 2707 a Fx(se)o(verity)g FC(le)n(v)o(el)g(\(see)p
+0 TeXcolorgray 1701 2707 a
+SDict begin H.S end
+ 1701 2707 a FC(Section)f(4.1.1)2138
+2707 y
+SDict begin 13 H.L end
+ 2138 2707 a 2138 2707 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2138 2707 a Black -2 w
+FC(>\))i(and)e(a)2430 2707 y
+SDict begin H.S end
+ 2430 2707 a 2430 2707 a
+SDict begin 13 H.A end
+
+2430 2707 a 2430 2707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:994) cvn H.B /DEST pdfmark
+end
+ 2430 2707 a Fx(class)i FC(\(see)p
+0 TeXcolorgray 2771 2707 a
+SDict begin H.S end
+ 2771 2707 a FC(Section)f(4.1.2)3209
+2707 y
+SDict begin 13 H.L end
+ 3209 2707 a 3209 2707 a
+SDict begin [ /Subtype /Link /Dest (0:CLASSES) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3209 2707 a Black -2 w
+FC(>\),)g(with)396 2815 y(some)n(what)g(orthogonal)d(meaning:)-2
+2999 y
+SDict begin H.S end
+ -2 2999 a -2 2999 a
+SDict begin 13 H.A end
+ -2 2999 a -2 2999 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:996) cvn H.B /DEST pdfmark
+end
+ -2 2999
+a 396 3088 a FC(The)546 3088 y
+SDict begin H.S end
+ 546 3088 a 546 3088 a
+SDict begin 13 H.A end
+
+546 3088 a 546 3088 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:997) cvn H.B /DEST pdfmark
+end
+ 546 3088 a Fx(se)o(verity)k FC(ranks)e(messages)i
+(with)f(respect)g(to)g(their)g(importance.)e(Most)j(e)n(v)o(ents)e
+(\(e.g.)h(timestamps,)f(internal)396 3196 y(errors,)g(program)f
+(startup/e)o(xit\))h(ha)n(v)o(e)1529 3196 y
+SDict begin H.S end
+ 1529 3196
+a 1529 3196 a
+SDict begin 13 H.A end
+ 1529 3196 a 1529 3196 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:998) cvn H.B /DEST pdfmark
+end
+ 1529 3196 a Fx(\002xed)i
+FC(se)n(v)o(erities.)f(Ho)n(we)n(v)o(er)m(,)e(as)j(importance)e
+(sometimes)g(is)j(a)e(matter)g(of)396 3304 y(taste,)h(some)f(e)n(v)o
+(ents)g(ha)n(v)o(e)1190 3304 y
+SDict begin H.S end
+ 1190 3304 a 1190 3304
+a
+SDict begin 13 H.A end
+ 1190 3304 a 1190 3304 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:999) cvn H.B /DEST pdfmark
+end
+ 1190 3304 a Fx(con\002gur)o(able)d
+FC(se)n(v)o(erities)j(\(see)p 0 TeXcolorgray 2115 3304
+a
+SDict begin H.S end
+ 2115 3304 a FC(Section)g(4.1)2490 3304 y
+SDict begin 13 H.L end
+ 2490 3304
+a 2490 3304 a
+SDict begin [ /Subtype /Link /Dest (0:LOGDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2490 3304 a Black -2 w FC(>\).)-2 3487
+y
+SDict begin H.S end
+ -2 3487 a -2 3487 a
+SDict begin 13 H.A end
+ -2 3487 a -2 3487 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1001) cvn H.B /DEST pdfmark
+end
+ -2 3487 a -2
+3487 a
+SDict begin H.S end
+ -2 3487 a -2 3487 a
+SDict begin 13 H.A end
+ -2 3487 a -2 3487 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1002) cvn H.B /DEST pdfmark
+end
+ -2 3487
+a 396 3578 a Fx(Classes)i FC(refer)d(to)h(the)h(purpose/cate)o(gory)16
+b(of)k(a)h(message.)e(As)i(such,)f(the)o(y)f(should)h(\(ideally\))f(be)
+h(useful)f(to)396 3686 y(e)o(xclude)g(messages)h(that)h(are)f(not)g
+(interesting)f(in)h(some)g(conte)o(xt)f(\(e.g.)g(startup/stop)h
+(messages)g(may)g(seem)396 3794 y(useless)h(noise)f(if)h(samhain)e(is)i
+(run)f(from)f(cron\).)-2 3975 y
+SDict begin H.S end
+ -2 3975 a -2 3975 a
+SDict begin 13 H.A end
+ -2
+3975 a -2 3975 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1003) cvn H.B /DEST pdfmark
+end
+ -2 3975 a 396 4068 a FC(Ob)o(viously)-5
+b(,)18 b(as)867 4068 y
+SDict begin H.S end
+ 867 4068 a 867 4068 a
+SDict begin 13 H.A end
+ 867 4068
+a 867 4068 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1004) cvn H.B /DEST pdfmark
+end
+ 867 4068 a Fx(se)o(verity)j FC(is)g(a)f(rank,)f(the)i
+(most)f(natural)f(w)o(ay)h(to)h(e)o(xclude)e(unw)o(anted)f(messages)j
+(is)g(to)f(set)h(a)396 4176 y
+SDict begin H.S end
+ 396 4176 a 396 4176 a
+SDict begin 13 H.A end
+ 396
+4176 a 396 4176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1005) cvn H.B /DEST pdfmark
+end
+ 396 4176 a Fx(thr)m(eshold)r FC(.)f(On)g(the)g(other)
+f(hand,)g(as)i(the)f(message)1903 4176 y
+SDict begin H.S end
+ 1903 4176 a
+1903 4176 a
+SDict begin 13 H.A end
+ 1903 4176 a 1903 4176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1006) cvn H.B /DEST pdfmark
+end
+ 1903 4176 a Fx(class)h
+FC(is)g(a)g(cate)o(gory)-5 b(,)18 b(the)i(most)g(natural)f(w)o(ay)i(to)
+f(e)o(xclude)396 4284 y(messages)h(is)g(to)892 4284 y
+SDict begin H.S end
+
+892 4284 a 892 4284 a
+SDict begin 13 H.A end
+ 892 4284 a 892 4284 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1007) cvn H.B /DEST pdfmark
+end
+ 892 4284
+a Fx(list)i FC(those)d(message)g(classes)h(that)f(you)g(w)o(ant.)-2
+4468 y
+SDict begin H.S end
+ -2 4468 a -2 4468 a
+SDict begin 13 H.A end
+ -2 4468 a -2 4468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1008) cvn H.B /DEST pdfmark
+end
+ -2 4468
+a 396 4558 a FC(Messages)h(are)f(only)f(logged)g(to)h(a)h(log)f(f)o
+(acility)g(if)g(their)g(se)n(v)o(erity)g(is)h(at)f(least)h(as)g(high)f
+(as)h(the)f(threshold)f(of)g(that)396 4666 y(f)o(acility)-5
+b(,)20 b(and)f(their)h(class)h(is)h(one)d(of)h(those)g(w)o(anted)g
+(\(by)f(def)o(ault:)h(all\).)g(Thresholds)f(and)g(class)i(lists)h(can)e
+(be)396 4774 y(speci\002ed)g(indi)n(vidually)e(for)i(each)g(f)o
+(acility)-5 b(.)-2 4792 y
+SDict begin H.S end
+ -2 4792 a -2 4792 a
+SDict begin 11.7 H.A end
+ -2 4792
+a -2 4792 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1009) cvn H.B /DEST pdfmark
+end
+ -2 4792 a 745 4891 2668 17 v 745 5350 17
+459 v 1843 5045 a Fp(CA)-10 b(VEA)f(T)786 5213 y
+SDict begin H.S end
+ 786
+5213 a 786 5213 a
+SDict begin 11.7 H.A end
+ 786 5213 a 786 5213 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1011) cvn H.B /DEST pdfmark
+end
+ 786 5213 a 95
+x Fv(Most)21 b(log)f(f)n(acilities)e(are)1503 5308 y
+SDict begin H.S end
+
+1503 5308 a 1503 5308 a
+SDict begin 11.7 H.A end
+ 1503 5308 a 1503 5308 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1012) cvn H.B /DEST pdfmark
+end
+ 1503
+5308 a Fq(off)h(b)o(y)i(def)n(ault)7 b Fv(.)p 3396 5350
+17 459 v 745 5366 2668 17 v -2 5377 a
+SDict begin H.S end
+ -2 5377 a -2 5377
+a
+SDict begin 11.7 H.A end
+ -2 5377 a -2 5377 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1013) cvn H.B /DEST pdfmark
+end
+ -2 5377 a Black 3661 5805 a Fx(22)p
+Black eop end
+%%Page: 23 28
+TeXDict begin 23 27 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.23) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 562 309 a Fw(TIP:)i Fv(A)h(threshold)d(of)i
+Fq(none)h Fv(s)n(witches)f(off)f(the)h(respectiv)n(e)f(f)n(acility)-7
+b(.)39 447 y
+SDict begin H.S end
+ 39 447 a 39 447 a
+SDict begin 11.7 H.A end
+ 39 447 a 39 447 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1017) cvn H.B /DEST pdfmark
+end
+ 39 447
+a -2 613 a
+SDict begin H.S end
+ -2 613 a -2 613 a
+SDict begin 11.7 H.A end
+ -2 613 a -2 613 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1019) cvn H.B /DEST pdfmark
+end
+ -2 613
+a 562 711 a Fw(TIP)20 b(\(ser)q(ver)f(onl)o(y\):)g Fv(By)i(def)n(ault,)
+d(messages)i(receiv)n(ed)f(b)o(y)h(the)g(ser)r(v)n(er)h(are)e(treated)g
+(specially)-7 b(,)18 b(and)i(are)562 808 y(alw)o(a)n(ys)g(logged)e(to)i
+(the)g(log\002le)o(,)e(and)i(ne)n(v)n(er)f(to)h(mail)g(or)g(syslog.)h
+(If)f(y)o(ou)g(don't)e(lik)o(e)i(that,)f(use)h(the)g(option)562
+905 y
+SDict begin H.S end
+ 562 905 a 562 905 a
+SDict begin 11.7 H.A end
+ 562 905 a 562 905 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1020) cvn H.B /DEST pdfmark
+end
+ 562 905
+a Fq(UseClientSe)n(v)n(er)q(ity=y)o(es)f Fv(\(section)1617
+905 y
+SDict begin H.S end
+ 1617 905 a 1617 905 a
+SDict begin 11.7 H.A end
+ 1617 905 a 1617 905 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1021) cvn H.B /DEST pdfmark
+end
+ 1617
+905 a Fq([Misc])7 b Fv(\).)-2 1220 y
+SDict begin H.S end
+ -2 1220 a -2 1220
+a
+SDict begin 13 H.A end
+ -2 1220 a -2 1220 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1022) cvn H.B /DEST pdfmark
+end
+ -2 1220 a 396 1328 a FC(Thresholds)19
+b(and)h(class)h(lists)g(are)f(set)h(in)g(the)1706 1328
+y
+SDict begin H.S end
+ 1706 1328 a 1706 1328 a
+SDict begin 13 H.A end
+ 1706 1328 a 1706 1328 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1023) cvn H.B /DEST pdfmark
+end
+ 1706
+1328 a Fx(Lo)o(g)f FC(section)g(of)g(the)g(con\002guration)e(\002le.)i
+(F)o(or)g(each)g(threshold)396 1436 y(option)629 1436
+y
+SDict begin H.S end
+ 629 1436 a 629 1436 a
+SDict begin 13 H.A end
+ 629 1436 a 629 1436 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1024) cvn H.B /DEST pdfmark
+end
+ 629 1436
+a 629 1436 a
+SDict begin H.S end
+ 629 1436 a 629 1436 a
+SDict begin 13 H.A end
+ 629 1436 a 629 1436
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1025) cvn H.B /DEST pdfmark
+end
+ 629 1436 a Fl(Facility)7 b Fy(Se)o(v)o(erity)18 b FC(there)i(is)h
+(also)f(a)h(corresponding)c(option)2508 1436 y
+SDict begin H.S end
+ 2508 1436
+a 2508 1436 a
+SDict begin 13 H.A end
+ 2508 1436 a 2508 1436 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1026) cvn H.B /DEST pdfmark
+end
+ 2508 1436 a 2508
+1436 a
+SDict begin H.S end
+ 2508 1436 a 2508 1436 a
+SDict begin 13 H.A end
+ 2508 1436 a 2508 1436
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1027) cvn H.B /DEST pdfmark
+end
+ 2508 1436 a Fl(Facility)7 b Fy(Class)19 b FC(to)i(limit)f(that)h(f)o
+(acility)396 1544 y(to)g(messages)f(within)g(a)h(gi)n(v)o(en)d(set)j
+(of)f(class.)h(The)f(ar)o(gument)e(must)i(be)g(a)h(list)g(of)f(v)n
+(alid)g(message)g(classes,)396 1652 y(separated)g(by)f(space)h(or)g
+(comma.)-2 1836 y
+SDict begin H.S end
+ -2 1836 a -2 1836 a
+SDict begin 13 H.A end
+ -2 1836 a -2 1836
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1028) cvn H.B /DEST pdfmark
+end
+ -2 1836 a 396 1926 a FC(Actually)-5 b(,)19 b(the)841
+1926 y
+SDict begin H.S end
+ 841 1926 a 841 1926 a
+SDict begin 13 H.A end
+ 841 1926 a 841 1926 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1029) cvn H.B /DEST pdfmark
+end
+ 841
+1926 a 841 1926 a
+SDict begin H.S end
+ 841 1926 a 841 1926 a
+SDict begin 13 H.A end
+ 841 1926 a 841
+1926 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1030) cvn H.B /DEST pdfmark
+end
+ 841 1926 a Fl(Facility)7 b Fy(Se)o(v)o(erity)17
+b FC(can)j(tak)o(e)h(a)f(list)h(of)f(se)n(v)o(erities)g(with)h
+(optional)e(speci\002ers)h('*',)f('!',)h(or)g('=',)396
+2034 y(which)g(are)g(interpreted)e(as)j('all',)f('e)o(xcluding',)d(and)
+i('only',)f(respecti)n(v)o(ely)-5 b(.)18 b(Examples:)h(specifying)g
+('*')g(is)j(equal)396 2142 y(to)f(specify)e(')l(deb)n(ug';)f
+(specifying)h('!*')g(is)i(equal)f(to)g(specifying)f('none';)f
+('info,!crit')g(is)j(the)g(range)e(from)g('info')396
+2250 y(to)i('err')e(\(e)o(xcluding)e(crit)k(and)e(abo)o(v)o(e\);)g(and)
+g('info,!=err')f(is)j(info)e(and)h(abo)o(v)o(e,)e(b)n(ut)i(e)o
+(xcluding)e(\(only\))h('err'.)g(This)396 2358 y(is)i(the)g(same)f
+(scheme)g(as)h(used)f(by)f(the)i(Linux)e(syslogd)g(\(see)i(man)e(5)h
+(syslogd\).)-2 2542 y
+SDict begin H.S end
+ -2 2542 a -2 2542 a
+SDict begin 13 H.A end
+ -2 2542 a -2
+2542 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1031) cvn H.B /DEST pdfmark
+end
+ -2 2542 a -2 2542 a
+SDict begin H.S end
+ -2 2542 a -2 2542 a
+SDict begin 13 H.A end
+ -2 2542
+a -2 2542 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1032) cvn H.B /DEST pdfmark
+end
+ -2 2542 a 396 2632 a Fx(System)h(calls:)f
+FC(certain)f(system)i(calls)g(\(e)o(x)o(ecv)o(e,)d(utime,)h(unlink,)g
+(dup)g(\(+)i(dup2\),)d(chdir)m(,)h(open,)f(kill,)j(e)o(xit)f(\(+)396
+2740 y(_e)o(xit\),)f(fork,)g(setuid,)h(setgid,)g(pipe\))f(can)h(be)g
+(logged)f(\(only)g(to)h(console)g(and)f(syslog\).)h(Y)-9
+b(ou)19 b(can)h(determine)f(the)396 2848 y(set)i(of)f(system)h(calls)f
+(to)h(log)f(via)g(the)g(option)1713 2848 y
+SDict begin H.S end
+ 1713 2848
+a 1713 2848 a
+SDict begin 13 H.A end
+ 1713 2848 a 1713 2848 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1033) cvn H.B /DEST pdfmark
+end
+ 1713 2848 a Fy(LogCalls=)2079
+2848 y
+SDict begin H.S end
+ 2079 2848 a 2079 2848 a
+SDict begin 13 H.A end
+ 2079 2848 a 2079 2848
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1034) cvn H.B /DEST pdfmark
+end
+ 2079 2848 a Fl(call1,)44 b(call2,)f(...)p FC(.)20 b(By)h(def)o(ault,)
+e(this)i(is)g(of)n(f)396 2955 y(\(nothing)d(is)k(logged\).)c(The)i
+(priority)e(is)1565 2955 y
+SDict begin H.S end
+ 1565 2955 a 1565 2955 a
+SDict begin 13 H.A end
+ 1565
+2955 a 1565 2955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1035) cvn H.B /DEST pdfmark
+end
+ 1565 2955 a Fx(notice)p FC(,)i(and)g(the)g(class)h
+(is)g(A)-5 b(UD.)-2 3139 y
+SDict begin H.S end
+ -2 3139 a -2 3139 a
+SDict begin 13 H.A end
+ -2 3139
+a -2 3139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1036) cvn H.B /DEST pdfmark
+end
+ -2 3139 a -2 3139 a
+SDict begin H.S end
+ -2 3139 a -2 3139 a
+SDict begin 13 H.A end
+ -2
+3139 a -2 3139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1037) cvn H.B /DEST pdfmark
+end
+ -2 3139 a 396 3229 a Fx(Example:)-2
+3329 y
+SDict begin H.S end
+ -2 3329 a -2 3329 a
+SDict begin 11.7 H.A end
+ -2 3329 a -2 3329 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1038) cvn H.B /DEST pdfmark
+end
+ -2 3329
+a 486 3410 a Fr([Log])486 3507 y(#)486 3604 y(#)45 b(Threshold)e(for)h
+(E-mails)g(\(none)g(=)h(switched)e(off\))486 3701 y(#)486
+3798 y(MailSeverity=none)486 3895 y(#)486 3992 y(#)i(Threshold)e(for)h
+(log)h(file)486 4090 y(#)486 4187 y(LogSeverity=err)486
+4284 y(LogClass=RUN)e(FIL)h(STAMP)486 4381 y(#)486 4478
+y(#)h(Threshold)e(for)h(console)486 4575 y(#)486 4672
+y(PrintSeverity=info)486 4769 y(#)486 4867 y(#)h(Threshold)e(for)h
+(syslog)g(\(none)g(=)h(switched)e(off\))486 4964 y(#)486
+5061 y(SyslogSeverity=none)486 5158 y(#)486 5255 y(#)i(Threshold)e(for)
+h(logging)g(to)g(Prelude)g(\(none)g(=)h(switched)e(off\))486
+5352 y(#)p Black 3661 5805 a Fx(23)p Black eop end
+%%Page: 24 29
+TeXDict begin 24 28 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.24) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 486 309 a Fr(PreludeSeverity=none)486
+406 y(#)486 503 y(#)45 b(Threshold)e(for)h(forwarding)f(to)i(the)f(log)
+h(server)486 600 y(#)486 697 y(ExportSeverity=crit)486
+794 y(#)486 892 y(#)g(Threshold)e(for)h(invoking)g(an)g(external)g
+(program)486 989 y(#)486 1086 y(ExternalSeverity=crit)486
+1183 y(#)486 1280 y(#)h(Threshold)e(for)h(logging)g(to)g(a)h(SQL)f
+(database)486 1377 y(#)486 1474 y(DatabaseSeverity=err)486
+1571 y(#)486 1669 y(#)h(System)e(calls)h(to)h(log)486
+1766 y(#)486 1863 y(LogCalls=open,)d(kill)-2 1958 y
+SDict begin H.S end
+ -2
+1958 a -2 1958 a
+SDict begin 13 H.A end
+ -2 1958 a -2 1958 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGURATION-EMAIL) cvn H.B
+/DEST pdfmark end
+ -2 1958 a 365 x
+Fu(4.4.)d(E-mail)709 2323 y
+SDict begin H.S end
+ 709 2323 a 709 2323 a
+SDict begin 22.464 H.A end
+ 709
+2323 a 709 2323 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.24.1) cvn H.B /DEST pdfmark
+end
+ 709 2323 a -2 2491 a
+SDict begin H.S end
+ -2 2491 a -2 2491
+a
+SDict begin 13 H.A end
+ -2 2491 a -2 2491 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1041) cvn H.B /DEST pdfmark
+end
+ -2 2491 a 396 2597 a FC(Items)20
+b(that)h(can/must)e(be)h(con\002gured)e(are:)1708 2597
+y
+SDict begin H.S end
+ 1708 2597 a 1708 2597 a
+SDict begin 13 H.A end
+ 1708 2597 a 1708 2597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1042) cvn H.B /DEST pdfmark
+end
+ 1708
+2597 a -2 2739 a
+SDict begin H.S end
+ -2 2739 a -2 2739 a
+SDict begin 13 H.A end
+ -2 2739 a -2 2739
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1044) cvn H.B /DEST pdfmark
+end
+ -2 2739 a 396 2829 a FC(Recipients)j(address)-2 2847
+y
+SDict begin H.S end
+ -2 2847 a -2 2847 a
+SDict begin 13 H.A end
+ -2 2847 a -2 2847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1045) cvn H.B /DEST pdfmark
+end
+ -2 2847 a Black
+Black 562 2979 a
+SDict begin H.S end
+ 562 2979 a 562 2979 a
+SDict begin 13 H.A end
+ 562 2979 a 562
+2979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1046) cvn H.B /DEST pdfmark
+end
+ 562 2979 a 562 2979 a
+SDict begin H.S end
+ 562 2979 a 562 2979 a
+SDict begin 13 H.A end
+ 562
+2979 a 562 2979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1047) cvn H.B /DEST pdfmark
+end
+ 562 2979 a Fy(SetMailAddr)o(ess=)1175
+2979 y
+SDict begin H.S end
+ 1175 2979 a 1175 2979 a
+SDict begin 13 H.A end
+ 1175 2979 a 1175 2979
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1048) cvn H.B /DEST pdfmark
+end
+ 1175 2979 a Fl(username@hostname)-2 3146 y
+SDict begin H.S end
+ -2 3146
+a -2 3146 a
+SDict begin 13 H.A end
+ -2 3146 a -2 3146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1049) cvn H.B /DEST pdfmark
+end
+ -2 3146 a 562 3253 a
+FC(Up)g(to)f(eight)g(addresses)g(are)g(possible,)f(each)h(one)g(at)h
+(most)f(63)g(characters)f(long,)2958 3253 y
+SDict begin H.S end
+ 2958 3253
+a 2958 3253 a
+SDict begin 13 H.A end
+ 2958 3253 a 2958 3253 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1050) cvn H.B /DEST pdfmark
+end
+ 2958 3253 a Fx(eac)o(h)g(on)h(a)g
+(seper)o(ate)g(line)562 3361 y(in)h(the)f(con\002gur)o(ation)d(\002le)p
+FC(.)-2 3378 y
+SDict begin H.S end
+ -2 3378 a -2 3378 a
+SDict begin 11.7 H.A end
+ -2 3378 a -2 3378
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1051) cvn H.B /DEST pdfmark
+end
+ -2 3378 a -2 3502 a
+SDict begin H.S end
+ -2 3502 a -2 3502 a
+SDict begin 11.7 H.A end
+ -2 3502 a -2
+3502 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1053) cvn H.B /DEST pdfmark
+end
+ -2 3502 a 728 3582 a Fw(TIP:)j Fv(it)g(is)h(recommended)d(to)j
+(use)f(n)o(umer)q(ical)f(IP)h(addresses)g(instead)e(of)i(host)g(names)g
+(\(to)g(a)o(v)n(oid)728 3680 y(DNS)h(lookups\).)-2 4103
+y
+SDict begin H.S end
+ -2 4103 a -2 4103 a
+SDict begin 13 H.A end
+ -2 4103 a -2 4103 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1055) cvn H.B /DEST pdfmark
+end
+ -2 4103 a 396
+4211 a FC(Relay)g(host)f(/)h(Mail)f(e)o(xchanger)-2 4229
+y
+SDict begin H.S end
+ -2 4229 a -2 4229 a
+SDict begin 13 H.A end
+ -2 4229 a -2 4229 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1056) cvn H.B /DEST pdfmark
+end
+ -2 4229 a Black
+Black 562 4360 a
+SDict begin H.S end
+ 562 4360 a 562 4360 a
+SDict begin 13 H.A end
+ 562 4360 a 562
+4360 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1057) cvn H.B /DEST pdfmark
+end
+ 562 4360 a 562 4360 a
+SDict begin H.S end
+ 562 4360 a 562 4360 a
+SDict begin 13 H.A end
+ 562
+4360 a 562 4360 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1058) cvn H.B /DEST pdfmark
+end
+ 562 4360 a Fy(SetMailRelay=)1090 4360
+y
+SDict begin H.S end
+ 1090 4360 a 1090 4360 a
+SDict begin 13 H.A end
+ 1090 4360 a 1090 4360 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1059) cvn H.B /DEST pdfmark
+end
+ 1090
+4360 a Fl(mail.some_domain.com)-2 4543 y
+SDict begin H.S end
+ -2 4543 a -2
+4543 a
+SDict begin 13 H.A end
+ -2 4543 a -2 4543 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1060) cvn H.B /DEST pdfmark
+end
+ -2 4543 a 562 4634 a FC(Y)-9
+b(ou)20 b(may)g(need)f(this)i(option)e(because)g(some)h(sites)i(don')o
+(t)c(allo)n(w)i(outbound)e(e-mail)i(connections)e(from)562
+4742 y(an)o(y)i(arbitrary)e(host.)i(If)g(the)g(recipient)g(is)h(of)n
+(fsite,)e(and)h(your)f(site)i(uses)g(a)f(mail)h(relay)e(host)i(to)f
+(route)562 4850 y(outbound)e(e-mails,)i(you)f(need)g(to)i(specify)e
+(the)i(relay)e(host.)p Black 3661 5805 a Fx(24)p Black
+eop end
+%%Page: 25 30
+TeXDict begin 25 29 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.25) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1062) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(Maximum)h(interv)n(al)-2
+310 y
+SDict begin H.S end
+ -2 310 a -2 310 a
+SDict begin 13 H.A end
+ -2 310 a -2 310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1063) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black
+Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1064) cvn H.B /DEST pdfmark
+end
+ 562 458 a 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562
+458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1065) cvn H.B /DEST pdfmark
+end
+ 562 458 a Fy(SetMailT)o(ime=)1069 458 y
+SDict begin H.S end
+ 1069 458
+a 1069 458 a
+SDict begin 13 H.A end
+ 1069 458 a 1069 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1066) cvn H.B /DEST pdfmark
+end
+ 1069 458 a Fl(86400)-2
+626 y
+SDict begin H.S end
+ -2 626 a -2 626 a
+SDict begin 13 H.A end
+ -2 626 a -2 626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1067) cvn H.B /DEST pdfmark
+end
+ -2 626 a 562
+732 a FC(Y)-9 b(ou)20 b(may)g(w)o(ant)g(to)g(set)h(a)g(maximum)d
+(interv)n(al)i(between)f(an)o(y)g(tw)o(o)i(consecuti)n(v)o(e)d
+(e-mails,)i(to)h(be)f(sure)g(that)562 840 y
+SDict begin H.S end
+ 562 840 a
+562 840 a
+SDict begin 13 H.A end
+ 562 840 a 562 840 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1068) cvn H.B /DEST pdfmark
+end
+ 562 840 a FC(samhain)g(is)h(still)g('ali)
+n(v)o(e'.)-2 1041 y
+SDict begin H.S end
+ -2 1041 a -2 1041 a
+SDict begin 13 H.A end
+ -2 1041 a -2
+1041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1070) cvn H.B /DEST pdfmark
+end
+ -2 1041 a 396 1149 a FC(Maximum)e(pending)-2 1167
+y
+SDict begin H.S end
+ -2 1167 a -2 1167 a
+SDict begin 13 H.A end
+ -2 1167 a -2 1167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1071) cvn H.B /DEST pdfmark
+end
+ -2 1167 a Black
+Black 562 1299 a
+SDict begin H.S end
+ 562 1299 a 562 1299 a
+SDict begin 13 H.A end
+ 562 1299 a 562
+1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1072) cvn H.B /DEST pdfmark
+end
+ 562 1299 a 562 1299 a
+SDict begin H.S end
+ 562 1299 a 562 1299 a
+SDict begin 13 H.A end
+ 562
+1299 a 562 1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1073) cvn H.B /DEST pdfmark
+end
+ 562 1299 a Fy(SetMailNum=)1061 1299
+y
+SDict begin H.S end
+ 1061 1299 a 1061 1299 a
+SDict begin 13 H.A end
+ 1061 1299 a 1061 1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1074) cvn H.B /DEST pdfmark
+end
+ 1061
+1299 a Fl(10)-2 1466 y
+SDict begin H.S end
+ -2 1466 a -2 1466 a
+SDict begin 13 H.A end
+ -2 1466 a
+-2 1466 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1075) cvn H.B /DEST pdfmark
+end
+ -2 1466 a 562 1573 a FC(Messages)i(can)f(be)g(queued)e(to)j
+(send)f(se)n(v)o(eral)f(messages)i(in)f(one)g(e-mail.)f(Y)-9
+b(ou)20 b(may)g(w)o(ant)g(to)g(set)h(the)f(the)562 1681
+y(maximum)f(number)f(of)i(messages)g(to)h(queue.)e(\(Note:)g(messages)i
+(of)f(highest)f(priority)g(\(alert\))h(are)g(al)o(w)o(ays)562
+1789 y(sent)h(immediately)-5 b(.)18 b(At)j(most)f(128)f(messages)i(can)
+f(be)g(queued.)-2 1990 y
+SDict begin H.S end
+ -2 1990 a -2 1990 a
+SDict begin 13 H.A end
+ -2 1990
+a -2 1990 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1077) cvn H.B /DEST pdfmark
+end
+ -2 1990 a 396 2098 a FC(Multiple)g(recipients)-2
+2116 y
+SDict begin H.S end
+ -2 2116 a -2 2116 a
+SDict begin 13 H.A end
+ -2 2116 a -2 2116 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1078) cvn H.B /DEST pdfmark
+end
+ -2 2116
+a Black Black 562 2247 a
+SDict begin H.S end
+ 562 2247 a 562 2247 a
+SDict begin 13 H.A end
+ 562 2247
+a 562 2247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1079) cvn H.B /DEST pdfmark
+end
+ 562 2247 a 562 2247 a
+SDict begin H.S end
+ 562 2247 a 562 2247
+a
+SDict begin 13 H.A end
+ 562 2247 a 562 2247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1080) cvn H.B /DEST pdfmark
+end
+ 562 2247 a Fy(MailSingle=)992
+2247 y
+SDict begin H.S end
+ 992 2247 a 992 2247 a
+SDict begin 13 H.A end
+ 992 2247 a 992 2247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1081) cvn H.B /DEST pdfmark
+end
+ 992
+2247 a Fl(yes/no)-2 2430 y
+SDict begin H.S end
+ -2 2430 a -2 2430 a
+SDict begin 13 H.A end
+ -2 2430
+a -2 2430 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1082) cvn H.B /DEST pdfmark
+end
+ -2 2430 a 562 2521 a FC(If)g(there)g(are)g(multiple)g
+(recipients,)f(whether)g(to)i(send)e(a)i(single)f(mail)h(with)f(the)g
+(recipient)f(list,)i(or)f(send)562 2629 y(multiple)g(mails.)g(If)g(all)
+h(recipients)f(are)g(on)g(same)g(domain,)e(a)j(single)f(mail)h(may)e
+(suf)n(\002ce,)h(otherwise)g(it)562 2737 y(depends)f(on)h(whether)f
+(the)h(mail)h(serv)o(er)e(supports)g(forw)o(arding)f(\(for)h(security)
+-5 b(,)19 b(most)h(don')o(t\).)-2 2938 y
+SDict begin H.S end
+ -2 2938 a -2
+2938 a
+SDict begin 13 H.A end
+ -2 2938 a -2 2938 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1084) cvn H.B /DEST pdfmark
+end
+ -2 2938 a 396 3046 a FC(Subject)g(line)-2
+3064 y
+SDict begin H.S end
+ -2 3064 a -2 3064 a
+SDict begin 13 H.A end
+ -2 3064 a -2 3064 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1085) cvn H.B /DEST pdfmark
+end
+ -2 3064
+a Black Black 562 3196 a
+SDict begin H.S end
+ 562 3196 a 562 3196 a
+SDict begin 13 H.A end
+ 562 3196
+a 562 3196 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1086) cvn H.B /DEST pdfmark
+end
+ 562 3196 a 562 3196 a
+SDict begin H.S end
+ 562 3196 a 562 3196
+a
+SDict begin 13 H.A end
+ 562 3196 a 562 3196 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1087) cvn H.B /DEST pdfmark
+end
+ 562 3196 a Fy(MailSubject=)1043
+3196 y
+SDict begin H.S end
+ 1043 3196 a 1043 3196 a
+SDict begin 13 H.A end
+ 1043 3196 a 1043 3196
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1088) cvn H.B /DEST pdfmark
+end
+ 1043 3196 a Fl(string)-2 3379 y
+SDict begin H.S end
+ -2 3379 a -2 3379 a
+SDict begin 13 H.A end
+
+-2 3379 a -2 3379 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1089) cvn H.B /DEST pdfmark
+end
+ -2 3379 a 562 3470 a FC(Here,)765
+3470 y
+SDict begin H.S end
+ 765 3470 a 765 3470 a
+SDict begin 13 H.A end
+ 765 3470 a 765 3470 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1090) cvn H.B /DEST pdfmark
+end
+ 765
+3470 a Fx(string)h FC(may)e(contain)h(the)g(placeholders)e(\045T)-6
+b(,)20 b(\045H,)h(\045S,)g(and/or)e(\045M)h(that)h(will)g(get)f
+(replaced)f(by)562 3578 y(the)i(time,)f(hostname,)e(message)i(se)n(v)o
+(erity)g(and)f(message)h(te)o(xt,)g(respecti)n(v)o(ely)-5
+b(.)18 b(The)i(def)o(ault)f(subject)h(line)h(is)562 3686
+y(equi)n(v)n(alent)e(to)h("\045T)h(\045H".)f(This)g(option)f(may)h(be)g
+(useful)g(if)g(you)g(w)o(ant)g(to)g(send)g(emails)h(to)f(an)562
+3794 y(email-to-sms)g(gate)n(w)o(ay)-5 b(.)-2 3995 y
+SDict begin H.S end
+
+-2 3995 a -2 3995 a
+SDict begin 13 H.A end
+ -2 3995 a -2 3995 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1092) cvn H.B /DEST pdfmark
+end
+ -2 3995 a 396
+4103 a FC(Sender)-2 4104 y
+SDict begin H.S end
+ -2 4104 a -2 4104 a
+SDict begin 13 H.A end
+ -2 4104
+a -2 4104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1093) cvn H.B /DEST pdfmark
+end
+ -2 4104 a Black Black 562 4252 a
+SDict begin H.S end
+ 562 4252
+a 562 4252 a
+SDict begin 13 H.A end
+ 562 4252 a 562 4252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1094) cvn H.B /DEST pdfmark
+end
+ 562 4252 a 562 4252
+a
+SDict begin H.S end
+ 562 4252 a 562 4252 a
+SDict begin 13 H.A end
+ 562 4252 a 562 4252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1095) cvn H.B /DEST pdfmark
+end
+ 562 4252
+a Fy(SetMailSender=)1135 4252 y
+SDict begin H.S end
+ 1135 4252 a 1135 4252
+a
+SDict begin 13 H.A end
+ 1135 4252 a 1135 4252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1096) cvn H.B /DEST pdfmark
+end
+ 1135 4252 a Fl(string)-2 4428
+y
+SDict begin H.S end
+ -2 4428 a -2 4428 a
+SDict begin 13 H.A end
+ -2 4428 a -2 4428 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1097) cvn H.B /DEST pdfmark
+end
+ -2 4428 a 562
+4526 a FC(Here,)765 4526 y
+SDict begin H.S end
+ 765 4526 a 765 4526 a
+SDict begin 13 H.A end
+ 765
+4526 a 765 4526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1098) cvn H.B /DEST pdfmark
+end
+ 765 4526 a Fx(string)21 b FC(is)g(the)f(address)g
+(that)g(is)h(inserted)f(in)g(the)g(From:)g(\002eld.)g(If)g(a)h(name)e
+(without)h(domain)f(is)i(gi)n(v)o(en)562 4634 y(\(i.e.)f(without)g
+('@xyz.tld'\),)e(the)i(FQDN)h(of)f(the)g(local)g(host)g(will)h(be)f
+(added)f(automatically)-5 b(.)-2 4835 y
+SDict begin H.S end
+ -2 4835 a -2
+4835 a
+SDict begin 13 H.A end
+ -2 4835 a -2 4835 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1100) cvn H.B /DEST pdfmark
+end
+ -2 4835 a 396 4943 a FC(AND)21
+b(Filter)-2 4944 y
+SDict begin H.S end
+ -2 4944 a -2 4944 a
+SDict begin 13 H.A end
+ -2 4944 a -2 4944
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1101) cvn H.B /DEST pdfmark
+end
+ -2 4944 a Black Black 562 5093 a
+SDict begin H.S end
+ 562 5093 a 562 5093
+a
+SDict begin 13 H.A end
+ 562 5093 a 562 5093 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1102) cvn H.B /DEST pdfmark
+end
+ 562 5093 a 562 5093 a
+SDict begin H.S end
+ 562 5093
+a 562 5093 a
+SDict begin 13 H.A end
+ 562 5093 a 562 5093 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1103) cvn H.B /DEST pdfmark
+end
+ 562 5093 a Fy(SetMailFilterAnd=)1237
+5093 y
+SDict begin H.S end
+ 1237 5093 a 1237 5093 a
+SDict begin 13 H.A end
+ 1237 5093 a 1237 5093
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1104) cvn H.B /DEST pdfmark
+end
+ 1237 5093 a Fl(list)p Black 3661 5805 a Fx(25)p Black
+eop end
+%%Page: 26 31
+TeXDict begin 26 30 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.26) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1105) cvn H.B /DEST pdfmark
+end
+ -2 226 a 562 309 a FC(If)i(used,)g(then)g(ALL)g(strings)g
+(in)1505 309 y
+SDict begin H.S end
+ 1505 309 a 1505 309 a
+SDict begin 13 H.A end
+ 1505 309 a 1505
+309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1106) cvn H.B /DEST pdfmark
+end
+ 1505 309 a Fx(list)j FC(must)d(occur)g(in)g(a)h(message,)e
+(otherwise)h(it)h(will)g(not)f(be)g(sent)g(by)g(email.)562
+417 y(As)h(whitespace)f(\(blank)f(or)h(tab\))g(is)h(a)f(v)n(alid)g
+(separator)f(in)h(a)h(list,)g(strings)f(with)h(whitespace)e(must)h(be)
+562 525 y(enclosed)g(in)g(single)g(or)g(double)f(quotes.)g(If)h(a)h
+(string)e(be)o(gins)h(with)g(a)h(double)d(quote,)h(enclose)h(it)h(in)f
+(single)562 632 y(quotes)g(\(and)f(vice)h(v)o(ersa\).)-2
+834 y
+SDict begin H.S end
+ -2 834 a -2 834 a
+SDict begin 13 H.A end
+ -2 834 a -2 834 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1108) cvn H.B /DEST pdfmark
+end
+ -2 834 a 396
+942 a FC(OR)h(Filter)-2 943 y
+SDict begin H.S end
+ -2 943 a -2 943 a
+SDict begin 13 H.A end
+ -2 943
+a -2 943 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1109) cvn H.B /DEST pdfmark
+end
+ -2 943 a Black Black 562 1091 a
+SDict begin H.S end
+ 562 1091 a
+562 1091 a
+SDict begin 13 H.A end
+ 562 1091 a 562 1091 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1110) cvn H.B /DEST pdfmark
+end
+ 562 1091 a 562 1091
+a
+SDict begin H.S end
+ 562 1091 a 562 1091 a
+SDict begin 13 H.A end
+ 562 1091 a 562 1091 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1111) cvn H.B /DEST pdfmark
+end
+ 562 1091
+a Fy(SetMailFilterOr=)1187 1091 y
+SDict begin H.S end
+ 1187 1091 a 1187 1091
+a
+SDict begin 13 H.A end
+ 1187 1091 a 1187 1091 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1112) cvn H.B /DEST pdfmark
+end
+ 1187 1091 a Fl(list)-2 1259
+y
+SDict begin H.S end
+ -2 1259 a -2 1259 a
+SDict begin 13 H.A end
+ -2 1259 a -2 1259 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1113) cvn H.B /DEST pdfmark
+end
+ -2 1259 a 562
+1365 a FC(If)f(used,)g(then)g(A)-9 b(T)20 b(LEAST)g(ONE)g(of)g(the)g
+(strings)h(in)2128 1365 y
+SDict begin H.S end
+ 2128 1365 a 2128 1365 a
+SDict begin 13 H.A end
+ 2128
+1365 a 2128 1365 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1114) cvn H.B /DEST pdfmark
+end
+ 2128 1365 a Fx(list)i FC(must)d(occur)f(in)i(a)f
+(message,)g(otherwise)f(it)i(will)562 1473 y(not)f(be)g(sent)h(by)f
+(email.)g(As)h(whitespace)e(\(blank)g(or)h(tab\))g(is)h(a)g(v)n(alid)e
+(separator)g(in)i(a)f(list,)h(strings)f(with)562 1581
+y(whitespace)g(must)g(be)g(enclosed)g(in)g(single)g(or)g(double)f
+(quotes.)g(If)h(a)h(string)e(be)o(gins)h(with)g(a)h(double)d(quote,)562
+1689 y(enclose)i(it)h(in)f(single)g(quotes)g(\(and)f(vice)h(v)o
+(ersa\).)-2 1890 y
+SDict begin H.S end
+ -2 1890 a -2 1890 a
+SDict begin 13 H.A end
+ -2 1890 a -2 1890
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1116) cvn H.B /DEST pdfmark
+end
+ -2 1890 a 396 1998 a FC(OR)h(Filter)-2 1999 y
+SDict begin H.S end
+ -2 1999
+a -2 1999 a
+SDict begin 13 H.A end
+ -2 1999 a -2 1999 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1117) cvn H.B /DEST pdfmark
+end
+ -2 1999 a Black Black
+562 2148 a
+SDict begin H.S end
+ 562 2148 a 562 2148 a
+SDict begin 13 H.A end
+ 562 2148 a 562 2148
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1118) cvn H.B /DEST pdfmark
+end
+ 562 2148 a 562 2148 a
+SDict begin H.S end
+ 562 2148 a 562 2148 a
+SDict begin 13 H.A end
+ 562 2148
+a 562 2148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1119) cvn H.B /DEST pdfmark
+end
+ 562 2148 a Fy(SetMailFilterNot=)1215 2148
+y
+SDict begin H.S end
+ 1215 2148 a 1215 2148 a
+SDict begin 13 H.A end
+ 1215 2148 a 1215 2148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1120) cvn H.B /DEST pdfmark
+end
+ 1215
+2148 a Fl(list)-2 2315 y
+SDict begin H.S end
+ -2 2315 a -2 2315 a
+SDict begin 13 H.A end
+ -2 2315
+a -2 2315 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1121) cvn H.B /DEST pdfmark
+end
+ -2 2315 a 562 2422 a FC(If)f(used,)g(then)g(NONE)g(of)g
+(the)g(strings)g(in)1787 2422 y
+SDict begin H.S end
+ 1787 2422 a 1787 2422
+a
+SDict begin 13 H.A end
+ 1787 2422 a 1787 2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1122) cvn H.B /DEST pdfmark
+end
+ 1787 2422 a Fx(list)i FC(can)e(occur)g(in)g
+(a)h(message,)e(otherwise)h(it)h(will)g(not)f(be)g(sent)g(by)562
+2530 y(email.)g(As)g(whitespace)f(\(blank)g(or)g(tab\))g(is)i(a)f(v)n
+(alid)f(separator)f(in)i(a)g(list,)h(strings)e(with)h(whitespace)f
+(must)h(be)562 2637 y(enclosed)g(in)g(single)g(or)g(double)f(quotes.)g
+(If)h(a)h(string)e(be)o(gins)h(with)g(a)h(double)d(quote,)h(enclose)h
+(it)h(in)f(single)562 2745 y(quotes)g(\(and)f(vice)h(v)o(ersa\).)-2
+3179 y
+SDict begin H.S end
+ -2 3179 a -2 3179 a
+SDict begin 13 H.A end
+ -2 3179 a -2 3179 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1123) cvn H.B /DEST pdfmark
+end
+ -2 3179
+a -2 3179 a
+SDict begin H.S end
+ -2 3179 a -2 3179 a
+SDict begin 13 H.A end
+ -2 3179 a -2 3179 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1124) cvn H.B /DEST pdfmark
+end
+ -2
+3179 a 396 3287 a Fx(Example:)-2 3387 y
+SDict begin H.S end
+ -2 3387 a -2
+3387 a
+SDict begin 11.7 H.A end
+ -2 3387 a -2 3387 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1125) cvn H.B /DEST pdfmark
+end
+ -2 3387 a 486 3467 a Fr([Misc])486
+3564 y(#)486 3662 y(#)45 b(E-mail)e(receipient)h(\(offsite)f(in)i(this)
+f(case\).)g(Up)g(to)h(eight)f(addresses,)486 3759 y(#)h(each)f(one)g
+(at)h(most)f(63)g(characters)f(long.)486 3856 y(#)486
+3953 y(SetMailAddress=username@host.some_domai)o(n.com)486
+4050 y(#)486 4147 y(#)i(Need)f(a)g(relay)g(host)h(for)f(outgoing)f
+(mail.)486 4244 y(#)486 4341 y(SetMailRelay=relay.mydomain.com)486
+4439 y(#)486 4536 y(#)i(Number)e(of)i(pending)f(mails.)486
+4633 y(#)486 4730 y(SetMailNum=10)486 4827 y(#)486 4924
+y(#)h(Maximum)e(time)h(between)g(e-mails.)486 5021 y(#)h(Want)f(a)g
+(message)g(every)g(day,)g(just)g(to)h(be)f(sure)h(that)f(the)486
+5119 y(#)h(program)e(still)h(runs.)486 5216 y(#)486 5313
+y(SetMailTime=86400)p Black 3660 5805 a Fx(26)p Black
+eop end
+%%Page: 27 32
+TeXDict begin 27 31 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.27) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1148) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2239 104 a Fx(Chapter)20
+b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d(facilities)p
+Black 486 309 a Fr(#)486 406 y(#)45 b(Do)f(not)g(send)h(messages)e
+(about)h(added)g(files,)g(and)g(startup)g(messages)486
+503 y(#)486 600 y(SetMailFilterNot)e(=)j('POLICY)e(ADDED',)h(START)486
+697 y(#)486 794 y(#)h(To)f(all)g(recipients)g(in)g(a)h(single)f(mail.)
+486 892 y(MailSingle=yes)-2 904 y
+SDict begin H.S end
+ -2 904 a -2 904 a
+SDict begin 13 H.A end
+ -2
+904 a -2 904 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:EMAILDETAILS) cvn H.B /DEST
+pdfmark end
+ -2 904 a 396 1220 a Fp(4.4.1.)36 b(E-mail)e(repor)r(ts)f
+(and)h(their)f(integrity)2577 1220 y
+SDict begin H.S end
+ 2577 1220 a 2577
+1220 a
+SDict begin 18.72 H.A end
+ 2577 1220 a 2577 1220 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.24.8.2) cvn H.B /DEST pdfmark
+end
+ 2577 1220 a -2 1412 a
+SDict begin H.S end
+
+-2 1412 a -2 1412 a
+SDict begin 13 H.A end
+ -2 1412 a -2 1412 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1128) cvn H.B /DEST pdfmark
+end
+ -2 1412 a 396
+1494 a FC(The)20 b(subject)g(line)g(contains)g(timestamp)g(and)f(local)
+h(hostname,)f(which)h(are)g(repeated)f(in)h(the)g(message)g(body)-5
+b(.)396 1602 y
+SDict begin H.S end
+ 396 1602 a 396 1602 a
+SDict begin 13 H.A end
+ 396 1602 a 396 1602
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1129) cvn H.B /DEST pdfmark
+end
+ 396 1602 a FC(samhain)20 b(uses)g(its)i(o)n(wn)d(b)n(uilt-in)h(SMTP)g
+(code)g(rather)f(than)h(the)g(system)h(mailer)m(,)e(because)g(in)i
+(case)f(of)396 1709 y(temporary)e(connection)g(f)o(ailures,)i(the)g
+(system)h(mailer)e(\(e.g.)2208 1709 y
+SDict begin H.S end
+ 2208 1709 a 2208
+1709 a
+SDict begin 13 H.A end
+ 2208 1709 a 2208 1709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1130) cvn H.B /DEST pdfmark
+end
+ 2208 1709 a FC(sendmail\))g(w)o(ould)g
+(queue)g(the)i(message)f(on)f(disk,)396 1817 y(where)h(it)h(may)e
+(become)g(visible)i(to)f(unauthorized)d(persons.)-2 2001
+y
+SDict begin H.S end
+ -2 2001 a -2 2001 a
+SDict begin 13 H.A end
+ -2 2001 a -2 2001 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1131) cvn H.B /DEST pdfmark
+end
+ -2 2001 a 396
+2091 a FC(During)i(temporary)f(connection)g(f)o(ailures,)i(messages)g
+(are)g(stored)g(in)g(memory)-5 b(.)18 b(The)i(maximum)f(number)f(of)396
+2199 y(stored)i(messages)g(is)h(128.)1196 2199 y
+SDict begin H.S end
+ 1196
+2199 a 1196 2199 a
+SDict begin 13 H.A end
+ 1196 2199 a 1196 2199 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1132) cvn H.B /DEST pdfmark
+end
+ 1196 2199
+a FC(samhain)f(will)h(re-try)e(to)h(mail)h(e)n(v)o(ery)e(hour)f(for)i
+(at)h(most)f(48)g(hours.)f(In)h(conformance)396 2307
+y(with)h(RFC)g(821,)908 2307 y
+SDict begin H.S end
+ 908 2307 a 908 2307 a
+SDict begin 13 H.A end
+
+908 2307 a 908 2307 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1133) cvn H.B /DEST pdfmark
+end
+ 908 2307 a FC(samhain)f(will)h(k)o(eep)e(the)i
+(responsibility)d(for)i(the)g(message)g(deli)n(v)o(ery)f(until)h(the)g
+(recipient')-5 b(s)396 2415 y(mail)21 b(serv)o(er)e(has)h(con\002rmed)f
+(receipt)g(of)h(the)h(e-mail)e(\(e)o(xcept)g(that,)h(as)h(noted)e(abo)o
+(v)o(e,)g(after)h(48)f(hours)h(it)h(will)396 2523 y(assume)f(a)h
+(permanent)d(connection)g(f)o(ailure,)i(i.e.)g(e-mailing)f(will)i(be)f
+(switched)g(of)n(f\).)-2 2707 y
+SDict begin H.S end
+ -2 2707 a -2 2707 a
+SDict begin 13 H.A end
+ -2
+2707 a -2 2707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1134) cvn H.B /DEST pdfmark
+end
+ -2 2707 a 396 2797 a FC(The)g(body)f(of)h(the)g(mail)g
+(may)g(consist)h(of)e(se)n(v)o(eral)h(messages)g(that)h(were)f(pending)
+e(on)i(the)g(internal)f(queue)g(\(see)p 0 TeXcolorgray
+396 2905 a
+SDict begin H.S end
+ 396 2905 a FC(Section)h(4.2)771 2905 y
+SDict begin 13 H.L end
+ 771
+2905 a 771 2905 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFACILITY) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 771 2905 a Black -1 w FC(>\),)g(follo)n(wed)f(by)g(a)
+i(signature)e(that)h(is)i(computed)c(from)h(the)h(message)g(and)g(a)g
+(k)o(e)o(y)-5 b(.)19 b(The)h(k)o(e)o(y)g(is)396 3013
+y(initialized)g(with)g(a)h(random)d(number)m(,)g(and)i(for)f(each)h
+(e-mail)g(iterated)g(by)g(a)2636 3013 y
+SDict begin H.S end
+ 2636 3013 a 2636
+3013 a
+SDict begin 13 H.A end
+ 2636 3013 a 2636 3013 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1136) cvn H.B /DEST pdfmark
+end
+ 2636 3013 a Fx(hash)g(c)o(hain)p
+FC(.)-2 3197 y
+SDict begin H.S end
+ -2 3197 a -2 3197 a
+SDict begin 13 H.A end
+ -2 3197 a -2 3197
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1137) cvn H.B /DEST pdfmark
+end
+ -2 3197 a 396 3287 a FC(The)g(initial)h(k)o(e)o(y)e(is)i(re)n(v)o
+(ealed)e(in)h(the)h(\002rst)f(email)h(sent)f(\(ob)o(viously)-5
+b(,)17 b(you)j(ha)n(v)o(e)f(to)h(belie)n(v)o(e)g(that)g(this)h(\002rst)
+g(e-mail)396 3395 y(is)g(authentic\).)e(This)h(initial)h(k)o(e)o(y)e
+(is)i(not)f(transmitted)g(in)g(clearte)o(xt,)f(b)n(ut)h(encrypted)e
+(with)j(a)f(one-time)f(pad)396 3503 y(\()p 0 TeXcolorgray
+424 3503 a
+SDict begin H.S end
+ 424 3503 a FC(Section)h(11.2)841 3503 y
+SDict begin 13 H.L end
+ 841
+3503 a 841 3503 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 841 3503 a Black -2 w FC(>\).)-2 3684
+y
+SDict begin H.S end
+ -2 3684 a -2 3684 a
+SDict begin 13 H.A end
+ -2 3684 a -2 3684 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1139) cvn H.B /DEST pdfmark
+end
+ -2 3684 a 396
+3777 a FC(The)g(signature)f(is)i(follo)n(wed)e(by)h(a)h(unique)d
+(identi\002cation)h(string.)h(This)g(is)h(used)f(to)h(identify)e
+(seperate)g(audit)396 3885 y(trails)i(\(here,)e(a)853
+3885 y
+SDict begin H.S end
+ 853 3885 a 853 3885 a
+SDict begin 13 H.A end
+ 853 3885 a 853 3885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1140) cvn H.B /DEST pdfmark
+end
+ 853
+3885 a Fx(tr)o(ail)h FC(is)h(a)g(sequence)e(of)h(e-mails)g(from)f(the)i
+(same)f(run)f(of)2546 3885 y
+SDict begin H.S end
+ 2546 3885 a 2546 3885 a
+SDict begin 13 H.A end
+
+2546 3885 a 2546 3885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1141) cvn H.B /DEST pdfmark
+end
+ 2546 3885 a FC(samhain\),)g(and)h(to)g
+(enumerate)396 3993 y(indi)n(vidual)f(e-mails)h(within)g(a)g(trail.)-2
+4159 y
+SDict begin H.S end
+ -2 4159 a -2 4159 a
+SDict begin 13 H.A end
+ -2 4159 a -2 4159 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1142) cvn H.B /DEST pdfmark
+end
+ -2 4159
+a 396 4267 a FC(The)g(mail)g(thus)h(looks)e(lik)o(e:)-2
+4350 y
+SDict begin H.S end
+ -2 4350 a -2 4350 a
+SDict begin 11.7 H.A end
+ -2 4350 a -2 4350 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1143) cvn H.B /DEST pdfmark
+end
+ -2 4350
+a 486 4447 a Fr(-----BEGIN)43 b(MESSAGE-----)486 4544
+y(first)h(message)486 4641 y(second)g(message)486 4738
+y(...)486 4835 y(-----BEGIN)f(SIGNATURE-----)486 4932
+y(signature)486 5029 y(ID)h(TRAIL_ID:hostname)486 5127
+y(-----END)f(MESSAGE-----)-2 5129 y
+SDict begin H.S end
+ -2 5129 a -2 5129
+a
+SDict begin 11.7 H.A end
+ -2 5129 a -2 5129 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1144) cvn H.B /DEST pdfmark
+end
+ -2 5129 a Black 3658 5805 a Fx(27)p
+Black eop end
+%%Page: 28 33
+TeXDict begin 28 32 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.28) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1146) cvn H.B /DEST pdfmark
+end
+ -2 226 a 562 309 a Fw(Integrity)h(veri\002cation:)1322
+309 y
+SDict begin H.S end
+ 1322 309 a 1322 309 a
+SDict begin 11.7 H.A end
+ 1322 309 a 1322 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1147) cvn H.B /DEST pdfmark
+end
+ 1322
+309 a Fq(T)-9 b(o)20 b(v)n(er)q(ify)h(the)e(integ)o(r)q(ity)27
+b Fv(of)20 b(an)f(e-mail)h(audit)e(tr)o(ail,)i(a)g(con)o(v)n(enience)e
+(function)g(is)562 406 y(pro)o(vided:)562 544 y Fw(samhain)h(-M)i
+Fm(/mailbox/file/path)-2 595 y
+SDict begin H.S end
+ -2 595 a -2 595 a
+SDict begin 11.7 H.A end
+ -2 595
+a -2 595 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1151) cvn H.B /DEST pdfmark
+end
+ -2 595 a 562 683 a Fv(The)f(mailbo)n(x)f(\002le)h(ma)n(y)h
+(contain)d(m)o(ultiple)h(and/or)f(o)o(v)n(er)q(lapping)g(audit)g(tr)o
+(ails)i(from)g(diff)n(erent)e(r)q(uns)i(of)562 780 y
+SDict begin H.S end
+
+562 780 a 562 780 a
+SDict begin 11.7 H.A end
+ 562 780 a 562 780 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1152) cvn H.B /DEST pdfmark
+end
+ 562 780 a Fv(samhain)f(and/or)g
+(diff)n(erent)f(clients)h(\(hosts\).)39 919 y
+SDict begin H.S end
+ 39 919
+a 39 919 a
+SDict begin 11.7 H.A end
+ 39 919 a 39 919 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1153) cvn H.B /DEST pdfmark
+end
+ 39 919 a 745 1019 2668 17
+v 745 1975 17 957 v 1803 1214 a Fp(CA)-10 b(VEA)f(TS)786
+1381 y
+SDict begin H.S end
+ 786 1381 a 786 1381 a
+SDict begin 11.7 H.A end
+ 786 1381 a 786 1381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1155) cvn H.B /DEST pdfmark
+end
+ 786
+1381 a 96 x Fv(V)-6 b(er)q(i\002cation)19 b(will)g(f)n(ail,)f(if)i(the)
+f(compiled-in)e(k)o(e)o(y)j(of)g(the)f(v)n(er)q(ifying)g(e)n(x)n
+(ecutab)o(le)e(is)j(diff)n(erent)786 1574 y(from)h(the)e(one)h(that)f
+(gener)o(ated)f(the)h(message\(s\))h(\(see)p 0 TeXcolorgray
+2430 1574 a
+SDict begin H.S end
+ 2430 1574 a Fv(Section)f(11.2)2847 1574 y
+SDict begin 11.7 H.L end
+
+2847 1574 a 2847 1574 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2847 1574 a Black -1 w Fv(>\).)786
+1757 y
+SDict begin H.S end
+ 786 1757 a 786 1757 a
+SDict begin 11.7 H.A end
+ 786 1757 a 786 1757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1157) cvn H.B /DEST pdfmark
+end
+ 786
+1757 a 80 x Fv(If)i(y)o(ou)f(use)g(a)g(pre-compiled)e(e)n(x)n(ecutab)o
+(le)f(from)j(some)g(binar)r(y)g(distr)q(ib)o(ution,)c(be)k(sure)g(to)
+786 1934 y(read)p 0 TeXcolorgray 957 1934 a
+SDict begin H.S end
+ 957 1934
+a Fv(Section)f(11.2)1374 1934 y
+SDict begin 11.7 H.L end
+ 1374 1934 a 1374 1934
+a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1374 1934 a Black -2 w Fv(>)i(carefully)-7 b(.)p 3396
+1975 17 957 v 745 1992 2668 17 v -2 2168 a
+SDict begin H.S end
+ -2 2168 a
+-2 2168 a
+SDict begin 13 H.A end
+ -2 2168 a -2 2168 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:TRUSTEDEXAMPLE) cvn H.B /DEST
+pdfmark end
+ -2 2168 a 320 x Fu(4.5.)39
+b(Log)g(\002le)788 2488 y
+SDict begin H.S end
+ 788 2488 a 788 2488 a
+SDict begin 22.464 H.A end
+ 788 2488
+a 788 2488 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.25.1) cvn H.B /DEST pdfmark
+end
+ 788 2488 a -2 2686 a
+SDict begin H.S end
+ -2 2686 a -2 2686 a
+SDict begin 13 H.A end
+
+-2 2686 a -2 2686 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1161) cvn H.B /DEST pdfmark
+end
+ -2 2686 a -2 2686 a
+SDict begin H.S end
+ -2 2686 a -2
+2686 a
+SDict begin 13 H.A end
+ -2 2686 a -2 2686 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1162) cvn H.B /DEST pdfmark
+end
+ -2 2686 a -2 2810 a
+SDict begin H.S end
+ -2 2810
+a -2 2810 a
+SDict begin 13 H.A end
+ -2 2810 a -2 2810 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1164) cvn H.B /DEST pdfmark
+end
+ -2 2810 a 396 2886 a
+FC(T)m(rusted)20 b(users)-2 2887 y
+SDict begin H.S end
+ -2 2887 a -2 2887
+a
+SDict begin 13 H.A end
+ -2 2887 a -2 2887 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1165) cvn H.B /DEST pdfmark
+end
+ -2 2887 a Black Black 562 3036
+a
+SDict begin H.S end
+ 562 3036 a 562 3036 a
+SDict begin 13 H.A end
+ 562 3036 a 562 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1166) cvn H.B /DEST pdfmark
+end
+ 562 3036
+a 562 3036 a
+SDict begin H.S end
+ 562 3036 a 562 3036 a
+SDict begin 13 H.A end
+ 562 3036 a 562 3036
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1167) cvn H.B /DEST pdfmark
+end
+ 562 3036 a Fy(T)-6 b(rustedUser=)1050 3036 y
+SDict begin H.S end
+ 1050 3036
+a 1050 3036 a
+SDict begin 13 H.A end
+ 1050 3036 a 1050 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1168) cvn H.B /DEST pdfmark
+end
+ 1050 3036 a Fl(username)-2
+3203 y
+SDict begin H.S end
+ -2 3203 a -2 3203 a
+SDict begin 13 H.A end
+ -2 3203 a -2 3203 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1169) cvn H.B /DEST pdfmark
+end
+ -2 3203
+a 562 3310 a FC(If)20 b(some)g(element)g(in)g(the)h(path)e(to)i(the)f
+(log)g(\002le)h(is)g(writeable)e(by)h(someone)f(else)i(than)3090
+3310 y
+SDict begin H.S end
+ 3090 3310 a 3090 3310 a
+SDict begin 13 H.A end
+ 3090 3310 a 3090 3310
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1170) cvn H.B /DEST pdfmark
+end
+ 3090 3310 a Fx(r)l(oot)g FC(or)f(the)3459 3310 y
+SDict begin H.S end
+ 3459
+3310 a 3459 3310 a
+SDict begin 13 H.A end
+ 3459 3310 a 3459 3310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1171) cvn H.B /DEST pdfmark
+end
+ 3459 3310
+a Fx(ef)o(fective)562 3418 y(user)j FC(of)d(the)g(process,)g(you)f(ha)n
+(v)o(e)g(to)i(include)e(that)h(user)g(in)h(the)f(list)h(of)2625
+3418 y
+SDict begin H.S end
+ 2625 3418 a 2625 3418 a
+SDict begin 13 H.A end
+ 2625 3418 a 2625 3418
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1172) cvn H.B /DEST pdfmark
+end
+ 2625 3418 a Fx(trusted)f(user)o(s)i FC(\(unless)e(their)g(UIDs)562
+3526 y(are)g(already)g(compiled)e(in\).)-2 3727 y
+SDict begin H.S end
+ -2
+3727 a -2 3727 a
+SDict begin 13 H.A end
+ -2 3727 a -2 3727 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1174) cvn H.B /DEST pdfmark
+end
+ -2 3727 a 396 3835
+a FC(Separate)i(log)g(\002les)h(for)e(clients)-2 3853
+y
+SDict begin H.S end
+ -2 3853 a -2 3853 a
+SDict begin 13 H.A end
+ -2 3853 a -2 3853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1175) cvn H.B /DEST pdfmark
+end
+ -2 3853 a Black
+Black 562 3984 a
+SDict begin H.S end
+ 562 3984 a 562 3984 a
+SDict begin 13 H.A end
+ 562 3984 a 562
+3984 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1176) cvn H.B /DEST pdfmark
+end
+ 562 3984 a 562 3984 a
+SDict begin H.S end
+ 562 3984 a 562 3984 a
+SDict begin 13 H.A end
+ 562
+3984 a 562 3984 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1177) cvn H.B /DEST pdfmark
+end
+ 562 3984 a Fy(UseSeparateLogs=)1224
+3984 y
+SDict begin H.S end
+ 1224 3984 a 1224 3984 a
+SDict begin 13 H.A end
+ 1224 3984 a 1224 3984
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1178) cvn H.B /DEST pdfmark
+end
+ 1224 3984 a Fl(yes/no)-2 4167 y
+SDict begin H.S end
+ -2 4167 a -2 4167 a
+SDict begin 13 H.A end
+
+-2 4167 a -2 4167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1179) cvn H.B /DEST pdfmark
+end
+ -2 4167 a -2 4167 a
+SDict begin H.S end
+ -2 4167 a -2
+4167 a
+SDict begin 13 H.A end
+ -2 4167 a -2 4167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1180) cvn H.B /DEST pdfmark
+end
+ -2 4167 a 562 4258 a Fx(Only)h(r)m(ele)o
+(vant)g(on)g(the)g(server)-9 b(.)21 b FC(Use)g(a)f(separate)g(log)g
+(\002le)h(for)e(\(reports)g(from\))g(each)h(client.)g(The)g(root)f
+(name)562 4366 y(of)h(these)h(log)e(\002les)j(will)f(be)f(the)g(same)g
+(as)h(the)f(main)g(log)g(\002le,)h(with)f(the)g(client)g(name)g
+(appended.)39 4634 y
+SDict begin H.S end
+ 39 4634 a 39 4634 a
+SDict begin 13 H.A end
+ 39 4634 a 39
+4634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LOGFILE) cvn H.B /DEST pdfmark
+end
+ 39 4634 a 396 4962 a Fp(4.5.1.)36 b(The)d(log)h(\002le)g(and)g
+(its)f(integrity)2282 4962 y
+SDict begin H.S end
+ 2282 4962 a 2282 4962 a
+SDict begin 18.72 H.A end
+
+2282 4962 a 2282 4962 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.25.9.2) cvn H.B /DEST pdfmark
+end
+ 2282 4962 a -2 5155 a
+SDict begin H.S end
+ -2 5155
+a -2 5155 a
+SDict begin 13 H.A end
+ -2 5155 a -2 5155 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1183) cvn H.B /DEST pdfmark
+end
+ -2 5155 a 396 5236 a
+FC(The)20 b(log)g(\002le)h(is)g(named)1118 5236 y
+SDict begin H.S end
+ 1118
+5236 a 1118 5236 a
+SDict begin 13 H.A end
+ 1118 5236 a 1118 5236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1184) cvn H.B /DEST pdfmark
+end
+ 1118 5236
+a Fr(samhain_log)e FC(by)h(def)o(ault,)f(and)h(placed)f(into)2535
+5236 y
+SDict begin H.S end
+ 2535 5236 a 2535 5236 a
+SDict begin 13 H.A end
+ 2535 5236 a 2535 5236
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1185) cvn H.B /DEST pdfmark
+end
+ 2535 5236 a Fr(/var/log)g FC(by)h(def)o(ault)g(\(name)f(and)396
+5344 y(location)h(can)g(be)g(con\002gured)d(at)k(compile)e(time\).)h
+(If)1957 5344 y
+SDict begin H.S end
+ 1957 5344 a 1957 5344 a
+SDict begin 13 H.A end
+ 1957 5344 a 1957
+5344 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1186) cvn H.B /DEST pdfmark
+end
+ 1957 5344 a FC(samhain)g(has)g(been)g(compiled)e(with)j(the)3184
+5344 y
+SDict begin H.S end
+ 3184 5344 a 3184 5344 a
+SDict begin 13 H.A end
+ 3184 5344 a 3184 5344
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1187) cvn H.B /DEST pdfmark
+end
+ 3184 5344 a Fy(./con\002gur)o(e)p Black 3661 5805 a
+Fx(28)p Black eop end
+%%Page: 29 34
+TeXDict begin 29 33 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.29) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 396 309 a Fy(--enable-xml-log)g FC(option,)h(it)i
+(will)g(be)f(written)g(in)g(XML)g(format.)-2 327 y
+SDict begin H.S end
+ -2
+327 a -2 327 a
+SDict begin 11.7 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1188) cvn H.B /DEST pdfmark
+end
+ -2 327 a -2 451 a
+SDict begin H.S end
+ -2
+451 a -2 451 a
+SDict begin 11.7 H.A end
+ -2 451 a -2 451 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1190) cvn H.B /DEST pdfmark
+end
+ -2 451 a 562 530 a Fw(NO)m(TE:)h
+Fv(If)f(y)o(ou)g(ha)o(v)n(e)f(compiled)g(f)n(or)g(stealth)g(\()p
+0 TeXcolorgray 1885 530 a
+SDict begin H.S end
+ 1885 530 a Fv(Chapter)g(9)2214
+530 y
+SDict begin 11.7 H.L end
+ 2214 530 a 2214 530 a
+SDict begin [ /Subtype /Link /Dest (0:STEALTHMODE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2214 530 a Black -1 w Fv(>\),)h(y)o(ou)g(w)
+o(on't)f(see)i(m)o(uch,)f(because)f(if)562 628 y(obfuscated,)f(then)i
+(both)f(a)h('nor)r(mal')e(and)i(an)f(XML)i(log\002le)e(look,)g(w)o(ell)
+h(...)g(obfuscated.)e(Use)3259 628 y
+SDict begin H.S end
+ 3259 628 a 3259
+628 a
+SDict begin 11.7 H.A end
+ 3259 628 a 3259 628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1192) cvn H.B /DEST pdfmark
+end
+ 3259 628 a Fw(samhain)h(-jL)562
+725 y
+SDict begin H.S end
+ 562 725 a 562 725 a
+SDict begin 11.7 H.A end
+ 562 725 a 562 725 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1193) cvn H.B /DEST pdfmark
+end
+ 562 725
+a Fm(/path/to/logfile)27 b Fv(to)20 b(vie)o(w)g(the)f(log\002le)o(.)-2
+1040 y
+SDict begin H.S end
+ -2 1040 a -2 1040 a
+SDict begin 13 H.A end
+ -2 1040 a -2 1040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1194) cvn H.B /DEST pdfmark
+end
+ -2 1040
+a 396 1148 a FC(The)h(log)g(\002le)h(is)g(created)e(if)i(it)g(does)f
+(not)g(e)o(xist,)g(and)f(lock)o(ed)h(by)f(creating)h(a)2603
+1148 y
+SDict begin H.S end
+ 2603 1148 a 2603 1148 a
+SDict begin 13 H.A end
+ 2603 1148 a 2603 1148
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1195) cvn H.B /DEST pdfmark
+end
+ 2603 1148 a Fx(loc)n(k)h(\002le)p FC(,)f(which)f(is)i(also)g(used)f
+(as)h(the)396 1256 y
+SDict begin H.S end
+ 396 1256 a 396 1256 a
+SDict begin 13 H.A end
+ 396 1256 a
+396 1256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1196) cvn H.B /DEST pdfmark
+end
+ 396 1256 a Fx(PID)f(\002le)h FC(\(i.e.)e(it)i(holds)f(the)g
+(PID)h(of)f(the)g(process\).)f(By)i(def)o(ault,)e(the)h(lock/PID)g
+(\002le)g(is)i(named)3179 1256 y
+SDict begin H.S end
+ 3179 1256 a 3179 1256
+a
+SDict begin 13 H.A end
+ 3179 1256 a 3179 1256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1197) cvn H.B /DEST pdfmark
+end
+ 3179 1256 a Fr(samhain.pid)396
+1364 y FC(and)e(placed)f(in)860 1364 y
+SDict begin H.S end
+ 860 1364 a 860
+1364 a
+SDict begin 13 H.A end
+ 860 1364 a 860 1364 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1198) cvn H.B /DEST pdfmark
+end
+ 860 1364 a Fr(/var/run)g
+FC(\(name)g(and)h(location)f(can)h(be)g(con\002gured)e(at)j(compile)e
+(time\).)h(Upon)f(normal)396 1472 y(program)f(termination,)h(the)h
+(lock)g(\002le)g(is)i(remo)o(v)o(ed.)17 b(Stale)k(lock)f(\002les)h(are)
+f(remo)o(v)o(ed)e(at)i(startup)g(if)h(there)e(is)i(no)396
+1580 y(process)f(with)g(that)h(PID.)-2 1764 y
+SDict begin H.S end
+ -2 1764
+a -2 1764 a
+SDict begin 13 H.A end
+ -2 1764 a -2 1764 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1199) cvn H.B /DEST pdfmark
+end
+ -2 1764 a 396 1854 a
+FC(On)f(the)h(log)f(serv)o(er)m(,)e(it)j(is)g(possible)f(to)h(use)f
+(separate)g(log)g(\002les)h(for)e(indi)n(vidual)g(clients.)h(This)g
+(can)g(be)g(enabled)396 1962 y(with)565 1962 y
+SDict begin H.S end
+ 565 1962
+a 565 1962 a
+SDict begin 13 H.A end
+ 565 1962 a 565 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1200) cvn H.B /DEST pdfmark
+end
+ 565 1962 a Fy(UseSeparateLogs=)1227
+1962 y
+SDict begin H.S end
+ 1227 1962 a 1227 1962 a
+SDict begin 13 H.A end
+ 1227 1962 a 1227 1962
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1201) cvn H.B /DEST pdfmark
+end
+ 1227 1962 a Fl(yes/no)g FC(in)g(the)g(Misc)h(section)f(of)g(the)g
+(serv)o(er)f(con\002guration)f(\002le.)j(No)f(locking)f(will)396
+2070 y(be)h(performed)e(for)h(client)i(\002les)g(\(only)e(one)h
+(instance)f(of)h(the)g(serv)o(er)g(can)g(listen)g(on)g(the)g(TCP)h
+(port,)f(thus)g(there)396 2178 y(will)h(be)f(no)g(concurrent)e
+(access\).)-2 2358 y
+SDict begin H.S end
+ -2 2358 a -2 2358 a
+SDict begin 13 H.A end
+ -2 2358 a -2
+2358 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1202) cvn H.B /DEST pdfmark
+end
+ -2 2358 a 396 2451 a FC(The)i(directory)f(where)g(the)h(log)g
+(and)g(the)g(lock/PID)g(\002le)g(are)h(located)e(must)h(be)g(writeable)
+g(only)g(by)f(trusted)h(users)396 2559 y(\(see)p 0 TeXcolorgray
+551 2559 a
+SDict begin H.S end
+ 551 2559 a FC(Section)g(2.10.1)1031 2559 y
+SDict begin 13 H.L end
+
+1031 2559 a 1031 2559 a
+SDict begin [ /Subtype /Link /Dest (0:DEFTRUST) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1031 2559 a Black -3 w FC(>\).)g(This)g
+(requirement)e(refers)i(to)g(the)2152 2559 y
+SDict begin H.S end
+ 2152 2559
+a 2152 2559 a
+SDict begin 13 H.A end
+ 2152 2559 a 2152 2559 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1204) cvn H.B /DEST pdfmark
+end
+ 2152 2559 a Fx(complete)f
+FC(path,)h(i.e.)g(all)g(directories)g(therein.)f(By)396
+2667 y(def)o(ault,)g(only)836 2667 y
+SDict begin H.S end
+ 836 2667 a 836 2667
+a
+SDict begin 13 H.A end
+ 836 2667 a 836 2667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1205) cvn H.B /DEST pdfmark
+end
+ 836 2667 a Fx(r)l(oot)j FC(and)d(the)1256
+2667 y
+SDict begin H.S end
+ 1256 2667 a 1256 2667 a
+SDict begin 13 H.A end
+ 1256 2667 a 1256 2667
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1206) cvn H.B /DEST pdfmark
+end
+ 1256 2667 a Fx(ef)o(fective)h(user)i FC(of)e(the)g(process)g(are)g
+(trusted.)-2 2851 y
+SDict begin H.S end
+ -2 2851 a -2 2851 a
+SDict begin 13 H.A end
+ -2 2851 a -2
+2851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1207) cvn H.B /DEST pdfmark
+end
+ -2 2851 a 396 2941 a FC(Audit)g(trails)h(\(sequences)e(of)h
+(messages)g(from)f(indi)n(vidual)g(runs)g(of)2393 2941
+y
+SDict begin H.S end
+ 2393 2941 a 2393 2941 a
+SDict begin 13 H.A end
+ 2393 2941 a 2393 2941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1208) cvn H.B /DEST pdfmark
+end
+ 2393
+2941 a FC(samhain\))g(in)i(the)f(log)g(\002le)h(start)f(with)h(a)396
+3049 y
+SDict begin H.S end
+ 396 3049 a 396 3049 a
+SDict begin 13 H.A end
+ 396 3049 a 396 3049 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1209) cvn H.B /DEST pdfmark
+end
+ 396
+3049 a Fx([SOF])g FC(mark)o(er)-5 b(.)19 b(Each)h(message)g(is)h(follo)
+n(wed)e(by)g(a)i(signature,)e(that)h(is)h(formed)e(by)h(hashing)f(the)h
+(message)g(with)396 3157 y(a)h(k)o(e)o(y)-5 b(.)-2 3341
+y
+SDict begin H.S end
+ -2 3341 a -2 3341 a
+SDict begin 13 H.A end
+ -2 3341 a -2 3341 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1210) cvn H.B /DEST pdfmark
+end
+ -2 3341 a 396
+3431 a FC(The)20 b(\002rst)h(k)o(e)o(y)f(is)h(generated)d(at)j(random,)
+d(and)i(sent)g(by)g(e-mail,)g(encrypted)e(with)i(a)h(one-time)e(pad)g
+(as)i(described)396 3539 y(in)g(the)f(pre)n(vious)e(section)i(on)g
+(e-mail.)g(Further)f(k)o(e)o(ys)h(are)g(generated)e(by)i(a)h(hash)f
+(chain)f(\(i.e.)h(the)g(k)o(e)o(y)g(is)h(hashed)396 3647
+y(to)g(generate)e(the)h(ne)o(xt)f(k)o(e)o(y\).)g(Thus,)h(only)f(by)h
+(kno)n(wing)e(the)i(initial)h(k)o(e)o(y)e(the)i(inte)o(grity)e(of)g
+(the)i(log)f(\002le)g(can)g(be)396 3755 y(assured.)-2
+3922 y
+SDict begin H.S end
+ -2 3922 a -2 3922 a
+SDict begin 13 H.A end
+ -2 3922 a -2 3922 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1211) cvn H.B /DEST pdfmark
+end
+ -2 3922
+a 396 4029 a FC(The)g(mail)g(with)h(the)f(k)o(e)o(y)g(looks)f(lik)o(e:)
+-2 4130 y
+SDict begin H.S end
+ -2 4130 a -2 4130 a
+SDict begin 11.7 H.A end
+ -2 4130 a -2 4130 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1212) cvn H.B /DEST pdfmark
+end
+ -2
+4130 a 486 4209 a Fr(-----BEGIN)43 b(MESSAGE-----)486
+4306 y(message)486 4403 y(-----BEGIN)g(LOGKEY-----)486
+4500 y(Key\(48)h(chars\)[timestamp])486 4598 y(-----BEGIN)f
+(SIGNATURE-----)486 4695 y(signature)486 4792 y(ID)h(TRAIL_ID:hostname)
+486 4889 y(-----END)f(MESSAGE-----)-2 4891 y
+SDict begin H.S end
+ -2 4891
+a -2 4891 a
+SDict begin 11.7 H.A end
+ -2 4891 a -2 4891 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1213) cvn H.B /DEST pdfmark
+end
+ -2 4891 a -2 5057 a
+SDict begin H.S end
+ -2
+5057 a -2 5057 a
+SDict begin 11.7 H.A end
+ -2 5057 a -2 5057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1215) cvn H.B /DEST pdfmark
+end
+ -2 5057 a 562 5152
+a Fw(Integrity)19 b(veri\002cation:)1322 5152 y
+SDict begin H.S end
+ 1322
+5152 a 1322 5152 a
+SDict begin 11.7 H.A end
+ 1322 5152 a 1322 5152 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1216) cvn H.B /DEST pdfmark
+end
+ 1322 5152
+a Fq(T)-9 b(o)20 b(v)n(er)q(ify)h(the)e(log)h(\002le')l(s)g(integ)o(r)q
+(ity)8 b Fv(,)18 b(a)j(con)o(v)n(enience)c(function)i(is)i(pro)o
+(vided:)-2 5210 y
+SDict begin H.S end
+ -2 5210 a -2 5210 a
+SDict begin 11.7 H.A end
+ -2 5210 a -2 5210
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1217) cvn H.B /DEST pdfmark
+end
+ -2 5210 a -2 5210 a
+SDict begin H.S end
+ -2 5210 a -2 5210 a
+SDict begin 11.7 H.A end
+ -2 5210 a -2
+5210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1218) cvn H.B /DEST pdfmark
+end
+ -2 5210 a 562 5291 a Fw(samhain)e(-L)978 5291
+y
+SDict begin H.S end
+ 978 5291 a 978 5291 a
+SDict begin 11.7 H.A end
+ 978 5291 a 978 5291 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1219) cvn H.B /DEST pdfmark
+end
+ 978 5291
+a Fm(/log/file/path)p Black 3661 5805 a Fx(29)p Black
+eop end
+%%Page: 30 35
+TeXDict begin 30 34 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.30) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1220) cvn H.B /DEST pdfmark
+end
+ -2 226 a 562 309 a Fv(When)g(encounter)q(ing)e(the)j(star)s
+(t)h(of)f(an)g(audit)f(tr)o(ail,)g(y)o(ou)h(will)g(then)f(be)h(ask)o
+(ed)g(f)n(or)g(the)g(k)o(e)o(y)g(\(as)h(sent)f(to)g(y)o(ou)g(b)o(y)562
+406 y(e-mail\).)g(Y)-10 b(ou)19 b(can)i(then:)e(\(i\))h(hit)1490
+406 y
+SDict begin H.S end
+ 1490 406 a 1490 406 a
+SDict begin 11.7 H.A end
+ 1490 406 a 1490 406 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1221) cvn H.B /DEST pdfmark
+end
+ 1490
+406 a Fw(return)g Fv(to)g(skip)h(signature)d(v)n(er)q(i\002cation,)h
+(\(ii\))g(enter)g(the)h(k)o(e)o(y)g(\(without)e(the)562
+503 y(appended)f(timestamp\),)i(or)i(\(iii\))e(enter)g(the)h(path)f(to)
+h(a)g(\002le)g(that)g(contains)f(the)h(k)o(e)o(y)g(\(e)o(.g.)f(the)g
+(mail)h(bo)n(x\).)-2 561 y
+SDict begin H.S end
+ -2 561 a -2 561 a
+SDict begin 11.7 H.A end
+ -2 561 a
+-2 561 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1222) cvn H.B /DEST pdfmark
+end
+ -2 561 a 562 642 a Fv(If)h(y)o(ou)e(use)i(option)d(\(iii\),)h
+(the)h(path)f(m)o(ust)i(be)f(an)f(absolute)g(path)g(\(star)s(ting)f
+(with)i(a)g('/',)g(not)f(longer)g(than)g(48)562 739 y(chars)o(.)h(F)n
+(or)g(each)g(audit)f(tr)o(ail,)g(the)g(\002le)i(m)o(ust)g(contain)d(a)j
+(tw)o(o-line)d(b)o(loc)o(k)h(with)h(the)2937 739 y
+SDict begin H.S end
+ 2937
+739 a 2937 739 a
+SDict begin 11.7 H.A end
+ 2937 739 a 2937 739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1223) cvn H.B /DEST pdfmark
+end
+ 2937 739 a Fq(-----BEGIN)g
+(LOGKEY)-10 b(-----)562 836 y Fv(line)19 b(f)n(ollo)o(w)o(ed)f(b)o(y)i
+(the)g(line)f(\()1375 836 y
+SDict begin H.S end
+ 1375 836 a 1375 836 a
+SDict begin 11.7 H.A end
+ 1375
+836 a 1375 836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1224) cvn H.B /DEST pdfmark
+end
+ 1375 836 a Fq(K)m(e)o(y\(48)g(chars\)[timestamp])7
+b Fv(\))18 b(from)i(the)g(mail.)f(Additional)e(lines)i(bef)n(ore/after)
+562 933 y(an)o(y)h(such)h(tw)o(o-line)d(b)o(loc)o(k)i(are)f(ignored)f
+(\(in)i(par)s(ticular)l(,)e(if)i(y)o(ou)g(collect)f(all)h(e-mails)g
+(from)3159 933 y
+SDict begin H.S end
+ 3159 933 a 3159 933 a
+SDict begin 11.7 H.A end
+ 3159 933 a 3159
+933 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1225) cvn H.B /DEST pdfmark
+end
+ 3159 933 a Fv(samhain)f(in)h(a)562 1030 y(mailbo)n(x)f(\002le)o
+(,)h(y)o(ou)g(can)g(simply)h(specify)f(the)f(path)h(to)g(that)f(mailbo)
+n(x)g(\002le\).)39 1169 y
+SDict begin H.S end
+ 39 1169 a 39 1169 a
+SDict begin 11.7 H.A end
+ 39 1169
+a 39 1169 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1226) cvn H.B /DEST pdfmark
+end
+ 39 1169 a 745 1268 2668 17 v 745 2225 17
+957 v 1803 1464 a Fp(CA)-10 b(VEA)f(TS)786 1631 y
+SDict begin H.S end
+ 786
+1631 a 786 1631 a
+SDict begin 11.7 H.A end
+ 786 1631 a 786 1631 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1228) cvn H.B /DEST pdfmark
+end
+ 786 1631 a 96
+x Fv(V)-6 b(er)q(i\002cation)19 b(will)g(f)n(ail,)f(if)i(the)f
+(compiled-in)e(k)o(e)o(y)j(of)g(the)f(v)n(er)q(ifying)g(e)n(x)n(ecutab)
+o(le)e(is)j(diff)n(erent)786 1824 y(from)h(the)e(one)h(that)f(gener)o
+(ated)f(the)h(message\(s\))h(\(see)p 0 TeXcolorgray 2430
+1824 a
+SDict begin H.S end
+ 2430 1824 a Fv(Section)f(11.2)2847 1824 y
+SDict begin 11.7 H.L end
+ 2847
+1824 a 2847 1824 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2847 1824 a Black -1 w Fv(>\).)786
+2007 y
+SDict begin H.S end
+ 786 2007 a 786 2007 a
+SDict begin 11.7 H.A end
+ 786 2007 a 786 2007 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1230) cvn H.B /DEST pdfmark
+end
+ 786
+2007 a 80 x Fv(If)i(y)o(ou)f(use)g(a)g(pre-compiled)e(e)n(x)n(ecutab)o
+(le)f(from)j(some)g(binar)r(y)g(distr)q(ib)o(ution,)c(be)k(sure)g(to)
+786 2184 y(read)p 0 TeXcolorgray 957 2184 a
+SDict begin H.S end
+ 957 2184
+a Fv(Section)f(11.2)1374 2184 y
+SDict begin 11.7 H.L end
+ 1374 2184 a 1374 2184
+a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1374 2184 a Black -2 w Fv(>)i(carefully)-7 b(.)p 3396
+2225 17 957 v 745 2241 2668 17 v -2 2418 a
+SDict begin H.S end
+ -2 2418 a
+-2 2418 a
+SDict begin 13 H.A end
+ -2 2418 a -2 2418 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGURATION-LOGSERVER) cvn
+H.B /DEST pdfmark end
+ -2 2418 a 320 x Fu(4.6.)39
+b(Log)g(ser)q(ver)1013 2738 y
+SDict begin H.S end
+ 1013 2738 a 1013 2738 a
+SDict begin 22.464 H.A end
+
+1013 2738 a 1013 2738 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.26.1) cvn H.B /DEST pdfmark
+end
+ 1013 2738 a -2 2936 a
+SDict begin H.S end
+ -2 2936
+a -2 2936 a
+SDict begin 13 H.A end
+ -2 2936 a -2 2936 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1234) cvn H.B /DEST pdfmark
+end
+ -2 2936 a -2 2936 a
+SDict begin H.S end
+ -2
+2936 a -2 2936 a
+SDict begin 13 H.A end
+ -2 2936 a -2 2936 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1235) cvn H.B /DEST pdfmark
+end
+ -2 2936 a -2 3060
+a
+SDict begin H.S end
+ -2 3060 a -2 3060 a
+SDict begin 13 H.A end
+ -2 3060 a -2 3060 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1237) cvn H.B /DEST pdfmark
+end
+ -2 3060 a 396
+3136 a FC(Serv)o(er)19 b(address)-2 3137 y
+SDict begin H.S end
+ -2 3137 a
+-2 3137 a
+SDict begin 13 H.A end
+ -2 3137 a -2 3137 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1238) cvn H.B /DEST pdfmark
+end
+ -2 3137 a Black Black 562
+3286 a
+SDict begin H.S end
+ 562 3286 a 562 3286 a
+SDict begin 13 H.A end
+ 562 3286 a 562 3286 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1239) cvn H.B /DEST pdfmark
+end
+ 562
+3286 a 562 3286 a
+SDict begin H.S end
+ 562 3286 a 562 3286 a
+SDict begin 13 H.A end
+ 562 3286 a 562
+3286 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1240) cvn H.B /DEST pdfmark
+end
+ 562 3286 a Fy(SetLogSer)o(v)o(er=)1093 3286 y
+SDict begin H.S end
+
+1093 3286 a 1093 3286 a
+SDict begin 13 H.A end
+ 1093 3286 a 1093 3286 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1241) cvn H.B /DEST pdfmark
+end
+ 1093
+3286 a Fl(my.server.address)-2 3469 y
+SDict begin H.S end
+ -2 3469 a -2 3469
+a
+SDict begin 13 H.A end
+ -2 3469 a -2 3469 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1242) cvn H.B /DEST pdfmark
+end
+ -2 3469 a 562 3560 a FC(Y)-9 b(ou)20
+b(ha)n(v)o(e)f(to)i(specify)e(the)i(serv)o(er)e(address,)g(unless)i(it)
+g(is)g(already)e(compiled)g(in.)h(It)g(is)h(possible)f(to)h(specify)562
+3668 y(a)g(second)e(serv)o(er)h(that)g(will)h(be)f(used)g(as)h(backup.)
+-2 3686 y
+SDict begin H.S end
+ -2 3686 a -2 3686 a
+SDict begin 11.7 H.A end
+ -2 3686 a -2 3686 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1243) cvn H.B /DEST pdfmark
+end
+ -2
+3686 a -2 3810 a
+SDict begin H.S end
+ -2 3810 a -2 3810 a
+SDict begin 11.7 H.A end
+ -2 3810 a -2 3810
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1245) cvn H.B /DEST pdfmark
+end
+ -2 3810 a 728 3889 a Fw(NO)m(TE:)g Fv(If)f(y)o(ou)g(w)o(ant)f(to)h
+(store)g(the)g(con\002gur)o(ation)d(\002le)k(on)f(the)f(ser)r(v)n(er)l
+(,)i(the)f(ser)r(v)n(er)g(address)g(m)o(ust)h(be)728
+3986 y(compiled)e(in.)39 4476 y
+SDict begin H.S end
+ 39 4476 a 39 4476 a
+SDict begin 13 H.A end
+ 39
+4476 a 39 4476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LOGSERVERDETAILS) cvn H.B /DEST
+pdfmark end
+ 39 4476 a 396 4804 a Fp(4.6.1.)36 b(Details)1119
+4804 y
+SDict begin H.S end
+ 1119 4804 a 1119 4804 a
+SDict begin 18.72 H.A end
+ 1119 4804 a 1119 4804
+a
+SDict begin [ /View [/XYZ H.V] /Dest (6.26.10.2) cvn H.B /DEST pdfmark
+end
+ 1119 4804 a -2 4972 a
+SDict begin H.S end
+ -2 4972 a -2 4972 a
+SDict begin 13 H.A end
+ -2 4972 a
+-2 4972 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1248) cvn H.B /DEST pdfmark
+end
+ -2 4972 a 396 5078 a FC(During)19 b(temporary)f(connection)g
+(f)o(ailures,)i(messages)g(are)g(stored)g(in)g(a)h(FIFO)g(queue)e(in)h
+(memory)-5 b(.)18 b(The)396 5186 y(maximum)h(number)f(of)i(stored)g
+(messages)g(is)h(128.)e(After)h(a)h(connection)d(f)o(ailure,)2814
+5186 y
+SDict begin H.S end
+ 2814 5186 a 2814 5186 a
+SDict begin 13 H.A end
+ 2814 5186 a 2814 5186
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1249) cvn H.B /DEST pdfmark
+end
+ 2814 5186 a FC(samhain)i(will)h(mak)o(e)e(the)i(ne)o(xt)396
+5294 y(attempt)f(only)f(after)h(a)h(deadtime)e(that)h(starts)h(with)g
+(1)f(sec)h(and)e(doubles)g(after)h(each)g(unsuccessful)f(attempt)h
+(\(max)396 5402 y(is)h(2048)e(sec\).)h(A)h(re-connection)c(attempt)j
+(is)h(actually)f(only)f(made)h(for)f(the)i(ne)o(xt)e(message)h(after)g
+(the)g(deadtime)p Black 3661 5805 a Fx(30)p Black eop
+end
+%%Page: 31 36
+TeXDict begin 31 35 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.31) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 396 309 a FC(--)i(you)g(should)f(send)h(timestamps)
+g(\(i.e.)g(set)h(the)f(threshold)f(to)2232 309 y
+SDict begin H.S end
+ 2232
+309 a 2232 309 a
+SDict begin 13 H.A end
+ 2232 309 a 2232 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1250) cvn H.B /DEST pdfmark
+end
+ 2232 309 a Fx(mark)q
+FC(\))h(to)h(ensure)e(re-connection)e(attempts)j(for)396
+417 y(f)o(ailed)g(connections.)-2 584 y
+SDict begin H.S end
+ -2 584 a -2 584
+a
+SDict begin 13 H.A end
+ -2 584 a -2 584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1251) cvn H.B /DEST pdfmark
+end
+ -2 584 a 396 691 a FC(It)h(is)g(possible)f(to)g
+(specify)g(tw)o(o)g(log)g(serv)o(ers)g(in)g(the)g(client)g
+(con\002guration)e(\002le.)i(The)g(\002rst)h(one)f(will)h(be)f(used)g
+(by)396 799 y(def)o(ault)g(\(primary\),)d(and)j(the)g(second)g(one)f
+(as)i(f)o(allback)e(in)i(case)f(of)g(a)h(connection)d(f)o(ailure)i
+(with)g(the)g(primary)f(log)396 906 y(serv)o(er)-5 b(.)-2
+1001 y
+SDict begin H.S end
+ -2 1001 a -2 1001 a
+SDict begin 13 H.A end
+ -2 1001 a -2 1001 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGURATION-EXTERNAL) cvn
+H.B /DEST pdfmark end
+ -2 1001
+a 376 x Fu(4.7.)39 b(External)f(facilities)1459 1377
+y
+SDict begin H.S end
+ 1459 1377 a 1459 1377 a
+SDict begin 22.464 H.A end
+ 1459 1377 a 1459 1377 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.27.1) cvn H.B /DEST pdfmark
+end
+ 1459
+1377 a -2 1545 a
+SDict begin H.S end
+ -2 1545 a -2 1545 a
+SDict begin 13 H.A end
+ -2 1545 a -2 1545
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1254) cvn H.B /DEST pdfmark
+end
+ -2 1545 a -2 1545 a
+SDict begin H.S end
+ -2 1545 a -2 1545 a
+SDict begin 13 H.A end
+ -2 1545 a -2
+1545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1255) cvn H.B /DEST pdfmark
+end
+ -2 1545 a 396 1651 a FC(samhain)20 b(can)g(in)m(v)n(ok)o(e)f(e)o
+(xternal)g(scripts/programs)f(for)h(logging)g(\(i.e.)h(to)g(implement)f
+(support)g(for)g(pagers)h(etc.\).)396 1759 y(This)h(is)g(e)o(xplained)d
+(in)i(detail)h(in)p 0 TeXcolorgray 1359 1759 a
+SDict begin H.S end
+ 1359 1759
+a FC(Chapter)f(7)1685 1759 y
+SDict begin 13 H.L end
+ 1685 1759 a 1685 1759 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+1685 1759 a Black -1 w FC(>.)-2 1787 y
+SDict begin H.S end
+ -2 1787 a -2 1787
+a
+SDict begin 13 H.A end
+ -2 1787 a -2 1787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONSOLEDETAILS) cvn H.B /DEST
+pdfmark end
+ -2 1787 a 359 x Fu(4.8.)39 b(Console)845
+2146 y
+SDict begin H.S end
+ 845 2146 a 845 2146 a
+SDict begin 22.464 H.A end
+ 845 2146 a 845 2146 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.28.1) cvn H.B /DEST pdfmark
+end
+ 845
+2146 a -2 2314 a
+SDict begin H.S end
+ -2 2314 a -2 2314 a
+SDict begin 13 H.A end
+ -2 2314 a -2 2314
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1259) cvn H.B /DEST pdfmark
+end
+ -2 2314 a 396 2420 a FC(Up)20 b(to)h(tw)o(o)f(console)g(de)n(vices)f
+(are)h(supported,)e(both)i(of)g(which)f(may)h(also)h(be)f(named)f
+(pipes.)h(If)g(running)e(as)396 2528 y(daemon,)701 2528
+y
+SDict begin H.S end
+ 701 2528 a 701 2528 a
+SDict begin 13 H.A end
+ 701 2528 a 701 2528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1260) cvn H.B /DEST pdfmark
+end
+ 701 2528
+a FC(samhain)h(will)i(use)1279 2528 y
+SDict begin H.S end
+ 1279 2528 a 1279
+2528 a
+SDict begin 13 H.A end
+ 1279 2528 a 1279 2528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1261) cvn H.B /DEST pdfmark
+end
+ 1279 2528 a Fr(/dev/console)e
+FC(for)h(output,)e(otherwise)i(stdout.)f(On)i(Linux,)396
+2636 y
+SDict begin H.S end
+ 396 2636 a 396 2636 a
+SDict begin 13 H.A end
+ 396 2636 a 396 2636 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1262) cvn H.B /DEST pdfmark
+end
+ 396
+2636 a Fx(_P)-7 b(A)m(TH_CONSOLE)21 b FC(will)g(be)f(used)g(instead)g
+(of)1836 2636 y
+SDict begin H.S end
+ 1836 2636 a 1836 2636 a
+SDict begin 13 H.A end
+ 1836 2636 a 1836
+2636 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1263) cvn H.B /DEST pdfmark
+end
+ 1836 2636 a Fr(/dev/console)p FC(,)e(if)j(it)g(is)g(de\002ned)e
+(in)h(the)h(\002le)396 2744 y
+SDict begin H.S end
+ 396 2744 a 396 2744 a
+SDict begin 13 H.A end
+ 396
+2744 a 396 2744 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1264) cvn H.B /DEST pdfmark
+end
+ 396 2744 a Fr(/usr/include/paths.h)p
+FC(.)-2 2922 y
+SDict begin H.S end
+ -2 2922 a -2 2922 a
+SDict begin 13 H.A end
+ -2 2922 a -2 2922
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1265) cvn H.B /DEST pdfmark
+end
+ -2 2922 a 396 3018 a FC(Y)-9 b(ou)20 b(can)g(o)o(v)o(erride)e(this)i
+(at)h(compile)e(time,)i(or)e(in)i(the)1978 3018 y
+SDict begin H.S end
+ 1978
+3018 a 1978 3018 a
+SDict begin 13 H.A end
+ 1978 3018 a 1978 3018 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1266) cvn H.B /DEST pdfmark
+end
+ 1978 3018
+a Fy([Misc])g FC(section)f(of)g(the)g(con\002guration)d(\002le)k(with)f
+(the)396 3126 y
+SDict begin H.S end
+ 396 3126 a 396 3126 a
+SDict begin 13 H.A end
+ 396 3126 a 396
+3126 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1267) cvn H.B /DEST pdfmark
+end
+ 396 3126 a Fy(SetConsole=)836 3126 y
+SDict begin H.S end
+ 836 3126
+a 836 3126 a
+SDict begin 13 H.A end
+ 836 3126 a 836 3126 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1268) cvn H.B /DEST pdfmark
+end
+ 836 3126 a Fl(device)g
+FC(option.)e(Up)j(to)f(tw)o(o)g(console)g(de)n(vices)f(are)i
+(supported,)c(both)j(of)g(which)f(may)h(also)h(be)396
+3234 y(named)e(pipes)h(\(use)g(the)1116 3234 y
+SDict begin H.S end
+ 1116 3234
+a 1116 3234 a
+SDict begin 13 H.A end
+ 1116 3234 a 1116 3234 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1269) cvn H.B /DEST pdfmark
+end
+ 1116 3234 a Fy(SetConsole)f
+FC(option)g(twice)i(to)f(set)h(both)f(de)n(vices\).)-2
+3252 y
+SDict begin H.S end
+ -2 3252 a -2 3252 a
+SDict begin 11.7 H.A end
+ -2 3252 a -2 3252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1270) cvn H.B /DEST pdfmark
+end
+ -2 3252
+a -2 3376 a
+SDict begin H.S end
+ -2 3376 a -2 3376 a
+SDict begin 11.7 H.A end
+ -2 3376 a -2 3376 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1272) cvn H.B /DEST pdfmark
+end
+ -2
+3376 a 562 3456 a Fw(Switc)o(hing)f(off:)h Fv(In)o(v)n(ar)q(iab)o(ly)-7
+b(,)17 b(some)j(users)h(set)1953 3456 y
+SDict begin H.S end
+ 1953 3456 a 1953
+3456 a
+SDict begin 11.7 H.A end
+ 1953 3456 a 1953 3456 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1273) cvn H.B /DEST pdfmark
+end
+ 1953 3456 a Fw(SetConsole=)2411
+3456 y
+SDict begin H.S end
+ 2411 3456 a 2411 3456 a
+SDict begin 11.7 H.A end
+ 2411 3456 a 2411 3456
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1274) cvn H.B /DEST pdfmark
+end
+ 2411 3456 a Fm(/dev/null)g Fv(to)f(s)n(witch)g(off)f(console)h
+(logging.)562 3553 y(This)g(is)h(highly)e(ineff)n(ectiv)n(e)o(,)f(as)i
+(the)g(de)n(vice)f(will)h(be)g(opened,)d(and)j(the)g(message)f(wr)q
+(itten)g(to)h(it,)g(f)n(or)g(e)n(v)n(er)r(y)562 3650
+y(log)g(message)o(.)f(The)h(correct)g(w)o(a)n(y)g(is)h(to)f(use)1874
+3650 y
+SDict begin H.S end
+ 1874 3650 a 1874 3650 a
+SDict begin 11.7 H.A end
+ 1874 3650 a 1874 3650
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1275) cvn H.B /DEST pdfmark
+end
+ 1874 3650 a Fw(PrintSe)o(verity=)2381 3650 y
+SDict begin H.S end
+ 2381 3650
+a 2381 3650 a
+SDict begin 11.7 H.A end
+ 2381 3650 a 2381 3650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1276) cvn H.B /DEST pdfmark
+end
+ 2381 3650 a Fm(none)f
+Fv(in)h(the)2764 3650 y
+SDict begin H.S end
+ 2764 3650 a 2764 3650 a
+SDict begin 11.7 H.A end
+ 2764
+3650 a 2764 3650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1277) cvn H.B /DEST pdfmark
+end
+ 2764 3650 a Fq([Log])25 b Fv(section)20
+b(of)g(the)562 3747 y(con\002gur)o(ation)e(\002le)i(\(or)g(the)g
+(command)g(line)f(s)n(witch)h('-p)g(none'\).)-2 3980
+y
+SDict begin H.S end
+ -2 3980 a -2 3980 a
+SDict begin 13 H.A end
+ -2 3980 a -2 3980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PRELUDEDETAILS) cvn H.B /DEST
+pdfmark end
+ -2 3980 a 377
+x Fu(4.9.)39 b(Prelude)805 4357 y
+SDict begin H.S end
+ 805 4357 a 805 4357
+a
+SDict begin 22.464 H.A end
+ 805 4357 a 805 4357 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.29.1) cvn H.B /DEST pdfmark
+end
+ 805 4357 a -2 4359 a
+SDict begin H.S end
+ -2 4359
+a -2 4359 a
+SDict begin 11.7 H.A end
+ -2 4359 a -2 4359 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1280) cvn H.B /DEST pdfmark
+end
+ -2 4359 a -2 4483 a
+SDict begin H.S end
+ -2
+4483 a -2 4483 a
+SDict begin 11.7 H.A end
+ -2 4483 a -2 4483 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1282) cvn H.B /DEST pdfmark
+end
+ -2 4483 a 562 4578
+a Fw(REQ)o(UIREMENTS:)20 b Fv(This)g(f)n(acility)f(requires)g(that)g(y)
+o(ou)h(ha)o(v)n(e)f(compiled)g(with)h(the)2950 4578 y
+SDict begin H.S end
+
+2950 4578 a 2950 4578 a
+SDict begin 11.7 H.A end
+ 2950 4578 a 2950 4578 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1283) cvn H.B /DEST pdfmark
+end
+ 2950
+4578 a Fq(--with-prelude)e Fv(option)h(to)562 4675 y(include)g(suppor)s
+(t)g(f)n(or)g(prelude)o(.)f(Of)j(course)f(y)o(ou)f(need)g(the)h
+(libprelude)d(client)i(libr)o(ar)r(y)h(f)n(or)f(this)h(to)g(w)o(or)q
+(k.)-2 4991 y
+SDict begin H.S end
+ -2 4991 a -2 4991 a
+SDict begin 13 H.A end
+ -2 4991 a -2 4991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1284) cvn H.B /DEST pdfmark
+end
+
+-2 4991 a 396 5099 a FC(F)o(or)g(Prelude)f(0.8,)h(timestamp)f(messages)
+i(will)g(automatically)d(be)j(con)m(v)o(erted)c(to)2802
+5099 y
+SDict begin H.S end
+ 2802 5099 a 2802 5099 a
+SDict begin 13 H.A end
+ 2802 5099 a 2802 5099
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1285) cvn H.B /DEST pdfmark
+end
+ 2802 5099 a FC(Prelude)j(heartbeat)f(messages.)p Black
+3661 5805 a Fx(31)p Black eop end
+%%Page: 32 37
+TeXDict begin 32 36 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.32) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1286) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(F)o(or)i(Prelude)f(0.9,)h(timestamp)f
+(messages)i(are)f(dropped,)d(and)j(the)g(b)n(uilt-in)g(heartbeat)f
+(mechanism)g(of)h(the)396 417 y(libprelude)f(library)g(is)i(used.)-2
+435 y
+SDict begin H.S end
+ -2 435 a -2 435 a
+SDict begin 11.7 H.A end
+ -2 435 a -2 435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1287) cvn H.B /DEST pdfmark
+end
+ -2 435 a -2
+559 a
+SDict begin H.S end
+ -2 559 a -2 559 a
+SDict begin 11.7 H.A end
+ -2 559 a -2 559 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1289) cvn H.B /DEST pdfmark
+end
+ -2 559 a 562
+638 a Fw(Note:)f Fv(The)f(f)n(ollo)o(wing)f(con\002gur)o(ation)f
+(options)i(can)h(only)g(be)g(used)g(with)f(libprelude)e(0.9.)i(The)h
+(should)f(be)562 735 y(placed)g(the)h([Misc])h(section)e(of)h(the)g
+(con\002gur)o(ation)e(\002le)o(,)i(if)g(y)o(ou)f(use)i(them.)e(The)h
+('PreludeMapT)-9 b(o)m(...)i(')15 b(options)562 833 y(do)20
+b(not)g(aff)n(ect)f(in)h(an)o(y)g(w)o(a)n(y)g(whether)f(a)h(message)g
+(is)h(repor)s(ted)d(b)o(y)i(samhain)f(to)h(the)g(prelude)e(manager)g
+(\(f)n(or)562 930 y(this)i(there)e(is)i('PreludeSe)n(v)n(er)q(ity')c
+(in)j(the)g([Log])g(section\);)f(the)o(y)h(only)g(aff)n(ect)g(the)g
+('Impact)g(se)n(v)n(er)q(ity')g(sho)o(wn)g(on)562 1027
+y(the)h(prelude)e(side)o(.)-2 1342 y
+SDict begin H.S end
+ -2 1342 a -2 1342
+a
+SDict begin 13 H.A end
+ -2 1342 a -2 1342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1290) cvn H.B /DEST pdfmark
+end
+ -2 1342 a -2 1342 a
+SDict begin H.S end
+ -2 1342 a -2
+1342 a
+SDict begin 13 H.A end
+ -2 1342 a -2 1342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1291) cvn H.B /DEST pdfmark
+end
+ -2 1342 a -2 1508 a
+SDict begin H.S end
+ -2 1508
+a -2 1508 a
+SDict begin 13 H.A end
+ -2 1508 a -2 1508 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1293) cvn H.B /DEST pdfmark
+end
+ -2 1508 a 396 1616 a
+FC(PreludePro\002le)-2 1617 y
+SDict begin H.S end
+ -2 1617 a -2 1617 a
+SDict begin 13 H.A end
+ -2
+1617 a -2 1617 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1294) cvn H.B /DEST pdfmark
+end
+ -2 1617 a Black Black 562 1766 a
+SDict begin H.S end
+ 562
+1766 a 562 1766 a
+SDict begin 13 H.A end
+ 562 1766 a 562 1766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1295) cvn H.B /DEST pdfmark
+end
+ 562 1766 a 562
+1766 a
+SDict begin H.S end
+ 562 1766 a 562 1766 a
+SDict begin 13 H.A end
+ 562 1766 a 562 1766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1296) cvn H.B /DEST pdfmark
+end
+ 562
+1766 a Fy(Pr)o(eludePr)o(o\002le=)1120 1766 y
+SDict begin H.S end
+ 1120 1766
+a 1120 1766 a
+SDict begin 13 H.A end
+ 1120 1766 a 1120 1766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1297) cvn H.B /DEST pdfmark
+end
+ 1120 1766 a Fl(profile_name)-2
+1942 y
+SDict begin H.S end
+ -2 1942 a -2 1942 a
+SDict begin 13 H.A end
+ -2 1942 a -2 1942 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1298) cvn H.B /DEST pdfmark
+end
+ -2 1942
+a 562 2040 a FC(Specify)i(the)g(pro\002le)f(to)i(use.)f(The)g(def)o
+(ault)f(is)i(')-5 b(samhain'.)-2 2241 y
+SDict begin H.S end
+ -2 2241 a -2
+2241 a
+SDict begin 13 H.A end
+ -2 2241 a -2 2241 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1300) cvn H.B /DEST pdfmark
+end
+ -2 2241 a 396 2349 a FC(PreludeMapT)e(oInfo)
+-2 2367 y
+SDict begin H.S end
+ -2 2367 a -2 2367 a
+SDict begin 13 H.A end
+ -2 2367 a -2 2367 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1301) cvn H.B /DEST pdfmark
+end
+ -2
+2367 a Black Black 562 2498 a
+SDict begin H.S end
+ 562 2498 a 562 2498 a
+SDict begin 13 H.A end
+ 562
+2498 a 562 2498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1302) cvn H.B /DEST pdfmark
+end
+ 562 2498 a 562 2498 a
+SDict begin H.S end
+ 562 2498 a 562
+2498 a
+SDict begin 13 H.A end
+ 562 2498 a 562 2498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1303) cvn H.B /DEST pdfmark
+end
+ 562 2498 a Fy(Pr)o(eludeMapT)f(oInf)n(o=)
+1286 2498 y
+SDict begin H.S end
+ 1286 2498 a 1286 2498 a
+SDict begin 13 H.A end
+ 1286 2498 a 1286
+2498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1304) cvn H.B /DEST pdfmark
+end
+ 1286 2498 a Fl(list)44 b(of)g(samhain)g(severities)-2
+2681 y
+SDict begin H.S end
+ -2 2681 a -2 2681 a
+SDict begin 13 H.A end
+ -2 2681 a -2 2681 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1305) cvn H.B /DEST pdfmark
+end
+ -2 2681
+a 562 2772 a FC(The)20 b(se)n(v)o(erities)g(that)g(should)g(be)g
+(mapped)e(to)j(impact)e(se)n(v)o(erity)h('info')f(for)g(prelude.)g
+(\(def)o(ault:)g(none\).)-2 2974 y
+SDict begin H.S end
+ -2 2974 a -2 2974
+a
+SDict begin 13 H.A end
+ -2 2974 a -2 2974 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1307) cvn H.B /DEST pdfmark
+end
+ -2 2974 a 396 3082 a FC(PreludeMapT)-7
+b(oLo)n(w)-2 3100 y
+SDict begin H.S end
+ -2 3100 a -2 3100 a
+SDict begin 13 H.A end
+ -2 3100 a -2
+3100 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1308) cvn H.B /DEST pdfmark
+end
+ -2 3100 a Black Black 562 3231 a
+SDict begin H.S end
+ 562 3231 a 562
+3231 a
+SDict begin 13 H.A end
+ 562 3231 a 562 3231 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1309) cvn H.B /DEST pdfmark
+end
+ 562 3231 a 562 3231 a
+SDict begin H.S end
+ 562
+3231 a 562 3231 a
+SDict begin 13 H.A end
+ 562 3231 a 562 3231 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1310) cvn H.B /DEST pdfmark
+end
+ 562 3231 a Fy(Pr)o(eludeMapT)f
+(oInf)n(o=)1286 3231 y
+SDict begin H.S end
+ 1286 3231 a 1286 3231 a
+SDict begin 13 H.A end
+ 1286 3231
+a 1286 3231 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1311) cvn H.B /DEST pdfmark
+end
+ 1286 3231 a Fl(list)44 b(of)g(samhain)g(severities)-2
+3414 y
+SDict begin H.S end
+ -2 3414 a -2 3414 a
+SDict begin 13 H.A end
+ -2 3414 a -2 3414 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1312) cvn H.B /DEST pdfmark
+end
+ -2 3414
+a 562 3505 a FC(The)19 b(se)n(v)o(erities)g(that)h(should)e(be)h
+(mapped)f(to)h(impact)g(se)n(v)o(erity)f(')o(lo)n(w')h(for)g(prelude.)e
+(\(def)o(ault:)h(deb)n(ug,)g(info\).)-2 3706 y
+SDict begin H.S end
+ -2 3706
+a -2 3706 a
+SDict begin 13 H.A end
+ -2 3706 a -2 3706 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1314) cvn H.B /DEST pdfmark
+end
+ -2 3706 a 396 3814 a
+FC(PreludeMapT)-7 b(oMedium)-2 3832 y
+SDict begin H.S end
+ -2 3832 a -2 3832
+a
+SDict begin 13 H.A end
+ -2 3832 a -2 3832 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1315) cvn H.B /DEST pdfmark
+end
+ -2 3832 a Black Black 562 3964
+a
+SDict begin H.S end
+ 562 3964 a 562 3964 a
+SDict begin 13 H.A end
+ 562 3964 a 562 3964 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1316) cvn H.B /DEST pdfmark
+end
+ 562 3964
+a 562 3964 a
+SDict begin H.S end
+ 562 3964 a 562 3964 a
+SDict begin 13 H.A end
+ 562 3964 a 562 3964
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1317) cvn H.B /DEST pdfmark
+end
+ 562 3964 a Fy(Pr)o(eludeMapT)f(oMedium=)1439 3964 y
+SDict begin H.S end
+
+1439 3964 a 1439 3964 a
+SDict begin 13 H.A end
+ 1439 3964 a 1439 3964 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1318) cvn H.B /DEST pdfmark
+end
+ 1439
+3964 a Fl(list)45 b(of)g(samhain)e(severities)-2 4147
+y
+SDict begin H.S end
+ -2 4147 a -2 4147 a
+SDict begin 13 H.A end
+ -2 4147 a -2 4147 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1319) cvn H.B /DEST pdfmark
+end
+ -2 4147 a 562
+4238 a FC(The)20 b(se)n(v)o(erities)g(that)g(should)g(be)g(mapped)e(to)
+j(impact)e(se)n(v)o(erity)h('medium')e(for)h(prelude.)g(\(def)o(ault:)g
+(notice,)562 4346 y(w)o(arn,)h(err\).)-2 4547 y
+SDict begin H.S end
+ -2 4547
+a -2 4547 a
+SDict begin 13 H.A end
+ -2 4547 a -2 4547 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1321) cvn H.B /DEST pdfmark
+end
+ -2 4547 a 396 4655 a
+FC(PreludeMapT)-7 b(oHigh)-2 4673 y
+SDict begin H.S end
+ -2 4673 a -2 4673
+a
+SDict begin 13 H.A end
+ -2 4673 a -2 4673 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1322) cvn H.B /DEST pdfmark
+end
+ -2 4673 a Black Black 562 4804
+a
+SDict begin H.S end
+ 562 4804 a 562 4804 a
+SDict begin 13 H.A end
+ 562 4804 a 562 4804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1323) cvn H.B /DEST pdfmark
+end
+ 562 4804
+a 562 4804 a
+SDict begin H.S end
+ 562 4804 a 562 4804 a
+SDict begin 13 H.A end
+ 562 4804 a 562 4804
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1324) cvn H.B /DEST pdfmark
+end
+ 562 4804 a Fy(Pr)o(eludeMapT)f(oHigh=)1316 4804 y
+SDict begin H.S end
+ 1316
+4804 a 1316 4804 a
+SDict begin 13 H.A end
+ 1316 4804 a 1316 4804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1325) cvn H.B /DEST pdfmark
+end
+ 1316 4804
+a Fl(list)44 b(of)g(samhain)g(severities)-2 4987 y
+SDict begin H.S end
+ -2
+4987 a -2 4987 a
+SDict begin 13 H.A end
+ -2 4987 a -2 4987 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1326) cvn H.B /DEST pdfmark
+end
+ -2 4987 a 562 5078
+a FC(The)20 b(se)n(v)o(erities)g(that)g(should)g(be)g(mapped)e(to)j
+(impact)e(se)n(v)o(erity)h('high')e(for)i(prelude.)e(\(def)o(ault:)i
+(crit,)g(alert\).)39 5346 y
+SDict begin H.S end
+ 39 5346 a 39 5346 a
+SDict begin 13 H.A end
+ 39 5346
+a 39 5346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PRELUDE9) cvn H.B /DEST pdfmark
+end
+ 39 5346 a Black 3661 5805 a Fx(32)p Black
+eop end
+%%Page: 33 38
+TeXDict begin 33 37 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.33) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 396 313 a Fp(4.9.1.)36 b(Registering)e(to)g(a)f
+(Prelude)h(0.9)g(mana)o(g)q(er)2833 313 y
+SDict begin H.S end
+ 2833 313 a
+2833 313 a
+SDict begin 18.72 H.A end
+ 2833 313 a 2833 313 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.29.11.2) cvn H.B /DEST pdfmark
+end
+ 2833 313 a -2 339 a
+SDict begin H.S end
+
+-2 339 a -2 339 a
+SDict begin 11.7 H.A end
+ -2 339 a -2 339 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1329) cvn H.B /DEST pdfmark
+end
+ -2 339 a -2 464 a
+SDict begin H.S end
+
+-2 464 a -2 464 a
+SDict begin 11.7 H.A end
+ -2 464 a -2 464 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1331) cvn H.B /DEST pdfmark
+end
+ -2 464 a 562 535
+a Fw(Sensor)19 b(name/pr)o(o\002le:)f Fv(F)n(or)h(libprelude)e(0.9,)j
+(the)f(def)n(ault)f(sensor)i(name/pro\002le)e(is)j(')l(samhain'.)d(Ho)o
+(w)o(e)n(v)n(er)l(,)562 632 y(v)n(ersion)i(2.0.6)f(of)1092
+632 y
+SDict begin H.S end
+ 1092 632 a 1092 632 a
+SDict begin 11.7 H.A end
+ 1092 632 a 1092 632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1332) cvn H.B /DEST pdfmark
+end
+ 1092
+632 a Fv(samhain)g(still)h(had)f('Samhain')f(\(as)j(f)n(or)e
+(libprelude)e(0.8\).)i(F)n(or)h(v)n(ersions)g(of)3274
+632 y
+SDict begin H.S end
+ 3274 632 a 3274 632 a
+SDict begin 11.7 H.A end
+ 3274 632 a 3274 632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1333) cvn H.B /DEST pdfmark
+end
+ 3274
+632 a Fv(samhain)f(later)562 729 y(than)g(2.0.6,)g(there)g(is)i(an)f
+(option)1530 729 y
+SDict begin H.S end
+ 1530 729 a 1530 729 a
+SDict begin 11.7 H.A end
+ 1530 729 a 1530
+729 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1334) cvn H.B /DEST pdfmark
+end
+ 1530 729 a Fw(PreludePr)o(o\002le=)2083 729 y
+SDict begin H.S end
+ 2083
+729 a 2083 729 a
+SDict begin 11.7 H.A end
+ 2083 729 a 2083 729 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1335) cvn H.B /DEST pdfmark
+end
+ 2083 729 a Fm(profile)f
+Fv(\(in)h(the)g([Misc])h(section\))e(to)h(set)h(a)562
+826 y(user-de\002ned)d(name/pro\002le)o(.)-2 1141 y
+SDict begin H.S end
+ -2
+1141 a -2 1141 a
+SDict begin 13 H.A end
+ -2 1141 a -2 1141 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1336) cvn H.B /DEST pdfmark
+end
+ -2 1141 a 396 1249
+a FC(In)i(order)f(to)h(re)o(gister)1036 1249 y
+SDict begin H.S end
+ 1036 1249
+a 1036 1249 a
+SDict begin 13 H.A end
+ 1036 1249 a 1036 1249 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1337) cvn H.B /DEST pdfmark
+end
+ 1036 1249 a FC(samhain)f(as)i(a)
+1481 1249 y
+SDict begin H.S end
+ 1481 1249 a 1481 1249 a
+SDict begin 13 H.A end
+ 1481 1249 a 1481
+1249 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1338) cvn H.B /DEST pdfmark
+end
+ 1481 1249 a FC(Prelude)e(sensor)m(,)h(you)f(need)g(to)i(run)e
+(on)h(the)g(sensor)g(host)g(and)g(on)g(the)396 1357 y(manager)f(host)h
+(the)984 1357 y
+SDict begin H.S end
+ 984 1357 a 984 1357 a
+SDict begin 13 H.A end
+ 984 1357 a 984
+1357 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1339) cvn H.B /DEST pdfmark
+end
+ 984 1357 a Fy(pr)o(elude-adduser)g FC(command.)-2
+1458 y
+SDict begin H.S end
+ -2 1458 a -2 1458 a
+SDict begin 11.7 H.A end
+ -2 1458 a -2 1458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1340) cvn H.B /DEST pdfmark
+end
+ -2 1458
+a -2 1458 a
+SDict begin H.S end
+ -2 1458 a -2 1458 a
+SDict begin 11.7 H.A end
+ -2 1458 a -2 1458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1341) cvn H.B /DEST pdfmark
+end
+ -2
+1458 a 396 1537 a Ft(sensor)43 b(#)759 1537 y
+SDict begin H.S end
+ 759 1537
+a 759 1537 a
+SDict begin 11.7 H.A end
+ 759 1537 a 759 1537 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1342) cvn H.B /DEST pdfmark
+end
+ 759 1537 a Fs(prelude-adduser)j
+(register)d(samhain)g("idmef:w)g(admin:r")g Fi(<)p Fs(manager)g(host)p
+Fi(>)396 1732 y Fr(-)i(Using)f(default)g(TLS)g(settings)f(from)i
+(/usr/local/etc/prelude/default/tls.c)o(onf:)486 1829
+y(-)g(Generated)e(key)h(size:)g(1024)g(bits.)486 1926
+y(-)h(Authority)e(certificate)g(lifetime:)g(unlimited.)486
+2023 y(-)i(Generated)e(certificate)g(lifetime:)g(unlimited.)396
+2217 y(-)i(Adding)f(analyzer)f(samhain.)486 2315 y(-)i(Creating)e
+(/usr/local/etc/prelude/profile/samhain..)o(.)486 2412
+y(-)i(Using)f(already)f(allocated)h(ident)g(for)g(samhain:)f
+(1312010545704259.)486 2509 y(-)i(Creating)e
+(/usr/local/var/spool/prelude/samhain...)396 2703 y(-)i(Registring)e
+(analyzer)h(samhain)f(to)i(localhost.)486 2897 y(You)f(now)h(need)f(to)
+g(start)g("prelude-adduser")e(on)j(the)f(server)g(host)g(where)486
+2994 y(you)g(need)g(to)h(register)e(to:)486 3189 y(use:)h
+("prelude-adduser)e(registration-server)g Fh(<)p Fr(analyzer)h(profile)
+p Fh(>)p Fr(")486 3286 y(example:)g("prelude-adduser)g
+(registration-server)e(prelude-manager")486 3480 y(This)j(is)h(used)f
+(in)g(order)g(to)h(register)e(the)i('sending')e(analyzer)g(to)i(the)f
+('receiving')486 3577 y(analyzer.)f Fh(<)p Fr(analyzer)g(profile)p
+Fh(>)h Fr(should)g(be)g(set)g(to)h(the)f(profile)g(name)g(of)h(the)486
+3674 y('receiving')e(analyzer,)g(the)i(one)f(where)g('sending')f
+(analyzer)h(will)g(register)f(to.)486 3869 y(Please)h(remember)f(that)h
+("prelude-adduser")e(should)i(be)h(used)f(to)g(register)486
+3966 y(every)g(server)g(used)g(by)g(this)h(analyzer.)486
+4160 y(Enter)f(the)g(one-shot)g(password)f(provided)h(by)g(the)h
+("prelude-adduser")d(program:)486 4354 y(-)j(Enter)f(registration)e
+(one)j(shot)f(password:)-2 4449 y
+SDict begin H.S end
+ -2 4449 a -2 4449 a
+SDict begin 11.7 H.A end
+
+-2 4449 a -2 4449 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1343) cvn H.B /DEST pdfmark
+end
+ -2 4449 a -2 4449 a
+SDict begin H.S end
+ -2 4449 a -2
+4449 a
+SDict begin 11.7 H.A end
+ -2 4449 a -2 4449 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1344) cvn H.B /DEST pdfmark
+end
+ -2 4449 a 396 4535 a Ft(manager)f(#)800
+4535 y
+SDict begin H.S end
+ 800 4535 a 800 4535 a
+SDict begin 11.7 H.A end
+ 800 4535 a 800 4535 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1345) cvn H.B /DEST pdfmark
+end
+ 800
+4535 a Fs(prelude-adduser)i(registration-serve)q(r)h(prelude-manager)
+396 4729 y Fr(-)f(Using)f(default)g(TLS)g(settings)f(from)i
+(/usr/local/etc/prelude/default/tls.c)o(onf:)486 4826
+y(-)g(Generated)e(key)h(size:)g(1024)g(bits.)486 4923
+y(-)h(Authority)e(certificate)g(lifetime:)g(unlimited.)486
+5020 y(-)i(Generated)e(certificate)g(lifetime:)g(unlimited.)396
+5215 y(-)i(Adding)f(analyzer)f(samhain.)486 5312 y(-)i(Creating)e
+(/usr/local/etc/prelude/profile/samhain..)o(.)p Black
+3661 5805 a Fx(33)p Black eop end
+%%Page: 34 39
+TeXDict begin 34 38 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.34) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1369) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2239 104 a Fx(Chapter)20
+b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d(facilities)p
+Black 486 309 a Fr(-)45 b(Using)f(already)f(allocated)h(ident)g(for)g
+(samhain:)f(1312010545704259.)486 406 y(-)i(Creating)e
+(/usr/local/var/spool/prelude/samhain...)396 600 y(-)i(Starting)e
+(registration)g(server.)486 697 y(-)i(generated)e(one-shot)g(password)h
+(is)g("fz64g2h2".)576 892 y(This)g(password)f(will)h(be)h(requested)e
+(by)i("prelude-adduser")d(in)i(order)g(to)h(connect.)576
+989 y(Please)e(remove)h(the)h(first)f(and)g(last)g(quote)g(from)g(this)
+g(password)g(before)g(using)g(it.)486 1183 y(-)h(Waiting)e(for)i(peers)
+f(install)f(request...)-2 1361 y
+SDict begin H.S end
+ -2 1361 a -2 1361 a
+SDict begin 13 H.A end
+
+-2 1361 a -2 1361 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1346) cvn H.B /DEST pdfmark
+end
+ -2 1361 a 396 1457 a FC(Y)-9 b(ou)20
+b(no)n(w)f(ha)n(v)o(e)h(to)g(type)g(in)g(the)1344 1457
+y
+SDict begin H.S end
+ 1344 1457 a 1344 1457 a
+SDict begin 13 H.A end
+ 1344 1457 a 1344 1457 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1347) cvn H.B /DEST pdfmark
+end
+ 1344
+1457 a Fx(one-shot)e(passwor)m(d)23 b FC(generated)18
+b(on)i("manager")e(at)j(the)f(passw)o(ord)g(prompt)e(on)396
+1565 y("sensor",)i(\(twice,)g(for)f(con\002rmation\).)f(Then)h(on)h
+("manager")e(you)h(will)i(be)f(ask)o(ed)g(to)h(appro)o(v)o(e)c(the)k
+(re)o(gistration.)396 1673 y(T)-7 b(ype)20 b('y',)f(and)h(you)f(are)h
+(\002nished.)-2 1857 y
+SDict begin H.S end
+ -2 1857 a -2 1857 a
+SDict begin 13 H.A end
+ -2 1857 a
+-2 1857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1348) cvn H.B /DEST pdfmark
+end
+ -2 1857 a 396 1947 a FC(The)g(con\002guration)e(\002le)i(for)
+g(the)g(samhain)g(sensor)g(is)396 2055 y
+SDict begin H.S end
+ 396 2055 a 396
+2055 a
+SDict begin 13 H.A end
+ 396 2055 a 396 2055 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1349) cvn H.B /DEST pdfmark
+end
+ 396 2055 a Fr
+(/usr/local/etc/prelude/profile/samhain/co)o(nfig)-2
+2077 y
+SDict begin H.S end
+ -2 2077 a -2 2077 a
+SDict begin 13 H.A end
+ -2 2077 a -2 2077 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PRELUDE8) cvn H.B /DEST pdfmark
+end
+ -2 2077
+a 396 2393 a Fp(4.9.2.)36 b(Registering)e(to)g(a)f(Prelude)h(0.8)g
+(mana)o(g)q(er)2833 2393 y
+SDict begin H.S end
+ 2833 2393 a 2833 2393 a
+SDict begin 18.72 H.A end
+ 2833
+2393 a 2833 2393 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.29.12.2) cvn H.B /DEST pdfmark
+end
+ 2833 2393 a -2 2420 a
+SDict begin H.S end
+ -2 2420 a -2
+2420 a
+SDict begin 11.7 H.A end
+ -2 2420 a -2 2420 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1352) cvn H.B /DEST pdfmark
+end
+ -2 2420 a -2 2544 a
+SDict begin H.S end
+ -2 2544
+a -2 2544 a
+SDict begin 11.7 H.A end
+ -2 2544 a -2 2544 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1354) cvn H.B /DEST pdfmark
+end
+ -2 2544 a 562 2615 a
+Fw(Sensor)19 b(name/pr)o(o\002le:)f Fv(F)n(or)h(libprelude)e(0.8,)j
+(the)f(sensor)h(name/pro\002le)e(is)j('Samhain'.)-2 2930
+y
+SDict begin H.S end
+ -2 2930 a -2 2930 a
+SDict begin 13 H.A end
+ -2 2930 a -2 2930 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1355) cvn H.B /DEST pdfmark
+end
+ -2 2930 a 396
+3038 a FC(In)f(order)f(to)h(re)o(gister)1036 3038 y
+SDict begin H.S end
+ 1036
+3038 a 1036 3038 a
+SDict begin 13 H.A end
+ 1036 3038 a 1036 3038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1356) cvn H.B /DEST pdfmark
+end
+ 1036 3038
+a FC(samhain)f(as)i(a)1481 3038 y
+SDict begin H.S end
+ 1481 3038 a 1481 3038
+a
+SDict begin 13 H.A end
+ 1481 3038 a 1481 3038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1357) cvn H.B /DEST pdfmark
+end
+ 1481 3038 a FC(Prelude)e(sensor)m(,)h(you)f
+(need)g(to)i(run)e(on)h(the)g(Prelude)g(manager)e(the)396
+3146 y(command:)768 3146 y
+SDict begin H.S end
+ 768 3146 a 768 3146 a
+SDict begin 13 H.A end
+ 768
+3146 a 768 3146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1358) cvn H.B /DEST pdfmark
+end
+ 768 3146 a Fy(manager)m(-adduser)p
+FC(,)g(and)i(on)g(the)g(client)g(the)g(command)2475 3146
+y
+SDict begin H.S end
+ 2475 3146 a 2475 3146 a
+SDict begin 13 H.A end
+ 2475 3146 a 2475 3146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1359) cvn H.B /DEST pdfmark
+end
+ 2475
+3146 a Fy(sensor)m(-adduser)h(--sensor)o(name)396 3254
+y(Samhain)g(--uid)922 3254 y
+SDict begin H.S end
+ 922 3254 a 922 3254 a
+SDict begin 13 H.A end
+ 922
+3254 a 922 3254 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1360) cvn H.B /DEST pdfmark
+end
+ 922 3254 a Fl(0)g Fy(--manager)m(-addr)1573
+3254 y
+SDict begin H.S end
+ 1573 3254 a 1573 3254 a
+SDict begin 13 H.A end
+ 1573 3254 a 1573 3254
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1361) cvn H.B /DEST pdfmark
+end
+ 1573 3254 a Fl(x.x.x.x)5 b FC(.)-2 3437 y
+SDict begin H.S end
+ -2 3437 a
+-2 3437 a
+SDict begin 13 H.A end
+ -2 3437 a -2 3437 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1362) cvn H.B /DEST pdfmark
+end
+ -2 3437 a 396 3528 a FC(Both)20
+b(commands)f(are)h(interacti)n(v)o(e,)f(and)g(apparently)g(should)g(be)
+h(run)f(simultaneously)-5 b(,)18 b(where)396 3636 y
+SDict begin H.S end
+ 396
+3636 a 396 3636 a
+SDict begin 13 H.A end
+ 396 3636 a 396 3636 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1363) cvn H.B /DEST pdfmark
+end
+ 396 3636 a Fy(manager)m
+(-adduser)h FC(will)h(generate)f(a)h('one-shot)e(passw)o(ord')h(that)h
+(must)g(be)f(entered)g(in)3019 3636 y
+SDict begin H.S end
+ 3019 3636 a 3019
+3636 a
+SDict begin 13 H.A end
+ 3019 3636 a 3019 3636 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1364) cvn H.B /DEST pdfmark
+end
+ 3019 3636 a Fy(sensor)m(-adduser)p
+FC(.)h(This)396 3744 y(is)h(ho)n(w)f(it)h(looks)f(on)f(the)i(Prelude)e
+(manager:)-2 3845 y
+SDict begin H.S end
+ -2 3845 a -2 3845 a
+SDict begin 11.7 H.A end
+ -2 3845 a -2
+3845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1365) cvn H.B /DEST pdfmark
+end
+ -2 3845 a -2 3845 a
+SDict begin H.S end
+ -2 3845 a -2 3845 a
+SDict begin 11.7 H.A end
+ -2 3845
+a -2 3845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1366) cvn H.B /DEST pdfmark
+end
+ -2 3845 a 396 3924 a Ft(bash$)638 3924 y
+SDict begin H.S end
+
+638 3924 a 638 3924 a
+SDict begin 11.7 H.A end
+ 638 3924 a 638 3924 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1367) cvn H.B /DEST pdfmark
+end
+ 638 3924
+a Fs(manager-adduser)396 4215 y Fr(Generated)44 b(one-shot)f(password)h
+(is)g("0ltdgbgy".)396 4410 y(This)g(password)g(will)g(be)h(requested)e
+(by)h("sensor-adduser")f(in)h(order)g(to)h(connect.)396
+4507 y(Please)f(remove)g(the)g(first)g(and)h(last)f(quote)g(from)g
+(this)g(password)g(before)f(using)h(it.)396 4895 y(-)h(Waiting)f(for)g
+(install)g(request)f(from)h(Prelude)g(sensors...)396
+4993 y(-)h(Connection)e(from)h(127.0.0.1.)396 5090 y(sensor)g(choose)g
+(to)g(use)h(PLAINTEXT)e(communication)g(method.)396 5187
+y(successfully)g(created)h(user)g(calvin.)396 5381 y(Sensor)g
+(registered)f(correctly.)p Black 3661 5805 a Fx(34)p
+Black eop end
+%%Page: 35 40
+TeXDict begin 35 39 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.35) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1368) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(And)i(this)h(is)g(the)f(dialog)f(on)h
+(the)g(client:)396 489 y Ft(bash$)638 489 y
+SDict begin H.S end
+ 638 489 a
+638 489 a
+SDict begin 11.7 H.A end
+ 638 489 a 638 489 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1371) cvn H.B /DEST pdfmark
+end
+ 638 489 a Fs(sensor-adduser)46
+b(--sensorname)e(Samhain)f(--uid)f(0)f(--manager-addr)k(127.0.0.1)396
+780 y Fr(Now)g(please)e(start)h("manager-adduser")e(on)j(the)f(Manager)
+g(host)g(where)396 877 y(you)h(wish)f(to)g(add)h(the)f(new)g(user.)396
+1072 y(Please)g(remember)g(that)g(you)g(should)g(call)g
+("sensor-adduser")e(for)j(each)f(configured)396 1169
+y(Manager)g(entry.)396 1363 y(Press)g(enter)g(when)g(done.)396
+1654 y(Please)g(use)g(the)h(one-shot)e(password)h(provided)f(by)i(the)f
+("manager-adduser")e(program.)396 1849 y(Enter)i(registration)f(one)h
+(shot)h(password)e(:)396 1946 y(Please)h(confirm)g(one)g(shot)g
+(password)g(:)396 2043 y(connecting)f(to)i(Manager)f(host)g
+(\(127.0.0.1:5553\)...)d(Succeeded.)396 2237 y(Username)j(to)g(use)h
+(to)f(authenticate)f(:)i(calvin)396 2334 y(Please)f(enter)g(a)h
+(password)e(for)i(this)f(user)g(:)396 2432 y(Please)g(re-enter)g(the)g
+(password)f(\(comfirm\))h(:)396 2529 y(Register)g(user)g("calvin")f(?)i
+([y/n])f(:)h(y)396 2626 y(Plaintext)f(account)f(creation)h(succeed)f
+(with)i(Prelude)e(Manager.)396 2723 y(Allocated)h(ident)g(for)g
+(Samhain@somehost:)e(61534998304562071.)-2 2891 y
+SDict begin H.S end
+ -2
+2891 a -2 2891 a
+SDict begin 13 H.A end
+ -2 2891 a -2 2891 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1372) cvn H.B /DEST pdfmark
+end
+ -2 2891 a 396 2997
+a FC(The)20 b(libprelude)f(client)h(library)f(has)h(a)h
+(con\002guration)c(\002le)396 3105 y
+SDict begin H.S end
+ 396 3105 a 396 3105
+a
+SDict begin 13 H.A end
+ 396 3105 a 396 3105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1373) cvn H.B /DEST pdfmark
+end
+ 396 3105 a Fr
+(/etc/prelude-sensors/sensors-default.conf)d FC(where)20
+b(you)f(can)h(con\002gure)e(e.g.)i(the)g(netw)o(ork)396
+3213 y(address)g(of)g(the)g(Prelude)g(manager)-5 b(.)-2
+3324 y
+SDict begin H.S end
+ -2 3324 a -2 3324 a
+SDict begin 13 H.A end
+ -2 3324 a -2 3324 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:NAGIOS) cvn H.B /DEST pdfmark
+end
+ -2 3324
+a 359 x Fu(4.10.)39 b(Using)f(samhain)g(with)h(na)o(gios)2207
+3683 y
+SDict begin H.S end
+ 2207 3683 a 2207 3683 a
+SDict begin 22.464 H.A end
+ 2207 3683 a 2207 3683
+a
+SDict begin [ /View [/XYZ H.V] /Dest (6.30.1) cvn H.B /DEST pdfmark
+end
+ 2207 3683 a -2 3881 a
+SDict begin H.S end
+ -2 3881 a -2 3881 a
+SDict begin 13 H.A end
+ -2 3881 a
+-2 3881 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1376) cvn H.B /DEST pdfmark
+end
+ -2 3881 a 396 3957 a FC(After)20 b(running)871
+3957 y
+SDict begin H.S end
+ 871 3957 a 871 3957 a
+SDict begin 13 H.A end
+ 871 3957 a 871 3957 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1377) cvn H.B /DEST pdfmark
+end
+ 871
+3957 a Fy(./con\002gur)o(e)p FC(,)f(you)g(will)i(\002nd)f(the)h(script)
+2060 3957 y
+SDict begin H.S end
+ 2060 3957 a 2060 3957 a
+SDict begin 13 H.A end
+ 2060 3957 a 2060
+3957 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1378) cvn H.B /DEST pdfmark
+end
+ 2060 3957 a Fr(check_samhain.pl)d FC(in)i(the)g(subdirectory)396
+4065 y
+SDict begin H.S end
+ 396 4065 a 396 4065 a
+SDict begin 13 H.A end
+ 396 4065 a 396 4065 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1379) cvn H.B /DEST pdfmark
+end
+ 396
+4065 a Fr(scripts/)g FC(of)g(the)g(samhain)f(distrib)n(ution.)g(The)h
+(follo)n(wing)e(recipe)i(to)g(use)h(this)f(script)h(has)f(been)g
+(kindly)396 4173 y(pro)o(vided)e(by)i(kiarna:)-2 4357
+y
+SDict begin H.S end
+ -2 4357 a -2 4357 a
+SDict begin 13 H.A end
+ -2 4357 a -2 4357 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1380) cvn H.B /DEST pdfmark
+end
+ -2 4357 a 396
+4447 a FC(Nagios)g(runs)g(as)h(user)f('nagios'.)e(Ho)n(we)n(v)o(er)m(,)
+h(in)h(order)f(to)h(check)g(the)g(\002lesystem,)g(you)f(typically)h(w)o
+(ant)g(to)g(run)396 4555 y
+SDict begin H.S end
+ 396 4555 a 396 4555 a
+SDict begin 13 H.A end
+ 396
+4555 a 396 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1381) cvn H.B /DEST pdfmark
+end
+ 396 4555 a FC(samhain)g(as)h(')l(root'.)d(Y)-9
+b(ou)20 b(can)g(use)1432 4555 y
+SDict begin H.S end
+ 1432 4555 a 1432 4555
+a
+SDict begin 13 H.A end
+ 1432 4555 a 1432 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1382) cvn H.B /DEST pdfmark
+end
+ 1432 4555 a FC(sudo)g(to)g(\002x)g(this)h
+(problem.)d(In)i(your)2525 4555 y
+SDict begin H.S end
+ 2525 4555 a 2525 4555
+a
+SDict begin 13 H.A end
+ 2525 4555 a 2525 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1383) cvn H.B /DEST pdfmark
+end
+ 2525 4555 a Fr(/etc/sudoers)f
+FC(\002le,)i(add)e(the)h(line:)-2 4656 y
+SDict begin H.S end
+ -2 4656 a -2
+4656 a
+SDict begin 11.7 H.A end
+ -2 4656 a -2 4656 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1384) cvn H.B /DEST pdfmark
+end
+ -2 4656 a 396 4832 a Fr(nagios)44
+b(ALL)g(=)h(NOPASSWD:/path/to/check_samhain)-2 5010 y
+SDict begin H.S end
+
+-2 5010 a -2 5010 a
+SDict begin 13 H.A end
+ -2 5010 a -2 5010 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1385) cvn H.B /DEST pdfmark
+end
+ -2 5010 a 396
+5106 a FC(Ne)o(xt,)20 b(add)g(the)g(service)g(to)g(the)g(nagios)g
+(\002le)1689 5106 y
+SDict begin H.S end
+ 1689 5106 a 1689 5106 a
+SDict begin 13 H.A end
+ 1689 5106
+a 1689 5106 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1386) cvn H.B /DEST pdfmark
+end
+ 1689 5106 a Fr(checkcommands.cfg)p FC(:)-2
+5207 y
+SDict begin H.S end
+ -2 5207 a -2 5207 a
+SDict begin 11.7 H.A end
+ -2 5207 a -2 5207 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1387) cvn H.B /DEST pdfmark
+end
+ -2 5207
+a 396 5384 a Fr(#)45 b('check_samhain')d(command)i(definition)p
+Black 3661 5805 a Fx(35)p Black eop end
+%%Page: 36 41
+TeXDict begin 36 40 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.36) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black 396 309 a Fr(define)44 b(command{)396
+406 y(command_name)f(check_samhain)396 503 y(command_line)g
+(/usr/bin/sudo)g(-u)h(root)g($USER1$/check_samhain)e(-t)i(100)396
+600 y(})-2 775 y
+SDict begin H.S end
+ -2 775 a -2 775 a
+SDict begin 13 H.A end
+ -2 775 a -2 775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1388) cvn H.B /DEST pdfmark
+end
+
+-2 775 a 396 874 a FC(Checking)19 b(the)h(\002lesystem)h(may)f(tak)o(e)
+g(some)g(time,)g(so)h(you)e(may)h(w)o(ant)g(to)g(increase)g(the)g
+(nagios)g(plugin)f(timeout)396 982 y(by)h(changing)e(the)i(follo)n
+(wing)f(line)h(in)1520 982 y
+SDict begin H.S end
+ 1520 982 a 1520 982 a
+SDict begin 13 H.A end
+ 1520
+982 a 1520 982 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1389) cvn H.B /DEST pdfmark
+end
+ 1520 982 a Fr(nagios.cfg)f FC(from)g(60)h(to)g(100:)-2
+1083 y
+SDict begin H.S end
+ -2 1083 a -2 1083 a
+SDict begin 11.7 H.A end
+ -2 1083 a -2 1083 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1390) cvn H.B /DEST pdfmark
+end
+ -2 1083
+a 396 1259 a Fr(service_check_timeout=100)-2 1434 y
+SDict begin H.S end
+ -2
+1434 a -2 1434 a
+SDict begin 13 H.A end
+ -2 1434 a -2 1434 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1391) cvn H.B /DEST pdfmark
+end
+ -2 1434 a 396 1533
+a FC(Then)g(add)f(the)h(service)g(to)h(the)f(appropriate)e(section)i
+(in)g(the)g(nagios)2414 1533 y
+SDict begin H.S end
+ 2414 1533 a 2414 1533
+a
+SDict begin 13 H.A end
+ 2414 1533 a 2414 1533 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1392) cvn H.B /DEST pdfmark
+end
+ 2414 1533 a Fr(service.cfg)f
+FC(\002le.)-2 1562 y
+SDict begin H.S end
+ -2 1562 a -2 1562 a
+SDict begin 13 H.A end
+ -2 1562 a -2
+1562 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SYSLOGDETAILS) cvn H.B /DEST
+pdfmark end
+ -2 1562 a 359 x Fu(4.11.)39 b(Syslog)829 1921
+y
+SDict begin H.S end
+ 829 1921 a 829 1921 a
+SDict begin 22.464 H.A end
+ 829 1921 a 829 1921 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.31.1) cvn H.B /DEST pdfmark
+end
+ 829 1921
+a -2 2119 a
+SDict begin H.S end
+ -2 2119 a -2 2119 a
+SDict begin 13 H.A end
+ -2 2119 a -2 2119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1395) cvn H.B /DEST pdfmark
+end
+ -2
+2119 a -2 2119 a
+SDict begin H.S end
+ -2 2119 a -2 2119 a
+SDict begin 13 H.A end
+ -2 2119 a -2 2119
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1396) cvn H.B /DEST pdfmark
+end
+ -2 2119 a 396 2195 a FC(samhain)20 b(will)h(translate)f(its)h(o)n(wn)
+f(se)n(v)o(erities)g(into)1887 2195 y
+SDict begin H.S end
+ 1887 2195 a 1887
+2195 a
+SDict begin 13 H.A end
+ 1887 2195 a 1887 2195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1397) cvn H.B /DEST pdfmark
+end
+ 1887 2195 a Fx(syslo)o(g)h(priorities)g
+FC(as)g(follo)n(ws:)-2 2212 y
+SDict begin H.S end
+ -2 2212 a -2 2212 a
+SDict begin 13 H.A end
+ -2
+2212 a -2 2212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1398) cvn H.B /DEST pdfmark
+end
+ -2 2212 a -2 2305 a
+SDict begin H.S end
+ -2 2305 a -2 2305
+a
+SDict begin 13 H.A end
+ -2 2305 a -2 2305 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1399) cvn H.B /DEST pdfmark
+end
+ -2 2305 a -2 2305 a
+SDict begin H.S end
+ -2 2305 a -2
+2305 a
+SDict begin 13 H.A end
+ -2 2305 a -2 2305 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.9) cvn H.B /DEST pdfmark
+end
+ -2 2305 a 396 2308 3359 4
+v 396 2308 V 396 2433 4 125 v 424 2408 a FD(Se)o(verity)p
+2074 2433 V 1357 w(Syslog)i(priority)p 3751 2433 V 396
+2436 3359 4 v 396 2436 V 396 2561 4 125 v 424 2536 a
+FC(deb)n(ug)p 2074 2561 V 1475 w(LOG_DEB)o(UG)p 3751
+2561 V 396 2564 3359 4 v 396 2564 V 396 2689 4 125 v
+424 2664 a(info)p 2074 2689 V 1543 w(LOG_INFO)p 3751
+2689 V 396 2692 3359 4 v 396 2692 V 396 2817 4 125 v
+424 2792 a(notice)p 2074 2817 V 1474 w(LOG_NO)m(TICE)p
+3751 2817 V 396 2820 3359 4 v 396 2820 V 396 2944 4 125
+v 424 2919 a(w)o(arn)p 2074 2944 V 1512 w(LOG_W)-10 b(ARNING)p
+3751 2944 V 396 2948 3359 4 v 396 2948 V 396 3072 4 125
+v 424 3047 a(mark)p 2074 3072 V 1506 w(LOG_ERR)p 3751
+3072 V 396 3076 3359 4 v 396 3076 V 396 3200 4 125 v
+424 3175 a(err)p 2074 3200 V 1585 w(LOG_ERR)p 3751 3200
+V 396 3203 3359 4 v 396 3203 V 396 3328 4 125 v 424 3303
+a(crit)p 2074 3328 V 1567 w(LOG_CRIT)p 3751 3328 V 396
+3331 3359 4 v 396 3331 V 396 3456 4 125 v 424 3431 a(alert)p
+2074 3456 V 1530 w(LOG_ALER)-5 b(T)p 3751 3456 V 396
+3459 3359 4 v 396 3459 V -2 3625 a
+SDict begin H.S end
+ -2 3625 a -2 3625
+a
+SDict begin 13 H.A end
+ -2 3625 a -2 3625 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1429) cvn H.B /DEST pdfmark
+end
+ -2 3625 a 396 3708 a FC(Messages)21
+b(lar)o(ger)e(than)g(960)h(chars)g(will)h(be)f(split)g(into)g(se)n(v)o
+(eral)g(messages.)g(By)h(def)o(ault,)3017 3708 y
+SDict begin H.S end
+ 3017
+3708 a 3017 3708 a
+SDict begin 13 H.A end
+ 3017 3708 a 3017 3708 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1430) cvn H.B /DEST pdfmark
+end
+ 3017 3708
+a FC(samhain)e(will)i(use)g(the)396 3816 y(identity)f(')-5
+b(samhain',)19 b(the)1162 3816 y
+SDict begin H.S end
+ 1162 3816 a 1162 3816
+a
+SDict begin 13 H.A end
+ 1162 3816 a 1162 3816 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1431) cvn H.B /DEST pdfmark
+end
+ 1162 3816 a Fx(syslo)o(g)h(facility)h
+FC(LOG_A)-5 b(UTHPRIV)-11 b(,)20 b(and)f(will)i(log)f(its)h(PID)g
+(\(process)e(identi\002cation)396 3924 y(number\))f(in)j(addition)e(to)
+h(the)g(message.)-2 4108 y
+SDict begin H.S end
+ -2 4108 a -2 4108 a
+SDict begin 13 H.A end
+ -2 4108
+a -2 4108 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1432) cvn H.B /DEST pdfmark
+end
+ -2 4108 a 396 4198 a FC(The)g(syslog)g(f)o(acility)g(can)g
+(be)g(modi\002ed)f(via)h(the)h(directi)n(v)o(e)2138 4198
+y
+SDict begin H.S end
+ 2138 4198 a 2138 4198 a
+SDict begin 13 H.A end
+ 2138 4198 a 2138 4198 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1433) cvn H.B /DEST pdfmark
+end
+ 2138
+4198 a Fy(SyslogF)n(acility=)2679 4198 y
+SDict begin H.S end
+ 2679 4198 a
+2679 4198 a
+SDict begin 13 H.A end
+ 2679 4198 a 2679 4198 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1434) cvn H.B /DEST pdfmark
+end
+ 2679 4198 a Fl(command>LOG_xxx)g
+FC(in)f(the)3582 4198 y
+SDict begin H.S end
+ 3582 4198 a 3582 4198 a
+SDict begin 13 H.A end
+ 3582
+4198 a 3582 4198 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1435) cvn H.B /DEST pdfmark
+end
+ 3582 4198 a Fx(Misc)396 4306 y FC(section)g(of)g
+(the)g(con\002guration)e(\002le.)-2 4334 y
+SDict begin H.S end
+ -2 4334 a
+-2 4334 a
+SDict begin 13 H.A end
+ -2 4334 a -2 4334 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SQLDETAILS) cvn H.B /DEST pdfmark
+end
+ -2 4334 a 359 x Fu(4.12.)39
+b(SQL)g(Database)1332 4693 y
+SDict begin H.S end
+ 1332 4693 a 1332 4693 a
+SDict begin 22.464 H.A end
+
+1332 4693 a 1332 4693 a
+SDict begin [ /View [/XYZ H.V] /Dest (6.32.1) cvn H.B /DEST pdfmark
+end
+ 1332 4693 a -2 4700 a
+SDict begin H.S end
+ -2 4700
+a -2 4700 a
+SDict begin 11.7 H.A end
+ -2 4700 a -2 4700 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1438) cvn H.B /DEST pdfmark
+end
+ -2 4700 a -2 4825 a
+SDict begin H.S end
+ -2
+4825 a -2 4825 a
+SDict begin 11.7 H.A end
+ -2 4825 a -2 4825 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1440) cvn H.B /DEST pdfmark
+end
+ -2 4825 a 562 4915
+a Fw(REQ)o(UIREMENTS:)20 b Fv(This)g(f)n(acility)f(requires)g(that)g(y)
+o(ou)h(ha)o(v)n(e)f(compiled)g(with)h(the)2950 4915 y
+SDict begin H.S end
+
+2950 4915 a 2950 4915 a
+SDict begin 11.7 H.A end
+ 2950 4915 a 2950 4915 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1441) cvn H.B /DEST pdfmark
+end
+ 2950
+4915 a Fq(--enab)o(le-xml-log)g Fv(option)562 5012 y(to)g(f)n(or)r(mat)
+g(log)f(messages)h(in)g(XML)h(\()1638 5012 y
+SDict begin H.S end
+ 1638 5012
+a 1638 5012 a
+SDict begin 11.7 H.A end
+ 1638 5012 a 1638 5012 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1442) cvn H.B /DEST pdfmark
+end
+ 1638 5012 a Fq(also)e(f)n(or)h
+(the)g(client)7 b Fv(,)18 b(e)n(v)n(en)i(if)g(y)o(ou)g(do)g(SQL)g
+(logging)e(on)h(the)h(ser)r(v)n(er\),)562 5109 y(and)g(of)g(course)g
+(with)f(the)1314 5109 y
+SDict begin H.S end
+ 1314 5109 a 1314 5109 a
+SDict begin 11.7 H.A end
+ 1314
+5109 a 1314 5109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1443) cvn H.B /DEST pdfmark
+end
+ 1314 5109 a Fq(--with-database=XXX)25
+b Fv(option)18 b(\(where)h('XXX')h(ma)n(y)h(be)e(an)o(y)i(of:)e(m)o
+(ysql,)562 5207 y(postg)o(resql,)g(or)o(acle)o(,)g(or)h(odbc\).)-2
+5265 y
+SDict begin H.S end
+ -2 5265 a -2 5265 a
+SDict begin 11.7 H.A end
+ -2 5265 a -2 5265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1444) cvn H.B /DEST pdfmark
+end
+ -2 5265
+a 562 5345 a Fv(If)h(y)o(ou)e(are)h(using)f(the)1217
+5345 y
+SDict begin H.S end
+ 1217 5345 a 1217 5345 a
+SDict begin 11.7 H.A end
+ 1217 5345 a 1217 5345
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1445) cvn H.B /DEST pdfmark
+end
+ 1217 5345 a Fq(MessageHeader)26 b Fv(directiv)n(e)19
+b(in)h(the)g(con\002gur)o(ation)e(\002le)i(f)n(or)g(a)g(user-de\002ned)
+p Black 3660 5805 a Fx(36)p Black eop end
+%%Page: 37 42
+TeXDict begin 37 41 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.37) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1464) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2239 104 a Fx(Chapter)20
+b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d(facilities)p
+Black 562 309 a Fv(message)i(header)l(,)f(mak)o(e)h(sure)g(that)f(the)h
+(log)f(messages)h(are)g(still)g(v)n(alid)f(XML,)i(and)e(that)g(all)h
+(the)f(def)n(ault)562 406 y(entities)g(are)h(still)f(present.)-2
+721 y
+SDict begin H.S end
+ -2 721 a -2 721 a
+SDict begin 13 H.A end
+ -2 721 a -2 721 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1446) cvn H.B /DEST pdfmark
+end
+ -2 721 a 396
+829 a FC(Currently)g(MySQL,)h(PostgreSQL,)f(and)h(Oracle)g(are)g
+(implemented)e(and)i(tested.)g(Support)f(for)g(unixODBC)h(is)396
+937 y(implemented,)e(b)n(ut)j(not)e(fully)h(tested.)g(If)g(the)g
+(header)f(\002le)i('mysql.h')e(\(')o(libpq-fe.h'\))d(is)21
+b(not)f(found)f(during)396 1045 y(compilation)g(\('mysql.h:)f(No)i
+(such)g(\002le)h(or)f(directory'\),)d(you)j(can)g(use)g(the)g(option)
+396 1153 y
+SDict begin H.S end
+ 396 1153 a 396 1153 a
+SDict begin 13 H.A end
+ 396 1153 a 396 1153
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1447) cvn H.B /DEST pdfmark
+end
+ 396 1153 a Fx(--with-c\003a)o(gs=-I/dir/wher)m(e/mysql.h/is)p
+FC(.)d(If)j(the)h(library)e(libmysqlclient.a)f(\(libpq.a\))h(is)i(not)e
+(found)396 1261 y(\('/usr/bin/ld:)g(cannot)g(\002nd)h
+(-lmysqlclient'\),)e(you)h(can)h(use)g(the)h(option)396
+1369 y
+SDict begin H.S end
+ 396 1369 a 396 1369 a
+SDict begin 13 H.A end
+ 396 1369 a 396 1369 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1448) cvn H.B /DEST pdfmark
+end
+ 396
+1369 a Fx(--with-libs=-L/dir/wher)m(e/libmysqlclient.a/is)p
+FC(.)-2 1386 y
+SDict begin H.S end
+ -2 1386 a -2 1386 a
+SDict begin 11.7 H.A end
+ -2 1386 a -2 1386
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1449) cvn H.B /DEST pdfmark
+end
+ -2 1386 a -2 1510 a
+SDict begin H.S end
+ -2 1510 a -2 1510 a
+SDict begin 11.7 H.A end
+ -2 1510 a -2
+1510 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1451) cvn H.B /DEST pdfmark
+end
+ -2 1510 a 562 1591 a Fw(NO)m(TE:)g Fv(P)l(ostg)o(reSQL)e(ma)n(y)
+h(f)n(ail)g(with)f(--enab)o(le-static.)e(This)i(is)i(a)f(postg)o(resql)
+f(b)o(ug.)-2 1906 y
+SDict begin H.S end
+ -2 1906 a -2 1906 a
+SDict begin 13 H.A end
+ -2 1906 a -2
+1906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1452) cvn H.B /DEST pdfmark
+end
+ -2 1906 a 396 2014 a FC(By)i(def)o(ault,)e(the)h(database)g
+(serv)o(er)f(is)i(assumed)f(to)g(be)h(on)e(localhost,)h(the)g(db)g
+(name)f(is)i(')-5 b(samhain',)19 b(the)h(db)g(table)396
+2122 y(is)h(')o(log',)d(and)h(inserting)g(is)h(possible)g(for)e(an)o(y)
+h(user)h(without)e(passw)o(ord.)h(T)-7 b(o)2639 2122
+y
+SDict begin H.S end
+ 2639 2122 a 2639 2122 a
+SDict begin 13 H.A end
+ 2639 2122 a 2639 2122 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1453) cvn H.B /DEST pdfmark
+end
+ 2639
+2122 a Fx(cr)m(eate)19 b FC(the)h(database/table)e(with)i(the)396
+2230 y(required)f(columns,)g(the)h(distrib)n(ution)f(includes)g(the)h
+(scripts)h(')-5 b(samhain.mysql.init',)17 b(')-5 b
+(samhain.postgres.init',)396 2338 y(and)20 b(')-5 b
+(samhain.oracle.init'.)17 b(E.g.,)i(for)h(PostgreSQL)f(you)h(w)o(ould)f
+(setup)h(the)g(database)g(lik)o(e:)-2 2439 y
+SDict begin H.S end
+ -2 2439
+a -2 2439 a
+SDict begin 11.7 H.A end
+ -2 2439 a -2 2439 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1454) cvn H.B /DEST pdfmark
+end
+ -2 2439 a 665 2518 a
+Fr($)45 b(su)f(postgres)665 2615 y($)h(createdb)e(samhain)665
+2712 y($)i(createuser)e(samhain)665 2809 y($)i(psql)f(-d)h(samhain)e(<)
+i(samhain.postgres.init)665 2906 y($)g(exit)-2 3081 y
+SDict begin H.S end
+
+-2 3081 a -2 3081 a
+SDict begin 13 H.A end
+ -2 3081 a -2 3081 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1455) cvn H.B /DEST pdfmark
+end
+ -2 3081 a 396
+3180 a FC(.)12 b(.)g(.)34 b(and)19 b(for)h(MySQL:)-2
+3281 y
+SDict begin H.S end
+ -2 3281 a -2 3281 a
+SDict begin 11.7 H.A end
+ -2 3281 a -2 3281 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1456) cvn H.B /DEST pdfmark
+end
+ -2 3281
+a 665 3361 a Fr($)45 b(mysql)f(-p)g(-u)h(root)f(<)h(samhain.mysql.init)
+665 3458 y($)g(mysql)f(-p)g(-u)h(root)665 3555 y(...)g(edit)f(grant)g
+(tables)665 3652 y($)h(mysqladmin)e(-p)i(-u)f(root)g(reload)-2
+3664 y
+SDict begin H.S end
+ -2 3664 a -2 3664 a
+SDict begin 11.7 H.A end
+ -2 3664 a -2 3664 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1457) cvn H.B /DEST pdfmark
+end
+ -2 3664
+a -2 3830 a
+SDict begin H.S end
+ -2 3830 a -2 3830 a
+SDict begin 11.7 H.A end
+ -2 3830 a -2 3830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1459) cvn H.B /DEST pdfmark
+end
+ -2
+3830 a 562 3915 a Fw(NO)m(TE:)21 b Fv(The)e(P)l(ostg)o(reSQL)g(init)h
+(scr)q(ipt)g(will)f(g)o(r)o(ant)h(INSER)n(T)g(per)r(mission)e(only)i
+(to)g(a)h(user)f(')l(samhain'.)e(Please)562 4012 y(tak)o(e)i(note)f
+(that)g(f)n(or)h(P)l(ostg)o(reSQL,)f(inser)s(ting)f(also)i(requires)f
+(SELECT)g(and)h(UPD)m(A)-9 b(TE)19 b(per)r(mission)g(f)n(or)h(the)562
+4109 y(sequence)f('log_log_inde)n(x_seq)o(')c(\(see)20
+b(bottom)f(of)h(init)f(scr)q(ipt\).)h(The)g(MySQL)h(init)e(scr)q(ipt)i
+(will)e(create)g(the)562 4207 y(database)o(,)f(b)o(ut)h(not)h(the)g
+(user)l(,)g(and)f(will)h(not)f(g)o(r)o(ant)h(an)o(y)g(per)r(missions)o
+(.)-2 4522 y
+SDict begin H.S end
+ -2 4522 a -2 4522 a
+SDict begin 13 H.A end
+ -2 4522 a -2 4522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1460) cvn H.B /DEST pdfmark
+end
+
+-2 4522 a 396 4630 a FC(As)h(with)g(all)f(logging)f(f)o(acilities,)h
+(logging)f(to)h(the)g(SQL)h(database)f(must)g(be)g(enabled)f(in)h(the)h
+(con\002guration)c(\002le:)-2 4731 y
+SDict begin H.S end
+ -2 4731 a -2 4731
+a
+SDict begin 11.7 H.A end
+ -2 4731 a -2 4731 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1461) cvn H.B /DEST pdfmark
+end
+ -2 4731 a 486 4907 a Fr([Log])486
+5004 y(DatabaseSeverity=warn)p Black 3658 5805 a Fx(37)p
+Black eop end
+%%Page: 38 43
+TeXDict begin 38 42 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.38) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2239 104 a
+Fx(Chapter)20 b(4.)g(Con\002gur)o(ation)d(of)k(lo)o(g)o(ging)d
+(facilities)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1462) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(In)i(the)608 309 y
+SDict begin H.S end
+ 608
+309 a 608 309 a
+SDict begin 13 H.A end
+ 608 309 a 608 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1463) cvn H.B /DEST pdfmark
+end
+ 608 309 a Fx(Database)f
+FC(section)h(of)g(the)g(con\002guration)e(\002le,)j(you)e(can)h(modify)
+e(the)j(def)o(aults)e(via)i(the)f(follo)n(wing)396 417
+y(directi)n(v)o(es:)486 694 y Fr([Database])486 791 y(SetDBName=)p
+Fg(db_name)486 888 y Fr(SetDBTable=)981 888 y
+SDict begin H.S end
+ 981 888
+a 981 888 a
+SDict begin 11.7 H.A end
+ 981 888 a 981 888 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1466) cvn H.B /DEST pdfmark
+end
+ 981 888 a Fg(db_table)486
+985 y Fr(SetDBHost=)936 985 y
+SDict begin H.S end
+ 936 985 a 936 985 a
+SDict begin 11.7 H.A end
+ 936
+985 a 936 985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1467) cvn H.B /DEST pdfmark
+end
+ 936 985 a Fg(db_host)486 1082 y Fr(SetDBUser=)936
+1082 y
+SDict begin H.S end
+ 936 1082 a 936 1082 a
+SDict begin 11.7 H.A end
+ 936 1082 a 936 1082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1468) cvn H.B /DEST pdfmark
+end
+ 936
+1082 a Fg(db_user)486 1180 y Fr(SetDBPassword=)1116 1180
+y
+SDict begin H.S end
+ 1116 1180 a 1116 1180 a
+SDict begin 11.7 H.A end
+ 1116 1180 a 1116 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1469) cvn H.B /DEST pdfmark
+end
+ 1116
+1180 a Fg(db_password)486 1277 y Fr(UsePersistent=)1116
+1277 y
+SDict begin H.S end
+ 1116 1277 a 1116 1277 a
+SDict begin 11.7 H.A end
+ 1116 1277 a 1116 1277
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1470) cvn H.B /DEST pdfmark
+end
+ 1116 1277 a Fg(yes/no)-2 1540 y
+SDict begin H.S end
+ -2 1540 a -2 1540 a
+SDict begin 13 H.A end
+
+-2 1540 a -2 1540 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1471) cvn H.B /DEST pdfmark
+end
+ -2 1540 a 396 1648 a FC(The)g(def)o(ault)g(is)h(to)
+f(use)g(a)h(persistent)f(connection)e(to)i(the)h(database.)e(Y)-9
+b(ou)20 b(can)g(change)e(this)j(with)396 1756 y
+SDict begin H.S end
+ 396 1756
+a 396 1756 a
+SDict begin 13 H.A end
+ 396 1756 a 396 1756 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1472) cvn H.B /DEST pdfmark
+end
+ 396 1756 a Fy(UseP)n(ersistent=no)-2
+1757 y
+SDict begin H.S end
+ -2 1757 a -2 1757 a
+SDict begin 11.7 H.A end
+ -2 1757 a -2 1757 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1473) cvn H.B /DEST pdfmark
+end
+ -2 1757
+a -2 1881 a
+SDict begin H.S end
+ -2 1881 a -2 1881 a
+SDict begin 11.7 H.A end
+ -2 1881 a -2 1881 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1475) cvn H.B /DEST pdfmark
+end
+ -2
+1881 a 562 1977 a Fw(NO)m(TE:)g Fv(F)n(or)e(P)l(ostg)o(reSQL,)g
+(db_host)g(m)o(ust)i(be)f(a)g(n)o(umer)q(ical)f(IP)h(address)o(.)-2
+2293 y
+SDict begin H.S end
+ -2 2293 a -2 2293 a
+SDict begin 13 H.A end
+ -2 2293 a -2 2293 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1476) cvn H.B /DEST pdfmark
+end
+ -2 2293
+a 396 2401 a FC(When)g(logging)f(client)h(messages,)1450
+2401 y
+SDict begin H.S end
+ 1450 2401 a 1450 2401 a
+SDict begin 13 H.A end
+ 1450 2401 a 1450 2401
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1477) cvn H.B /DEST pdfmark
+end
+ 1450 2401 a FC(yule)g(will)h(wrap)e(them)h(into)g(a)h(serv)o(er)e
+Ff(<)p FC(log)h(se)n(v=\224RCVT\224)g(tstamp=.)12 b(.)g(.)32
+b Ff(>)396 2509 y FC(.)12 b(.)g(.)34 b Ff(<)p FC(/log)p
+Ff(>)19 b FC(message.)h(The)f(parser)h(will)h(then)f(create)g(a)g
+(seperate)g(database)f(entry)h(for)f(this)i(serv)o(er)e(timestamp.)396
+2617 y(If)h(you)g(don')o(t)e(lik)o(e)j(this,)f(you)f(can)h(use)h(the)f
+(option)1886 2617 y
+SDict begin H.S end
+ 1886 2617 a 1886 2617 a
+SDict begin 13 H.A end
+ 1886 2617
+a 1886 2617 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1478) cvn H.B /DEST pdfmark
+end
+ 1886 2617 a Fy(SetDBSer)o(v)o(erTstamp=)2665
+2617 y
+SDict begin H.S end
+ 2665 2617 a 2665 2617 a
+SDict begin 13 H.A end
+ 2665 2617 a 2665 2617
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1479) cvn H.B /DEST pdfmark
+end
+ 2665 2617 a Fl(false)p FC(.)-2 2801 y
+SDict begin H.S end
+ -2 2801 a -2
+2801 a
+SDict begin 13 H.A end
+ -2 2801 a -2 2801 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1480) cvn H.B /DEST pdfmark
+end
+ -2 2801 a 396 2891 a FC(The)g(table)g
+(\002eld)h(')o(log_ref)5 b(')17 b(is)k(NULL)f(for)g(client)g(messages,)
+g(0)h(for)e(serv)o(er)g(messages,)i(and)e(equal)h(to)396
+2999 y(')o(log_inde)o(x')d(of)j(the)g(client)h(message)f(for)f(the)h
+(aforementioned)d(serv)o(er)j(timestamp)f(of)h(a)h(client)f(message.)-2
+3183 y
+SDict begin H.S end
+ -2 3183 a -2 3183 a
+SDict begin 13 H.A end
+ -2 3183 a -2 3183 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1481) cvn H.B /DEST pdfmark
+end
+ -2 3183
+a 396 3273 a FC(Log)f(records)f(can)h(be)h(tagged)e(via)i(a)f(special)h
+(\(inde)o(x)o(ed\))d(table)i(\002eld)g(')o(log_hash',)e(which)i(is)i
+(the)e(MD5)g(checksum)396 3381 y(of)h(\(the)g(concatenation)e(of\))h
+(an)o(y)h(\002elds)g(re)o(gistered)f(with)2091 3381 y
+SDict begin H.S end
+
+2091 3381 a 2091 3381 a
+SDict begin 13 H.A end
+ 2091 3381 a 2091 3381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1482) cvn H.B /DEST pdfmark
+end
+ 2091
+3381 a Fy(AddT)-8 b(oDBHash=)2679 3381 y
+SDict begin H.S end
+ 2679 3381 a
+2679 3381 a
+SDict begin 13 H.A end
+ 2679 3381 a 2679 3381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1483) cvn H.B /DEST pdfmark
+end
+ 2679 3381 a Fl(field)s
+FC(.)20 b(The)3098 3381 y
+SDict begin H.S end
+ 3098 3381 a 3098 3381 a
+SDict begin 13 H.A end
+ 3098
+3381 a 3098 3381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1484) cvn H.B /DEST pdfmark
+end
+ 3098 3381 a FC(beltane)g(web-based)396
+3488 y(console)g(can)g(use)g(these)g(tags)h(to)f(\002lter)h(messages.)f
+(There)f(is)i(no)f(def)o(ault)g(set)h(of)f(\002elds)g(o)o(v)o(er)f
+(which)h(the)g(MD5)396 3596 y(hash)g(is)h(computed,)d(so)j(by)f(def)o
+(ault)f(the)h(tag)h(is)1784 3596 y
+SDict begin H.S end
+ 1784 3596 a 1784 3596
+a
+SDict begin 13 H.A end
+ 1784 3596 a 1784 3596 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1485) cvn H.B /DEST pdfmark
+end
+ 1784 3596 a Fx(equal)e FC(for)g(all)i(ro)n
+(ws.)-2 3614 y
+SDict begin H.S end
+ -2 3614 a -2 3614 a
+SDict begin 11.7 H.A end
+ -2 3614 a -2 3614
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1486) cvn H.B /DEST pdfmark
+end
+ -2 3614 a -2 3739 a
+SDict begin H.S end
+ -2 3739 a -2 3739 a
+SDict begin 11.7 H.A end
+ -2 3739 a -2
+3739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1488) cvn H.B /DEST pdfmark
+end
+ -2 3739 a 562 3818 a Fw(TIP:)f Fv(F)n(or)g(secur)q(ity)-7
+b(,)19 b(y)o(ou)h(ma)n(y)h(w)o(ant)e(to)h(set)h(up)f(a)g(user/pass)n(w)
+o(ord)f(f)n(or)g(inser)s(tion)f(into)i(the)f(db)m(.)h(Ho)o(w)o(e)n(v)n
+(er)l(,)g(as)562 3915 y(the)g(pass)n(w)o(ord)f(is)i(in)f(clear)s(te)n
+(xt)f(in)h(the)f(con\002g)i(\002le)f(\(and)f(the)h(connection)e(to)i
+(the)g(db)f(ser)r(v)n(er)i(is)g(not)562 4012 y(encr)r(ypted\),)d(f)n
+(or)h(remote)g(logging)e(this)i(f)n(acility)g(is)h(less)g(secure)f
+(than)g(samhain')l(s)f(o)o(wn)h(client/ser)r(v)n(er)g(system)562
+4109 y(\(it)h(is)h(recommended)d(to)i(r)q(un)g(the)g(db)g(ser)r(v)n(er)
+g(on)g(the)g(log)f(host)h(and)g(ha)o(v)n(e)f(the)h(log)f(ser)r(v)n(er)l
+(,)i(i.e)o(.)3334 4109 y
+SDict begin H.S end
+ 3334 4109 a 3334 4109 a
+SDict begin 11.7 H.A end
+ 3334
+4109 a 3334 4109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1489) cvn H.B /DEST pdfmark
+end
+ 3334 4109 a Fv(yule,)f(log)f(to)562
+4207 y(the)h(db\).)p Black 3661 5805 a Fx(38)p Black
+eop end
+%%Page: 39 44
+TeXDict begin 39 43 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.39) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:FILE-MONITOR) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(5.)f(Con\002guration)j(\227)e(samhain,)f(the)h(\002le)
+-2 575 y(monitor)638 575 y
+SDict begin H.S end
+ 638 575 a 638 575 a
+SDict begin 26.957 H.A end
+ 638 575
+a 638 575 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.0) cvn H.B /DEST pdfmark end
+ 638 575 a -2 797 a
+SDict begin H.S end
+ -2 797 a -2 797 a
+SDict begin 13 H.A end
+ -2 797
+a -2 797 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1493) cvn H.B /DEST pdfmark
+end
+ -2 797 a 396 903 a FC(The)546 903 y
+SDict begin H.S end
+ 546 903
+a 546 903 a
+SDict begin 13 H.A end
+ 546 903 a 546 903 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1494) cvn H.B /DEST pdfmark
+end
+ 546 903 a FC(samhain)20
+b(\002le)g(monitor)f(checks)h(the)g(inte)o(grity)f(of)h(\002les)h(by)f
+(comparing)e(them)h(against)h(a)g(database)g(of)g(\002le)396
+1011 y(signatures,)f(and)h(notify)f(the)h(user)g(of)g(inconsistencies.)
+g(The)f(le)n(v)o(el)h(of)g(logging)f(is)i(con\002gurable,)c(and)j(se)n
+(v)o(eral)396 1119 y(logging)f(f)o(acilities)i(are)f(pro)o(vided.)-2
+1303 y
+SDict begin H.S end
+ -2 1303 a -2 1303 a
+SDict begin 13 H.A end
+ -2 1303 a -2 1303 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1495) cvn H.B /DEST pdfmark
+end
+ -2 1303
+a -2 1303 a
+SDict begin H.S end
+ -2 1303 a -2 1303 a
+SDict begin 13 H.A end
+ -2 1303 a -2 1303 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1496) cvn H.B /DEST pdfmark
+end
+ -2
+1303 a 396 1393 a FC(samhain)g(can)g(be)g(used)g(as)h(a)f(client)h
+(that)f(forw)o(ards)f(messages)h(to)g(the)h(serv)o(er)e(part)h(\()2857
+1393 y
+SDict begin H.S end
+ 2857 1393 a 2857 1393 a
+SDict begin 13 H.A end
+ 2857 1393 a 2857 1393
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1497) cvn H.B /DEST pdfmark
+end
+ 2857 1393 a FC(yule\))f(of)h(the)3260 1393 y
+SDict begin H.S end
+ 3260 1393
+a 3260 1393 a
+SDict begin 13 H.A end
+ 3260 1393 a 3260 1393 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1498) cvn H.B /DEST pdfmark
+end
+ 3260 1393 a FC(samhain)396
+1501 y(system,)g(or)g(as)h(a)g(standalone)e(program)f(\(for)h(single)h
+(hosts\).)-2 1685 y
+SDict begin H.S end
+ -2 1685 a -2 1685 a
+SDict begin 13 H.A end
+ -2 1685 a -2
+1685 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1499) cvn H.B /DEST pdfmark
+end
+ -2 1685 a -2 1685 a
+SDict begin H.S end
+ -2 1685 a -2 1685 a
+SDict begin 13 H.A end
+ -2 1685
+a -2 1685 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1500) cvn H.B /DEST pdfmark
+end
+ -2 1685 a 396 1775 a FC(samhain)g(can)g(be)g(run)f(as)i(a)g
+(background)16 b(process)k(\(i.e.)g(a)h(daemon\),)d(or)i(it)h(can)f(be)
+g(started)g(at)g(re)o(gular)f(interv)n(als)396 1882 y(by)500
+1882 y
+SDict begin H.S end
+ 500 1882 a 500 1882 a
+SDict begin 13 H.A end
+ 500 1882 a 500 1882 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1501) cvn H.B /DEST pdfmark
+end
+ 500
+1882 a FC(cron.)-2 1900 y
+SDict begin H.S end
+ -2 1900 a -2 1900 a
+SDict begin 11.7 H.A end
+ -2 1900
+a -2 1900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1502) cvn H.B /DEST pdfmark
+end
+ -2 1900 a -2 2025 a
+SDict begin H.S end
+ -2 2025 a -2 2025 a
+SDict begin 11.7 H.A end
+ -2
+2025 a -2 2025 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1504) cvn H.B /DEST pdfmark
+end
+ -2 2025 a 562 2104 a Fw(TIP:)h Fv(It)h(is)f
+(recommended)f(to)h(r)q(un)1573 2104 y
+SDict begin H.S end
+ 1573 2104 a 1573
+2104 a
+SDict begin 11.7 H.A end
+ 1573 2104 a 1573 2104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1505) cvn H.B /DEST pdfmark
+end
+ 1573 2104 a Fv(samhain)f(as)h(daemon,)f
+(because)2611 2104 y
+SDict begin H.S end
+ 2611 2104 a 2611 2104 a
+SDict begin 11.7 H.A end
+ 2611 2104
+a 2611 2104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1506) cvn H.B /DEST pdfmark
+end
+ 2611 2104 a -2 2126 a
+SDict begin H.S end
+ -2 2126 a -2 2126
+a
+SDict begin 11.7 H.A end
+ -2 2126 a -2 2126 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1507) cvn H.B /DEST pdfmark
+end
+ -2 2126 a Black 562 2264 a Fe(\225)p
+Black 645 2264 a
+SDict begin H.S end
+ 645 2264 a 645 2264 a
+SDict begin 11.7 H.A end
+ 645 2264 a 645
+2264 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1508) cvn H.B /DEST pdfmark
+end
+ 645 2264 a 645 2264 a
+SDict begin H.S end
+ 645 2264 a 645 2264 a
+SDict begin 11.7 H.A end
+ 645
+2264 a 645 2264 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1509) cvn H.B /DEST pdfmark
+end
+ 645 2264 a Fv(samhain)g(can)i(remember)e(\002le)h
+(changes)o(,)f(thus)h(while)f(r)q(unning)f(as)j(a)f(a)g(daemon,)f(it)h
+(will)f(not)h(bother)f(y)o(ou)645 2361 y(with)h(repetitiv)n(e)e
+(messages)i(about)f(the)h(same)g(prob)o(lem,)e(and)-2
+2377 y
+SDict begin H.S end
+ -2 2377 a -2 2377 a
+SDict begin 11.7 H.A end
+ -2 2377 a -2 2377 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1510) cvn H.B /DEST pdfmark
+end
+ -2 2377
+a Black 562 2499 a Fe(\225)p Black 645 2499 a
+SDict begin H.S end
+ 645 2499
+a 645 2499 a
+SDict begin 11.7 H.A end
+ 645 2499 a 645 2499 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1511) cvn H.B /DEST pdfmark
+end
+ 645 2499 a Fv(using)844
+2499 y
+SDict begin H.S end
+ 844 2499 a 844 2499 a
+SDict begin 11.7 H.A end
+ 844 2499 a 844 2499 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1512) cvn H.B /DEST pdfmark
+end
+ 844
+2499 a Fv(cron)h(opens)g(up)g(a)h(secur)q(ity)g(hole)o(,)d(because)i
+(betw)o(een)f(consecutiv)n(e)h(in)o(v)n(ocations)e(the)i(e)n(x)n
+(ecutab)o(le)645 2596 y(could)h(get)f(modi\002ed)g(or)i(replaced)d(b)o
+(y)i(a)g(rogue)f(prog)o(r)o(am.)39 2885 y
+SDict begin H.S end
+ 39 2885 a 39
+2885 a
+SDict begin 13 H.A end
+ 39 2885 a 39 2885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:BASCLT) cvn H.B /DEST pdfmark
+end
+ 39 2885 a -2 3262 a Fu(5.1.)39
+b(Usa)o(g)q(e)f(o)m(ver)q(vie)n(w)1359 3262 y
+SDict begin H.S end
+ 1359 3262
+a 1359 3262 a
+SDict begin 22.464 H.A end
+ 1359 3262 a 1359 3262 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.33.1) cvn H.B /DEST pdfmark
+end
+ 1359 3262 a -2
+3460 a
+SDict begin H.S end
+ -2 3460 a -2 3460 a
+SDict begin 13 H.A end
+ -2 3460 a -2 3460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1515) cvn H.B /DEST pdfmark
+end
+ -2 3460
+a 396 3536 a FC(T)-7 b(o)21 b(use)634 3536 y
+SDict begin H.S end
+ 634 3536
+a 634 3536 a
+SDict begin 13 H.A end
+ 634 3536 a 634 3536 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1516) cvn H.B /DEST pdfmark
+end
+ 634 3536 a FC(samhain,)e(the)h
+(follo)n(wing)f(steps)i(must)f(be)g(follo)n(wed:)-2 3720
+y
+SDict begin H.S end
+ -2 3720 a -2 3720 a
+SDict begin 13 H.A end
+ -2 3720 a -2 3720 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1517) cvn H.B /DEST pdfmark
+end
+ -2 3720 a -2
+3720 a
+SDict begin H.S end
+ -2 3720 a -2 3720 a
+SDict begin 13 H.A end
+ -2 3720 a -2 3720 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1518) cvn H.B /DEST pdfmark
+end
+ -2 3720
+a -2 3730 a
+SDict begin H.S end
+ -2 3730 a -2 3730 a
+SDict begin 13 H.A end
+ -2 3730 a -2 3730 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1519) cvn H.B /DEST pdfmark
+end
+ -2
+3730 a Black 463 3872 a FC(1.)p Black 546 3872 a
+SDict begin H.S end
+ 546
+3872 a 546 3872 a
+SDict begin 13 H.A end
+ 546 3872 a 546 3872 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1520) cvn H.B /DEST pdfmark
+end
+ 546 3872 a FC(The)g
+(con\002guration)d(\002le)k(must)f(be)g(prepared)e(\()p
+0 TeXcolorgray 1906 3872 a
+SDict begin H.S end
+ 1906 3872 a FC(Section)i(5.4)2281
+3872 y
+SDict begin 13 H.L end
+ 2281 3872 a 2281 3872 a
+SDict begin [ /Subtype /Link /Dest (0:FILEDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2281 3872 a Black -1 w
+FC(>,)p 0 TeXcolorgray 2368 3872 a
+SDict begin H.S end
+ 2368 3872 a FC(Section)g(4.1)2743
+3872 y
+SDict begin 13 H.L end
+ 2743 3872 a 2743 3872 a
+SDict begin [ /Subtype /Link /Dest (0:LOGDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2743 3872 a Black -1 w
+FC(>,)g(and)p 0 TeXcolorgray 2971 3872 a
+SDict begin H.S end
+ 2971 3872 a
+FC(Section)f(5.11)3387 3872 y
+SDict begin 13 H.L end
+ 3387 3872 a 3387 3872 a
+SDict begin [ /Subtype /Link /Dest (0:MONDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+
+3387 3872 a Black -1 w FC(>)h(for)546 3980 y(details\).)-2
+4161 y
+SDict begin H.S end
+ -2 4161 a -2 4161 a
+SDict begin 13 H.A end
+ -2 4161 a -2 4161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1524) cvn H.B /DEST pdfmark
+end
+ -2 4161
+a -2 4161 a
+SDict begin H.S end
+ -2 4161 a -2 4161 a
+SDict begin 13 H.A end
+ -2 4161 a -2 4161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1525) cvn H.B /DEST pdfmark
+end
+ -2
+4161 a -2 4161 a
+SDict begin H.S end
+ -2 4161 a -2 4161 a
+SDict begin 13 H.A end
+ -2 4161 a -2 4161
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1526) cvn H.B /DEST pdfmark
+end
+ -2 4161 a Black 546 4295 a FB(\225)p Black 629 4295
+a
+SDict begin H.S end
+ 629 4295 a 629 4295 a
+SDict begin 13 H.A end
+ 629 4295 a 629 4295 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1527) cvn H.B /DEST pdfmark
+end
+ 629 4295
+a FC(All)756 4295 y
+SDict begin H.S end
+ 756 4295 a 756 4295 a
+SDict begin 13 H.A end
+ 756 4295 a
+756 4295 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1528) cvn H.B /DEST pdfmark
+end
+ 756 4295 a Fx(\002les)g(and)f(dir)m(ectories)i
+FC(that)f(you)f(w)o(ant)i(to)f(monitor)f(must)h(be)g(listed.)g(W)m
+(ildcard)g(patterns)f(are)629 4403 y(supported.)-2 4421
+y
+SDict begin H.S end
+ -2 4421 a -2 4421 a
+SDict begin 13 H.A end
+ -2 4421 a -2 4421 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1529) cvn H.B /DEST pdfmark
+end
+ -2 4421 a Black
+546 4553 a FB(\225)p Black 629 4553 a
+SDict begin H.S end
+ 629 4553 a 629
+4553 a
+SDict begin 13 H.A end
+ 629 4553 a 629 4553 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1530) cvn H.B /DEST pdfmark
+end
+ 629 4553 a FC(The)779 4553
+y
+SDict begin H.S end
+ 779 4553 a 779 4553 a
+SDict begin 13 H.A end
+ 779 4553 a 779 4553 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1531) cvn H.B /DEST pdfmark
+end
+ 779 4553
+a Fx(policies)h FC(for)f(monitoring)f(them)i(\(i.e.)g(which)f
+(modi\002cations)g(are)h(allo)n(wed)g(and)f(which)h(not\))g(must)629
+4661 y(be)g(chosen.)-2 4662 y
+SDict begin H.S end
+ -2 4662 a -2 4662 a
+SDict begin 13 H.A end
+ -2
+4662 a -2 4662 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1532) cvn H.B /DEST pdfmark
+end
+ -2 4662 a Black 546 4810 a FB(\225)p
+Black 629 4810 a
+SDict begin H.S end
+ 629 4810 a 629 4810 a
+SDict begin 13 H.A end
+ 629 4810 a 629
+4810 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1533) cvn H.B /DEST pdfmark
+end
+ 629 4810 a FC(Optionally)-5 b(,)18 b(the)1142
+4810 y
+SDict begin H.S end
+ 1142 4810 a 1142 4810 a
+SDict begin 13 H.A end
+ 1142 4810 a 1142 4810
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1534) cvn H.B /DEST pdfmark
+end
+ 1142 4810 a Fx(se)o(verity)j FC(of)f(a)g(polic)o(y)g(violation)e(can)
+i(be)h(selected.)-2 4828 y
+SDict begin H.S end
+ -2 4828 a -2 4828 a
+SDict begin 13 H.A end
+ -2 4828
+a -2 4828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1535) cvn H.B /DEST pdfmark
+end
+ -2 4828 a Black 546 4959 a FB(\225)p Black
+629 4959 a
+SDict begin H.S end
+ 629 4959 a 629 4959 a
+SDict begin 13 H.A end
+ 629 4959 a 629 4959
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1536) cvn H.B /DEST pdfmark
+end
+ 629 4959 a FC(The)779 4959 y
+SDict begin H.S end
+ 779 4959 a 779 4959 a
+SDict begin 13 H.A end
+
+779 4959 a 779 4959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1537) cvn H.B /DEST pdfmark
+end
+ 779 4959 a Fx(lo)o(g)o(ging)d(facilities)j
+FC(must)f(be)h(chosen,)e(and)g(the)2174 4959 y
+SDict begin H.S end
+ 2174 4959
+a 2174 4959 a
+SDict begin 13 H.A end
+ 2174 4959 a 2174 4959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1538) cvn H.B /DEST pdfmark
+end
+ 2174 4959 a Fx(thr)m(eshold)h(le)
+o(vel)g FC(of)g(logging)e(should)i(be)g(de\002ned)f(T)-7
+b(o)629 5067 y(acti)n(v)n(ate)20 b(a)g(logging)f(f)o(acility)-5
+b(,)19 b(its)i(threshold)e(le)n(v)o(el)h(must)g(be)g(dif)n(ferent)f
+(from)2882 5067 y
+SDict begin H.S end
+ 2882 5067 a 2882 5067 a
+SDict begin 13 H.A end
+ 2882 5067 a
+2882 5067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1539) cvn H.B /DEST pdfmark
+end
+ 2882 5067 a Fx(none)p FC(.)-2 5085 y
+SDict begin H.S end
+ -2 5085
+a -2 5085 a
+SDict begin 13 H.A end
+ -2 5085 a -2 5085 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1540) cvn H.B /DEST pdfmark
+end
+ -2 5085 a Black 546 5217
+a FB(\225)p Black 629 5217 a
+SDict begin H.S end
+ 629 5217 a 629 5217 a
+SDict begin 13 H.A end
+ 629
+5217 a 629 5217 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1541) cvn H.B /DEST pdfmark
+end
+ 629 5217 a FC(Ev)o(entually)-5 b(,)17
+b(the)1146 5217 y
+SDict begin H.S end
+ 1146 5217 a 1146 5217 a
+SDict begin 13 H.A end
+ 1146 5217 a
+1146 5217 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1542) cvn H.B /DEST pdfmark
+end
+ 1146 5217 a Fx(addr)m(ess)i FC(of)h(the)h(e-mail)e
+(recepient)h(and/or)e(the)2547 5217 y
+SDict begin H.S end
+ 2547 5217 a 2547
+5217 a
+SDict begin 13 H.A end
+ 2547 5217 a 2547 5217 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1543) cvn H.B /DEST pdfmark
+end
+ 2547 5217 a Fx(IP)i(addr)m(ess)g
+FC(of)g(the)g(log)g(serv)o(er)f(must)h(be)629 5325 y(gi)n(v)o(en.)p
+Black 3661 5805 a Fx(39)p Black eop end
+%%Page: 40 45
+TeXDict begin 40 44 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.40) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 438 427 a
+SDict begin H.S end
+ 438 427 a 438 427
+a
+SDict begin 13 H.A end
+ 438 427 a 438 427 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1544) cvn H.B /DEST pdfmark
+end
+ 438 427 a Black 463 576 a FC(2.)p
+Black 546 576 a
+SDict begin H.S end
+ 546 576 a 546 576 a
+SDict begin 13 H.A end
+ 546 576 a 546 576
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1545) cvn H.B /DEST pdfmark
+end
+ 546 576 a FC(The)g(database)f(must)h(be)h(initialized.)e(If)h(it)h
+(already)e(e)o(xists,)i(it)f(should)g(be)g(deleted)f(\()2991
+576 y
+SDict begin H.S end
+ 2991 576 a 2991 576 a
+SDict begin 13 H.A end
+ 2991 576 a 2991 576 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1546) cvn H.B /DEST pdfmark
+end
+ 2991
+576 a FC(samhain)g(will)i(not)546 684 y(o)o(v)o(erwrite,)d(b)n(ut)i
+(append\),)e(or)1427 684 y
+SDict begin H.S end
+ 1427 684 a 1427 684 a
+SDict begin 13 H.A end
+ 1427
+684 a 1427 684 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1547) cvn H.B /DEST pdfmark
+end
+ 1427 684 a Fx(update)h FC(instead)h(of)2020
+684 y
+SDict begin H.S end
+ 2020 684 a 2020 684 a
+SDict begin 13 H.A end
+ 2020 684 a 2020 684 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1548) cvn H.B /DEST pdfmark
+end
+ 2020
+684 a Fx(init)h FC(should)f(be)g(used:)-2 868 y
+SDict begin H.S end
+ -2 868
+a -2 868 a
+SDict begin 13 H.A end
+ -2 868 a -2 868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1549) cvn H.B /DEST pdfmark
+end
+ -2 868 a -2 868 a
+SDict begin H.S end
+ -2 868
+a -2 868 a
+SDict begin 13 H.A end
+ -2 868 a -2 868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1550) cvn H.B /DEST pdfmark
+end
+ -2 868 a 546 958 a Fy(samhain)g(-t)942
+958 y
+SDict begin H.S end
+ 942 958 a 942 958 a
+SDict begin 13 H.A end
+ 942 958 a 942 958 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1551) cvn H.B /DEST pdfmark
+end
+ 942 958
+a Fl(init|update)438 1077 y
+SDict begin H.S end
+ 438 1077 a 438 1077 a
+SDict begin 13 H.A end
+ 438
+1077 a 438 1077 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1552) cvn H.B /DEST pdfmark
+end
+ 438 1077 a Black 463 1226 a FC(3.)p
+Black 546 1226 a
+SDict begin H.S end
+ 546 1226 a 546 1226 a
+SDict begin 13 H.A end
+ 546 1226 a 546
+1226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1553) cvn H.B /DEST pdfmark
+end
+ 546 1226 a FC(Start)723 1226 y
+SDict begin H.S end
+ 723 1226 a 723
+1226 a
+SDict begin 13 H.A end
+ 723 1226 a 723 1226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1554) cvn H.B /DEST pdfmark
+end
+ 723 1226 a FC(samhain)g(in)1106
+1226 y
+SDict begin H.S end
+ 1106 1226 a 1106 1226 a
+SDict begin 13 H.A end
+ 1106 1226 a 1106 1226
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1555) cvn H.B /DEST pdfmark
+end
+ 1106 1226 a Fx(c)o(hec)n(k)h FC(mode.)e(Either)h(select)h(this)f
+(mode)g(in)g(the)g(con\002guration)e(\002le,)i(or)g(use)h(the)546
+1334 y(command)d(line)i(option:)-2 1518 y
+SDict begin H.S end
+ -2 1518 a -2
+1518 a
+SDict begin 13 H.A end
+ -2 1518 a -2 1518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1556) cvn H.B /DEST pdfmark
+end
+ -2 1518 a -2 1518 a
+SDict begin H.S end
+ -2 1518
+a -2 1518 a
+SDict begin 13 H.A end
+ -2 1518 a -2 1518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1557) cvn H.B /DEST pdfmark
+end
+ -2 1518 a 546 1608 a
+Fy(samhain)g(-t)942 1608 y
+SDict begin H.S end
+ 942 1608 a 942 1608 a
+SDict begin 13 H.A end
+ 942
+1608 a 942 1608 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1558) cvn H.B /DEST pdfmark
+end
+ 942 1608 a Fl(check)-2 1776 y
+SDict begin H.S end
+ -2 1776
+a -2 1776 a
+SDict begin 13 H.A end
+ -2 1776 a -2 1776 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1559) cvn H.B /DEST pdfmark
+end
+ -2 1776 a 546 1882 a
+FC(T)-7 b(o)20 b(run)783 1882 y
+SDict begin H.S end
+ 783 1882 a 783 1882 a
+SDict begin 13 H.A end
+
+783 1882 a 783 1882 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1560) cvn H.B /DEST pdfmark
+end
+ 783 1882 a FC(samhain)g(as)h(a)f(background)d
+(process,)j(use)g(the)g(command)e(line)j(option)-2 2066
+y
+SDict begin H.S end
+ -2 2066 a -2 2066 a
+SDict begin 13 H.A end
+ -2 2066 a -2 2066 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1561) cvn H.B /DEST pdfmark
+end
+ -2 2066 a -2
+2066 a
+SDict begin H.S end
+ -2 2066 a -2 2066 a
+SDict begin 13 H.A end
+ -2 2066 a -2 2066 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1562) cvn H.B /DEST pdfmark
+end
+ -2 2066
+a 546 2156 a Fy(samhain)f(-D)h(-t)1051 2156 y
+SDict begin H.S end
+ 1051 2156
+a 1051 2156 a
+SDict begin 13 H.A end
+ 1051 2156 a 1051 2156 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1563) cvn H.B /DEST pdfmark
+end
+ 1051 2156 a Fl(check)-2
+2434 y
+SDict begin H.S end
+ -2 2434 a -2 2434 a
+SDict begin 13 H.A end
+ -2 2434 a -2 2434 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HASH-FUNCTION) cvn H.B /DEST
+pdfmark end
+ -2 2434
+a 377 x Fu(5.2.)39 b(A)-6 b(v)m(ailab)o(le)38 b(c)o(hec)m(ksum)f
+(functions)2322 2811 y
+SDict begin H.S end
+ 2322 2811 a 2322 2811 a
+SDict begin 22.464 H.A end
+ 2322 2811
+a 2322 2811 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.34.1) cvn H.B /DEST pdfmark
+end
+ 2322 2811 a -2 2979 a
+SDict begin H.S end
+ -2 2979 a -2 2979
+a
+SDict begin 13 H.A end
+ -2 2979 a -2 2979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1566) cvn H.B /DEST pdfmark
+end
+ -2 2979 a 396 3085 a FC(A)21 b(cryptographic)c
+(hash)j(function)e(is)j(a)g(one-w)o(ay)e(function)2166
+3085 y
+SDict begin H.S end
+ 2166 3085 a 2166 3085 a
+SDict begin 13 H.A end
+ 2166 3085 a 2166 3085
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1567) cvn H.B /DEST pdfmark
+end
+ 2166 3085 a Fy(H\()2259 3085 y
+SDict begin H.S end
+ 2259 3085 a 2259 3085
+a
+SDict begin 13 H.A end
+ 2259 3085 a 2259 3085 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1568) cvn H.B /DEST pdfmark
+end
+ 2259 3085 a Fl(foo)r Fy(\))g
+FC(such)h(that)g(it)h(is)g(easy)g(to)f(compute)3465 3085
+y
+SDict begin H.S end
+ 3465 3085 a 3465 3085 a
+SDict begin 13 H.A end
+ 3465 3085 a 3465 3085 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1569) cvn H.B /DEST pdfmark
+end
+ 3465
+3085 a Fy(H\()3558 3085 y
+SDict begin H.S end
+ 3558 3085 a 3558 3085 a
+SDict begin 13 H.A end
+ 3558
+3085 a 3558 3085 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1570) cvn H.B /DEST pdfmark
+end
+ 3558 3085 a Fl(foo)r Fy(\))396 3193
+y FC(from)578 3193 y
+SDict begin H.S end
+ 578 3193 a 578 3193 a
+SDict begin 13 H.A end
+ 578 3193 a
+578 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1571) cvn H.B /DEST pdfmark
+end
+ 578 3193 a Fk(foo)p FC(,)g(b)n(ut)h(infeasible)e(to)i
+(compute)1615 3193 y
+SDict begin H.S end
+ 1615 3193 a 1615 3193 a
+SDict begin 13 H.A end
+ 1615 3193
+a 1615 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1572) cvn H.B /DEST pdfmark
+end
+ 1615 3193 a Fk(foo)f FC(from)1953 3193
+y
+SDict begin H.S end
+ 1953 3193 a 1953 3193 a
+SDict begin 13 H.A end
+ 1953 3193 a 1953 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1573) cvn H.B /DEST pdfmark
+end
+ 1953
+3193 a Fy(H\()2046 3193 y
+SDict begin H.S end
+ 2046 3193 a 2046 3193 a
+SDict begin 13 H.A end
+ 2046
+3193 a 2046 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1574) cvn H.B /DEST pdfmark
+end
+ 2046 3193 a Fl(foo)r Fy(\))p FC(,)e(or)i(to)g
+(\002nd)2575 3193 y
+SDict begin H.S end
+ 2575 3193 a 2575 3193 a
+SDict begin 13 H.A end
+ 2575 3193
+a 2575 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1575) cvn H.B /DEST pdfmark
+end
+ 2575 3193 a Fk(bar)j FC(such)d(that)3051
+3193 y
+SDict begin H.S end
+ 3051 3193 a 3051 3193 a
+SDict begin 13 H.A end
+ 3051 3193 a 3051 3193
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1576) cvn H.B /DEST pdfmark
+end
+ 3051 3193 a Fy(H\()3144 3193 y
+SDict begin H.S end
+ 3144 3193 a 3144 3193
+a
+SDict begin 13 H.A end
+ 3144 3193 a 3144 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1577) cvn H.B /DEST pdfmark
+end
+ 3144 3193 a Fl(bar)t Fy(\))g
+FC(=)3398 3193 y
+SDict begin H.S end
+ 3398 3193 a 3398 3193 a
+SDict begin 13 H.A end
+ 3398 3193 a
+3398 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1578) cvn H.B /DEST pdfmark
+end
+ 3398 3193 a Fy(H\()3491 3193 y
+SDict begin H.S end
+ 3491 3193
+a 3491 3193 a
+SDict begin 13 H.A end
+ 3491 3193 a 3491 3193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1579) cvn H.B /DEST pdfmark
+end
+ 3491 3193 a Fl(foo)r
+Fy(\))396 3301 y FC(\(which)g(w)o(ould)f(allo)n(w)h(to)h(replace)1424
+3301 y
+SDict begin H.S end
+ 1424 3301 a 1424 3301 a
+SDict begin 13 H.A end
+ 1424 3301 a 1424 3301
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1580) cvn H.B /DEST pdfmark
+end
+ 1424 3301 a Fk(foo)f FC(with)1748 3301 y
+SDict begin H.S end
+ 1748 3301
+a 1748 3301 a
+SDict begin 13 H.A end
+ 1748 3301 a 1748 3301 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1581) cvn H.B /DEST pdfmark
+end
+ 1748 3301 a Fk(bar)j
+FC(without)c(changing)f(the)i(hash)g(function\).)-2 3485
+y
+SDict begin H.S end
+ -2 3485 a -2 3485 a
+SDict begin 13 H.A end
+ -2 3485 a -2 3485 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1582) cvn H.B /DEST pdfmark
+end
+ -2 3485 a 396
+3575 a FC(One)g(common)f(usage)g(of)h(a)h(such)f(a)h(hash)e(function)g
+(is)i(the)f(computation)e(of)2649 3575 y
+SDict begin H.S end
+ 2649 3575 a
+2649 3575 a
+SDict begin 13 H.A end
+ 2649 3575 a 2649 3575 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1583) cvn H.B /DEST pdfmark
+end
+ 2649 3575 a Fx(c)o(hec)n(ksums)i
+FC(of)g(\002les,)h(such)f(that)g(an)o(y)396 3683 y(modi\002cation)f(of)
+h(a)g(\002le)h(can)f(be)g(noticed,)f(as)i(its)g(checksum)e(will)i
+(change.)-2 3867 y
+SDict begin H.S end
+ -2 3867 a -2 3867 a
+SDict begin 13 H.A end
+ -2 3867 a -2 3867
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1584) cvn H.B /DEST pdfmark
+end
+ -2 3867 a 396 3957 a FC(F)o(or)f(computing)e(checksums)h(of)h
+(\002les,)h(and)f(also)g(for)g(some)g(other)f(purposes,)2699
+3957 y
+SDict begin H.S end
+ 2699 3957 a 2699 3957 a
+SDict begin 13 H.A end
+ 2699 3957 a 2699 3957
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1585) cvn H.B /DEST pdfmark
+end
+ 2699 3957 a FC(samhain)g(uses)i(the)f(TIGER)g(hash)396
+4065 y(function)f(de)n(v)o(eloped)e(by)j(Ross)h(Anderson)e(and)h(Eli)g
+(Biham.)g(The)g(output)f(of)h(this)h(function)d(is)j(192)e(bits)i
+(long,)396 4173 y(and)f(the)g(function)f(can)h(be)g(implemented)e(ef)n
+(\002ciently)h(on)h(32-bit)f(and)h(64-bit)f(machines.)g(T)-6
+b(echnical)19 b(details)i(can)396 4281 y(be)f(found)f(at)791
+4281 y
+SDict begin H.S end
+ 791 4281 a 791 4281 a
+SDict begin 13 H.A end
+ 791 4281 a 791 4281 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1586) cvn H.B /DEST pdfmark
+end
+ 791
+4281 a FC(this)h(page)g(\(http://www)-5 b
+(.cs.technion.ac.il/~biham/Repo)o(rts/T)m(ige)o(r/\).)-2
+4465 y
+SDict begin H.S end
+ -2 4465 a -2 4465 a
+SDict begin 13 H.A end
+ -2 4465 a -2 4465 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1587) cvn H.B /DEST pdfmark
+end
+ -2 4465
+a 396 4555 a FC(As)21 b(of)f(v)o(ersion)f(1.2.10,)f(also)j(the)f(MD5)g
+(and)g(SHA-1)f(hash)h(functions)f(are)h(a)n(v)n(ailable.)g(\(Y)-9
+b(ou)19 b(need)h(to)g(set)h(the)396 4663 y(option)629
+4663 y
+SDict begin H.S end
+ 629 4663 a 629 4663 a
+SDict begin 13 H.A end
+ 629 4663 a 629 4663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1588) cvn H.B /DEST pdfmark
+end
+ 629
+4663 a Fx(Dig)o(estAlgo=MD5)e FC(or)1339 4663 y
+SDict begin H.S end
+ 1339
+4663 a 1339 4663 a
+SDict begin 13 H.A end
+ 1339 4663 a 1339 4663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1589) cvn H.B /DEST pdfmark
+end
+ 1339 4663
+a Fx(Dig)o(estAlgo=SHA1)g FC(in)h(the)g(con\002g)f(\002le)i(to)g
+(enable)e(this\).)h(Note)g(that)h(MD5)f(is)396 4771 y(some)n(what)g(f)o
+(aster)m(,)f(b)n(ut)i(because)e(of)h(security)g(concerns)e(it)j(is)g
+(not)f(recommended)d(an)o(ymore)h(for)i(ne)n(w)396 4878
+y(applications.)-2 4907 y
+SDict begin H.S end
+ -2 4907 a -2 4907 a
+SDict begin 13 H.A end
+ -2 4907
+a -2 4907 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:FILE-SIGNATURES) cvn H.B /DEST
+pdfmark end
+ -2 4907 a Black 3661 5805 a Fx(40)p Black
+eop end
+%%Page: 41 46
+TeXDict begin 41 45 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.41) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1636) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black -2 330 a Fu(5.3.)39 b(File)g(signatures)1292 330
+y
+SDict begin H.S end
+ 1292 330 a 1292 330 a
+SDict begin 22.464 H.A end
+ 1292 330 a 1292 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.35.1) cvn H.B /DEST pdfmark
+end
+ 1292 330
+a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1592) cvn H.B /DEST pdfmark
+end
+ -2 528
+a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1593) cvn H.B /DEST pdfmark
+end
+ -2 528
+a 396 604 a FC(samhain)20 b(w)o(orks)g(by)f(generating)g(a)h(database)g
+(of)1846 604 y
+SDict begin H.S end
+ 1846 604 a 1846 604 a
+SDict begin 13 H.A end
+ 1846 604 a 1846
+604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1594) cvn H.B /DEST pdfmark
+end
+ 1846 604 a Fx(\002le)g(signatur)m(es)p FC(,)f(and)h(later)g
+(comparing)e(\002le)j(against)e(that)396 712 y(database)h(to)g
+(recognize)f(\002le)i(modi\002cations)d(and/or)h(added/deleted)f
+(\002les.)-2 896 y
+SDict begin H.S end
+ -2 896 a -2 896 a
+SDict begin 13 H.A end
+ -2 896 a -2 896
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1595) cvn H.B /DEST pdfmark
+end
+ -2 896 a 396 986 a FC(File)j(signatures)f(include:)-2
+1170 y
+SDict begin H.S end
+ -2 1170 a -2 1170 a
+SDict begin 13 H.A end
+ -2 1170 a -2 1170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1596) cvn H.B /DEST pdfmark
+end
+ -2 1170
+a -2 1170 a
+SDict begin H.S end
+ -2 1170 a -2 1170 a
+SDict begin 13 H.A end
+ -2 1170 a -2 1170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1597) cvn H.B /DEST pdfmark
+end
+ -2
+1170 a -2 1180 a
+SDict begin H.S end
+ -2 1180 a -2 1180 a
+SDict begin 13 H.A end
+ -2 1180 a -2 1180
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1598) cvn H.B /DEST pdfmark
+end
+ -2 1180 a Black 396 1322 a FB(\225)p Black 479 1322
+a
+SDict begin H.S end
+ 479 1322 a 479 1322 a
+SDict begin 13 H.A end
+ 479 1322 a 479 1322 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1599) cvn H.B /DEST pdfmark
+end
+ 479 1322
+a FC(a)h(192-bit)e(cryptographic)d(checksum)j(computed)f(using)i(the)g
+(TIGER)g(hash)g(algorithm)f(\(alternati)n(v)o(ely)479
+1430 y(SHA-1)h(or)g(MD5)g(can)g(be)g(used\),)-2 1445
+y
+SDict begin H.S end
+ -2 1445 a -2 1445 a
+SDict begin 13 H.A end
+ -2 1445 a -2 1445 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1600) cvn H.B /DEST pdfmark
+end
+ -2 1445 a Black
+396 1580 a FB(\225)p Black 479 1580 a
+SDict begin H.S end
+ 479 1580 a 479
+1580 a
+SDict begin 13 H.A end
+ 479 1580 a 479 1580 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1601) cvn H.B /DEST pdfmark
+end
+ 479 1580 a FC(the)g(inode)g(of)g(the)g
+(\002le,)-2 1592 y
+SDict begin H.S end
+ -2 1592 a -2 1592 a
+SDict begin 13 H.A end
+ -2 1592 a -2 1592
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1602) cvn H.B /DEST pdfmark
+end
+ -2 1592 a Black 396 1729 a FB(\225)p Black 479 1729
+a
+SDict begin H.S end
+ 479 1729 a 479 1729 a
+SDict begin 13 H.A end
+ 479 1729 a 479 1729 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1603) cvn H.B /DEST pdfmark
+end
+ 479 1729
+a FC(the)g(type)g(of)g(the)g(\002le,)-2 1747 y
+SDict begin H.S end
+ -2 1747
+a -2 1747 a
+SDict begin 13 H.A end
+ -2 1747 a -2 1747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1604) cvn H.B /DEST pdfmark
+end
+ -2 1747 a Black 396 1879
+a FB(\225)p Black 479 1879 a
+SDict begin H.S end
+ 479 1879 a 479 1879 a
+SDict begin 13 H.A end
+ 479
+1879 a 479 1879 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1605) cvn H.B /DEST pdfmark
+end
+ 479 1879 a FC(o)n(wner)f(and)h(group,)-2
+1897 y
+SDict begin H.S end
+ -2 1897 a -2 1897 a
+SDict begin 13 H.A end
+ -2 1897 a -2 1897 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1606) cvn H.B /DEST pdfmark
+end
+ -2 1897
+a Black 396 2028 a FB(\225)p Black 479 2028 a
+SDict begin H.S end
+ 479 2028
+a 479 2028 a
+SDict begin 13 H.A end
+ 479 2028 a 479 2028 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1607) cvn H.B /DEST pdfmark
+end
+ 479 2028 a FC(access)h(permissions,)
+-2 2046 y
+SDict begin H.S end
+ -2 2046 a -2 2046 a
+SDict begin 13 H.A end
+ -2 2046 a -2 2046 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1608) cvn H.B /DEST pdfmark
+end
+ -2
+2046 a Black 396 2178 a FB(\225)p Black 479 2178 a
+SDict begin H.S end
+ 479
+2178 a 479 2178 a
+SDict begin 13 H.A end
+ 479 2178 a 479 2178 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1609) cvn H.B /DEST pdfmark
+end
+ 479 2178 a FC(on)f(Linux)f
+(only:)h(\003ags)g(of)g(the)g(e)o(xt2)g(\002le)h(system)f(\(see)2078
+2178 y
+SDict begin H.S end
+ 2078 2178 a 2078 2178 a
+SDict begin 13 H.A end
+ 2078 2178 a 2078 2178
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1610) cvn H.B /DEST pdfmark
+end
+ 2078 2178 a Fy(man)h(chattr)p FC(\),)-2 2196 y
+SDict begin H.S end
+ -2 2196
+a -2 2196 a
+SDict begin 13 H.A end
+ -2 2196 a -2 2196 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1611) cvn H.B /DEST pdfmark
+end
+ -2 2196 a Black 396 2327
+a FB(\225)p Black 479 2327 a
+SDict begin H.S end
+ 479 2327 a 479 2327 a
+SDict begin 13 H.A end
+ 479
+2327 a 479 2327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1612) cvn H.B /DEST pdfmark
+end
+ 479 2327 a FC(the)f(timestamps)g(of)g(the)h(\002le,)
+-2 2345 y
+SDict begin H.S end
+ -2 2345 a -2 2345 a
+SDict begin 13 H.A end
+ -2 2345 a -2 2345 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1613) cvn H.B /DEST pdfmark
+end
+ -2
+2345 a Black 396 2476 a FB(\225)p Black 479 2476 a
+SDict begin H.S end
+ 479
+2476 a 479 2476 a
+SDict begin 13 H.A end
+ 479 2476 a 479 2476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1614) cvn H.B /DEST pdfmark
+end
+ 479 2476 a FC(the)f(\002le)h
+(size,)-2 2488 y
+SDict begin H.S end
+ -2 2488 a -2 2488 a
+SDict begin 13 H.A end
+ -2 2488 a -2 2488
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1615) cvn H.B /DEST pdfmark
+end
+ -2 2488 a Black 396 2626 a FB(\225)p Black 479 2626
+a
+SDict begin H.S end
+ 479 2626 a 479 2626 a
+SDict begin 13 H.A end
+ 479 2626 a 479 2626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1616) cvn H.B /DEST pdfmark
+end
+ 479 2626
+a FC(the)f(number)f(of)h(hard)f(links,)-2 2638 y
+SDict begin H.S end
+ -2 2638
+a -2 2638 a
+SDict begin 13 H.A end
+ -2 2638 a -2 2638 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1617) cvn H.B /DEST pdfmark
+end
+ -2 2638 a Black 396 2775
+a FB(\225)p Black 479 2775 a
+SDict begin H.S end
+ 479 2775 a 479 2775 a
+SDict begin 13 H.A end
+ 479
+2775 a 479 2775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1618) cvn H.B /DEST pdfmark
+end
+ 479 2775 a FC(minor)g(and)h(major)f(de)n(vice)h
+(number)e(\(de)n(vices)i(only\))-2 2793 y
+SDict begin H.S end
+ -2 2793 a -2
+2793 a
+SDict begin 13 H.A end
+ -2 2793 a -2 2793 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1619) cvn H.B /DEST pdfmark
+end
+ -2 2793 a Black 396 2925 a
+FB(\225)p Black 479 2925 a
+SDict begin H.S end
+ 479 2925 a 479 2925 a
+SDict begin 13 H.A end
+ 479
+2925 a 479 2925 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1620) cvn H.B /DEST pdfmark
+end
+ 479 2925 a FC(and)g(the)g(name)g(of)g(the)g(link)o
+(ed)f(\002le)i(\(if)f(the)g(\002le)h(is)g(a)g(symbolic)e(link\).)-2
+3240 y
+SDict begin H.S end
+ -2 3240 a -2 3240 a
+SDict begin 13 H.A end
+ -2 3240 a -2 3240 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1621) cvn H.B /DEST pdfmark
+end
+ -2 3240
+a 396 3348 a FC(Depending)f(on)i(the)g(polic)o(y)f(chosen)h(for)f(a)i
+(particular)e(\002le,)h(only)g(a)g(subset)h(of)f(these)g(may)g(be)g
+(check)o(ed)f(for)396 3456 y(modi\002cations)g(\(see)p
+0 TeXcolorgray 1023 3456 a
+SDict begin H.S end
+ 1023 3456 a FC(Section)h(5.4.1)1461
+3456 y
+SDict begin 13 H.L end
+ 1461 3456 a 1461 3456 a
+SDict begin [ /Subtype /Link /Dest (0:POLICY) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1461 3456 a Black -2 w
+FC(>\),)g(b)n(ut)h(usually)e(all)i(these)f(informations)e(are)i
+(collected.)-2 3484 y
+SDict begin H.S end
+ -2 3484 a -2 3484 a
+SDict begin 13 H.A end
+ -2 3484 a -2
+3484 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:FILEDEF) cvn H.B /DEST pdfmark
+end
+ -2 3484 a 360 x Fu(5.4.)39 b(De\002ning)f(whic)o(h)g
+(\002les/directories)e(to)j(monitor)3147 3844 y
+SDict begin H.S end
+ 3147
+3844 a 3147 3844 a
+SDict begin 22.464 H.A end
+ 3147 3844 a 3147 3844 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.1) cvn H.B /DEST pdfmark
+end
+ 3147 3844
+a -2 4042 a
+SDict begin H.S end
+ -2 4042 a -2 4042 a
+SDict begin 13 H.A end
+ -2 4042 a -2 4042 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1625) cvn H.B /DEST pdfmark
+end
+ -2
+4042 a 396 4118 a FC(This)21 b(section)f(e)o(xplains)f(ho)n(w)g(to)i
+(specify)e(in)i(the)f(con\002guration)d(\002le,)k(which)f(\002les)h(or)
+f(directories)f(should)g(be)396 4226 y(monitored,)f(and)i(which)f
+(monitoring)f(polic)o(y)h(should)g(be)i(used.)-2 4243
+y
+SDict begin H.S end
+ -2 4243 a -2 4243 a
+SDict begin 13 H.A end
+ -2 4243 a -2 4243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:POLICY) cvn H.B /DEST pdfmark
+end
+ -2 4243 a 396
+4554 a Fp(5.4.1.)36 b(Monitoring)c(policies)1822 4554
+y
+SDict begin H.S end
+ 1822 4554 a 1822 4554 a
+SDict begin 18.72 H.A end
+ 1822 4554 a 1822 4554 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.13.2) cvn H.B /DEST pdfmark
+end
+ 1822
+4554 a -2 4746 a
+SDict begin H.S end
+ -2 4746 a -2 4746 a
+SDict begin 13 H.A end
+ -2 4746 a -2 4746
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1628) cvn H.B /DEST pdfmark
+end
+ -2 4746 a -2 4746 a
+SDict begin H.S end
+ -2 4746 a -2 4746 a
+SDict begin 13 H.A end
+ -2 4746 a -2
+4746 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1629) cvn H.B /DEST pdfmark
+end
+ -2 4746 a 396 4828 a FC(samhain)20 b(of)n(fers)f(se)n(v)o(eral)h
+(pre-de\002ned)d(monitoring)h(policies.)i(Each)g(of)g(these)g(policies)
+g(has)g(its)i(o)n(wn)d(section)h(in)396 4936 y(the)g(con\002guration)e
+(\002le.)j(Placing)e(a)i(\002le)g(in)f(one)g(of)g(these)g(sections)g
+(will)h(select)g(the)f(respecti)n(v)o(e)f(polic)o(y)g(for)h(that)396
+5043 y(\002le.)-2 5210 y
+SDict begin H.S end
+ -2 5210 a -2 5210 a
+SDict begin 13 H.A end
+ -2 5210
+a -2 5210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1630) cvn H.B /DEST pdfmark
+end
+ -2 5210 a 396 5317 a FC(The)g(a)n(v)n(ailable)g(policies)g
+(\(section)f(headings\))g(are:)1935 5317 y
+SDict begin H.S end
+ 1935 5317
+a 1935 5317 a
+SDict begin 13 H.A end
+ 1935 5317 a 1935 5317 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1631) cvn H.B /DEST pdfmark
+end
+ 1935 5317 a Black
+3661 5805 a Fx(41)p Black eop end
+%%Page: 42 47
+TeXDict begin 42 46 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.42) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1633) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(ReadOnly)-2 327
+y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1634) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black
+Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1635) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(All)h(modi\002cations)e(e)o(xcept)g(access)i(times)g
+(will)g(be)f(reported)e(for)i(these)g(\002les.)562 732
+y(Check)o(ed:)g(o)n(wner)m(,)e(group,)h(permissions,)g(\002le)i(type,)e
+(de)n(vice)g(number)m(,)f(hardlinks,)h(links,)h(inode,)562
+840 y(checksum,)f(size,)h(mtime,)g(ctime.)-2 1041 y
+SDict begin H.S end
+ -2
+1041 a -2 1041 a
+SDict begin 13 H.A end
+ -2 1041 a -2 1041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1638) cvn H.B /DEST pdfmark
+end
+ -2 1041 a 396 1149
+a FC(LogFiles)-2 1167 y
+SDict begin H.S end
+ -2 1167 a -2 1167 a
+SDict begin 13 H.A end
+ -2 1167 a
+-2 1167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1639) cvn H.B /DEST pdfmark
+end
+ -2 1167 a Black Black 562 1299 a
+SDict begin H.S end
+ 562 1299 a
+562 1299 a
+SDict begin 13 H.A end
+ 562 1299 a 562 1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1640) cvn H.B /DEST pdfmark
+end
+ 562 1299 a FC(Modi\002cations)f(of)h
+(timestamps,)g(\002le)h(size,)f(and)g(signature)f(will)i(be)f(ignored.)
+-2 1483 y
+SDict begin H.S end
+ -2 1483 a -2 1483 a
+SDict begin 13 H.A end
+ -2 1483 a -2 1483 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1641) cvn H.B /DEST pdfmark
+end
+ -2
+1483 a 562 1573 a FC(Check)o(ed:)g(o)n(wner)m(,)e(group,)h
+(permissions,)g(\002le)i(type,)e(de)n(vice)g(number)m(,)f(hardlinks,)h
+(links,)h(inode.)-2 1774 y
+SDict begin H.S end
+ -2 1774 a -2 1774 a
+SDict begin 13 H.A end
+ -2 1774
+a -2 1774 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1643) cvn H.B /DEST pdfmark
+end
+ -2 1774 a 396 1882 a FC(Gro)n(wingLogFiles)-2
+1900 y
+SDict begin H.S end
+ -2 1900 a -2 1900 a
+SDict begin 13 H.A end
+ -2 1900 a -2 1900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1644) cvn H.B /DEST pdfmark
+end
+ -2 1900
+a Black Black 562 2031 a
+SDict begin H.S end
+ 562 2031 a 562 2031 a
+SDict begin 13 H.A end
+ 562 2031
+a 562 2031 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1645) cvn H.B /DEST pdfmark
+end
+ 562 2031 a FC(Modi\002cations)f(of)h(timestamps,)g(and)g
+(signature)f(will)i(be)f(ignored.)e(Modi\002cation)h(of)h(the)g(\002le)
+h(size)f(will)562 2139 y(only)g(be)g(ignored)e(if)j(the)f(\002le)h
+(size)g(has)1706 2139 y
+SDict begin H.S end
+ 1706 2139 a 1706 2139 a
+SDict begin 13 H.A end
+ 1706
+2139 a 1706 2139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1646) cvn H.B /DEST pdfmark
+end
+ 1706 2139 a Fx(incr)m(eased)r FC(.)-2
+2323 y
+SDict begin H.S end
+ -2 2323 a -2 2323 a
+SDict begin 13 H.A end
+ -2 2323 a -2 2323 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1647) cvn H.B /DEST pdfmark
+end
+ -2 2323
+a 562 2413 a FC(Check)o(ed:)f(o)n(wner)m(,)e(group,)h(permissions,)g
+(\002le)i(type,)e(de)n(vice)g(number)m(,)f(hardlinks,)h(links,)h
+(inode,)f(\(size\).)-2 2615 y
+SDict begin H.S end
+ -2 2615 a -2 2615 a
+SDict begin 13 H.A end
+ -2
+2615 a -2 2615 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1649) cvn H.B /DEST pdfmark
+end
+ -2 2615 a 396 2723 a FC(Attrib)n(utes)-2
+2724 y
+SDict begin H.S end
+ -2 2724 a -2 2724 a
+SDict begin 13 H.A end
+ -2 2724 a -2 2724 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1650) cvn H.B /DEST pdfmark
+end
+ -2 2724
+a Black Black 562 2872 a
+SDict begin H.S end
+ 562 2872 a 562 2872 a
+SDict begin 13 H.A end
+ 562 2872
+a 562 2872 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1651) cvn H.B /DEST pdfmark
+end
+ 562 2872 a FC(Only)h(modi\002cations)f(of)h(o)n(wnership,)
+e(access)j(permissions,)e(and)h(de)n(vice)f(number)f(will)j(be)g(check)
+o(ed.)-2 3056 y
+SDict begin H.S end
+ -2 3056 a -2 3056 a
+SDict begin 13 H.A end
+ -2 3056 a -2 3056
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1652) cvn H.B /DEST pdfmark
+end
+ -2 3056 a 562 3146 a FC(Check)o(ed:)f(o)n(wner)m(,)e(group,)h
+(permissions,)g(\002le)i(type,)e(de)n(vice)g(number)-5
+b(.)-2 3347 y
+SDict begin H.S end
+ -2 3347 a -2 3347 a
+SDict begin 13 H.A end
+ -2 3347 a -2 3347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1654) cvn H.B /DEST pdfmark
+end
+
+-2 3347 a 396 3455 a FC(IgnoreAll)-2 3473 y
+SDict begin H.S end
+ -2 3473 a
+-2 3473 a
+SDict begin 13 H.A end
+ -2 3473 a -2 3473 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1655) cvn H.B /DEST pdfmark
+end
+ -2 3473 a Black Black 562
+3605 a
+SDict begin H.S end
+ 562 3605 a 562 3605 a
+SDict begin 13 H.A end
+ 562 3605 a 562 3605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1656) cvn H.B /DEST pdfmark
+end
+ 562
+3605 a FC(No)21 b(modi\002cations)d(will)j(be)f(reported.)f(Ho)n(we)n
+(v)o(er)m(,)f(the)2184 3605 y
+SDict begin H.S end
+ 2184 3605 a 2184 3605 a
+SDict begin 13 H.A end
+
+2184 3605 a 2184 3605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1657) cvn H.B /DEST pdfmark
+end
+ 2184 3605 a Fx(e)n(xistence)i
+FC(of)g(the)g(speci\002ed)g(\002le)h(or)f(directory)e(will)562
+3713 y(still)k(be)e(check)o(ed.)-2 3796 y
+SDict begin H.S end
+ -2 3796 a -2
+3796 a
+SDict begin 13 H.A end
+ -2 3796 a -2 3796 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1659) cvn H.B /DEST pdfmark
+end
+ -2 3796 a 396 3904 a FC(IgnoreNone)-2
+3922 y
+SDict begin H.S end
+ -2 3922 a -2 3922 a
+SDict begin 13 H.A end
+ -2 3922 a -2 3922 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1660) cvn H.B /DEST pdfmark
+end
+ -2 3922
+a Black Black 562 4053 a
+SDict begin H.S end
+ 562 4053 a 562 4053 a
+SDict begin 13 H.A end
+ 562 4053
+a 562 4053 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1661) cvn H.B /DEST pdfmark
+end
+ 562 4053 a FC(All)h(modi\002cations,)e(including)f(access)
+j(time,)f(b)n(ut)g(e)o(xcluding)e(ctime,)i(will)h(be)f(reported)f(-)h
+(checking)e(atime)562 4161 y
+SDict begin H.S end
+ 562 4161 a 562 4161 a
+SDict begin 13 H.A end
+ 562
+4161 a 562 4161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1662) cvn H.B /DEST pdfmark
+end
+ 562 4161 a Fx(and)k FC(ctime)e(w)o(ould)g(require)e
+(to)j(play)e(with)i(the)f(system)g(clock.)-2 4345 y
+SDict begin H.S end
+ -2
+4345 a -2 4345 a
+SDict begin 13 H.A end
+ -2 4345 a -2 4345 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1663) cvn H.B /DEST pdfmark
+end
+ -2 4345 a 562 4435
+a FC(Check)o(ed:)g(o)n(wner)m(,)e(group,)h(permissions,)g(\002le)i
+(type,)e(de)n(vice)g(number)m(,)f(hardlinks,)h(links,)h(inode,)562
+4543 y(checksum,)f(size,)h(mtime,)g(atime.)-2 4744 y
+SDict begin H.S end
+
+-2 4744 a -2 4744 a
+SDict begin 13 H.A end
+ -2 4744 a -2 4744 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1665) cvn H.B /DEST pdfmark
+end
+ -2 4744 a 396
+4852 a FC(User0)-2 4853 y
+SDict begin H.S end
+ -2 4853 a -2 4853 a
+SDict begin 13 H.A end
+ -2 4853
+a -2 4853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1666) cvn H.B /DEST pdfmark
+end
+ -2 4853 a Black Black 562 5002 a
+SDict begin H.S end
+ 562 5002
+a 562 5002 a
+SDict begin 13 H.A end
+ 562 5002 a 562 5002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1667) cvn H.B /DEST pdfmark
+end
+ 562 5002 a FC(Initialized)g(to:)g
+(report)f(all)i(modi\002cations.)-2 5103 y
+SDict begin H.S end
+ -2 5103 a
+-2 5103 a
+SDict begin 13 H.A end
+ -2 5103 a -2 5103 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1669) cvn H.B /DEST pdfmark
+end
+ -2 5103 a 396 5192 a FC(User1)-2
+5193 y
+SDict begin H.S end
+ -2 5193 a -2 5193 a
+SDict begin 13 H.A end
+ -2 5193 a -2 5193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1670) cvn H.B /DEST pdfmark
+end
+ -2 5193
+a Black Black 562 5342 a
+SDict begin H.S end
+ 562 5342 a 562 5342 a
+SDict begin 13 H.A end
+ 562 5342
+a 562 5342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1671) cvn H.B /DEST pdfmark
+end
+ 562 5342 a FC(Initialized)f(to:)g(report)f(all)i
+(modi\002cations.)p Black 3661 5805 a Fx(42)p Black eop
+end
+%%Page: 43 48
+TeXDict begin 43 47 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.43) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1673) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(Prelink)-2 310
+y
+SDict begin H.S end
+ -2 310 a -2 310 a
+SDict begin 13 H.A end
+ -2 310 a -2 310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1674) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black
+Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1675) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(Modi\002cations)f(of)h(timestamps,)g(size,)h(and)e
+(inode)g(will)i(be)g(ignored)d(Checksums)h(will)i(be)g(v)o(eri\002ed)e
+(by)562 566 y(calling)809 566 y
+SDict begin H.S end
+ 809 566 a 809 566 a
+SDict begin 13 H.A end
+ 809
+566 a 809 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1676) cvn H.B /DEST pdfmark
+end
+ 809 566 a Fy(/usr/sbin/pr)o(elink)j(--v)o(erify)p
+FC(.)c(This)j(polic)o(y)e(is)i(intended)e(for)g(v)o(eri\002cation)g(of)
+h(prelink)o(ed)562 674 y(e)o(x)o(ecutables/libraries)e(and/or)h
+(directories)g(containing)f(such)i(\002les.)h(F)o(or)f(details)h(and)e
+(further)562 782 y(con\002guration)f(options)h(see)p
+0 TeXcolorgray 1418 782 a
+SDict begin H.S end
+ 1418 782 a FC(Section)h(5.4.8)1856
+782 y
+SDict begin 13 H.L end
+ 1856 782 a 1856 782 a
+SDict begin [ /Subtype /Link /Dest (0:PRELINK) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1856 782 a Black -2 w FC(>.)-2
+966 y
+SDict begin H.S end
+ -2 966 a -2 966 a
+SDict begin 13 H.A end
+ -2 966 a -2 966 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1678) cvn H.B /DEST pdfmark
+end
+ -2 966 a 562
+1056 a FC(Check)o(ed:)g(o)n(wner)m(,)e(group,)h(permissions,)g(\002le)i
+(type,)e(de)n(vice)g(number)m(,)f(hardlinks,)h(links,)h(checksum.)39
+1313 y
+SDict begin H.S end
+ 39 1313 a 39 1313 a
+SDict begin 11.7 H.A end
+ 39 1313 a 39 1313 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1679) cvn H.B /DEST pdfmark
+end
+ 39 1313
+a -2 1437 a
+SDict begin H.S end
+ -2 1437 a -2 1437 a
+SDict begin 11.7 H.A end
+ -2 1437 a -2 1437 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1681) cvn H.B /DEST pdfmark
+end
+ -2
+1437 a 562 1535 a Fw(NO)m(TE:)h Fv(Each)f(policy)f(can)i(be)e
+(modi\002ed)h(in)f(the)h(con\002g)g(\002le)g(section)2561
+1535 y
+SDict begin H.S end
+ 2561 1535 a 2561 1535 a
+SDict begin 11.7 H.A end
+ 2561 1535 a 2561 1535
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1682) cvn H.B /DEST pdfmark
+end
+ 2561 1535 a Fq(Misc)25 b Fv(with)20 b(entr)q(ies)f(lik)o(e)562
+1632 y
+SDict begin H.S end
+ 562 1632 a 562 1632 a
+SDict begin 11.7 H.A end
+ 562 1632 a 562 1632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1683) cvn H.B /DEST pdfmark
+end
+ 562
+1632 a Fw(RedefReadOnl)o(y=)1165 1632 y
+SDict begin H.S end
+ 1165 1632 a 1165
+1632 a
+SDict begin 11.7 H.A end
+ 1165 1632 a 1165 1632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1684) cvn H.B /DEST pdfmark
+end
+ 1165 1632 a Fm(+XXX)24
+b Fv(or)1437 1632 y
+SDict begin H.S end
+ 1437 1632 a 1437 1632 a
+SDict begin 11.7 H.A end
+ 1437 1632
+a 1437 1632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1685) cvn H.B /DEST pdfmark
+end
+ 1437 1632 a Fw(RedefReadOnl)o(y=)2040 1632
+y
+SDict begin H.S end
+ 2040 1632 a 2040 1632 a
+SDict begin 11.7 H.A end
+ 2040 1632 a 2040 1632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1686) cvn H.B /DEST pdfmark
+end
+ 2040
+1632 a Fm(-XXX)g Fv(to)c(add)f(\(+XXX\))h(or)g(remo)o(v)n(e)g(\(-XXX\))
+g(a)g(test)g(XXX,)562 1729 y(where)g(XXX)g(can)g(be)g(an)o(y)g(of)g
+(CHK)h(\(chec)o(ksum\),)f(LNK)g(\(link\),)f(HLN)h(\(hardlink\),)e(INO)j
+(\(inode\),)d(USR)i(\(user\),)562 1826 y(GRP)h(\(g)o(roup\),)e(MTM)i
+(\(mtime\),)e(A)-9 b(TM)21 b(\(atime\),)e(CTM)h(\(ctime\),)g(SIZ)g
+(\(siz)o(e\),)g(RDEV)h(\(de)n(vice)e(n)o(umbers\))562
+1923 y(and/or)g(MOD)i(\(\002le)f(mode\).)-2 1980 y
+SDict begin H.S end
+ -2
+1980 a -2 1980 a
+SDict begin 11.7 H.A end
+ -2 1980 a -2 1980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1687) cvn H.B /DEST pdfmark
+end
+ -2 1980 a -2 1980
+a
+SDict begin H.S end
+ -2 1980 a -2 1980 a
+SDict begin 11.7 H.A end
+ -2 1980 a -2 1980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1688) cvn H.B /DEST pdfmark
+end
+ -2 1980 a 562
+2062 a Fq(This)g(m)o(ust)h(come)g(bef)n(ore)d(an)o(y)i(\002le)g
+(policies)f(are)h(used)g(in)g(the)f(con\002g)h(\002le)o(.)-2
+2294 y
+SDict begin H.S end
+ -2 2294 a -2 2294 a
+SDict begin 13 H.A end
+ -2 2294 a -2 2294 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:FILE-SPECIFICATION) cvn H.B
+/DEST pdfmark end
+ -2 2294
+a 396 2622 a Fp(5.4.2.)36 b(File/director)q(y)f(speci\002cation)2242
+2622 y
+SDict begin H.S end
+ 2242 2622 a 2242 2622 a
+SDict begin 18.72 H.A end
+ 2242 2622 a 2242 2622
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.14.2) cvn H.B /DEST pdfmark
+end
+ 2242 2622 a -2 2813 a
+SDict begin H.S end
+ -2 2813 a -2 2813 a
+SDict begin 13 H.A end
+ -2 2813 a
+-2 2813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1691) cvn H.B /DEST pdfmark
+end
+ -2 2813 a 396 2896 a FC(Entries)20 b(for)g(\002les)h(ha)n(v)o
+(e)f(the)g(follo)n(wing)e(syntax:)-2 3080 y
+SDict begin H.S end
+ -2 3080 a
+-2 3080 a
+SDict begin 13 H.A end
+ -2 3080 a -2 3080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1692) cvn H.B /DEST pdfmark
+end
+ -2 3080 a -2 3080 a
+SDict begin H.S end
+ -2
+3080 a -2 3080 a
+SDict begin 13 H.A end
+ -2 3080 a -2 3080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1693) cvn H.B /DEST pdfmark
+end
+ -2 3080 a 396 3170
+a Fy(\002le=)549 3170 y
+SDict begin H.S end
+ 549 3170 a 549 3170 a
+SDict begin 13 H.A end
+ 549 3170
+a 549 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1694) cvn H.B /DEST pdfmark
+end
+ 549 3170 a Fl(/full/path/to/the/file)-2
+3346 y
+SDict begin H.S end
+ -2 3346 a -2 3346 a
+SDict begin 13 H.A end
+ -2 3346 a -2 3346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1695) cvn H.B /DEST pdfmark
+end
+ -2 3346
+a 396 3444 a FC(Entries)i(for)g(directories)f(ha)n(v)o(e)h(the)g(follo)
+n(wing)e(syntax:)-2 3628 y
+SDict begin H.S end
+ -2 3628 a -2 3628 a
+SDict begin 13 H.A end
+ -2 3628
+a -2 3628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1696) cvn H.B /DEST pdfmark
+end
+ -2 3628 a -2 3628 a
+SDict begin H.S end
+ -2 3628 a -2 3628 a
+SDict begin 13 H.A end
+ -2
+3628 a -2 3628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1697) cvn H.B /DEST pdfmark
+end
+ -2 3628 a 396 3718 a Fy(dir=)549 3718
+y
+SDict begin H.S end
+ 549 3718 a 549 3718 a
+SDict begin 13 H.A end
+ 549 3718 a 549 3718 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1698) cvn H.B /DEST pdfmark
+end
+ 549 3718
+a Fl([recursion)44 b(depth]/full/path/to/the/dir)-2 3894
+y
+SDict begin H.S end
+ -2 3894 a -2 3894 a
+SDict begin 13 H.A end
+ -2 3894 a -2 3894 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1699) cvn H.B /DEST pdfmark
+end
+ -2 3894 a 396
+3992 a FC(The)20 b(speci\002cation)g(of)f(a)i(\(numerical\))d
+(recursion)h(depth)g(is)i(optional)e(\(see)p 0 TeXcolorgray
+2600 3992 a
+SDict begin H.S end
+ 2600 3992 a FC(Section)h(5.4.5)3038 3992
+y
+SDict begin 13 H.L end
+ 3038 3992 a 3038 3992 a
+SDict begin [ /Subtype /Link /Dest (0:RECDEP) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3038 3992 a Black -2 w FC(>\).)g(\(Do)g(not)g
+(put)g(the)396 4100 y(recursion)f(depth)g(in)i(brack)o(ets)e(--)h(the)o
+(y)g(just)g(indicate)g(that)g(this)h(is)g(an)f(optional)f(ar)o(gument)f
+(...\).)-2 4284 y
+SDict begin H.S end
+ -2 4284 a -2 4284 a
+SDict begin 13 H.A end
+ -2 4284 a -2 4284
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1701) cvn H.B /DEST pdfmark
+end
+ -2 4284 a 396 4374 a FC(W)m(ildcard)i(patterns)f(\('*',)g('?',)h
+('[...]'\))e(as)j(in)f(shell)h(globbing)d(are)i(supported)e(for)i
+(paths.)g(The)f(leading)h('/')g(is)396 4482 y(mandatory)-5
+b(.)-2 4500 y
+SDict begin H.S end
+ -2 4500 a -2 4500 a
+SDict begin 11.7 H.A end
+ -2 4500 a -2 4500 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1702) cvn H.B /DEST pdfmark
+end
+
+-2 4500 a -2 4624 a
+SDict begin H.S end
+ -2 4624 a -2 4624 a
+SDict begin 11.7 H.A end
+ -2 4624 a -2
+4624 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1704) cvn H.B /DEST pdfmark
+end
+ -2 4624 a 562 4704 a Fw(Note)20 b(on)g(directories:)e
+Fv(A)i(director)r(y)g(is)h(\(a\))f(a)g(collection)e(of)i(\002les)o(,)h
+(with)e(\(b\))h(a)h(director)r(y)e(special)g(\002le)i(where)562
+4801 y(a)f(listing)f(of)h(all)f(\002les)h(in)g(the)f(director)q(ies)g
+(is)h(k)o(ept.)f(This)h(director)r(y)f(special)g(\002le)h(will)f(be)h
+(modi\002ed)f(in)h(case)g(of)g(a)562 4898 y(\002le)h(addition,)c(remo)o
+(v)n(al,)i(or)h(renaming.)e(Depending)f(on)j(the)g(chosen)f(policy)-7
+b(,)20 b(samhain)f(will)g(repor)s(t)g(on)h(such)562 4995
+y(modi\002cations)f(of)h(the)g(director)r(y)f(special)h(\002le)o(.)-2
+5052 y
+SDict begin H.S end
+ -2 5052 a -2 5052 a
+SDict begin 11.7 H.A end
+ -2 5052 a -2 5052 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1705) cvn H.B /DEST pdfmark
+end
+ -2 5052
+a 562 5134 a Fv(The)g(addition)d(and/or)i(deletion)e(of)j(\002les)h
+(from)f(a)h(director)r(y)e(modi\002es)h(the)g(director)r(y)f(special)g
+(\002le)562 5231 y(\(mtime/ctime\).)g(The)h(addition/deletio)o(n)15
+b(of)20 b(subdirector)q(ies)e(will)h(also)h(modify)g(the)f(n)o(umber)h
+(of)g(hardlinks)f(of)562 5328 y(the)h(director)r(y)f(special)h(\002le)o
+(.)g(A)g(modi\002cation)f(of)h(a)g(\002le)2137 5328 y
+SDict begin H.S end
+
+2137 5328 a 2137 5328 a
+SDict begin 11.7 H.A end
+ 2137 5328 a 2137 5328 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1706) cvn H.B /DEST pdfmark
+end
+ 2137
+5328 a Fq(ma)n(y)28 b Fv(modify)20 b(a)h(director)r(y)e(special)g
+(\002le)p Black 3661 5805 a Fx(43)p Black eop end
+%%Page: 44 49
+TeXDict begin 44 48 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.44) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 562 309 a Fv(\(mtime/ctime\),)f(if)h(this)g
+(modi\002cation)f(is)i(done)d(b)o(y)j(\002rst)g(creating)d(of)i(a)h
+(tempor)o(ar)r(y)e(\002le)o(,)h(f)n(ollo)o(w)o(ed)e(b)o(y)562
+406 y(renaming)h(this)h(tempor)o(ar)r(y)f(\002le)h(to)g(the)g(or)q
+(iginal)e(one)o(.)39 555 y
+SDict begin H.S end
+ 39 555 a 39 555 a
+SDict begin 13 H.A end
+ 39 555 a
+39 555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:POLRULES) cvn H.B /DEST pdfmark
+end
+ 39 555 a 396 851 a Fj(5.4.2.1.)28 b(Rules)1027
+851 y
+SDict begin H.S end
+ 1027 851 a 1027 851 a
+SDict begin 15.6 H.A end
+ 1027 851 a 1027 851 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.14.5.3) cvn H.B /DEST pdfmark
+end
+ 1027
+851 a -2 852 a
+SDict begin H.S end
+ -2 852 a -2 852 a
+SDict begin 13 H.A end
+ -2 852 a -2 852 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1709) cvn H.B /DEST pdfmark
+end
+ -2
+852 a -2 872 a
+SDict begin H.S end
+ -2 872 a -2 872 a
+SDict begin 13 H.A end
+ -2 872 a -2 872 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1710) cvn H.B /DEST pdfmark
+end
+ -2
+872 a Black 463 1040 a FC(1.)p Black 546 1040 a
+SDict begin H.S end
+ 546 1040
+a 546 1040 a
+SDict begin 13 H.A end
+ 546 1040 a 546 1040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1711) cvn H.B /DEST pdfmark
+end
+ 546 1040 a FC(F)o(or)20
+b(the)g(\002le)h(check,)e(samhain)g(does)h(not)g(follo)n(w)f(symlinks.)
+h(If)g(the)g(ar)o(gument)e(for)h(a)i(\002le=...)f(directi)n(v)o(e)f(is)
+i(a)546 1148 y(symlink,)e(then)h(the)g(symlink)f(itself)i(is)g(check)o
+(ed,)e(not)g(the)i(location)e(it)i(points)f(to.)-2 1166
+y
+SDict begin H.S end
+ -2 1166 a -2 1166 a
+SDict begin 13 H.A end
+ -2 1166 a -2 1166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1712) cvn H.B /DEST pdfmark
+end
+ -2 1166 a Black
+463 1297 a FC(2.)p Black 546 1297 a
+SDict begin H.S end
+ 546 1297 a 546 1297
+a
+SDict begin 13 H.A end
+ 546 1297 a 546 1297 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1713) cvn H.B /DEST pdfmark
+end
+ 546 1297 a FC(The)g(ar)o(gument)d(for)j(a)h
+(dir=...)e(directi)n(v)o(e)g(must)h(be)g(a)2073 1297
+y
+SDict begin H.S end
+ 2073 1297 a 2073 1297 a
+SDict begin 13 H.A end
+ 2073 1297 a 2073 1297 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1714) cvn H.B /DEST pdfmark
+end
+ 2073
+1297 a Fx(dir)m(ectory)p FC(.)f(Using)h(a)h(symlink)e(to)i(a)f
+(directory)f(as)546 1405 y(ar)o(gument)f(is)j(incorrect.)-2
+1423 y
+SDict begin H.S end
+ -2 1423 a -2 1423 a
+SDict begin 13 H.A end
+ -2 1423 a -2 1423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1715) cvn H.B /DEST pdfmark
+end
+ -2 1423
+a Black 463 1555 a FC(3.)p Black 546 1555 a
+SDict begin H.S end
+ 546 1555
+a 546 1555 a
+SDict begin 13 H.A end
+ 546 1555 a 546 1555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1716) cvn H.B /DEST pdfmark
+end
+ 546 1555 a FC(Precedence)d(is)k(gi)n
+(v)o(en)c(to)j(the)f(most)g(speci\002c)h(location)e(in)h(the)g
+(\002lesystem.)h(I.e.,)2929 1555 y
+SDict begin H.S end
+ 2929 1555 a 2929 1555
+a
+SDict begin 13 H.A end
+ 2929 1555 a 2929 1555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1717) cvn H.B /DEST pdfmark
+end
+ 2929 1555 a -2 1573 a
+SDict begin H.S end
+ -2 1573
+a -2 1573 a
+SDict begin 13 H.A end
+ -2 1573 a -2 1573 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1718) cvn H.B /DEST pdfmark
+end
+ -2 1573 a Black 546 1704
+a FB(\225)p Black 629 1704 a
+SDict begin H.S end
+ 629 1704 a 629 1704 a
+SDict begin 13 H.A end
+ 629
+1704 a 629 1704 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1719) cvn H.B /DEST pdfmark
+end
+ 629 1704 a FC(a)f(polic)o(y)f(for)h(a)h(speci\002c)f
+(\002le)h(o)o(v)o(errides)d(the)i(polic)o(y)f(for)h(its)h(directory)-2
+1722 y
+SDict begin H.S end
+ -2 1722 a -2 1722 a
+SDict begin 13 H.A end
+ -2 1722 a -2 1722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1720) cvn H.B /DEST pdfmark
+end
+ -2 1722
+a Black 546 1854 a FB(\225)p Black 629 1854 a
+SDict begin H.S end
+ 629 1854
+a 629 1854 a
+SDict begin 13 H.A end
+ 629 1854 a 629 1854 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1721) cvn H.B /DEST pdfmark
+end
+ 629 1854 a FC(a)f(polic)o(y)f(for)h
+(a)h(subdirectory)c(o)o(v)o(errides)i(the)h(polic)o(y)f(for)g(its)j
+(parent)d(directory)-2 1913 y
+SDict begin H.S end
+ -2 1913 a -2 1913 a
+SDict begin 13 H.A end
+ -2
+1913 a -2 1913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1722) cvn H.B /DEST pdfmark
+end
+ -2 1913 a Black 463 2045 a FC(4.)p Black
+546 2045 a
+SDict begin H.S end
+ 546 2045 a 546 2045 a
+SDict begin 13 H.A end
+ 546 2045 a 546 2045
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1723) cvn H.B /DEST pdfmark
+end
+ 546 2045 a FC(Checking)g(a)h(directory)f(with)h(dir=...)f(will)i
+(check)f(both)f(the)2308 2045 y
+SDict begin H.S end
+ 2308 2045 a 2308 2045
+a
+SDict begin 13 H.A end
+ 2308 2045 a 2308 2045 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1724) cvn H.B /DEST pdfmark
+end
+ 2308 2045 a Fx(content)g(of)i(the)f(dir)m
+(ectory)g FC(as)h(well)f(as)h(the)546 2153 y
+SDict begin H.S end
+ 546 2153
+a 546 2153 a
+SDict begin 13 H.A end
+ 546 2153 a 546 2153 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1725) cvn H.B /DEST pdfmark
+end
+ 546 2153 a Fx(dir)m(ectory)f
+(special)g(\002le)g FC(itself)-2 2170 y
+SDict begin H.S end
+ -2 2170 a -2
+2170 a
+SDict begin 13 H.A end
+ -2 2170 a -2 2170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1726) cvn H.B /DEST pdfmark
+end
+ -2 2170 a Black 463 2302 a
+FC(5.)p Black 546 2302 a
+SDict begin H.S end
+ 546 2302 a 546 2302 a
+SDict begin 13 H.A end
+ 546 2302
+a 546 2302 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1727) cvn H.B /DEST pdfmark
+end
+ 546 2302 a FC(Using)g(a)g(directory)f(as)i(ar)o(gument)d
+(for)h(both)h(a)g(\002le=...)g(and)g(a)g(dir=...)f(directi)n(v)o(e)g
+(will)i(ha)n(v)o(e)f(the)g(ef)n(fect)g(that)546 2410
+y(the)g(\002le=...)g(directi)n(v)o(e)f(will)i(o)o(v)o(erride)d(the)i
+(dir=...)f(directi)n(v)o(e)g(for)g(the)i(directory)d(special)i(\002le,)
+h(while)f(the)546 2518 y(dir=...)f(directi)n(v)o(e)g(remains)g(in)i(ef)
+n(fect)e(for)h(the)g(directory)f(content.)-2 2660 y
+SDict begin H.S end
+ -2
+2660 a -2 2660 a
+SDict begin 13 H.A end
+ -2 2660 a -2 2660 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUPPRESS) cvn H.B /DEST pdfmark
+end
+ -2 2660 a 396 2971
+a Fp(5.4.3.)36 b(Suppress)e(messa)o(g)q(es)i(about)e(ne)n(w/deleted)h
+(\002les)3230 2971 y
+SDict begin H.S end
+ 3230 2971 a 3230 2971 a
+SDict begin 18.72 H.A end
+ 3230 2971
+a 3230 2971 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.15.2) cvn H.B /DEST pdfmark
+end
+ 3230 2971 a -2 3163 a
+SDict begin H.S end
+ -2 3163 a -2 3163
+a
+SDict begin 13 H.A end
+ -2 3163 a -2 3163 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1730) cvn H.B /DEST pdfmark
+end
+ -2 3163 a 396 3245 a FC(If)20 b(you)g(w)o(ant)g
+(to)g(suppress)g(messages)g(about)f(the)i(creation)e(of)h(certain)f
+(\002les)j(\(e.g.)d(rotated)g(log)h(\002les\),)h(you)e(can)396
+3352 y(use)i(the)f(options)915 3352 y
+SDict begin H.S end
+ 915 3352 a 915
+3352 a
+SDict begin 13 H.A end
+ 915 3352 a 915 3352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1731) cvn H.B /DEST pdfmark
+end
+ 915 3352 a Fy(Ignor)o(eAdded=)1432
+3352 y
+SDict begin H.S end
+ 1432 3352 a 1432 3352 a
+SDict begin 13 H.A end
+ 1432 3352 a 1432 3352
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1732) cvn H.B /DEST pdfmark
+end
+ 1432 3352 a Fl(/fullpath/with_some_regex_inside)15
+b FC(and/or)396 3460 y
+SDict begin H.S end
+ 396 3460 a 396 3460 a
+SDict begin 13 H.A end
+ 396 3460
+a 396 3460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1733) cvn H.B /DEST pdfmark
+end
+ 396 3460 a Fy(Ignor)o(eMissing=)954 3460
+y
+SDict begin H.S end
+ 954 3460 a 954 3460 a
+SDict begin 13 H.A end
+ 954 3460 a 954 3460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1734) cvn H.B /DEST pdfmark
+end
+ 954 3460
+a Fl(/fullpath/with_some_regex_inside)h FC(\(to)k(be)g(placed)f(in)i
+(the)f([Misc])g(section)g(of)396 3568 y(the)g(con\002guration)e
+(\002les.)j(If)f(you)f(w)o(ant)i(to)f(add)g(more)f(re)o(gular)g(e)o
+(xpressions,)f(you)h(can)h(use)h(these)f(options)396
+3676 y(multiple)g(times.)-2 3694 y
+SDict begin H.S end
+ -2 3694 a -2 3694
+a
+SDict begin 11.7 H.A end
+ -2 3694 a -2 3694 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1735) cvn H.B /DEST pdfmark
+end
+ -2 3694 a -2 3819 a
+SDict begin H.S end
+ -2 3819 a -2
+3819 a
+SDict begin 11.7 H.A end
+ -2 3819 a -2 3819 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1737) cvn H.B /DEST pdfmark
+end
+ -2 3819 a 562 3898 a Fw(Note:)g
+Fv(The)f(argument)g(to)1343 3898 y
+SDict begin H.S end
+ 1343 3898 a 1343 3898
+a
+SDict begin 11.7 H.A end
+ 1343 3898 a 1343 3898 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1738) cvn H.B /DEST pdfmark
+end
+ 1343 3898 a Fw(IgnoreAd)o(ded)f
+Fv(and)1969 3898 y
+SDict begin H.S end
+ 1969 3898 a 1969 3898 a
+SDict begin 11.7 H.A end
+ 1969 3898
+a 1969 3898 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1739) cvn H.B /DEST pdfmark
+end
+ 1969 3898 a Fw(IgnoreMissing)f Fv(m)o(ust)k(be)f(a)h
+(regular)d(e)n(xpression)h(that)562 3995 y(matches)h(the)g(full)f
+(path.T)-9 b(o)19 b(test)h(y)o(our)f(rege)n(x)h(bef)n(ore)e(putting)g
+(in)i(samhain,)f(y)o(ou)h(do)g(something)e(lik)o(e)h(this:)-2
+4095 y
+SDict begin H.S end
+ -2 4095 a -2 4095 a
+SDict begin 10.53 H.A end
+ -2 4095 a -2 4095 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1740) cvn H.B /DEST pdfmark
+end
+ -2 4095
+a 562 4165 a Ft(#)41 b(This)h(regex)g(matches)h(all)e(files)h(added)g
+(by)f(logrotate)j(\(e.g:)e(messages.1)i(or)d(messages.2.gz,)k(etc.\))
+562 4253 y(cd)c(/var/log)562 4340 y(for)h(file)f(in)g(*;)h(do)f(echo)g
+($file|)i(egrep)f("\(cron|ksyms|maillog)q(|m)q(ess)q(age)q(s|r)q(pmp)q
+(kgs)q(|se)q(cu)q(re|)q(spo)q(ole)q(r|u)q(p2d)q(ate)q(|wm)q(tp)q(\)\\.)
+q([0-)q(9]\()q(\\.g)q(z\)?)q($")47 b(;)41 b(done)-2 4440
+y
+SDict begin H.S end
+ -2 4440 a -2 4440 a
+SDict begin 11.7 H.A end
+ -2 4440 a -2 4440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1741) cvn H.B /DEST pdfmark
+end
+ -2 4440 a 562
+4520 a Fv(Once)21 b(it')l(s)f(w)o(or)q(k)h(this)f(w)o(a)n(y)-7
+b(,)19 b(y)o(ou)h(can)g(add)g(it)g(to)g(y)o(our)g(samhainrc)f(\002le)o
+(,)h(b)o(ut)f(don't)g(f)n(orget)f(to)i(add)g(the)g(full)f(path.)562
+4618 y(e)o(.g:)-2 4717 y
+SDict begin H.S end
+ -2 4717 a -2 4717 a
+SDict begin 10.53 H.A end
+ -2 4717
+a -2 4717 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1742) cvn H.B /DEST pdfmark
+end
+ -2 4717 a 562 4788 a Ft(IgnoreAdded)44 b(=)d
+(/var/log/\(cron|ksym)q(s|)q(mai)q(llo)q(g|m)q(ess)q(age)q(s|r)q(pmp)q
+(kg)q(s|s)q(ecu)q(re|)q(spo)q(ole)q(r|u)q(p2)q(dat)q(e|w)q(mtp)q(\)\\.)
+q([0-)q(9]\()q(\\.g)q(z\))q(?$)-2 4888 y
+SDict begin H.S end
+ -2 4888 a -2
+4888 a
+SDict begin 11.7 H.A end
+ -2 4888 a -2 4888 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1743) cvn H.B /DEST pdfmark
+end
+ -2 4888 a 562 4968 a Fv(This)20
+b(tip)g(has)g(been)f(pro)o(vided)f(b)o(y)i(jim)h(at)f(aegis)f(h)n
+(yphen)g(cor)r(p)h(dot)g(org.)39 5107 y
+SDict begin H.S end
+ 39 5107 a 39
+5107 a
+SDict begin 11.7 H.A end
+ 39 5107 a 39 5107 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1744) cvn H.B /DEST pdfmark
+end
+ 39 5107 a Black 3661 5805
+a Fx(44)p Black eop end
+%%Page: 45 50
+TeXDict begin 45 49 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.45) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1746) cvn H.B /DEST pdfmark
+end
+ -2 226 a 562 309 a Fw(Alternative:)e
+Fv(If)i(a)h(director)r(y)e(is)i(added)d(to)j([Attr)q(ib)o(utes])c(as)k
+(a)f(\002le=/dir)l(,)f(then)g(only)h(the)f(director)r(y)h(special)f
+(\002le)562 406 y(is)i(monitored)d(f)n(or)i(per)r(missions/o)o
+(wnership)m(.)c(The)k(adv)n(antage)e(is)i(that)g(additions/remo)o(v)n
+(als)c(of)k(\002les)h(to)f(that)562 503 y(subdirector)r(y)f(can)h
+(happen)e(without)h(recourse)o(,)g(b)o(ut)g(the)h(integ)o(r)q(ity)f(of)
+h(that)f(director)r(y)h(is)g(def)n(ended.)562 600 y(Assuming)g(the)g
+(administr)o(ator)e(doesn't)g(w)o(ant)i(to)g(get)f(g)o(r)o(an)o(ular)g
+(le)n(v)n(el)g(of)h(detail.)-2 658 y
+SDict begin H.S end
+ -2 658 a -2 658
+a
+SDict begin 11.7 H.A end
+ -2 658 a -2 658 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1747) cvn H.B /DEST pdfmark
+end
+ -2 658 a 562 739 a Fv(Good)g(f)n(or)g(such)g
+(director)q(ies)f(as:)1537 739 y
+SDict begin H.S end
+ 1537 739 a 1537 739
+a
+SDict begin 11.7 H.A end
+ 1537 739 a 1537 739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1748) cvn H.B /DEST pdfmark
+end
+ 1537 739 a Ft(/var/mail)1921
+739 y
+SDict begin H.S end
+ 1921 739 a 1921 739 a
+SDict begin 11.7 H.A end
+ 1921 739 a 1921 739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1749) cvn H.B /DEST pdfmark
+end
+ 1921
+739 a Ft(/var/cron/tabs)2507 739 y
+SDict begin H.S end
+ 2507 739 a 2507 739
+a
+SDict begin 11.7 H.A end
+ 2507 739 a 2507 739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1750) cvn H.B /DEST pdfmark
+end
+ 2507 739 a Ft(/var/tmp)2850 739
+y
+SDict begin H.S end
+ 2850 739 a 2850 739 a
+SDict begin 11.7 H.A end
+ 2850 739 a 2850 739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1751) cvn H.B /DEST pdfmark
+end
+ 2850 739
+a Ft(/tmp)-2 791 y
+SDict begin H.S end
+ -2 791 a -2 791 a
+SDict begin 11.7 H.A end
+ -2 791 a -2 791
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1752) cvn H.B /DEST pdfmark
+end
+ -2 791 a 562 877 a Fv(This)h(tip)g(has)g(been)f(pro)o(vided)f(b)o(y)i
+(Br)q(ian)g(A.)g(Seklec)o(ki)-2 1110 y
+SDict begin H.S end
+ -2 1110 a -2 1110
+a
+SDict begin 13 H.A end
+ -2 1110 a -2 1110 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DYNUP) cvn H.B /DEST pdfmark
+end
+ -2 1110 a 396 1438 a Fp(5.4.4.)36
+b(Dynamic)f(database)h(update)396 1593 y(\(modi\002ed/disappeared/ne)n
+(w)i(\002les\))2247 1593 y
+SDict begin H.S end
+ 2247 1593 a 2247 1593 a
+SDict begin 18.72 H.A end
+ 2247
+1593 a 2247 1593 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.16.2) cvn H.B /DEST pdfmark
+end
+ 2247 1593 a -2 1784 a
+SDict begin H.S end
+ -2 1784 a -2
+1784 a
+SDict begin 13 H.A end
+ -2 1784 a -2 1784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1755) cvn H.B /DEST pdfmark
+end
+ -2 1784 a -2 1784 a
+SDict begin H.S end
+ -2 1784
+a -2 1784 a
+SDict begin 13 H.A end
+ -2 1784 a -2 1784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1756) cvn H.B /DEST pdfmark
+end
+ -2 1784 a 396 1867 a
+FC(samhain)20 b(reads)g(the)g(\002le)h(signature)e(database)g(at)i
+(startup)f(and)f(creates)i(an)f(in-memory)e(cop)o(y)-5
+b(.)18 b(This)j(in-memory)396 1975 y(cop)o(y)f(is)h(then)e(dynamically)
+g(updated)f(to)j(re\003ect)f(changes)f(in)h(the)h(\002le)f(system.)-2
+2159 y
+SDict begin H.S end
+ -2 2159 a -2 2159 a
+SDict begin 13 H.A end
+ -2 2159 a -2 2159 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1757) cvn H.B /DEST pdfmark
+end
+ -2 2159
+a 396 2249 a FC(I.e.)g(for)g(each)f(modi\002ed/disappeared/ne)n(w)d
+(\002le)21 b(you)e(will)i(recei)n(v)o(e)f(an)g(alarm,)f(then)h(the)g
+(in-memory)e(cop)o(y)h(of)396 2357 y(the)h(\002le)h(signature)e
+(database)h(is)h(updated,)e(and)g(you)g(will)i(only)f(recei)n(v)o(e)f
+(another)g(alarm)g(for)h(that)g(\002le)h(if)g(it)f(is)396
+2465 y(modi\002ed)f(again)g(\(or)h(disappears/appears)e(again\).)-2
+2649 y
+SDict begin H.S end
+ -2 2649 a -2 2649 a
+SDict begin 13 H.A end
+ -2 2649 a -2 2649 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1758) cvn H.B /DEST pdfmark
+end
+ -2 2649
+a 396 2739 a FC(Note)i(that)h(the)f(on-disk)f(\002le)i(signature)e
+(database)g(is)1950 2739 y
+SDict begin H.S end
+ 1950 2739 a 1950 2739 a
+SDict begin 13 H.A end
+ 1950
+2739 a 1950 2739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1759) cvn H.B /DEST pdfmark
+end
+ 1950 2739 a Fx(not)j FC(updated)c(\(if)i(you)g(ha)n
+(v)o(e)f(signed)h(it,)h(the)f(daemon)e(could)396 2847
+y(not)i(do)g(that)g(an)o(yw)o(ay\).)e(Ho)n(we)n(v)o(er)m(,)h(as)h(long)
+g(as)h(the)f(machine)f(is)i(not)f(rebooted,)e(there)i(should)f(be)h(no)
+g(need)f(to)396 2955 y(update)g(the)i(on-disk)d(\002le)j(signature)e
+(database.)-2 3139 y
+SDict begin H.S end
+ -2 3139 a -2 3139 a
+SDict begin 13 H.A end
+ -2 3139 a -2
+3139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1760) cvn H.B /DEST pdfmark
+end
+ -2 3139 a 396 3229 a FC(If)h(\002les)h(disappear)e(after)h
+(initialization,)f(you)h(will)h(get)f(an)g(error)f(message)h(with)g
+(the)h(se)n(v)o(erity)e(speci\002ed)h(for)f(\002le)396
+3337 y(access)i(errors)e(\()871 3337 y
+SDict begin H.S end
+ 871 3337 a 871
+3337 a
+SDict begin 13 H.A end
+ 871 3337 a 871 3337 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1761) cvn H.B /DEST pdfmark
+end
+ 871 3337 a Fx(e)n(xcept)j
+FC(if)e(the)g(\002le)h(is)g(placed)f(under)f(the)2070
+3337 y
+SDict begin H.S end
+ 2070 3337 a 2070 3337 a
+SDict begin 13 H.A end
+ 2070 3337 a 2070 3337
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1762) cvn H.B /DEST pdfmark
+end
+ 2070 3337 a Fx(Ignor)m(eAll)g FC(polic)o(y)-5 b(,)18
+b(in)j(which)e(case)i(a)f(message)g(of)396 3445 y
+SDict begin H.S end
+ 396
+3445 a 396 3445 a
+SDict begin 13 H.A end
+ 396 3445 a 396 3445 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1763) cvn H.B /DEST pdfmark
+end
+ 396 3445 a Fx(Se)o(verityIgnor)
+m(eAll)e FC(\227)j(see)p 0 TeXcolorgray 1229 3445 a
+SDict begin H.S end
+ 1229
+3445 a FC(Section)f(4.1.1)1667 3445 y
+SDict begin 13 H.L end
+ 1667 3445 a 1667
+3445 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1667 3445 a Black -2 w FC(>)g(\227)h(is)g(generated\).)-2
+3629 y
+SDict begin H.S end
+ -2 3629 a -2 3629 a
+SDict begin 13 H.A end
+ -2 3629 a -2 3629 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1765) cvn H.B /DEST pdfmark
+end
+ -2 3629
+a 396 3719 a FC(If)f(ne)n(w)g(\002les)h(appear)e(in)i(a)f(monitored)e
+(directory)h(after)h(initialization,)f(you)g(will)i(get)f(an)h(error)e
+(message)h(with)396 3827 y(the)g(se)n(v)o(erity)g(speci\002ed)g(for)f
+(that)h(directory')-5 b(s)19 b(\002le)i(polic)o(y)e(\()2135
+3827 y
+SDict begin H.S end
+ 2135 3827 a 2135 3827 a
+SDict begin 13 H.A end
+ 2135 3827 a 2135 3827
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1766) cvn H.B /DEST pdfmark
+end
+ 2135 3827 a Fx(e)n(xcept)j FC(if)e(the)g(\002le)h(is)g(placed)f
+(under)e(the)3334 3827 y
+SDict begin H.S end
+ 3334 3827 a 3334 3827 a
+SDict begin 13 H.A end
+ 3334
+3827 a 3334 3827 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1767) cvn H.B /DEST pdfmark
+end
+ 3334 3827 a Fx(Ignor)m(eAll)396 3935
+y FC(polic)o(y)-5 b(,)19 b(in)h(which)g(case)g(a)h(message)f(of)1561
+3935 y
+SDict begin H.S end
+ 1561 3935 a 1561 3935 a
+SDict begin 13 H.A end
+ 1561 3935 a 1561 3935
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1768) cvn H.B /DEST pdfmark
+end
+ 1561 3935 a Fx(Se)o(verityIgnor)m(eAll)e FC(\227)j(see)p
+0 TeXcolorgray 2394 3935 a
+SDict begin H.S end
+ 2394 3935 a FC(Section)e(4.1.1)2831
+3935 y
+SDict begin 13 H.L end
+ 2831 3935 a 2831 3935 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2831 3935 a Black -2 w
+FC(>)i(\227)g(is)g(generated\).)-2 4119 y
+SDict begin H.S end
+ -2 4119 a -2
+4119 a
+SDict begin 13 H.A end
+ -2 4119 a -2 4119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1770) cvn H.B /DEST pdfmark
+end
+ -2 4119 a 396 4209 a FC(The)f(special)g
+(treatment)g(of)g(\002les)h(under)e(the)1713 4209 y
+SDict begin H.S end
+ 1713
+4209 a 1713 4209 a
+SDict begin 13 H.A end
+ 1713 4209 a 1713 4209 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1771) cvn H.B /DEST pdfmark
+end
+ 1713 4209
+a Fx(Ignor)m(eAll)g FC(polic)o(y)g(allo)n(ws)h(to)h(handle)e(cases)i
+(where)e(a)i(\002le)g(might)e(be)396 4317 y(deleted)h(and/or)f
+(recreated)g(by)g(the)i(system)f(more)f(or)h(less)i(frequently)-5
+b(.)-2 4345 y
+SDict begin H.S end
+ -2 4345 a -2 4345 a
+SDict begin 13 H.A end
+ -2 4345 a -2 4345 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:RECDEP) cvn H.B /DEST pdfmark
+end
+
+-2 4345 a 396 4655 a Fp(5.4.5.)36 b(Recur)n(sion)f(depth\(s\))1816
+4655 y
+SDict begin H.S end
+ 1816 4655 a 1816 4655 a
+SDict begin 18.72 H.A end
+ 1816 4655 a 1816 4655
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.17.2) cvn H.B /DEST pdfmark
+end
+ 1816 4655 a -2 4846 a
+SDict begin H.S end
+ -2 4846 a -2 4846 a
+SDict begin 13 H.A end
+ -2 4846 a
+-2 4846 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1774) cvn H.B /DEST pdfmark
+end
+ -2 4846 a 396 4929 a FC(Directories)19 b(can)g(be)h
+(monitored)d(up)i(to)g(a)h(maximum)e(recursion)g(depth)g(of)h(99)g
+(\(i.e.)g(99)g(le)n(v)o(els)h(of)f(subdirectories.)396
+5037 y(The)h(recursion)f(depth)g(actually)h(used)g(is)h(de\002ned)e(in)
+h(the)g(follo)n(wing)f(order)g(of)h(priority:)-2 5221
+y
+SDict begin H.S end
+ -2 5221 a -2 5221 a
+SDict begin 13 H.A end
+ -2 5221 a -2 5221 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1775) cvn H.B /DEST pdfmark
+end
+ -2 5221 a -2
+5221 a
+SDict begin H.S end
+ -2 5221 a -2 5221 a
+SDict begin 13 H.A end
+ -2 5221 a -2 5221 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1776) cvn H.B /DEST pdfmark
+end
+ -2 5221
+a -2 5231 a
+SDict begin H.S end
+ -2 5231 a -2 5231 a
+SDict begin 13 H.A end
+ -2 5231 a -2 5231 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1777) cvn H.B /DEST pdfmark
+end
+ -2
+5231 a Black 3661 5805 a Fx(45)p Black eop end
+%%Page: 46 51
+TeXDict begin 46 50 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.46) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black Black 463 309 a FC(1.)p Black
+546 309 a
+SDict begin H.S end
+ 546 309 a 546 309 a
+SDict begin 13 H.A end
+ 546 309 a 546 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1778) cvn H.B /DEST pdfmark
+end
+ 546
+309 a FC(The)g(recursion)e(depth)h(speci\002ed)h(for)g(that)g(indi)n
+(vidual)f(directory)f(\()p 0 TeXcolorgray 2513 309 a
+SDict begin H.S end
+
+2513 309 a FC(Section)i(5.4)2888 309 y
+SDict begin 13 H.L end
+ 2888 309 a 2888
+309 a
+SDict begin [ /Subtype /Link /Dest (0:FILEDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2888 309 a Black -2 w FC(>\).)g(As)h(a)g(special)f(case,)h(for)
+546 417 y(directories)e(with)h(the)g(polic)o(y)1435 417
+y
+SDict begin H.S end
+ 1435 417 a 1435 417 a
+SDict begin 13 H.A end
+ 1435 417 a 1435 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1780) cvn H.B /DEST pdfmark
+end
+ 1435 417
+a Fx(Ignor)m(eAll)p FC(,)e(the)i(recursion)f(depth)g(should)h(be)g(set)
+h(to)2988 417 y
+SDict begin H.S end
+ 2988 417 a 2988 417 a
+SDict begin 13 H.A end
+ 2988 417 a 2988
+417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1781) cvn H.B /DEST pdfmark
+end
+ 2988 417 a Fx(0)p FC(,)f(if)h(you)e(w)o(ant)h(to)546
+525 y(monitor)e(\(the)i(e)o(xistence)g(of\))f(the)h(\002les)i(within)e
+(that)g(directory)-5 b(,)18 b(b)n(ut)i(to)2631 525 y
+SDict begin H.S end
+
+2631 525 a 2631 525 a
+SDict begin 13 H.A end
+ 2631 525 a 2631 525 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1782) cvn H.B /DEST pdfmark
+end
+ 2631 525
+a Fx(-1)p FC(,)g(if)g(you)g(do)f(not)h(w)o(ant)3371 525
+y
+SDict begin H.S end
+ 3371 525 a 3371 525 a
+SDict begin 13 H.A end
+ 3371 525 a 3371 525 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1783) cvn H.B /DEST pdfmark
+end
+ 3371 525
+a FC(samhain)f(to)546 632 y(look)g(into)h(that)g(directory)-5
+b(.)-2 650 y
+SDict begin H.S end
+ -2 650 a -2 650 a
+SDict begin 13 H.A end
+ -2 650 a -2 650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1784) cvn H.B /DEST pdfmark
+end
+ -2 650
+a Black 463 782 a FC(2.)p Black 546 782 a
+SDict begin H.S end
+ 546 782 a 546
+782 a
+SDict begin 13 H.A end
+ 546 782 a 546 782 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1785) cvn H.B /DEST pdfmark
+end
+ 546 782 a FC(The)20 b(global)f(def)o(ault)g
+(recursion)g(depth)g(speci\002ed)h(in)g(the)h(con\002guration)c
+(\002le.)k(This)f(is)h(done)e(in)i(the)546 890 y(con\002guration)c
+(\002le)k(section)1392 890 y
+SDict begin H.S end
+ 1392 890 a 1392 890 a
+SDict begin 13 H.A end
+ 1392
+890 a 1392 890 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1786) cvn H.B /DEST pdfmark
+end
+ 1392 890 a Fx(Misc)g FC(with)g(the)f(entry)2056
+890 y
+SDict begin H.S end
+ 2056 890 a 2056 890 a
+SDict begin 13 H.A end
+ 2056 890 a 2056 890 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1787) cvn H.B /DEST pdfmark
+end
+ 2056
+890 a Fy(SetRecursionLe)o(v)o(el=)2766 890 y
+SDict begin H.S end
+ 2766 890
+a 2766 890 a
+SDict begin 13 H.A end
+ 2766 890 a 2766 890 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1788) cvn H.B /DEST pdfmark
+end
+ 2766 890 a Fl(number)-2
+908 y
+SDict begin H.S end
+ -2 908 a -2 908 a
+SDict begin 13 H.A end
+ -2 908 a -2 908 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1789) cvn H.B /DEST pdfmark
+end
+ -2 908 a Black
+463 1039 a FC(3.)p Black 546 1039 a
+SDict begin H.S end
+ 546 1039 a 546 1039
+a
+SDict begin 13 H.A end
+ 546 1039 a 546 1039 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1790) cvn H.B /DEST pdfmark
+end
+ 546 1039 a FC(The)g(def)o(ault)f(recursion)g
+(depth,)g(which)g(is)i(zero.)-2 1199 y
+SDict begin H.S end
+ -2 1199 a -2 1199
+a
+SDict begin 13 H.A end
+ -2 1199 a -2 1199 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HARDLINKCHECK) cvn H.B /DEST
+pdfmark end
+ -2 1199 a 396 1527 a Fp(5.4.6.)36
+b(Har)n(dlink)e(c)o(hec)n(k)1572 1527 y
+SDict begin H.S end
+ 1572 1527 a 1572
+1527 a
+SDict begin 18.72 H.A end
+ 1572 1527 a 1572 1527 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.18.2) cvn H.B /DEST pdfmark
+end
+ 1572 1527 a -2 1695 a
+SDict begin H.S end
+
+-2 1695 a -2 1695 a
+SDict begin 13 H.A end
+ -2 1695 a -2 1695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1793) cvn H.B /DEST pdfmark
+end
+ -2 1695 a 396
+1801 a FC(As)21 b(of)f(v)o(ersion)f(1.8.4,)g(samhain)g(will)i(by)f(def)
+o(ault)f(compare)g(the)h(number)e(of)i(hardlinks)f(of)h(a)h(directory)d
+(to)i(the)396 1909 y(number)f(of)h(its)h(subdirectories)d(\(including)g
+(".")j(and)e(".."\).)h(Normally)-5 b(,)18 b(these)i(numbers)f(should)g
+(be)h(equal.)g(The)396 2017 y(idea)g(here)g(is)h(that)f(a)h(\(k)o
+(ernel\))e(rootkit)g(may)h(hide)f(a)i(directory)-5 b(,)18
+b(b)n(ut)i(f)o(ail)h(to)f("\002x")g(the)g(parent)f(directory)g
+(hardlink)396 2125 y(count)g(\(actually)-5 b(,)19 b(I)h(am)h(not)f(a)o
+(w)o(are)f(of)h(an)o(y)g(k)o(ernel)f(rootkit)g(that)i(w)o(ould)e(care)h
+(to)g(\002x)h(the)f(hardlink)e(count)i(of)g(the)396 2233
+y(parent)f(directory\).)f(This)j(is)g(an)f(e)o(xperimental)e(feature;)h
+(if)i(there)e(are)i(an)o(y)e(problems,)f(it)j(can)f(be)g(disabled)g
+(with)396 2341 y(the)g(option)751 2341 y
+SDict begin H.S end
+ 751 2341 a 751
+2341 a
+SDict begin 13 H.A end
+ 751 2341 a 751 2341 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1794) cvn H.B /DEST pdfmark
+end
+ 751 2341 a Fy(UseHardlinkCheck=)1481
+2341 y
+SDict begin H.S end
+ 1481 2341 a 1481 2341 a
+SDict begin 13 H.A end
+ 1481 2341 a 1481 2341
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1795) cvn H.B /DEST pdfmark
+end
+ 1481 2341 a Fl(no)i FC(in)f(the)f([Misc])g(section)g(of)g(the)g
+(con\002guration)e(\002le.)-2 2525 y
+SDict begin H.S end
+ -2 2525 a -2 2525
+a
+SDict begin 13 H.A end
+ -2 2525 a -2 2525 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1796) cvn H.B /DEST pdfmark
+end
+ -2 2525 a 396 2615 a FC(Errors)h(will)i(be)g
+(reported)d(at)j(the)f(same)g(se)n(v)o(erity)f(as)i(directory)e(access)
+i(errors)e(option)396 2723 y
+SDict begin H.S end
+ 396 2723 a 396 2723 a
+SDict begin 13 H.A end
+ 396
+2723 a 396 2723 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1797) cvn H.B /DEST pdfmark
+end
+ 396 2723 a Fy(Se)o(v)o(erityDirs=)885
+2723 y
+SDict begin H.S end
+ 885 2723 a 885 2723 a
+SDict begin 13 H.A end
+ 885 2723 a 885 2723 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1798) cvn H.B /DEST pdfmark
+end
+ 885
+2723 a Fl(severity)26 b FC(in)20 b(section)g([Ev)o(entSe)n(v)o
+(erity]\).)-2 2741 y
+SDict begin H.S end
+ -2 2741 a -2 2741 a
+SDict begin 11.7 H.A end
+ -2 2741 a -2
+2741 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1799) cvn H.B /DEST pdfmark
+end
+ -2 2741 a -2 2865 a
+SDict begin H.S end
+ -2 2865 a -2 2865 a
+SDict begin 11.7 H.A end
+ -2 2865
+a -2 2865 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1801) cvn H.B /DEST pdfmark
+end
+ -2 2865 a 562 2944 a Fw(MacOS)g(X:)f Fv(This)h(f)n(eature)d
+(is)j(not)f(suppor)s(ted)e(on)i(MacOS)h(X)g(\(because)f(the)g(resource)
+f(f)n(or)q(k)i(is)g(implemented)562 3042 y(as)h(an)f(in)o(visib)o(le)d
+(director)r(y)-7 b(,)19 b(it)h(modi\002es)g(the)g(parent)e(director)r
+(y)i(hardlink)e(count.\))39 3191 y
+SDict begin H.S end
+ 39 3191 a 39 3191
+a
+SDict begin 13 H.A end
+ 39 3191 a 39 3191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HLOFFSETS) cvn H.B /DEST pdfmark
+end
+ 39 3191 a 396 3487 a Fj(5.4.6.1.)28
+b(Specify)h(e)o(xceptions)g(f)n(or)f(the)g(har)n(dlink)f(c)o(hec)n(k)
+2712 3487 y
+SDict begin H.S end
+ 2712 3487 a 2712 3487 a
+SDict begin 15.6 H.A end
+ 2712 3487 a 2712
+3487 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.18.6.3) cvn H.B /DEST pdfmark
+end
+ 2712 3487 a -2 3673 a
+SDict begin H.S end
+ -2 3673 a -2 3673 a
+SDict begin 13 H.A end
+ -2 3673
+a -2 3673 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1804) cvn H.B /DEST pdfmark
+end
+ -2 3673 a 396 3761 a FC(Some)20 b(\002lesystems)h(do)f(not)
+g(al)o(w)o(ays)g(follo)n(w)g(the)g(rule)g(mentioned)e(abo)o(v)o(e)h
+(\(directory)f(hardlink)g(equals)i(number)396 3868 y(of)g
+(subdirectories\).)d(E.g.)i(the)h(root)f(directory)e(of)j(reiserfs)f
+(partitions)g(generally)f(seems)i(to)g(ha)n(v)o(e)f(tw)o(o)h
+(additional)396 3976 y(hardlinks.)f(T)-7 b(o)20 b(account)f(for)h(such)
+g(e)o(xceptions,)e(you)h(can)h(specify)g(e)o(xceptions)e(with)j(the)f
+(option)396 4084 y
+SDict begin H.S end
+ 396 4084 a 396 4084 a
+SDict begin 13 H.A end
+ 396 4084 a 396
+4084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1805) cvn H.B /DEST pdfmark
+end
+ 396 4084 a Fy(HardlinkOffset=)989 4084 y
+SDict begin H.S end
+ 989 4084
+a 989 4084 a
+SDict begin 13 H.A end
+ 989 4084 a 989 4084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1806) cvn H.B /DEST pdfmark
+end
+ 989 4084 a Fl(N)10
+b Fy(:)1072 4084 y
+SDict begin H.S end
+ 1072 4084 a 1072 4084 a
+SDict begin 13 H.A end
+ 1072 4084
+a 1072 4084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1807) cvn H.B /DEST pdfmark
+end
+ 1072 4084 a Fl(/path)19 b FC(in)h(the)g([Misc])h(section)
+f(of)f(the)i(con\002guration)c(\002le.)k(Here,)f(N)g(is)h(the)g
+(numerical)396 4192 y(of)n(fset)f(\(actual)g(-)g(e)o(xpected)f
+(hardlinks\))f(for)1689 4192 y
+SDict begin H.S end
+ 1689 4192 a 1689 4192
+a
+SDict begin 13 H.A end
+ 1689 4192 a 1689 4192 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1808) cvn H.B /DEST pdfmark
+end
+ 1689 4192 a Fr(/path)p FC(.)h(F)o(or)h
+(multiple)g(e)o(xceptions,)e(use)i(this)h(options)e(multiple)396
+4300 y(times)i(\(note)e(that)i('/path)e(N:/path2')g(w)o(ould)g(itself)i
+(be)f(a)h(v)n(alid)f(path,)f(so)i(using)e(the)i(option)e(only)g(once)g
+(with)396 4408 y(multiple)h(e)o(xceptions)e(on)i(the)g(same)h(line)f(w)
+o(ould)g(be)g(ambiguous\).)-2 4426 y
+SDict begin H.S end
+ -2 4426 a -2 4426
+a
+SDict begin 11.7 H.A end
+ -2 4426 a -2 4426 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1809) cvn H.B /DEST pdfmark
+end
+ -2 4426 a -2 4551 a
+SDict begin H.S end
+ -2 4551 a -2
+4551 a
+SDict begin 11.7 H.A end
+ -2 4551 a -2 4551 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1811) cvn H.B /DEST pdfmark
+end
+ -2 4551 a 562 4630 a Fw(NO)m(TE:)g
+Fv(Please)e(note)g(that)1369 4630 y
+SDict begin H.S end
+ 1369 4630 a 1369
+4630 a
+SDict begin 11.7 H.A end
+ 1369 4630 a 1369 4630 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1812) cvn H.B /DEST pdfmark
+end
+ 1369 4630 a Fv(samhain)g(will)h(not)f
+(chec)o(k)i(f)n(or)f(an)f(e)n(xception)g(if)h(the)f(standard)g(r)q(ule)
+g(\(offset)h(=)g(0\))g(is)562 4727 y(tr)q(ue)h(f)n(or)g(a)g(director)r
+(y)-7 b(.)19 b(Thus)h(it)g(will)f(not)h(w)o(ar)r(n)f(if)h(a)h(director)
+r(y)e(that)h(once)f(w)o(as)i(e)n(xceptional)c(is)k(not)f(an)o(ymore)o
+(.)-2 5042 y
+SDict begin H.S end
+ -2 5042 a -2 5042 a
+SDict begin 13 H.A end
+ -2 5042 a -2 5042 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:OBSCURE) cvn H.B /DEST pdfmark
+end
+
+-2 5042 a Black 3660 5805 a Fx(46)p Black eop end
+%%Page: 47 52
+TeXDict begin 47 51 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.47) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1850) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black 396 313 a Fp(5.4.7.)36 b(Chec)n(k)e(f)n(or)e(weir)n(d)i
+(\002lenames)2201 313 y
+SDict begin H.S end
+ 2201 313 a 2201 313 a
+SDict begin 18.72 H.A end
+ 2201 313
+a 2201 313 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.19.2) cvn H.B /DEST pdfmark
+end
+ 2201 313 a -2 480 a
+SDict begin H.S end
+ -2 480 a -2 480 a
+SDict begin 13 H.A end
+ -2
+480 a -2 480 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1815) cvn H.B /DEST pdfmark
+end
+ -2 480 a -2 480 a
+SDict begin H.S end
+ -2 480 a -2 480 a
+SDict begin 13 H.A end
+ -2
+480 a -2 480 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1816) cvn H.B /DEST pdfmark
+end
+ -2 480 a 396 587 a FC(Samhain)20 b(checks)f(for)h(weird)
+g(\002lenames)g(\(containing)d(control/nonprintable)f(characters,)j(ne)
+n(wlines)h(or)g(tabs\))396 695 y(and)g(w)o(arns)g(about)f(them)h(at)h
+(a)f(se)n(v)o(erity)g(le)n(v)o(el)g(that)g(is)h(set)g(with)2247
+695 y
+SDict begin H.S end
+ 2247 695 a 2247 695 a
+SDict begin 13 H.A end
+ 2247 695 a 2247 695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1817) cvn H.B /DEST pdfmark
+end
+ 2247
+695 a Fy(Se)o(v)o(erityNames=)2824 695 y
+SDict begin H.S end
+ 2824 695 a 2824
+695 a
+SDict begin 13 H.A end
+ 2824 695 a 2824 695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1818) cvn H.B /DEST pdfmark
+end
+ 2824 695 a Fl(severity)k
+FC(in)c(section)396 803 y([Ev)o(entSe)n(v)o(erity].)c(The)j(rationale)f
+(is:)i(most)f(of)g(the)h(time,)f(such)g(names)f(are)i(either)e(the)i
+(result)f(of)g(user)g(errors,)396 911 y(b)n(uggy)f(scripts,)h(or)g
+(questionable)f(acti)n(vity)-5 b(.)19 b(If)h(you)f(w)o(ant)h(to)h(add)e
+(characters)h(to)g(the)g(set)h(of)f('good')e(ones,)i(you)396
+1019 y(can)g(do)g(so)h(with)f(the)g(option:)1277 1019
+y
+SDict begin H.S end
+ 1277 1019 a 1277 1019 a
+SDict begin 13 H.A end
+ 1277 1019 a 1277 1019 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1819) cvn H.B /DEST pdfmark
+end
+ 1277
+1019 a Fy(AddOKChars=)1823 1019 y
+SDict begin H.S end
+ 1823 1019 a 1823 1019
+a
+SDict begin 13 H.A end
+ 1823 1019 a 1823 1019 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1820) cvn H.B /DEST pdfmark
+end
+ 1823 1019 a Fl(N1,)44 b(N2,)g(...)21
+b FC(in)f(the)g([Misc])g(section)g(of)g(the)g(con\002guration)396
+1127 y(\002le.)h(Nn)f(should)f(be)h(the)h(unsigned)d(byte)i(v)n(alue)f
+(of)h(the)g(character\(s\))f(in)h(he)o(x)g(\(leading)f('0x':)g(0xNN\),)
+g(octal)396 1234 y(\(leading)g(zero:)h(0NNN\),)f(or)h(decimal.)-2
+1252 y
+SDict begin H.S end
+ -2 1252 a -2 1252 a
+SDict begin 11.7 H.A end
+ -2 1252 a -2 1252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1821) cvn H.B /DEST pdfmark
+end
+ -2 1252
+a -2 1377 a
+SDict begin H.S end
+ -2 1377 a -2 1377 a
+SDict begin 11.7 H.A end
+ -2 1377 a -2 1377 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1823) cvn H.B /DEST pdfmark
+end
+ -2
+1377 a 562 1456 a Fw(TIP:)g Fv(This)g(chec)o(k)h(will)e(not)h(be)g
+(perf)n(or)r(med)d(f)n(or)j(\002les)h(under)e(the)g(IgnoreAll)f(policy)
+-7 b(.)19 b(T)-9 b(o)20 b(completely)f(disab)o(le)562
+1553 y(this)h(chec)o(k,)h(use)1076 1553 y
+SDict begin H.S end
+ 1076 1553 a
+1076 1553 a
+SDict begin 11.7 H.A end
+ 1076 1553 a 1076 1553 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1824) cvn H.B /DEST pdfmark
+end
+ 1076 1553 a Fw(Ad)o(dOKChar)o
+(s=all)p Fv(.)-2 1786 y
+SDict begin H.S end
+ -2 1786 a -2 1786 a
+SDict begin 13 H.A end
+ -2 1786 a
+-2 1786 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PRELINK) cvn H.B /DEST pdfmark
+end
+ -2 1786 a 396 2114 a Fp(5.4.8.)36 b(Suppor)r(t)c(f)n(or)h
+(prelink)1804 2114 y
+SDict begin H.S end
+ 1804 2114 a 1804 2114 a
+SDict begin 18.72 H.A end
+ 1804 2114
+a 1804 2114 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.20.2) cvn H.B /DEST pdfmark
+end
+ 1804 2114 a -2 2305 a
+SDict begin H.S end
+ -2 2305 a -2 2305
+a
+SDict begin 13 H.A end
+ -2 2305 a -2 2305 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1827) cvn H.B /DEST pdfmark
+end
+ -2 2305 a -2 2305 a
+SDict begin H.S end
+ -2 2305 a -2
+2305 a
+SDict begin 13 H.A end
+ -2 2305 a -2 2305 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1828) cvn H.B /DEST pdfmark
+end
+ -2 2305 a 396 2388 a FC(prelink)19
+b(is)i(a)g(tool)f(a)n(v)n(ailable)g(on)f(modern)g(Linux)g(systems)i
+(that)f(can)g(signi\002cantly)f(reduce)g(the)h(startup)g(time)g(of)396
+2496 y(applications.)f(It)h(does)g(this)h(by)f(performing)d(some)j(of)g
+(the)g(w)o(ork)g(of)g(the)g(dynamic)f(link)o(er)g(in)i(adv)n(ance.)d
+(As)j(this)396 2604 y(changes)e(both)h(e)o(x)o(ecutables)e(and)i
+(shared)f(libraries,)h(\002le)h(inte)o(grity)e(v)o(eri\002cation)f
+(will)j(f)o(ail)g(unless)3284 2604 y
+SDict begin H.S end
+ 3284 2604 a 3284
+2604 a
+SDict begin 13 H.A end
+ 3284 2604 a 3284 2604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1829) cvn H.B /DEST pdfmark
+end
+ 3284 2604 a FC(prelink)e(is)396
+2712 y(supported,)f(in)j(particular)d(as)j(prelinking)d(has)j(to)f(be)g
+(redone)f(if)h(libraries)g(are)g(updated)f(\(so)h(initializing)g(the)
+396 2819 y(checksum)f(database)h(after)f(prelinking)g(may)g(not)h(be)g
+(good)f(enough\).)-2 3004 y
+SDict begin H.S end
+ -2 3004 a -2 3004 a
+SDict begin 13 H.A end
+ -2 3004
+a -2 3004 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1830) cvn H.B /DEST pdfmark
+end
+ -2 3004 a 396 3093 a FC(The)h(disadv)n(antage)e(is)j(that)g
+(prelinking)d(modi\002es)h(libraries)h(and)g(e)o(x)o(ecutables,)e(and)i
+(may)g(need)f(to)h(be)h(redone)396 3201 y(\(potentially)e(modifying)f
+(all)i(or)g(man)o(y)f(e)o(x)o(ecutables)g(again\))g(if)h(a)h(library)e
+(is)i(updated.)d(This)j(is)g(a)f(major)g(problem)396
+3309 y(for)g(\002le)h(inte)o(grity)e(check)o(ers.)-2
+3493 y
+SDict begin H.S end
+ -2 3493 a -2 3493 a
+SDict begin 13 H.A end
+ -2 3493 a -2 3493 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1831) cvn H.B /DEST pdfmark
+end
+ -2 3493
+a 396 3583 a FC(V)-9 b(ersion)20 b(2.0)f(of)885 3583
+y
+SDict begin H.S end
+ 885 3583 a 885 3583 a
+SDict begin 13 H.A end
+ 885 3583 a 885 3583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1832) cvn H.B /DEST pdfmark
+end
+ 885 3583
+a FC(samhain)h(and)f(later)h(support)1761 3583 y
+SDict begin H.S end
+ 1761
+3583 a 1761 3583 a
+SDict begin 13 H.A end
+ 1761 3583 a 1761 3583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1833) cvn H.B /DEST pdfmark
+end
+ 1761 3583
+a FC(prelink.)f(T)-7 b(o)20 b(use)h(this)g(support,)d(you)h(need)h(to)g
+(place)g(prelink)o(ed)396 3691 y(e)o(x)o(ecutables)f(and)g(libraries)h
+(\(or)g(directories)f(holding)f(them\))i(under)f(the)2545
+3691 y
+SDict begin H.S end
+ 2545 3691 a 2545 3691 a
+SDict begin 13 H.A end
+ 2545 3691 a 2545 3691
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1834) cvn H.B /DEST pdfmark
+end
+ 2545 3691 a Fx([Pr)m(elink])i FC(polic)o(y)e(rather)g(than)h(under)
+396 3799 y(the)g(\(e.g.\))714 3799 y
+SDict begin H.S end
+ 714 3799 a 714 3799
+a
+SDict begin 13 H.A end
+ 714 3799 a 714 3799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1835) cvn H.B /DEST pdfmark
+end
+ 714 3799 a Fx([ReadOnly])g FC(polic)o(y)-5
+b(.)18 b(F)o(or)i(all)h(\002les)g(under)e(the)2104 3799
+y
+SDict begin H.S end
+ 2104 3799 a 2104 3799 a
+SDict begin 13 H.A end
+ 2104 3799 a 2104 3799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1836) cvn H.B /DEST pdfmark
+end
+ 2104
+3799 a Fx([Pr)m(elink])i FC(polic)o(y)-5 b(,)18 b(inode,)h(size,)i(and)
+e(timestamps)h(will)396 3907 y(be)g(ignored)f(\(prelinking)e(changes)j
+(them\).)f(In)h(addition,)e(for)i(ELF)g(binaries)g(under)f(the)2988
+3907 y
+SDict begin H.S end
+ 2988 3907 a 2988 3907 a
+SDict begin 13 H.A end
+ 2988 3907 a 2988 3907
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1837) cvn H.B /DEST pdfmark
+end
+ 2988 3907 a Fx([Pr)m(elink])i FC(polic)o(y)-5 b(,)396
+4015 y
+SDict begin H.S end
+ 396 4015 a 396 4015 a
+SDict begin 13 H.A end
+ 396 4015 a 396 4015 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1838) cvn H.B /DEST pdfmark
+end
+ 396
+4015 a Fy(/usr/sbin/pr)o(elink)22 b(--v)o(erify)d FC(will)i(be)f(used)g
+(to)g(compute)f(checksums)g(\(i.e.)h(the)g(checksum)f(will)i(be)f
+(computed)396 4123 y(on)g(the)g(output)f(of)h(this)h(command\).)c(F)o
+(or)j(other)g(\002les,)h(checksums)e(are)h(computed)e(as)j(usual.)-2
+4141 y
+SDict begin H.S end
+ -2 4141 a -2 4141 a
+SDict begin 11.7 H.A end
+ -2 4141 a -2 4141 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1839) cvn H.B /DEST pdfmark
+end
+ -2 4141
+a -2 4265 a
+SDict begin H.S end
+ -2 4265 a -2 4265 a
+SDict begin 11.7 H.A end
+ -2 4265 a -2 4265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1841) cvn H.B /DEST pdfmark
+end
+ -2
+4265 a 562 4345 a Fw(Speed:)e Fv(Ob)o(viously)-7 b(,)19
+b(in)o(v)n(oking)1484 4345 y
+SDict begin H.S end
+ 1484 4345 a 1484 4345 a
+SDict begin 11.7 H.A end
+
+1484 4345 a 1484 4345 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1842) cvn H.B /DEST pdfmark
+end
+ 1484 4345 a Fw(prelink)g Fv(results)h(in)g(a)g
+(signi\002cant)f(o)o(v)n(erhead,)f(and)i(slo)o(ws)g(do)o(wn)f(\002le)
+562 4442 y(integ)o(r)q(ity)g(chec)o(king)g(\(tests)i(indicate)d(a)i(f)n
+(actor)g(of)g(three)f(-)h(y)o(our)g(mileage)e(ma)n(y)j(v)n(ar)r(y\).)39
+4580 y
+SDict begin H.S end
+ 39 4580 a 39 4580 a
+SDict begin 11.7 H.A end
+ 39 4580 a 39 4580 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1843) cvn H.B /DEST pdfmark
+end
+ 39 4580
+a -2 4746 a
+SDict begin H.S end
+ -2 4746 a -2 4746 a
+SDict begin 11.7 H.A end
+ -2 4746 a -2 4746 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1845) cvn H.B /DEST pdfmark
+end
+ -2
+4746 a 562 4844 a Fw(V)l(eri\002cation)d(failures)h(\(z)q(er)o(o)g(c)o
+(hec)o(ksum\):)f Fv(It)i(seems)h(that)2354 4844 y
+SDict begin H.S end
+ 2354
+4844 a 2354 4844 a
+SDict begin 11.7 H.A end
+ 2354 4844 a 2354 4844 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1846) cvn H.B /DEST pdfmark
+end
+ 2354 4844
+a Fw(prelink)d(--verify)h Fv(f)n(ails)h(if)g(the)f(dependencies)562
+4941 y(of)h(a)h(prelink)o(ed)c(binar)r(y)j(ha)o(v)n(e)f(changed.)f
+(This)i(results)g(in)g(a)g(z)o(ero)g(chec)o(ksum,)g(and)g(can)g(be)g
+(\002x)n(ed)g(b)o(y)562 5038 y(re-prelinking)d(the)j(aff)n(ected)e
+(binar)r(y)-7 b(.)p Black 3658 5805 a Fx(47)p Black eop
+end
+%%Page: 48 53
+TeXDict begin 48 52 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.48) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1847) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(There)g(are)g(tw)o(o)g
+(con\002guration)e(options)h(in)h(the)1814 309 y
+SDict begin H.S end
+ 1814
+309 a 1814 309 a
+SDict begin 13 H.A end
+ 1814 309 a 1814 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1848) cvn H.B /DEST pdfmark
+end
+ 1814 309 a Fx([Misc])h
+FC(section)f(that)g(can)g(are)h(rele)n(v)n(ant)e(for)3121
+309 y
+SDict begin H.S end
+ 3121 309 a 3121 309 a
+SDict begin 13 H.A end
+ 3121 309 a 3121 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1849) cvn H.B /DEST pdfmark
+end
+ 3121
+309 a FC(prelink)g(support:)396 583 y Fy(SetPr)o(elinkP)o(ath=)p
+Fl(fullpath)g FC(sets)j(the)e(path)g(to)g(the)2000 583
+y
+SDict begin H.S end
+ 2000 583 a 2000 583 a
+SDict begin 13 H.A end
+ 2000 583 a 2000 583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1853) cvn H.B /DEST pdfmark
+end
+ 2000 583
+a FC(prelink)f(e)o(x)o(ecutable.)f(The)i(def)o(ault)f(is)396
+691 y
+SDict begin H.S end
+ 396 691 a 396 691 a
+SDict begin 13 H.A end
+ 396 691 a 396 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1854) cvn H.B /DEST pdfmark
+end
+ 396 691
+a Fr(/usr/sbin/prelink)p FC(.)-2 868 y
+SDict begin H.S end
+ -2 868 a -2 868
+a
+SDict begin 13 H.A end
+ -2 868 a -2 868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1855) cvn H.B /DEST pdfmark
+end
+ -2 868 a -2 868 a
+SDict begin H.S end
+ -2 868 a -2 868
+a
+SDict begin 13 H.A end
+ -2 868 a -2 868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1856) cvn H.B /DEST pdfmark
+end
+ -2 868 a 396 965 a Fy(SetPr)o(elinkChecksum=)1189
+965 y
+SDict begin H.S end
+ 1189 965 a 1189 965 a
+SDict begin 13 H.A end
+ 1189 965 a 1189 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1857) cvn H.B /DEST pdfmark
+end
+ 1189
+965 a Fl(checksum)k FC(sets)f(the)e(TIGER192)e(checksum)h(for)h(the)
+2822 965 y
+SDict begin H.S end
+ 2822 965 a 2822 965 a
+SDict begin 13 H.A end
+ 2822 965 a 2822 965
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1858) cvn H.B /DEST pdfmark
+end
+ 2822 965 a FC(prelink)f(e)o(x)o(ecutable.)f(Y)-9 b(ou)20
+b(can)396 1073 y(compute)f(this)i(with)1012 1073 y
+SDict begin H.S end
+ 1012
+1073 a 1012 1073 a
+SDict begin 13 H.A end
+ 1012 1073 a 1012 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1859) cvn H.B /DEST pdfmark
+end
+ 1012 1073
+a Fy(samhain)g(-H)f(/usr/sbin/pr)o(elink)i FC(\(remo)o(v)o(e)17
+b(whitespace)j(from)f(the)h(computed)396 1180 y(checksum\).)e(If)i(the)
+h(checksum)d(is)k(set,)1558 1180 y
+SDict begin H.S end
+ 1558 1180 a 1558 1180
+a
+SDict begin 13 H.A end
+ 1558 1180 a 1558 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1860) cvn H.B /DEST pdfmark
+end
+ 1558 1180 a FC(samhain)e(will)h(v)o(erify)d
+(the)2346 1180 y
+SDict begin H.S end
+ 2346 1180 a 2346 1180 a
+SDict begin 13 H.A end
+ 2346 1180 a
+2346 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1861) cvn H.B /DEST pdfmark
+end
+ 2346 1180 a FC(prelink)h(e)o(x)o(ecutable)f(immediately)h
+(before)396 1288 y(using)h(it,)h(otherwise)1028 1288
+y
+SDict begin H.S end
+ 1028 1288 a 1028 1288 a
+SDict begin 13 H.A end
+ 1028 1288 a 1028 1288 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1862) cvn H.B /DEST pdfmark
+end
+ 1028
+1288 a FC(prelink)e(will)i(be)f(used)g(without)g(this)g(special)h
+(precaution.)-2 1317 y
+SDict begin H.S end
+ -2 1317 a -2 1317 a
+SDict begin 13 H.A end
+ -2 1317 a
+-2 1317 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHANGE-CODES) cvn H.B /DEST
+pdfmark end
+ -2 1317 a 396 1627 a Fp(5.4.9.)36 b(Codes)e(in)g(messa)o(g)q
+(es)i(about)e(repor)r(ted)f(\002les)2995 1627 y
+SDict begin H.S end
+ 2995
+1627 a 2995 1627 a
+SDict begin 18.72 H.A end
+ 2995 1627 a 2995 1627 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.36.21.2) cvn H.B /DEST pdfmark
+end
+ 2995 1627
+a -2 1819 a
+SDict begin H.S end
+ -2 1819 a -2 1819 a
+SDict begin 13 H.A end
+ -2 1819 a -2 1819 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1865) cvn H.B /DEST pdfmark
+end
+ -2
+1819 a 396 1901 a FC(As)21 b(of)f(v)o(ersion)f(1.8.2,)g(reports)g
+(about)g(modi\002ed)g(\002les)i(include)e(a)i(short)f(code)f(in)i(the)f
+(message)g(\002eld)g(to)h(describe)396 2009 y(which)f(properties)f(ha)n
+(v)o(e)g(been)h(modi\002ed.)f(The)g(codes)h(are:)g('C')h(for)e
+('checksum',)f('L)-8 b(')20 b(for)g(\(soft\))f(')o(link',)h('D')g(for)
+396 2117 y(')l(de)n(vice)f(number',)f('I')i(for)f('inode',)f('H')i(for)
+g(\(number)e(of\))i('hardlinks',)d('M')j(for)g('mode',)e('U')i(for)g
+('user')396 2225 y(\(o)n(wner\),)e('G')i(for)g('group')e(\(o)n(wner\),)
+g('T')i(for)f(')o(time')g(\(an)o(y\),)g(and)h(\002nally)f('S')i(for)e
+(')-5 b(size'.)-2 2409 y
+SDict begin H.S end
+ -2 2409 a -2 2409 a
+SDict begin 13 H.A end
+ -2 2409
+a -2 2409 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1866) cvn H.B /DEST pdfmark
+end
+ -2 2409 a 396 2499 a FC(As)21 b(an)f(e)o(xample,)f
+('C--I----TS')f(w)o(ould)h(indicate)h(that)g(a)h(\002le)g(has)f(been)g
+(replaced)e(by)i(one)g(with)g(dif)n(ferent)396 2606 y(checksum,)f
+(inode,)g(timestamp,)g(and)h(size,)g(b)n(ut)h(\(e.g.\))e(same)h(mode)f
+(\(type)h(and)f(access)i(permissions\))e(and)h(same)396
+2714 y(o)n(wnership.)-2 2826 y
+SDict begin H.S end
+ -2 2826 a -2 2826 a
+SDict begin 13 H.A end
+ -2
+2826 a -2 2826 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:ALL-EXCEPT) cvn H.B /DEST pdfmark
+end
+ -2 2826 a 359 x Fu(5.5.)39 b(Exc)m(luding)f(\002les)g
+(and/or)h(subdirectories)d(\(All)j(e)n(xcept)-2 3371
+y(.)24 b(.)g(.)g(\))238 3371 y
+SDict begin H.S end
+ 238 3371 a 238 3371 a
+SDict begin 22.464 H.A end
+
+238 3371 a 238 3371 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.37.1) cvn H.B /DEST pdfmark
+end
+ 238 3371 a -2 3567 a
+SDict begin H.S end
+ -2 3567 a
+-2 3567 a
+SDict begin 13 H.A end
+ -2 3567 a -2 3567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1869) cvn H.B /DEST pdfmark
+end
+ -2 3567 a 396 3645 a FC(T)-7
+b(o)21 b(e)o(xclude)d(indi)n(vidual)h(\002les)i(from)e(a)i(directory)-5
+b(,)17 b(place)j(them)g(under)f(the)h(polic)o(y)2812
+3645 y
+SDict begin H.S end
+ 2812 3645 a 2812 3645 a
+SDict begin 13 H.A end
+ 2812 3645 a 2812 3645
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1870) cvn H.B /DEST pdfmark
+end
+ 2812 3645 a Fx(Ignor)m(eAll)p FC(.)f(Note)h(that)g(the)396
+3753 y
+SDict begin H.S end
+ 396 3753 a 396 3753 a
+SDict begin 13 H.A end
+ 396 3753 a 396 3753 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1871) cvn H.B /DEST pdfmark
+end
+ 396
+3753 a Fx(e)n(xistence)h FC(of)f(such)f(\002les)j(will)f(still)g(be)f
+(check)o(ed)f(\(see)h(ne)o(xt)g(section\).)-2 3934 y
+SDict begin H.S end
+
+-2 3934 a -2 3934 a
+SDict begin 13 H.A end
+ -2 3934 a -2 3934 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1872) cvn H.B /DEST pdfmark
+end
+ -2 3934 a 396
+4027 a FC(T)-7 b(o)21 b(e)o(xclude)d(subdirectories)h(from)g(a)i
+(directory)-5 b(,)17 b(place)j(them)g(under)f(the)h(polic)o(y)2784
+4027 y
+SDict begin H.S end
+ 2784 4027 a 2784 4027 a
+SDict begin 13 H.A end
+ 2784 4027 a 2784 4027
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1873) cvn H.B /DEST pdfmark
+end
+ 2784 4027 a Fx(Ignor)m(eAll)f FC(with)i(an)f(indi)n(vidual)396
+4135 y(recursion)f(depth)g(of)1021 4135 y
+SDict begin H.S end
+ 1021 4135 a
+1021 4135 a
+SDict begin 13 H.A end
+ 1021 4135 a 1021 4135 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1874) cvn H.B /DEST pdfmark
+end
+ 1021 4135 a Fx(-1)h
+FC(\(see)p 0 TeXcolorgray 1265 4135 a
+SDict begin H.S end
+ 1265 4135 a FC(Section)g(5.4.5)
+1703 4135 y
+SDict begin 13 H.L end
+ 1703 4135 a 1703 4135 a
+SDict begin [ /Subtype /Link /Dest (0:RECDEP) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1703 4135 a Black
+-2 w FC(>\).)-2 4153 y
+SDict begin H.S end
+ -2 4153 a -2 4153 a
+SDict begin 11.7 H.A end
+ -2 4153 a
+-2 4153 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1876) cvn H.B /DEST pdfmark
+end
+ -2 4153 a -2 4278 a
+SDict begin H.S end
+ -2 4278 a -2 4278 a
+SDict begin 11.7 H.A end
+ -2
+4278 a -2 4278 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1878) cvn H.B /DEST pdfmark
+end
+ -2 4278 a 562 4357 a Fw(NO)m(TE:)h Fv(Changes)d(in)i
+(a)h(director)r(y)e(ma)n(y)i(also)f(modify)f(the)h(director)r(y)f
+(inode)g(itself)g(\(i.e)o(.)h(the)f(special)h(\002le)g(that)562
+4454 y(holds)g(the)f(director)r(y)h(inf)n(or)r(mation\).)c(If)21
+b(y)o(ou)e(w)o(ant)h(to)g(chec)o(k)g(all)g(b)o(ut)f(a)h(f)n(e)o(w)g
+(\002les)g(in)g(a)g(director)r(y)g(\(sa)n(y)-7 b(,)3500
+4454 y
+SDict begin H.S end
+ 3500 4454 a 3500 4454 a
+SDict begin 11.7 H.A end
+ 3500 4454 a 3500 4454
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1879) cvn H.B /DEST pdfmark
+end
+ 3500 4454 a Ft(/etc)p Fv(\),)562 4551 y(and)20 b(y)o(ou)f(e)n(xpect)h
+(some)h(of)f(the)f(e)n(xcluded)g(\002les)h(to)h(get)e(modi\002ed,)g(y)o
+(ou)h(should)f(use)h(a)g(setup)g(lik)o(e:)-2 4609 y
+SDict begin H.S end
+ -2
+4609 a -2 4609 a
+SDict begin 11.7 H.A end
+ -2 4609 a -2 4609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1880) cvn H.B /DEST pdfmark
+end
+ -2 4609 a -2 4692
+a
+SDict begin H.S end
+ -2 4692 a -2 4692 a
+SDict begin 10.53 H.A end
+ -2 4692 a -2 4692 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1881) cvn H.B /DEST pdfmark
+end
+ -2 4692 a 643
+4763 a Ft([ReadOnly])643 4851 y(#)643 4938 y(dir=/etc)643
+5025 y(#)643 5113 y([Attributes])643 5200 y(#)643 5288
+y(#)41 b(less)g(restrictive)k(policy)d(for)f(the)h(directory)h(file)f
+(itself)643 5375 y(#)p Black 3661 5805 a Fx(48)p Black
+eop end
+%%Page: 49 54
+TeXDict begin 49 53 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.49) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 643 309 a Ft(file=/etc)643
+396 y(#)643 484 y([IgnoreAll])643 571 y(#)643 658 y(#)41
+b(exclude)h(these)h(file)e(and)h(directories)643 746
+y(#)643 833 y(file=/etc/resolv.co)q(nf.)q(sav)q(e)643
+921 y(dir=-1/etc/calendar)643 1008 y(#)-2 1421 y
+SDict begin H.S end
+ -2 1421
+a -2 1421 a
+SDict begin 13 H.A end
+ -2 1421 a -2 1421 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:TIMING-FILE-CHECKS) cvn H.B
+/DEST pdfmark end
+ -2 1421 a 377 x Fu(5.6.)d(Timing)f
+(\002le)h(c)o(hec)m(ks)1518 1798 y
+SDict begin H.S end
+ 1518 1798 a 1518 1798
+a
+SDict begin 22.464 H.A end
+ 1518 1798 a 1518 1798 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.38.1) cvn H.B /DEST pdfmark
+end
+ 1518 1798 a -2 1996 a
+SDict begin H.S end
+ -2 1996
+a -2 1996 a
+SDict begin 13 H.A end
+ -2 1996 a -2 1996 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1884) cvn H.B /DEST pdfmark
+end
+ -2 1996 a 396 2072 a
+FC(In)20 b(the)608 2072 y
+SDict begin H.S end
+ 608 2072 a 608 2072 a
+SDict begin 13 H.A end
+ 608 2072
+a 608 2072 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1885) cvn H.B /DEST pdfmark
+end
+ 608 2072 a Fx(Misc)i FC(section)d(of)h(the)h
+(con\002guration)c(\002le,)k(you)e(can)h(set)h(the)f(interv)n(al)g
+(\(in)f(seconds\))h(between)f(succesi)n(v)o(e)396 2180
+y(\002le)i(checks:)-2 2347 y
+SDict begin H.S end
+ -2 2347 a -2 2347 a
+SDict begin 13 H.A end
+ -2 2347
+a -2 2347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1886) cvn H.B /DEST pdfmark
+end
+ -2 2347 a -2 2347 a
+SDict begin H.S end
+ -2 2347 a -2 2347 a
+SDict begin 13 H.A end
+ -2
+2347 a -2 2347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1887) cvn H.B /DEST pdfmark
+end
+ -2 2347 a 396 2454 a Fy(SetFilecheckT)o(ime=)1074
+2454 y
+SDict begin H.S end
+ 1074 2454 a 1074 2454 a
+SDict begin 13 H.A end
+ 1074 2454 a 1074 2454
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1888) cvn H.B /DEST pdfmark
+end
+ 1074 2454 a Fl(value)-2 2621 y
+SDict begin H.S end
+ -2 2621 a -2 2621 a
+SDict begin 13 H.A end
+
+-2 2621 a -2 2621 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1889) cvn H.B /DEST pdfmark
+end
+ -2 2621 a 396 2728 a FC(Alternati)n(v)o(ely)-5
+b(,)18 b(you)h(can)h(specify)g(a)h(crontab-lik)o(e)d(schedule)h(with:)
+-2 2912 y
+SDict begin H.S end
+ -2 2912 a -2 2912 a
+SDict begin 13 H.A end
+ -2 2912 a -2 2912 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1890) cvn H.B /DEST pdfmark
+end
+ -2
+2912 a -2 2912 a
+SDict begin H.S end
+ -2 2912 a -2 2912 a
+SDict begin 13 H.A end
+ -2 2912 a -2 2912
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1891) cvn H.B /DEST pdfmark
+end
+ -2 2912 a 396 3002 a Fy(FileCheckScheduleOne=)1269
+3002 y
+SDict begin H.S end
+ 1269 3002 a 1269 3002 a
+SDict begin 13 H.A end
+ 1269 3002 a 1269 3002
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1892) cvn H.B /DEST pdfmark
+end
+ 1269 3002 a Fl(schedule)-2 3169 y
+SDict begin H.S end
+ -2 3169 a -2 3169
+a
+SDict begin 13 H.A end
+ -2 3169 a -2 3169 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1893) cvn H.B /DEST pdfmark
+end
+ -2 3169 a 396 3276 a FC(The)h(schedule)f(follo)n
+(ws)h(the)g(same)h(rules)f(as)h(crontab\(5\))c(entries,)j(with)g(tw)o
+(o)h(noteable)e(e)o(xceptions:)g(\(a\))3466 3276 y
+SDict begin H.S end
+ 3466
+3276 a 3466 3276 a
+SDict begin 13 H.A end
+ 3466 3276 a 3466 3276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1894) cvn H.B /DEST pdfmark
+end
+ 3466 3276
+a Fx(lists)i FC(are)396 3384 y(not)e(allo)n(wed,)f(and)h(\(b\))1079
+3384 y
+SDict begin H.S end
+ 1079 3384 a 1079 3384 a
+SDict begin 13 H.A end
+ 1079 3384 a 1079 3384
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1895) cvn H.B /DEST pdfmark
+end
+ 1079 3384 a Fx(r)o(ang)o(es)g FC(of)f(names)h(\(lik)o(e)g(Mon-Fri\))f
+(are)h(allo)n(wed.)f(See)2704 3384 y
+SDict begin H.S end
+ 2704 3384 a 2704
+3384 a
+SDict begin 13 H.A end
+ 2704 3384 a 2704 3384 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1896) cvn H.B /DEST pdfmark
+end
+ 2704 3384 a Fy(man)i(5)f(cr)o(ontab)f
+FC(for)g(details.)i(Y)-9 b(ou)396 3491 y(can)19 b(specify)g(a)h(list)h
+(of)e(schedules,)f(with)i(separate)f(FileCheckScheduleOne=.)12
+b(.)g(.)29 b(directi)n(v)o(es)19 b(on)g(separate)g(lines.)-2
+3509 y
+SDict begin H.S end
+ -2 3509 a -2 3509 a
+SDict begin 11.7 H.A end
+ -2 3509 a -2 3509 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1897) cvn H.B /DEST pdfmark
+end
+ -2 3509
+a -2 3634 a
+SDict begin H.S end
+ -2 3634 a -2 3634 a
+SDict begin 11.7 H.A end
+ -2 3634 a -2 3634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1899) cvn H.B /DEST pdfmark
+end
+ -2
+3634 a 562 3713 a Fw(NO)m(TE:)i Fv(If)f(y)o(ou)g(need)f(a)h(list)g(in)g
+(y)o(our)f(schedule)o(,)g(y)o(ou)h(can)g(either)e(use)j(steps)f(\(lik)o
+(e)f(*/2)h(f)n(or)g('e)n(v)n(er)r(y)g(tw)o(o)562 3810
+y(min)o(utes/hours/...\),)d(or)k(y)o(ou)e(can)h(specify)h(a)f(list)g
+(of)g(schedules)o(,)f(with)h(separ)o(ate)562 3907 y(FileChec)o
+(kScheduleOne=.)12 b(.)g(.)28 b(directiv)n(es)19 b(on)h(separ)o(ate)f
+(lines)o(.)39 4057 y
+SDict begin H.S end
+ 39 4057 a 39 4057 a
+SDict begin 13 H.A end
+ 39 4057 a 39
+4057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SECOND-SCHEDULE) cvn H.B /DEST
+pdfmark end
+ 39 4057 a 396 4385 a Fp(5.6.1.)36 b(Using)e(a)g(second)g(sc)o
+(hedule)2160 4385 y
+SDict begin H.S end
+ 2160 4385 a 2160 4385 a
+SDict begin 18.72 H.A end
+ 2160 4385
+a 2160 4385 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.38.22.2) cvn H.B /DEST pdfmark
+end
+ 2160 4385 a -2 4578 a
+SDict begin H.S end
+ -2 4578 a -2 4578
+a
+SDict begin 13 H.A end
+ -2 4578 a -2 4578 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1902) cvn H.B /DEST pdfmark
+end
+ -2 4578 a 396 4659 a FC(If)20 b(you)g(w)o(ant)g
+(to)g(check)g(some)g(\002les)h(rather)e(often,)g(while)h(doing)f(a)i
+(more)e(e)o(xtensi)n(v)o(e)g(check)g(only)h(sometimes,)396
+4767 y(this)h(is)g(supported)d(as)j(follo)n(ws:)-2 4951
+y
+SDict begin H.S end
+ -2 4951 a -2 4951 a
+SDict begin 13 H.A end
+ -2 4951 a -2 4951 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1903) cvn H.B /DEST pdfmark
+end
+ -2 4951 a -2
+4951 a
+SDict begin H.S end
+ -2 4951 a -2 4951 a
+SDict begin 13 H.A end
+ -2 4951 a -2 4951 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1904) cvn H.B /DEST pdfmark
+end
+ -2 4951
+a -2 4961 a
+SDict begin H.S end
+ -2 4961 a -2 4961 a
+SDict begin 13 H.A end
+ -2 4961 a -2 4961 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1905) cvn H.B /DEST pdfmark
+end
+ -2
+4961 a Black 396 5103 a FB(\225)p Black 479 5103 a
+SDict begin H.S end
+ 479
+5103 a 479 5103 a
+SDict begin 13 H.A end
+ 479 5103 a 479 5103 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1906) cvn H.B /DEST pdfmark
+end
+ 479 5103 a FC(Enclose)f(all)h
+(directories)e(for)g(the)i(more)e(e)o(xtensi)n(v)o(e)g(check)g(in)h(a)h
+(\045SCHEDULE_TW)o(O)f(...)479 5211 y(!\045SCHEDULE_TW)o(O)g(block)f
+(lik)o(e:)-2 5262 y
+SDict begin H.S end
+ -2 5262 a -2 5262 a
+SDict begin 11.7 H.A end
+ -2 5262 a -2
+5262 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1907) cvn H.B /DEST pdfmark
+end
+ -2 5262 a 569 5350 a Fr(\045SCHEDULE_TWO)p Black
+3661 5805 a Fx(49)p Black eop end
+%%Page: 50 55
+TeXDict begin 50 54 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.50) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 569 309 a Fr(dir=/check/only/once/per/day)569
+406 y(!\045SCHEDULE_TWO)-2 503 y
+SDict begin H.S end
+ -2 503 a -2 503 a
+SDict begin 13 H.A end
+ -2
+503 a -2 503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1908) cvn H.B /DEST pdfmark
+end
+ -2 503 a Black 396 652 a FB(\225)p Black
+479 652 a
+SDict begin H.S end
+ 479 652 a 479 652 a
+SDict begin 13 H.A end
+ 479 652 a 479 652 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1909) cvn H.B /DEST pdfmark
+end
+ 479
+652 a FC(De\002ne)g(an)h(optional)d(second)i(schedule)f(as)i(follo)n
+(ws)f(\(similar)g(to)g(FileCheckSchedule,)e(you)h(can)h(specify)g(a)479
+760 y(list)i(of)d(schedules\):)-2 941 y
+SDict begin H.S end
+ -2 941 a -2 941
+a
+SDict begin 13 H.A end
+ -2 941 a -2 941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1910) cvn H.B /DEST pdfmark
+end
+ -2 941 a -2 941 a
+SDict begin H.S end
+ -2 941 a -2 941
+a
+SDict begin 13 H.A end
+ -2 941 a -2 941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1911) cvn H.B /DEST pdfmark
+end
+ -2 941 a 479 1034 a Fy(FileCheckScheduleT)-6
+b(w)o(o=)1354 1034 y
+SDict begin H.S end
+ 1354 1034 a 1354 1034 a
+SDict begin 13 H.A end
+ 1354 1034
+a 1354 1034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1912) cvn H.B /DEST pdfmark
+end
+ 1354 1034 a Fl(schedule2)-2 1468 y
+SDict begin H.S end
+ -2 1468
+a -2 1468 a
+SDict begin 13 H.A end
+ -2 1468 a -2 1468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1913) cvn H.B /DEST pdfmark
+end
+ -2 1468 a -2 1468 a
+SDict begin H.S end
+ -2
+1468 a -2 1468 a
+SDict begin 13 H.A end
+ -2 1468 a -2 1468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1914) cvn H.B /DEST pdfmark
+end
+ -2 1468 a 396 1576
+a Fx(Rules:)-2 1743 y
+SDict begin H.S end
+ -2 1743 a -2 1743 a
+SDict begin 13 H.A end
+ -2 1743 a -2
+1743 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1915) cvn H.B /DEST pdfmark
+end
+ -2 1743 a -2 1743 a
+SDict begin H.S end
+ -2 1743 a -2 1743 a
+SDict begin 13 H.A end
+ -2 1743
+a -2 1743 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1916) cvn H.B /DEST pdfmark
+end
+ -2 1743 a -2 1753 a
+SDict begin H.S end
+ -2 1753 a -2 1753 a
+SDict begin 13 H.A end
+ -2
+1753 a -2 1753 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1917) cvn H.B /DEST pdfmark
+end
+ -2 1753 a Black 463 1912 a FC(1.)p Black
+546 1912 a
+SDict begin H.S end
+ 546 1912 a 546 1912 a
+SDict begin 13 H.A end
+ 546 1912 a 546 1912
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1918) cvn H.B /DEST pdfmark
+end
+ 546 1912 a FC(All)21 b(\002les)g(and)e(directories)h(will)g(al)o(w)o
+(ays)h(be)f(check)o(ed)f(at)i(FileCheckScheduleT)-7 b(w)o(o.)-2
+1930 y
+SDict begin H.S end
+ -2 1930 a -2 1930 a
+SDict begin 13 H.A end
+ -2 1930 a -2 1930 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1919) cvn H.B /DEST pdfmark
+end
+ -2 1930
+a Black 463 2062 a FC(2.)p Black 546 2062 a
+SDict begin H.S end
+ 546 2062
+a 546 2062 a
+SDict begin 13 H.A end
+ 546 2062 a 546 2062 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1920) cvn H.B /DEST pdfmark
+end
+ 546 2062 a FC(All)21
+b(single)f(\002les)h(\(\002le=.)12 b(.)g(.)g(\))20 b(will)h(al)o(w)o
+(ays)g(be)f(check)o(ed)f(at)i(both)e(FileCheckScheduleOne)f(and)546
+2170 y(FileCheckScheduleT)-7 b(w)o(o)18 b(\(rationale:)h(this)i(is)g
+(required)d(to)i(check)g(for)f(missing/added)g(\002les)i(in)546
+2278 y(directories\).)-2 2293 y
+SDict begin H.S end
+ -2 2293 a -2 2293 a
+SDict begin 13 H.A end
+ -2
+2293 a -2 2293 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1921) cvn H.B /DEST pdfmark
+end
+ -2 2293 a Black 463 2427 a FC(3.)p Black
+546 2427 a
+SDict begin H.S end
+ 546 2427 a 546 2427 a
+SDict begin 13 H.A end
+ 546 2427 a 546 2427
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1922) cvn H.B /DEST pdfmark
+end
+ 546 2427 a FC(All)g(directories)e(outside)g(the)i(\045SCHEDULE_TW)o
+(O)f(block)f(will)i(be)f(check)o(ed)f(at)i(both)546 2535
+y(FileCheckScheduleOne)c(and)j(FileCheckScheduleT)-7
+b(w)o(o.)-2 2536 y
+SDict begin H.S end
+ -2 2536 a -2 2536 a
+SDict begin 13 H.A end
+ -2 2536 a -2 2536
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1923) cvn H.B /DEST pdfmark
+end
+ -2 2536 a Black 463 2684 a FC(4.)p Black 546 2684 a
+SDict begin H.S end
+
+546 2684 a 546 2684 a
+SDict begin 13 H.A end
+ 546 2684 a 546 2684 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1924) cvn H.B /DEST pdfmark
+end
+ 546 2684
+a FC(All)21 b(directories)e(inside)h(the)g(\045SCHEDULE_TW)o(O)g(block)
+f(will)i(be)g(check)o(ed)d(at)546 2792 y(FileCheckScheduleT)-7
+b(w)o(o)18 b(only)-5 b(.)-2 3035 y
+SDict begin H.S end
+ -2 3035 a -2 3035
+a
+SDict begin 13 H.A end
+ -2 3035 a -2 3035 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:INITIALIZING-UPDATING-CHECKING)
+cvn H.B /DEST pdfmark end
+ -2 3035 a 377 x Fu(5.7.)39 b(Initializing,)e
+(updating,)h(or)h(c)o(hec)m(king)2547 3412 y
+SDict begin H.S end
+ 2547 3412
+a 2547 3412 a
+SDict begin 22.464 H.A end
+ 2547 3412 a 2547 3412 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.39.1) cvn H.B /DEST pdfmark
+end
+ 2547 3412 a -2
+3610 a
+SDict begin H.S end
+ -2 3610 a -2 3610 a
+SDict begin 13 H.A end
+ -2 3610 a -2 3610 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1927) cvn H.B /DEST pdfmark
+end
+ -2 3610
+a 396 3686 a FC(In)20 b(the)608 3686 y
+SDict begin H.S end
+ 608 3686 a 608
+3686 a
+SDict begin 13 H.A end
+ 608 3686 a 608 3686 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1928) cvn H.B /DEST pdfmark
+end
+ 608 3686 a Fx(Misc)i FC(section)d(of)h
+(the)h(con\002guration)c(\002le,)k(you)e(can)h(choose)f(between)h
+(initializing)f(the)h(database,)396 3794 y(updating)f(it,)h(or)g
+(checking)f(the)h(\002les)h(against)f(the)g(e)o(xisting)f(database:)-2
+3978 y
+SDict begin H.S end
+ -2 3978 a -2 3978 a
+SDict begin 13 H.A end
+ -2 3978 a -2 3978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1929) cvn H.B /DEST pdfmark
+end
+ -2 3978
+a -2 3978 a
+SDict begin H.S end
+ -2 3978 a -2 3978 a
+SDict begin 13 H.A end
+ -2 3978 a -2 3978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1930) cvn H.B /DEST pdfmark
+end
+ -2
+3978 a 396 4068 a Fy(ChecksumT)-8 b(est=)960 4068 y
+SDict begin H.S end
+ 960
+4068 a 960 4068 a
+SDict begin 13 H.A end
+ 960 4068 a 960 4068 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1931) cvn H.B /DEST pdfmark
+end
+ 960 4068 a Fl
+(init|update|check|none)-2 4253 y
+SDict begin H.S end
+ -2 4253 a -2 4253 a
+SDict begin 13 H.A end
+
+-2 4253 a -2 4253 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1932) cvn H.B /DEST pdfmark
+end
+ -2 4253 a 396 4342 a FC(If)20 b(you)g(use)g(the)g
+(mode)1076 4342 y
+SDict begin H.S end
+ 1076 4342 a 1076 4342 a
+SDict begin 13 H.A end
+ 1076 4342 a
+1076 4342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1933) cvn H.B /DEST pdfmark
+end
+ 1076 4342 a Fx(none)p FC(,)f(you)h(should)f(specify)g(on)h
+(the)g(command)f(line)h(one)f(of)2877 4342 y
+SDict begin H.S end
+ 2877 4342
+a 2877 4342 a
+SDict begin 13 H.A end
+ 2877 4342 a 2877 4342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1934) cvn H.B /DEST pdfmark
+end
+ 2877 4342 a Fx(init)q
+FC(,)3031 4342 y
+SDict begin H.S end
+ 3031 4342 a 3031 4342 a
+SDict begin 13 H.A end
+ 3031 4342 a
+3031 4342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1935) cvn H.B /DEST pdfmark
+end
+ 3031 4342 a Fx(update)p FC(,)g(or)3389 4342
+y
+SDict begin H.S end
+ 3389 4342 a 3389 4342 a
+SDict begin 13 H.A end
+ 3389 4342 a 3389 4342 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1936) cvn H.B /DEST pdfmark
+end
+ 3389
+4342 a Fx(c)o(hec)n(k)q FC(,)396 4450 y(lik)o(e:)564
+4450 y
+SDict begin H.S end
+ 564 4450 a 564 4450 a
+SDict begin 13 H.A end
+ 564 4450 a 564 4450 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1937) cvn H.B /DEST pdfmark
+end
+ 564
+4450 a Fy(samhain)h(-t)960 4450 y
+SDict begin H.S end
+ 960 4450 a 960 4450
+a
+SDict begin 13 H.A end
+ 960 4450 a 960 4450 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1938) cvn H.B /DEST pdfmark
+end
+ 960 4450 a Fl(check)-2 4618 y
+SDict begin H.S end
+
+-2 4618 a -2 4618 a
+SDict begin 13 H.A end
+ -2 4618 a -2 4618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1939) cvn H.B /DEST pdfmark
+end
+ -2 4618 a 396
+4724 a FC(As)h(of)f(v)o(ersion)f(1.8.1,)g(there)g(is)i(a)g(ne)n(w)f
+(command)e(line)j(\003ag)2187 4724 y
+SDict begin H.S end
+ 2187 4724 a 2187
+4724 a
+SDict begin 13 H.A end
+ 2187 4724 a 2187 4724 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1940) cvn H.B /DEST pdfmark
+end
+ 2187 4724 a Fx(--inter)o(active)e
+FC(to)h(enable)g(interacti)n(v)o(e)e(updates.)i(If)396
+4832 y(you)g(use)g(this)h(\003ag)f(together)f(with)1420
+4832 y
+SDict begin H.S end
+ 1420 4832 a 1420 4832 a
+SDict begin 13 H.A end
+ 1420 4832 a 1420 4832
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1941) cvn H.B /DEST pdfmark
+end
+ 1420 4832 a Fx(-t)i(update)p FC(,)d(you)h(will)i(be)f(ask)o(ed)g(if)h
+(the)f(database)g(entry)f(should)g(be)h(updated,)396
+4940 y(whene)n(v)o(er)736 4940 y
+SDict begin H.S end
+ 736 4940 a 736 4940
+a
+SDict begin 13 H.A end
+ 736 4940 a 736 4940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1942) cvn H.B /DEST pdfmark
+end
+ 736 4940 a FC(samhain)g(encounters)e(a)j
+(modi\002ed)e(\002le.)-2 4951 y
+SDict begin H.S end
+ -2 4951 a -2 4951 a
+SDict begin 13 H.A end
+ -2
+4951 a -2 4951 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DATABASEFILE) cvn H.B /DEST
+pdfmark end
+ -2 4951 a Black 3661 5805 a Fx(50)p
+Black eop end
+%%Page: 51 56
+TeXDict begin 51 55 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.51) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1977) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black -2 330 a Fu(5.8.)39 b(The)g(\002le)g(signature)f(database)2129
+330 y
+SDict begin H.S end
+ 2129 330 a 2129 330 a
+SDict begin 22.464 H.A end
+ 2129 330 a 2129 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.40.1) cvn H.B /DEST pdfmark
+end
+ 2129
+330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1945) cvn H.B /DEST pdfmark
+end
+ -2
+528 a 396 604 a FC(The)20 b(database)g(\002le)h(is)g(named)1298
+604 y
+SDict begin H.S end
+ 1298 604 a 1298 604 a
+SDict begin 13 H.A end
+ 1298 604 a 1298 604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1946) cvn H.B /DEST pdfmark
+end
+ 1298
+604 a Fr(samhain_file)e FC(by)g(def)o(ault,)h(and)f(placed)h(into)396
+712 y
+SDict begin H.S end
+ 396 712 a 396 712 a
+SDict begin 13 H.A end
+ 396 712 a 396 712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1947) cvn H.B /DEST pdfmark
+end
+ 396 712
+a Fr(/usr/local/var/lib/samhain)d FC(by)i(def)o(ault)h(\(name)f(and)h
+(location)f(can)h(be)g(con\002gured)e(at)j(compile)396
+820 y(time\).)-2 1001 y
+SDict begin H.S end
+ -2 1001 a -2 1001 a
+SDict begin 13 H.A end
+ -2 1001 a
+-2 1001 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1948) cvn H.B /DEST pdfmark
+end
+ -2 1001 a 396 1094 a FC(The)f(database)g(is)h(a)f(binary)f
+(\002le.)i(F)o(or)f(security)f(reasons,)h(it)h(is)g(recommended)c(to)j
+(store)g(a)h(backup)e(cop)o(y)g(of)h(the)396 1202 y(database)g(on)g
+(read-only)e(media,)h(otherwise)g(you)h(will)h(not)f(be)g(able)g(to)g
+(recognize)f(\002le)h(modi\002cations)f(after)h(its)396
+1310 y(deletion)g(\(by)f(accident)g(or)h(by)g(some)g(malicious)g
+(person\).)-2 1494 y
+SDict begin H.S end
+ -2 1494 a -2 1494 a
+SDict begin 13 H.A end
+ -2 1494 a -2
+1494 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1949) cvn H.B /DEST pdfmark
+end
+ -2 1494 a -2 1494 a
+SDict begin H.S end
+ -2 1494 a -2 1494 a
+SDict begin 13 H.A end
+ -2 1494
+a -2 1494 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1950) cvn H.B /DEST pdfmark
+end
+ -2 1494 a 396 1584 a FC(samhain)g(will)h(compute)d(the)j
+(checksum)d(of)i(the)g(database)g(at)h(startup)e(and)h(v)o(erify)f(it)i
+(at)f(each)g(access.)3404 1584 y
+SDict begin H.S end
+ 3404 1584 a 3404 1584
+a
+SDict begin 13 H.A end
+ 3404 1584 a 3404 1584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1951) cvn H.B /DEST pdfmark
+end
+ 3404 1584 a FC(samhain)396
+1692 y(will)h(\002rst)g(open\(\))e(the)h(database,)f(compute)g(the)h
+(checksum,)f(re)n(wind)g(the)h(\002le,)h(and)e(then)h(read)g(it.)g
+(Thus)g(it)h(is)g(not)396 1800 y(possible)f(to)h(modify)d(the)i(\002le)
+h(between)f(checksumming)d(and)j(reading.)-2 1828 y
+SDict begin H.S end
+ -2
+1828 a -2 1828 a
+SDict begin 13 H.A end
+ -2 1828 a -2 1828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUIDCHK) cvn H.B /DEST pdfmark
+end
+ -2 1828 a 359 x
+Fu(5.9.)39 b(Chec)m(king)f(the)h(\002le)g(system)f(f)m(or)h(SUID/SGID)f
+(binaries)3550 2187 y
+SDict begin H.S end
+ 3550 2187 a 3550 2187 a
+SDict begin 22.464 H.A end
+ 3550 2187
+a 3550 2187 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.41.1) cvn H.B /DEST pdfmark
+end
+ 3550 2187 a -2 2385 a
+SDict begin H.S end
+ -2 2385 a -2 2385
+a
+SDict begin 13 H.A end
+ -2 2385 a -2 2385 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1954) cvn H.B /DEST pdfmark
+end
+ -2 2385 a 396 2461 a FC(T)-7 b(o)21
+b(compile)e(with)h(support)f(for)h(this)g(option,)f(use)h(the)h
+(con\002gure)d(option)-2 2645 y
+SDict begin H.S end
+ -2 2645 a -2 2645 a
+SDict begin 13 H.A end
+ -2
+2645 a -2 2645 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1955) cvn H.B /DEST pdfmark
+end
+ -2 2645 a -2 2645 a
+SDict begin H.S end
+ -2 2645 a -2 2645
+a
+SDict begin 13 H.A end
+ -2 2645 a -2 2645 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1956) cvn H.B /DEST pdfmark
+end
+ -2 2645 a 396 2735 a Fy(./con\002gur)o(e)h
+(--with-suidcheck)-2 2918 y
+SDict begin H.S end
+ -2 2918 a -2 2918 a
+SDict begin 13 H.A end
+ -2 2918
+a -2 2918 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1957) cvn H.B /DEST pdfmark
+end
+ -2 2918 a 396 3009 a FC(If)h(enabled,)f(this)i(will)g
+(cause)f(the)g(samhain)f(daemon)g(to)h(check)g(the)g(whole)g(\002le)h
+(system)f(hierarchy)e(for)396 3117 y(SUID/SGID)i(\002les)i(at)e(user)n
+(-de\002ned)f(interv)n(als,)g(and)h(to)g(report)f(on)h(an)o(y)f(that)i
+(are)f(not)g(included)e(in)j(the)f(\002le)396 3225 y(database.)g(Upon)f
+(database)g(initialization,)h(all)g(SUID/SGID)h(\002les)g(will)g
+(automatically)d(be)j(included)d(in)j(the)396 3333 y(database.)f
+(Excluded)e(are)i(nfs,)g(proc,)f(msdos,)h(vf)o(at,)g(and)f(iso9660)g
+(\(CD-R)m(OM\))h(\002le)h(systems,)f(as)h(well)g(as)g(\002le)396
+3441 y(systems)g(mounted)d(with)j(the)f('nosuid')e(options)i(\(the)f
+(latter)i(is)g(not)f(supported)e(on)i(all)h(OSes,)f(b)n(ut)g(at)h
+(least)g(on)396 3549 y(Linux\).)-2 3730 y
+SDict begin H.S end
+ -2 3730 a -2
+3730 a
+SDict begin 13 H.A end
+ -2 3730 a -2 3730 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1958) cvn H.B /DEST pdfmark
+end
+ -2 3730 a 396 3823 a FC(On)f(Linux,)f
+(\002les)i(that)g(are)f(mark)o(ed)f(as)i(candidates)e(for)g(mandatory)f
+(locking)h(\(group-id)e(bit)k(set,)g(group-e)o(x)o(ecute)396
+3931 y(bit)g(cleared\))e(will)i(be)f(ignored.)-2 4115
+y
+SDict begin H.S end
+ -2 4115 a -2 4115 a
+SDict begin 13 H.A end
+ -2 4115 a -2 4115 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1959) cvn H.B /DEST pdfmark
+end
+ -2 4115 a 396
+4205 a FC(Y)-9 b(ou)20 b(can)g(manually)f(e)o(xclude)f(one)i(directory)
+e(\(see)j(belo)n(w\);)e(this)i(should)e(be)h(used)g(only)f(for)h
+(obscure)f(problems)396 4313 y(\(e.g.:)h(/net/localhost)f(on)h(Solaris)
+g(-)g(the)h(automounter)c(will)k(mirror)e(the)h(root)f(directory)g
+(twice,)h(as)396 4421 y('/net/localhost')f(and)g
+('/net/localhost/net/localhost',)e(and)j(an)o(y)f(nfs)h(\002le)h
+(system)f(in)h('/')f(will)h(be)f(labelled)g(as)g(ufs)396
+4529 y(system)h(in)f('/net/localhost/net/localhost')d(.)12
+b(.)g(.)g(\).)-2 4547 y
+SDict begin H.S end
+ -2 4547 a -2 4547 a
+SDict begin 11.7 H.A end
+ -2 4547 a
+-2 4547 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1960) cvn H.B /DEST pdfmark
+end
+ -2 4547 a -2 4671 a
+SDict begin H.S end
+ -2 4671 a -2 4671 a
+SDict begin 11.7 H.A end
+ -2
+4671 a -2 4671 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1962) cvn H.B /DEST pdfmark
+end
+ -2 4671 a 562 4750 a Fw(NO)m(TE:)20
+b Fv(The)g(SUID)g(chec)o(k)g(is)h(v)n(er)r(y)g(I/O)f(e)n(xpensiv)n(e)o
+(.)f(Using)h('nice')f(ma)n(y)h(not)g(help)m(,)f(if)h(the)f(CPU)i(is)f
+(w)o(aiting)e(f)n(or)562 4847 y(I/O)j(all)e(the)h(time)g(an)o(yw)o(a)n
+(y)-7 b(.)19 b(T)-9 b(o)20 b(limit)f(the)h(load,)f(the)g(f)n(ollo)o
+(wing)e(options)i(are)h(pro)o(vided:)-2 4905 y
+SDict begin H.S end
+ -2 4905
+a -2 4905 a
+SDict begin 11.7 H.A end
+ -2 4905 a -2 4905 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1963) cvn H.B /DEST pdfmark
+end
+ -2 4905 a 562 4986 a
+Fv(Y)-10 b(ou)20 b(can)847 4986 y
+SDict begin H.S end
+ 847 4986 a 847 4986
+a
+SDict begin 11.7 H.A end
+ 847 4986 a 847 4986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1964) cvn H.B /DEST pdfmark
+end
+ 847 4986 a Fq(schedule)g Fv(e)n(x)n(ecution)e
+(at)i(\002x)n(ed)h(times)f(with)2117 4986 y
+SDict begin H.S end
+ 2117 4986
+a 2117 4986 a
+SDict begin 11.7 H.A end
+ 2117 4986 a 2117 4986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1965) cvn H.B /DEST pdfmark
+end
+ 2117 4986 a Fw(SuidChec)o(kSc)o
+(hedule=)2882 4986 y
+SDict begin H.S end
+ 2882 4986 a 2882 4986 a
+SDict begin 11.7 H.A end
+ 2882 4986
+a 2882 4986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1966) cvn H.B /DEST pdfmark
+end
+ 2882 4986 a Fm(schedule)p Fv(.)-2 5029
+y
+SDict begin H.S end
+ -2 5029 a -2 5029 a
+SDict begin 11.7 H.A end
+ -2 5029 a -2 5029 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1967) cvn H.B /DEST pdfmark
+end
+ -2 5029 a 562
+5125 a Fv(Y)-10 b(ou)20 b(can)847 5125 y
+SDict begin H.S end
+ 847 5125 a 847
+5125 a
+SDict begin 11.7 H.A end
+ 847 5125 a 847 5125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1968) cvn H.B /DEST pdfmark
+end
+ 847 5125 a Fq(limit)f(I/O)24
+b Fv(with)c(the)1403 5125 y
+SDict begin H.S end
+ 1403 5125 a 1403 5125 a
+SDict begin 11.7 H.A end
+ 1403
+5125 a 1403 5125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1969) cvn H.B /DEST pdfmark
+end
+ 1403 5125 a Fw(SuidChec)o(kFps=)1969
+5125 y
+SDict begin H.S end
+ 1969 5125 a 1969 5125 a
+SDict begin 11.7 H.A end
+ 1969 5125 a 1969 5125
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1970) cvn H.B /DEST pdfmark
+end
+ 1969 5125 a Fm(fps)d Fv(option)h(\(fps:)i(\002les)h(per)f(second\).)p
+Black 3661 5805 a Fx(51)p Black eop end
+%%Page: 52 57
+TeXDict begin 52 56 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.52) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1971) cvn H.B /DEST pdfmark
+end
+ -2 226 a 562 309 a Fv(As)h(an)f(alter)r(nativ)n(e)e
+(to)i(the)1347 309 y
+SDict begin H.S end
+ 1347 309 a 1347 309 a
+SDict begin 11.7 H.A end
+ 1347 309 a
+1347 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1972) cvn H.B /DEST pdfmark
+end
+ 1347 309 a Fw(SuidChec)o(kFps)d Fv(option,)h(y)o(ou)h(can)i
+(use)2553 309 y
+SDict begin H.S end
+ 2553 309 a 2553 309 a
+SDict begin 11.7 H.A end
+ 2553 309 a 2553
+309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1973) cvn H.B /DEST pdfmark
+end
+ 2553 309 a Fw(SuidChec)o(kYield=)3165 309 y
+SDict begin H.S end
+ 3165
+309 a 3165 309 a
+SDict begin 11.7 H.A end
+ 3165 309 a 3165 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1974) cvn H.B /DEST pdfmark
+end
+ 3165 309 a Fm(yes)p
+Fv(.)c(This)j(will)562 406 y(cause)g(the)f(SuidChec)o(k)e(module)h(to)i
+(yield)f(its)g(time)h(slice)f(after)g(each)g(\002le)o(.)g(If)2780
+406 y
+SDict begin H.S end
+ 2780 406 a 2780 406 a
+SDict begin 11.7 H.A end
+ 2780 406 a 2780 406 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1975) cvn H.B /DEST pdfmark
+end
+ 2780
+406 a Fw(SuidChec)o(kYield)d Fv(is)k(used,)e(the)562
+503 y
+SDict begin H.S end
+ 562 503 a 562 503 a
+SDict begin 11.7 H.A end
+ 562 503 a 562 503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1976) cvn H.B /DEST pdfmark
+end
+ 562 503
+a Fw(SuidChec)o(kFps)f Fv(option)h(will)h(not)h(tak)o(e)f(eff)n(ect.)
+562 642 y(The)h(schedule)f(should)g(ha)o(v)n(e)g(the)h(same)g(syntax)h
+(as)f(a)h(crontab)e(entr)r(y)h(\(see)g(crontab\(5\))e(and)i(e)n(xample)
+562 739 y(belo)o(w\),)f(with)g(the)h(f)n(ollo)o(wing)d(e)n(xceptions:)i
+(\(a\))h(lists)g(are)g(not)f(allo)o(w)o(ed,)f(and)i(\(b\))g(r)o(anges)f
+(of)h(names)g(are)562 836 y(allo)o(w)o(ed.)e(If)j(a)f(schedule)f(is)h
+(giv)n(en,)g(the)f Fw(SuidChec)o(kInter)q(v)o(al)c Fv(option)j(will)i
+(not)f(tak)o(e)h(eff)n(ect.)f(Y)-10 b(ou)19 b(can)562
+933 y(specify)i(a)f(list)g(of)g(schedules)f(with)h(successiv)n(e)h
+(SuidChec)o(kSchedule=...)15 b(directiv)n(es)o(.)39 1082
+y
+SDict begin H.S end
+ 39 1082 a 39 1082 a
+SDict begin 13 H.A end
+ 39 1082 a 39 1082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUIDCHK-QUARANTINE) cvn H.B
+/DEST pdfmark end
+ 39 1082 a 396
+1411 a Fp(5.9.1.)36 b(Quarantine)e(SUID/SGID)g(\002les)2275
+1411 y
+SDict begin H.S end
+ 2275 1411 a 2275 1411 a
+SDict begin 18.72 H.A end
+ 2275 1411 a 2275 1411
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.41.23.2) cvn H.B /DEST pdfmark
+end
+ 2275 1411 a -2 1583 a
+SDict begin H.S end
+ -2 1583 a -2 1583 a
+SDict begin 13 H.A end
+ -2 1583 a
+-2 1583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1981) cvn H.B /DEST pdfmark
+end
+ -2 1583 a 396 1685 a FC(As)21 b(of)f(v)o(ersion)f(1.8.4,)g
+(it)i(is)g(possible)f(to)1592 1685 y
+SDict begin H.S end
+ 1592 1685 a 1592
+1685 a
+SDict begin 13 H.A end
+ 1592 1685 a 1592 1685 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1982) cvn H.B /DEST pdfmark
+end
+ 1592 1685 a Fx(quar)o(antine)e
+FC(ne)n(w)i(SUID/SGID)g(\002les)h(detected)f(by)3124
+1685 y
+SDict begin H.S end
+ 3124 1685 a 3124 1685 a
+SDict begin 13 H.A end
+ 3124 1685 a 3124 1685
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1983) cvn H.B /DEST pdfmark
+end
+ 3124 1685 a FC(samhain.)g(T)-7 b(o)20 b(use)396 1792
+y(this)h(option,)e(you)g(must)h(\002rst)h(enable)f(it)h(with)1741
+1792 y
+SDict begin H.S end
+ 1741 1792 a 1741 1792 a
+SDict begin 13 H.A end
+ 1741 1792 a 1741 1792
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1984) cvn H.B /DEST pdfmark
+end
+ 1741 1792 a Fy(SuidCheckQuarantineFiles=)2753 1792
+y
+SDict begin H.S end
+ 2753 1792 a 2753 1792 a
+SDict begin 13 H.A end
+ 2753 1792 a 2753 1792 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1985) cvn H.B /DEST pdfmark
+end
+ 2753
+1792 a Fl(yes)q FC(.)e(This)h(tells)h(the)g(SuidCheck)396
+1900 y(module)e(to)h(quarantine)f(an)o(y)g(SUID/SGID)h(\002les)h(found)
+e(after)h(the)g(initialization)f(of)h(the)h(database)e(using)h(the)396
+2008 y(method)f(selected)h(in)1040 2008 y
+SDict begin H.S end
+ 1040 2008 a
+1040 2008 a
+SDict begin 13 H.A end
+ 1040 2008 a 1040 2008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1986) cvn H.B /DEST pdfmark
+end
+ 1040 2008 a Fy
+(SuidCheckQuarantineMethod)f FC(\(see)i(ne)o(xt)e(paragraph\).)e(If)j
+(this)h(is)g(used,)f(the)g(\002le)h(will)396 2116 y(be)f(logged)f(each)
+h(time)g(it)h(is)g(found)e(and)g(not)h(added)f(to)i(the)f(memory)e
+(resident)i(database.)-2 2300 y
+SDict begin H.S end
+ -2 2300 a -2 2300 a
+SDict begin 13 H.A end
+ -2
+2300 a -2 2300 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1987) cvn H.B /DEST pdfmark
+end
+ -2 2300 a 396 2390 a FC(Y)-9 b(ou)20
+b(must)g(also)h(choose)e(a)i(method)d(to)j(be)f(used)g(to)g(quarantine)
+e(a)j(SUID/SGID)f(\002le:)396 2498 y
+SDict begin H.S end
+ 396 2498 a 396 2498
+a
+SDict begin 13 H.A end
+ 396 2498 a 396 2498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1988) cvn H.B /DEST pdfmark
+end
+ 396 2498 a Fy(SuidCheckQuarantineMethod=)1519
+2498 y
+SDict begin H.S end
+ 1519 2498 a 1519 2498 a
+SDict begin 13 H.A end
+ 1519 2498 a 1519 2498
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1989) cvn H.B /DEST pdfmark
+end
+ 1519 2498 a Fl(0/1/2)p FC(.)f(Currently)-5 b(,)18 b(there)i(are)g(3)g
+(methods)g(implemented:)e(0)i(-)h(Delete)f(the)396 2606
+y(\002le)h(from)e(the)h(system.)h(1)f(-)g(Remo)o(v)o(e)f(the)h
+(SUID/SGID)h(permissions)e(from)g(the)h(\002le.)h(2)f(-)h(Mo)o(v)o(e)e
+(the)396 2714 y(SUID/SGID)h(\002le)h(to)g(a)f(quarantine)e(directory)-5
+b(.)18 b(The)i(quarantine)e(directory)h(is)396 2822 y
+SDict begin H.S end
+
+396 2822 a 396 2822 a
+SDict begin 13 H.A end
+ 396 2822 a 396 2822 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1990) cvn H.B /DEST pdfmark
+end
+ 396 2822
+a Fr(DEFAULT_DATAROOT/.quarantine)p FC(.)d(Each)k(\002le)h(mo)o(v)o(ed)
+d(there)i(has)g(an)g(additional)f(\002le)i(created)e(that)396
+2930 y(contains)h(information)e(about)h(the)h(SUID/SGID)g(\002le.)h(F)o
+(or)f(e)o(xample,)e(if)j(a)f(\002le)2725 2930 y
+SDict begin H.S end
+ 2725
+2930 a 2725 2930 a
+SDict begin 13 H.A end
+ 2725 2930 a 2725 2930 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1991) cvn H.B /DEST pdfmark
+end
+ 2725 2930
+a Fr(/foo)g FC(is)h(an)f(unauthorized)396 3038 y(SUID/SGID)g(\002le,)h
+(then)f(it)h(will)g(be)f(remo)o(v)o(ed)e(and)h(mo)o(v)o(ed)f(to)2234
+3038 y
+SDict begin H.S end
+ 2234 3038 a 2234 3038 a
+SDict begin 13 H.A end
+ 2234 3038 a 2234 3038
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1992) cvn H.B /DEST pdfmark
+end
+ 2234 3038 a Fr(/var/lib/samhain/.quarantine)e FC(and)396
+3146 y(another)j(\002le,)814 3146 y
+SDict begin H.S end
+ 814 3146 a 814 3146
+a
+SDict begin 13 H.A end
+ 814 3146 a 814 3146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1993) cvn H.B /DEST pdfmark
+end
+ 814 3146 a Fr(foo.info)p FC(,)g(will)i(be)f
+(created)f(in)1809 3146 y
+SDict begin H.S end
+ 1809 3146 a 1809 3146 a
+SDict begin 13 H.A end
+ 1809
+3146 a 1809 3146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1994) cvn H.B /DEST pdfmark
+end
+ 1809 3146 a Fr(/var/lib/samhain/.quarantine)d
+FC(with)k(information)396 3254 y(about)601 3254 y
+SDict begin H.S end
+ 601
+3254 a 601 3254 a
+SDict begin 13 H.A end
+ 601 3254 a 601 3254 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1995) cvn H.B /DEST pdfmark
+end
+ 601 3254 a Fr(/foo)p
+FC(.)-2 3260 y
+SDict begin H.S end
+ -2 3260 a -2 3260 a
+SDict begin 11.7 H.A end
+ -2 3260 a -2 3260
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1996) cvn H.B /DEST pdfmark
+end
+ -2 3260 a 745 3359 2668 17 v 745 4566 17 1208 v 1843
+3513 a Fp(CA)-10 b(VEA)f(T)786 3680 y
+SDict begin H.S end
+ 786 3680 a 786
+3680 a
+SDict begin 11.7 H.A end
+ 786 3680 a 786 3680 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1998) cvn H.B /DEST pdfmark
+end
+ 786 3680 a 96 x Fv(Methods)20
+b(0)g(and)g(2)g(will)f(b)o(y)h(def)n(ault)e(not)i(remo)o(v)n(e)g(the)f
+(or)q(iginal)f(\002le)o(,)i(b)o(ut)f(r)o(ather)g(tr)q(uncate)786
+3873 y(to)i(z)o(ero)f(siz)o(e)g(and)f(remo)o(v)n(e)h(suid/sgid)f
+(proper)s(ties)o(.)f(If)i(y)o(ou)g(really)f(w)o(ant)g(to)h(remo)o(v)n
+(e)g(the)786 3970 y(or)q(iginal)e(\002le)i(r)o(ather)g(than)f(tr)q
+(uncate)o(,)f(y)o(ou)i(need)f(to)h(set)h(the)e(option)786
+4067 y
+SDict begin H.S end
+ 786 4067 a 786 4067 a
+SDict begin 11.7 H.A end
+ 786 4067 a 786 4067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:1999) cvn H.B /DEST pdfmark
+end
+ 786
+4067 a Fw(SuidChec)o(kQuarantineDele)o(te=)1839 4067
+y
+SDict begin H.S end
+ 1839 4067 a 1839 4067 a
+SDict begin 11.7 H.A end
+ 1839 4067 a 1839 4067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2000) cvn H.B /DEST pdfmark
+end
+ 1839
+4067 a Fm(yes)786 4243 y
+SDict begin H.S end
+ 786 4243 a 786 4243 a
+SDict begin 11.7 H.A end
+ 786 4243
+a 786 4243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2001) cvn H.B /DEST pdfmark
+end
+ 786 4243 a 88 x Fv(Remo)o(ving)g(a)i(\002le)f(in)g(an)g
+(arbitr)o(ar)r(y)f(director)r(y)h(is)g(considered)e(to)j(be)2757
+4331 y
+SDict begin H.S end
+ 2757 4331 a 2757 4331 a
+SDict begin 11.7 H.A end
+ 2757 4331 a 2757 4331
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2002) cvn H.B /DEST pdfmark
+end
+ 2757 4331 a Fq(dangerous)r Fv(,)786 4428 y(because)f(the)f(object)g
+(that)h(is)h(unlink)o(ed)c(ma)n(y)k(not)e(be)h(the)g(same)g(object)f
+(an)o(ymore)h(that)786 4525 y(has)h(been)e(deter)r(mined)e(to)j(be)g(a)
+g(suid/sgid)f(\002le)h(bef)n(ore)o(.)e(Y)-10 b(ou)19
+b(ha)o(v)n(e)h(been)f(w)o(ar)r(ned.)p 3396 4566 17 1208
+v 745 4583 2668 17 v -2 4676 a
+SDict begin H.S end
+ -2 4676 a -2 4676 a
+SDict begin 13 H.A end
+ -2
+4676 a -2 4676 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUIDCHK-CONFIG) cvn H.B /DEST
+pdfmark end
+ -2 4676 a 396 4946 a Fp(5.9.2.)36 b(Con\002guration)
+1512 4946 y
+SDict begin H.S end
+ 1512 4946 a 1512 4946 a
+SDict begin 18.72 H.A end
+ 1512 4946 a 1512
+4946 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.41.24.2) cvn H.B /DEST pdfmark
+end
+ 1512 4946 a -2 5139 a
+SDict begin H.S end
+ -2 5139 a -2 5139 a
+SDict begin 13 H.A end
+ -2 5139
+a -2 5139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2005) cvn H.B /DEST pdfmark
+end
+ -2 5139 a 396 5220 a FC(This)21 b(f)o(acility)f(is)h
+(con\002gured)d(in)i(the)1479 5220 y
+SDict begin H.S end
+ 1479 5220 a 1479
+5220 a
+SDict begin 13 H.A end
+ 1479 5220 a 1479 5220 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2006) cvn H.B /DEST pdfmark
+end
+ 1479 5220 a Fx(SuidChec)n(k)h
+FC(section)f(of)g(the)g(con\002guration)d(\002le.)-2
+5404 y
+SDict begin H.S end
+ -2 5404 a -2 5404 a
+SDict begin 13 H.A end
+ -2 5404 a -2 5404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2007) cvn H.B /DEST pdfmark
+end
+ -2 5404
+a Black 3661 5805 a Fx(52)p Black eop end
+%%Page: 53 58
+TeXDict begin 53 57 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.53) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2020) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2008) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 486 309 a Fr([SuidCheck])486 406 y(#)45 b(activate)e(\(0)i(for)f
+(switching)f(off\))486 503 y(SuidCheckActive=1)486 600
+y(#)i(interval)e(between)h(checks)g(\(in)g(seconds,)f(default)h(7200\))
+486 697 y(#)h(SuidCheckInterval=86400)486 794 y(#)g(scheduled)e(check)h
+(at)g(01:30)g(each)h(night)486 892 y(SuidCheckSchedule=30)c(1)k(*)g(*)f
+(*)486 989 y(#)h(this)f(is)g(the)h(severity)e(\(see)p
+0 TeXcolorgray 1741 989 a
+SDict begin H.S end
+ 1741 989 a Fr(Section)h(4.1.1)2325
+989 y
+SDict begin 11.7 H.L end
+ 2325 989 a 2325 989 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2325 989 a Black -1 w Fr(>\))486
+1086 y(SeveritySuidCheck=crit)486 1183 y(#)h(you)f(may)g(manually)g
+(exclude)f(one)i(directory)486 1280 y(SuidCheckExclude=/net/localhost)
+486 1377 y(#)486 1474 y(#)g(limit)f(on)g(files)g(per)g(seconds)486
+1571 y(SuidCheckFps=250)486 1669 y(#)h(alternatively)d(yield)i(time)g
+(slice)g(after)g(each)h(file)486 1766 y(#)g(SuidCheckYield=yes)486
+1863 y(#)486 1960 y(#)g(Quarantine)e(detected)g(SUID/SGID)h(files)486
+2057 y(#)h(SuidCheckQuarantineFiles=no)486 2154 y(#)486
+2251 y(#)g(Quarantine)e(Method)486 2349 y(#)i(0)f(-)h(Delete)f(the)g
+(file)g(from)g(the)h(system.)486 2446 y(#)g(1)f(-)h(Remove)f(the)g
+(SUID/SGID)f(permissions)g(from)i(the)f(file.)486 2543
+y(#)h(2)f(-)h(Move)f(the)g(SUID/SGID)g(file)g(to)g(a)h(quarantine)e
+(directory.)486 2640 y(#)224 b(The)44 b(quarantine)f(directory)h(is)g
+(DEFAULT_DATAROOT/.quarantine.)486 2737 y(#)h
+(SuidCheckQuarantineMethod)40 b(=)45 b(1)486 2834 y(#)486
+2931 y(#)g(Really)e(delete)h(if)h(using)f(methods)f(0)i(or)g(2)486
+3028 y(#)g(SuidCheckQuarantineDelete)40 b(=)45 b(no)-2
+3410 y
+SDict begin H.S end
+ -2 3410 a -2 3410 a
+SDict begin 13 H.A end
+ -2 3410 a -2 3410 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KERNELDEF) cvn H.B /DEST pdfmark
+end
+ -2 3410
+a 377 x Fu(5.10.)39 b(Detecting)e(K)n(ernel)h(r)m(ootkits)2059
+3787 y
+SDict begin H.S end
+ 2059 3787 a 2059 3787 a
+SDict begin 22.464 H.A end
+ 2059 3787 a 2059 3787
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.42.1) cvn H.B /DEST pdfmark
+end
+ 2059 3787 a -2 3985 a
+SDict begin H.S end
+ -2 3985 a -2 3985 a
+SDict begin 13 H.A end
+ -2 3985 a
+-2 3985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2012) cvn H.B /DEST pdfmark
+end
+ -2 3985 a 396 4061 a FC(This)21 b(option)e(is)i(currently)d
+(supported)g(only)i(for)f(Linux,)g(k)o(ernel)h(v)o(ersions)f(2.2.x,)f
+(2.4.x,)h(and)h(2.6.x)e(on)i(ix86)396 4169 y(machines,)f(and)h(for)g
+(FreeBSD)g(\(tested)g(on)g(FreeBSD)h(4.6.2\).)-2 4184
+y
+SDict begin H.S end
+ -2 4184 a -2 4184 a
+SDict begin 11.7 H.A end
+ -2 4184 a -2 4184 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2013) cvn H.B /DEST pdfmark
+end
+ -2 4184 a 745
+4283 2668 17 v 745 4921 17 638 v 1842 4437 a Fp(W)-5
+b(arning)786 4630 y
+SDict begin H.S end
+ 786 4630 a 786 4630 a
+SDict begin 11.7 H.A end
+ 786 4630 a
+786 4630 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2015) cvn H.B /DEST pdfmark
+end
+ 786 4630 a 70 x Fv(It)21 b(is)g(incorrect)e(to)h(assume)g
+(that)g(disab)o(ling)d(suppor)s(t)i(f)n(or)g(loadab)o(le)e(k)o(er)r
+(nel)i(modules)786 4797 y(protects)h(against)f(r)q(untime)g(k)o(er)r
+(nel)f(modi\002cations)o(.)h(It)h(is)h(possib)o(le)d(to)i(modify)g(the)
+786 4895 y(k)o(er)r(nel)f(via)h(/de)n(v/kmem)g(as)h(w)o(ell.)p
+3396 4921 17 638 v 745 4938 2668 17 v -2 5114 a
+SDict begin H.S end
+ -2 5114
+a -2 5114 a
+SDict begin 13 H.A end
+ -2 5114 a -2 5114 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2016) cvn H.B /DEST pdfmark
+end
+ -2 5114 a 396 5179 a
+FC(T)-7 b(o)21 b(use)f(this)h(f)o(acility)-5 b(,)19 b(you)h(need)f(to)h
+(compile)g(with)g(the)g(option:)p Black 3661 5805 a Fx(53)p
+Black eop end
+%%Page: 54 59
+TeXDict begin 54 58 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.54) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2017) cvn H.B /DEST pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+
+-2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2018) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a Fy(./con\002gur)o(e)f
+(--with-kcheck=)1328 309 y
+SDict begin H.S end
+ 1328 309 a 1328 309 a
+SDict begin 13 H.A end
+ 1328
+309 a 1328 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2019) cvn H.B /DEST pdfmark
+end
+ 1328 309 a Fl(/path/to/System.map)g
+FC(\(Linux\),)f(or)396 583 y Fy(./con\002gur)o(e)h(--with-kcheck)h
+FC(\(FreeBSD\).)-2 766 y
+SDict begin H.S end
+ -2 766 a -2 766 a
+SDict begin 13 H.A end
+ -2 766 a -2
+766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2022) cvn H.B /DEST pdfmark
+end
+ -2 766 a 396 857 a FC(On)g(Linux,)758 857 y
+SDict begin H.S end
+ 758
+857 a 758 857 a
+SDict begin 13 H.A end
+ 758 857 a 758 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2023) cvn H.B /DEST pdfmark
+end
+ 758 857 a Fr(System.map)f
+FC(is)j(a)e(\002le)h(\(sometimes)f(with)g(the)g(k)o(ernel)g(v)o(ersion)
+e(appended)g(to)j(its)g(name\))e(that)h(is)396 965 y(generated)f(when)g
+(the)i(k)o(ernel)e(is)i(compiled,)e(and)g(is)i(usually)f(installed)g
+(in)g(the)h(same)f(directory)e(as)j(your)e(k)o(ernel)396
+1073 y(\(e.g.)565 1073 y
+SDict begin H.S end
+ 565 1073 a 565 1073 a
+SDict begin 13 H.A end
+ 565 1073
+a 565 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2024) cvn H.B /DEST pdfmark
+end
+ 565 1073 a Fr(/boot)p FC(\),)g(or)h(in)g(the)g(root)g
+(directory)-5 b(.)18 b(T)-7 b(o)20 b(\002nd)g(it,)h(you)e(can)h(use:)
+2425 1073 y
+SDict begin H.S end
+ 2425 1073 a 2425 1073 a
+SDict begin 13 H.A end
+ 2425 1073 a 2425
+1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2025) cvn H.B /DEST pdfmark
+end
+ 2425 1073 a Fy(locate)g(System.map)-2 1090 y
+SDict begin H.S end
+ -2
+1090 a -2 1090 a
+SDict begin 11.7 H.A end
+ -2 1090 a -2 1090 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2026) cvn H.B /DEST pdfmark
+end
+ -2 1090 a -2 1215
+a
+SDict begin H.S end
+ -2 1215 a -2 1215 a
+SDict begin 11.7 H.A end
+ -2 1215 a -2 1215 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2028) cvn H.B /DEST pdfmark
+end
+ -2 1215 a 562
+1294 a Fw(Updating)f(the)h(kernel:)e Fv(On)j(Lin)o(ux,)e(after)h
+(installing)d(a)j(ne)o(w)g(k)o(er)r(nel,)e(y)o(ou)i(need)f(to)h
+(con\002gure)f(\002v)n(e)i(\(5\))562 1391 y(addresses)f(\(see)g
+(con\002gur)o(ation)e(e)n(xample)h(belo)o(w\),)f(otherwise)h(the)g(k)o
+(er)r(nel)g(chec)o(k)h(will)g(not)f(w)o(or)q(k)i(an)o(ymore)562
+1488 y(\(samhain)e(needs)h(to)g(kno)o(w)g(the)f(ne)o(w)h(position)e(of)
+i(some)h(objects)e(within)g(the)g(k)o(er)r(nel\).)g(As)i(e)n(xplained)
+562 1586 y(belo)o(w)l(,)d(y)o(ou)i(can)g(easily)g(obtain)e(the)i
+(required)e(v)n(alues)i(b)o(y)g(g)o(repping)e(them)i(from)g(the)3055
+1586 y
+SDict begin H.S end
+ 3055 1586 a 3055 1586 a
+SDict begin 11.7 H.A end
+ 3055 1586 a 3055 1586
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2029) cvn H.B /DEST pdfmark
+end
+ 3055 1586 a Ft(System.map)25 b Fv(of)20 b(y)o(our)562
+1683 y(ne)o(w)g(k)o(er)r(nel,)e(which)i(should)f(nor)r(mally)g(be)g
+(installed)f(into)h(the)2386 1683 y
+SDict begin H.S end
+ 2386 1683 a 2386
+1683 a
+SDict begin 11.7 H.A end
+ 2386 1683 a 2386 1683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2030) cvn H.B /DEST pdfmark
+end
+ 2386 1683 a Ft(/boot)k
+Fv(director)r(y)-7 b(,)18 b(together)g(with)i(the)g(k)o(er)r(nel.)39
+1821 y
+SDict begin H.S end
+ 39 1821 a 39 1821 a
+SDict begin 11.7 H.A end
+ 39 1821 a 39 1821 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2031) cvn H.B /DEST pdfmark
+end
+ 39 1821
+a -2 1987 a
+SDict begin H.S end
+ -2 1987 a -2 1987 a
+SDict begin 11.7 H.A end
+ -2 1987 a -2 1987 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2033) cvn H.B /DEST pdfmark
+end
+ -2
+1987 a 562 2085 a Fw(Cr)o(oss-compiling)d(f)o(or)j(a)g(diff)o(erent)f
+(kernel:)g Fv(Y)-10 b(ou)19 b(need)g(at)h(least)g(to)g(perf)n(or)r(m)f
+(the)g(con\002gur)o(ation)f(as)562 2182 y(descr)q(ibed)h(in)p
+0 TeXcolorgray 987 2182 a
+SDict begin H.S end
+ 987 2182 a Fv(Section)g(5.10.1)1467
+2182 y
+SDict begin 11.7 H.L end
+ 1467 2182 a 1467 2182 a
+SDict begin [ /Subtype /Link /Dest (0:KERNELDEF-CONFIG) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1467 2182 a Black -2 w
+Fv(>.)h(Also)m(,)g(if)g(y)o(ou)g(compile)f(f)n(or)h(a)g(2.4)f(k)o(er)r
+(nel)g(on)h(a)g(2.6)g(system,)h(y)o(ou)f(should)562 2279
+y(supply)g(the)924 2279 y
+SDict begin H.S end
+ 924 2279 a 924 2279 a
+SDict begin 11.7 H.A end
+ 924 2279
+a 924 2279 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2035) cvn H.B /DEST pdfmark
+end
+ 924 2279 a Ft(System.map)k Fv(f)n(or)c(the)f(target)g(k)o
+(er)r(nel)g(when)g(r)q(unning)2485 2279 y
+SDict begin H.S end
+ 2485 2279 a
+2485 2279 a
+SDict begin 11.7 H.A end
+ 2485 2279 a 2485 2279 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2036) cvn H.B /DEST pdfmark
+end
+ 2485 2279 a Fw(./con\002gure)p
+Fv(,)f(and)h(y)o(ou)h(should)f(edit)g(the)562 2376 y(\002le)679
+2376 y
+SDict begin H.S end
+ 679 2376 a 679 2376 a
+SDict begin 11.7 H.A end
+ 679 2376 a 679 2376 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2037) cvn H.B /DEST pdfmark
+end
+ 679
+2376 a Ft(config.h)k Fv(after)c(r)q(unning)f(the)1588
+2376 y
+SDict begin H.S end
+ 1588 2376 a 1588 2376 a
+SDict begin 11.7 H.A end
+ 1588 2376 a 1588 2376
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2038) cvn H.B /DEST pdfmark
+end
+ 1588 2376 a Fw(./con\002gure)g Fv(scr)q(ipt,)i(b)o(ut)f(bef)n(ore)g
+(e)n(x)n(ecuting)2902 2376 y
+SDict begin H.S end
+ 2902 2376 a 2902 2376 a
+SDict begin 11.7 H.A end
+
+2902 2376 a 2902 2376 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2039) cvn H.B /DEST pdfmark
+end
+ 2902 2376 a Fw(make)g Fv(in)h(the)g(f)n(ollo)o
+(wing)562 2473 y(w)o(a)n(y:)g(search)g(f)n(or)f(SH_KERNEL_VERSION,)f
+(and)h(set)h(it)g(to)g(the)f(k)o(er)r(nel)f(v)n(ersion)i(\()2986
+2473 y
+SDict begin H.S end
+ 2986 2473 a 2986 2473 a
+SDict begin 11.7 H.A end
+ 2986 2473 a 2986 2473
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2040) cvn H.B /DEST pdfmark
+end
+ 2986 2473 a Fw(uname)f(-r)p Fv(\))h(of)g(the)f(target)562
+2570 y(k)o(er)r(nel.)39 2709 y
+SDict begin H.S end
+ 39 2709 a 39 2709 a
+SDict begin 11.7 H.A end
+ 39
+2709 a 39 2709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2041) cvn H.B /DEST pdfmark
+end
+ 39 2709 a -2 2875 a
+SDict begin H.S end
+ -2 2875 a -2 2875
+a
+SDict begin 11.7 H.A end
+ -2 2875 a -2 2875 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2043) cvn H.B /DEST pdfmark
+end
+ -2 2875 a 562 2972 a Fw(Using)h(the)f(hiding)g
+(kernel)g(module:)h Fv(If)g(y)o(ou)g(also)g(use)g(the)f(option)2571
+2972 y
+SDict begin H.S end
+ 2571 2972 a 2571 2972 a
+SDict begin 11.7 H.A end
+ 2571 2972 a 2571 2972
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2044) cvn H.B /DEST pdfmark
+end
+ 2571 2972 a Fw(./con\002gure)e(--enab)o(le-khide)g
+Fv(to)j(use)562 3069 y(a)h(k)o(er)r(nel)d(module)h(to)h(hide)f(the)h
+(presence)f(of)1896 3069 y
+SDict begin H.S end
+ 1896 3069 a 1896 3069 a
+SDict begin 11.7 H.A end
+ 1896
+3069 a 1896 3069 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2045) cvn H.B /DEST pdfmark
+end
+ 1896 3069 a Fv(samhain,)g(the)g(\002rst)j(detected)c
+(modi\002cation)g(of)i(the)562 3166 y(sys_getdents)f(syscall)i(\(to)f
+(list)g(director)q(ies\))f(will)g(only)h(cause)g(a)g(w)o(ar)r(ning)f
+(\(r)o(ather)g(than)g(an)h(error\),)f(as)h(it)h(is)562
+3263 y(presumed)e(to)h(be)g(caused)g(b)o(y)g(the)g(samhain_hide)d
+(LKM\).)-2 3321 y
+SDict begin H.S end
+ -2 3321 a -2 3321 a
+SDict begin 11.7 H.A end
+ -2 3321 a -2 3321
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2046) cvn H.B /DEST pdfmark
+end
+ -2 3321 a 562 3402 a Fv(Y)-10 b(ou)20 b(should)946
+3402 y
+SDict begin H.S end
+ 946 3402 a 946 3402 a
+SDict begin 11.7 H.A end
+ 946 3402 a 946 3402 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2047) cvn H.B /DEST pdfmark
+end
+ 946
+3402 a Fq(NO)m(T)31 b Fv(initializ)o(e)18 b(the)h(database)f(with)i
+(the)g(samhain_hide)d(LKM)j(loaded)e(\(doing)h(so)h(might)562
+3499 y(result)g(in)g(the)f(non-detection)e(of)j(a)g(real)g(rootkit)f
+(if)h(it)g(also)g(only)g(modi\002es)g(the)f(sys_getdents)g(syscall\).)
+39 3649 y
+SDict begin H.S end
+ 39 3649 a 39 3649 a
+SDict begin 13 H.A end
+ 39 3649 a 39 3649 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KERNELDEF-CONFIG) cvn H.B /DEST
+pdfmark end
+ 39
+3649 a 396 3977 a Fp(5.10.1.)36 b(Con\002guration)1578
+3977 y
+SDict begin H.S end
+ 1578 3977 a 1578 3977 a
+SDict begin 18.72 H.A end
+ 1578 3977 a 1578 3977
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.42.25.2) cvn H.B /DEST pdfmark
+end
+ 1578 3977 a -2 4169 a
+SDict begin H.S end
+ -2 4169 a -2 4169 a
+SDict begin 13 H.A end
+ -2 4169 a
+-2 4169 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2050) cvn H.B /DEST pdfmark
+end
+ -2 4169 a 396 4251 a FC(This)21 b(f)o(acility)f(is)h
+(con\002gured)d(in)i(the)1479 4251 y
+SDict begin H.S end
+ 1479 4251 a 1479
+4251 a
+SDict begin 13 H.A end
+ 1479 4251 a 1479 4251 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2051) cvn H.B /DEST pdfmark
+end
+ 1479 4251 a Fx(K)m(ernel)h
+FC(section)f(of)g(the)g(con\002guration)e(\002le.)-2
+4352 y
+SDict begin H.S end
+ -2 4352 a -2 4352 a
+SDict begin 11.7 H.A end
+ -2 4352 a -2 4352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2052) cvn H.B /DEST pdfmark
+end
+ -2 4352
+a 486 4431 a Fr([Kernel])486 4528 y(#)45 b(activate)e(\(0)i(for)f
+(switching)f(off\))486 4625 y(KernelCheckActive=1)486
+4722 y(#)i(interval)e(between)h(checks)g(\(in)g(seconds,)f(default)h
+(300\))486 4819 y(KernelCheckInterval=20)486 4917 y(#)h(also)f(check)g
+(the)g(interrupt)f(descriptor)h(table)g(\(default)f(TRUE\))486
+5014 y(KernelCheckIDT=TRUE)486 5111 y(#)i(this)f(is)g(the)h(severity)e
+(\(see)h(section)p 0 TeXcolorgray 2100 5111 a
+SDict begin H.S end
+ 2100 5111
+a Fr(Section)g(4.1.1)2684 5111 y
+SDict begin 11.7 H.L end
+ 2684 5111 a 2684 5111
+a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2684 5111 a Black -1 w Fr(\))486 5208 y(SeverityKernel=crit)486
+5305 y(#)486 5402 y(#)h(Only)f(needed)g(for)g(Linux,)g(after)g
+(installing)f(a)i(new)f(kernel.)g(You)g(need)g(the)g(address)p
+Black 3661 5805 a Fx(54)p Black eop end
+%%Page: 55 60
+TeXDict begin 55 59 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.55) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2068) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black 486 309 a Fr(#)45 b(\(first)e(item)i(in)f(the)g(grepped)g
+(line\),)g(prefixed)f(with)i('0x')f(to)g(indicate)486
+406 y(#)h(hexadecimal)e(format.)486 503 y(#)486 600 y(#)i(this)f(is)g
+(the)h(address)e(of)i(system_call)e(\(grep)h(system_call)f
+(System.map\))486 697 y(KernelSystemCall)f(=)j(0xc0106cf8)486
+794 y(#)486 892 y(#)g(this)f(is)g(the)h(address)e(of)i(sys_call_table)d
+(\(grep)i(')h(sys_call_table')d(System.map\))486 989
+y(KernelSyscallTable)g(=)i(0xc01efb98)486 1086 y(#)486
+1183 y(#)h(this)f(is)g(the)h(address)e(of)i(proc_root)e(\(grep)h(')h
+(proc_root$')e(System.map\))486 1280 y(KernelProcRoot)f(=)j(0xc01efb98)
+486 1377 y(#)486 1474 y(#)g(this)f(is)g(the)h(address)e(of)i
+(proc_root_inode_operations)486 1571 y(#)g(\(grep)f
+(proc_root_inode_operations)c(System.map\))486 1669 y
+(KernelProcRootIops)i(=)i(0xc01efb98)486 1766 y(#)486
+1863 y(#)h(this)f(is)g(the)h(address)e(of)i(proc_root_lookup)486
+1960 y(#)g(\(grep)f(proc_root_lookup)e(System.map\))486
+2057 y(KernelProcRootLookup)f(=)k(0xc01efb98)-2 2452
+y
+SDict begin H.S end
+ -2 2452 a -2 2452 a
+SDict begin 13 H.A end
+ -2 2452 a -2 2452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KERNELDEF-WHAT) cvn H.B /DEST
+pdfmark end
+ -2 2452 a 396
+2781 a Fp(5.10.2.)36 b(What)d(is)h(a)g(kernel)h(r)n(ootkit)d(?)2214
+2781 y
+SDict begin H.S end
+ 2214 2781 a 2214 2781 a
+SDict begin 18.72 H.A end
+ 2214 2781 a 2214 2781
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.42.26.2) cvn H.B /DEST pdfmark
+end
+ 2214 2781 a -2 2948 a
+SDict begin H.S end
+ -2 2948 a -2 2948 a
+SDict begin 13 H.A end
+ -2 2948 a
+-2 2948 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2056) cvn H.B /DEST pdfmark
+end
+ -2 2948 a 396 3055 a FC(A)477 3055 y
+SDict begin H.S end
+ 477 3055
+a 477 3055 a
+SDict begin 13 H.A end
+ 477 3055 a 477 3055 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2057) cvn H.B /DEST pdfmark
+end
+ 477 3055 a Fx(r)l(ootkit)22
+b FC(is)f(a)g(set)g(of)f(programs)e(installed)i(to)g("k)o(eep)g(a)g
+(backdoor)e(open")h(after)h(an)g(intruder)f(has)h(obtained)f(root)396
+3163 y(access)i(to)f(a)h(system.)f(Usually)g(such)g(rootkits)g(are)g(v)
+o(ery)f(easy)h(to)g(install,)h(and)f(pro)o(vide)e(f)o(acilities)j(to)f
+(hide)g(the)396 3271 y(intrusion)f(\(e.g.)h(erase)g(all)h(traces)f
+(from)f(audit)h(logs,)g(install)h(a)f(modi\002ed)f('ps')h(that)g(will)h
+(not)f(list)h(certain)396 3379 y(programs,)d(etc.\).)-2
+3563 y
+SDict begin H.S end
+ -2 3563 a -2 3563 a
+SDict begin 13 H.A end
+ -2 3563 a -2 3563 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2058) cvn H.B /DEST pdfmark
+end
+ -2 3563
+a 396 3653 a FC(While)j("normal")e(rootkits)g(can)h(be)g(detected)g
+(with)g(checksums)f(on)h(programs,)e(lik)o(e)2907 3653
+y
+SDict begin H.S end
+ 2907 3653 a 2907 3653 a
+SDict begin 13 H.A end
+ 2907 3653 a 2907 3653 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2059) cvn H.B /DEST pdfmark
+end
+ 2907
+3653 a FC(samhain)i(does)g(\(the)396 3761 y(modi\002ed)f('ps')h(w)o
+(ould)g(ha)n(v)o(e)f(a)i(dif)n(ferent)d(checksum)h(than)h(the)g
+(original)f(one\),)g(this)i(method)e(can)h(be)g(sub)o(v)o(erted)396
+3868 y(by)g(rootkits)g(that)g(modify)e(the)j(k)o(ernel)e(at)i(runtime,)
+d(either)i(with)h(a)2346 3868 y
+SDict begin H.S end
+ 2346 3868 a 2346 3868
+a
+SDict begin 13 H.A end
+ 2346 3868 a 2346 3868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2060) cvn H.B /DEST pdfmark
+end
+ 2346 3868 a Fx(loadable)e(k)o(ernel)h(module)
+f FC(\(LKM\),)g(i.e.)i(a)396 3976 y(module)d(that)i(is)h(loaded)d(into)
+h(the)h(k)o(ernel)f(at)h(runtime,)e(or)h(by)h(writing)f(to)2541
+3976 y
+SDict begin H.S end
+ 2541 3976 a 2541 3976 a
+SDict begin 13 H.A end
+ 2541 3976 a 2541 3976
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2061) cvn H.B /DEST pdfmark
+end
+ 2541 3976 a Fr(/dev/kmem)g FC(\(this)h(allo)n(ws)f(to)h('patch')e(a)
+396 4084 y(k)o(ernel)i(on-the-\003y)e(e)n(v)o(en)h(if)i(the)f(k)o
+(ernel)f(has)1699 4084 y
+SDict begin H.S end
+ 1699 4084 a 1699 4084 a
+SDict begin 13 H.A end
+ 1699
+4084 a 1699 4084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2062) cvn H.B /DEST pdfmark
+end
+ 1699 4084 a Fx(no)g FC(LKM)i(support\).)-2
+4268 y
+SDict begin H.S end
+ -2 4268 a -2 4268 a
+SDict begin 13 H.A end
+ -2 4268 a -2 4268 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2063) cvn H.B /DEST pdfmark
+end
+ -2 4268
+a 396 4358 a FC(K)n(ernel)f(rootkits)f(can)h(modify)f(the)h(action)g
+(of)g(k)o(ernel)1975 4358 y
+SDict begin H.S end
+ 1975 4358 a 1975 4358 a
+SDict begin 13 H.A end
+ 1975
+4358 a 1975 4358 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2064) cvn H.B /DEST pdfmark
+end
+ 1975 4358 a Fx(syscalls)p FC(.)h(From)f(a)g(users)h
+(vie)n(wpoint,)d(these)i(syscalls)h(are)396 4466 y(the)f(lo)n(west)h
+(le)n(v)o(el)f(of)g(system)g(functions,)f(and)g(pro)o(vide)f(access)j
+(to)f(\002lesystems,)h(netw)o(ork)e(connections,)f(and)396
+4574 y(other)i(goodies.)e(By)j(modifying)d(k)o(ernel)h(syscalls,)i(k)o
+(ernel)e(rootkits)h(can)g(hide)g(\002les,)g(directories,)f(processes,)h
+(or)396 4682 y(netw)o(ork)f(connections)g(without)g(modifying)f(an)o(y)
+h(system)i(binaries.)e(Ob)o(viously)-5 b(,)18 b(checksums)h(are)h
+(useless)h(in)396 4790 y(this)g(situation.)-2 4801 y
+SDict begin H.S end
+
+-2 4801 a -2 4801 a
+SDict begin 13 H.A end
+ -2 4801 a -2 4801 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KERNELDEF-HOW) cvn H.B /DEST
+pdfmark end
+ -2 4801 a Black
+3661 5805 a Fx(55)p Black eop end
+%%Page: 56 61
+TeXDict begin 56 60 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.56) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 396 313 a Fp(5.10.3.)36 b(Implemented)g
+(integrity)e(c)o(hec)n(ks)2471 313 y
+SDict begin H.S end
+ 2471 313 a 2471
+313 a
+SDict begin 18.72 H.A end
+ 2471 313 a 2471 313 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.42.27.2) cvn H.B /DEST pdfmark
+end
+ 2471 313 a -2 506 a
+SDict begin H.S end
+ -2 506
+a -2 506 a
+SDict begin 13 H.A end
+ -2 506 a -2 506 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2067) cvn H.B /DEST pdfmark
+end
+ -2 506 a 396 587 a FC(When)20
+b(a)h(system)f(call)h(\(e.g.)e(open\(\))g(to)h(open)f(a)i(\002le\))f
+(is)h(made)f(by)g(an)g(application,)e(the)j(\003o)n(w)f(of)g(control)f
+(looks)396 695 y(lik)o(e)i(this:)p Black 463 1031 a(1.)p
+Black 20 w(An)f(interrupt)f(is)i(triggered,)d(and)i(e)o(x)o(ecution)e
+(continues)h(at)h(the)h(interrupt)d(handler)h(de\002ned)g(for)h(that)
+546 1139 y(interrupt.)e(On)i(Linux,)f(interrupt)g(80)h(is)h(used.)546
+1413 y(A)f(rootkit)g(could)f(replace)g(the)h(k)o(ernels)g(interrupt)f
+(handler)g(by)g(an)h(o)n(wn)g(function.)-2 1597 y
+SDict begin H.S end
+ -2
+1597 a -2 1597 a
+SDict begin 13 H.A end
+ -2 1597 a -2 1597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2073) cvn H.B /DEST pdfmark
+end
+ -2 1597 a -2 1597
+a
+SDict begin H.S end
+ -2 1597 a -2 1597 a
+SDict begin 13 H.A end
+ -2 1597 a -2 1597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2074) cvn H.B /DEST pdfmark
+end
+ -2 1597 a 546
+1687 a FC(Samhain)f(checks)h(the)g(Interrupt)e(Descriptor)h(T)-7
+b(able)20 b(for)g(modi\002cations.)438 1805 y
+SDict begin H.S end
+ 438 1805
+a 438 1805 a
+SDict begin 13 H.A end
+ 438 1805 a 438 1805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2075) cvn H.B /DEST pdfmark
+end
+ 438 1805 a Black 463
+1955 a FC(2.)p Black 546 1955 a
+SDict begin H.S end
+ 546 1955 a 546 1955 a
+SDict begin 13 H.A end
+
+546 1955 a 546 1955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2076) cvn H.B /DEST pdfmark
+end
+ 546 1955 a FC(The)g(interrupt)e(handler)h
+(\(named)g(system_call\(\))g(on)h(Linux\))e(looks)i(up)g(the)g(address)
+g(of)g(the)g(requested)546 2063 y(syscall)g(in)h(the)f(syscall)h
+(table,)f(and)f(e)o(x)o(ecutes)g(a)i(jump)e(to)i(the)f(respecti)n(v)o
+(e)f(address.)-2 2247 y
+SDict begin H.S end
+ -2 2247 a -2 2247 a
+SDict begin 13 H.A end
+ -2 2247 a
+-2 2247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2077) cvn H.B /DEST pdfmark
+end
+ -2 2247 a 546 2337 a FC(A)h(rootkit)g(may)f(\(a\))h(modify)f
+(the)h(interrupt)f(handler)f(to)j(use)f(a)h(\(rootkit-supplied\))16
+b(dif)n(ferent)j(syscall)i(table,)546 2444 y(or)f(\(b\))f(modify)g(the)
+h(entries)g(in)g(the)h(syscall)f(table)h(to)f(point)f(to)i(the)f
+(rootkits)f(replacement)g(functions.)-2 2628 y
+SDict begin H.S end
+ -2 2628
+a -2 2628 a
+SDict begin 13 H.A end
+ -2 2628 a -2 2628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2078) cvn H.B /DEST pdfmark
+end
+ -2 2628 a -2 2628 a
+SDict begin H.S end
+ -2
+2628 a -2 2628 a
+SDict begin 13 H.A end
+ -2 2628 a -2 2628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2079) cvn H.B /DEST pdfmark
+end
+ -2 2628 a 546 2718
+a FC(Samhain)g(checks)h(\(a\))g(the)g(interrupt)e(handler)m(,)h(and)g
+(\(b\))h(the)g(syscall)h(table)f(for)g(modi\002cations.)438
+2837 y
+SDict begin H.S end
+ 438 2837 a 438 2837 a
+SDict begin 13 H.A end
+ 438 2837 a 438 2837 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2080) cvn H.B /DEST pdfmark
+end
+ 438
+2837 a Black 463 2986 a FC(3.)p Black 546 2986 a
+SDict begin H.S end
+ 546
+2986 a 546 2986 a
+SDict begin 13 H.A end
+ 546 2986 a 546 2986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2081) cvn H.B /DEST pdfmark
+end
+ 546 2986 a FC(The)g(syscall)g
+(function)f(is)i(e)o(x)o(ecuted,)d(and)i(control)f(returns)g(to)h(the)g
+(application.)-2 3170 y
+SDict begin H.S end
+ -2 3170 a -2 3170 a
+SDict begin 13 H.A end
+ -2 3170 a
+-2 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2082) cvn H.B /DEST pdfmark
+end
+ -2 3170 a 546 3260 a FC(A)g(rootkit)g(may)f(o)o(v)o(erwrite)g
+(the)h(syscall)h(function)d(to)i(place)g(a)h(jump)e(to)i(its)g(o)n(wn)f
+(replacement)e(function)h(at)546 3368 y(the)h(start)h(of)f(the)g
+(syscall)g(function.)-2 3552 y
+SDict begin H.S end
+ -2 3552 a -2 3552 a
+SDict begin 13 H.A end
+ -2
+3552 a -2 3552 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2083) cvn H.B /DEST pdfmark
+end
+ -2 3552 a -2 3552 a
+SDict begin H.S end
+ -2 3552 a -2 3552
+a
+SDict begin 13 H.A end
+ -2 3552 a -2 3552 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2084) cvn H.B /DEST pdfmark
+end
+ -2 3552 a 546 3642 a FC(Samhain)f(checks)h(the)g
+(\002rst)h(fe)n(w)f(bytes)g(of)g(each)g(syscall)g(function)f(for)g
+(modi\002cations.)-2 4076 y
+SDict begin H.S end
+ -2 4076 a -2 4076 a
+SDict begin 13 H.A end
+ -2 4076
+a -2 4076 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2085) cvn H.B /DEST pdfmark
+end
+ -2 4076 a 396 4184 a FC(In)h(addition)f(to)h(these)h
+(checks,)1323 4184 y
+SDict begin H.S end
+ 1323 4184 a 1323 4184 a
+SDict begin 13 H.A end
+ 1323 4184
+a 1323 4184 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2086) cvn H.B /DEST pdfmark
+end
+ 1323 4184 a FC(Samhain)f(will)g(check)g(the)2121
+4184 y
+SDict begin H.S end
+ 2121 4184 a 2121 4184 a
+SDict begin 13 H.A end
+ 2121 4184 a 2121 4184
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2087) cvn H.B /DEST pdfmark
+end
+ 2121 4184 a Fr(/proc)g FC(inode)f(to)i(detect)f(the)2998
+4184 y
+SDict begin H.S end
+ 2998 4184 a 2998 4184 a
+SDict begin 13 H.A end
+ 2998 4184 a 2998 4184
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2088) cvn H.B /DEST pdfmark
+end
+ 2998 4184 a FC(adore-ng)e(rootkit,)396 4292 y(which)i(does)g(not)g
+(modify)e(an)o(y)i(syscall)g(e)o(x)o(ecution,)e(b)n(ut)i(rather)g(the)g
+(VFS)h(\(V)-5 b(irtual)20 b(File)h(System\))e(layer)h(of)g(the)396
+4400 y(k)o(ernel.)-2 4567 y
+SDict begin H.S end
+ -2 4567 a -2 4567 a
+SDict begin 13 H.A end
+ -2 4567
+a -2 4567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2089) cvn H.B /DEST pdfmark
+end
+ -2 4567 a 396 4674 a FC(On)g(FreeBSD,)h(currently)d(only)i
+(the)g(syscall)h(table)f(\(2b\))f(and)h(the)g(system)g(call)h(\(3\))e
+(are)i(check)o(ed.)-2 4702 y
+SDict begin H.S end
+ -2 4702 a -2 4702 a
+SDict begin 13 H.A end
+ -2 4702
+a -2 4702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KERNELDEF-ERRORS) cvn H.B /DEST
+pdfmark end
+ -2 4702 a 396 5012 a Fp(5.10.4.)36 b(Err)n(or)31
+b(messa)o(g)q(es)1693 5012 y
+SDict begin H.S end
+ 1693 5012 a 1693 5012 a
+SDict begin 18.72 H.A end
+
+1693 5012 a 1693 5012 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.42.28.2) cvn H.B /DEST pdfmark
+end
+ 1693 5012 a -2 5205 a
+SDict begin H.S end
+ -2 5205
+a -2 5205 a
+SDict begin 13 H.A end
+ -2 5205 a -2 5205 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2092) cvn H.B /DEST pdfmark
+end
+ -2 5205 a 396 5286 a
+FC(Error)19 b(messages)i(start)f(with)h('POLICY)f(KERNEL)-8
+b('.)20 b(There)f(are)h(four)f(types)h(of)g(them:)g(\(a\))g('IDT')f
+(signi\002es)396 5394 y(modi\002ed)g(interrupts:)g(old)h(and)g(ne)n(w)g
+(address,)f(se)o(gment,)g(pri)n(vile)o(ge)g(le)n(v)o(el,)g(and)h(type)g
+(are)g(listed,)g(\(b\))p Black 3660 5805 a Fx(56)p Black
+eop end
+%%Page: 57 62
+TeXDict begin 57 61 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.57) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MOUNTCHECK) cvn H.B /DEST pdfmark
+end
+ -2 35 a 1956 104 a Fx(Chapter)20
+b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h(\002le)g(monitor)p
+Black 396 309 a FC(SYSCALL:)h(modi\002ed)e(syscall)i(table/syscall)f
+(code)g(interrupt)e(handler)m(,)g(and)i(\(c\))g(SYS_GA)-9
+b(TE:)20 b(modi\002ed)396 417 y(interrupt)f(handler)g(for)g(syscalls.)i
+(\(d\))f(PR)m(OC:)h(modi\002ed)2081 417 y
+SDict begin H.S end
+ 2081 417 a
+2081 417 a
+SDict begin 13 H.A end
+ 2081 417 a 2081 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2093) cvn H.B /DEST pdfmark
+end
+ 2081 417 a Fr(/proc)f
+FC(system)-2 601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2094) cvn H.B /DEST pdfmark
+end
+ -2 601 a 396 691 a FC(If)g(an)g(empty)g(slot)g(in)h(the)f(interrupt)f
+(descriptor)f(table)j(\(old)e(address)h(zero\))f(has)i(been)e
+(modi\002ed,)g(this)h(indicates)396 799 y(that)h(a)f(ne)n(w)g
+(interrupt)f(has)h(been)g(installed.)g(This)g(cannot)f(modify)g(the)h
+(beha)n(viour)e(of)i(user)g(applications)f(\(which)396
+906 y(w)o(ould)h(not)g(use)g(that)g(interrupt\),)e(b)n(ut)j(could)e(be)
+h(used)g(by)g(a)g(dedicated)f(\(rootkit-supplied\))e(application)h(to)
+396 1014 y(perform)g(some)i(action)g(\(e.g.)f(ele)n(v)n(ate)h(pri)n
+(vile)o(ges\).)-2 1198 y
+SDict begin H.S end
+ -2 1198 a -2 1198 a
+SDict begin 13 H.A end
+ -2 1198
+a -2 1198 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2095) cvn H.B /DEST pdfmark
+end
+ -2 1198 a 396 1288 a FC(Lik)o(e)n(wise,)g(if)h(an)f(empty)f
+(slot)i(in)f(the)g(syscall)h(table)f(\(syscall)h(name)e
+(sys_ni_syscall/_nosys\))f(has)i(been)396 1396 y(modi\002ed,)f(this)i
+(cannot)e(modify)f(the)j(beha)n(viour)d(of)i(user)g(applications,)e(b)n
+(ut)j(again)e(could)g(be)h(used)g(by)g(a)396 1504 y(dedicated)f
+(\(rootkit-supplied\))e(application)h(to)j(perform)d(some)i(action.)-2
+1522 y
+SDict begin H.S end
+ -2 1522 a -2 1522 a
+SDict begin 11.7 H.A end
+ -2 1522 a -2 1522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2096) cvn H.B /DEST pdfmark
+end
+ -2 1522
+a -2 1647 a
+SDict begin H.S end
+ -2 1647 a -2 1647 a
+SDict begin 11.7 H.A end
+ -2 1647 a -2 1647 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2098) cvn H.B /DEST pdfmark
+end
+ -2
+1647 a 562 1726 a Fw(NO)m(TE:)h Fv(As)g(of)f(v)n(ersion)f(1.8.4,)g(k)o
+(er)r(nel)g(inf)n(o)g(is)h(stored)g(in)g(the)f(baseline)f(database)g(b)
+o(y)j(\(mis-\)using)e(\002elds)562 1823 y(that)h(nor)r(mally)f(descr)q
+(ibe)g(some)h(proper)s(ties)e(of)i(\002les)o(.)h(Y)-10
+b(ou)19 b(ma)n(y)i(theref)n(ore)c(\002nd)j(that)g(error)f(messages)i
+(ha)o(v)n(e)562 1920 y(inf)n(o)e(appended)e(that)j(looks)g(lik)o(e)f
+(proper)s(ties)f(y)o(ou)i(w)o(ould)f(nor)r(mally)g(e)n(xpect)h(f)n(or)g
+(a)g(\002le)g(\(e)o(.g.)f(mtime)o(,)h(ctime)o(,)562 2017
+y(link_path)e(...\).)i(This)g(is)g(required)e(f)n(or)i(ser)r(v)n
+(er-side)g(database)e(update)g(\(if)i(y)o(ou)g(use)g(samhain)f(as)562
+2114 y(client/ser)r(v)n(er)g(system\).)-2 2430 y
+SDict begin H.S end
+ -2 2430
+a -2 2430 a
+SDict begin 13 H.A end
+ -2 2430 a -2 2430 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MONDEF) cvn H.B /DEST pdfmark
+end
+ -2 2430 a 377 x Fu(5.11.)39
+b(Monitoring)e(login/logout)f(e)n(vents)2452 2807 y
+SDict begin H.S end
+ 2452
+2807 a 2452 2807 a
+SDict begin 22.464 H.A end
+ 2452 2807 a 2452 2807 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.43.1) cvn H.B /DEST pdfmark
+end
+ 2452 2807
+a -2 3005 a
+SDict begin H.S end
+ -2 3005 a -2 3005 a
+SDict begin 13 H.A end
+ -2 3005 a -2 3005 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2101) cvn H.B /DEST pdfmark
+end
+ -2
+3005 a -2 3005 a
+SDict begin H.S end
+ -2 3005 a -2 3005 a
+SDict begin 13 H.A end
+ -2 3005 a -2 3005
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2102) cvn H.B /DEST pdfmark
+end
+ -2 3005 a 396 3081 a FC(samhain)20 b(can)g(be)g(compiled)f(to)h
+(monitor)f(login/logout)e(e)n(v)o(ents)j(of)g(system)g(users.)g(F)o(or)
+g(initialization,)f(the)396 3189 y(system)648 3189 y
+SDict begin H.S end
+
+648 3189 a 648 3189 a
+SDict begin 13 H.A end
+ 648 3189 a 648 3189 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2103) cvn H.B /DEST pdfmark
+end
+ 648 3189
+a Fr(utmp)h FC(\002le)h(is)g(searched)e(for)g(users)i(currently)d
+(logged)h(in.)h(T)-7 b(o)20 b(recognize)f(changes)g(\(i.e.)h(logouts)f
+(or)396 3297 y(logins\),)g(the)i(system)1042 3297 y
+SDict begin H.S end
+ 1042
+3297 a 1042 3297 a
+SDict begin 13 H.A end
+ 1042 3297 a 1042 3297 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2104) cvn H.B /DEST pdfmark
+end
+ 1042 3297
+a Fr(wtmp)f FC(\002le)h(is)g(then)f(used.)f(This)i(f)o(acility)f(is)h
+(con\002gured)d(in)i(the)2885 3297 y
+SDict begin H.S end
+ 2885 3297 a 2885
+3297 a
+SDict begin 13 H.A end
+ 2885 3297 a 2885 3297 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2105) cvn H.B /DEST pdfmark
+end
+ 2885 3297 a Fx(Utmp)h
+FC(section)f(of)g(the)396 3405 y(con\002guration)e(\002le:)-2
+3506 y
+SDict begin H.S end
+ -2 3506 a -2 3506 a
+SDict begin 11.7 H.A end
+ -2 3506 a -2 3506 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2106) cvn H.B /DEST pdfmark
+end
+ -2 3506
+a 486 3585 a Fr([Utmp])486 3682 y(#)486 3779 y(#)45 b(activate)e(\(0)i
+(for)f(switching)f(off\))486 3876 y(#)486 3973 y(LoginCheckActive=1)486
+4071 y(#)486 4168 y(#)i(interval)e(between)h(checks)g(\(in)g(seconds\))
+486 4265 y(#)486 4362 y(LoginCheckInterval=600)486 4459
+y(#)486 4556 y(#)h(these)f(are)g(the)g(severities)f(\(see)i(section)p
+0 TeXcolorgray 2279 4556 a
+SDict begin H.S end
+ 2279 4556 a Fr(Section)f(4.1.1)2863
+4556 y
+SDict begin 11.7 H.L end
+ 2863 4556 a 2863 4556 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2863 4556 a Black -1 w
+Fr(\))486 4653 y(#)486 4751 y(SeverityLogin=info)486
+4848 y(SeverityLogout=info)486 4945 y(#)486 5042 y(#)h(multiple)e
+(logins)h(by)g(same)h(user)486 5139 y(#)486 5236 y
+(SeverityLoginMulti=crit)p Black 3658 5805 a Fx(57)p
+Black eop end
+%%Page: 58 63
+TeXDict begin 58 62 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.58) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 319 a
+SDict begin H.S end
+ -2 319 a -2 319 a
+SDict begin 13 H.A end
+
+-2 319 a -2 319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MOUNTCHECK) cvn H.B /DEST pdfmark
+end
+ -2 319 a 377 x Fu(5.12.)39 b(Chec)m(king)e(mounted)h
+(\002lesystem)g(policies)2963 696 y
+SDict begin H.S end
+ 2963 696 a 2963 696
+a
+SDict begin 22.464 H.A end
+ 2963 696 a 2963 696 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.44.1) cvn H.B /DEST pdfmark
+end
+ 2963 696 a -2 894 a
+SDict begin H.S end
+ -2 894 a
+-2 894 a
+SDict begin 13 H.A end
+ -2 894 a -2 894 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2110) cvn H.B /DEST pdfmark
+end
+ -2 894 a -2 894 a
+SDict begin H.S end
+ -2 894 a
+-2 894 a
+SDict begin 13 H.A end
+ -2 894 a -2 894 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2111) cvn H.B /DEST pdfmark
+end
+ -2 894 a 396 970 a FC(samhain)20
+b(can)g(be)g(compiled)f(to)h(check)f(if)i(certain)e(\002lesystems)i
+(are)f(mounted,)e(and)i(if)h(the)o(y)e(are)h(mounted)e(with)396
+1078 y(the)i(appropriate)e(options.)h(This)i(module)d(currently)h
+(supports)g(Linux,)g(Solaris,)h(HP-UX)g(\(mount)f(options)g(as)i(in)396
+1186 y(/etc/mnttab\),)e(and)h(FreeBSD.)g(The)g(con\002guration)e(of)h
+(the)i(module)d(is)k(done)d(in)h(the)2891 1186 y
+SDict begin H.S end
+ 2891
+1186 a 2891 1186 a
+SDict begin 13 H.A end
+ 2891 1186 a 2891 1186 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2112) cvn H.B /DEST pdfmark
+end
+ 2891 1186
+a Fx(Mounts)g FC(section)g(of)g(the)396 1294 y(con\002guration)e
+(\002le:)-2 1395 y
+SDict begin H.S end
+ -2 1395 a -2 1395 a
+SDict begin 11.7 H.A end
+ -2 1395 a -2 1395
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2113) cvn H.B /DEST pdfmark
+end
+ -2 1395 a 486 1474 a Fr([Mounts])486 1571 y(#)486 1668
+y(#)45 b(Activate)e(\(0)i(is)f(off\).)486 1766 y(#)486
+1863 y(MountCheckActive=1)486 1960 y(#)486 2057 y(#)h(Interval)e
+(between)h(checks.)486 2154 y(#)486 2251 y(MountCheckInterval=7200)486
+2348 y(#)486 2445 y(#)h(Logging)e(severities.)g(We)i(have)f(two)g
+(checks:)g(to)g(see)h(if)f(a)h(mount)f(is)g(there,)g(and)g(to)486
+2543 y(#)h(see)f(if)g(it)h(is)f(mounted)g(with)g(the)h(correct)e
+(options.)486 2640 y(#)486 2737 y(SeverityMountMissing=warn)486
+2834 y(SeverityOptionMissing=warn)486 2931 y(#)486 3028
+y(#)i(Mounts)e(to)i(check)f(for,)g(followed)g(by)g(lists)g(of)h
+(options)e(to)i(check)f(on)g(them.)486 3125 y(#)486 3223
+y(checkmount=/)486 3320 y(checkmount=/var)486 3417 y(checkmount=/usr)
+486 3514 y(checkmount=/tmp)e(noexec,nosuid,nodev)486
+3611 y(checkmount=/home)g(noexec,nosuid,nodev)-2 4065
+y
+SDict begin H.S end
+ -2 4065 a -2 4065 a
+SDict begin 13 H.A end
+ -2 4065 a -2 4065 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2114) cvn H.B /DEST pdfmark
+end
+ -2 4065 a 396
+4173 a FC(This)21 b(module)d(by)i(the)g(eircom.net)f(Computer)g
+(Incident)g(Response)h(T)-6 b(eam.)-2 4202 y
+SDict begin H.S end
+ -2 4202
+a -2 4202 a
+SDict begin 13 H.A end
+ -2 4202 a -2 4202 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:USERCHECK) cvn H.B /DEST pdfmark
+end
+ -2 4202 a 359 x Fu(5.13.)39
+b(Chec)m(king)e(sensitive)h(\002les)h(o)n(wned)f(b)m(y)i(user)n(s)3099
+4561 y
+SDict begin H.S end
+ 3099 4561 a 3099 4561 a
+SDict begin 22.464 H.A end
+ 3099 4561 a 3099 4561
+a
+SDict begin [ /View [/XYZ H.V] /Dest (7.45.1) cvn H.B /DEST pdfmark
+end
+ 3099 4561 a -2 4759 a
+SDict begin H.S end
+ -2 4759 a -2 4759 a
+SDict begin 13 H.A end
+ -2 4759 a
+-2 4759 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2117) cvn H.B /DEST pdfmark
+end
+ -2 4759 a -2 4759 a
+SDict begin H.S end
+ -2 4759 a -2 4759 a
+SDict begin 13 H.A end
+ -2
+4759 a -2 4759 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2118) cvn H.B /DEST pdfmark
+end
+ -2 4759 a 396 4835 a FC(samhain)20 b(can)g(be)g
+(compiled)f(to)h(support)f(checking)f(of)i(\002les)h(that)g(are)f
+(speci\002ed)g(as)h(being)e(relati)n(v)o(e)g(to)i(the)f(a)396
+4943 y(user')-5 b(s)21 b(home)e(directory)-5 b(.)18 b(It)i(is)h
+(intended)e(to)h(detect)g(interference)f(with)h(\002les)h(that)f
+(in\003uence)f(process)h(beha)n(viour)396 5050 y(such)g(as)658
+5050 y
+SDict begin H.S end
+ 658 5050 a 658 5050 a
+SDict begin 13 H.A end
+ 658 5050 a 658 5050 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2119) cvn H.B /DEST pdfmark
+end
+ 658
+5050 a Fr(.profile)f FC(It)h(simply)f(adds)h(the)g(appropriate)d
+(\002le)j(entries)g(to)g(the)f(main)h(samhain)f(list,)h(at)g(the)g
+(speci\002ed)396 5158 y(alerting)g(le)n(v)o(el.)-2 5259
+y
+SDict begin H.S end
+ -2 5259 a -2 5259 a
+SDict begin 11.7 H.A end
+ -2 5259 a -2 5259 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2120) cvn H.B /DEST pdfmark
+end
+ -2 5259 a 486
+5339 a Fr([UserFiles])p Black 3661 5805 a Fx(58)p Black
+eop end
+%%Page: 59 64
+TeXDict begin 59 63 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.59) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 486 309 a Fr(#)486 406 y(#)45
+b(Activate)e(\(0)i(is)f(off\).)486 503 y(#)486 600 y(UserfilesActive=1)
+486 794 y(#)486 892 y(#)h(Files)f(to)g(check)g(for)g(under)g(each)h
+($HOME)486 989 y(#)g(A)f(specific)g(level)g(can)g(be)h(specified.)486
+1086 y(#)g(The)f(allowed)g(values)f(are:)486 1183 y(#)i(allignore)486
+1280 y(#)g(attributes)486 1377 y(#)g(logfiles)486 1474
+y(#)g(loggrow)486 1571 y(#)g(noignore)486 1669 y(#)g(readonly)486
+1766 y(#)g(user0)486 1863 y(#)g(user1)486 1960 y(#)486
+2057 y(#)g(The)f(default)g(is)g(noignore)486 2154 y(#)486
+2251 y(UserfilesName=.login)d(noignore)486 2349 y
+(UserfilesName=.profile)g(readonly)486 2446 y
+(UserfilesName=.ssh/authorized_keys)486 2543 y(#)486
+2640 y(#)k(A)f(list)g(of)h(UIDs)f(where)g(we)h(want)f(to)g(check.)486
+2737 y(#)h(The)f(default)g(is)g(all.)486 2834 y(#)h(IF)f(THERE)g(IS)h
+(AN)f(OPEN)g(RANGE,)g(IT)h(MUST)f(BE)g(LAST)486 2931
+y(#)486 3028 y(UserfilesCheckUids=0,100-500,1000-)-2
+3483 y
+SDict begin H.S end
+ -2 3483 a -2 3483 a
+SDict begin 13 H.A end
+ -2 3483 a -2 3483 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2121) cvn H.B /DEST pdfmark
+end
+ -2 3483
+a 396 3591 a FC(This)21 b(module)d(by)i(the)g(eircom.net)f(Computer)g
+(Incident)g(Response)h(T)-6 b(eam.)-2 3619 y
+SDict begin H.S end
+ -2 3619
+a -2 3619 a
+SDict begin 13 H.A end
+ -2 3619 a -2 3619 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MODULES) cvn H.B /DEST pdfmark
+end
+ -2 3619 a 359 x Fu(5.14.)39
+b(Modules)941 3978 y
+SDict begin H.S end
+ 941 3978 a 941 3978 a
+SDict begin 22.464 H.A end
+ 941 3978 a
+941 3978 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.46.1) cvn H.B /DEST pdfmark
+end
+ 941 3978 a -2 4146 a
+SDict begin H.S end
+ -2 4146 a -2 4146 a
+SDict begin 13 H.A end
+ -2
+4146 a -2 4146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2124) cvn H.B /DEST pdfmark
+end
+ -2 4146 a -2 4146 a
+SDict begin H.S end
+ -2 4146 a -2 4146
+a
+SDict begin 13 H.A end
+ -2 4146 a -2 4146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2125) cvn H.B /DEST pdfmark
+end
+ -2 4146 a 396 4252 a FC(samhain)20
+b(has)g(a)h(programming)16 b(interf)o(ace)k(that)g(allo)n(ws)h(to)f
+(add)g(modules)f(written)h(in)g(C.)h(Basically)-5 b(,)20
+b(for)g(each)396 4360 y(module)f(a)i(structure)e(of)h(type)1289
+4360 y
+SDict begin H.S end
+ 1289 4360 a 1289 4360 a
+SDict begin 13 H.A end
+ 1289 4360 a 1289 4360
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2126) cvn H.B /DEST pdfmark
+end
+ 1289 4360 a Fx(struct)g(mod_type)p FC(,)f(as)i(de\002ned)e(in)2303
+4360 y
+SDict begin H.S end
+ 2303 4360 a 2303 4360 a
+SDict begin 13 H.A end
+ 2303 4360 a 2303 4360
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2127) cvn H.B /DEST pdfmark
+end
+ 2303 4360 a Fr(sh_modules.h)p FC(,)g(must)h(be)g(added)f(to)h(the)h
+(list)396 4468 y(in)482 4468 y
+SDict begin H.S end
+ 482 4468 a 482 4468 a
+SDict begin 13 H.A end
+
+482 4468 a 482 4468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2128) cvn H.B /DEST pdfmark
+end
+ 482 4468 a Fr(sh_modules.c)p FC(.)-2
+4643 y
+SDict begin H.S end
+ -2 4643 a -2 4643 a
+SDict begin 13 H.A end
+ -2 4643 a -2 4643 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2129) cvn H.B /DEST pdfmark
+end
+ -2 4643
+a 396 4742 a FC(This)g(structure)e(contains)g(pointers)h(to)g
+(initialization,)f(timing,)h(checking,)e(and)h(cleanup)g(functions,)g
+(as)i(well)g(as)396 4850 y(information)d(for)i(parsing)f(the)h
+(con\002guration)d(\002le.)-2 5034 y
+SDict begin H.S end
+ -2 5034 a -2 5034
+a
+SDict begin 13 H.A end
+ -2 5034 a -2 5034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2130) cvn H.B /DEST pdfmark
+end
+ -2 5034 a 396 5124 a FC(F)o(or)j(details,)f(in)h
+(the)g(source)f(code)g(distrib)n(ution)g(check)g(the)g(\002les)2305
+5124 y
+SDict begin H.S end
+ 2305 5124 a 2305 5124 a
+SDict begin 13 H.A end
+ 2305 5124 a 2305 5124
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2131) cvn H.B /DEST pdfmark
+end
+ 2305 5124 a Fr(sh_modules.h,)43 b(sh_modules.c)p FC(,)18
+b(as)i(well)396 5232 y(as)h(e.g.)626 5232 y
+SDict begin H.S end
+ 626 5232
+a 626 5232 a
+SDict begin 13 H.A end
+ 626 5232 a 626 5232 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2132) cvn H.B /DEST pdfmark
+end
+ 626 5232 a Fr(utmp.c,)44
+b(utmp.h)p FC(,)19 b(which)g(implement)f(a)i(module)f(to)h(monitor)e
+(login/logout)f(e)n(v)o(ents.)i(There)g(is)h(also)g(a)396
+5340 y(HO)m(WT)o(O)h(written)e(by)h(eircom.net)f(Computer)g(Incident)f
+(Response)i(T)-6 b(eam.)-2 5368 y
+SDict begin H.S end
+ -2 5368 a -2 5368 a
+SDict begin 13 H.A end
+
+-2 5368 a -2 5368 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PERFORMANCE-TUNING) cvn H.B
+/DEST pdfmark end
+ -2 5368 a Black 3661 5805 a Fx(59)p
+Black eop end
+%%Page: 60 65
+TeXDict begin 60 64 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.60) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black -2 330 a Fu(5.15.)39 b(P)l(erf)m(ormance)d
+(tuning)1706 330 y
+SDict begin H.S end
+ 1706 330 a 1706 330 a
+SDict begin 22.464 H.A end
+ 1706 330 a 1706
+330 a
+SDict begin [ /View [/XYZ H.V] /Dest (7.47.1) cvn H.B /DEST pdfmark
+end
+ 1706 330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a
+-2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2135) cvn H.B /DEST pdfmark
+end
+ -2 528 a 396 604 a FC(Almost)21 b(all)f(time)h(is)g(spent)f
+(in)g(the)g(checksum)f(algorithm.)f(T)-7 b(o)21 b(impro)o(v)o(e)d
+(performance,)f(you)i(can)h(use)h(MD5)396 712 y(instead)f(of)g(TIGER,)g
+(which)g(will)h(gi)n(v)o(e)e(some)h(20)g(per)g(cent)g(impro)o(v)o
+(ement)d(\(on)i(Linux/i686\).)e(T)-7 b(o)21 b(switch)f(to)396
+820 y(MD5,)g(use)g(the)867 820 y
+SDict begin H.S end
+ 867 820 a 867 820 a
+SDict begin 13 H.A end
+
+867 820 a 867 820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2136) cvn H.B /DEST pdfmark
+end
+ 867 820 a Fy(DigestAlgo)f FC(option)g(in)h(the)g
+(con\002guration)e(\002le:)-2 921 y
+SDict begin H.S end
+ -2 921 a -2 921 a
+SDict begin 11.7 H.A end
+
+-2 921 a -2 921 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2137) cvn H.B /DEST pdfmark
+end
+ -2 921 a 486 1000 a Fr([Misc])486 1097
+y(#)45 b(use)f(MD5)486 1195 y(DigestAlgo=MD5)-2 1649
+y
+SDict begin H.S end
+ -2 1649 a -2 1649 a
+SDict begin 13 H.A end
+ -2 1649 a -2 1649 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2138) cvn H.B /DEST pdfmark
+end
+ -2 1649 a 396
+1757 a FC(Other)20 b(things)g(you)f(can)h(do)g(are:)-2
+1941 y
+SDict begin H.S end
+ -2 1941 a -2 1941 a
+SDict begin 13 H.A end
+ -2 1941 a -2 1941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2139) cvn H.B /DEST pdfmark
+end
+ -2 1941
+a -2 1941 a
+SDict begin H.S end
+ -2 1941 a -2 1941 a
+SDict begin 13 H.A end
+ -2 1941 a -2 1941 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2140) cvn H.B /DEST pdfmark
+end
+ -2
+1941 a -2 1951 a
+SDict begin H.S end
+ -2 1951 a -2 1951 a
+SDict begin 13 H.A end
+ -2 1951 a -2 1951
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2141) cvn H.B /DEST pdfmark
+end
+ -2 1951 a Black 396 2093 a FB(\225)p Black 479 2093
+a
+SDict begin H.S end
+ 479 2093 a 479 2093 a
+SDict begin 13 H.A end
+ 479 2093 a 479 2093 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2142) cvn H.B /DEST pdfmark
+end
+ 479 2093
+a FC(Build)h(a)f(static)h(binary)e(\(use)h(the)1452 2093
+y
+SDict begin H.S end
+ 1452 2093 a 1452 2093 a
+SDict begin 13 H.A end
+ 1452 2093 a 1452 2093 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2143) cvn H.B /DEST pdfmark
+end
+ 1452
+2093 a Fy(--enable-static)f FC(switch)h(for)g(con\002gure\).)e(Static)i
+(binaries)g(are)g(f)o(aster)m(,)g(and)479 2201 y(also)h(more)e(secure,)
+h(because)f(the)o(y)h(cannot)f(be)h(sub)o(v)o(erted)e(via)i(libc.)-2
+2219 y
+SDict begin H.S end
+ -2 2219 a -2 2219 a
+SDict begin 11.7 H.A end
+ -2 2219 a -2 2219 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2144) cvn H.B /DEST pdfmark
+end
+ -2 2219
+a -2 2343 a
+SDict begin H.S end
+ -2 2343 a -2 2343 a
+SDict begin 11.7 H.A end
+ -2 2343 a -2 2343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2146) cvn H.B /DEST pdfmark
+end
+ -2
+2343 a 645 2422 a Fw(NO)m(TE:)h Fv(Unf)n(or)s(tunately)16
+b(this)k(is)h(not)f(possib)o(le)e(on)i(Solar)q(is)o(.)f(This)h(is)h
+(not)e(a)h(b)o(ug)f(in)3011 2422 y
+SDict begin H.S end
+ 3011 2422 a 3011 2422
+a
+SDict begin 11.7 H.A end
+ 3011 2422 a 3011 2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2147) cvn H.B /DEST pdfmark
+end
+ 3011 2422 a Fv(samhain,)g(b)o(ut)g(is)645
+2520 y(because)h(some)g(functions)f(in)h(Solar)q(is)f(are)h(only)f
+(supplied)g(b)o(y)h(dynamic)g(libr)o(ar)q(ies)o(.)438
+2860 y
+SDict begin H.S end
+ 438 2860 a 438 2860 a
+SDict begin 13 H.A end
+ 438 2860 a 438 2860 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2148) cvn H.B /DEST pdfmark
+end
+ 438
+2860 a Black 396 3009 a FB(\225)p Black 479 3009 a
+SDict begin H.S end
+ 479
+3009 a 479 3009 a
+SDict begin 13 H.A end
+ 479 3009 a 479 3009 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2149) cvn H.B /DEST pdfmark
+end
+ 479 3009 a FC(Change)g(the)g
+(compiler)f(switches)h(to)h(optimize)e(more)g(aggressi)n(v)o(ely)-5
+b(.)-2 3027 y
+SDict begin H.S end
+ -2 3027 a -2 3027 a
+SDict begin 13 H.A end
+ -2 3027 a -2 3027 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2150) cvn H.B /DEST pdfmark
+end
+
+-2 3027 a Black 396 3159 a FB(\225)p Black 479 3159 a
+SDict begin H.S end
+
+479 3159 a 479 3159 a
+SDict begin 13 H.A end
+ 479 3159 a 479 3159 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2151) cvn H.B /DEST pdfmark
+end
+ 479 3159
+a FC(If)20 b(on)g(a)h(commercial)d(UNIX,)i(check)g(whether)f(the)h
+(nati)n(v)o(e)f(compiler)g(produces)g(f)o(aster)h(code)g(\(you)f(need)g
+(an)479 3267 y(ANSI)i(C)g(compiler\).)d(The)1284 3267
+y
+SDict begin H.S end
+ 1284 3267 a 1284 3267 a
+SDict begin 13 H.A end
+ 1284 3267 a 1284 3267 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2152) cvn H.B /DEST pdfmark
+end
+ 1284
+3267 a Fy(./con\002gur)o(e)h FC(script)h(honours)f(CC)i(\(compiler\))d
+(and)i(CFLA)m(GS)h(en)m(vironment)479 3375 y(v)n(ariables.)-2
+3690 y
+SDict begin H.S end
+ -2 3690 a -2 3690 a
+SDict begin 13 H.A end
+ -2 3690 a -2 3690 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2153) cvn H.B /DEST pdfmark
+end
+ -2 3690
+a 396 3798 a FC(On)f(the)h(other)e(side,)h(if)h(you)e(w)o(ant)h(to)h
+(reduce)e(the)h(load)g(caused)f(by)h(\002le)h(checking,)d(you)h(can)h
+(change)f(the)396 3906 y(scheduling)g(priority)g(\(see)1201
+3906 y
+SDict begin H.S end
+ 1201 3906 a 1201 3906 a
+SDict begin 13 H.A end
+ 1201 3906 a 1201 3906
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2154) cvn H.B /DEST pdfmark
+end
+ 1201 3906 a Fy(man)i(nice)p FC(\),)f(and/or)f(limit)h(the)g(I/O:)-2
+4007 y
+SDict begin H.S end
+ -2 4007 a -2 4007 a
+SDict begin 11.7 H.A end
+ -2 4007 a -2 4007 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2155) cvn H.B /DEST pdfmark
+end
+ -2 4007
+a 486 4086 a Fr([Misc])486 4183 y(#)45 b(low)f(priority)f(\(positive)h
+(argument)f(means)h(lower)g(priority\))486 4281 y(SetNiceLevel=19)486
+4378 y(#)h(kilobytes)e(per)h(second)486 4475 y(SetIOLimit=1000)-2
+4929 y
+SDict begin H.S end
+ -2 4929 a -2 4929 a
+SDict begin 13 H.A end
+ -2 4929 a -2 4929 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2156) cvn H.B /DEST pdfmark
+end
+ -2 4929
+a 396 5037 a FC(Similarly)-5 b(,)19 b(for)h(the)g(SUID)h(check,)e(you)g
+(can)h(limit)h(the)f(\002les)h(per)f(seconds:)-2 5138
+y
+SDict begin H.S end
+ -2 5138 a -2 5138 a
+SDict begin 11.7 H.A end
+ -2 5138 a -2 5138 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2157) cvn H.B /DEST pdfmark
+end
+ -2 5138 a 486
+5217 a Fr([SuidCheck])486 5314 y(#)45 b(limit)f(on)g(files)g(per)g
+(seconds)p Black 3661 5805 a Fx(60)p Black eop end
+%%Page: 61 66
+TeXDict begin 61 65 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.61) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1956 104 a
+Fx(Chapter)20 b(5.)g(Con\002gur)o(ation)e(\227)i(samhain,)f(the)h
+(\002le)g(monitor)p Black 486 309 a Fr(SuidCheckFps=250)p
+Black 3661 5805 a Fx(61)p Black eop end
+%%Page: 62 67
+TeXDict begin 62 66 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.62) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:YULE) cvn H.B /DEST pdfmark
+end
+ -2 226 a 125 x
+Fz(Chapter)48 b(6.)f(yule,)h(the)g(log)g(ser)r(ver)2460
+351 y
+SDict begin H.S end
+ 2460 351 a 2460 351 a
+SDict begin 26.957 H.A end
+ 2460 351 a 2460 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.0) cvn H.B /DEST pdfmark end
+ 2460
+351 a -2 609 a
+SDict begin H.S end
+ -2 609 a -2 609 a
+SDict begin 13 H.A end
+ -2 609 a -2 609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2161) cvn H.B /DEST pdfmark
+end
+ -2
+609 a -2 609 a
+SDict begin H.S end
+ -2 609 a -2 609 a
+SDict begin 13 H.A end
+ -2 609 a -2 609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2162) cvn H.B /DEST pdfmark
+end
+ -2
+609 a 396 679 a FC(yule)20 b(is)h(the)f(log)g(serv)o(er)g(within)f(the)
+1463 679 y
+SDict begin H.S end
+ 1463 679 a 1463 679 a
+SDict begin 13 H.A end
+ 1463 679 a 1463 679
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2163) cvn H.B /DEST pdfmark
+end
+ 1463 679 a FC(samhain)g(\002le)i(inte)o(grity)e(monitoring)f(system.)
+2850 679 y
+SDict begin H.S end
+ 2850 679 a 2850 679 a
+SDict begin 13 H.A end
+ 2850 679 a 2850 679
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2164) cvn H.B /DEST pdfmark
+end
+ 2850 679 a FC(yule)i(is)h(part)e(of)h(the)396 787 y(distrib)n(ution)f
+(package.)g(It)h(is)h(only)f(required)e(if)j(you)e(intend)g(to)i(use)f
+(the)g(client/serv)o(er)f(capability)g(of)h(the)396 895
+y
+SDict begin H.S end
+ 396 895 a 396 895 a
+SDict begin 13 H.A end
+ 396 895 a 396 895 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2165) cvn H.B /DEST pdfmark
+end
+ 396 895 a FC(samhain)g
+(system)g(for)g(centralized)f(logging)f(to)1807 895 y
+SDict begin H.S end
+
+1807 895 a 1807 895 a
+SDict begin 13 H.A end
+ 1807 895 a 1807 895 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2166) cvn H.B /DEST pdfmark
+end
+ 1807 895
+a FC(yule.)-2 913 y
+SDict begin H.S end
+ -2 913 a -2 913 a
+SDict begin 11.7 H.A end
+ -2 913 a -2 913
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2167) cvn H.B /DEST pdfmark
+end
+ -2 913 a 745 1012 2668 17 v 745 2120 17 1108 v 1802
+1164 a Fp(Impor)r(tant)786 1354 y
+SDict begin H.S end
+ 786 1354 a 786 1354
+a
+SDict begin 11.7 H.A end
+ 786 1354 a 786 1354 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2169) cvn H.B /DEST pdfmark
+end
+ 786 1354 a 73 x Fv(Client)h(and)h(ser)r(v)n(er)
+g(are)1501 1427 y
+SDict begin H.S end
+ 1501 1427 a 1501 1427 a
+SDict begin 11.7 H.A end
+ 1501 1427 a
+1501 1427 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2170) cvn H.B /DEST pdfmark
+end
+ 1501 1427 a Fq(distict)27 b Fv(applications)o(,)16
+b(and)k(m)o(ust)h(be)f(b)o(uilt)e(seper)o(ately)-7 b(.)18
+b(By)786 1524 y(def)n(ault,)g(installation)f(names)j(and)f(paths)h(\(e)
+o(.g.)f(the)h(con\002gur)o(ation)d(\002le\))j(are)g(diff)n(erent.)786
+1621 y(Do)h(not)e(b)o(lame)g(us)i(if)f(y)o(ou)g(ab)o(use)e
+('./con\002gure')g(options)h(to)h(cause)g(name)g(clashes)o(,)f(if)786
+1718 y(y)o(ou)h(install)f(both)g(on)h(the)g(same)g(host.)786
+1900 y
+SDict begin H.S end
+ 786 1900 a 786 1900 a
+SDict begin 11.7 H.A end
+ 786 1900 a 786 1900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2171) cvn H.B /DEST pdfmark
+end
+ 786
+1900 a 81 x Fv(T)-9 b(o)20 b(compile)1164 1981 y
+SDict begin H.S end
+ 1164
+1981 a 1164 1981 a
+SDict begin 11.7 H.A end
+ 1164 1981 a 1164 1981 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2172) cvn H.B /DEST pdfmark
+end
+ 1164 1981
+a Fv(yule,)f(y)o(ou)h(m)o(ust)h(use)1805 1981 y
+SDict begin H.S end
+ 1805
+1981 a 1805 1981 a
+SDict begin 11.7 H.A end
+ 1805 1981 a 1805 1981 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2173) cvn H.B /DEST pdfmark
+end
+ 1805 1981
+a Fw(./con\002gure)d(--enab)o(le-netw)o(ork=ser)q(ve)o(r)p
+Fv(.)d(T)-9 b(o)786 2078 y(compile)20 b(a)1127 2078 y
+SDict begin H.S end
+
+1127 2078 a 1127 2078 a
+SDict begin 11.7 H.A end
+ 1127 2078 a 1127 2078 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2174) cvn H.B /DEST pdfmark
+end
+ 1127
+2078 a Fv(samhain)f(client,)g(y)o(ou)h(m)o(ust)h(use)2109
+2078 y
+SDict begin H.S end
+ 2109 2078 a 2109 2078 a
+SDict begin 11.7 H.A end
+ 2109 2078 a 2109 2078
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2175) cvn H.B /DEST pdfmark
+end
+ 2109 2078 a Fw(./con\002gure)d(--enab)o(le-netw)o(ork=c)o(li)o(ent)p
+Fv(.)p 3396 2120 17 1108 v 745 2137 2668 17 v -2 2147
+a
+SDict begin H.S end
+ -2 2147 a -2 2147 a
+SDict begin 13 H.A end
+ -2 2147 a -2 2147 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:GENERAL) cvn H.B /DEST pdfmark
+end
+ -2 2147 a 319
+x Fu(6.1.)39 b(General)813 2466 y
+SDict begin H.S end
+ 813 2466 a 813 2466
+a
+SDict begin 22.464 H.A end
+ 813 2466 a 813 2466 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.48.1) cvn H.B /DEST pdfmark
+end
+ 813 2466 a -2 2634 a
+SDict begin H.S end
+ -2 2634
+a -2 2634 a
+SDict begin 13 H.A end
+ -2 2634 a -2 2634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2178) cvn H.B /DEST pdfmark
+end
+ -2 2634 a -2 2634 a
+SDict begin H.S end
+ -2
+2634 a -2 2634 a
+SDict begin 13 H.A end
+ -2 2634 a -2 2634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2179) cvn H.B /DEST pdfmark
+end
+ -2 2634 a 396 2740
+a FC(yule)20 b(is)h(a)g(non-forking)16 b(serv)o(er)-5
+b(.)20 b(Instead)f(of)h(forking)e(a)j(ne)n(w)f(process)g(for)f(each)h
+(incoming)e(logging)h(request,)g(it)396 2848 y(multiple)o(x)o(es)g
+(connections)f(internally)-5 b(.)19 b(Apart)g(from)1966
+2848 y
+SDict begin H.S end
+ 1966 2848 a 1966 2848 a
+SDict begin 13 H.A end
+ 1966 2848 a 1966 2848
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2180) cvn H.B /DEST pdfmark
+end
+ 1966 2848 a FC(samhain)g(client)h(reports)g(\(see)g(belo)n(w\),)3144
+2848 y
+SDict begin H.S end
+ 3144 2848 a 3144 2848 a
+SDict begin 13 H.A end
+ 3144 2848 a 3144 2848
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2181) cvn H.B /DEST pdfmark
+end
+ 3144 2848 a FC(yule)g(\(v)o(ersion)396 2956 y(1.2.8+\))f(can)h(also)g
+(collect)g(syslog)g(reports)f(by)h(listening)g(on)g(port)f(514/udp,)f
+(if)i(compiled)f(with)h(this)h(option)396 3064 y(enabled)e(\(see)i
+(also)984 3064 y
+SDict begin H.S end
+ 984 3064 a 984 3064 a
+SDict begin 13 H.A end
+ 984 3064 a 984
+3064 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2182) cvn H.B /DEST pdfmark
+end
+ 984 3064 a Fy(man)g(syslogd)p FC(.)-2 3247 y
+SDict begin H.S end
+ -2
+3247 a -2 3247 a
+SDict begin 13 H.A end
+ -2 3247 a -2 3247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2183) cvn H.B /DEST pdfmark
+end
+ -2 3247 a 396 3338
+a FC(Each)f(potential)f(client)i(must)f(be)1381 3338
+y
+SDict begin H.S end
+ 1381 3338 a 1381 3338 a
+SDict begin 13 H.A end
+ 1381 3338 a 1381 3338 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2184) cvn H.B /DEST pdfmark
+end
+ 1381
+3338 a Fx(r)m(e)m(gister)m(ed)i FC(with)1899 3338 y
+SDict begin H.S end
+ 1899
+3338 a 1899 3338 a
+SDict begin 13 H.A end
+ 1899 3338 a 1899 3338 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2185) cvn H.B /DEST pdfmark
+end
+ 1899 3338
+a FC(yule)e(to)h(mak)o(e)e(a)i(connection)d(\(see)p 0
+TeXcolorgray 2945 3338 a
+SDict begin H.S end
+ 2945 3338 a FC(Section)i(5.1)3320
+3338 y
+SDict begin 13 H.L end
+ 3320 3338 a 3320 3338 a
+SDict begin [ /Subtype /Link /Dest (0:BASCLT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3320 3338 a Black -1 w
+FC(>)h(and)e(the)396 3446 y(e)o(xample)g(belo)n(w\).)g(The)h(client)g
+(tells)h(its)g(host)g(name)e(to)i(the)f(serv)o(er)m(,)f(and)g(the)h
+(serv)o(er)g(v)o(eri\002es)g(it)h(against)e(the)h(peer)396
+3554 y(of)g(the)g(connecting)e(sock)o(et.)i(On)g(the)h(\002rst)g
+(connection)d(made)h(by)h(a)h(client,)f(an)g(authentication)e(protocol)
+g(is)396 3661 y(performed.)g(This)i(protocol)e(pro)o(vides)1555
+3661 y
+SDict begin H.S end
+ 1555 3661 a 1555 3661 a
+SDict begin 13 H.A end
+ 1555 3661 a 1555 3661
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2187) cvn H.B /DEST pdfmark
+end
+ 1555 3661 a Fx(mutual)h(authentication)f FC(of)i(client)g(and)f(serv)
+o(er)m(,)g(as)i(well)g(as)g(a)f(fresh)396 3769 y
+SDict begin H.S end
+ 396
+3769 a 396 3769 a
+SDict begin 13 H.A end
+ 396 3769 a 396 3769 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2188) cvn H.B /DEST pdfmark
+end
+ 396 3769 a Fx(session)h(k)o(e)n
+(y)f FC(.)-2 3952 y
+SDict begin H.S end
+ -2 3952 a -2 3952 a
+SDict begin 13 H.A end
+ -2 3952 a -2
+3952 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2189) cvn H.B /DEST pdfmark
+end
+ -2 3952 a 396 4043 a FC(By)f(def)o(ault,)f(all)h(messages)g(are)
+g(encrypted)d(using)i(Rijndael)h(\(selected)f(as)i(the)e(Adv)n(anced)f
+(Encryption)f(Standard)396 4151 y(\(AES\))k(algorithm\).)e(The)i
+(192-bit)f(k)o(e)o(y)g(v)o(ersion)g(of)h(the)g(algorithm)f(is)i(used.)f
+(There)f(is)i(a)g(compile-time)d(option)396 4259 y(to)j(switch)f(of)n
+(f)g(encryption,)d(if)k(your)e(local)h(la)o(wmak)o(ers)f(don')o(t)g
+(allo)n(w)h(to)g(use)h(it)f(\(see)h(Appendix\).)-2 4443
+y
+SDict begin H.S end
+ -2 4443 a -2 4443 a
+SDict begin 13 H.A end
+ -2 4443 a -2 4443 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2190) cvn H.B /DEST pdfmark
+end
+ -2 4443 a -2
+4443 a
+SDict begin H.S end
+ -2 4443 a -2 4443 a
+SDict begin 13 H.A end
+ -2 4443 a -2 4443 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2191) cvn H.B /DEST pdfmark
+end
+ -2 4443
+a 396 4533 a FC(yule)f(k)o(eeps)g(track)g(of)g(all)g(clients)h(and)f
+(their)f(session)i(k)o(e)o(ys.)f(As)h(connections)d(are)i(dropped)e
+(after)i(successful)396 4641 y(completion)f(of)h(message)g(deli)n(v)o
+(ery)-5 b(,)17 b(there)j(is)h(no)f(limit)h(on)e(the)i(total)f(number)e
+(of)i(clients.)h(There)e(is,)i(ho)n(we)n(v)o(er)m(,)d(a)396
+4749 y(limit)j(on)f(the)g(maximum)e(number)h(of)1522
+4749 y
+SDict begin H.S end
+ 1522 4749 a 1522 4749 a
+SDict begin 13 H.A end
+ 1522 4749 a 1522 4749
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2192) cvn H.B /DEST pdfmark
+end
+ 1522 4749 a Fx(simultaneous)g FC(connections.)f(This)i(limit)h
+(depends)e(on)g(the)i(operating)396 4857 y(system,)f(b)n(ut)h(may)e(be)
+h(of)g(order)f(1000.)-2 5041 y
+SDict begin H.S end
+ -2 5041 a -2 5041 a
+SDict begin 13 H.A end
+ -2
+5041 a -2 5041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2193) cvn H.B /DEST pdfmark
+end
+ -2 5041 a 396 5131 a FC(Session)i(k)o(e)o(y)e(e)o
+(xpire)g(after)h(tw)o(o)h(hours.)e(If)h(its)h(session)f(k)o(e)o(y)g(is)
+h(e)o(xpired,)d(the)j(client)f(is)h(forced)e(to)h(repeat)g(the)396
+5239 y(authentication)e(protocol)h(to)h(set)h(up)f(a)h(fresh)e(session)
+i(k)o(e)o(y)-5 b(.)p Black -2 5805 a
+SDict begin H.S end
+ -2 5805 a -2 5805
+a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2196) cvn H.B /DEST pdfmark
+end
+ -2 5805 a 3661 5874 a Fx(62)p Black
+eop end
+%%Page: 63 68
+TeXDict begin 63 67 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.63) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2194) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(Incoming)e(messages)j(are)f(signed)f(by)h(the)g
+(client.)g(On)g(receipt,)2271 309 y
+SDict begin H.S end
+ 2271 309 a 2271 309
+a
+SDict begin 13 H.A end
+ 2271 309 a 2271 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2195) cvn H.B /DEST pdfmark
+end
+ 2271 309 a FC(yule)g(will:)p
+Black 463 645 a(1.)p Black 20 w(check)f(the)h(signature,)-2
+663 y
+SDict begin H.S end
+ -2 663 a -2 663 a
+SDict begin 13 H.A end
+ -2 663 a -2 663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2200) cvn H.B /DEST pdfmark
+end
+ -2 663 a Black
+463 794 a FC(2.)p Black 546 794 a
+SDict begin H.S end
+ 546 794 a 546 794 a
+SDict begin 13 H.A end
+
+546 794 a 546 794 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2201) cvn H.B /DEST pdfmark
+end
+ 546 794 a FC(accept)f(the)i(message)f(if)g(the)g
+(signature)g(can)g(be)g(v)o(eri\002ed,)f(otherwise)g(discard)h(it)h
+(and)e(issue)i(an)f(error)546 902 y(message,)-2 920 y
+SDict begin H.S end
+
+-2 920 a -2 920 a
+SDict begin 13 H.A end
+ -2 920 a -2 920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2202) cvn H.B /DEST pdfmark
+end
+ -2 920 a Black 463
+1052 a FC(3.)p Black 546 1052 a
+SDict begin H.S end
+ 546 1052 a 546 1052 a
+SDict begin 13 H.A end
+
+546 1052 a 546 1052 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2203) cvn H.B /DEST pdfmark
+end
+ 546 1052 a FC(discard)f(the)h(clients)h
+(signature,)-2 1070 y
+SDict begin H.S end
+ -2 1070 a -2 1070 a
+SDict begin 13 H.A end
+ -2 1070 a -2
+1070 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2204) cvn H.B /DEST pdfmark
+end
+ -2 1070 a Black 463 1201 a FC(4.)p Black 546 1201
+a
+SDict begin H.S end
+ 546 1201 a 546 1201 a
+SDict begin 13 H.A end
+ 546 1201 a 546 1201 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2205) cvn H.B /DEST pdfmark
+end
+ 546 1201
+a FC(log)f(the)g(message,)g(and)f(the)h(client')-5 b(s)21
+b(hostname,)e(to)h(the)g(console)g(and)f(the)i(log)e(\002le,)i(and)-2
+1219 y
+SDict begin H.S end
+ -2 1219 a -2 1219 a
+SDict begin 13 H.A end
+ -2 1219 a -2 1219 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2206) cvn H.B /DEST pdfmark
+end
+ -2 1219
+a Black 463 1351 a FC(5.)p Black 546 1351 a
+SDict begin H.S end
+ 546 1351
+a 546 1351 a
+SDict begin 13 H.A end
+ 546 1351 a 546 1351 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2207) cvn H.B /DEST pdfmark
+end
+ 546 1351 a FC(add)e(its)j(o)n(wn)d
+(signature)g(to)i(the)f(log)g(\002le)h(entry)-5 b(.)-2
+1510 y
+SDict begin H.S end
+ -2 1510 a -2 1510 a
+SDict begin 13 H.A end
+ -2 1510 a -2 1510 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DROPROOT) cvn H.B /DEST pdfmark
+end
+ -2 1510
+a 378 x Fu(6.2.)39 b(Impor)s(tant)e(installation)g(notes)2162
+1888 y
+SDict begin H.S end
+ 2162 1888 a 2162 1888 a
+SDict begin 22.464 H.A end
+ 2162 1888 a 2162 1888
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.49.1) cvn H.B /DEST pdfmark
+end
+ 2162 1888 a -2 2083 a
+SDict begin H.S end
+ -2 2083 a -2 2083 a
+SDict begin 13 H.A end
+ -2 2083 a
+-2 2083 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2210) cvn H.B /DEST pdfmark
+end
+ -2 2083 a 396 2162 a FC(As)21 b(of)f(v)o(ersion)f(1.7.0,)1071
+2162 y
+SDict begin H.S end
+ 1071 2162 a 1071 2162 a
+SDict begin 13 H.A end
+ 1071 2162 a 1071 2162
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2211) cvn H.B /DEST pdfmark
+end
+ 1071 2162 a FC(yule)g(will)1384 2162 y
+SDict begin H.S end
+ 1384 2162 a
+1384 2162 a
+SDict begin 13 H.A end
+ 1384 2162 a 1384 2162 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2212) cvn H.B /DEST pdfmark
+end
+ 1384 2162 a Fx(always)i
+FC(drop)e(root)g(pri)n(vile)o(ges)g(after)h(startup)g(and)f
+(initialization.)g(Y)-9 b(ou)20 b(can)g(use)396 2269
+y(a)h(pri)n(vile)o(ged)d(port)h(\(port)h(number)e(belo)n(w)i(1024\),)e
+(because)h(setting)h(up)g(the)g(listening)g(sock)o(et)g(will)h(occur)e
+(as)396 2377 y(long)h(as)655 2377 y
+SDict begin H.S end
+ 655 2377 a 655 2377
+a
+SDict begin 13 H.A end
+ 655 2377 a 655 2377 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2213) cvn H.B /DEST pdfmark
+end
+ 655 2377 a FC(yule)f(still)j(has)e(root)g(pri)n
+(vile)o(ges.)-2 2561 y
+SDict begin H.S end
+ -2 2561 a -2 2561 a
+SDict begin 13 H.A end
+ -2 2561 a
+-2 2561 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2214) cvn H.B /DEST pdfmark
+end
+ -2 2561 a 396 2651 a FC(There)g(are)g(some)g(special)g
+(considerations)e(that)j(need)e(to)i(be)f(tak)o(en)f(into)h(account)f
+(when)h(setting)g(up)g(an)396 2759 y(installation)g(of)876
+2759 y
+SDict begin H.S end
+ 876 2759 a 876 2759 a
+SDict begin 13 H.A end
+ 876 2759 a 876 2759 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2215) cvn H.B /DEST pdfmark
+end
+ 876
+2759 a FC(yule.)f(In)h(particular:)-2 2777 y
+SDict begin H.S end
+ -2 2777
+a -2 2777 a
+SDict begin 13 H.A end
+ -2 2777 a -2 2777 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2216) cvn H.B /DEST pdfmark
+end
+ -2 2777 a -2 2902 a
+SDict begin H.S end
+ -2
+2902 a -2 2902 a
+SDict begin 13 H.A end
+ -2 2902 a -2 2902 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2218) cvn H.B /DEST pdfmark
+end
+ -2 2902 a 396 2992
+a FC(The)g(unpri)n(vile)o(ged)d(user)-2 3010 y
+SDict begin H.S end
+ -2 3010
+a -2 3010 a
+SDict begin 13 H.A end
+ -2 3010 a -2 3010 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2219) cvn H.B /DEST pdfmark
+end
+ -2 3010 a Black Black
+562 3141 a
+SDict begin H.S end
+ 562 3141 a 562 3141 a
+SDict begin 13 H.A end
+ 562 3141 a 562 3141
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2220) cvn H.B /DEST pdfmark
+end
+ 562 3141 a FC(By)k(def)o(ault,)951 3141 y
+SDict begin H.S end
+ 951 3141
+a 951 3141 a
+SDict begin 13 H.A end
+ 951 3141 a 951 3141 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2221) cvn H.B /DEST pdfmark
+end
+ 951 3141 a Fy(con\002gur)o(e)f
+FC(will)g(check)g(\(in)g(this)h(order\))d(for)i(the)g(e)o(xistance)f
+(of)h(a)h(user)3019 3141 y
+SDict begin H.S end
+ 3019 3141 a 3019 3141 a
+SDict begin 13 H.A end
+ 3019
+3141 a 3019 3141 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2222) cvn H.B /DEST pdfmark
+end
+ 3019 3141 a Fx(yule)p FC(,)3199 3141
+y
+SDict begin H.S end
+ 3199 3141 a 3199 3141 a
+SDict begin 13 H.A end
+ 3199 3141 a 3199 3141 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2223) cvn H.B /DEST pdfmark
+end
+ 3199
+3141 a Fx(daemon)p FC(,)d(or)562 3249 y
+SDict begin H.S end
+ 562 3249 a 562
+3249 a
+SDict begin 13 H.A end
+ 562 3249 a 562 3249 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2224) cvn H.B /DEST pdfmark
+end
+ 562 3249 a Fx(nobody)p FC(,)g(and)i(use)g
+(the)h(\002rst)f(match.)-2 3432 y
+SDict begin H.S end
+ -2 3432 a -2 3432 a
+SDict begin 13 H.A end
+
+-2 3432 a -2 3432 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2225) cvn H.B /DEST pdfmark
+end
+ -2 3432 a 562 3523 a FC(Y)-9 b(ou)19
+b(can)h(o)o(v)o(erride)d(this)j(with)g(the)g(option)1808
+3523 y
+SDict begin H.S end
+ 1808 3523 a 1808 3523 a
+SDict begin 13 H.A end
+ 1808 3523 a 1808 3523
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2226) cvn H.B /DEST pdfmark
+end
+ 1808 3523 a Fy(con\002gur)o(e)f(--enable-user=)2673
+3523 y
+SDict begin H.S end
+ 2673 3523 a 2673 3523 a
+SDict begin 13 H.A end
+ 2673 3523 a 2673 3523
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2227) cvn H.B /DEST pdfmark
+end
+ 2673 3523 a Fl(user)t FC(.)f(The)i(user)f(does)g(not)h(need)f(to)562
+3631 y(e)o(xist)i(already;)e(the)h(install)h(script)f(kno)n(ws)f(ho)n
+(w)h(to)g(create)g(a)h(ne)n(w)f(user)g(\(on)f(Linux,)g(FreeBSD,)i
+(NetBSD,)562 3739 y(Solaris,)f(HP-UX,)h(OSF1\).)-2 3920
+y
+SDict begin H.S end
+ -2 3920 a -2 3920 a
+SDict begin 13 H.A end
+ -2 3920 a -2 3920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2228) cvn H.B /DEST pdfmark
+end
+ -2 3920 a 562
+4013 a FC(After)f(successful)g(installation,)g(you)f(will)i(be)f(ask)o
+(ed)g(to)g(run)2351 4013 y
+SDict begin H.S end
+ 2351 4013 a 2351 4013 a
+SDict begin 13 H.A end
+ 2351
+4013 a 2351 4013 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2229) cvn H.B /DEST pdfmark
+end
+ 2351 4013 a Fy(mak)o(e)g(install-user)h
+FC(in)f(order)f(to:)i(\(i\))f(create)562 4121 y(the)h(user)f(that)g
+(you)f(speci\002ed)h(to)1535 4121 y
+SDict begin H.S end
+ 1535 4121 a 1535
+4121 a
+SDict begin 13 H.A end
+ 1535 4121 a 1535 4121 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2230) cvn H.B /DEST pdfmark
+end
+ 1535 4121 a Fy(con\002gur)o(e)g
+FC(if)g(it)h(does)f(not)g(e)o(xist)g(already)f(\()2794
+4121 y
+SDict begin H.S end
+ 2794 4121 a 2794 4121 a
+SDict begin 13 H.A end
+ 2794 4121 a 2794 4121
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2231) cvn H.B /DEST pdfmark
+end
+ 2794 4121 a Fy(mak)o(e)i(install-user)f FC(will)562
+4229 y(check)g(for)f(this\),)h(and)g(\(ii\))g(cho)n(wn/chmod)d(some)j
+(directories.)-2 4410 y
+SDict begin H.S end
+ -2 4410 a -2 4410 a
+SDict begin 13 H.A end
+ -2 4410 a
+-2 4410 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2232) cvn H.B /DEST pdfmark
+end
+ -2 4410 a 562 4503 a FC(After)g(running)1037
+4503 y
+SDict begin H.S end
+ 1037 4503 a 1037 4503 a
+SDict begin 13 H.A end
+ 1037 4503 a 1037 4503
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2233) cvn H.B /DEST pdfmark
+end
+ 1037 4503 a Fy(mak)o(e)h(install)f FC(and)1629 4503
+y
+SDict begin H.S end
+ 1629 4503 a 1629 4503 a
+SDict begin 13 H.A end
+ 1629 4503 a 1629 4503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2234) cvn H.B /DEST pdfmark
+end
+ 1629
+4503 a Fy(mak)o(e)h(install-user)p FC(,)f(you)f(should)g(ha)n(v)o(e)h
+(a)h(sane)f(setup.)-2 4704 y
+SDict begin H.S end
+ -2 4704 a -2 4704 a
+SDict begin 13 H.A end
+ -2 4704
+a -2 4704 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2236) cvn H.B /DEST pdfmark
+end
+ -2 4704 a 396 4812 a FC(Log\002le)g(directory)-2
+4830 y
+SDict begin H.S end
+ -2 4830 a -2 4830 a
+SDict begin 13 H.A end
+ -2 4830 a -2 4830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2237) cvn H.B /DEST pdfmark
+end
+ -2 4830
+a Black Black 562 4961 a
+SDict begin H.S end
+ 562 4961 a 562 4961 a
+SDict begin 13 H.A end
+ 562 4961
+a 562 4961 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2238) cvn H.B /DEST pdfmark
+end
+ 562 4961 a FC(The)g(system)h(log\002le)f(directory)e
+(usually)i(requires)f(root)g(pri)n(vile)o(ges)g(to)h(write)h(there)f
+(\(otherwise)f(log)h(\002les)562 5069 y(may)g(easily)g(get)h(corrupted)
+d(...\).)h(T)-7 b(o)20 b(enable)1877 5069 y
+SDict begin H.S end
+ 1877 5069
+a 1877 5069 a
+SDict begin 13 H.A end
+ 1877 5069 a 1877 5069 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2239) cvn H.B /DEST pdfmark
+end
+ 1877 5069 a FC(yule)g(to)g(write)
+g(the)g(log)g(\002le)h(and)f(the)g(HTML)g(status)h(\002le,)f(a)562
+5177 y(\(sub-\)directory)c(should)i(be)i(used)e(that)i(is)g(o)n(wned)e
+(by)2153 5177 y
+SDict begin H.S end
+ 2153 5177 a 2153 5177 a
+SDict begin 13 H.A end
+ 2153 5177 a 2153
+5177 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2240) cvn H.B /DEST pdfmark
+end
+ 2153 5177 a FC(yule.)g(The)2485 5177 y
+SDict begin H.S end
+ 2485 5177
+a 2485 5177 a
+SDict begin 13 H.A end
+ 2485 5177 a 2485 5177 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2241) cvn H.B /DEST pdfmark
+end
+ 2485 5177 a Fy(con\002gur)o(e)h
+FC(script)g(and)g(the)g(Mak)o(e\002le)g(will)562 5285
+y(do)h(that)g(automatically)f(with)h(the)h(def)o(ault)e(layout)g
+(\(i.e.)h(a)h(directory)2581 5285 y
+SDict begin H.S end
+ 2581 5285 a 2581
+5285 a
+SDict begin 13 H.A end
+ 2581 5285 a 2581 5285 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2242) cvn H.B /DEST pdfmark
+end
+ 2581 5285 a Fr(/var/log/yule)e
+FC(will)i(be)f(created\).)p Black 3661 5805 a Fx(63)p
+Black eop end
+%%Page: 64 69
+TeXDict begin 64 68 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.64) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2244) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(Data)h(\002les)-2 310 y
+SDict begin H.S end
+ -2 310 a -2
+310 a
+SDict begin 13 H.A end
+ -2 310 a -2 310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2245) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black Black 562 458
+a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2246) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(The)f(data)g
+(\002le)h(directory)e(is)i(no)n(w)e(o)n(wned)g(by)h(root)g(and)f(w)o
+(orld)h(readable)f(by)h(def)o(ault.)f(If)h(you)f(cho)n(wn)g(it)i(to)f
+(a)562 566 y(suitable)841 566 y
+SDict begin H.S end
+ 841 566 a 841 566 a
+SDict begin 13 H.A end
+ 841
+566 a 841 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2247) cvn H.B /DEST pdfmark
+end
+ 841 566 a Fx(gr)l(oup)g FC(for)f(the)h(unpri)n(vile)o
+(ged)1734 566 y
+SDict begin H.S end
+ 1734 566 a 1734 566 a
+SDict begin 13 H.A end
+ 1734 566 a 1734
+566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2248) cvn H.B /DEST pdfmark
+end
+ 1734 566 a FC(yule)f(user)m(,)h(you)f(can)h(mak)o(e)g(it)h(group)
+d(readable)h(only)-5 b(.)3322 566 y
+SDict begin H.S end
+ 3322 566 a 3322 566
+a
+SDict begin 13 H.A end
+ 3322 566 a 3322 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2249) cvn H.B /DEST pdfmark
+end
+ 3322 566 a Fx(Note)20 b(that)g(it)562
+674 y(is)h(not)f(r)m(equir)m(ed,)g(and)f(weak)o(ens)h(the)g(security)-5
+b(,)21 b(if)g(the)f(data)g(\002le)g(dir)m(ectory)g(is)h(writeable)f
+(for)h(the)f(server)-9 b(.)-2 774 y
+SDict begin H.S end
+ -2 774 a -2 774 a
+SDict begin 13 H.A end
+
+-2 774 a -2 774 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2251) cvn H.B /DEST pdfmark
+end
+ -2 774 a 396 865 a FC(GnuPG)20 b(signed)g
+(con\002guration)d(\002le)-2 883 y
+SDict begin H.S end
+ -2 883 a -2 883 a
+SDict begin 13 H.A end
+
+-2 883 a -2 883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2252) cvn H.B /DEST pdfmark
+end
+ -2 883 a Black Black 562 1014 a
+SDict begin H.S end
+ 562
+1014 a 562 1014 a
+SDict begin 13 H.A end
+ 562 1014 a 562 1014 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2253) cvn H.B /DEST pdfmark
+end
+ 562 1014 a FC(The)j(unpri)n
+(vile)o(ged)d(yule)j(user)g(must)g(ha)n(v)o(e)g(a)1886
+1014 y
+SDict begin H.S end
+ 1886 1014 a 1886 1014 a
+SDict begin 13 H.A end
+ 1886 1014 a 1886 1014
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2254) cvn H.B /DEST pdfmark
+end
+ 1886 1014 a Fr(.gnupg)g FC(subdirectory)e(in)i(its)i(home)d
+(directory)-5 b(,)18 b(holding)g(the)562 1122 y(public)i(k)o(e)o(yring)
+e(with)i(the)h(k)o(e)o(y)e(to)h(v)o(erify)f(the)h(signature.)-2
+1223 y
+SDict begin H.S end
+ -2 1223 a -2 1223 a
+SDict begin 13 H.A end
+ -2 1223 a -2 1223 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2256) cvn H.B /DEST pdfmark
+end
+ -2 1223
+a 396 1313 a FC(PID)h(\002le)-2 1314 y
+SDict begin H.S end
+ -2 1314 a -2 1314
+a
+SDict begin 13 H.A end
+ -2 1314 a -2 1314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2257) cvn H.B /DEST pdfmark
+end
+ -2 1314 a Black Black 562 1463
+a
+SDict begin H.S end
+ 562 1463 a 562 1463 a
+SDict begin 13 H.A end
+ 562 1463 a 562 1463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2258) cvn H.B /DEST pdfmark
+end
+ 562 1463
+a FC(The)f(PID)h(\002le)g(is)g(written)f(with)g(before)f(dropping)e
+(root)j(pri)n(vile)o(ges.)e(Therefore)2915 1463 y
+SDict begin H.S end
+ 2915
+1463 a 2915 1463 a
+SDict begin 13 H.A end
+ 2915 1463 a 2915 1463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2259) cvn H.B /DEST pdfmark
+end
+ 2915 1463
+a FC(yule)i(will)h(not)f(be)g(able)g(to)562 1571 y(o)o(v)o(erwrite)f
+(it)i(later)f(\(which)f(is)i(a)g(GoodThing\),)c(or)j(remo)o(v)o(e)e(it)
+j(upon)e(e)o(xit)h(\(it)g(will)h(usually)f(be)g(able)g(to)562
+1679 y(recognize)f(and)g(handle)g(a)i(stale)g(PID)g(\002le)f(on)g
+(startup\).)f(Still,)i(it)g(may)f(be)g(a)h(good)d(idea)j(to)f(remo)o(v)
+o(e)e(it)j(after)562 1786 y(stopping)869 1786 y
+SDict begin H.S end
+ 869 1786
+a 869 1786 a
+SDict begin 13 H.A end
+ 869 1786 a 869 1786 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2260) cvn H.B /DEST pdfmark
+end
+ 869 1786 a FC(yule.)f(The)f(pro)o
+(vided)f(start/stop)i(scripts)h(for)e(v)n(arious)g(architectures)g
+(will)i(handle)e(this.)-2 1846 y
+SDict begin H.S end
+ -2 1846 a -2 1846 a
+SDict begin 13 H.A end
+
+-2 1846 a -2 1846 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CLIENTS) cvn H.B /DEST pdfmark
+end
+ -2 1846 a 359 x Fu(6.3.)39 b(Registering)e(a)j(c)m
+(lient)1599 2205 y
+SDict begin H.S end
+ 1599 2205 a 1599 2205 a
+SDict begin 22.464 H.A end
+ 1599 2205
+a 1599 2205 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.50.1) cvn H.B /DEST pdfmark
+end
+ 1599 2205 a -2 2403 a
+SDict begin H.S end
+ -2 2403 a -2 2403
+a
+SDict begin 13 H.A end
+ -2 2403 a -2 2403 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2263) cvn H.B /DEST pdfmark
+end
+ -2 2403 a 396 2479 a FC(Clients)21
+b(must)g(be)f(re)o(gistered)f(with)1449 2479 y
+SDict begin H.S end
+ 1449 2479
+a 1449 2479 a
+SDict begin 13 H.A end
+ 1449 2479 a 1449 2479 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2264) cvn H.B /DEST pdfmark
+end
+ 1449 2479 a FC(yule)h(to)g(mak)o
+(e)g(a)g(connection.)2361 2479 y
+SDict begin H.S end
+ 2361 2479 a 2361 2479
+a
+SDict begin 13 H.A end
+ 2361 2479 a 2361 2479 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2265) cvn H.B /DEST pdfmark
+end
+ 2361 2479 a Fx(Connection)f(attempts)h(by)g
+(unknown)e(clients)396 2587 y(will)k(be)e(r)m(ejected.)g
+FC(The)f(respecti)n(v)o(e)g(section)h(in)h(the)f(serv)o(er)f
+(con\002guration)f(\002le)j(looks)e(lik)o(e:)-2 2688
+y
+SDict begin H.S end
+ -2 2688 a -2 2688 a
+SDict begin 11.7 H.A end
+ -2 2688 a -2 2688 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2266) cvn H.B /DEST pdfmark
+end
+ -2 2688 a 486
+2767 a Fr([Clients])486 2864 y(#)486 2961 y(#)45 b(A)f(client)486
+3059 y(#)486 3156 y(Client=HOSTNAME_CLIENT1@salt1@verifier1)486
+3253 y(#)486 3350 y(#)h(another)e(one)486 3447 y(#)486
+3544 y(Client=HOSTNAME_CLIENT2@salt2@verifier2)486 3641
+y(#)-2 3809 y
+SDict begin H.S end
+ -2 3809 a -2 3809 a
+SDict begin 13 H.A end
+ -2 3809 a -2 3809 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2267) cvn H.B /DEST pdfmark
+end
+
+-2 3809 a 396 3915 a FC(These)20 b(entries)g(ha)n(v)o(e)g(to)g(be)g
+(computed)f(in)h(the)g(follo)n(wing)f(w)o(ay:)-2 4099
+y
+SDict begin H.S end
+ -2 4099 a -2 4099 a
+SDict begin 13 H.A end
+ -2 4099 a -2 4099 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2268) cvn H.B /DEST pdfmark
+end
+ -2 4099 a -2
+4099 a
+SDict begin H.S end
+ -2 4099 a -2 4099 a
+SDict begin 13 H.A end
+ -2 4099 a -2 4099 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2269) cvn H.B /DEST pdfmark
+end
+ -2 4099
+a -2 4109 a
+SDict begin H.S end
+ -2 4109 a -2 4109 a
+SDict begin 13 H.A end
+ -2 4109 a -2 4109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2270) cvn H.B /DEST pdfmark
+end
+ -2
+4109 a Black 463 4252 a FC(1.)p Black 546 4252 a
+SDict begin H.S end
+ 546
+4252 a 546 4252 a
+SDict begin 13 H.A end
+ 546 4252 a 546 4252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2271) cvn H.B /DEST pdfmark
+end
+ 546 4252 a FC(Choose)h(a)873
+4252 y
+SDict begin H.S end
+ 873 4252 a 873 4252 a
+SDict begin 13 H.A end
+ 873 4252 a 873 4252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2272) cvn H.B /DEST pdfmark
+end
+ 873
+4252 a Fx(passwor)m(d)i FC(\(16)e(chars)g(he)o(xadecimal,)e(i.e.)i
+(only)f(0)h(--)g(9,)g(a)h(--)f(f,)g(A)h(--)f(F)h(allo)n(wed.)e(T)-7
+b(o)21 b(generate)e(a)546 4360 y(random)f(passw)o(ord,)h(you)h(may)f
+(use:)-2 4419 y
+SDict begin H.S end
+ -2 4419 a -2 4419 a
+SDict begin 11.7 H.A end
+ -2 4419 a -2 4419
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2273) cvn H.B /DEST pdfmark
+end
+ -2 4419 a 904 4498 a
+SDict begin H.S end
+ 904 4498 a 904 4498 a
+SDict begin 11.7 H.A end
+ 904 4498
+a 904 4498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2274) cvn H.B /DEST pdfmark
+end
+ 904 4498 a Ft(sh$)1066 4498 y
+SDict begin H.S end
+ 1066 4498
+a 1066 4498 a
+SDict begin 11.7 H.A end
+ 1066 4498 a 1066 4498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2275) cvn H.B /DEST pdfmark
+end
+ 1066 4498 a Fs(yule)41
+b(--gen-password)-2 4595 y
+SDict begin H.S end
+ -2 4595 a -2 4595 a
+SDict begin 13 H.A end
+ -2 4595
+a -2 4595 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2276) cvn H.B /DEST pdfmark
+end
+ -2 4595 a Black 463 4745 a FC(2.)p Black
+546 4745 a
+SDict begin H.S end
+ 546 4745 a 546 4745 a
+SDict begin 13 H.A end
+ 546 4745 a 546 4745
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2277) cvn H.B /DEST pdfmark
+end
+ 546 4745 a FC(Use)21 b(the)f(program)1120 4745 y
+SDict begin H.S end
+ 1120
+4745 a 1120 4745 a
+SDict begin 13 H.A end
+ 1120 4745 a 1120 4745 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2278) cvn H.B /DEST pdfmark
+end
+ 1120 4745
+a Fy(samhain_setpwd)g FC(to)g(reset)h(the)f(passw)o(ord)g(in)g(the)g
+(compiled)2987 4745 y
+SDict begin H.S end
+ 2987 4745 a 2987 4745 a
+SDict begin 13 H.A end
+ 2987 4745
+a 2987 4745 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2279) cvn H.B /DEST pdfmark
+end
+ 2987 4745 a Fx(client)i FC(binary)c(\(that)i(is,)546
+4853 y
+SDict begin H.S end
+ 546 4853 a 546 4853 a
+SDict begin 13 H.A end
+ 546 4853 a 546 4853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2280) cvn H.B /DEST pdfmark
+end
+ 546
+4853 a FC(samhain,)f(not)991 4853 y
+SDict begin H.S end
+ 991 4853 a 991 4853
+a
+SDict begin 13 H.A end
+ 991 4853 a 991 4853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2281) cvn H.B /DEST pdfmark
+end
+ 991 4853 a FC(yule\))g(to)h(the)h(one)e(you)h
+(ha)n(v)o(e)f(chosen.)2122 4853 y
+SDict begin H.S end
+ 2122 4853 a 2122 4853
+a
+SDict begin 13 H.A end
+ 2122 4853 a 2122 4853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2282) cvn H.B /DEST pdfmark
+end
+ 2122 4853 a Fy(samhain_setpwd)h
+FC(tak)o(es)h(three)f(ar)o(guments:)e(\(1\))h(the)546
+4961 y(binary)g(name,)g(\(2\))g(an)i(e)o(xtension)d(to)j(append)d(to)j
+(the)f(ne)n(w)g(binary)-5 b(,)18 b(and)i(\(3\))f(the)h(passw)o(ord.)g
+(It)g(will)h(read)f(the)546 5069 y(e)o(x)o(ecutable)e(binary)h(\(ar)o
+(gument)e(1\),)j(insert)g(the)g(passw)o(ord)g(\(ar)o(gument)d(3\),)j
+(and)g(write)g(a)h(modi\002ed)e(binary)546 5176 y(with)h(the)g
+(speci\002ed)g(e)o(xtension)f(\(ar)o(gument)e(2\).)j(Run)2120
+5176 y
+SDict begin H.S end
+ 2120 5176 a 2120 5176 a
+SDict begin 13 H.A end
+ 2120 5176 a 2120 5176
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2283) cvn H.B /DEST pdfmark
+end
+ 2120 5176 a Fy(samhain_setpwd)g FC(without)g(ar)o(guments)e(for)i
+(usage)546 5284 y(information.)d(Example:)p Black 3661
+5805 a Fx(64)p Black eop end
+%%Page: 65 70
+TeXDict begin 65 69 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.65) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2284) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 904 309 a
+SDict begin H.S end
+ 904 309 a 904 309 a
+SDict begin 11.7 H.A end
+ 904 309 a 904 309
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2285) cvn H.B /DEST pdfmark
+end
+ 904 309 a Ft(sh$)1066 309 y
+SDict begin H.S end
+ 1066 309 a 1066 309 a
+SDict begin 11.7 H.A end
+ 1066
+309 a 1066 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2286) cvn H.B /DEST pdfmark
+end
+ 1066 309 a Fs(samhain_setpwd)45 b(samhain)e(EXT)e
+(0123456789ABCDEF)-2 406 y
+SDict begin H.S end
+ -2 406 a -2 406 a
+SDict begin 13 H.A end
+ -2 406 a
+-2 406 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2287) cvn H.B /DEST pdfmark
+end
+ -2 406 a Black 463 555 a FC(3.)p Black 546 555
+a
+SDict begin H.S end
+ 546 555 a 546 555 a
+SDict begin 13 H.A end
+ 546 555 a 546 555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2288) cvn H.B /DEST pdfmark
+end
+ 546 555 a FC(Use)21
+b(the)f(serv)o(er')-5 b(s)19 b(con)m(v)o(enience)f(function)g('-P')i
+(to)g(create)g(a)h(re)o(gistration)d(entry)-5 b(.)19
+b(Example:)-2 615 y
+SDict begin H.S end
+ -2 615 a -2 615 a
+SDict begin 11.7 H.A end
+ -2 615 a -2 615
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2289) cvn H.B /DEST pdfmark
+end
+ -2 615 a 904 694 a
+SDict begin H.S end
+ 904 694 a 904 694 a
+SDict begin 11.7 H.A end
+ 904 694 a 904
+694 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2290) cvn H.B /DEST pdfmark
+end
+ 904 694 a Ft(sh$)1066 694 y
+SDict begin H.S end
+ 1066 694 a 1066 694
+a
+SDict begin 11.7 H.A end
+ 1066 694 a 1066 694 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2291) cvn H.B /DEST pdfmark
+end
+ 1066 694 a Fs(yule)41 b(-P)h(0123456789ABCDEF)
+-2 791 y
+SDict begin H.S end
+ -2 791 a -2 791 a
+SDict begin 13 H.A end
+ -2 791 a -2 791 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2292) cvn H.B /DEST pdfmark
+end
+ -2 791 a
+Black 463 940 a FC(4.)p Black 546 940 a
+SDict begin H.S end
+ 546 940 a 546
+940 a
+SDict begin 13 H.A end
+ 546 940 a 546 940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2293) cvn H.B /DEST pdfmark
+end
+ 546 940 a FC(The)20 b(output)f(will)h(look)g
+(lik)o(e:)-2 1125 y
+SDict begin H.S end
+ -2 1125 a -2 1125 a
+SDict begin 13 H.A end
+ -2 1125 a -2
+1125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2294) cvn H.B /DEST pdfmark
+end
+ -2 1125 a -2 1125 a
+SDict begin H.S end
+ -2 1125 a -2 1125 a
+SDict begin 13 H.A end
+ -2 1125
+a -2 1125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2295) cvn H.B /DEST pdfmark
+end
+ -2 1125 a 546 1214 a Fx(Client=HOSTN)n(AME@salt@veri\002er)
+-2 1397 y
+SDict begin H.S end
+ -2 1397 a -2 1397 a
+SDict begin 13 H.A end
+ -2 1397 a -2 1397 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2296) cvn H.B /DEST pdfmark
+end
+ -2
+1397 a 546 1488 a FC(Y)-9 b(ou)19 b(no)n(w)h(ha)n(v)o(e)g(to)g(replace)
+1382 1488 y
+SDict begin H.S end
+ 1382 1488 a 1382 1488 a
+SDict begin 13 H.A end
+ 1382 1488 a 1382
+1488 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2297) cvn H.B /DEST pdfmark
+end
+ 1382 1488 a Fx(HOSTN)n(AME)i FC(with)f(the)f(fully)f
+(quali\002ed)h(domain)f(name)g(of)h(the)g(host)g(on)546
+1596 y(which)f(the)i(client)f(should)f(run)g(\()1498
+1596 y
+SDict begin H.S end
+ 1498 1596 a 1498 1596 a
+SDict begin 13 H.A end
+ 1498 1596 a 1498 1596
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2298) cvn H.B /DEST pdfmark
+end
+ 1498 1596 a Fx(e)n(xception)p FC(:)g(if)i(the)f(serv)o(er)f(cannot)g
+(determine)g(the)h(fully)g(quali\002ed)546 1704 y(hostname,)e(you)i
+(may)f(need)h(to)g(use)h(the)f(numerical)f(address)g(instead.)h(Y)-9
+b(ou)20 b(will)h(see)f(the)h(problem)d(in)i(a)546 1812
+y('Connection)e(refused')h(message)h(from)f(the)h(serv)o(er\).)438
+1931 y
+SDict begin H.S end
+ 438 1931 a 438 1931 a
+SDict begin 13 H.A end
+ 438 1931 a 438 1931 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2299) cvn H.B /DEST pdfmark
+end
+ 438
+1931 a Black 463 2080 a FC(5.)p Black 546 2080 a
+SDict begin H.S end
+ 546
+2080 a 546 2080 a
+SDict begin 13 H.A end
+ 546 2080 a 546 2080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2300) cvn H.B /DEST pdfmark
+end
+ 546 2080 a FC(Put)g(the)f(re)o
+(gistration)f(entry)h(into)g(the)h(serv)o(ers')-5 b(s)19
+b(con\002guration)e(\002le,)j(under)e(the)h(section)h(heading)3444
+2080 y
+SDict begin H.S end
+ 3444 2080 a 3444 2080 a
+SDict begin 13 H.A end
+ 3444 2080 a 3444 2080
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2301) cvn H.B /DEST pdfmark
+end
+ 3444 2080 a Fx([Clients])546 2188 y FC(\(see)p 0 TeXcolorgray
+700 2188 a
+SDict begin H.S end
+ 700 2188 a FC(Section)g(6.3)1075 2188 y
+SDict begin 13 H.L end
+ 1075
+2188 a 1075 2188 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENTS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1075 2188 a Black -1 w FC(>\).)g(Y)-9
+b(ou)19 b(need)h(to)g(send)g(SIGHUP)h(to)f(the)g(serv)o(er)f(for)h(the)
+g(ne)n(w)g(entry)g(to)g(tak)o(e)g(ef)n(fect.)-2 2206
+y
+SDict begin H.S end
+ -2 2206 a -2 2206 a
+SDict begin 13 H.A end
+ -2 2206 a -2 2206 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2303) cvn H.B /DEST pdfmark
+end
+ -2 2206 a Black
+463 2337 a FC(6.)p Black 546 2337 a
+SDict begin H.S end
+ 546 2337 a 546 2337
+a
+SDict begin 13 H.A end
+ 546 2337 a 546 2337 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2304) cvn H.B /DEST pdfmark
+end
+ 546 2337 a FC(Repeat)g(steps)g(\(1\))f(--)h
+(\(5\))f(for)g(an)o(y)g(number)f(of)h(clients)h(you)f(need)g
+(\(actually)-5 b(,)18 b(you)h(need)g(a)h(re)o(gistration)f(entry)546
+2445 y(for)g(each)g(client')-5 b(s)20 b(host,)g(b)n(ut)f(you)g(don')o
+(t)f(neccesarily)h(need)g(dif)n(ferent)f(passw)o(ords)h(for)h(each)f
+(client.)g(I.e.)h(you)546 2553 y(may)f(skip)i(steps)f(\(1\))g(--)g
+(\(3\)\).)-2 2869 y
+SDict begin H.S end
+ -2 2869 a -2 2869 a
+SDict begin 13 H.A end
+ -2 2869 a -2
+2869 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2305) cvn H.B /DEST pdfmark
+end
+ -2 2869 a 396 2977 a FC(If)g(you)e(ha)n(v)o(e)h(a)h(def)o(ault)f
+(directory)f(layout,)h(a)1723 2977 y
+SDict begin H.S end
+ 1723 2977 a 1723
+2977 a
+SDict begin 13 H.A end
+ 1723 2977 a 1723 2977 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2306) cvn H.B /DEST pdfmark
+end
+ 1723 2977 a Fx([Clients])i
+FC(section)e(right)g(at)h(the)g(end)f(of)g(the)h(serv)o(er)f(con\002g)f
+(\002le,)i(and)396 3085 y(your)f(client)h(is)i(client.mydomain.com,)15
+b(then)20 b(you)f(could)g(e.g.)h(do:)-2 3269 y
+SDict begin H.S end
+ -2 3269
+a -2 3269 a
+SDict begin 13 H.A end
+ -2 3269 a -2 3269 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2307) cvn H.B /DEST pdfmark
+end
+ -2 3269 a -2 3352 a
+SDict begin H.S end
+ -2
+3352 a -2 3352 a
+SDict begin 11.7 H.A end
+ -2 3352 a -2 3352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2308) cvn H.B /DEST pdfmark
+end
+ -2 3352 a -2 3352
+a
+SDict begin H.S end
+ -2 3352 a -2 3352 a
+SDict begin 11.7 H.A end
+ -2 3352 a -2 3352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2309) cvn H.B /DEST pdfmark
+end
+ -2 3352 a 396
+3431 a Ft(bash$)643 3431 y
+SDict begin H.S end
+ 643 3431 a 643 3431 a
+SDict begin 11.7 H.A end
+ 643
+3431 a 643 3431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2310) cvn H.B /DEST pdfmark
+end
+ 643 3431 a Fs(PASSWD=`yule)44 b(--gen-password`)-2
+3440 y
+SDict begin H.S end
+ -2 3440 a -2 3440 a
+SDict begin 11.7 H.A end
+ -2 3440 a -2 3440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2311) cvn H.B /DEST pdfmark
+end
+ -2 3440
+a 396 3528 a Ft(bash$)643 3528 y
+SDict begin H.S end
+ 643 3528 a 643 3528
+a
+SDict begin 11.7 H.A end
+ 643 3528 a 643 3528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2312) cvn H.B /DEST pdfmark
+end
+ 643 3528 a Fs(samhain_setpwd)h(samhain)e(new)e
+($PASSWD)-2 3537 y
+SDict begin H.S end
+ -2 3537 a -2 3537 a
+SDict begin 11.7 H.A end
+ -2 3537 a -2 3537
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2313) cvn H.B /DEST pdfmark
+end
+ -2 3537 a 396 3625 a Ft(bash$)643 3625 y
+SDict begin H.S end
+ 643 3625 a
+643 3625 a
+SDict begin 11.7 H.A end
+ 643 3625 a 643 3625 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2314) cvn H.B /DEST pdfmark
+end
+ 643 3625 a Fs(scp)g(samhain.new)85
+b(root@client.mydomain)q(.co)q(m:/)q(us)q(r/l)q(oca)q(l/s)q(bin)q(/sa)q
+(mha)q(in)-2 3634 y
+SDict begin H.S end
+ -2 3634 a -2 3634 a
+SDict begin 11.7 H.A end
+ -2 3634 a -2
+3634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2315) cvn H.B /DEST pdfmark
+end
+ -2 3634 a 396 3722 a Ft(bash$)643 3722 y
+SDict begin H.S end
+ 643 3722
+a 643 3722 a
+SDict begin 11.7 H.A end
+ 643 3722 a 643 3722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2316) cvn H.B /DEST pdfmark
+end
+ 643 3722 a Fs(ENTRY=`yule)44
+b(-P)d($PASSWD)i(|)e(sed)g(s\045HOSTNAME\045client.m)q(ydo)q(mai)q(n.c)
+q(om\045)q(`)-2 3739 y
+SDict begin H.S end
+ -2 3739 a -2 3739 a
+SDict begin 11.7 H.A end
+ -2 3739 a
+-2 3739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2317) cvn H.B /DEST pdfmark
+end
+ -2 3739 a 396 3819 a Ft(bash$)643 3819 y
+SDict begin H.S end
+ 643
+3819 a 643 3819 a
+SDict begin 11.7 H.A end
+ 643 3819 a 643 3819 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2318) cvn H.B /DEST pdfmark
+end
+ 643 3819 a Fs(echo)h($ENTRY)g
+(>>)f(/etc/yulerc)-2 3828 y
+SDict begin H.S end
+ -2 3828 a -2 3828 a
+SDict begin 11.7 H.A end
+ -2 3828
+a -2 3828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2319) cvn H.B /DEST pdfmark
+end
+ -2 3828 a 396 3916 a Ft(bash$)643 3916 y
+SDict begin H.S end
+
+643 3916 a 643 3916 a
+SDict begin 11.7 H.A end
+ 643 3916 a 643 3916 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2320) cvn H.B /DEST pdfmark
+end
+ 643 3916
+a Fs(kill)h(-HUP)f(`cat)h(/var/run/yule.pid`)-2 4117
+y
+SDict begin H.S end
+ -2 4117 a -2 4117 a
+SDict begin 13 H.A end
+ -2 4117 a -2 4117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:ENABLING-LOGGING-TO-THE-SERVER)
+cvn H.B /DEST pdfmark end
+ -2 4117 a 378
+x Fu(6.4.)d(Enab)o(ling)e(log)o(ging)h(to)h(the)g(ser)q(ver)2341
+4495 y
+SDict begin H.S end
+ 2341 4495 a 2341 4495 a
+SDict begin 22.464 H.A end
+ 2341 4495 a 2341 4495
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.51.1) cvn H.B /DEST pdfmark
+end
+ 2341 4495 a -2 4693 a
+SDict begin H.S end
+ -2 4693 a -2 4693 a
+SDict begin 13 H.A end
+ -2 4693 a
+-2 4693 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2323) cvn H.B /DEST pdfmark
+end
+ -2 4693 a 396 4769 a FC(If)20 b(the)g(client)f(is)i(properly)
+d(re)o(gistered)g(with)i(the)g(serv)o(er)m(,)e(all)j(you)e(need)g(to)h
+(do)f(is)i(to)f(set)g(an)g(appropriate)d(threshold)396
+4877 y(for)j(remote)f(logging)g(in)h(the)g(client')-5
+b(s)21 b(con\002guration)c(\002le,)k(and)f(gi)n(v)o(e)f(the)h(IP)h
+(address)e(of)h(the)h(serv)o(er)e(\(if)h(not)396 4985
+y(already)f(compiled)g(in\).)h(Of)g(course,)f(the)i(client)f(must)g(be)
+g(compiled)f(with)h(the)2721 4985 y
+SDict begin H.S end
+ 2721 4985 a 2721
+4985 a
+SDict begin 13 H.A end
+ 2721 4985 a 2721 4985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2324) cvn H.B /DEST pdfmark
+end
+ 2721 4985 a Fy(--enable-netw)o
+(ork=client)396 5093 y FC(switch.)-2 5259 y
+SDict begin H.S end
+ -2 5259 a
+-2 5259 a
+SDict begin 13 H.A end
+ -2 5259 a -2 5259 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2325) cvn H.B /DEST pdfmark
+end
+ -2 5259 a 396 5367 a FC(Example)f(for)h
+(client)g(con\002guration:)p Black 3661 5805 a Fx(65)p
+Black eop end
+%%Page: 66 71
+TeXDict begin 66 70 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.66) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2326) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 486 309 a Fr([Log])486 406 y(#)486 503 y(#)45 b(Threshold)e(for)h
+(forwarding)f(to)i(the)f(log)h(server)486 600 y(#)486
+697 y(ExportSeverity=crit)486 892 y([Misc])486 1086 y(SetLogServer=IP)d
+(address)-2 1264 y
+SDict begin H.S end
+ -2 1264 a -2 1264 a
+SDict begin 13 H.A end
+ -2 1264 a -2 1264
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2327) cvn H.B /DEST pdfmark
+end
+ -2 1264 a 396 1360 a FC(Example)19 b(for)h(serv)o(er)f
+(con\002guration:)-2 1461 y
+SDict begin H.S end
+ -2 1461 a -2 1461 a
+SDict begin 11.7 H.A end
+ -2 1461
+a -2 1461 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2328) cvn H.B /DEST pdfmark
+end
+ -2 1461 a 486 1540 a Fr([Clients])486 1637
+y(#)486 1734 y(#)45 b(Register)e(a)i(client)f(to)g(allow)g(it)h(to)f
+(connect)486 1831 y(#)486 1928 y
+(Client=client.mydomain.com@salt@verifie)o(r)-2 2023
+y
+SDict begin H.S end
+ -2 2023 a -2 2023 a
+SDict begin 13 H.A end
+ -2 2023 a -2 2023 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DATABASE-CONFIGURATION-FILE-DOWNLOAD)
+cvn H.B /DEST pdfmark end
+ -2 2023 a 366
+x Fu(6.5.)39 b(Enab)o(ling)e(baseline)h(database)g(/)i(con\002guration)
+c(\002le)-2 2575 y(do)n(wnload)h(fr)m(om)i(the)g(ser)q(ver)1749
+2575 y
+SDict begin H.S end
+ 1749 2575 a 1749 2575 a
+SDict begin 22.464 H.A end
+ 1749 2575 a 1749 2575
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.52.1) cvn H.B /DEST pdfmark
+end
+ 1749 2575 a -2 2743 a
+SDict begin H.S end
+ -2 2743 a -2 2743 a
+SDict begin 13 H.A end
+ -2 2743 a
+-2 2743 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2331) cvn H.B /DEST pdfmark
+end
+ -2 2743 a 396 2849 a FC(A)21 b(signi\002cant)f(adv)n(antage)e
+(of)1289 2849 y
+SDict begin H.S end
+ 1289 2849 a 1289 2849 a
+SDict begin 13 H.A end
+ 1289 2849 a 1289
+2849 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2332) cvn H.B /DEST pdfmark
+end
+ 1289 2849 a FC(samhain)h(is)i(the)g(option)e(to)h(store)g
+(baseline)g(databases)g(and)f(con\002guration)f(\002les)396
+2957 y(on)i(the)g(central)g(log)g(serv)o(er)f(\()1246
+2957 y
+SDict begin H.S end
+ 1246 2957 a 1246 2957 a
+SDict begin 13 H.A end
+ 1246 2957 a 1246 2957
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2333) cvn H.B /DEST pdfmark
+end
+ 1246 2957 a FC(yule\),)g(from)g(where)h(the)o(y)f(can)h(be)g(do)n
+(wnloaded)e(by)h(clients)i(upons)e(startup.)h(In)396
+3065 y(order)f(to)i(use)f(this)h(option,)d(clients)j(must)f(be)g
+(con\002gured)e(to)i(retrie)n(v)o(e)f(these)i(\002les)g(from)e(the)h
+(serv)o(er)g(rather)f(than)396 3173 y(from)g(the)i(local)f
+(\002lesystem.)-2 3191 y
+SDict begin H.S end
+ -2 3191 a -2 3191 a
+SDict begin 11.7 H.A end
+ -2 3191
+a -2 3191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2334) cvn H.B /DEST pdfmark
+end
+ -2 3191 a -2 3315 a
+SDict begin H.S end
+ -2 3315 a -2 3315 a
+SDict begin 11.7 H.A end
+ -2
+3315 a -2 3315 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2336) cvn H.B /DEST pdfmark
+end
+ -2 3315 a 562 3395 a Fw(TIP:)g Fv(Ob)o(viously)-7
+b(,)19 b(retr)q(ie)n(ving)f(the)h(con\002gur)o(ation)f(\002le)i(from)g
+(the)g(log)f(ser)r(v)n(er)i(requires)d(that)i(the)f(IP)i(address)e(of)
+562 3492 y(the)h(log)f(ser)r(v)n(er)i(is)1111 3492 y
+SDict begin H.S end
+
+1111 3492 a 1111 3492 a
+SDict begin 11.7 H.A end
+ 1111 3492 a 1111 3492 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2337) cvn H.B /DEST pdfmark
+end
+ 1111
+3492 a Fq(compiled)e(in)q Fv(,)g(using)h(the)f(option)2080
+3492 y
+SDict begin H.S end
+ 2080 3492 a 2080 3492 a
+SDict begin 11.7 H.A end
+ 2080 3492 a 2080 3492
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2338) cvn H.B /DEST pdfmark
+end
+ 2080 3492 a Fw(./con\002gure)e(--with-logser)q(ver=HOST)p
+Fv(.)-2 3807 y
+SDict begin H.S end
+ -2 3807 a -2 3807 a
+SDict begin 13 H.A end
+ -2 3807 a -2 3807
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2339) cvn H.B /DEST pdfmark
+end
+ -2 3807 a 396 3915 a FC(Do)n(wnloaded)h(\002les)j(are)f(written)g(to)
+h(a)f(temporary)e(\002le)j(that)f(is)i(created)d(in)h(the)h(home)e
+(directory)f(of)i(the)g(ef)n(fecti)n(v)o(e)396 4023 y(user)g(\(usually)
+844 4023 y
+SDict begin H.S end
+ 844 4023 a 844 4023 a
+SDict begin 13 H.A end
+ 844 4023 a 844 4023
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2340) cvn H.B /DEST pdfmark
+end
+ 844 4023 a Fx(r)l(oot)q FC(.)g(The)g(\002lename)g(is)h(chosen)e(at)i
+(random,)d(the)i(\002le)h(is)g(opened)e(for)g(writing)h(after)g
+(checking)396 4131 y(that)h(it)f(does)g(not)g(e)o(xist)h(already)-5
+b(,)18 b(and)i(immediately)f(thereafter)f(unlink)o(ed.)h(Thus)g(the)i
+(name)e(of)h(the)g(\002le)h(will)g(be)396 4239 y(deleted)f(from)f(the)h
+(\002lesystem,)g(b)n(ut)h(the)f(\002le)h(itself)f(will)h(remain)f(in)g
+(e)o(xistence)f(until)h(the)h(\002le)g(descriptor)396
+4347 y(referring)d(it)j(is)g(closed)f(\(see)1238 4347
+y
+SDict begin H.S end
+ 1238 4347 a 1238 4347 a
+SDict begin 13 H.A end
+ 1238 4347 a 1238 4347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2341) cvn H.B /DEST pdfmark
+end
+ 1238
+4347 a Fy(man)g(unlink)p FC(\),)h(or)f(the)g(process)g(e)o(xits)g(\(on)
+g(e)o(xit,)g(all)g(open)g(\002le)g(descriptors)396 4455
+y(belonging)e(to)i(the)h(process)e(are)i(closed\).)-2
+4473 y
+SDict begin H.S end
+ -2 4473 a -2 4473 a
+SDict begin 13 H.A end
+ -2 4473 a -2 4473 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGURATION-FILE-DOWNLOAD)
+cvn H.B /DEST pdfmark end
+ -2 4473
+a 396 4783 a Fp(6.5.1.)36 b(Con\002guration)d(\002le)1717
+4783 y
+SDict begin H.S end
+ 1717 4783 a 1717 4783 a
+SDict begin 18.72 H.A end
+ 1717 4783 a 1717 4783
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.52.29.2) cvn H.B /DEST pdfmark
+end
+ 1717 4783 a -2 4975 a
+SDict begin H.S end
+ -2 4975 a -2 4975 a
+SDict begin 13 H.A end
+ -2 4975 a
+-2 4975 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2344) cvn H.B /DEST pdfmark
+end
+ -2 4975 a 396 5057 a FC(If)20 b(the)h(compiled-in)d(path)h
+(to)i(the)f(con\002guration)d(\002le)k(be)o(gins)e(with)i(the)f
+(special)g(v)n(alue)396 5165 y(\223REQ_FR)m(OM_SER)-7
+b(VER\224,)20 b(the)1426 5165 y
+SDict begin H.S end
+ 1426 5165 a 1426 5165
+a
+SDict begin 13 H.A end
+ 1426 5165 a 1426 5165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2345) cvn H.B /DEST pdfmark
+end
+ 1426 5165 a Fx(client)i FC(will)f(request)f
+(to)g(do)n(wnload)e(the)i(con\002guration)e(\002le)j(from)3370
+5165 y
+SDict begin H.S end
+ 3370 5165 a 3370 5165 a
+SDict begin 13 H.A end
+ 3370 5165 a 3370 5165
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2346) cvn H.B /DEST pdfmark
+end
+ 3370 5165 a FC(yule)e(\(i.e.)396 5273 y(from)g(the)i(serv)o(er\).)p
+Black 3660 5805 a Fx(66)p Black eop end
+%%Page: 67 72
+TeXDict begin 67 71 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.67) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2347) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(If)g(\223REQ_FR)m(OM_SER)-7 b(VER\224)20
+b(is)i(follo)n(wed)c(by)i(a)h(path,)e(the)2218 309 y
+SDict begin H.S end
+
+2218 309 a 2218 309 a
+SDict begin 13 H.A end
+ 2218 309 a 2218 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2348) cvn H.B /DEST pdfmark
+end
+ 2218 309
+a Fx(client)i FC(will)g(use)g(the)f(path)g(follo)n(wing)396
+417 y(\223REQ_FR)m(OM_SER)-7 b(VER\224)20 b(as)h(a)g(f)o(allback)e(if)i
+(\()1818 417 y
+SDict begin H.S end
+ 1818 417 a 1818 417 a
+SDict begin 13 H.A end
+ 1818 417 a 1818
+417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2349) cvn H.B /DEST pdfmark
+end
+ 1818 417 a Fx(and)e(only)g(if)12 b FC(\))21 b(it)g(is)g
+(initializing)f(the)g(database.)f(This)i(is)g(a)396 525
+y(con)m(v)o(enience)c(feature)h(to)i(allo)n(w)f(initializing)g(the)g
+(database\(s\))f(before)g(the)i(client)f(is)i(re)o(gistered)d(with)h
+(the)h(serv)o(er)-5 b(.)-2 709 y
+SDict begin H.S end
+ -2 709 a -2 709 a
+SDict begin 13 H.A end
+ -2
+709 a -2 709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2350) cvn H.B /DEST pdfmark
+end
+ -2 709 a 396 799 a FC(Example:)735 799
+y
+SDict begin H.S end
+ 735 799 a 735 799 a
+SDict begin 13 H.A end
+ 735 799 a 735 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2351) cvn H.B /DEST pdfmark
+end
+ 735 799 a Fy(./con\002gur)o
+(e)19 b(--with-con\002g-\002le=REQ_FR)n(OM_SER)-5 b(VER/etc/conf)o
+(.samhain)17 b FC(In)i(this)i(case,)396 906 y(the)f(client)h(will)g
+(request)e(to)h(do)n(wnload)f(the)h(con\002guration)d(\002le)k(from)e
+(the)i(serv)o(er)-5 b(.)19 b(If)h(the)g(connection)e(to)j(the)396
+1014 y(serv)o(er)f(f)o(ails,)g(it)h(will)g(e)o(xit)f(on)g(error)f(if)h
+(run)g(in)g('check')f(mode,)g(b)n(ut)h(f)o(allback)f(to)2731
+1014 y
+SDict begin H.S end
+ 2731 1014 a 2731 1014 a
+SDict begin 13 H.A end
+ 2731 1014 a 2731 1014
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2352) cvn H.B /DEST pdfmark
+end
+ 2731 1014 a Fr(/etc/conf.samhain)f FC(as)j(its)396
+1122 y(con\002guration)d(\002le,)i(if)h(run)e(in)i('init')e(mode.)-2
+1140 y
+SDict begin H.S end
+ -2 1140 a -2 1140 a
+SDict begin 11.7 H.A end
+ -2 1140 a -2 1140 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2353) cvn H.B /DEST pdfmark
+end
+ -2 1140
+a -2 1265 a
+SDict begin H.S end
+ -2 1265 a -2 1265 a
+SDict begin 11.7 H.A end
+ -2 1265 a -2 1265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2355) cvn H.B /DEST pdfmark
+end
+ -2
+1265 a 562 1344 a Fw(NO)m(TE:)g Fv(F)n(or)f(ob)o(vious)f(secur)q(ity)i
+(reasons)o(,)e(the)h(client)g(cannot)f(specify)i(the)f(path)f(to)i(the)
+f(con\002gur)o(ation)e(\002le)i(on)562 1441 y(the)i(ser)r(v)n(er)h
+(side)o(.)e(The)h(ser)r(v)n(er)g(will)g(lookup)f(the)g(con\002gur)o
+(ation)f(\002le)i(using)g(only)g(the)f(hostname)g(of)h(the)g(client)562
+1538 y(and)g(the)f(compiled-in)f(path)h(f)n(or)h(the)g('localstatedir')
+c(\(see)k(belo)o(w\).)f(The)g(def)n(ault)f(f)n(or)i('localstatedir')c
+(is)3536 1538 y
+SDict begin H.S end
+ 3536 1538 a 3536 1538 a
+SDict begin 11.7 H.A end
+ 3536 1538 a 3536
+1538 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2356) cvn H.B /DEST pdfmark
+end
+ 3536 1538 a Ft(/var)p Fv(.)-2 1854 y
+SDict begin H.S end
+ -2 1854 a
+-2 1854 a
+SDict begin 13 H.A end
+ -2 1854 a -2 1854 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2357) cvn H.B /DEST pdfmark
+end
+ -2 1854 a 396 1962 a FC(The)k(serv)o(er)f
+(will)i(search)f(for)g(the)g(con\002guration)d(\002le)k(to)g(send)f(in)
+g(the)g(follo)n(wing)f(order)g(of)h(priority)e(\(paths)i(are)396
+2070 y(e)o(xplained)f(in)p 0 TeXcolorgray 824 2070 a
+SDict begin H.S end
+
+824 2070 a FC(Section)h(A.5)1217 2070 y
+SDict begin 13 H.L end
+ 1217 2070 a 1217
+2070 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1217 2070 a Black -1 w FC(>\).)1332 2070 y
+SDict begin H.S end
+ 1332
+2070 a 1332 2070 a
+SDict begin 13 H.A end
+ 1332 2070 a 1332 2070 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2359) cvn H.B /DEST pdfmark
+end
+ 1332 2070
+a Fx(CLIENTN)n(AME)j FC(is)e(the)f(hostname)f(of)h(the)g(client')-5
+b(s)21 b(host,)f(as)h(listed)f(in)h(the)396 2178 y(serv)o(er')-5
+b(s)20 b(con\002g)f(\002le)i(in)f(the)1237 2178 y
+SDict begin H.S end
+ 1237
+2178 a 1237 2178 a
+SDict begin 13 H.A end
+ 1237 2178 a 1237 2178 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2360) cvn H.B /DEST pdfmark
+end
+ 1237 2178
+a Fy(Clients)h FC(section:)-2 2362 y
+SDict begin H.S end
+ -2 2362 a -2 2362
+a
+SDict begin 13 H.A end
+ -2 2362 a -2 2362 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2361) cvn H.B /DEST pdfmark
+end
+ -2 2362 a -2 2362 a
+SDict begin H.S end
+ -2 2362 a -2
+2362 a
+SDict begin 13 H.A end
+ -2 2362 a -2 2362 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2362) cvn H.B /DEST pdfmark
+end
+ -2 2362 a -2 2372 a
+SDict begin H.S end
+ -2 2372
+a -2 2372 a
+SDict begin 13 H.A end
+ -2 2372 a -2 2372 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2363) cvn H.B /DEST pdfmark
+end
+ -2 2372 a Black 463 2514
+a FC(1.)p Black 546 2514 a
+SDict begin H.S end
+ 546 2514 a 546 2514 a
+SDict begin 13 H.A end
+ 546
+2514 a 546 2514 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2364) cvn H.B /DEST pdfmark
+end
+ 546 2514 a 546 2514 a
+SDict begin H.S end
+ 546 2514 a 546
+2514 a
+SDict begin 13 H.A end
+ 546 2514 a 546 2514 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2365) cvn H.B /DEST pdfmark
+end
+ 546 2514 a Fr
+(localstatedir/lib/yule/rc.CLIENTNAME)-2 2526 y
+SDict begin H.S end
+ -2 2526
+a -2 2526 a
+SDict begin 13 H.A end
+ -2 2526 a -2 2526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2366) cvn H.B /DEST pdfmark
+end
+ -2 2526 a Black 463 2663
+a FC(2.)p Black 546 2663 a
+SDict begin H.S end
+ 546 2663 a 546 2663 a
+SDict begin 13 H.A end
+ 546
+2663 a 546 2663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2367) cvn H.B /DEST pdfmark
+end
+ 546 2663 a 546 2663 a
+SDict begin H.S end
+ 546 2663 a 546
+2663 a
+SDict begin 13 H.A end
+ 546 2663 a 546 2663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2368) cvn H.B /DEST pdfmark
+end
+ 546 2663 a Fr(localstatedir/lib/yule/rc)-2
+2823 y
+SDict begin H.S end
+ -2 2823 a -2 2823 a
+SDict begin 13 H.A end
+ -2 2823 a -2 2823 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DATABASE-FILE-DOWNLOAD) cvn
+H.B /DEST pdfmark end
+ -2 2823
+a 396 3151 a Fp(6.5.2.)36 b(Database)f(\002le)1465 3151
+y
+SDict begin H.S end
+ 1465 3151 a 1465 3151 a
+SDict begin 18.72 H.A end
+ 1465 3151 a 1465 3151 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.52.30.2) cvn H.B /DEST pdfmark
+end
+ 1465
+3151 a -2 3319 a
+SDict begin H.S end
+ -2 3319 a -2 3319 a
+SDict begin 13 H.A end
+ -2 3319 a -2 3319
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2371) cvn H.B /DEST pdfmark
+end
+ -2 3319 a 396 3425 a FC(If)20 b(the)h(compiled-in)d(path)h(to)i(the)f
+(database)f(\002le)i(be)o(gins)f(with)g(the)g(special)g(v)n(alue)g
+(\223REQ_FR)m(OM_SER)-7 b(VER\224,)396 3533 y(the)518
+3533 y
+SDict begin H.S end
+ 518 3533 a 518 3533 a
+SDict begin 13 H.A end
+ 518 3533 a 518 3533 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2372) cvn H.B /DEST pdfmark
+end
+ 518
+3533 a Fx(client)22 b FC(will)f(request)f(to)g(do)n(wnload)e(the)i
+(database)g(\002le)h(from)2305 3533 y
+SDict begin H.S end
+ 2305 3533 a 2305
+3533 a
+SDict begin 13 H.A end
+ 2305 3533 a 2305 3533 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2373) cvn H.B /DEST pdfmark
+end
+ 2305 3533 a FC(yule)f(\(i.e.)f(from)h
+(the)g(serv)o(er\).)-2 3551 y
+SDict begin H.S end
+ -2 3551 a -2 3551 a
+SDict begin 11.7 H.A end
+ -2
+3551 a -2 3551 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2374) cvn H.B /DEST pdfmark
+end
+ -2 3551 a 745 3651 2668 17 v 745 4497
+17 846 v 1843 3804 a Fp(CA)-10 b(VEA)f(T)786 3972 y
+SDict begin H.S end
+ 786
+3972 a 786 3972 a
+SDict begin 11.7 H.A end
+ 786 3972 a 786 3972 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2376) cvn H.B /DEST pdfmark
+end
+ 786 3972 a 95
+x Fv(\223REQ_FR)o(OM_SER)l(VER\224)1624 4067 y
+SDict begin H.S end
+ 1624 4067
+a 1624 4067 a
+SDict begin 11.7 H.A end
+ 1624 4067 a 1624 4067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2377) cvn H.B /DEST pdfmark
+end
+ 1624 4067 a Fq(m)o(ust)28
+b Fv(be)20 b(f)n(ollo)o(w)o(ed)d(b)o(y)j(a)h(path)e(that)g(will)h(be)g
+(used)f(f)n(or)786 4165 y(wr)q(iting)g(the)h(database)e(\002le)i(when)
+1793 4165 y
+SDict begin H.S end
+ 1793 4165 a 1793 4165 a
+SDict begin 11.7 H.A end
+ 1793 4165 a 1793
+4165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2378) cvn H.B /DEST pdfmark
+end
+ 1793 4165 a Fq(initializing)t Fv(.)c(Upon)j(initialization,)d
+(the)k(database)e(is)786 4262 y(alw)o(a)n(ys)i(wr)q(itten)f(to)h(a)h
+(local)e(\002le)o(,)h(and)f(m)o(ust)i(be)f(copied)f(with)2556
+4262 y
+SDict begin H.S end
+ 2556 4262 a 2556 4262 a
+SDict begin 11.7 H.A end
+ 2556 4262 a 2556 4262
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2379) cvn H.B /DEST pdfmark
+end
+ 2556 4262 a Fw(scp)g Fv(to)h(the)g(ser)r(v)n(er)h(\(the)786
+4359 y(client)f(cannot)1227 4359 y
+SDict begin H.S end
+ 1227 4359 a 1227 4359
+a
+SDict begin 11.7 H.A end
+ 1227 4359 a 1227 4359 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2380) cvn H.B /DEST pdfmark
+end
+ 1227 4359 a Fq(upload)25 b
+Fv(the)20 b(database)e(\002le)i(to)g(the)g(ser)r(v)n(er)l(,)h(as)f
+(this)g(w)o(ould)f(open)g(a)786 4456 y(secur)q(ity)i(hole\).)p
+3396 4497 17 846 v 745 4513 2668 17 v -2 4690 a
+SDict begin H.S end
+ -2 4690
+a -2 4690 a
+SDict begin 13 H.A end
+ -2 4690 a -2 4690 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2381) cvn H.B /DEST pdfmark
+end
+ -2 4690 a 396 4747 a
+FC(Example:)735 4747 y
+SDict begin H.S end
+ 735 4747 a 735 4747 a
+SDict begin 13 H.A end
+ 735 4747
+a 735 4747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2382) cvn H.B /DEST pdfmark
+end
+ 735 4747 a Fy(--with-data-\002le=REQ_FR)n(OM_SER)-5
+b(VER/v)o(ar/lib/samhain/data.samhain)16 b FC(In)k(this)h(case,)396
+4855 y(the)f(client)h(will)g(request)e(to)h(do)n(wnload)f(the)h
+(database)f(\002le)i(from)e(the)i(serv)o(er)e(if)2719
+4855 y
+SDict begin H.S end
+ 2719 4855 a 2719 4855 a
+SDict begin 13 H.A end
+ 2719 4855 a 2719 4855
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2383) cvn H.B /DEST pdfmark
+end
+ 2719 4855 a Fx(c)o(hec)n(king)p FC(,)g(and)h(will)h(create)f(a)396
+4963 y(local)g(database)g(\002le)1012 4963 y
+SDict begin H.S end
+ 1012 4963
+a 1012 4963 a
+SDict begin 13 H.A end
+ 1012 4963 a 1012 4963 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2384) cvn H.B /DEST pdfmark
+end
+ 1012 4963 a Fr
+(/var/lib/samhain/data.samhain)c FC(if)2404 4963 y
+SDict begin H.S end
+ 2404
+4963 a 2404 4963 a
+SDict begin 13 H.A end
+ 2404 4963 a 2404 4963 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2385) cvn H.B /DEST pdfmark
+end
+ 2404 4963
+a Fx(initializing)p FC(.)k(Y)-9 b(ou)19 b(ha)n(v)o(e)h(to)g(use)3352
+4963 y
+SDict begin H.S end
+ 3352 4963 a 3352 4963 a
+SDict begin 13 H.A end
+ 3352 4963 a 3352 4963
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2386) cvn H.B /DEST pdfmark
+end
+ 3352 4963 a Fy(scp)h FC(to)f(cop)o(y)396 5071 y(the)g(\002le)h
+(signature)e(database)h(to)g(the)h(serv)o(er)e(then.)-2
+5089 y
+SDict begin H.S end
+ -2 5089 a -2 5089 a
+SDict begin 11.7 H.A end
+ -2 5089 a -2 5089 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2387) cvn H.B /DEST pdfmark
+end
+ -2 5089
+a Black 3658 5805 a Fx(67)p Black eop end
+%%Page: 68 73
+TeXDict begin 68 72 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.68) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2389) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 562 309 a Fw(NO)m(TE:)h Fv(F)n(or)e(ob)o(vious)g(secur)q(ity)h
+(reasons)o(,)f(the)h(client)f(cannot)g(specify)i(the)e(path)g(to)h(the)
+g(database)e(\002le)j(on)562 406 y(the)f(ser)r(v)n(er)h(side)o(.)e(The)
+h(ser)r(v)n(er)g(will)g(lookup)f(the)g(databse)g(\002le)h(using)g(only)
+f(the)h(hostname)f(of)h(the)g(client)f(and)562 503 y(the)h(compiled-in)
+e(path)h(f)n(or)h(the)f('localstatedir')e(\(see)j(belo)o(w\).)e(The)i
+(def)n(ault)e(f)n(or)h('localstatedir')e(is)3391 503
+y
+SDict begin H.S end
+ 3391 503 a 3391 503 a
+SDict begin 11.7 H.A end
+ 3391 503 a 3391 503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2390) cvn H.B /DEST pdfmark
+end
+ 3391 503
+a Ft(/var)p Fv(.)-2 818 y
+SDict begin H.S end
+ -2 818 a -2 818 a
+SDict begin 13 H.A end
+ -2 818 a
+-2 818 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2391) cvn H.B /DEST pdfmark
+end
+ -2 818 a 396 926 a FC(The)j(serv)o(er)f(will)i(search)f(for)g
+(the)g(database)g(\002le)g(to)h(send)f(in)g(the)g(follo)n(wing)f(order)
+g(of)h(priority)e(\(see)p 0 TeXcolorgray 396 1034 a
+SDict begin H.S end
+ 396
+1034 a FC(Section)i(A.5)789 1034 y
+SDict begin 13 H.L end
+ 789 1034 a 789 1034
+a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 789 1034 a Black -1 w FC(>\).)904 1034 y
+SDict begin H.S end
+ 904 1034 a
+904 1034 a
+SDict begin 13 H.A end
+ 904 1034 a 904 1034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2393) cvn H.B /DEST pdfmark
+end
+ 904 1034 a Fx(CLIENTN)n(AME)j
+FC(is)e(the)f(hostname)f(of)h(the)h(client')-5 b(s)20
+b(host,)g(as)h(listed)g(in)f(the)g(serv)o(er')-5 b(s)20
+b(con\002g)f(\002le)396 1142 y(in)i(the)604 1142 y
+SDict begin H.S end
+ 604
+1142 a 604 1142 a
+SDict begin 13 H.A end
+ 604 1142 a 604 1142 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2394) cvn H.B /DEST pdfmark
+end
+ 604 1142 a Fy(Clients)g
+FC(section:)-2 1309 y
+SDict begin H.S end
+ -2 1309 a -2 1309 a
+SDict begin 13 H.A end
+ -2 1309 a -2
+1309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2395) cvn H.B /DEST pdfmark
+end
+ -2 1309 a -2 1309 a
+SDict begin H.S end
+ -2 1309 a -2 1309 a
+SDict begin 13 H.A end
+ -2 1309
+a -2 1309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2396) cvn H.B /DEST pdfmark
+end
+ -2 1309 a -2 1319 a
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2
+1319 a -2 1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2397) cvn H.B /DEST pdfmark
+end
+ -2 1319 a Black 463 1478 a FC(1.)p Black
+546 1478 a
+SDict begin H.S end
+ 546 1478 a 546 1478 a
+SDict begin 13 H.A end
+ 546 1478 a 546 1478
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2398) cvn H.B /DEST pdfmark
+end
+ 546 1478 a 546 1478 a
+SDict begin H.S end
+ 546 1478 a 546 1478 a
+SDict begin 13 H.A end
+ 546 1478
+a 546 1478 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2399) cvn H.B /DEST pdfmark
+end
+ 546 1478 a Fr(localstatedir/lib/yule/file.CLIENTNAM)o(E)-2
+1490 y
+SDict begin H.S end
+ -2 1490 a -2 1490 a
+SDict begin 13 H.A end
+ -2 1490 a -2 1490 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2400) cvn H.B /DEST pdfmark
+end
+ -2 1490
+a Black 463 1628 a FC(2.)p Black 546 1628 a
+SDict begin H.S end
+ 546 1628
+a 546 1628 a
+SDict begin 13 H.A end
+ 546 1628 a 546 1628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2401) cvn H.B /DEST pdfmark
+end
+ 546 1628 a 546 1628
+a
+SDict begin H.S end
+ 546 1628 a 546 1628 a
+SDict begin 13 H.A end
+ 546 1628 a 546 1628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2402) cvn H.B /DEST pdfmark
+end
+ 546 1628
+a Fr(localstatedir/lib/yule/file)-2 1871 y
+SDict begin H.S end
+ -2 1871 a
+-2 1871 a
+SDict begin 13 H.A end
+ -2 1871 a -2 1871 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SERVER-LOGGING) cvn H.B /DEST
+pdfmark end
+ -2 1871 a 377 x Fu(6.6.)39
+b(Rules)f(f)m(or)i(log)o(ging)d(of)i(c)m(lient)g(messa)o(g)q(es)2775
+2248 y
+SDict begin H.S end
+ 2775 2248 a 2775 2248 a
+SDict begin 22.464 H.A end
+ 2775 2248 a 2775 2248
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.53.1) cvn H.B /DEST pdfmark
+end
+ 2775 2248 a -2 2446 a
+SDict begin H.S end
+ -2 2446 a -2 2446 a
+SDict begin 13 H.A end
+ -2 2446 a
+-2 2446 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2405) cvn H.B /DEST pdfmark
+end
+ -2 2446 a 396 2522 a FC(As)21 b(the)f(log)g(serv)o(er)g(may)f
+(recei)n(v)o(e)g(quite)h(a)h(lar)o(ge)e(number)g(of)g(log)h(messages)h
+(from)e(clients)h(\(depending)e(on)h(the)396 2630 y(number)g(of)h
+(clients)g(and)g(their)g(threshold)e(settings\),)i(client)h(messages)f
+(are)g(treated)g(specially)g(and)f(by)h(def)o(ault)396
+2738 y(are)g(only)g(logged)e(to)j(f)o(acilities)g(suitable)f(for)f(b)n
+(ulk)h(logging:)f(console,)g(log)h(\002le,)g(relational)f(database)h
+(\(if)396 2846 y(enabled\),)f(and)g(e)o(xternal)g(\(if)h(enabled\).)-2
+3027 y
+SDict begin H.S end
+ -2 3027 a -2 3027 a
+SDict begin 13 H.A end
+ -2 3027 a -2 3027 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2406) cvn H.B /DEST pdfmark
+end
+ -2 3027
+a 396 3120 a FC(T)-7 b(o)20 b(o)o(v)o(erride)d(this)j(beha)n(vior)m(,)e
+(you)g(can)i(set)g(the)g(option)2009 3120 y
+SDict begin H.S end
+ 2009 3120
+a 2009 3120 a
+SDict begin 13 H.A end
+ 2009 3120 a 2009 3120 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2407) cvn H.B /DEST pdfmark
+end
+ 2009 3120 a Fy(UseClientSe)o(v)o
+(erity=)2692 3120 y
+SDict begin H.S end
+ 2692 3120 a 2692 3120 a
+SDict begin 13 H.A end
+ 2692 3120
+a 2692 3120 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2408) cvn H.B /DEST pdfmark
+end
+ 2692 3120 a Fl(yes)f FC(in)h(the)3052 3120
+y
+SDict begin H.S end
+ 3052 3120 a 3052 3120 a
+SDict begin 13 H.A end
+ 3052 3120 a 3052 3120 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2409) cvn H.B /DEST pdfmark
+end
+ 3052
+3120 a Fx([Misc])h FC(section)f(of)f(the)396 3228 y(con\002guration)f
+(\002le.)i(In)g(that)h(case,)f(the)g(client)g(message)g(se)n(v)o(erity)
+g(is)h(used,)f(and)f(client)h(messages)h(are)f(treated)396
+3335 y(just)h(lik)o(e)f(local)h(messages)f(\(i.e.)g(lik)o(e)g(those)g
+(from)f(the)i(serv)o(er)e(itself\).)-2 3519 y
+SDict begin H.S end
+ -2 3519
+a -2 3519 a
+SDict begin 13 H.A end
+ -2 3519 a -2 3519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2410) cvn H.B /DEST pdfmark
+end
+ -2 3519 a 396 3609 a
+FC(If)h(you)g(also)g(w)o(ant)g(to)h(\002lter)f(by)g(message)g(class,)h
+(there)f(is)h(also)f(an)h(option)2574 3609 y
+SDict begin H.S end
+ 2574 3609
+a 2574 3609 a
+SDict begin 13 H.A end
+ 2574 3609 a 2574 3609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2411) cvn H.B /DEST pdfmark
+end
+ 2574 3609 a Fy(UseClientClass=)
+3156 3609 y
+SDict begin H.S end
+ 3156 3609 a 3156 3609 a
+SDict begin 13 H.A end
+ 3156 3609 a 3156
+3609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2412) cvn H.B /DEST pdfmark
+end
+ 3156 3609 a Fl(yes)-2 3793 y
+SDict begin H.S end
+ -2 3793 a -2 3793
+a
+SDict begin 13 H.A end
+ -2 3793 a -2 3793 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2413) cvn H.B /DEST pdfmark
+end
+ -2 3793 a 396 3883 a FC(All)g(client)f(messages)h
+(are)f(recorded)e(in)i(the)h(main)e(log)h(\002le)h(by)f(def)o(ault.)f
+(Ho)n(we)n(v)o(er)m(,)f(it)j(is)g(possible)f(to)g(use)396
+3991 y(separate)g(log)g(\002les)h(for)f(indi)n(vidual)e(clients.)i
+(This)h(can)f(be)g(enabled)f(with)2557 3991 y
+SDict begin H.S end
+ 2557 3991
+a 2557 3991 a
+SDict begin 13 H.A end
+ 2557 3991 a 2557 3991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2414) cvn H.B /DEST pdfmark
+end
+ 2557 3991 a Fy(UseSeparateLogs=)
+3219 3991 y
+SDict begin H.S end
+ 3219 3991 a 3219 3991 a
+SDict begin 13 H.A end
+ 3219 3991 a 3219
+3991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2415) cvn H.B /DEST pdfmark
+end
+ 3219 3991 a Fl(yes/no)h FC(in)g(the)396 4099 y
+SDict begin H.S end
+
+396 4099 a 396 4099 a
+SDict begin 13 H.A end
+ 396 4099 a 396 4099 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2416) cvn H.B /DEST pdfmark
+end
+ 396 4099
+a Fx(Misc)h FC(section)f(of)g(the)g(serv)o(er)g(con\002guration)d
+(\002le.)k(No)f(locking)f(will)i(be)f(performed)e(for)h(such)h
+(separate)g(client)396 4207 y(log)g(\002les)h(\(only)e(one)h(instance)g
+(of)g(the)g(serv)o(er)f(can)h(listen)h(on)f(the)g(TCP)h(port,)e(thus)h
+(there)g(will)h(be)f(no)g(concurrent)396 4315 y(access\).)-2
+4340 y
+SDict begin H.S end
+ -2 4340 a -2 4340 a
+SDict begin 13 H.A end
+ -2 4340 a -2 4340 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:GCM) cvn H.B /DEST pdfmark
+end
+ -2 4340
+a 363 x Fu(6.7.)39 b(Detecting)e(')-11 b(dead')38 b(c)m(lients)1866
+4703 y
+SDict begin H.S end
+ 1866 4703 a 1866 4703 a
+SDict begin 22.464 H.A end
+ 1866 4703 a 1866 4703
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.54.1) cvn H.B /DEST pdfmark
+end
+ 1866 4703 a -2 4901 a
+SDict begin H.S end
+ -2 4901 a -2 4901 a
+SDict begin 13 H.A end
+ -2 4901 a
+-2 4901 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2419) cvn H.B /DEST pdfmark
+end
+ -2 4901 a 396 4977 a FC(It)21 b(is)g(possible)f(to)g(set)h(a)
+g(time)f(limit)h(for)e(the)i(maximum)d(time)i(between)g(tw)o(o)g
+(consecuti)n(v)o(e)f(messages)h(of)g(a)g(client)396 5085
+y(\(option)657 5085 y
+SDict begin H.S end
+ 657 5085 a 657 5085 a
+SDict begin 13 H.A end
+ 657 5085
+a 657 5085 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2420) cvn H.B /DEST pdfmark
+end
+ 657 5085 a Fy(SetClientT)o(imeLimit)g FC(in)h(the)f
+([Misc])g(section)g(of)g(the)g(con\002guration)e(\002le\).)i(If)g(the)g
+(time)g(limit)h(is)396 5192 y(e)o(xceeded)e(without)g(a)i(message)f
+(from)f(the)h(client,)g(the)g(serv)o(er)g(will)h(issue)f(a)h(w)o
+(arning.)e(The)h(def)o(ault)f(is)i(86400)396 5300 y(seconds)f(\(one)f
+(day\);)h(specifying)e(a)j(v)n(alue)e(of)h(0)g(will)h(switch)g(of)n(f)e
+(this)i(option.)p Black 3661 5805 a Fx(68)p Black eop
+end
+%%Page: 69 74
+TeXDict begin 69 73 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.69) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2472) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2731 104 a Fx(Chapter)20
+b(6.)g(yule,)g(the)g(lo)o(g)g(server)p Black -2 226 a
+SDict begin H.S end
+
+-2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2421) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309
+a FC(Y)-9 b(ou)20 b(may)g(w)o(ant)g(to)g(set)1094 309
+y
+SDict begin H.S end
+ 1094 309 a 1094 309 a
+SDict begin 13 H.A end
+ 1094 309 a 1094 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2422) cvn H.B /DEST pdfmark
+end
+ 1094 309
+a Fy(ExportSe)o(v)o(erity)e(=)k(mark)e FC(\(or)g(an)o(y)f(lo)n(wer)h
+(threshold\))e(in)i(the)h(client)f(con\002guration)d(\002le)396
+417 y(in)k(order)e(to)h(log)g(timestamp)f(\('heartbeat'\))f(messages)i
+(to)h(the)f(serv)o(er)-5 b(.)-2 445 y
+SDict begin H.S end
+ -2 445 a -2 445
+a
+SDict begin 13 H.A end
+ -2 445 a -2 445 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SERVER-STATUS-INFORMATION)
+cvn H.B /DEST pdfmark end
+ -2 445 a 359 x Fu(6.8.)39 b(The)g(HTML)f(ser)q(ver)
+h(status)g(pa)o(g)q(e)2281 804 y
+SDict begin H.S end
+ 2281 804 a 2281 804
+a
+SDict begin 22.464 H.A end
+ 2281 804 a 2281 804 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.55.1) cvn H.B /DEST pdfmark
+end
+ 2281 804 a -2 1002 a
+SDict begin H.S end
+ -2 1002
+a -2 1002 a
+SDict begin 13 H.A end
+ -2 1002 a -2 1002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2425) cvn H.B /DEST pdfmark
+end
+ -2 1002 a -2 1002 a
+SDict begin H.S end
+ -2
+1002 a -2 1002 a
+SDict begin 13 H.A end
+ -2 1002 a -2 1002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2426) cvn H.B /DEST pdfmark
+end
+ -2 1002 a 396 1078
+a FC(yule)19 b(writes)h(the)g(current)e(status)i(to)g(a)g(HTML)f
+(\002le.)h(The)g(def)o(ault)e(name)h(of)h(this)g(\002le)g(is)2942
+1078 y
+SDict begin H.S end
+ 2942 1078 a 2942 1078 a
+SDict begin 13 H.A end
+ 2942 1078 a 2942 1078
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2427) cvn H.B /DEST pdfmark
+end
+ 2942 1078 a Fr(samhain.html)p FC(,)e(and)h(by)396 1186
+y(def)o(ault)h(it)h(is)g(placed)e(in)1113 1186 y
+SDict begin H.S end
+ 1113
+1186 a 1113 1186 a
+SDict begin 13 H.A end
+ 1113 1186 a 1113 1186 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2428) cvn H.B /DEST pdfmark
+end
+ 1113 1186
+a Fr(/var/log)p FC(.)-2 1370 y
+SDict begin H.S end
+ -2 1370 a -2 1370 a
+SDict begin 13 H.A end
+ -2
+1370 a -2 1370 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2429) cvn H.B /DEST pdfmark
+end
+ -2 1370 a 396 1460 a FC(The)h(\002le)h(contains)e(a)i
+(header)e(with)h(the)h(current)e(status)h(of)g(the)h(serv)o(er)e
+(\(starting)g(time,)h(current)f(time,)h(open)396 1568
+y(connections,)e(total)j(connections)d(since)i(start\),)h(and)e(a)i
+(table)f(that)g(lists)i(the)e(status)h(of)f(all)h(re)o(gistered)d
+(clients.)-2 1752 y
+SDict begin H.S end
+ -2 1752 a -2 1752 a
+SDict begin 13 H.A end
+ -2 1752 a -2
+1752 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2430) cvn H.B /DEST pdfmark
+end
+ -2 1752 a 396 1842 a FC(There)i(are)g(a)g(number)f(of)h
+(pre-de\002ned)d(e)n(v)o(ents)j(that)g(may)g(occur)f(for)h(a)g(client:)
+-2 1860 y
+SDict begin H.S end
+ -2 1860 a -2 1860 a
+SDict begin 13 H.A end
+ -2 1860 a -2 1860 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2431) cvn H.B /DEST pdfmark
+end
+ -2
+1860 a -2 1984 a
+SDict begin H.S end
+ -2 1984 a -2 1984 a
+SDict begin 13 H.A end
+ -2 1984 a -2 1984
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2433) cvn H.B /DEST pdfmark
+end
+ -2 1984 a 396 2074 a FC(Inacti)n(v)o(e)-2 2075 y
+SDict begin H.S end
+ -2
+2075 a -2 2075 a
+SDict begin 13 H.A end
+ -2 2075 a -2 2075 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2434) cvn H.B /DEST pdfmark
+end
+ -2 2075 a Black
+Black 562 2224 a
+SDict begin H.S end
+ 562 2224 a 562 2224 a
+SDict begin 13 H.A end
+ 562 2224 a 562
+2224 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2435) cvn H.B /DEST pdfmark
+end
+ 562 2224 a FC(The)g(client)g(has)h(not)f(connected)e(since)i
+(serv)o(er)g(startup.)-2 2325 y
+SDict begin H.S end
+ -2 2325 a -2 2325 a
+SDict begin 13 H.A end
+ -2
+2325 a -2 2325 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2437) cvn H.B /DEST pdfmark
+end
+ -2 2325 a 396 2415 a FC(Started)-2 2416
+y
+SDict begin H.S end
+ -2 2416 a -2 2416 a
+SDict begin 13 H.A end
+ -2 2416 a -2 2416 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2438) cvn H.B /DEST pdfmark
+end
+ -2 2416 a Black
+Black 562 2564 a
+SDict begin H.S end
+ 562 2564 a 562 2564 a
+SDict begin 13 H.A end
+ 562 2564 a 562
+2564 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2439) cvn H.B /DEST pdfmark
+end
+ 562 2564 a FC(The)g(client)g(has)h(started.)f(This)g(message)g
+(may)g(be)g(missing)g(if)g(the)h(client)f(w)o(as)h(already)e(running)f
+(at)j(serv)o(er)562 2672 y(startup.)-2 2773 y
+SDict begin H.S end
+ -2 2773
+a -2 2773 a
+SDict begin 13 H.A end
+ -2 2773 a -2 2773 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2441) cvn H.B /DEST pdfmark
+end
+ -2 2773 a 396 2863 a
+FC(Exited)-2 2864 y
+SDict begin H.S end
+ -2 2864 a -2 2864 a
+SDict begin 13 H.A end
+ -2 2864 a -2
+2864 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2442) cvn H.B /DEST pdfmark
+end
+ -2 2864 a Black Black 562 3013 a
+SDict begin H.S end
+ 562 3013 a 562
+3013 a
+SDict begin 13 H.A end
+ 562 3013 a 562 3013 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2443) cvn H.B /DEST pdfmark
+end
+ 562 3013 a FC(The)f(client)g(has)h(e)o
+(xited.)-2 3096 y
+SDict begin H.S end
+ -2 3096 a -2 3096 a
+SDict begin 13 H.A end
+ -2 3096 a -2 3096
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2445) cvn H.B /DEST pdfmark
+end
+ -2 3096 a 396 3203 a FC(Message)-2 3221 y
+SDict begin H.S end
+ -2 3221 a
+-2 3221 a
+SDict begin 13 H.A end
+ -2 3221 a -2 3221 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2446) cvn H.B /DEST pdfmark
+end
+ -2 3221 a Black Black 562
+3353 a
+SDict begin H.S end
+ 562 3353 a 562 3353 a
+SDict begin 13 H.A end
+ 562 3353 a 562 3353 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2447) cvn H.B /DEST pdfmark
+end
+ 562
+3353 a FC(The)f(client)g(has)h(sent)f(a)h(message.)-2
+3454 y
+SDict begin H.S end
+ -2 3454 a -2 3454 a
+SDict begin 13 H.A end
+ -2 3454 a -2 3454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2449) cvn H.B /DEST pdfmark
+end
+ -2 3454
+a 396 3544 a FC(File)g(transfer)-2 3545 y
+SDict begin H.S end
+ -2 3545 a -2
+3545 a
+SDict begin 13 H.A end
+ -2 3545 a -2 3545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2450) cvn H.B /DEST pdfmark
+end
+ -2 3545 a Black Black 562
+3693 a
+SDict begin H.S end
+ 562 3693 a 562 3693 a
+SDict begin 13 H.A end
+ 562 3693 a 562 3693 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2451) cvn H.B /DEST pdfmark
+end
+ 562
+3693 a FC(The)f(client)g(has)h(fetched)e(a)i(\002le)f(from)g(the)g
+(serv)o(er)-5 b(.)-2 3777 y
+SDict begin H.S end
+ -2 3777 a -2 3777 a
+SDict begin 13 H.A end
+ -2 3777
+a -2 3777 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2453) cvn H.B /DEST pdfmark
+end
+ -2 3777 a 396 3884 a FC(ILLEGAL)-2 3885 y
+SDict begin H.S end
+
+-2 3885 a -2 3885 a
+SDict begin 13 H.A end
+ -2 3885 a -2 3885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2454) cvn H.B /DEST pdfmark
+end
+ -2 3885 a Black
+Black 562 4034 a
+SDict begin H.S end
+ 562 4034 a 562 4034 a
+SDict begin 13 H.A end
+ 562 4034 a 562
+4034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2455) cvn H.B /DEST pdfmark
+end
+ 562 4034 a FC(Startup)20 b(without)f(prior)h(e)o(xit.)f(May)h
+(indicate)g(a)g(preceding)f(abnormal)f(termination.)-2
+4135 y
+SDict begin H.S end
+ -2 4135 a -2 4135 a
+SDict begin 13 H.A end
+ -2 4135 a -2 4135 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2457) cvn H.B /DEST pdfmark
+end
+ -2 4135
+a 396 4225 a FC(P)-8 b(ANIC)-2 4226 y
+SDict begin H.S end
+ -2 4226 a -2 4226
+a
+SDict begin 13 H.A end
+ -2 4226 a -2 4226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2458) cvn H.B /DEST pdfmark
+end
+ -2 4226 a Black Black 562 4374
+a
+SDict begin H.S end
+ 562 4374 a 562 4374 a
+SDict begin 13 H.A end
+ 562 4374 a 562 4374 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2459) cvn H.B /DEST pdfmark
+end
+ 562 4374
+a FC(The)20 b(client)g(has)h(encountered)c(a)k(f)o(atal)f(error)f
+(condition.)-2 4458 y
+SDict begin H.S end
+ -2 4458 a -2 4458 a
+SDict begin 13 H.A end
+ -2 4458 a -2
+4458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2461) cvn H.B /DEST pdfmark
+end
+ -2 4458 a 396 4565 a FC(F)-6 b(AILED)-2 4565 y
+SDict begin H.S end
+
+-2 4565 a -2 4565 a
+SDict begin 13 H.A end
+ -2 4565 a -2 4565 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2462) cvn H.B /DEST pdfmark
+end
+ -2 4565 a Black
+Black 562 4714 a
+SDict begin H.S end
+ 562 4714 a 562 4714 a
+SDict begin 13 H.A end
+ 562 4714 a 562
+4714 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2463) cvn H.B /DEST pdfmark
+end
+ 562 4714 a FC(An)21 b(unsuccessful)e(attempt)g(to)i(set)g(up)e
+(a)i(session)g(k)o(e)o(y)e(or)h(transfer)f(a)i(message.)-2
+4815 y
+SDict begin H.S end
+ -2 4815 a -2 4815 a
+SDict begin 13 H.A end
+ -2 4815 a -2 4815 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2465) cvn H.B /DEST pdfmark
+end
+ -2 4815
+a 396 4905 a FC(POLICY)-2 4906 y
+SDict begin H.S end
+ -2 4906 a -2 4906 a
+SDict begin 13 H.A end
+
+-2 4906 a -2 4906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2466) cvn H.B /DEST pdfmark
+end
+ -2 4906 a Black Black 562 5055 a
+SDict begin H.S end
+
+562 5055 a 562 5055 a
+SDict begin 13 H.A end
+ 562 5055 a 562 5055 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2467) cvn H.B /DEST pdfmark
+end
+ 562 5055
+a FC(The)f(client)g(has)h(disco)o(v)o(ered)d(a)i(polic)o(y)f
+(violation.)p Black 3661 5805 a Fx(69)p Black eop end
+%%Page: 70 75
+TeXDict begin 70 74 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.70) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2536) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2731 104 a Fx(Chapter)20
+b(6.)g(yule,)g(the)g(lo)o(g)g(server)p Black -2 226 a
+SDict begin H.S end
+
+-2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2469) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309
+a FC(TIME_EXCEEDED)-2 319 y
+SDict begin H.S end
+ -2 319 a -2 319 a
+SDict begin 13 H.A end
+ -2 319
+a -2 319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2470) cvn H.B /DEST pdfmark
+end
+ -2 319 a Black Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562
+458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2471) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(No)h(message)f(\(e.g.)f
+(timestamp\))g(has)i(been)e(recei)n(v)o(ed)g(from)g(the)h(client)g(for)
+g(a)g(de\002ned)g(amount)e(of)i(time)562 566 y(\(def)o(ault)f(1)i(day)
+-5 b(,)19 b(option)g(SetClientT)m(imeLimit\).)396 840
+y(F)o(or)h(each)g(client,)g(the)g(latest)h(e)n(v)o(ent)e(of)h(each)g
+(gi)n(v)o(en)f(type)h(is)h(listed.)f(Ev)o(ents)g(are)g(sorted)g(by)f
+(time.)i(Ev)o(ents)e(that)396 948 y(ha)n(v)o(e)h(not)g(occurred)e
+(\(yet\))h(are)i(not)e(listed.)-2 1132 y
+SDict begin H.S end
+ -2 1132 a -2
+1132 a
+SDict begin 13 H.A end
+ -2 1132 a -2 1132 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2473) cvn H.B /DEST pdfmark
+end
+ -2 1132 a 396 1222 a FC(It)i(is)g(possible)f
+(to)g(specify)g(templates)g(for)f(\(i\))h(the)h(\002le)f(header)m(,)f
+(\(ii\))h(a)h(single)f(table)g(entry)-5 b(,)19 b(and)g(\(iii\))i(the)f
+(\002le)h(end.)396 1330 y(T)-6 b(emplates)20 b(must)g(be)g(named)1281
+1330 y
+SDict begin H.S end
+ 1281 1330 a 1281 1330 a
+SDict begin 13 H.A end
+ 1281 1330 a 1281 1330
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2474) cvn H.B /DEST pdfmark
+end
+ 1281 1330 a Fr(head.html)p FC(,)1726 1330 y
+SDict begin H.S end
+ 1726 1330
+a 1726 1330 a
+SDict begin 13 H.A end
+ 1726 1330 a 1726 1330 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2475) cvn H.B /DEST pdfmark
+end
+ 1726 1330 a Fr(entry.html)p
+FC(,)e(and)2356 1330 y
+SDict begin H.S end
+ 2356 1330 a 2356 1330 a
+SDict begin 13 H.A end
+ 2356 1330
+a 2356 1330 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2476) cvn H.B /DEST pdfmark
+end
+ 2356 1330 a Fr(foot.html)p FC(,)h(respecti)n(v)o(ely)-5
+b(,)18 b(and)i(must)g(be)396 1438 y(located)g(in)g(the)g(data)g
+(directory)f(\(i.e.)1494 1438 y
+SDict begin H.S end
+ 1494 1438 a 1494 1438
+a
+SDict begin 13 H.A end
+ 1494 1438 a 1494 1438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2477) cvn H.B /DEST pdfmark
+end
+ 1494 1438 a Fr(localstatedir/lib/yule/)p
+FC(,)d(see)p 0 TeXcolorgray 2693 1438 a
+SDict begin H.S end
+ 2693 1438 a FC(Section)k(A.5)
+3086 1438 y
+SDict begin 13 H.L end
+ 3086 1438 a 3086 1438 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3086 1438 a Black
+-1 w FC(>\).)g(The)g(distrib)n(ution)396 1546 y(package)f(includes)g
+(tw)o(o)i(sample)f(\002les)1546 1546 y
+SDict begin H.S end
+ 1546 1546 a 1546
+1546 a
+SDict begin 13 H.A end
+ 1546 1546 a 1546 1546 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2479) cvn H.B /DEST pdfmark
+end
+ 1546 1546 a Fr(head.html)f
+FC(and)2111 1546 y
+SDict begin H.S end
+ 2111 1546 a 2111 1546 a
+SDict begin 13 H.A end
+ 2111 1546
+a 2111 1546 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2480) cvn H.B /DEST pdfmark
+end
+ 2111 1546 a Fr(foot.html)p FC(.)-2 1730
+y
+SDict begin H.S end
+ -2 1730 a -2 1730 a
+SDict begin 13 H.A end
+ -2 1730 a -2 1730 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2481) cvn H.B /DEST pdfmark
+end
+ -2 1730 a 396
+1820 a FC(The)h(follo)n(wing)f(replacements)f(will)j(be)g(made)e(in)h
+(the)h(head)e(template:)-2 1838 y
+SDict begin H.S end
+ -2 1838 a -2 1838 a
+SDict begin 13 H.A end
+
+-2 1838 a -2 1838 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2482) cvn H.B /DEST pdfmark
+end
+ -2 1838 a -2 1931 a
+SDict begin H.S end
+ -2 1931 a -2
+1931 a
+SDict begin 13 H.A end
+ -2 1931 a -2 1931 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2483) cvn H.B /DEST pdfmark
+end
+ -2 1931 a -2 1931 a
+SDict begin H.S end
+ -2 1931
+a -2 1931 a
+SDict begin 13 H.A end
+ -2 1931 a -2 1931 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.10) cvn H.B /DEST pdfmark
+end
+ -2 1931 a 396 1934 3359
+4 v 396 1934 V 396 2059 4 125 v 424 2034 a FD(Placeholder)p
+2074 2059 V 1208 w(Signi\002cance)p 3751 2059 V 396 2062
+3359 4 v 396 2062 V 396 2187 4 125 v 424 2162 a FC(\045T)p
+2074 2187 V 1558 w(Current)g(time.)p 3751 2187 V 396
+2190 3359 4 v 396 2190 V 396 2315 4 125 v 424 2290 a(\045S)p
+2074 2315 V 1563 w(Startup)g(time.)p 3751 2315 V 396
+2318 3359 4 v 396 2318 V 396 2442 4 125 v 424 2418 a(\045L)p
+2074 2442 V 1558 w(T)m(ime)h(of)g(last)h(connection.)p
+3751 2442 V 396 2446 3359 4 v 396 2446 V 396 2570 4 125
+v 424 2545 a(\045O)p 2074 2570 V 1549 w(Open)e(connections.)p
+3751 2570 V 396 2574 3359 4 v 396 2574 V 396 2698 4 125
+v 424 2673 a(\045A)p 2074 2698 V 1549 w(T)-7 b(otal)20
+b(connections)f(since)h(startup.)p 3751 2698 V 396 2702
+3359 4 v 396 2702 V 396 2826 4 125 v 424 2801 a(\045M)p
+2074 2826 V 1535 w(Maximum)f(simultaneous)f(connections.)p
+3751 2826 V 396 2829 3359 4 v 396 2829 V -2 2995 a
+SDict begin H.S end
+ -2
+2995 a -2 2995 a
+SDict begin 13 H.A end
+ -2 2995 a -2 2995 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2507) cvn H.B /DEST pdfmark
+end
+ -2 2995 a 396 3078
+a FC(The)i(follo)n(wing)f(replacements)f(will)j(be)g(made)e(in)h(the)h
+(entry)e(template:)-2 3096 y
+SDict begin H.S end
+ -2 3096 a -2 3096 a
+SDict begin 13 H.A end
+ -2 3096
+a -2 3096 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2508) cvn H.B /DEST pdfmark
+end
+ -2 3096 a -2 3190 a
+SDict begin H.S end
+ -2 3190 a -2 3190 a
+SDict begin 13 H.A end
+ -2
+3190 a -2 3190 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2509) cvn H.B /DEST pdfmark
+end
+ -2 3190 a -2 3190 a
+SDict begin H.S end
+ -2 3190 a -2 3190
+a
+SDict begin 13 H.A end
+ -2 3190 a -2 3190 a
+SDict begin [ /View [/XYZ H.V] /Dest (table.11) cvn H.B /DEST pdfmark
+end
+ -2 3190 a 396 3193 3359 4 v 396
+3193 V 396 3318 4 125 v 424 3293 a FD(Placeholder)p 2074
+3318 V 1208 w(Signi\002cance)p 3751 3318 V 396 3321 3359
+4 v 396 3321 V 396 3446 4 125 v 424 3421 a FC(\045H)p
+2074 3446 V 1549 w(Host)h(name.)p 3751 3446 V 396 3449
+3359 4 v 396 3449 V 396 3573 4 125 v 424 3548 a(\045S)p
+2074 3573 V 1563 w(Ev)o(ent.)p 3751 3573 V 396 3577 3359
+4 v 396 3577 V 396 3701 4 125 v 424 3676 a(\045T)p 2074
+3701 V 1558 w(T)m(ime)g(of)g(e)n(v)o(ent.)p 3751 3701
+V 396 3705 3359 4 v 396 3705 V -2 3705 a
+SDict begin H.S end
+ -2 3705 a -2
+3705 a
+SDict begin 11.7 H.A end
+ -2 3705 a -2 3705 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2524) cvn H.B /DEST pdfmark
+end
+ -2 3705 a -2 3871 a
+SDict begin H.S end
+ -2 3871
+a -2 3871 a
+SDict begin 11.7 H.A end
+ -2 3871 a -2 3871 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2526) cvn H.B /DEST pdfmark
+end
+ -2 3871 a 562 3943 a
+Fw(TIP:)g Fv(A)h(liter)o(al)d('\045')j(in)f(the)f(HTML)h(output)f(m)o
+(ust)i(be)f(represented)d(b)o(y)j(a)h('\045)f(')h(\('\045')f(f)n(ollo)o
+(w)o(ed)e(b)o(y)i(space\))g(in)g(the)562 4040 y(template)o(.)-2
+4272 y
+SDict begin H.S end
+ -2 4272 a -2 4272 a
+SDict begin 13 H.A end
+ -2 4272 a -2 4272 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHROOT) cvn H.B /DEST pdfmark
+end
+ -2 4272
+a 378 x Fu(6.9.)39 b(Chr)m(oot)746 4650 y
+SDict begin H.S end
+ 746 4650 a
+746 4650 a
+SDict begin 22.464 H.A end
+ 746 4650 a 746 4650 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.56.1) cvn H.B /DEST pdfmark
+end
+ 746 4650 a -2 4817 a
+SDict begin H.S end
+
+-2 4817 a -2 4817 a
+SDict begin 13 H.A end
+ -2 4817 a -2 4817 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2529) cvn H.B /DEST pdfmark
+end
+ -2 4817 a 396
+4924 a FC(As)21 b(of)f(v)o(ersion)f(1.7.0,)1071 4924
+y
+SDict begin H.S end
+ 1071 4924 a 1071 4924 a
+SDict begin 13 H.A end
+ 1071 4924 a 1071 4924 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2530) cvn H.B /DEST pdfmark
+end
+ 1071
+4924 a FC(yuleis)h(able)g(to)g(chroot)f(itself)i(after)f(startup)f(and)
+h(initialization,)f(either)h(by)g(using)g(the)396 5031
+y(command)e(line)j(option)-2 5132 y
+SDict begin H.S end
+ -2 5132 a -2 5132
+a
+SDict begin 11.7 H.A end
+ -2 5132 a -2 5132 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2531) cvn H.B /DEST pdfmark
+end
+ -2 5132 a -2 5132 a
+SDict begin H.S end
+ -2 5132 a -2
+5132 a
+SDict begin 11.7 H.A end
+ -2 5132 a -2 5132 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2532) cvn H.B /DEST pdfmark
+end
+ -2 5132 a 396 5212 a Ft(bash$)596
+5212 y
+SDict begin H.S end
+ 596 5212 a 596 5212 a
+SDict begin 11.7 H.A end
+ 596 5212 a 596 5212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2533) cvn H.B /DEST pdfmark
+end
+ 596
+5212 a 42 w Fs(yule)42 b(--chroot=)1200 5212 y
+SDict begin H.S end
+ 1200 5212
+a 1200 5212 a
+SDict begin 11.7 H.A end
+ 1200 5212 a 1200 5212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2534) cvn H.B /DEST pdfmark
+end
+ 1200 5212 a Fd(/chrootdir)p
+Black 3661 5805 a Fx(70)p Black eop end
+%%Page: 71 76
+TeXDict begin 71 75 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.71) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2594) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2731 104 a Fx(Chapter)20
+b(6.)g(yule,)g(the)g(lo)o(g)g(server)p Black -2 226 a
+SDict begin H.S end
+
+-2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2535) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309
+a FC(or)g(by)g(requesting)f(it)h(in)h(the)f(con\002guration)e(\002le:)
+396 489 y Fr([Misc])396 586 y Fc(SetChrootDir=)p Fm(path)-2
+761 y
+SDict begin H.S end
+ -2 761 a -2 761 a
+SDict begin 13 H.A end
+ -2 761 a -2 761 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2539) cvn H.B /DEST pdfmark
+end
+ -2 761 a 396
+860 a FC(In)i(order)f(to)h(prepare)f(for)h(the)g(chroot)f(jail,)h(the)h
+(follo)n(wing)d(is)j(required:)-2 878 y
+SDict begin H.S end
+ -2 878 a -2 878
+a
+SDict begin 11.7 H.A end
+ -2 878 a -2 878 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2540) cvn H.B /DEST pdfmark
+end
+ -2 878 a -2 1002 a
+SDict begin H.S end
+ -2 1002 a -2 1002
+a
+SDict begin 11.7 H.A end
+ -2 1002 a -2 1002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2542) cvn H.B /DEST pdfmark
+end
+ -2 1002 a 562 1082 a Fw(TIP:)f
+Fv(In)g(the)932 1082 y
+SDict begin H.S end
+ 932 1082 a 932 1082 a
+SDict begin 11.7 H.A end
+ 932 1082
+a 932 1082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2543) cvn H.B /DEST pdfmark
+end
+ 932 1082 a Ft(scripts)j Fv(subdirector)r(y)c(of)h(the)g
+(source)g(director)r(y)f(there)g(is)i(a)f(scr)q(ipt)2956
+1082 y
+SDict begin H.S end
+ 2956 1082 a 2956 1082 a
+SDict begin 11.7 H.A end
+ 2956 1082 a 2956 1082
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2544) cvn H.B /DEST pdfmark
+end
+ 2956 1082 a Ft(chroot.sh)k Fv(to)c(perf)n(or)r(m)562
+1179 y(steps)h(\(4\))f(and)f(\(5\))h(\(only)g(f)n(or)g(Lin)o(ux\).)-2
+1494 y
+SDict begin H.S end
+ -2 1494 a -2 1494 a
+SDict begin 13 H.A end
+ -2 1494 a -2 1494 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2545) cvn H.B /DEST pdfmark
+end
+ -2 1494
+a -2 1494 a
+SDict begin H.S end
+ -2 1494 a -2 1494 a
+SDict begin 13 H.A end
+ -2 1494 a -2 1494 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2546) cvn H.B /DEST pdfmark
+end
+ -2
+1494 a -2 1577 a
+SDict begin H.S end
+ -2 1577 a -2 1577 a
+SDict begin 13 H.A end
+ -2 1577 a -2 1577
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2547) cvn H.B /DEST pdfmark
+end
+ -2 1577 a Black 463 1851 a FC(1.)p Black 546 1851 a
+SDict begin H.S end
+
+546 1851 a 546 1851 a
+SDict begin 13 H.A end
+ 546 1851 a 546 1851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2548) cvn H.B /DEST pdfmark
+end
+ 546 1851
+a FC(Compile)f(normally)-5 b(.)18 b(Mak)o(e)i(sure)g(you)f(use)h
+(either)2041 1851 y
+SDict begin H.S end
+ 2041 1851 a 2041 1851 a
+SDict begin 13 H.A end
+ 2041 1851
+a 2041 1851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2549) cvn H.B /DEST pdfmark
+end
+ 2041 1851 a Fr(dev/random)f FC(\(def)o(ault)g(if)h(e)o
+(xisting\))f(or)h(EGD)g(\(Entrop)o(y)546 1959 y(Gathering)e(Daemon\))h
+(for)h(the)g(entrop)o(y)e(de)n(vice.)i(If)2074 1959 y
+SDict begin H.S end
+
+2074 1959 a 2074 1959 a
+SDict begin 13 H.A end
+ 2074 1959 a 2074 1959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2550) cvn H.B /DEST pdfmark
+end
+ 2074
+1959 a Fr(dev/random)f FC(does)h(not)f(e)o(xist,)i(the)f(def)o(ault)f
+(is)i(the)546 2067 y(')-5 b(standard)19 b(unix)g(entrop)o(y)g
+(gatherer',)e(which)j(uses)h(the)f(output)f(of)h(man)o(y)f(system)h
+(commands,)f(and)546 2175 y(therefore)f(is)j(not)f(suitable)g(within)g
+(a)h(chroot)e(jail.)-2 2193 y
+SDict begin H.S end
+ -2 2193 a -2 2193 a
+SDict begin 13 H.A end
+ -2
+2193 a -2 2193 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2551) cvn H.B /DEST pdfmark
+end
+ -2 2193 a Black 463 2324 a FC(2.)p Black
+546 2324 a
+SDict begin H.S end
+ 546 2324 a 546 2324 a
+SDict begin 13 H.A end
+ 546 2324 a 546 2324
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2552) cvn H.B /DEST pdfmark
+end
+ 546 2324 a FC(Install)h(with)g(the)h(command\(s\):)-2
+2381 y
+SDict begin H.S end
+ -2 2381 a -2 2381 a
+SDict begin 11.7 H.A end
+ -2 2381 a -2 2381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2553) cvn H.B /DEST pdfmark
+end
+ -2 2381
+a -2 2381 a
+SDict begin H.S end
+ -2 2381 a -2 2381 a
+SDict begin 11.7 H.A end
+ -2 2381 a -2 2381 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2554) cvn H.B /DEST pdfmark
+end
+ -2
+2381 a 546 2463 a Ft(bash$)746 2463 y
+SDict begin H.S end
+ 746 2463 a 746
+2463 a
+SDict begin 11.7 H.A end
+ 746 2463 a 746 2463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2555) cvn H.B /DEST pdfmark
+end
+ 746 2463 a 42 w Fs(make)42
+b(DESTDIR=)1310 2463 y
+SDict begin H.S end
+ 1310 2463 a 1310 2463 a
+SDict begin 11.7 H.A end
+ 1310 2463
+a 1310 2463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2556) cvn H.B /DEST pdfmark
+end
+ 1310 2463 a Fd(/chrootdir)49 b Fs(install)-2
+2471 y
+SDict begin H.S end
+ -2 2471 a -2 2471 a
+SDict begin 11.7 H.A end
+ -2 2471 a -2 2471 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2557) cvn H.B /DEST pdfmark
+end
+ -2 2471
+a 546 2560 a Ft(bash$)746 2560 y
+SDict begin H.S end
+ 746 2560 a 746 2560
+a
+SDict begin 11.7 H.A end
+ 746 2560 a 746 2560 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2558) cvn H.B /DEST pdfmark
+end
+ 746 2560 a 42 w Fs(make)42 b(DESTDIR=)1310
+2560 y
+SDict begin H.S end
+ 1310 2560 a 1310 2560 a
+SDict begin 11.7 H.A end
+ 1310 2560 a 1310 2560
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2559) cvn H.B /DEST pdfmark
+end
+ 1310 2560 a Fd(/chrootdir)49 b Fs(install-user)-2 2568
+y
+SDict begin H.S end
+ -2 2568 a -2 2568 a
+SDict begin 11.7 H.A end
+ -2 2568 a -2 2568 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2560) cvn H.B /DEST pdfmark
+end
+ -2 2568 a 546
+2657 a Ft(bash$)746 2657 y
+SDict begin H.S end
+ 746 2657 a 746 2657 a
+SDict begin 11.7 H.A end
+ 746
+2657 a 746 2657 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2561) cvn H.B /DEST pdfmark
+end
+ 746 2657 a 42 w Fs(make)42 b(install-boot)-2
+2665 y
+SDict begin H.S end
+ -2 2665 a -2 2665 a
+SDict begin 13 H.A end
+ -2 2665 a -2 2665 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2562) cvn H.B /DEST pdfmark
+end
+ -2 2665
+a Black 463 2807 a FC(3.)p Black 546 2807 a
+SDict begin H.S end
+ 546 2807
+a 546 2807 a
+SDict begin 13 H.A end
+ 546 2807 a 546 2807 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2563) cvn H.B /DEST pdfmark
+end
+ 546 2807 a FC(Fix)20
+b(the)g(path)g(to)g(the)1171 2807 y
+SDict begin H.S end
+ 1171 2807 a 1171
+2807 a
+SDict begin 13 H.A end
+ 1171 2807 a 1171 2807 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2564) cvn H.B /DEST pdfmark
+end
+ 1171 2807 a FC(yule)f(binary)g(in)i(the)
+f(runle)n(v)o(el)e(start/stop)j(script)f(installed)g(by)g(the)g(last)h
+(command.)-2 2825 y
+SDict begin H.S end
+ -2 2825 a -2 2825 a
+SDict begin 13 H.A end
+ -2 2825 a -2
+2825 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2565) cvn H.B /DEST pdfmark
+end
+ -2 2825 a Black 463 2956 a FC(4.)p Black 546 2956
+a
+SDict begin H.S end
+ 546 2956 a 546 2956 a
+SDict begin 13 H.A end
+ 546 2956 a 546 2956 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2566) cvn H.B /DEST pdfmark
+end
+ 546 2956
+a FC(Prepare)e(the)h(chroot)f(en)m(vironment.)e(Basically)-5
+b(,)20 b(you)f(need)h(under)2511 2956 y
+SDict begin H.S end
+ 2511 2956 a 2511
+2956 a
+SDict begin 13 H.A end
+ 2511 2956 a 2511 2956 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2567) cvn H.B /DEST pdfmark
+end
+ 2511 2956 a Fr(/chrootdir)-2
+3140 y
+SDict begin H.S end
+ -2 3140 a -2 3140 a
+SDict begin 13 H.A end
+ -2 3140 a -2 3140 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2568) cvn H.B /DEST pdfmark
+end
+ -2 3140
+a 546 3230 a FC(\(a\))g(an)g(entrop)o(y)e(de)n(vice,)h(either)1497
+3230 y
+SDict begin H.S end
+ 1497 3230 a 1497 3230 a
+SDict begin 13 H.A end
+ 1497 3230 a 1497 3230
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2569) cvn H.B /DEST pdfmark
+end
+ 1497 3230 a Fr(dev/random)p FC(,)1987 3230 y
+SDict begin H.S end
+ 1987 3230
+a 1987 3230 a
+SDict begin 13 H.A end
+ 1987 3230 a 1987 3230 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2570) cvn H.B /DEST pdfmark
+end
+ 1987 3230 a Fr(dev/urandom)p
+FC(,)g(or)h(an)g(EGD)g(\(Entrop)o(y)e(Gathering)546 3338
+y(Daemon\))g(sock)o(et,)-2 3519 y
+SDict begin H.S end
+ -2 3519 a -2 3519 a
+SDict begin 13 H.A end
+
+-2 3519 a -2 3519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2571) cvn H.B /DEST pdfmark
+end
+ -2 3519 a 546 3612 a FC(\(b\))h(minimum)1007
+3612 y
+SDict begin H.S end
+ 1007 3612 a 1007 3612 a
+SDict begin 13 H.A end
+ 1007 3612 a 1007 3612
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2572) cvn H.B /DEST pdfmark
+end
+ 1007 3612 a Fr(etc/passwd)p FC(,)1497 3612 y
+SDict begin H.S end
+ 1497 3612
+a 1497 3612 a
+SDict begin 13 H.A end
+ 1497 3612 a 1497 3612 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2573) cvn H.B /DEST pdfmark
+end
+ 1497 3612 a Fr(etc/group)g
+FC(\002les,)i(at)g(least)g(with)f(entries)g(for)g(root)f(and)h(the)g
+(unpri)n(vile)o(ged)546 3720 y
+SDict begin H.S end
+ 546 3720 a 546 3720 a
+SDict begin 13 H.A end
+
+546 3720 a 546 3720 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2574) cvn H.B /DEST pdfmark
+end
+ 546 3720 a FC(yule)f(user)-5 b(.)21
+b(Replace)f(passw)o(ords)g(with)g(an)g(asterix,)g(and)g(mak)o(e)f(sure)
+h(the)h(homedirectory)c(of)i(the)546 3828 y(unpri)n(vile)o(ged)983
+3828 y
+SDict begin H.S end
+ 983 3828 a 983 3828 a
+SDict begin 13 H.A end
+ 983 3828 a 983 3828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2575) cvn H.B /DEST pdfmark
+end
+ 983
+3828 a FC(yule)h(user)g(is)h(correct)e(within)h(the)g(chroot)f(jail.)-2
+4012 y
+SDict begin H.S end
+ -2 4012 a -2 4012 a
+SDict begin 13 H.A end
+ -2 4012 a -2 4012 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2576) cvn H.B /DEST pdfmark
+end
+ -2 4012
+a 546 4102 a FC(\(c\))h(\002les)h(required)d(for)i(DNS:)1443
+4102 y
+SDict begin H.S end
+ 1443 4102 a 1443 4102 a
+SDict begin 13 H.A end
+ 1443 4102 a 1443 4102
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2577) cvn H.B /DEST pdfmark
+end
+ 1443 4102 a Fr(etc/nsswitch.conf)p FC(,)2246 4102 y
+SDict begin H.S end
+
+2246 4102 a 2246 4102 a
+SDict begin 13 H.A end
+ 2246 4102 a 2246 4102 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2578) cvn H.B /DEST pdfmark
+end
+ 2246
+4102 a Fr(etc/hosts)p FC(,)2691 4102 y
+SDict begin H.S end
+ 2691 4102 a 2691
+4102 a
+SDict begin 13 H.A end
+ 2691 4102 a 2691 4102 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2579) cvn H.B /DEST pdfmark
+end
+ 2691 4102 a Fr(etc/host.conf)p
+FC(,)546 4210 y
+SDict begin H.S end
+ 546 4210 a 546 4210 a
+SDict begin 13 H.A end
+ 546 4210 a 546
+4210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2580) cvn H.B /DEST pdfmark
+end
+ 546 4210 a Fr(etc/resolv.conf)p FC(,)1260 4210
+y
+SDict begin H.S end
+ 1260 4210 a 1260 4210 a
+SDict begin 13 H.A end
+ 1260 4210 a 1260 4210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2581) cvn H.B /DEST pdfmark
+end
+ 1260
+4210 a Fr(etc/services)p FC(,)1839 4210 y
+SDict begin H.S end
+ 1839 4210 a
+1839 4210 a
+SDict begin 13 H.A end
+ 1839 4210 a 1839 4210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2582) cvn H.B /DEST pdfmark
+end
+ 1839 4210 a Fr(etc/protocols)p
+FC(.)438 4328 y
+SDict begin H.S end
+ 438 4328 a 438 4328 a
+SDict begin 13 H.A end
+ 438 4328 a 438
+4328 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2583) cvn H.B /DEST pdfmark
+end
+ 438 4328 a Black 463 4478 a FC(5.)p Black 546
+4478 a
+SDict begin H.S end
+ 546 4478 a 546 4478 a
+SDict begin 13 H.A end
+ 546 4478 a 546 4478 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2584) cvn H.B /DEST pdfmark
+end
+ 546
+4478 a FC(Create)g(a)h(symlink)1129 4478 y
+SDict begin H.S end
+ 1129 4478
+a 1129 4478 a
+SDict begin 13 H.A end
+ 1129 4478 a 1129 4478 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2585) cvn H.B /DEST pdfmark
+end
+ 1129 4478 a Fr(/etc/yulerc)e
+FC(to)1728 4478 y
+SDict begin H.S end
+ 1728 4478 a 1728 4478 a
+SDict begin 13 H.A end
+ 1728 4478 a
+1728 4478 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2586) cvn H.B /DEST pdfmark
+end
+ 1728 4478 a Fr(/chrootdir/etc/yulerc)f FC(\(no,)h(it)i
+(will)g(not)e(w)o(ork)h(the)g(other)546 4586 y(w)o(ay)g(round\).)-2
+4901 y
+SDict begin H.S end
+ -2 4901 a -2 4901 a
+SDict begin 13 H.A end
+ -2 4901 a -2 4901 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2587) cvn H.B /DEST pdfmark
+end
+ -2 4901
+a 396 5009 a FC(Because)694 5009 y
+SDict begin H.S end
+ 694 5009 a 694 5009
+a
+SDict begin 13 H.A end
+ 694 5009 a 694 5009 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2588) cvn H.B /DEST pdfmark
+end
+ 694 5009 a FC(yule)f(chroots)h(after)f
+(startup,)h(there)g(is)h(no)e(need)h(to)g(cop)o(y)g(shared)f(libraries)
+h(into)g(the)g(chroot)f(jail.)i(The)o(y)396 5117 y(will)g(be)f(loaded)f
+(upon)g(startup,)h(before)f(the)h(chroot\(\))e(occurs.)-2
+5135 y
+SDict begin H.S end
+ -2 5135 a -2 5135 a
+SDict begin 11.7 H.A end
+ -2 5135 a -2 5135 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2589) cvn H.B /DEST pdfmark
+end
+ -2 5135
+a Black 3661 5805 a Fx(71)p Black eop end
+%%Page: 72 77
+TeXDict begin 72 76 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.72) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2591) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 562 309 a Fw(TIP:)g Fv(If)g(y)o(ou)g(are)f(using)g(syslog)i
+(logging,)c(y)o(ou)i(need)g(a)2156 309 y
+SDict begin H.S end
+ 2156 309 a 2156
+309 a
+SDict begin 11.7 H.A end
+ 2156 309 a 2156 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2592) cvn H.B /DEST pdfmark
+end
+ 2156 309 a Ft(dev/log)k Fv(soc)o(k)o(et)d
+(in)g(the)f(chroot)g(jail.)g(Moder)r(n)3533 309 y
+SDict begin H.S end
+ 3533
+309 a 3533 309 a
+SDict begin 11.7 H.A end
+ 3533 309 a 3533 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2593) cvn H.B /DEST pdfmark
+end
+ 3533 309 a Fv(syslog)562
+406 y(incar)r(nations)f(will)h(allo)o(w)g(y)o(ou)h(to)g(ha)o(v)n(e)f
+(an)h(additional)d(soc)o(k)o(et)i(using)h(the)f(command:)562
+576 y Fo(bash$)742 576 y
+SDict begin H.S end
+ 742 576 a 742 576 a
+SDict begin 10.53 H.A end
+ 742 576
+a 742 576 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2596) cvn H.B /DEST pdfmark
+end
+ 742 576 a 38 w Fn(syslogd)39 b(-a)1180 576
+y
+SDict begin H.S end
+ 1180 576 a 1180 576 a
+SDict begin 10.53 H.A end
+ 1180 576 a 1180 576 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2597) cvn H.B /DEST pdfmark
+end
+ 1180 576
+a Fb(/chrootdir)s Fn(/dev/log)39 756 y
+SDict begin H.S end
+ 39 756 a 39 756
+a
+SDict begin 11.7 H.A end
+ 39 756 a 39 756 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2598) cvn H.B /DEST pdfmark
+end
+ 39 756 a -2 922 a
+SDict begin H.S end
+ -2 922 a -2 922
+a
+SDict begin 11.7 H.A end
+ -2 922 a -2 922 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2600) cvn H.B /DEST pdfmark
+end
+ -2 922 a 562 1020 a Fw(TIP:)20 b
+Fv(If)h(y)o(ou)e(are)h(using)f(a)i(Gn)o(uPG-signed)d(con\002gur)o
+(ation,)f(y)o(ou)j(will)g(need)f(a)h(w)o(or)q(king)f(cop)n(y)i(of)3351
+1020 y
+SDict begin H.S end
+ 3351 1020 a 3351 1020 a
+SDict begin 11.7 H.A end
+ 3351 1020 a 3351 1020
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2601) cvn H.B /DEST pdfmark
+end
+ 3351 1020 a Fv(gpg)e(in)h(the)562 1117 y(chroot)g(jail.)-2
+1349 y
+SDict begin H.S end
+ -2 1349 a -2 1349 a
+SDict begin 13 H.A end
+ -2 1349 a -2 1349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LIBWRAP) cvn H.B /DEST pdfmark
+end
+ -2 1349
+a 377 x Fu(6.10.)39 b(Restrict)f(access)g(with)h(libwrap)f(\(tcp)h
+(wrapper)n(s\))3307 1726 y
+SDict begin H.S end
+ 3307 1726 a 3307 1726 a
+SDict begin 22.464 H.A end
+ 3307
+1726 a 3307 1726 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.57.1) cvn H.B /DEST pdfmark
+end
+ 3307 1726 a -2 1922 a
+SDict begin H.S end
+ -2 1922 a -2
+1922 a
+SDict begin 13 H.A end
+ -2 1922 a -2 1922 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2604) cvn H.B /DEST pdfmark
+end
+ -2 1922 a 396 2000 a FC(As)21
+b(of)f(v)o(ersion)f(1.8.0,)1071 2000 y
+SDict begin H.S end
+ 1071 2000 a 1071
+2000 a
+SDict begin 13 H.A end
+ 1071 2000 a 1071 2000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2605) cvn H.B /DEST pdfmark
+end
+ 1071 2000 a FC(yule)g(can)h(be)g(b)n
+(uild)g(with)h(support)d(for)2215 2000 y
+SDict begin H.S end
+ 2215 2000 a
+2215 2000 a
+SDict begin 13 H.A end
+ 2215 2000 a 2215 2000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2606) cvn H.B /DEST pdfmark
+end
+ 2215 2000 a FC(libwrap,)h(i.e.)h(W)
+m(ietse)h(V)-9 b(enema')k(s)20 b(tcp)g(wrappers)396 2108
+y(libraries.)g(T)-7 b(o)20 b(enable)g(this,)g(use)h(the)1469
+2108 y
+SDict begin H.S end
+ 1469 2108 a 1469 2108 a
+SDict begin 13 H.A end
+ 1469 2108 a 1469 2108
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2607) cvn H.B /DEST pdfmark
+end
+ 1469 2108 a Fy(con\002gur)o(e)e FC(option)2053 2108
+y
+SDict begin H.S end
+ 2053 2108 a 2053 2108 a
+SDict begin 13 H.A end
+ 2053 2108 a 2053 2108 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2608) cvn H.B /DEST pdfmark
+end
+ 2053
+2108 a Fx(--with-libwr)o(ap)p FC(.)-2 2292 y
+SDict begin H.S end
+ -2 2292
+a -2 2292 a
+SDict begin 13 H.A end
+ -2 2292 a -2 2292 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2609) cvn H.B /DEST pdfmark
+end
+ -2 2292 a 396 2382 a
+FC(Y)-9 b(ou)20 b(can)g(then)g(restrict)g(access)h(to)1420
+2382 y
+SDict begin H.S end
+ 1420 2382 a 1420 2382 a
+SDict begin 13 H.A end
+ 1420 2382 a 1420 2382
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2610) cvn H.B /DEST pdfmark
+end
+ 1420 2382 a FC(yule)f(with)g(appropriate)e(entries)i(in)g(the)2601
+2382 y
+SDict begin H.S end
+ 2601 2382 a 2601 2382 a
+SDict begin 13 H.A end
+ 2601 2382 a 2601 2382
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2611) cvn H.B /DEST pdfmark
+end
+ 2601 2382 a Fr(/etc/hosts.allow)e FC(and/or)396 2490
+y
+SDict begin H.S end
+ 396 2490 a 396 2490 a
+SDict begin 13 H.A end
+ 396 2490 a 396 2490 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2612) cvn H.B /DEST pdfmark
+end
+ 396 2490
+a Fr(/etc/hosts.deny)g FC(\002les.)-2 2502 y
+SDict begin H.S end
+ -2 2502
+a -2 2502 a
+SDict begin 11.7 H.A end
+ -2 2502 a -2 2502 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2613) cvn H.B /DEST pdfmark
+end
+ -2 2502 a -2 2626 a
+SDict begin H.S end
+ -2
+2626 a -2 2626 a
+SDict begin 11.7 H.A end
+ -2 2626 a -2 2626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2615) cvn H.B /DEST pdfmark
+end
+ -2 2626 a 562 2712
+a Fw(NO)m(TE:)j Fv(If)f(y)o(ou)g(use)g(the)1280 2712
+y
+SDict begin H.S end
+ 1280 2712 a 1280 2712 a
+SDict begin 11.7 H.A end
+ 1280 2712 a 1280 2712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2616) cvn H.B /DEST pdfmark
+end
+ 1280
+2712 a Fw(con\002gure)f Fv(option)1866 2712 y
+SDict begin H.S end
+ 1866 2712
+a 1866 2712 a
+SDict begin 11.7 H.A end
+ 1866 2712 a 1866 2712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2617) cvn H.B /DEST pdfmark
+end
+ 1866 2712 a Fq(--enab)o
+(le-install-na)o(me=NAME)7 b Fv(,)14 b(then)3040 2712
+y
+SDict begin H.S end
+ 3040 2712 a 3040 2712 a
+SDict begin 11.7 H.A end
+ 3040 2712 a 3040 2712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2618) cvn H.B /DEST pdfmark
+end
+ 3040
+2712 a Fv(yule)20 b(will)g(be)g(installed)562 2809 y(as)h('NAME',)f
+(and)f(this)h(is)h(what)e(y)o(ou)h(then)f(need)g(to)h(use)g(as)h(the)f
+(daemons)f(name)g(in)h(the)562 2906 y
+SDict begin H.S end
+ 562 2906 a 562
+2906 a
+SDict begin 11.7 H.A end
+ 562 2906 a 562 2906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2619) cvn H.B /DEST pdfmark
+end
+ 562 2906 a Ft(/etc/hosts.allow)27
+b Fv(and/or)1461 2906 y
+SDict begin H.S end
+ 1461 2906 a 1461 2906 a
+SDict begin 11.7 H.A end
+ 1461
+2906 a 1461 2906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2620) cvn H.B /DEST pdfmark
+end
+ 1461 2906 a Ft(/etc/hosts.deny)f Fv(\002les)o(.)-2
+3139 y
+SDict begin H.S end
+ -2 3139 a -2 3139 a
+SDict begin 13 H.A end
+ -2 3139 a -2 3139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SEND-COMMANDS) cvn H.B /DEST
+pdfmark end
+ -2 3139
+a 377 x Fu(6.11.)39 b(Sending)f(commands)f(to)i(c)m(lients)2388
+3516 y
+SDict begin H.S end
+ 2388 3516 a 2388 3516 a
+SDict begin 22.464 H.A end
+ 2388 3516 a 2388 3516
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.58.1) cvn H.B /DEST pdfmark
+end
+ 2388 3516 a -2 3714 a
+SDict begin H.S end
+ -2 3714 a -2 3714 a
+SDict begin 13 H.A end
+ -2 3714 a
+-2 3714 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2623) cvn H.B /DEST pdfmark
+end
+ -2 3714 a 396 3790 a FC(It)21 b(is)g(generally)e(not)g
+(possible)h(to)h(send)f(commands)e(to)i(clients,)h(because)e(the)h
+(client)h(does)f(not)f(listen)i(on)f(the)396 3898 y(netw)o(ork)f(\(the)
+h(client)g(needs)g(root)g(pri)n(vile)o(ges)e(to)j(perform)d(its)j
+(tasks,)g(and)e(you)h(don')o(t)e(w)o(ant)j(a)f(root)g(netw)o(ork)396
+4005 y(daemon\).)-2 4186 y
+SDict begin H.S end
+ -2 4186 a -2 4186 a
+SDict begin 13 H.A end
+ -2 4186
+a -2 4186 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2624) cvn H.B /DEST pdfmark
+end
+ -2 4186 a 396 4279 a FC(Ho)n(we)n(v)o(er)m(,)e(it)j(is)g
+(possible)f(to)h(send)f(a)g(command)e(if)j(and)e(when)h(a)h(client)f
+(connects)f(to)h(deli)n(v)o(er)f(a)i(message.)f(As)h(of)396
+4387 y(v)o(ersion)e(1.8.0,)g(clients)h(use)h(a)f(ne)n(w)g(v)o(ersion)f
+(of)h(the)g(client/serv)o(er)f(protocol,)f(which)i(includes)g(a)g(set)h
+(of)396 4495 y(pre-de\002ned)d(commands)h(that)h(are)g(understood)e(by)
+h(the)i(client.)f(Currently)f(implemented)f(are)3200
+4495 y
+SDict begin H.S end
+ 3200 4495 a 3200 4495 a
+SDict begin 13 H.A end
+ 3200 4495 a 3200 4495
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2625) cvn H.B /DEST pdfmark
+end
+ 3200 4495 a Fx(RELO)-5 b(AD)20 b FC(to)396 4603 y(reload)f(the)i
+(con\002guration,)c(and)1372 4603 y
+SDict begin H.S end
+ 1372 4603 a 1372
+4603 a
+SDict begin 13 H.A end
+ 1372 4603 a 1372 4603 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2626) cvn H.B /DEST pdfmark
+end
+ 1372 4603 a Fx(ST)o(OP)i
+FC(to)i(terminate)e(the)h(client.)-2 4787 y
+SDict begin H.S end
+ -2 4787 a
+-2 4787 a
+SDict begin 13 H.A end
+ -2 4787 a -2 4787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2627) cvn H.B /DEST pdfmark
+end
+ -2 4787 a 396 4877 a FC(Pre-1.8.0)e
+(clients,)j(or)f(clients)g(b)n(uild)g(with)g(the)g(\(optional\))f(old)g
+(protocol)g(v)o(ersion,)g(will)i(simply)e(ignore)g(such)396
+4985 y(commands.)-2 4986 y
+SDict begin H.S end
+ -2 4986 a -2 4986 a
+SDict begin 13 H.A end
+ -2 4986
+a -2 4986 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SUPPLY-COMMANDS) cvn H.B /DEST
+pdfmark end
+ -2 4986 a Black 3661 5805 a Fx(72)p Black
+eop end
+%%Page: 73 78
+TeXDict begin 73 77 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.73) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black 396 313 a Fp(6.11.1.)36 b(Comm)n(unicating)f(with)f(the)f(ser)q
+(ver)2573 313 y
+SDict begin H.S end
+ 2573 313 a 2573 313 a
+SDict begin 18.72 H.A end
+ 2573 313 a 2573
+313 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.58.31.2) cvn H.B /DEST pdfmark
+end
+ 2573 313 a -2 506 a
+SDict begin H.S end
+ -2 506 a -2 506 a
+SDict begin 13 H.A end
+ -2 506 a
+-2 506 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2630) cvn H.B /DEST pdfmark
+end
+ -2 506 a 396 587 a FC(As)21 b(of)f(v)o(ersion)f(1.8.0,)1071
+587 y
+SDict begin H.S end
+ 1071 587 a 1071 587 a
+SDict begin 13 H.A end
+ 1071 587 a 1071 587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2631) cvn H.B /DEST pdfmark
+end
+ 1071
+587 a FC(yule)g(can)h(send)g(a)h(command)d(to)i(a)h(client)f(if)h(and)e
+(when)h(a)h(client)f(connects)f(to)h(deli)n(v)o(er)f(a)396
+695 y(message,)h(e.g.)g(a)g(timestamp)g(message)g(\(clients)g(are)g
+(not)g(listening)g(on)g(the)g(netw)o(ork,)f(and)g(thus)h(commands)f
+(can)396 803 y(only)h(be)g(sent)g(together)f(with)h(the)h
+(con\002rmation)d(when)h(a)i(message)f(is)h(recei)n(v)o(ed\).)-2
+987 y
+SDict begin H.S end
+ -2 987 a -2 987 a
+SDict begin 13 H.A end
+ -2 987 a -2 987 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2632) cvn H.B /DEST pdfmark
+end
+ -2 987 a 396
+1077 a FC(Of)g(course)e(the)h(serv)o(er)g(needs)f(to)i(kno)n(w)e(which)
+h(\(if)g(an)o(y\))f(command)f(to)i(send.)g(Therefore)e(it)j(can)f(open)
+f(a)i(unix)396 1185 y(domain)e(sock)o(et)h(upon)f(startup)h(\(in)g(the)
+g(same)g(directory)f(as)i(the)f(PID)g(\002le\).)h(Opening)d(this)j
+(command)d(interf)o(ace)396 1293 y(must)i(be)h(requested)e(e)o
+(xplicitely)g(with)h(the)g(option)1910 1293 y
+SDict begin H.S end
+ 1910 1293
+a 1910 1293 a
+SDict begin 13 H.A end
+ 1910 1293 a 1910 1293 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2633) cvn H.B /DEST pdfmark
+end
+ 1910 1293 a Fy(SetUseSock)o(et=)
+2432 1293 y
+SDict begin H.S end
+ 2432 1293 a 2432 1293 a
+SDict begin 13 H.A end
+ 2432 1293 a 2432
+1293 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2634) cvn H.B /DEST pdfmark
+end
+ 2432 1293 a Fl(yes)g FC(\(in)g(the)g([Misc])h(section\).)-2
+1477 y
+SDict begin H.S end
+ -2 1477 a -2 1477 a
+SDict begin 13 H.A end
+ -2 1477 a -2 1477 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2635) cvn H.B /DEST pdfmark
+end
+ -2 1477
+a 396 1567 a FC(A)g(separate)f(application)1159 1567
+y
+SDict begin H.S end
+ 1159 1567 a 1159 1567 a
+SDict begin 13 H.A end
+ 1159 1567 a 1159 1567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2636) cvn H.B /DEST pdfmark
+end
+ 1159
+1567 a FC(yulectl)g(is)h(compiled)e(together)g(with)h(the)g(serv)o(er)g
+(that)g(pro)o(vides)e(a)j(command-line)396 1674 y(interf)o(ace)f(to)g
+(access)h(this)f(f)o(acility)-5 b(.)20 b(Use)1586 1674
+y
+SDict begin H.S end
+ 1586 1674 a 1586 1674 a
+SDict begin 13 H.A end
+ 1586 1674 a 1586 1674 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2637) cvn H.B /DEST pdfmark
+end
+ 1586
+1674 a Fy(yulectl)g(-h)g FC(for)g(help.)-2 1703 y
+SDict begin H.S end
+ -2
+1703 a -2 1703 a
+SDict begin 13 H.A end
+ -2 1703 a -2 1703 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:AUTH-CRED) cvn H.B /DEST pdfmark
+end
+ -2 1703 a 396 2013
+a Fp(6.11.2.)36 b(A)l(uthenticating)g(to)d(the)g(ser)q(ver)2379
+2013 y
+SDict begin H.S end
+ 2379 2013 a 2379 2013 a
+SDict begin 18.72 H.A end
+ 2379 2013 a 2379 2013
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.58.32.2) cvn H.B /DEST pdfmark
+end
+ 2379 2013 a -2 2206 a
+SDict begin H.S end
+ -2 2206 a -2 2206 a
+SDict begin 13 H.A end
+ -2 2206 a
+-2 2206 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2640) cvn H.B /DEST pdfmark
+end
+ -2 2206 a 396 2287 a FC(There)20 b(are)g(tw)o(o)g(methods)f
+(to)i(authenticate)e(to)h(the)g(serv)o(er)-5 b(.)20 b(If)g(supported)e
+(by)i(the)g(OS,)g(authentication)f(is)i(done)396 2395
+y(by)f(passing)g(the)g(credentials)f(of)h(the)h(sock)o(et)f(peer)f(to)i
+(the)f(serv)o(er)f(\(this)i(is)g(a)f(special)h(feature)e(of)h(unix)f
+(domain)396 2503 y(sock)o(ets\),)h(and)850 2503 y
+SDict begin H.S end
+ 850
+2503 a 850 2503 a
+SDict begin 13 H.A end
+ 850 2503 a 850 2503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2641) cvn H.B /DEST pdfmark
+end
+ 850 2503 a Fx(r)m(equiring)f
+(the)h(UID)g FC(of)g(the)h(the)f(sock)o(et)g(peer)f(\(i.e.)h(the)h
+(user)f(using)f(the)2955 2503 y
+SDict begin H.S end
+ 2955 2503 a 2955 2503
+a
+SDict begin 13 H.A end
+ 2955 2503 a 2955 2503 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2642) cvn H.B /DEST pdfmark
+end
+ 2955 2503 a FC(yulectl)h(program\))e(to)396
+2611 y(match)i(a)h(UID)f(as)h(set)g(with)f(the)1339 2611
+y
+SDict begin H.S end
+ 1339 2611 a 1339 2611 a
+SDict begin 13 H.A end
+ 1339 2611 a 1339 2611 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2643) cvn H.B /DEST pdfmark
+end
+ 1339
+2611 a Fy(SetSock)o(etAllo)o(wUid=)2068 2611 y
+SDict begin H.S end
+ 2068 2611
+a 2068 2611 a
+SDict begin 13 H.A end
+ 2068 2611 a 2068 2611 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2644) cvn H.B /DEST pdfmark
+end
+ 2068 2611 a Fl(UID)25
+b FC(option)19 b(\(def)o(ault)g(is)i(0,)f(i.e.)g(only)f(root)h(can)g
+(use)g(the)396 2719 y(interf)o(ace\).)-2 2734 y
+SDict begin H.S end
+ -2 2734
+a -2 2734 a
+SDict begin 11.7 H.A end
+ -2 2734 a -2 2734 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2645) cvn H.B /DEST pdfmark
+end
+ -2 2734 a -2 2858 a
+SDict begin H.S end
+ -2
+2858 a -2 2858 a
+SDict begin 11.7 H.A end
+ -2 2858 a -2 2858 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2647) cvn H.B /DEST pdfmark
+end
+ -2 2858 a 562 2940
+a Fw(Note:)g Fv(If)g(passing)g(credentials)e(o)o(v)n(er)i(the)f(soc)o
+(k)o(et)h(is)h(suppor)s(ted)d(b)o(y)i(the)g(OS)o(,)g(it)g(is)g(not)g
+(possib)o(le)e(to)j(f)n(ak)o(e)562 3037 y(these)f(credentials)e(-)j
+(the)o(y)e(are)h(supplied)e(b)o(y)i(the)g(k)o(er)r(nel.)e(Theref)n(ore)
+o(,)f(the)j(ser)r(v)n(er)g(can)h(rely)f(on)g(the)f(f)n(act)h(that)562
+3135 y(the)g(user)g(process)g(wr)q(iting)f(to)h(the)g(soc)o(k)o(et)g
+(has)g(indeed)e(the)i(UID)g(passed)g(via)g(the)g(soc)o(k)o(et.)f(Thus)o
+(,)h(the)562 3232 y(access)i(r)q(ights)d(to)h(the)g(soc)o(k)o(et)g(are)
+f(basically)h(not)f(impor)s(tant)f(\(on)i(some)h(systems)o(,)g(the)o(y)
+f(are)f(not)h(e)n(v)n(en)562 3329 y(recogniz)o(ed/respected)c(at)k
+(all\).)-2 3644 y
+SDict begin H.S end
+ -2 3644 a -2 3644 a
+SDict begin 13 H.A end
+ -2 3644 a -2 3644
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2648) cvn H.B /DEST pdfmark
+end
+ -2 3644 a 396 3752 a FC(As)h(of)f(v)o(ersion)f(1.8.12,)f(if)j(\(and)e
+(only)g(if\))h(passing)g(credentials)g(o)o(v)o(er)e(the)j(sock)o(et)f
+(is)h(not)f(supported,)e(you)h(can)396 3860 y(specify)h(a)g(passw)o
+(ord)g(with)g(the)1338 3860 y
+SDict begin H.S end
+ 1338 3860 a 1338 3860 a
+SDict begin 13 H.A end
+
+1338 3860 a 1338 3860 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2649) cvn H.B /DEST pdfmark
+end
+ 1338 3860 a Fy(SetSock)o(etP)o(assw)o(ord=)2071
+3860 y
+SDict begin H.S end
+ 2071 3860 a 2071 3860 a
+SDict begin 13 H.A end
+ 2071 3860 a 2071 3860
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2650) cvn H.B /DEST pdfmark
+end
+ 2071 3860 a Fl(password)i FC(option.)d(The)h(passw)o(ord)f(must)h(be)
+h(14)396 3968 y(characters)f(or)f(less,)i(and)f(must)g(not)g(include)f
+(the)i('@')f(character)-5 b(.)-2 4146 y
+SDict begin H.S end
+ -2 4146 a -2
+4146 a
+SDict begin 13 H.A end
+ -2 4146 a -2 4146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2651) cvn H.B /DEST pdfmark
+end
+ -2 4146 a 396 4242 a FC(Of)21
+b(course)e(you)g(must)i(supply)e(the)h(passw)o(ord)f(to)1853
+4242 y
+SDict begin H.S end
+ 1853 4242 a 1853 4242 a
+SDict begin 13 H.A end
+ 1853 4242 a 1853 4242
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2652) cvn H.B /DEST pdfmark
+end
+ 1853 4242 a FC(yulectl)h(if)g(you)f(w)o(ant)i(to)f(communicate)e
+(with)i(the)h(serv)o(er)-5 b(.)19 b(T)-7 b(o)396 4350
+y(do)20 b(so,)g(create)g(a)h(\002le)1019 4350 y
+SDict begin H.S end
+ 1019
+4350 a 1019 4350 a
+SDict begin 13 H.A end
+ 1019 4350 a 1019 4350 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2653) cvn H.B /DEST pdfmark
+end
+ 1019 4350
+a Fr(.yulectl_cred)d FC(in)j(your)e(home)g(directory)-5
+b(,)18 b(and)h(place)h(the)g(passw)o(ord)g(there.)-2
+4368 y
+SDict begin H.S end
+ -2 4368 a -2 4368 a
+SDict begin 11.7 H.A end
+ -2 4368 a -2 4368 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2654) cvn H.B /DEST pdfmark
+end
+ -2 4368
+a -2 4493 a
+SDict begin H.S end
+ -2 4493 a -2 4493 a
+SDict begin 11.7 H.A end
+ -2 4493 a -2 4493 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2656) cvn H.B /DEST pdfmark
+end
+ -2
+4493 a 562 4572 a Fw(Note:)g Fv(P)m(ass)n(w)o(ord)g(authentication)c
+(is)k(not)g(suppor)s(ted)e(if)i(the)g(OS)h(suppor)s(ts)e(the)h(af)n
+(orementioned)15 b(method.)-2 4887 y
+SDict begin H.S end
+ -2 4887 a -2 4887
+a
+SDict begin 13 H.A end
+ -2 4887 a -2 4887 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:UDP) cvn H.B /DEST pdfmark
+end
+ -2 4887 a Black 3661 5805 a Fx(73)p
+Black eop end
+%%Page: 74 79
+TeXDict begin 74 78 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.74) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black -2 330 a Fu(6.12.)39 b(Syslog)f(log)o(ging)1386
+330 y
+SDict begin H.S end
+ 1386 330 a 1386 330 a
+SDict begin 22.464 H.A end
+ 1386 330 a 1386 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (8.59.1) cvn H.B /DEST pdfmark
+end
+ 1386
+330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2659) cvn H.B /DEST pdfmark
+end
+ -2
+528 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2660) cvn H.B /DEST pdfmark
+end
+ -2
+528 a 396 604 a FC(yule)20 b(\(v)o(ersion)f(1.2.8+\))f(can)i(listen)g
+(on)g(port)g(514/udp)e(to)i(collect)g(reports)f(from)h(syslog)f
+(clients.)i(This)f(must)g(be)396 712 y(enabled)f(by)g(using)h(the)1100
+712 y
+SDict begin H.S end
+ 1100 712 a 1100 712 a
+SDict begin 13 H.A end
+ 1100 712 a 1100 712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2661) cvn H.B /DEST pdfmark
+end
+ 1100
+712 a Fy(--enable-udp)g FC(con\002gure)e(option)g(when)i(compiling.)e
+(In)h(addition,)f(in)i(the)3327 712 y
+SDict begin H.S end
+ 3327 712 a 3327
+712 a
+SDict begin 13 H.A end
+ 3327 712 a 3327 712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2662) cvn H.B /DEST pdfmark
+end
+ 3327 712 a Fx(Misc)h FC(section)396
+820 y(of)f(the)g(con\002guration)e(\002le,)j(you)e(must)h(set)h(the)f
+(option)2015 820 y
+SDict begin H.S end
+ 2015 820 a 2015 820 a
+SDict begin 13 H.A end
+ 2015 820 a 2015
+820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2663) cvn H.B /DEST pdfmark
+end
+ 2015 820 a Fy(SetUDP)-6 b(Acti)o(v)o(e=)2563 820
+y
+SDict begin H.S end
+ 2563 820 a 2563 820 a
+SDict begin 13 H.A end
+ 2563 820 a 2563 820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2664) cvn H.B /DEST pdfmark
+end
+ 2563 820
+a Fl(yes)q FC(.)-2 1004 y
+SDict begin H.S end
+ -2 1004 a -2 1004 a
+SDict begin 13 H.A end
+ -2 1004
+a -2 1004 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2665) cvn H.B /DEST pdfmark
+end
+ -2 1004 a 396 1094 a FC(This)21 b(option)e(requires)g(to)h
+(run)1303 1094 y
+SDict begin H.S end
+ 1303 1094 a 1303 1094 a
+SDict begin 13 H.A end
+ 1303 1094 a
+1303 1094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2666) cvn H.B /DEST pdfmark
+end
+ 1303 1094 a FC(yule)f(either)h(as)1766 1094
+y
+SDict begin H.S end
+ 1766 1094 a 1766 1094 a
+SDict begin 13 H.A end
+ 1766 1094 a 1766 1094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2667) cvn H.B /DEST pdfmark
+end
+ 1766
+1094 a Fx(r)l(oot)q FC(,)h(or)f(as)2123 1094 y
+SDict begin H.S end
+ 2123 1094
+a 2123 1094 a
+SDict begin 13 H.A end
+ 2123 1094 a 2123 1094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2668) cvn H.B /DEST pdfmark
+end
+ 2123 1094 a Fx(SUID)g
+FC(root.)f(F)o(or)h(security)-5 b(,)2942 1094 y
+SDict begin H.S end
+ 2942
+1094 a 2942 1094 a
+SDict begin 13 H.A end
+ 2942 1094 a 2942 1094 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2669) cvn H.B /DEST pdfmark
+end
+ 2942 1094
+a FC(yule)20 b(will)h(drop)e(root)396 1202 y(pri)n(vile)o(ges)g(irre)n
+(v)n(ocably)f(immediately)h(after)h(binding)e(to)j(port)e(514/udp.)f
+(It)i(will)h(assume)f(the)h(credentials)e(of)396 1310
+y(some)h(compiled-in)e(user)-5 b(.)21 b(The)e(def)o(ault)h(is)h
+('yule',)e(')l(daemon',)e(or)j('nobody')d(\(i.e.)j(the)g(\002rst)h(of)f
+(these)h(that)f(e)o(xists)396 1418 y(on)g(your)f(system\).)h(Y)-9
+b(ou)19 b(can)h(o)o(v)o(erride)e(this)j(with)f(the)1990
+1418 y
+SDict begin H.S end
+ 1990 1418 a 1990 1418 a
+SDict begin 13 H.A end
+ 1990 1418 a 1990 1418
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2670) cvn H.B /DEST pdfmark
+end
+ 1990 1418 a Fy(--enable-identity=)2625 1418 y
+SDict begin H.S end
+ 2625
+1418 a 2625 1418 a
+SDict begin 13 H.A end
+ 2625 1418 a 2625 1418 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2671) cvn H.B /DEST pdfmark
+end
+ 2625 1418
+a Fl(USER)f FC(option.)g(Note)h(that)g(each)396 1526
+y(daemon)f(should)g(ha)n(v)o(e)h(its)h(o)n(wn)e(user/group,)f(such)i
+(that)g(an)g(e)o(xploit)g(will)h(gi)n(v)o(e)e(write)h(access)h(to)f
+(\002les)i(o)n(wned)d(by)396 1634 y(other)h(daemons.)-2
+1645 y
+SDict begin H.S end
+ -2 1645 a -2 1645 a
+SDict begin 13 H.A end
+ -2 1645 a -2 1645 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PERFORMANCE-TUNING-SERVER)
+cvn H.B /DEST pdfmark end
+ -2 1645
+a 376 x Fu(6.13.)39 b(P)l(erf)m(ormance)d(tuning)1706
+2021 y
+SDict begin H.S end
+ 1706 2021 a 1706 2021 a
+SDict begin 22.464 H.A end
+ 1706 2021 a 1706 2021
+a
+SDict begin [ /View [/XYZ H.V] /Dest (8.60.1) cvn H.B /DEST pdfmark
+end
+ 1706 2021 a -2 2219 a
+SDict begin H.S end
+ -2 2219 a -2 2219 a
+SDict begin 13 H.A end
+ -2 2219 a
+-2 2219 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2674) cvn H.B /DEST pdfmark
+end
+ -2 2219 a 396 2295 a FC(Ev)o(en)19 b(without)h(tweaking,)f
+(the)h(serv)o(er)f(can)h(probably)e(handle)h(some)h(100)g(connections)e
+(per)i(second)f(on)h(a)396 2403 y(500Mhz)f(i686.)g(Depending)f(on)i
+(the)g(v)o(erbosity)e(of)i(the)h(logging)d(that)i(you)g(wish,)g(this)h
+(should)e(suf)n(\002ce)h(e)n(v)o(en)f(for)396 2511 y(some)h(thousand)f
+(clients.)-2 2678 y
+SDict begin H.S end
+ -2 2678 a -2 2678 a
+SDict begin 13 H.A end
+ -2 2678 a -2
+2678 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2675) cvn H.B /DEST pdfmark
+end
+ -2 2678 a 396 2785 a FC(Almost)i(all)f(time)h(is)g(spent)f
+(\(i\))g(in)g(the)g(HMA)m(C)h(function)d(that)j(computes)e(the)h
+(message)g(signatures,)f(and)h(\(ii\))g(if)396 2893 y(you)g(do)f(not)h
+(ha)n(v)o(e)g(the)1069 2893 y
+SDict begin H.S end
+ 1069 2893 a 1069 2893 a
+SDict begin 13 H.A end
+
+1069 2893 a 1069 2893 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2676) cvn H.B /DEST pdfmark
+end
+ 1069 2893 a FC(gmp)f(\(GNU)i(MP\))f(multiple)f
+(precision)h(library)-5 b(,)18 b(in)i(the)h(multiple)e(precision)g
+(arithmetic)396 3001 y(library)g(\(for)h(SRP)h(authentication\).)-2
+3185 y
+SDict begin H.S end
+ -2 3185 a -2 3185 a
+SDict begin 13 H.A end
+ -2 3185 a -2 3185 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2677) cvn H.B /DEST pdfmark
+end
+ -2 3185
+a 396 3275 a FC(The)f(reason)g(for)f(\(ii\))h(is)h(that)1245
+3275 y
+SDict begin H.S end
+ 1245 3275 a 1245 3275 a
+SDict begin 13 H.A end
+ 1245 3275 a 1245 3275
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2678) cvn H.B /DEST pdfmark
+end
+ 1245 3275 a FC(samhain/)1546 3275 y
+SDict begin H.S end
+ 1546 3275 a 1546
+3275 a
+SDict begin 13 H.A end
+ 1546 3275 a 1546 3275 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2679) cvn H.B /DEST pdfmark
+end
+ 1546 3275 a FC(yule)d(will)j(use)g(a)f
+(simple,)g(portable,)f(b)n(ut)h(not)g(v)o(ery)f(ef)n(\002cient)h(MP)g
+(library)396 3383 y(that)h(is)g(included)d(in)j(the)f(source)f(code,)h
+(if)1639 3383 y
+SDict begin H.S end
+ 1639 3383 a 1639 3383 a
+SDict begin 13 H.A end
+ 1639 3383 a 1639
+3383 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2680) cvn H.B /DEST pdfmark
+end
+ 1639 3383 a FC(gmp)f(is)j(not)d(present)h(on)g(your)f(system.)-2
+3567 y
+SDict begin H.S end
+ -2 3567 a -2 3567 a
+SDict begin 13 H.A end
+ -2 3567 a -2 3567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2681) cvn H.B /DEST pdfmark
+end
+ -2 3567
+a 396 3657 a FC(T)-7 b(o)21 b(impro)o(v)o(e)d(performance,)f(you)i
+(can:)-2 3841 y
+SDict begin H.S end
+ -2 3841 a -2 3841 a
+SDict begin 13 H.A end
+ -2 3841 a -2 3841
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2682) cvn H.B /DEST pdfmark
+end
+ -2 3841 a -2 3841 a
+SDict begin H.S end
+ -2 3841 a -2 3841 a
+SDict begin 13 H.A end
+ -2 3841 a -2
+3841 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2683) cvn H.B /DEST pdfmark
+end
+ -2 3841 a -2 3851 a
+SDict begin H.S end
+ -2 3851 a -2 3851 a
+SDict begin 13 H.A end
+ -2 3851
+a -2 3851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2684) cvn H.B /DEST pdfmark
+end
+ -2 3851 a Black 396 3993 a FB(\225)p Black
+479 3993 a
+SDict begin H.S end
+ 479 3993 a 479 3993 a
+SDict begin 13 H.A end
+ 479 3993 a 479 3993
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2685) cvn H.B /DEST pdfmark
+end
+ 479 3993 a FC(install)703 3993 y
+SDict begin H.S end
+ 703 3993 a 703 3993
+a
+SDict begin 13 H.A end
+ 703 3993 a 703 3993 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2686) cvn H.B /DEST pdfmark
+end
+ 703 3993 a FC(gmp,)g(remo)o(v)o(e)f(the)j
+(\002le)f(con\002g.cache)e(in)j(the)f(source)f(directory)g(\(if)h(you)f
+(ha)n(v)o(e)h(run)3162 3993 y
+SDict begin H.S end
+ 3162 3993 a 3162 3993 a
+SDict begin 13 H.A end
+
+3162 3993 a 3162 3993 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2687) cvn H.B /DEST pdfmark
+end
+ 3162 3993 a Fy(con\002gur)o(e)479
+4101 y FC(before\),)e(and)i(then)g(run)1196 4101 y
+SDict begin H.S end
+ 1196
+4101 a 1196 4101 a
+SDict begin 13 H.A end
+ 1196 4101 a 1196 4101 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2688) cvn H.B /DEST pdfmark
+end
+ 1196 4101
+a Fy(con\002gur)o(e)g FC(and)1688 4101 y
+SDict begin H.S end
+ 1688 4101 a
+1688 4101 a
+SDict begin 13 H.A end
+ 1688 4101 a 1688 4101 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2689) cvn H.B /DEST pdfmark
+end
+ 1688 4101 a Fy(mak)o(e)h
+FC(again.)e(The)2273 4101 y
+SDict begin H.S end
+ 2273 4101 a 2273 4101 a
+SDict begin 13 H.A end
+ 2273
+4101 a 2273 4101 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2690) cvn H.B /DEST pdfmark
+end
+ 2273 4101 a Fy(con\002gur)o(e)g FC(script)h(should)f
+(automatically)g(detect)479 4209 y(the)601 4209 y
+SDict begin H.S end
+ 601
+4209 a 601 4209 a
+SDict begin 13 H.A end
+ 601 4209 a 601 4209 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2691) cvn H.B /DEST pdfmark
+end
+ 601 4209 a FC(gmp)h(library)f
+(and)h(link)g(against)f(it.)-2 4227 y
+SDict begin H.S end
+ -2 4227 a -2 4227
+a
+SDict begin 13 H.A end
+ -2 4227 a -2 4227 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2692) cvn H.B /DEST pdfmark
+end
+ -2 4227 a Black 396 4358 a FB(\225)p
+Black 479 4358 a
+SDict begin H.S end
+ 479 4358 a 479 4358 a
+SDict begin 13 H.A end
+ 479 4358 a 479
+4358 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2693) cvn H.B /DEST pdfmark
+end
+ 479 4358 a FC(use)i(a)f(simple)g(k)o(e)o(yed)f(hash)h
+(\(HASH-TIGER\),)f(which)h(will)h(compute)d(signatures)i(as)h
+(HASH\(message)e(k)o(e)o(y\))479 4466 y(instead)h(of)g(the)g(HMA)m(C)h
+(\(HMA)m(C-TIGER\).)d(This)j(will)g(sa)n(v)o(e)f(tw)o(o)h(of)f(the)g
+(three)f(hash)h(computations)479 4574 y(required)f(for)g(a)i(HMA)m(C)f
+(signature.)-2 4592 y
+SDict begin H.S end
+ -2 4592 a -2 4592 a
+SDict begin 11.7 H.A end
+ -2 4592 a -2
+4592 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2694) cvn H.B /DEST pdfmark
+end
+ -2 4592 a 1060 4692 2502 17 v 1060 5150 17 459
+v 2075 4845 a Fp(CA)-10 b(VEA)f(T)1102 5013 y
+SDict begin H.S end
+ 1102 5013
+a 1102 5013 a
+SDict begin 11.7 H.A end
+ 1102 5013 a 1102 5013 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2696) cvn H.B /DEST pdfmark
+end
+ 1102 5013 a 96
+x Fv(Mak)o(e)20 b(sure)g(y)o(ou)g(use)g(the)g(same)g(signature)e(type)i
+(on)g(ser)r(v)n(er)h(and)e(client)g(!)p 3545 5150 17
+459 v 1060 5167 2502 17 v -2 5260 a
+SDict begin H.S end
+ -2 5260 a -2 5260
+a
+SDict begin 11.7 H.A end
+ -2 5260 a -2 5260 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2697) cvn H.B /DEST pdfmark
+end
+ -2 5260 a 569 5308 a Fr([Misc])569
+5405 y(#)p Black 3661 5805 a Fx(74)p Black eop end
+%%Page: 75 80
+TeXDict begin 75 79 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.75) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2731 104 a
+Fx(Chapter)20 b(6.)g(yule,)g(the)g(lo)o(g)g(server)p
+Black 569 309 a Fr(#)45 b(use)f(simple)g(keyed)g(hash)g(for)g(message)g
+(signatures)569 406 y(#)h(Make)f(sure)g(you)g(set)h(this)f(both)g(for)g
+(client)g(and)g(server)569 503 y(#)569 600 y(MACType=HASH-TIGER)-2
+697 y
+SDict begin H.S end
+ -2 697 a -2 697 a
+SDict begin 13 H.A end
+ -2 697 a -2 697 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2698) cvn H.B /DEST pdfmark
+end
+ -2 697 a Black
+396 847 a FB(\225)p Black 479 847 a
+SDict begin H.S end
+ 479 847 a 479 847
+a
+SDict begin 13 H.A end
+ 479 847 a 479 847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2699) cvn H.B /DEST pdfmark
+end
+ 479 847 a FC(b)n(uild)20 b(a)h(static)g(binary)e
+(\(use)h(the)1437 847 y
+SDict begin H.S end
+ 1437 847 a 1437 847 a
+SDict begin 13 H.A end
+ 1437 847
+a 1437 847 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2700) cvn H.B /DEST pdfmark
+end
+ 1437 847 a Fy(--enable-static)e FC(switch)j(for)e
+(con\002gure\).)f(Static)j(binaries)e(are)i(f)o(aster)m(,)e(and)479
+955 y(also)i(more)e(secure,)h(because)f(the)o(y)h(cannot)f(be)h(sub)o
+(v)o(erted)e(via)i(libc.)-2 973 y
+SDict begin H.S end
+ -2 973 a -2 973 a
+SDict begin 11.7 H.A end
+ -2
+973 a -2 973 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2701) cvn H.B /DEST pdfmark
+end
+ -2 973 a -2 1097 a
+SDict begin H.S end
+ -2 1097 a -2 1097 a
+SDict begin 11.7 H.A end
+
+-2 1097 a -2 1097 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2703) cvn H.B /DEST pdfmark
+end
+ -2 1097 a 645 1176 a Fw(NO)m(TE:)h
+Fv(Unf)n(or)s(tunately)16 b(this)k(is)h(not)f(possib)o(le)e(on)i(Solar)
+q(is)o(.)f(This)h(is)h(not)e(a)h(b)o(ug)f(in)3011 1176
+y
+SDict begin H.S end
+ 3011 1176 a 3011 1176 a
+SDict begin 11.7 H.A end
+ 3011 1176 a 3011 1176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2704) cvn H.B /DEST pdfmark
+end
+ 3011
+1176 a Fv(samhain,)g(b)o(ut)g(is)645 1273 y(because)h(some)g(functions)
+f(in)h(Solar)q(is)f(are)h(only)f(supplied)g(b)o(y)h(dynamic)g(libr)o
+(ar)q(ies)o(.)438 1614 y
+SDict begin H.S end
+ 438 1614 a 438 1614 a
+SDict begin 13 H.A end
+ 438 1614
+a 438 1614 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2705) cvn H.B /DEST pdfmark
+end
+ 438 1614 a Black 396 1763 a FB(\225)p Black
+479 1763 a
+SDict begin H.S end
+ 479 1763 a 479 1763 a
+SDict begin 13 H.A end
+ 479 1763 a 479 1763
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2706) cvn H.B /DEST pdfmark
+end
+ 479 1763 a FC(change)f(the)h(compiler)f(switches)i(to)f(optimize)g
+(more)f(aggressi)n(v)o(ely)-5 b(.)-2 1781 y
+SDict begin H.S end
+ -2 1781 a
+-2 1781 a
+SDict begin 13 H.A end
+ -2 1781 a -2 1781 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2707) cvn H.B /DEST pdfmark
+end
+ -2 1781 a Black 396 1913
+a FB(\225)p Black 479 1913 a
+SDict begin H.S end
+ 479 1913 a 479 1913 a
+SDict begin 13 H.A end
+ 479
+1913 a 479 1913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2708) cvn H.B /DEST pdfmark
+end
+ 479 1913 a FC(if)21 b(on)f(a)g(commercial)f(UNIX,)h
+(check)f(whether)g(the)i(nati)n(v)o(e)e(compiler)g(produces)f(f)o
+(aster)j(code)e(than)h(gcc)g(\(you)479 2021 y(need)g(an)g(ANSI)g(C)h
+(compiler\).)e(The)1561 2021 y
+SDict begin H.S end
+ 1561 2021 a 1561 2021
+a
+SDict begin 13 H.A end
+ 1561 2021 a 1561 2021 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2709) cvn H.B /DEST pdfmark
+end
+ 1561 2021 a Fy(con\002gur)o(e)g
+FC(script)h(honours)e(CC)k(\(compiler\))c(and)i(CFLA)m(GS)479
+2129 y(en)m(vironment)d(v)n(ariables.)p Black 3661 5805
+a Fx(75)p Black eop end
+%%Page: 76 81
+TeXDict begin 76 80 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.76) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:EXTERN) cvn H.B /DEST pdfmark
+end
+ -2 226 a 125 x
+Fz(Chapter)48 b(7.)f(Hooks)h(f)m(or)g(External)f(Pr)m(ograms)3263
+351 y
+SDict begin H.S end
+ 3263 351 a 3263 351 a
+SDict begin 26.957 H.A end
+ 3263 351 a 3263 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (9.0) cvn H.B /DEST pdfmark end
+ 3263
+351 a -2 609 a
+SDict begin H.S end
+ -2 609 a -2 609 a
+SDict begin 13 H.A end
+ -2 609 a -2 609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2712) cvn H.B /DEST pdfmark
+end
+ -2
+609 a -2 609 a
+SDict begin H.S end
+ -2 609 a -2 609 a
+SDict begin 13 H.A end
+ -2 609 a -2 609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2713) cvn H.B /DEST pdfmark
+end
+ -2
+609 a 396 679 a FC(samhain)20 b(pro)o(vides)e(se)n(v)o(eral)i(hooks)f
+(for)g(e)o(xternal)g(programs)g(for)g(\(re-\)processing)e(the)k(audit)e
+(trail,)i(including)396 787 y(pipes,)f(a)h(System)f(V)h(message)f
+(queue,)e(and)i(the)g(option)f(to)i(call)f(e)o(xternal)f(programs.)-2
+805 y
+SDict begin H.S end
+ -2 805 a -2 805 a
+SDict begin 13 H.A end
+ -2 805 a -2 805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PIPES) cvn H.B /DEST pdfmark
+end
+ -2 805 a 359
+x Fu(7.1.)39 b(Pipes)661 1164 y
+SDict begin H.S end
+ 661 1164 a 661 1164 a
+SDict begin 22.464 H.A end
+
+661 1164 a 661 1164 a
+SDict begin [ /View [/XYZ H.V] /Dest (9.61.1) cvn H.B /DEST pdfmark
+end
+ 661 1164 a -2 1360 a
+SDict begin H.S end
+ -2 1360 a
+-2 1360 a
+SDict begin 13 H.A end
+ -2 1360 a -2 1360 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2716) cvn H.B /DEST pdfmark
+end
+ -2 1360 a 396 1438 a FC(It)21
+b(is)g(possible)f(to)g(use)h(named)e(pipes)h(as)h('console')d(de)n
+(vice\(s\))h(\()2262 1438 y
+SDict begin H.S end
+ 2262 1438 a 2262 1438 a
+SDict begin 13 H.A end
+ 2262
+1438 a 2262 1438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2717) cvn H.B /DEST pdfmark
+end
+ 2262 1438 a FC(samhain)g(supports)g(up)h(to)h(tw)o
+(o)f(console)f(de)n(vices,)396 1546 y(both)h(of)g(which)f(may)h(be)g
+(named)f(pipes.)h(Y)-9 b(ou)19 b(can)h(set)h(the)g(de)n(vice)e(path)h
+(at)g(compile)g(time)g(\(see)p 0 TeXcolorgray 3216 1546
+a
+SDict begin H.S end
+ 3216 1546 a FC(Section)g(A.5)3609 1546 y
+SDict begin 13 H.L end
+ 3609 1546
+a 3609 1546 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3609 1546 a Black FC(>\),)396 1654 y(and/or)f(in)h(the)h
+(con\002guration)c(\002le)k(\(see)p 0 TeXcolorgray 1581
+1654 a
+SDict begin H.S end
+ 1581 1654 a FC(Section)f(4.8)1956 1654 y
+SDict begin 13 H.L end
+ 1956
+1654 a 1956 1654 a
+SDict begin [ /Subtype /Link /Dest (0:CONSOLEDETAILS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1956 1654 a Black -1 w FC(>\).)-2
+1682 y
+SDict begin H.S end
+ -2 1682 a -2 1682 a
+SDict begin 13 H.A end
+ -2 1682 a -2 1682 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SYSTEM-V-MESSAGE-QUEUE) cvn
+H.B /DEST pdfmark end
+ -2 1682
+a 359 x Fu(7.2.)39 b(System)f(V)i(messa)o(g)q(e)e(queue)2041
+2041 y
+SDict begin H.S end
+ 2041 2041 a 2041 2041 a
+SDict begin 22.464 H.A end
+ 2041 2041 a 2041 2041
+a
+SDict begin [ /View [/XYZ H.V] /Dest (9.62.1) cvn H.B /DEST pdfmark
+end
+ 2041 2041 a -2 2239 a
+SDict begin H.S end
+ -2 2239 a -2 2239 a
+SDict begin 13 H.A end
+ -2 2239 a
+-2 2239 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2722) cvn H.B /DEST pdfmark
+end
+ -2 2239 a 396 2315 a FC(It)21 b(is)g(possible)f(to)g(ha)n(v)o
+(e)g(a)g(SystemV)h(IPC)f(message)g(queue)g(\(which)f(is)i(de\002nitely)
+e(more)h(ele)o(gant)f(than)g(named)396 2423 y(pipes\))h(as)h
+(additional)e('console')f(de)n(vice.)h(Y)-9 b(ou)20 b(need)g(to)g
+(compile)f(with)2523 2423 y
+SDict begin H.S end
+ 2523 2423 a 2523 2423 a
+SDict begin 13 H.A end
+ 2523
+2423 a 2523 2423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2723) cvn H.B /DEST pdfmark
+end
+ 2523 2423 a Fy(--enable-message-queue=)3416
+2423 y
+SDict begin H.S end
+ 3416 2423 a 3416 2423 a
+SDict begin 13 H.A end
+ 3416 2423 a 3416 2423
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2724) cvn H.B /DEST pdfmark
+end
+ 3416 2423 a Fl(MODE)k FC(and)396 2531 y(use)e(the)f(option)883
+2531 y
+SDict begin H.S end
+ 883 2531 a 883 2531 a
+SDict begin 13 H.A end
+ 883 2531 a 883 2531 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2725) cvn H.B /DEST pdfmark
+end
+ 883
+2531 a Fy(MessageQueueActi)o(v)o(e=)1686 2531 y
+SDict begin H.S end
+ 1686
+2531 a 1686 2531 a
+SDict begin 13 H.A end
+ 1686 2531 a 1686 2531 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2726) cvn H.B /DEST pdfmark
+end
+ 1686 2531
+a Fl(T/F)6 b FC(.)-2 2715 y
+SDict begin H.S end
+ -2 2715 a -2 2715 a
+SDict begin 13 H.A end
+ -2 2715
+a -2 2715 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2727) cvn H.B /DEST pdfmark
+end
+ -2 2715 a 396 2805 a FC(The)20 b(def)o(ault)g(mode)f(is)i
+(0700)e(\(rwx------\),)e(b)n(ut)j(this)g(is)i(a)e(compile)f(option)g
+(\(message)h(queues)f(are)396 2913 y(k)o(ernel-resident,)f(b)n(ut)i(ha)
+n(v)o(e)g(access)g(permissions)g(lik)o(e)g(\002les\).)h(T)-7
+b(o)20 b(get)g(the)h(System)f(V)h(IPC)g(k)o(e)o(y)e(for)h(the)g
+(message)396 3021 y(queue,)f(use)767 3021 y
+SDict begin H.S end
+ 767 3021
+a 767 3021 a
+SDict begin 13 H.A end
+ 767 3021 a 767 3021 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2728) cvn H.B /DEST pdfmark
+end
+ 767 3021 a Fy(ftok\("/tmp",)h
+('#'\);)f FC(\()1439 3021 y
+SDict begin H.S end
+ 1439 3021 a 1439 3021 a
+SDict begin 13 H.A end
+ 1439
+3021 a 1439 3021 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2729) cvn H.B /DEST pdfmark
+end
+ 1439 3021 a Fy(man)h(ftok)p FC(,)1800
+3021 y
+SDict begin H.S end
+ 1800 3021 a 1800 3021 a
+SDict begin 13 H.A end
+ 1800 3021 a 1800 3021
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2730) cvn H.B /DEST pdfmark
+end
+ 1800 3021 a Fy(man)h(msgctl)p FC(,)2250 3021 y
+SDict begin H.S end
+ 2250
+3021 a 2250 3021 a
+SDict begin 13 H.A end
+ 2250 3021 a 2250 3021 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2731) cvn H.B /DEST pdfmark
+end
+ 2250 3021
+a Fy(man)g(msgr)o(cv)p FC(\).)d(Note)j(that)f(not)g(all)g(systems)396
+3129 y(support)f(SysV)i(IPC.)-2 3147 y
+SDict begin H.S end
+ -2 3147 a -2 3147
+a
+SDict begin 11.7 H.A end
+ -2 3147 a -2 3147 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2732) cvn H.B /DEST pdfmark
+end
+ -2 3147 a -2 3272 a
+SDict begin H.S end
+ -2 3272 a -2
+3272 a
+SDict begin 11.7 H.A end
+ -2 3272 a -2 3272 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2734) cvn H.B /DEST pdfmark
+end
+ -2 3272 a 562 3351 a Fw(TIP:)f
+Fv(There)f(is)i(a)f(demo)g(application)d(\(a)j(GNOME)h(panel)e
+(applet\))f(a)o(v)n(ailab)o(le)e(on)k(the)g(do)o(wnload)d(site)j(that)
+562 3448 y(uses)h(the)f(message)f(queue)o(.)-2 3680 y
+SDict begin H.S end
+
+-2 3680 a -2 3680 a
+SDict begin 13 H.A end
+ -2 3680 a -2 3680 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CALLING-EXTERNAL-PROGRAMS)
+cvn H.B /DEST pdfmark end
+ -2 3680 a 377
+x Fu(7.3.)39 b(Calling)f(e)n(xternal)g(pr)m(ograms)2044
+4057 y
+SDict begin H.S end
+ 2044 4057 a 2044 4057 a
+SDict begin 22.464 H.A end
+ 2044 4057 a 2044 4057
+a
+SDict begin [ /View [/XYZ H.V] /Dest (9.63.1) cvn H.B /DEST pdfmark
+end
+ 2044 4057 a -2 4255 a
+SDict begin H.S end
+ -2 4255 a -2 4255 a
+SDict begin 13 H.A end
+ -2 4255 a
+-2 4255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2737) cvn H.B /DEST pdfmark
+end
+ -2 4255 a -2 4255 a
+SDict begin H.S end
+ -2 4255 a -2 4255 a
+SDict begin 13 H.A end
+ -2
+4255 a -2 4255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2738) cvn H.B /DEST pdfmark
+end
+ -2 4255 a 396 4331 a FC(samhain)20 b(may)f(in)m(v)n
+(ok)o(e)g(e)o(xternal)g(programs)g(or)h(scripts)g(in)g(order)f(to)i
+(implement)e(logging)f(capabilities)i(that)g(are)396
+4439 y(not)g(supported)e(by)975 4439 y
+SDict begin H.S end
+ 975 4439 a 975
+4439 a
+SDict begin 13 H.A end
+ 975 4439 a 975 4439 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2739) cvn H.B /DEST pdfmark
+end
+ 975 4439 a FC(samhain)i(itself)g(\(e.g.)g
+(pager)f(support\).)f(This)i(section)g(pro)o(vides)f(an)h(o)o(v)o
+(ervie)n(w)e(of)i(this)396 4547 y(capability)-5 b(.)-2
+4731 y
+SDict begin H.S end
+ -2 4731 a -2 4731 a
+SDict begin 13 H.A end
+ -2 4731 a -2 4731 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2740) cvn H.B /DEST pdfmark
+end
+ -2 4731
+a 396 4821 a FC(External)19 b(programs/scripts)f(in)m(v)n(ok)o(ed)h
+(for)g(logging)g(will)i(recei)n(v)o(e)e(the)h(formatted)f(log)h
+(message)g(on)3352 4821 y
+SDict begin H.S end
+ 3352 4821 a 3352 4821 a
+SDict begin 13 H.A end
+ 3352
+4821 a 3352 4821 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2741) cvn H.B /DEST pdfmark
+end
+ 3352 4821 a Fx(stdin)p FC(.)g(The)396
+4929 y(program)e(should)h(e)o(xpect)h(that)1322 4929
+y
+SDict begin H.S end
+ 1322 4929 a 1322 4929 a
+SDict begin 13 H.A end
+ 1322 4929 a 1322 4929 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2742) cvn H.B /DEST pdfmark
+end
+ 1322
+4929 a Fx(stdout)h FC(and)1688 4929 y
+SDict begin H.S end
+ 1688 4929 a 1688
+4929 a
+SDict begin 13 H.A end
+ 1688 4929 a 1688 4929 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2743) cvn H.B /DEST pdfmark
+end
+ 1688 4929 a Fx(stderr)i
+FC(are)d(closed,)g(and)f(that)i(the)f(w)o(orking)e(directory)h(is)i
+(the)f(root)396 5037 y(directory)-5 b(.)p Black 3660
+5805 a Fx(76)p Black eop end
+%%Page: 77 82
+TeXDict begin 77 81 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.77) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2385 104 a
+Fx(Chapter)20 b(7.)g(Hooks)g(for)g(External)g(Pr)l(o)o(gr)o(ams)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2744) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(Each)g(e)o(xternal)f(program)f(must)i(be)g
+(de\002ned)f(in)i(the)f(con\002guration)e(\002le,)i(in)g(a)h(section)f
+(starting)g(with)g(the)g(header)396 417 y
+SDict begin H.S end
+ 396 417 a 396
+417 a
+SDict begin 13 H.A end
+ 396 417 a 396 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2745) cvn H.B /DEST pdfmark
+end
+ 396 417 a Fy([Exter)o(nal])p
+FC(.)f(In)h(addition,)1204 417 y
+SDict begin H.S end
+ 1204 417 a 1204 417
+a
+SDict begin 13 H.A end
+ 1204 417 a 1204 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2746) cvn H.B /DEST pdfmark
+end
+ 1204 417 a Fy(Exter)o(nalSe)o(v)o(erity)e
+FC(must)j(be)f(set)h(to)f(an)g(appropriate)e(threshold)h(in)h(the)g
+(section)396 525 y
+SDict begin H.S end
+ 396 525 a 396 525 a
+SDict begin 13 H.A end
+ 396 525 a 396
+525 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2747) cvn H.B /DEST pdfmark
+end
+ 396 525 a Fy([Log])p FC(.)-2 707 y
+SDict begin H.S end
+ -2 707 a -2
+707 a
+SDict begin 13 H.A end
+ -2 707 a -2 707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2748) cvn H.B /DEST pdfmark
+end
+ -2 707 a 396 799 a FC(Each)g(program)e
+(de\002nition)h(starts)i(with)f(the)h(line)-2 983 y
+SDict begin H.S end
+ -2
+983 a -2 983 a
+SDict begin 13 H.A end
+ -2 983 a -2 983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2749) cvn H.B /DEST pdfmark
+end
+ -2 983 a -2 983 a
+SDict begin H.S end
+ -2
+983 a -2 983 a
+SDict begin 13 H.A end
+ -2 983 a -2 983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2750) cvn H.B /DEST pdfmark
+end
+ -2 983 a 396 1073 a
+Fy(OpenCommand=)1011 1073 y
+SDict begin H.S end
+ 1011 1073 a 1011 1073 a
+SDict begin 13 H.A end
+ 1011
+1073 a 1011 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2751) cvn H.B /DEST pdfmark
+end
+ 1011 1073 a Fl(/full/path)-2 1255
+y
+SDict begin H.S end
+ -2 1255 a -2 1255 a
+SDict begin 13 H.A end
+ -2 1255 a -2 1255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2752) cvn H.B /DEST pdfmark
+end
+ -2 1255 a 396
+1346 a FC(Options)e(for)g(the)g(program)f(may)h(follo)n(w)-5
+b(.)18 b(The)h(de\002nition)f(of)h(an)h(e)o(xternal)e(program)f(is)k
+(ended)d(when)h(the)g(section)396 1454 y(ends,)h(or)g(when)f(another)
+1150 1454 y
+SDict begin H.S end
+ 1150 1454 a 1150 1454 a
+SDict begin 13 H.A end
+ 1150 1454 a 1150
+1454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2753) cvn H.B /DEST pdfmark
+end
+ 1150 1454 a Fy(OpenCommand=)1765 1454 y
+SDict begin H.S end
+ 1765 1454
+a 1765 1454 a
+SDict begin 13 H.A end
+ 1765 1454 a 1765 1454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2754) cvn H.B /DEST pdfmark
+end
+ 1765 1454 a Fl(/full/path)h
+FC(line)g(for)g(the)g(ne)o(xt)g(command)e(is)j(encountered.)-2
+1637 y
+SDict begin H.S end
+ -2 1637 a -2 1637 a
+SDict begin 13 H.A end
+ -2 1637 a -2 1637 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2755) cvn H.B /DEST pdfmark
+end
+ -2 1637
+a -2 1637 a
+SDict begin H.S end
+ -2 1637 a -2 1637 a
+SDict begin 13 H.A end
+ -2 1637 a -2 1637 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2756) cvn H.B /DEST pdfmark
+end
+ -2
+1637 a -2 1647 a
+SDict begin H.S end
+ -2 1647 a -2 1647 a
+SDict begin 13 H.A end
+ -2 1647 a -2 1647
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2757) cvn H.B /DEST pdfmark
+end
+ -2 1647 a Black 396 1791 a FB(\225)p Black 479 1791
+a
+SDict begin H.S end
+ 479 1791 a 479 1791 a
+SDict begin 13 H.A end
+ 479 1791 a 479 1791 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2758) cvn H.B /DEST pdfmark
+end
+ 479 1791
+a FC(There)f(are)g(se)n(v)o(eral)f(places)i(in)1382 1791
+y
+SDict begin H.S end
+ 1382 1791 a 1382 1791 a
+SDict begin 13 H.A end
+ 1382 1791 a 1382 1791 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2759) cvn H.B /DEST pdfmark
+end
+ 1382
+1791 a FC(samhain)e(where)h(e)o(xternal)f(programs)f(may)i(be)g
+(called.)g(Each)g(such)f(place)h(is)479 1899 y(identi\002ed)g(by)f(a)
+975 1899 y
+SDict begin H.S end
+ 975 1899 a 975 1899 a
+SDict begin 13 H.A end
+ 975 1899 a 975 1899
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2760) cvn H.B /DEST pdfmark
+end
+ 975 1899 a Fx(type)p FC(.)h(Currently)-5 b(,)18 b(v)n(alid)i(types)g
+(are:)-2 2083 y
+SDict begin H.S end
+ -2 2083 a -2 2083 a
+SDict begin 13 H.A end
+ -2 2083 a -2 2083
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2761) cvn H.B /DEST pdfmark
+end
+ -2 2083 a -2 2083 a
+SDict begin H.S end
+ -2 2083 a -2 2083 a
+SDict begin 13 H.A end
+ -2 2083 a -2
+2083 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2762) cvn H.B /DEST pdfmark
+end
+ -2 2083 a -2 2083 a
+SDict begin H.S end
+ -2 2083 a -2 2083 a
+SDict begin 13 H.A end
+ -2 2083
+a -2 2083 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2763) cvn H.B /DEST pdfmark
+end
+ -2 2083 a Black 479 2214 a Fa(\225)p Black
+562 2214 a
+SDict begin H.S end
+ 562 2214 a 562 2214 a
+SDict begin 13 H.A end
+ 562 2214 a 562 2214
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2764) cvn H.B /DEST pdfmark
+end
+ 562 2214 a 562 2214 a
+SDict begin H.S end
+ 562 2214 a 562 2214 a
+SDict begin 13 H.A end
+ 562 2214
+a 562 2214 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2765) cvn H.B /DEST pdfmark
+end
+ 562 2214 a Fx(lo)o(g)g FC(\227)h(An)f(e)o(xternal)f
+(logging)g(f)o(acility)-5 b(,)19 b(which)h(is)h(handled)e(lik)o(e)h
+(other)f(logging)g(f)o(acilities.)h(The)g(program)562
+2322 y(will)h(recei)n(v)o(e)e(the)i(logged)d(message)i(on)g(stdin,)g
+(follo)n(wed)f(by)h(a)g(ne)n(wline,)g(follo)n(wed)e(by)i(the)g(string)
+3474 2322 y
+SDict begin H.S end
+ 3474 2322 a 3474 2322 a
+SDict begin 13 H.A end
+ 3474 2322 a 3474
+2322 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2766) cvn H.B /DEST pdfmark
+end
+ 3474 2322 a Fx([EOF])562 2430 y FC(and)g(another)f(ne)n(wline.)
+-2 2431 y
+SDict begin H.S end
+ -2 2431 a -2 2431 a
+SDict begin 13 H.A end
+ -2 2431 a -2 2431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2767) cvn H.B /DEST pdfmark
+end
+ -2
+2431 a Black 479 2579 a Fa(\225)p Black 562 2579 a
+SDict begin H.S end
+ 562
+2579 a 562 2579 a
+SDict begin 13 H.A end
+ 562 2579 a 562 2579 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2768) cvn H.B /DEST pdfmark
+end
+ 562 2579 a 562
+2579 a
+SDict begin H.S end
+ 562 2579 a 562 2579 a
+SDict begin 13 H.A end
+ 562 2579 a 562 2579 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2769) cvn H.B /DEST pdfmark
+end
+ 562
+2579 a Fx(srv)j FC(\227)e(Ex)o(ecuted)f(by)h(the)g(serv)o(er)m(,)e
+(whene)n(v)o(er)h(the)h(status)h(of)f(a)g(client,)g(as)h(displayed)e
+(in)h(the)h(HTML)f(status)562 2687 y(table,)g(has)h(changed.)d(The)i
+(program)e(will)j(recei)n(v)o(e)e(the)h(client)g(hostname,)f(the)h
+(timestamp,)g(and)f(the)h(ne)n(w)562 2795 y(status,)h(follo)n(wed)e(by)
+h(a)g(ne)n(wline,)f(follo)n(wed)g(by)1988 2795 y
+SDict begin H.S end
+ 1988
+2795 a 1988 2795 a
+SDict begin 13 H.A end
+ 1988 2795 a 1988 2795 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2770) cvn H.B /DEST pdfmark
+end
+ 1988 2795
+a Fx([EOF])i FC(and)e(another)g(ne)n(wline.)438 3063
+y
+SDict begin H.S end
+ 438 3063 a 438 3063 a
+SDict begin 13 H.A end
+ 438 3063 a 438 3063 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2771) cvn H.B /DEST pdfmark
+end
+ 438 3063
+a Black 396 3212 a FB(\225)p Black 479 3212 a
+SDict begin H.S end
+ 479 3212
+a 479 3212 a
+SDict begin 13 H.A end
+ 479 3212 a 479 3212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2772) cvn H.B /DEST pdfmark
+end
+ 479 3212 a FC(An)o(y)h(number)e(of)i
+(e)o(xternal)f(programs)f(may)i(be)g(de\002ned)f(in)i(the)f
+(con\002guration)d(\002le.)k(Each)f(e)o(xternal)f(program)479
+3320 y(has)i(a)668 3320 y
+SDict begin H.S end
+ 668 3320 a 668 3320 a
+SDict begin 13 H.A end
+ 668 3320
+a 668 3320 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2773) cvn H.B /DEST pdfmark
+end
+ 668 3320 a Fx(type)p FC(,)f(which)g(is)1148
+3320 y
+SDict begin H.S end
+ 1148 3320 a 1148 3320 a
+SDict begin 13 H.A end
+ 1148 3320 a 1148 3320
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2774) cvn H.B /DEST pdfmark
+end
+ 1148 3320 a Fx(lo)o(g)g FC(by)g(def)o(ault.)f(Whene)n(v)o(er)g(e)o
+(xternal)f(programs)h(are)h(called,)g(all)g(programs)f(of)h(the)479
+3428 y(appropriate)878 3428 y
+SDict begin H.S end
+ 878 3428 a 878 3428 a
+SDict begin 13 H.A end
+ 878
+3428 a 878 3428 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2775) cvn H.B /DEST pdfmark
+end
+ 878 3428 a Fx(type)g FC(are)g(e)o(x)o(ecuted.)e(The)
+1643 3428 y
+SDict begin H.S end
+ 1643 3428 a 1643 3428 a
+SDict begin 13 H.A end
+ 1643 3428 a 1643
+3428 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2776) cvn H.B /DEST pdfmark
+end
+ 1643 3428 a Fx(type)i FC(can)g(be)g(set)h(with)2319
+3428 y
+SDict begin H.S end
+ 2319 3428 a 2319 3428 a
+SDict begin 13 H.A end
+ 2319 3428 a 2319 3428
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2777) cvn H.B /DEST pdfmark
+end
+ 2319 3428 a Fy(SetT)-6 b(ype=)2651 3428 y
+SDict begin H.S end
+ 2651 3428
+a 2651 3428 a
+SDict begin 13 H.A end
+ 2651 3428 a 2651 3428 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2778) cvn H.B /DEST pdfmark
+end
+ 2651 3428 a Fl(type)-2
+3446 y
+SDict begin H.S end
+ -2 3446 a -2 3446 a
+SDict begin 13 H.A end
+ -2 3446 a -2 3446 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2779) cvn H.B /DEST pdfmark
+end
+ -2 3446
+a Black 396 3578 a FB(\225)p Black 479 3578 a
+SDict begin H.S end
+ 479 3578
+a 479 3578 a
+SDict begin 13 H.A end
+ 479 3578 a 479 3578 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2780) cvn H.B /DEST pdfmark
+end
+ 479 3578 a FC(External)19
+b(programs)g(must)h(be)g(on)g(a)g(trusted)g(path)g(\(see)p
+0 TeXcolorgray 2123 3578 a
+SDict begin H.S end
+ 2123 3578 a FC(Section)g(2.10.1)2603
+3578 y
+SDict begin 13 H.L end
+ 2603 3578 a 2603 3578 a
+SDict begin [ /Subtype /Link /Dest (0:DEFTRUST) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2603 3578 a Black -2 w
+FC(>\),)g(i.e.)g(must)g(not)g(be)g(writeable)g(by)479
+3686 y(untrusted)f(users.)-2 3687 y
+SDict begin H.S end
+ -2 3687 a -2 3687
+a
+SDict begin 13 H.A end
+ -2 3687 a -2 3687 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2782) cvn H.B /DEST pdfmark
+end
+ -2 3687 a Black 396 3835 a FB(\225)p
+Black 479 3835 a
+SDict begin H.S end
+ 479 3835 a 479 3835 a
+SDict begin 13 H.A end
+ 479 3835 a 479
+3835 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2783) cvn H.B /DEST pdfmark
+end
+ 479 3835 a FC(F)o(or)h(enhanced)e(security)-5
+b(,)19 b(the)i(\(192-bit)d(TIGER\))i(checksum)e(of)i(the)g(e)o(xternal)
+f(program/script)f(may)i(be)479 3943 y(speci\002ed)g(in)h(the)f
+(con\002guration)d(\002le:)1616 3943 y
+SDict begin H.S end
+ 1616 3943 a 1616
+3943 a
+SDict begin 13 H.A end
+ 1616 3943 a 1616 3943 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2784) cvn H.B /DEST pdfmark
+end
+ 1616 3943 a Fy(SetChecksum=)2147
+3943 y
+SDict begin H.S end
+ 2147 3943 a 2147 3943 a
+SDict begin 13 H.A end
+ 2147 3943 a 2147 3943
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2785) cvn H.B /DEST pdfmark
+end
+ 2147 3943 a Fl(checksum)24 b FC(\(one)19 b(string,)h(no)f(blanks)h
+(in)g(checksum\))-2 3961 y
+SDict begin H.S end
+ -2 3961 a -2 3961 a
+SDict begin 13 H.A end
+ -2 3961
+a -2 3961 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2786) cvn H.B /DEST pdfmark
+end
+ -2 3961 a Black 396 4092 a FB(\225)p Black
+479 4092 a
+SDict begin H.S end
+ 479 4092 a 479 4092 a
+SDict begin 13 H.A end
+ 479 4092 a 479 4092
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2787) cvn H.B /DEST pdfmark
+end
+ 479 4092 a FC(Command)f(line)h(ar)o(guments)e(and)i(en)m(vironment)d
+(v)n(ariables)j(for)f(each)h(e)o(xternal)f(program)f(are)i
+(con\002gurable)479 4200 y(\(the)g(def)o(ault)g(is)h(no)f(command)e
+(line)i(ar)o(guments,)e(and)i(only)f(the)h(timezone)f(in)i(the)f(en)m
+(vironment\):)-2 4384 y
+SDict begin H.S end
+ -2 4384 a -2 4384 a
+SDict begin 13 H.A end
+ -2 4384 a
+-2 4384 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2788) cvn H.B /DEST pdfmark
+end
+ -2 4384 a -2 4384 a
+SDict begin H.S end
+ -2 4384 a -2 4384 a
+SDict begin 13 H.A end
+ -2
+4384 a -2 4384 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2789) cvn H.B /DEST pdfmark
+end
+ -2 4384 a 479 4474 a Fy(SetCommandline=)1140
+4474 y
+SDict begin H.S end
+ 1140 4474 a 1140 4474 a
+SDict begin 13 H.A end
+ 1140 4474 a 1140 4474
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2790) cvn H.B /DEST pdfmark
+end
+ 1140 4474 a Fl(full_command_line)e FC(\(full)i(command)e(line)i
+(starting)g(with)h(the)f(name)f(of)h(the)479 4582 y(program\))-2
+4766 y
+SDict begin H.S end
+ -2 4766 a -2 4766 a
+SDict begin 13 H.A end
+ -2 4766 a -2 4766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2791) cvn H.B /DEST pdfmark
+end
+ -2 4766
+a -2 4766 a
+SDict begin H.S end
+ -2 4766 a -2 4766 a
+SDict begin 13 H.A end
+ -2 4766 a -2 4766 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2792) cvn H.B /DEST pdfmark
+end
+ -2
+4766 a 479 4856 a Fy(Seten)m(vir)o(on=)906 4856 y
+SDict begin H.S end
+ 906
+4856 a 906 4856 a
+SDict begin 13 H.A end
+ 906 4856 a 906 4856 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2793) cvn H.B /DEST pdfmark
+end
+ 906 4856 a Fl(KEY=value)438
+4975 y
+SDict begin H.S end
+ 438 4975 a 438 4975 a
+SDict begin 13 H.A end
+ 438 4975 a 438 4975 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2794) cvn H.B /DEST pdfmark
+end
+ 438
+4975 a Black 396 5124 a FB(\225)p Black 479 5124 a
+SDict begin H.S end
+ 479
+5124 a 479 5124 a
+SDict begin 13 H.A end
+ 479 5124 a 479 5124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2795) cvn H.B /DEST pdfmark
+end
+ 479 5124 a FC(The)g(user)g
+(whose)g(credentials)f(shall)i(be)f(used,)g(can)g(be)g(speci\002ed:)
+2446 5124 y
+SDict begin H.S end
+ 2446 5124 a 2446 5124 a
+SDict begin 13 H.A end
+ 2446 5124 a 2446
+5124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2796) cvn H.B /DEST pdfmark
+end
+ 2446 5124 a Fy(SetCr)o(edentials=)3014 5124 y
+SDict begin H.S end
+
+3014 5124 a 3014 5124 a
+SDict begin 13 H.A end
+ 3014 5124 a 3014 5124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2797) cvn H.B /DEST pdfmark
+end
+ 3014
+5124 a Fl(username)-2 5142 y
+SDict begin H.S end
+ -2 5142 a -2 5142 a
+SDict begin 13 H.A end
+ -2 5142
+a -2 5142 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2798) cvn H.B /DEST pdfmark
+end
+ -2 5142 a Black 396 5273 a FB(\225)p Black
+479 5273 a
+SDict begin H.S end
+ 479 5273 a 479 5273 a
+SDict begin 13 H.A end
+ 479 5273 a 479 5273
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2799) cvn H.B /DEST pdfmark
+end
+ 479 5273 a FC(Some)g(\002lters)h(are)f(a)n(v)n(ailable)g(to)g(mak)o
+(e)g(the)g(e)o(x)o(ecution)e(of)i(an)g(e)o(xternal)f(program)f
+(dependent)g(on)i(the)g(message)479 5381 y(content:)p
+Black 3658 5805 a Fx(77)p Black eop end
+%%Page: 78 83
+TeXDict begin 78 82 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.78) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2385 104 a
+Fx(Chapter)20 b(7.)g(Hooks)g(for)g(External)g(Pr)l(o)o(gr)o(ams)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2800) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2801) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 479 309 a Fy(SetFilterNot=)966 309 y
+SDict begin H.S end
+ 966 309 a
+966 309 a
+SDict begin 13 H.A end
+ 966 309 a 966 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2802) cvn H.B /DEST pdfmark
+end
+ 966 309 a Fl(list)f FC(If)h(an)o(y)f(w)o
+(ord)h(in)g(')o(list')h(matches)f(a)g(w)o(ord)g(in)g(the)g(message,)g
+(the)g(program)e(is)j(not)479 417 y(e)o(x)o(ecuted,)d(else)-2
+595 y
+SDict begin H.S end
+ -2 595 a -2 595 a
+SDict begin 13 H.A end
+ -2 595 a -2 595 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2803) cvn H.B /DEST pdfmark
+end
+ -2 595 a -2
+595 a
+SDict begin H.S end
+ -2 595 a -2 595 a
+SDict begin 13 H.A end
+ -2 595 a -2 595 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2804) cvn H.B /DEST pdfmark
+end
+ -2 595 a 479
+691 a Fy(SetFilterAnd=)988 691 y
+SDict begin H.S end
+ 988 691 a 988 691 a
+SDict begin 13 H.A end
+
+988 691 a 988 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2805) cvn H.B /DEST pdfmark
+end
+ 988 691 a Fl(list)i FC(if)g(an)o(y)g(w)o(ord)f(in)i
+(')o(list')f(is)i(missing)e(in)g(the)g(message,)g(the)g(program)e(is)j
+(not)f(e)o(x)o(ecuted,)479 799 y(else)-2 965 y
+SDict begin H.S end
+ -2 965
+a -2 965 a
+SDict begin 13 H.A end
+ -2 965 a -2 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2806) cvn H.B /DEST pdfmark
+end
+ -2 965 a -2 965 a
+SDict begin H.S end
+ -2 965
+a -2 965 a
+SDict begin 13 H.A end
+ -2 965 a -2 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2807) cvn H.B /DEST pdfmark
+end
+ -2 965 a 479 1073 a Fy(SetFilterOr=)938
+1073 y
+SDict begin H.S end
+ 938 1073 a 938 1073 a
+SDict begin 13 H.A end
+ 938 1073 a 938 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2808) cvn H.B /DEST pdfmark
+end
+ 938
+1073 a Fl(list)f FC(if)i(none)e(of)h(the)g(w)o(ords)g(in)g(')o(list')h
+(is)g(in)f(the)g(message,)g(the)g(program)e(is)k(not)d(e)o(x)o(ecuted.)
+479 1180 y(An)o(y)h(\002lter)g(not)g(de\002ned)f(is)i(not)f(e)n(v)n
+(aluated.)438 1299 y
+SDict begin H.S end
+ 438 1299 a 438 1299 a
+SDict begin 13 H.A end
+ 438 1299 a
+438 1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2809) cvn H.B /DEST pdfmark
+end
+ 438 1299 a Black 396 1448 a FB(\225)p Black
+479 1448 a
+SDict begin H.S end
+ 479 1448 a 479 1448 a
+SDict begin 13 H.A end
+ 479 1448 a 479 1448
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2810) cvn H.B /DEST pdfmark
+end
+ 479 1448 a FC(It)h(is)g(possible)f(to)g(set)h(a)g(')l(deadtime'.)d(W)
+m(ithin)i(that)g(')l(deadtime',)e(the)i(respecti)n(v)o(e)f(e)o(xternal)
+g(program)f(will)j(be)479 1556 y(e)o(x)o(ecuted)e(only)g(once)g(\(if)i
+(triggered\):)1609 1556 y
+SDict begin H.S end
+ 1609 1556 a 1609 1556 a
+SDict begin 13 H.A end
+ 1609
+1556 a 1609 1556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2811) cvn H.B /DEST pdfmark
+end
+ 1609 1556 a Fy(SetDeadtime=)2109 1556
+y
+SDict begin H.S end
+ 2109 1556 a 2109 1556 a
+SDict begin 13 H.A end
+ 2109 1556 a 2109 1556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2812) cvn H.B /DEST pdfmark
+end
+ 2109
+1556 a Fl(seconds)39 1706 y
+SDict begin H.S end
+ 39 1706 a 39 1706 a
+SDict begin 13 H.A end
+ 39 1706
+a 39 1706 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PAGING) cvn H.B /DEST pdfmark
+end
+ 39 1706 a 396 2034 a Fp(7.3.1.)36 b(Example)f(setup)f(f)n
+(or)e(pa)o(ging)2186 2034 y
+SDict begin H.S end
+ 2186 2034 a 2186 2034 a
+SDict begin 18.72 H.A end
+ 2186
+2034 a 2186 2034 a
+SDict begin [ /View [/XYZ H.V] /Dest (9.63.33.2) cvn H.B /DEST pdfmark
+end
+ 2186 2034 a -2 2226 a
+SDict begin H.S end
+ -2 2226 a -2
+2226 a
+SDict begin 13 H.A end
+ -2 2226 a -2 2226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2815) cvn H.B /DEST pdfmark
+end
+ -2 2226 a 396 2308 a FC(The)20
+b(distrib)n(ution)f(contains)h(tw)o(o)g(e)o(xample)f(perl)h(scripts)g
+(for)g(paging)e(and)i(SMS)h(messages)f(\(e)o(xample_pager)-5
+b(.pl,)396 2416 y(e)o(xample_sms.pl\).)17 b(The)j(paging)f(script)h
+(will)h(page)f(via)g(a)h(web)f(CGI)g(script)h(at)f(www)-5
+b(.pagemart.com)396 2523 y(\(ob)o(viously)18 b(will)j(w)o(ork)e(only)h
+(for)f(their)h(pagers\),)f(the)h(SMS)h(script)f(is)i(for)d(an)o(y)h
+(German)f('free)g(SMS')i(web)f(site)396 2631 y(that)g(outsources)e
+(free)h(SMS)h(to)g(pitcom)e(\(with)h(a)h(suitable)f(query)f(on)h
+(Google)g(you)f(can)i(\002nd)f(such)g(sites;)i(you)d(can)396
+2739 y(then)i(inspect)g(the)g(HTML)g(form)f(to)i(set)g(proper)d(v)n
+(alues)i(for)f(the)i(required)d(form)h(v)n(ariables.\))-2
+2923 y
+SDict begin H.S end
+ -2 2923 a -2 2923 a
+SDict begin 13 H.A end
+ -2 2923 a -2 2923 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2816) cvn H.B /DEST pdfmark
+end
+ -2 2923
+a 396 3013 a FC(If)h(you)g(kno)n(w)f(some)h(Perl,)g(both)f(scripts)i
+(can)f(be)g(adapted)f(f)o(airly)h(easily)g(to)h(other)e(pro)o(viders.)f
+(Belo)n(w)i(is)h(an)396 3121 y(e)o(xample)e(setup)h(for)g(calling)f(e)o
+(xample_pager)-5 b(.pl)17 b(as)k(an)f(e)o(xternal)f(logging)f(f)o
+(acility)-5 b(.)-2 3222 y
+SDict begin H.S end
+ -2 3222 a -2 3222 a
+SDict begin 11.7 H.A end
+ -2 3222
+a -2 3222 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2817) cvn H.B /DEST pdfmark
+end
+ -2 3222 a 486 3301 a Fr([External])486 3399
+y(#)45 b(start)f(definition)f(of)h(first)g(external)g(program)486
+3496 y(OpenCommand=/usr/local/bin/example_page)o(r.pl)486
+3593 y(SetType=log)486 3690 y(#)h(arguments)486 3787
+y(SetCommandline=example_pager.pl)40 b(pager_id)486 3884
+y(#)45 b(environment)486 3981 y(SetEnviron=HOME=/home/moses)486
+4078 y(SetEnviron=PATH=/bin:/usr/bin:/usr/loca)o(l/bin)486
+4176 y(#)g(checksum)486 4273 y(SetChecksum=FCBD3377B65F92F1701AFEEF3B5)
+o(E8A80E)o(D4936F)o(D0D172)o(C84)486 4370 y(#)g(credentials)486
+4467 y(SetCredentials=moses)486 4564 y(#)g(filter)486
+4661 y(SetFilterOr=POLICY)486 4758 y(#)g(deadtime)486
+4856 y(SetDeadtime=3600)p Black 3661 5805 a Fx(78)p Black
+eop end
+%%Page: 79 84
+TeXDict begin 79 83 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.79) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SIGNED-FILES) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(8.)f(Ad)n(ditional)i(Features)f(\227)g(Signed)-2
+575 y(Con\002guration/Database)g(Files)2380 575 y
+SDict begin H.S end
+ 2380
+575 a 2380 575 a
+SDict begin 26.957 H.A end
+ 2380 575 a 2380 575 a
+SDict begin [ /View [/XYZ H.V] /Dest (10.0) cvn H.B /DEST pdfmark end
+ 2380 575 a -2
+833 a
+SDict begin H.S end
+ -2 833 a -2 833 a
+SDict begin 13 H.A end
+ -2 833 a -2 833 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2820) cvn H.B /DEST pdfmark
+end
+ -2 833 a 396
+903 a FC(Both)20 b(the)h(con\002guration)c(\002le)k(\(see)p
+0 TeXcolorgray 1445 903 a
+SDict begin H.S end
+ 1445 903 a FC(Section)f(C.1)1833
+903 y
+SDict begin 13 H.L end
+ 1833 903 a 1833 903 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1833 903 a Black FC(>\))g(and)g(the)g
+(database)g(of)g(\002le)g(signatures)g(\()p 0 TeXcolorgray
+3100 903 a
+SDict begin H.S end
+ 3100 903 a FC(Section)f(5.8)3474 903 y
+SDict begin 13 H.L end
+ 3474
+903 a 3474 903 a
+SDict begin [ /Subtype /Link /Dest (0:DATABASEFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3474 903 a Black -1 w FC(>\))h(may)396
+1011 y(al)o(w)o(ays)h(be)f(clearte)o(xt)f(signed)h(by)g(GnuGP)g(\()1690
+1011 y
+SDict begin H.S end
+ 1690 1011 a 1690 1011 a
+SDict begin 13 H.A end
+ 1690 1011 a 1690 1011
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2823) cvn H.B /DEST pdfmark
+end
+ 1690 1011 a Fy(gpg)p FC(\).)e(The)2037 1011 y
+SDict begin H.S end
+ 2037
+1011 a 2037 1011 a
+SDict begin 13 H.A end
+ 2037 1011 a 2037 1011 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2824) cvn H.B /DEST pdfmark
+end
+ 2037 1011
+a Fx(r)m(ecommended)j FC(options)e(are:)-2 1195 y
+SDict begin H.S end
+ -2
+1195 a -2 1195 a
+SDict begin 13 H.A end
+ -2 1195 a -2 1195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2825) cvn H.B /DEST pdfmark
+end
+ -2 1195 a -2 1195
+a
+SDict begin H.S end
+ -2 1195 a -2 1195 a
+SDict begin 13 H.A end
+ -2 1195 a -2 1195 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2826) cvn H.B /DEST pdfmark
+end
+ -2 1195 a 396
+1285 a Fy(gpg)h(-a)g(--clearsign)f(--not-dash-escaped)1720
+1285 y
+SDict begin H.S end
+ 1720 1285 a 1720 1285 a
+SDict begin 13 H.A end
+ 1720 1285 a 1720 1285
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2827) cvn H.B /DEST pdfmark
+end
+ 1720 1285 a Fl(FILE)-2 1468 y
+SDict begin H.S end
+ -2 1468 a -2 1468 a
+SDict begin 13 H.A end
+ -2
+1468 a -2 1468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2828) cvn H.B /DEST pdfmark
+end
+ -2 1468 a 396 1559 a FC(If)h(compiled)f(with)h
+(support)f(for)h(signatures,)1736 1559 y
+SDict begin H.S end
+ 1736 1559 a
+1736 1559 a
+SDict begin 13 H.A end
+ 1736 1559 a 1736 1559 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2829) cvn H.B /DEST pdfmark
+end
+ 1736 1559 a FC(samhain)f(will)i(in)
+m(v)n(ok)o(e)2424 1559 y
+SDict begin H.S end
+ 2424 1559 a 2424 1559 a
+SDict begin 13 H.A end
+ 2424
+1559 a 2424 1559 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2830) cvn H.B /DEST pdfmark
+end
+ 2424 1559 a Fy(gpg)f FC(to)h(v)o(erify)d(the)j
+(signature.)d(T)-7 b(o)21 b(compile)396 1667 y(with)565
+1667 y
+SDict begin H.S end
+ 565 1667 a 565 1667 a
+SDict begin 13 H.A end
+ 565 1667 a 565 1667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2831) cvn H.B /DEST pdfmark
+end
+ 565
+1667 a Fy(gpg)f FC(support,)e(use)j(the)f(option:)-2
+1851 y
+SDict begin H.S end
+ -2 1851 a -2 1851 a
+SDict begin 13 H.A end
+ -2 1851 a -2 1851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2832) cvn H.B /DEST pdfmark
+end
+ -2 1851
+a -2 1851 a
+SDict begin H.S end
+ -2 1851 a -2 1851 a
+SDict begin 13 H.A end
+ -2 1851 a -2 1851 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2833) cvn H.B /DEST pdfmark
+end
+ -2
+1851 a 396 1941 a Fy(./con\002gur)o(e)f(--with-gpg=/full/path/to/gpg)-2
+2124 y
+SDict begin H.S end
+ -2 2124 a -2 2124 a
+SDict begin 13 H.A end
+ -2 2124 a -2 2124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2834) cvn H.B /DEST pdfmark
+end
+ -2 2124
+a -2 2124 a
+SDict begin H.S end
+ -2 2124 a -2 2124 a
+SDict begin 13 H.A end
+ -2 2124 a -2 2124 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2835) cvn H.B /DEST pdfmark
+end
+ -2
+2124 a -2 2134 a
+SDict begin H.S end
+ -2 2134 a -2 2134 a
+SDict begin 13 H.A end
+ -2 2134 a -2 2134
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2836) cvn H.B /DEST pdfmark
+end
+ -2 2134 a Black 396 2277 a FB(\225)p Black 479 2277
+a
+SDict begin H.S end
+ 479 2277 a 479 2277 a
+SDict begin 13 H.A end
+ 479 2277 a 479 2277 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2837) cvn H.B /DEST pdfmark
+end
+ 479 2277
+a FC(samhain)h(will)h(check)e(that)h(the)h(path)e(to)i(the)1780
+2277 y
+SDict begin H.S end
+ 1780 2277 a 1780 2277 a
+SDict begin 13 H.A end
+ 1780 2277 a 1780 2277
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2838) cvn H.B /DEST pdfmark
+end
+ 1780 2277 a Fy(gpg)f FC(e)o(x)o(ecutable)e(is)j(writeable)2709
+2277 y
+SDict begin H.S end
+ 2709 2277 a 2709 2277 a
+SDict begin 13 H.A end
+ 2709 2277 a 2709 2277
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2839) cvn H.B /DEST pdfmark
+end
+ 2709 2277 a Fx(only)f(by)g(trusted)g(user)o(s)h FC(\(see)p
+0 TeXcolorgray 479 2385 a
+SDict begin H.S end
+ 479 2385 a FC(Section)f(2.10.1)959
+2385 y
+SDict begin 13 H.L end
+ 959 2385 a 959 2385 a
+SDict begin [ /Subtype /Link /Dest (0:DEFTRUST) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 959 2385 a Black -2 w FC(>\).)-2
+2400 y
+SDict begin H.S end
+ -2 2400 a -2 2400 a
+SDict begin 13 H.A end
+ -2 2400 a -2 2400 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2841) cvn H.B /DEST pdfmark
+end
+ -2 2400
+a Black 396 2534 a FB(\225)p Black 479 2534 a
+SDict begin H.S end
+ 479 2534
+a 479 2534 a
+SDict begin 13 H.A end
+ 479 2534 a 479 2534 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2842) cvn H.B /DEST pdfmark
+end
+ 479 2534 a FC(The)g(program)e(will)j
+(be)f(called)g(without)g(using)f(the)i(shell,)f(with)g(its)h(full)g
+(path)e(\(as)i(compiled)e(in\),)g(and)h(with)g(an)479
+2642 y(en)m(vironment)d(that)k(is)g(limited)f(to)g(the)g(HOME)h(v)n
+(ariable.)-2 2643 y
+SDict begin H.S end
+ -2 2643 a -2 2643 a
+SDict begin 13 H.A end
+ -2 2643 a -2
+2643 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2843) cvn H.B /DEST pdfmark
+end
+ -2 2643 a Black 396 2792 a FB(\225)p Black 479
+2792 a
+SDict begin H.S end
+ 479 2792 a 479 2792 a
+SDict begin 13 H.A end
+ 479 2792 a 479 2792 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2844) cvn H.B /DEST pdfmark
+end
+ 479
+2792 a FC(The)f(public)f(k)o(e)o(y)h(must)g(be)g(in)h(in)f(the)g
+(subdirectory)2006 2792 y
+SDict begin H.S end
+ 2006 2792 a 2006 2792 a
+SDict begin 13 H.A end
+ 2006
+2792 a 2006 2792 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2845) cvn H.B /DEST pdfmark
+end
+ 2006 2792 a Fr(HOME/.gnupg)p FC(,)f(where)g(HOME)h
+(is)i(the)e(home)f(directory)479 2900 y(of)h(the)g(ef)n(fecti)n(v)o(e)f
+(user)h(\(usually)1444 2900 y
+SDict begin H.S end
+ 1444 2900 a 1444 2900 a
+SDict begin 13 H.A end
+
+1444 2900 a 1444 2900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2846) cvn H.B /DEST pdfmark
+end
+ 1444 2900 a Fx(r)l(oot)q FC(\).)-2
+2917 y
+SDict begin H.S end
+ -2 2917 a -2 2917 a
+SDict begin 13 H.A end
+ -2 2917 a -2 2917 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2847) cvn H.B /DEST pdfmark
+end
+ -2 2917
+a Black 396 3049 a FB(\225)p Black 479 3049 a
+SDict begin H.S end
+ 479 3049
+a 479 3049 a
+SDict begin 13 H.A end
+ 479 3049 a 479 3049 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2848) cvn H.B /DEST pdfmark
+end
+ 479 3049 a FC(From)g(the)g(command)e
+(line,)i(the)h(signature)e(must)h(v)o(erify)f(correctly)g(with)2648
+3049 y
+SDict begin H.S end
+ 2648 3049 a 2648 3049 a
+SDict begin 13 H.A end
+ 2648 3049 a 2648 3049
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2849) cvn H.B /DEST pdfmark
+end
+ 2648 3049 a Fy(/path/to/gpg)g(--status-fd)g(1)479 3157
+y(--v)o(erify)762 3157 y
+SDict begin H.S end
+ 762 3157 a 762 3157 a
+SDict begin 13 H.A end
+ 762 3157
+a 762 3157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2850) cvn H.B /DEST pdfmark
+end
+ 762 3157 a Fl(FILE)25 b FC(when)20 b(in)m(v)n(ok)o(ed)e
+(by)i(the)g(ef)n(fecti)n(v)o(e)f(user)h(of)g(samhain)f(\(usually)2817
+3157 y
+SDict begin H.S end
+ 2817 3157 a 2817 3157 a
+SDict begin 13 H.A end
+ 2817 3157 a 2817 3157
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2851) cvn H.B /DEST pdfmark
+end
+ 2817 3157 a Fx(r)l(oot)q FC(\).)39 3296 y
+SDict begin H.S end
+ 39 3296 a
+39 3296 a
+SDict begin 11.7 H.A end
+ 39 3296 a 39 3296 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2852) cvn H.B /DEST pdfmark
+end
+ 39 3296 a -2 3420 a
+SDict begin H.S end
+ -2
+3420 a -2 3420 a
+SDict begin 11.7 H.A end
+ -2 3420 a -2 3420 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2854) cvn H.B /DEST pdfmark
+end
+ -2 3420 a 562 3517
+a Fw(TIP:)g Fv(There)g(is)h(a)f(P)l(er)q(l)g(scr)q(ipt)1424
+3517 y
+SDict begin H.S end
+ 1424 3517 a 1424 3517 a
+SDict begin 11.7 H.A end
+ 1424 3517 a 1424 3517
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2855) cvn H.B /DEST pdfmark
+end
+ 1424 3517 a Fw(samhainadmin.pl)d Fv(to)k(f)n(acilitate)c(some)k
+(tasks)g(related)e(to)h(the)g(administr)o(ation)562 3614
+y(of)h(signed)f(con\002gur)o(ation)f(and)h(database)g(\002les)h(\(see)p
+0 TeXcolorgray 2127 3614 a
+SDict begin H.S end
+ 2127 3614 a Fv(Section)f(8.1)2502
+3614 y
+SDict begin 11.7 H.L end
+ 2502 3614 a 2502 3614 a
+SDict begin [ /Subtype /Link /Dest (0:SAMHAINADMIN) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2502 3614 a Black -1 w
+Fv(>\).)39 3753 y
+SDict begin H.S end
+ 39 3753 a 39 3753 a
+SDict begin 11.7 H.A end
+ 39 3753 a 39 3753
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2857) cvn H.B /DEST pdfmark
+end
+ 39 3753 a 745 3853 2668 17 v 745 4741 17 889 v 1843
+4048 a Fp(CA)-10 b(VEA)f(T)786 4215 y
+SDict begin H.S end
+ 786 4215 a 786
+4215 a
+SDict begin 11.7 H.A end
+ 786 4215 a 786 4215 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2859) cvn H.B /DEST pdfmark
+end
+ 786 4215 a 96 x Fv(When)19
+b(signing,)g(the)g(option)1630 4311 y
+SDict begin H.S end
+ 1630 4311 a 1630
+4311 a
+SDict begin 11.7 H.A end
+ 1630 4311 a 1630 4311 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2860) cvn H.B /DEST pdfmark
+end
+ 1630 4311 a Fq(--not-dash-escaped)k
+Fv(is)e(recommended,)d(because)786 4408 y(otherwise)h(the)h(database)e
+(might)h(get)h(corr)q(upted.)e(Ho)o(w)o(e)n(v)n(er)l(,)i(this)g
+(implies)f(that)g(after)h(a)786 4505 y(database)f(update)o(,)f(y)o(ou)
+1523 4505 y
+SDict begin H.S end
+ 1523 4505 a 1523 4505 a
+SDict begin 11.7 H.A end
+ 1523 4505 a 1523
+4505 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2861) cvn H.B /DEST pdfmark
+end
+ 1523 4505 a Fq(m)o(ust)28 b Fv(remo)o(v)n(e)20
+b(the)f(old)h(signature)e(\002rst,)j(bef)n(ore)d(re-signing)786
+4602 y(the)i(database)o(.)e(Without)g(')l(dash)i(escaping',)2086
+4602 y
+SDict begin H.S end
+ 2086 4602 a 2086 4602 a
+SDict begin 11.7 H.A end
+ 2086 4602 a 2086 4602
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2862) cvn H.B /DEST pdfmark
+end
+ 2086 4602 a Fv(gpg)f(will)h(not)f(proper)q(ly)g(handle)f(the)i(old)
+786 4699 y(signature)o(.)e(See)i(the)g(tip)f(just)h(abo)o(v)n(e)o(.)p
+3396 4741 17 889 v 745 4758 2668 17 v -2 4934 a
+SDict begin H.S end
+ -2 4934
+a -2 4934 a
+SDict begin 13 H.A end
+ -2 4934 a -2 4934 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2863) cvn H.B /DEST pdfmark
+end
+ -2 4934 a 396 4991 a
+FC(As)h(signatures)f(on)f(\002les)j(are)e(only)f(useful)h(as)h(long)e
+(as)i(you)e(can)h(trust)h(the)2564 4991 y
+SDict begin H.S end
+ 2564 4991 a
+2564 4991 a
+SDict begin 13 H.A end
+ 2564 4991 a 2564 4991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2864) cvn H.B /DEST pdfmark
+end
+ 2564 4991 a Fy(gpg)f
+FC(e)o(x)o(ecutable,)e(the)3230 4991 y
+SDict begin H.S end
+ 3230 4991 a 3230
+4991 a
+SDict begin 13 H.A end
+ 3230 4991 a 3230 4991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2865) cvn H.B /DEST pdfmark
+end
+ 3230 4991 a Fy(con\002gur)o(e)396
+5099 y FC(script)i(will)h(determine)e(the)h(TIGER192)1616
+5099 y
+SDict begin H.S end
+ 1616 5099 a 1616 5099 a
+SDict begin 13 H.A end
+ 1616 5099 a 1616 5099
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2866) cvn H.B /DEST pdfmark
+end
+ 1616 5099 a Fx(c)o(hec)n(ksum)g FC(of)g(the)2169 5099
+y
+SDict begin H.S end
+ 2169 5099 a 2169 5099 a
+SDict begin 13 H.A end
+ 2169 5099 a 2169 5099 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2867) cvn H.B /DEST pdfmark
+end
+ 2169
+5099 a Fy(gpg)g FC(e)o(x)o(ecutable,)e(which)h(will)i(be)f(compiled)f
+(into)396 5207 y
+SDict begin H.S end
+ 396 5207 a 396 5207 a
+SDict begin 13 H.A end
+ 396 5207 a 396
+5207 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2868) cvn H.B /DEST pdfmark
+end
+ 396 5207 a FC(samhain.)g(In)h(case)h(of)f(an)g(error)m(,)f(you)g
+(can)h(specify)f(the)i(checksum)d(by)i(hand)f(with:)p
+Black -2 5805 a
+SDict begin H.S end
+ -2 5805 a -2 5805 a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2873) cvn H.B /DEST pdfmark
+end
+ -2 5805 a 3661 5874 a Fx(79)p Black eop end
+%%Page: 80 85
+TeXDict begin 80 84 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.80) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1360 104 a
+Fx(Chapter)20 b(8.)g(Additional)e(F)-6 b(eatur)m(es)20
+b(\227)h(Signed)d(Con\002gur)o(ation/Database)e(F)l(iles)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2869) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2870) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(--with-checksum=")1080 309 y
+SDict begin H.S end
+ 1080
+309 a 1080 309 a
+SDict begin 13 H.A end
+ 1080 309 a 1080 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2871) cvn H.B /DEST pdfmark
+end
+ 1080 309 a Fl(CHECKSUM)9
+b Fy(")19 b FC(\227)i(or)f(\227)1812 309 y
+SDict begin H.S end
+ 1812 309 a
+1812 309 a
+SDict begin 13 H.A end
+ 1812 309 a 1812 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2872) cvn H.B /DEST pdfmark
+end
+ 1812 309 a Fy(--without-checksum)396
+583 y Fx(CHECKSUM)25 b FC(should)19 b(be)h(the)g(checksum)f(as)i
+(printed)e(by)-2 767 y
+SDict begin H.S end
+ -2 767 a -2 767 a
+SDict begin 13 H.A end
+ -2 767 a -2
+767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2875) cvn H.B /DEST pdfmark
+end
+ -2 767 a -2 767 a
+SDict begin H.S end
+ -2 767 a -2 767 a
+SDict begin 13 H.A end
+ -2 767 a -2
+767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2876) cvn H.B /DEST pdfmark
+end
+ -2 767 a 396 857 a Fy(gpg)h(--load-extension)e(tiger)i
+(--print-md)g(TIGER192)2133 857 y
+SDict begin H.S end
+ 2133 857 a 2133 857
+a
+SDict begin 13 H.A end
+ 2133 857 a 2133 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2877) cvn H.B /DEST pdfmark
+end
+ 2133 857 a Fl(/path/to/gpg)k
+FC(\227)d(or)f(\227)2994 857 y
+SDict begin H.S end
+ 2994 857 a 2994 857 a
+SDict begin 13 H.A end
+
+2994 857 a 2994 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2878) cvn H.B /DEST pdfmark
+end
+ 2994 857 a Fy(samhain)h(-H)396
+965 y
+SDict begin H.S end
+ 396 965 a 396 965 a
+SDict begin 13 H.A end
+ 396 965 a 396 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2879) cvn H.B /DEST pdfmark
+end
+ 396 965
+a Fl(/path/to/gpg)j FC(\(the)c(full)g(line)h(of)f(output,)1735
+965 y
+SDict begin H.S end
+ 1735 965 a 1735 965 a
+SDict begin 13 H.A end
+ 1735 965 a 1735 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2880) cvn H.B /DEST pdfmark
+end
+ 1735
+965 a Fx(with)h(spaces)p FC(\).)-2 1149 y
+SDict begin H.S end
+ -2 1149 a -2
+1149 a
+SDict begin 13 H.A end
+ -2 1149 a -2 1149 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2881) cvn H.B /DEST pdfmark
+end
+ -2 1149 a -2 1149 a
+SDict begin H.S end
+ -2 1149
+a -2 1149 a
+SDict begin 13 H.A end
+ -2 1149 a -2 1149 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2882) cvn H.B /DEST pdfmark
+end
+ -2 1149 a 396 1239 a
+Fx(Example:)735 1239 y
+SDict begin H.S end
+ 735 1239 a 735 1239 a
+SDict begin 13 H.A end
+ 735 1239
+a 735 1239 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2883) cvn H.B /DEST pdfmark
+end
+ 735 1239 a Fy(--with-checksum="/usr/bin/gpg:)f(1C739B6A)f
+(F768C949)e(F)-7 b(ABEF313)19 b(5F0B37F5)396 1346 y(22ED4A27)g
+(60D59664")-2 1347 y
+SDict begin H.S end
+ -2 1347 a -2 1347 a
+SDict begin 11.7 H.A end
+ -2 1347 a -2
+1347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2884) cvn H.B /DEST pdfmark
+end
+ -2 1347 a 745 1447 2668 17 v 745 2196 17 749 v
+1790 1601 a Fp(W)-7 b(ARNING)786 1768 y
+SDict begin H.S end
+ 786 1768 a 786
+1768 a
+SDict begin 11.7 H.A end
+ 786 1768 a 786 1768 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2886) cvn H.B /DEST pdfmark
+end
+ 786 1768 a 96 x Fv(Compiling)18
+b(in)i(the)g(Gn)o(uPG)g(chec)o(ksum)h(will)e(tie)h(the)f(samhain)h(e)n
+(x)n(ecutab)o(le)d(to)j(the)f(gpg)786 1961 y(e)n(x)n(ecutab)o(le)o(.)e
+(If)j(y)o(ou)f(upg)o(r)o(ade)f(Gn)o(uPG,)h(y)o(ou)g(will)g(need)g(to)h
+(re-compile)e(samhain.)g(If)i(y)o(ou)786 2058 y(don't)f(lik)o(e)h(this)
+o(,)f(use)1398 2058 y
+SDict begin H.S end
+ 1398 2058 a 1398 2058 a
+SDict begin 11.7 H.A end
+ 1398 2058
+a 1398 2058 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2887) cvn H.B /DEST pdfmark
+end
+ 1398 2058 a Fw('--with-c)o(hec)o(ksum=no')d
+Fv(\(or)2295 2058 y
+SDict begin H.S end
+ 2295 2058 a 2295 2058 a
+SDict begin 11.7 H.A end
+ 2295 2058
+a 2295 2058 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2888) cvn H.B /DEST pdfmark
+end
+ 2295 2058 a Fw('--without-c)o(hec)o(ksum')p
+Fv(,)g(which)j(is)786 2155 y(equiv)n(alent\).)p 3396
+2196 17 749 v 745 2213 2668 17 v -2 2389 a
+SDict begin H.S end
+ -2 2389 a
+-2 2389 a
+SDict begin 13 H.A end
+ -2 2389 a -2 2389 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2889) cvn H.B /DEST pdfmark
+end
+ -2 2389 a 396 2445 a FC(Lik)o(e)n(wise,)h
+(it)g(is)h(highly)e(recommended)e(to)j(compile)e(in)i(the)2184
+2445 y
+SDict begin H.S end
+ 2184 2445 a 2184 2445 a
+SDict begin 13 H.A end
+ 2184 2445 a 2184 2445
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2890) cvn H.B /DEST pdfmark
+end
+ 2184 2445 a Fx(k)o(e)n(y)g(\002ng)o(erprint)g FC(of)g(the)g
+(signature)e(k)o(e)o(y)-5 b(,)19 b(which)g(then)396 2553
+y(will)i(be)f(v)o(eri\002ed)f(after)h(checking)f(the)h(signature)f
+(itself:)-2 2737 y
+SDict begin H.S end
+ -2 2737 a -2 2737 a
+SDict begin 13 H.A end
+ -2 2737 a -2 2737
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2891) cvn H.B /DEST pdfmark
+end
+ -2 2737 a -2 2737 a
+SDict begin H.S end
+ -2 2737 a -2 2737 a
+SDict begin 13 H.A end
+ -2 2737 a -2
+2737 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2892) cvn H.B /DEST pdfmark
+end
+ -2 2737 a 396 2827 a Fy(--with-fp=FINGERPRINT)-2
+3010 y
+SDict begin H.S end
+ -2 3010 a -2 3010 a
+SDict begin 13 H.A end
+ -2 3010 a -2 3010 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2893) cvn H.B /DEST pdfmark
+end
+ -2 3010
+a -2 3010 a
+SDict begin H.S end
+ -2 3010 a -2 3010 a
+SDict begin 13 H.A end
+ -2 3010 a -2 3010 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2894) cvn H.B /DEST pdfmark
+end
+ -2
+3010 a 396 3101 a Fx(Example)h FC(\(spaces)g(in)g(FINGERPRINT)g(do)g
+(not)g(matter\):)2133 3101 y
+SDict begin H.S end
+ 2133 3101 a 2133 3101 a
+SDict begin 13 H.A end
+
+2133 3101 a 2133 3101 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2895) cvn H.B /DEST pdfmark
+end
+ 2133 3101 a Fy(--with-fp="EF6C)f(EF54)h(701A)f
+(0AFD)h(B86A)396 3209 y(F4C3)g(1AAD)g(26C8)f(0F57)g(1F6C")-2
+3210 y
+SDict begin H.S end
+ -2 3210 a -2 3210 a
+SDict begin 11.7 H.A end
+ -2 3210 a -2 3210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2896) cvn H.B /DEST pdfmark
+end
+ -2 3210
+a -2 3335 a
+SDict begin H.S end
+ -2 3335 a -2 3335 a
+SDict begin 11.7 H.A end
+ -2 3335 a -2 3335 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2898) cvn H.B /DEST pdfmark
+end
+ -2
+3335 a 562 3431 a Fw(TIP:)724 3431 y
+SDict begin H.S end
+ 724 3431 a 724 3431
+a
+SDict begin 11.7 H.A end
+ 724 3431 a 724 3431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2899) cvn H.B /DEST pdfmark
+end
+ 724 3431 a Fw(make)h(install)f
+Fv(will)g(gpg)h(sign)f(the)h(con\002gur)o(ation)e(\002le)i(bef)n(ore)e
+(installation.)-2 3663 y
+SDict begin H.S end
+ -2 3663 a -2 3663 a
+SDict begin 11.7 H.A end
+ -2 3663
+a -2 3663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2900) cvn H.B /DEST pdfmark
+end
+ -2 3663 a -2 3663 a
+SDict begin H.S end
+ -2 3663 a -2 3663 a
+SDict begin 11.7 H.A end
+ -2
+3663 a -2 3663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2901) cvn H.B /DEST pdfmark
+end
+ -2 3663 a 396 3760 a Ft(bash$)643 3760
+y
+SDict begin H.S end
+ 643 3760 a 643 3760 a
+SDict begin 11.7 H.A end
+ 643 3760 a 643 3760 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2902) cvn H.B /DEST pdfmark
+end
+ 643 3760
+a Fs(./configure)44 b(--with-gpg=/usr/bin)q(/gp)q(g)i
+(--with-fp=EF6CEF54)q(701)q(A0A)q(FDB)q(86)q(AF4)q(C31)q(AAD)q(26C)q
+(80F)q(571)q(F6C)-2 3769 y
+SDict begin H.S end
+ -2 3769 a -2 3769 a
+SDict begin 11.7 H.A end
+ -2 3769
+a -2 3769 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2903) cvn H.B /DEST pdfmark
+end
+ -2 3769 a 396 3857 a Ft(bash$)643 3857 y
+SDict begin H.S end
+
+643 3857 a 643 3857 a
+SDict begin 11.7 H.A end
+ 643 3857 a 643 3857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2904) cvn H.B /DEST pdfmark
+end
+ 643 3857
+a Fs(make)-2 3865 y
+SDict begin H.S end
+ -2 3865 a -2 3865 a
+SDict begin 11.7 H.A end
+ -2 3865 a -2
+3865 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2905) cvn H.B /DEST pdfmark
+end
+ -2 3865 a 396 3955 a Ft(bash$)643 3955 y
+SDict begin H.S end
+ 643 3955
+a 643 3955 a
+SDict begin 11.7 H.A end
+ 643 3955 a 643 3955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2906) cvn H.B /DEST pdfmark
+end
+ 643 3955 a Fs(su)-2
+3963 y
+SDict begin H.S end
+ -2 3963 a -2 3963 a
+SDict begin 11.7 H.A end
+ -2 3963 a -2 3963 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2907) cvn H.B /DEST pdfmark
+end
+ -2 3963
+a 396 4052 a Ft(bash$)643 4052 y
+SDict begin H.S end
+ 643 4052 a 643 4052
+a
+SDict begin 11.7 H.A end
+ 643 4052 a 643 4052 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2908) cvn H.B /DEST pdfmark
+end
+ 643 4052 a Fs(make)c(install)-2
+4060 y
+SDict begin H.S end
+ -2 4060 a -2 4060 a
+SDict begin 11.7 H.A end
+ -2 4060 a -2 4060 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2909) cvn H.B /DEST pdfmark
+end
+ -2 4060
+a 396 4149 a Ft(bash$)643 4149 y
+SDict begin H.S end
+ 643 4149 a 643 4149
+a
+SDict begin 11.7 H.A end
+ 643 4149 a 643 4149 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2910) cvn H.B /DEST pdfmark
+end
+ 643 4149 a Fs(samhain)h(-t)e(init)-2
+4157 y
+SDict begin H.S end
+ -2 4157 a -2 4157 a
+SDict begin 11.7 H.A end
+ -2 4157 a -2 4157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2911) cvn H.B /DEST pdfmark
+end
+ -2 4157
+a 396 4246 a Ft(bash$)643 4246 y
+SDict begin H.S end
+ 643 4246 a 643 4246
+a
+SDict begin 11.7 H.A end
+ 643 4246 a 643 4246 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2912) cvn H.B /DEST pdfmark
+end
+ 643 4246 a Fs(gpg)g(-a)g(--clearsign)j
+(/var/lib/samhain/s)q(amh)q(ain)q(_f)q(ile)-2 4255 y
+SDict begin H.S end
+
+-2 4255 a -2 4255 a
+SDict begin 11.7 H.A end
+ -2 4255 a -2 4255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2913) cvn H.B /DEST pdfmark
+end
+ -2 4255 a 396
+4343 a Ft(bash$)643 4343 y
+SDict begin H.S end
+ 643 4343 a 643 4343 a
+SDict begin 11.7 H.A end
+ 643
+4343 a 643 4343 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2914) cvn H.B /DEST pdfmark
+end
+ 643 4343 a Fs(mv)d(/var/lib/samhain/sa)q(mha)q(in_)q
+(fil)q(e.a)q(sc)47 b(/var/lib/samhain/sam)q(hai)q(n_f)q(il)q(e)-2
+4518 y
+SDict begin H.S end
+ -2 4518 a -2 4518 a
+SDict begin 13 H.A end
+ -2 4518 a -2 4518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2915) cvn H.B /DEST pdfmark
+end
+ -2 4518
+a -2 4518 a
+SDict begin H.S end
+ -2 4518 a -2 4518 a
+SDict begin 13 H.A end
+ -2 4518 a -2 4518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2916) cvn H.B /DEST pdfmark
+end
+ -2
+4518 a 396 4617 a FC(samhain)20 b(will)h(report)e(the)h(signature)f(k)o
+(e)o(y)h(o)n(wner)f(and)g(the)i(k)o(e)o(y)e(\002ngerprint)f(as)j
+(obtained)e(from)3226 4617 y
+SDict begin H.S end
+ 3226 4617 a 3226 4617 a
+SDict begin 13 H.A end
+
+3226 4617 a 3226 4617 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2917) cvn H.B /DEST pdfmark
+end
+ 3226 4617 a Fy(gpg)p FC(.)h(If)g(both)396
+4725 y(\002les)h(are)g(present)e(and)h(check)o(ed)f(\(i.e.)g(when)h
+(checking)e(\002les)k(against)d(the)h(database\),)f(both)h(must)g(be)g
+(signed)396 4833 y(with)h(the)f(same)g(k)o(e)o(y)-5 b(.)19
+b(If)h(the)g(v)o(eri\002cation)f(is)i(successful,)2087
+4833 y
+SDict begin H.S end
+ 2087 4833 a 2087 4833 a
+SDict begin 13 H.A end
+ 2087 4833 a 2087 4833
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2918) cvn H.B /DEST pdfmark
+end
+ 2087 4833 a FC(samhain)e(will)i(only)f(report)f(the)h(signature)f(on)
+h(the)396 4941 y(con\002guration)e(\002le.)i(If)g(the)g(v)o
+(eri\002cation)f(f)o(ails,)i(or)f(the)g(k)o(e)o(y)f(for)h(the)g
+(con\002guration)d(\002le)k(is)g(dif)n(ferent)e(from)g(that)h(of)396
+5049 y(the)g(database)g(\002le,)h(an)f(error)f(message)h(will)h
+(result.)-2 5067 y
+SDict begin H.S end
+ -2 5067 a -2 5067 a
+SDict begin 13 H.A end
+ -2 5067 a -2 5067
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SAMHAINADMIN) cvn H.B /DEST
+pdfmark end
+ -2 5067 a Black 3661 5805 a Fx(80)p Black eop end
+%%Page: 81 86
+TeXDict begin 81 85 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.81) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 1360 104 a
+Fx(Chapter)20 b(8.)g(Additional)e(F)-6 b(eatur)m(es)20
+b(\227)h(Signed)d(Con\002gur)o(ation/Database)e(F)l(iles)p
+Black -2 330 a Fu(8.1.)39 b(The)g(samhainadmin)d(script)2008
+330 y
+SDict begin H.S end
+ 2008 330 a 2008 330 a
+SDict begin 22.464 H.A end
+ 2008 330 a 2008 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (10.64.1) cvn H.B /DEST pdfmark
+end
+ 2008
+330 a -2 526 a
+SDict begin H.S end
+ -2 526 a -2 526 a
+SDict begin 13 H.A end
+ -2 526 a -2 526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2921) cvn H.B /DEST pdfmark
+end
+ -2
+526 a 396 604 a FC(In)20 b(the)g(subdirectory)1044 604
+y
+SDict begin H.S end
+ 1044 604 a 1044 604 a
+SDict begin 13 H.A end
+ 1044 604 a 1044 604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2922) cvn H.B /DEST pdfmark
+end
+ 1044 604
+a Fr(scripts/)g FC(of)f(the)i(source)e(directory)g(you)g(will)i(\002nd)
+f(a)g(Perl)h(script)3056 604 y
+SDict begin H.S end
+ 3056 604 a 3056 604 a
+SDict begin 13 H.A end
+
+3056 604 a 3056 604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2923) cvn H.B /DEST pdfmark
+end
+ 3056 604 a Fy(samhainadmin.pl)396
+712 y FC(to)g(f)o(acilitate)f(some)g(tasks)h(related)e(to)i(the)f
+(administration)e(of)i(signed)g(con\002guration)d(and)j(database)g
+(\002les)h(\(e.g.)396 820 y(e)o(xamine/create/remo)o(v)o(e)16
+b(signatures\).)j(By)h(def)o(ault,)g(this)g(script)g(is)2405
+820 y
+SDict begin H.S end
+ 2405 820 a 2405 820 a
+SDict begin 13 H.A end
+ 2405 820 a 2405 820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2924) cvn H.B /DEST pdfmark
+end
+ 2405
+820 a Fx(not)f(installed)r FC(.)-2 921 y
+SDict begin H.S end
+ -2 921 a -2
+921 a
+SDict begin 11.7 H.A end
+ -2 921 a -2 921 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2925) cvn H.B /DEST pdfmark
+end
+ -2 921 a -2 921 a
+SDict begin H.S end
+ -2 921 a -2
+921 a
+SDict begin 11.7 H.A end
+ -2 921 a -2 921 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2926) cvn H.B /DEST pdfmark
+end
+ -2 921 a 396 1000 a Ft(bash$)643
+1000 y
+SDict begin H.S end
+ 643 1000 a 643 1000 a
+SDict begin 11.7 H.A end
+ 643 1000 a 643 1000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2927) cvn H.B /DEST pdfmark
+end
+ 643
+1000 a Fs(samhainadmin.pl)45 b(--help)486 1097 y Fr(samhainadmin.pl)d
+({)j(-m)f(F)h(|)g(--sign-cfgfile)d(})269 b([options])43
+b([in.cfgfile])576 1195 y(Sign)h(the)g(configuration)f(file.)h(If)g
+(in.cfgfile)f(is)i(given,)f(sign)g(it)576 1292 y(and)g(install)g(it)g
+(as)h(configuration)d(file.)486 1486 y(samhainadmin.pl)g({)j(-m)f(f)h
+(|)g(--print-cfgfile)d(})224 b([options])576 1583 y(Print)44
+b(the)g(configuration)f(file)h(to)g(stdout.)g(Signatures)f(are)h
+(removed.)486 1777 y(samhainadmin.pl)e({)j(-m)f(D)h(|)g
+(--sign-datafile)d(})224 b([options])43 b([in.datafile])576
+1875 y(Sign)h(the)g(database)g(file.)g(If)g(in.datafile)f(is)i(given,)e
+(sign)i(it)576 1972 y(and)f(install)g(it)g(as)h(database)e(file.)486
+2166 y(samhainadmin.pl)f({)j(-m)f(d)h(|)g(--print-datafile)d(})179
+b([options])576 2263 y(Print)44 b(the)g(database)f(file)i(to)f(stdout.)
+g(Signatures)f(are)h(removed.)g(Use)576 2360 y(option)f(--list)h(to)h
+(list)f(files)g(in)g(database)g(rather)g(than)g(printing)f(the)i(raw)f
+(file.)486 2554 y(samhainadmin.pl)e({)j(-m)f(R)h(|)g
+(--remove-signature)d(})89 b([options])43 b(file1)h([file2)g(...])576
+2652 y(Remove)f(cleartext)h(signature)f(from)h(input)g(file\(s\).)g
+(The)g(file)576 2749 y(is)g(replaced)g(by)g(the)g(non-signed)g(file.)
+486 2943 y(samhainadmin.pl)e({)j(-m)f(E)h(|)g(--sign)f(})627
+b([options])43 b(file1)h([file2)g(...])576 3040 y(Sign)g(file\(s\))f
+(with)i(a)f(cleartext)g(signature.)f(The)h(file)576 3137
+y(is)g(replaced)g(by)g(the)g(signed)g(file.)486 3332
+y(samhainadmin.pl)e({)j(-m)f(e)h(|)g(--examine)e(})493
+b([options])43 b(file1)h([file2)g(...])576 3429 y(Report)f(signature)h
+(status)g(of)g(file\(s\).)486 3623 y(samhainadmin.pl)e({)j(-m)f(G)h(|)g
+(--generate-keys)d(})224 b([options])576 3720 y(Generate)43
+b(a)i(PGP)f(keypair)g(to)g(use)h(for)f(signing.)396 3914
+y(Options:)486 4012 y(-c)g(cfgfile)179 b(--cfgfile)43
+b(cfgfile)576 4109 y(Select)g(an)i(alternate)e(configuration)g(file.)
+486 4303 y(-d)h(datafile)134 b(--datafile)43 b(datafile)576
+4400 y(Select)g(an)i(alternate)e(database)h(file.)486
+4594 y(-p)g(passphrase)g(--passphrase)e(passphrase)576
+4691 y(Set)i(the)g(passphrase)f(for)i(gpg.)f(By)g(default,)g(gpg)g
+(will)g(ask.)486 4886 y(-l)538 b(--list)576 4983 y(List)44
+b(the)g(files)g(in)h(database)e(rather)h(than)g(printing)g(the)g(raw)g
+(file.)486 5177 y(-v)538 b(--verbose)576 5274 y(Verbose)43
+b(output.)p Black 3661 5805 a Fx(81)p Black eop end
+%%Page: 82 87
+TeXDict begin 82 86 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.82) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:STEALTHMODE) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(9.)f(Ad)n(ditional)i(Features)f(\227)g(Stealth)3335
+351 y
+SDict begin H.S end
+ 3335 351 a 3335 351 a
+SDict begin 26.957 H.A end
+ 3335 351 a 3335 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (11.0) cvn H.B /DEST pdfmark end
+ 3335
+351 a -2 607 a
+SDict begin H.S end
+ -2 607 a -2 607 a
+SDict begin 13 H.A end
+ -2 607 a -2 607 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2930) cvn H.B /DEST pdfmark
+end
+ -2
+607 a 396 679 a FC(If)20 b(an)g(intruder)f(does)h(not)g(kno)n(w)f(that)
+1503 679 y
+SDict begin H.S end
+ 1503 679 a 1503 679 a
+SDict begin 13 H.A end
+ 1503 679 a 1503 679
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2931) cvn H.B /DEST pdfmark
+end
+ 1503 679 a FC(samhain)h(is)h(running,)d(s/he)i(will)h(mak)o(e)f(no)g
+(attempt)f(to)i(sub)o(v)o(ert)d(it.)j(Hence,)396 787
+y(you)d(may)h(consider)f(to)h(run)1218 787 y
+SDict begin H.S end
+ 1218 787
+a 1218 787 a
+SDict begin 13 H.A end
+ 1218 787 a 1218 787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2932) cvn H.B /DEST pdfmark
+end
+ 1218 787 a FC(samhain)f(in)h
+(stealth)g(mode,)f(using)h(some)f(of)h(the)g(options)f(discussed)h(in)g
+(this)g(section.)-2 805 y
+SDict begin H.S end
+ -2 805 a -2 805 a
+SDict begin 13 H.A end
+ -2 805 a
+-2 805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HIDING-THE-EXECUTABLE) cvn
+H.B /DEST pdfmark end
+ -2 805 a 359 x Fu(9.1.)39 b(Hiding)f(the)h(e)n(x)o(ecutab)o
+(le)1758 1164 y
+SDict begin H.S end
+ 1758 1164 a 1758 1164 a
+SDict begin 22.464 H.A end
+ 1758 1164 a 1758
+1164 a
+SDict begin [ /View [/XYZ H.V] /Dest (11.65.1) cvn H.B /DEST pdfmark
+end
+ 1758 1164 a -2 1362 a
+SDict begin H.S end
+ -2 1362 a -2 1362 a
+SDict begin 13 H.A end
+ -2 1362
+a -2 1362 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2935) cvn H.B /DEST pdfmark
+end
+ -2 1362 a -2 1362 a
+SDict begin H.S end
+ -2 1362 a -2 1362 a
+SDict begin 13 H.A end
+ -2
+1362 a -2 1362 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2936) cvn H.B /DEST pdfmark
+end
+ -2 1362 a 396 1438 a FC(samhain)20 b(may)f(be)i
+(compiled)d(with)j(support)e(for)g(a)i(stealth)f(mode)f(of)h
+(operation,)e(meaning)h(that)h(the)h(program)396 1546
+y(can)f(be)g(run)f(without)h(an)o(y)f(ob)o(vious)f(trace)i(of)g(its)h
+(presence)e(on)h(disk.)f(The)h(follo)n(wing)e(compile-time)h(options)g
+(are)396 1654 y(pro)o(vided:)-2 1838 y
+SDict begin H.S end
+ -2 1838 a -2 1838
+a
+SDict begin 13 H.A end
+ -2 1838 a -2 1838 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2937) cvn H.B /DEST pdfmark
+end
+ -2 1838 a -2 1838 a
+SDict begin H.S end
+ -2 1838 a -2
+1838 a
+SDict begin 13 H.A end
+ -2 1838 a -2 1838 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2938) cvn H.B /DEST pdfmark
+end
+ -2 1838 a 396 1928 a Fy(--enable-stealth=)
+994 1928 y
+SDict begin H.S end
+ 994 1928 a 994 1928 a
+SDict begin 13 H.A end
+ 994 1928 a 994 1928
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2939) cvn H.B /DEST pdfmark
+end
+ 994 1928 a Fl(xor_val)f FC(pro)o(vides)g(the)j(follo)n(wing)d
+(measures:)-2 2112 y
+SDict begin H.S end
+ -2 2112 a -2 2112 a
+SDict begin 13 H.A end
+ -2 2112 a -2
+2112 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2940) cvn H.B /DEST pdfmark
+end
+ -2 2112 a -2 2112 a
+SDict begin H.S end
+ -2 2112 a -2 2112 a
+SDict begin 13 H.A end
+ -2 2112
+a -2 2112 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2941) cvn H.B /DEST pdfmark
+end
+ -2 2112 a -2 2122 a
+SDict begin H.S end
+ -2 2122 a -2 2122 a
+SDict begin 13 H.A end
+ -2
+2122 a -2 2122 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2942) cvn H.B /DEST pdfmark
+end
+ -2 2122 a Black 463 2264 a FC(1.)p Black
+546 2264 a
+SDict begin H.S end
+ 546 2264 a 546 2264 a
+SDict begin 13 H.A end
+ 546 2264 a 546 2264
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2943) cvn H.B /DEST pdfmark
+end
+ 546 2264 a FC(All)j(embedded)d(strings)i(are)g(obfuscated)e(by)i
+(XORing)g(them)g(with)g(some)g(v)n(alue)2935 2264 y
+SDict begin H.S end
+ 2935
+2264 a 2935 2264 a
+SDict begin 13 H.A end
+ 2935 2264 a 2935 2264 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2944) cvn H.B /DEST pdfmark
+end
+ 2935 2264
+a Fx(xor_val)f FC(chosen)h(at)546 2372 y(compile)f(time.)h(The)g(allo)n
+(wed)f(range)h(for)1777 2372 y
+SDict begin H.S end
+ 1777 2372 a 1777 2372
+a
+SDict begin 13 H.A end
+ 1777 2372 a 1777 2372 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2945) cvn H.B /DEST pdfmark
+end
+ 1777 2372 a Fx(xor_val)g FC(is)h(128)e(to)h
+(255.)-2 2390 y
+SDict begin H.S end
+ -2 2390 a -2 2390 a
+SDict begin 13 H.A end
+ -2 2390 a -2 2390
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2946) cvn H.B /DEST pdfmark
+end
+ -2 2390 a Black 463 2521 a FC(2.)p Black 546 2521 a
+SDict begin H.S end
+
+546 2521 a 546 2521 a
+SDict begin 13 H.A end
+ 546 2521 a 546 2521 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2947) cvn H.B /DEST pdfmark
+end
+ 546 2521
+a FC(The)g(messages)g(in)g(the)g(log)g(\002le)h(are)f(obfuscated)f(by)g
+(XORing)i(them)e(with)2755 2521 y
+SDict begin H.S end
+ 2755 2521 a 2755 2521
+a
+SDict begin 13 H.A end
+ 2755 2521 a 2755 2521 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2948) cvn H.B /DEST pdfmark
+end
+ 2755 2521 a Fx(xor_val)p FC(.)g(The)h(b)n
+(uilt-in)f(routine)546 2629 y(for)g(v)n(alidating)g(the)h(log)g(\002le)
+h(\()1418 2629 y
+SDict begin H.S end
+ 1418 2629 a 1418 2629 a
+SDict begin 13 H.A end
+ 1418 2629 a
+1418 2629 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2949) cvn H.B /DEST pdfmark
+end
+ 1418 2629 a Fy(samhain)f(-L)h(/path/to/log\002le)p
+FC(\))d(will)j(handle)e(this)i(transparently)-5 b(.)18
+b(Y)-9 b(ou)19 b(may)546 2737 y(specify)g(as)i(path)f(an)g(already)f(e)
+o(xisting)h(binary)e(\002le)j(\(e.g.)f(an)g(e)o(x)o(ecutable,)e(or)i(a)
+g(JPEG)h(image\),)e(to)h(which)546 2845 y(the)g(log)g(will)h(get)f
+(appended.)-2 2863 y
+SDict begin H.S end
+ -2 2863 a -2 2863 a
+SDict begin 11.7 H.A end
+ -2 2863 a -2
+2863 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2950) cvn H.B /DEST pdfmark
+end
+ -2 2863 a -2 2988 a
+SDict begin H.S end
+ -2 2988 a -2 2988 a
+SDict begin 11.7 H.A end
+ -2 2988
+a -2 2988 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2952) cvn H.B /DEST pdfmark
+end
+ -2 2988 a 712 3067 a Fw(TIP:)g Fv(Use)1027
+3067 y
+SDict begin H.S end
+ 1027 3067 a 1027 3067 a
+SDict begin 11.7 H.A end
+ 1027 3067 a 1027 3067
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2953) cvn H.B /DEST pdfmark
+end
+ 1027 3067 a Fw(samhain)f(-jL)h(/path/to/log\002le)d
+Fv(if)j(y)o(ou)g(just)g(w)o(ant)f(to)h(vie)o(w)g(r)o(ather)f(than)g(v)n
+(er)q(ify)i(the)e(log\002le)o(.)438 3407 y
+SDict begin H.S end
+ 438 3407 a
+438 3407 a
+SDict begin 13 H.A end
+ 438 3407 a 438 3407 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2954) cvn H.B /DEST pdfmark
+end
+ 438 3407 a Black 463
+3557 a FC(3.)p Black 546 3557 a
+SDict begin H.S end
+ 546 3557 a 546 3557 a
+SDict begin 13 H.A end
+
+546 3557 a 546 3557 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2955) cvn H.B /DEST pdfmark
+end
+ 546 3557 a FC(Strings)h(in)g(the)g(database)g
+(\002le)h(are)f(obfuscated)e(by)i(XORing)g(them)g(with)2706
+3557 y
+SDict begin H.S end
+ 2706 3557 a 2706 3557 a
+SDict begin 13 H.A end
+ 2706 3557 a 2706 3557
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2956) cvn H.B /DEST pdfmark
+end
+ 2706 3557 a Fx(xor_val)p FC(.)g(Y)-9 b(ou)19 b(may)h(append)e(the)546
+3665 y(database)h(\002le)i(to)g(some)f(binary)e(\002le)j(\(e.g.)f(an)g
+(e)o(x)o(ecutable,)e(or)i(a)g(JPEG)h(image\),)e(if)i(you)e(lik)o(e.)-2
+3683 y
+SDict begin H.S end
+ -2 3683 a -2 3683 a
+SDict begin 13 H.A end
+ -2 3683 a -2 3683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2957) cvn H.B /DEST pdfmark
+end
+ -2 3683
+a Black 463 3814 a FC(4.)p Black 546 3814 a
+SDict begin H.S end
+ 546 3814
+a 546 3814 a
+SDict begin 13 H.A end
+ 546 3814 a 546 3814 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2958) cvn H.B /DEST pdfmark
+end
+ 546 3814 a FC(The)h(con\002guration)
+d(\002le)k(must)f(be)g(ste)o(ganographically)d(hidden)h(in)j(a)f
+(postscript)g(image)g(\002le)g(\(the)g(image)546 3922
+y(data)g(must)g(be)g(uncompressed\).)d(T)-7 b(o)21 b(create)f(such)f(a)
+i(\002le)g(from)e(an)h(e)o(xisting)g(image,)f(you)g(may)h(use)g(e.g.)g
+(the)546 4030 y(program)848 4030 y
+SDict begin H.S end
+ 848 4030 a 848 4030
+a
+SDict begin 13 H.A end
+ 848 4030 a 848 4030 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2959) cvn H.B /DEST pdfmark
+end
+ 848 4030 a Fy(con)m(v)o(ert)p
+FC(,)f(which)g(is)i(part)f(of)g(the)1814 4030 y
+SDict begin H.S end
+ 1814
+4030 a 1814 4030 a
+SDict begin 13 H.A end
+ 1814 4030 a 1814 4030 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2960) cvn H.B /DEST pdfmark
+end
+ 1814 4030
+a FC(ImageMagick)e(package,)h(such)h(as)2872 4030 y
+SDict begin H.S end
+ 2872
+4030 a 2872 4030 a
+SDict begin 13 H.A end
+ 2872 4030 a 2872 4030 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2961) cvn H.B /DEST pdfmark
+end
+ 2872 4030
+a Fy(con)m(v)o(ert)f(+compr)o(ess)546 4138 y
+SDict begin H.S end
+ 546 4138
+a 546 4138 a
+SDict begin 13 H.A end
+ 546 4138 a 546 4138 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2962) cvn H.B /DEST pdfmark
+end
+ 546 4138 a Fl(ima.jpg)43
+b(ima.ps)q FC(.)-2 4148 y
+SDict begin H.S end
+ -2 4148 a -2 4148 a
+SDict begin 11.7 H.A end
+ -2 4148
+a -2 4148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2963) cvn H.B /DEST pdfmark
+end
+ -2 4148 a -2 4273 a
+SDict begin H.S end
+ -2 4273 a -2 4273 a
+SDict begin 11.7 H.A end
+ -2
+4273 a -2 4273 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2965) cvn H.B /DEST pdfmark
+end
+ -2 4273 a 712 4360 a Fw(TIP:)874 4360
+y
+SDict begin H.S end
+ 874 4360 a 874 4360 a
+SDict begin 11.7 H.A end
+ 874 4360 a 874 4360 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2966) cvn H.B /DEST pdfmark
+end
+ 874 4360
+a Fw(make)19 b(install)g Fv(will)h(do)g(this)g(automatically)d(bef)n
+(ore)i(installation.)-2 4675 y
+SDict begin H.S end
+ -2 4675 a -2 4675 a
+SDict begin 13 H.A end
+ -2
+4675 a -2 4675 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2967) cvn H.B /DEST pdfmark
+end
+ -2 4675 a 546 4783 a FC(T)-7 b(o)20
+b(hide/e)o(xtract)f(the)h(con\002guration)d(data)j(within/from)f(the)h
+(postscript)g(\002le,)g(a)h(utility)f(program)546 4891
+y
+SDict begin H.S end
+ 546 4891 a 546 4891 a
+SDict begin 13 H.A end
+ 546 4891 a 546 4891 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2968) cvn H.B /DEST pdfmark
+end
+ 546 4891
+a Fy(samhain_stealth)f FC(is)i(pro)o(vided.)d(Use)i(it)h(without)f
+(options)f(to)h(get)h(help.)-2 4909 y
+SDict begin H.S end
+ -2 4909 a -2 4909
+a
+SDict begin 11.7 H.A end
+ -2 4909 a -2 4909 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2969) cvn H.B /DEST pdfmark
+end
+ -2 4909 a -2 5033 a
+SDict begin H.S end
+ -2 5033 a -2
+5033 a
+SDict begin 11.7 H.A end
+ -2 5033 a -2 5033 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2971) cvn H.B /DEST pdfmark
+end
+ -2 5033 a 712 5113 a Fw(NO)m(TE:)f
+Fv(If)1024 5113 y
+SDict begin H.S end
+ 1024 5113 a 1024 5113 a
+SDict begin 11.7 H.A end
+ 1024 5113 a
+1024 5113 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2972) cvn H.B /DEST pdfmark
+end
+ 1024 5113 a Fw(--enab)o(le-stealth)c Fv(is)21
+b(used)f(together)e(with)2303 5113 y
+SDict begin H.S end
+ 2303 5113 a 2303
+5113 a
+SDict begin 11.7 H.A end
+ 2303 5113 a 2303 5113 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2973) cvn H.B /DEST pdfmark
+end
+ 2303 5113 a Fw(--with-gpg)p
+Fv(,)g(then)h(the)h(con\002g)g(\002le)g(m)o(ust)h(be)712
+5210 y(signed)e(bef)n(ore)f(hiding)g(it)i(\(r)o(ather)f(than)g(signing)
+g(the)h(PS)g(image)f(\002le)i(afterw)o(ards\).)p Black
+3661 5805 a Fx(82)p Black eop end
+%%Page: 83 88
+TeXDict begin 83 87 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.83) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2365 104 a
+Fx(Chapter)20 b(9.)g(Additional)f(F)-6 b(eatur)m(es)19
+b(\227)i(Stealth)p Black -2 624 a
+SDict begin H.S end
+ -2 624 a -2 624 a
+SDict begin 13 H.A end
+ -2
+624 a -2 624 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2974) cvn H.B /DEST pdfmark
+end
+ -2 624 a -2 624 a
+SDict begin H.S end
+ -2 624 a -2 624 a
+SDict begin 13 H.A end
+ -2
+624 a -2 624 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2975) cvn H.B /DEST pdfmark
+end
+ -2 624 a 396 732 a Fy(--enable-micr)o(o-stealth=)1229
+732 y
+SDict begin H.S end
+ 1229 732 a 1229 732 a
+SDict begin 13 H.A end
+ 1229 732 a 1229 732 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2976) cvn H.B /DEST pdfmark
+end
+ 1229
+732 a Fl(xor_val)c FC(is)k(lik)o(e)1781 732 y
+SDict begin H.S end
+ 1781 732
+a 1781 732 a
+SDict begin 13 H.A end
+ 1781 732 a 1781 732 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2977) cvn H.B /DEST pdfmark
+end
+ 1781 732 a Fy(--enable-stealth)p
+FC(,)d(b)n(ut)j(uses)f(a)h('normal')d(con\002guration)g(\002le)396
+840 y(\(not)i(hidden)f(ste)o(ganographically\).)-2 1024
+y
+SDict begin H.S end
+ -2 1024 a -2 1024 a
+SDict begin 13 H.A end
+ -2 1024 a -2 1024 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2978) cvn H.B /DEST pdfmark
+end
+ -2 1024 a -2
+1024 a
+SDict begin H.S end
+ -2 1024 a -2 1024 a
+SDict begin 13 H.A end
+ -2 1024 a -2 1024 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2979) cvn H.B /DEST pdfmark
+end
+ -2 1024
+a 396 1114 a Fy(--enable-nocl[=ARG])f FC(will)j(disables)f(command)f
+(line)h(parsing.)f(The)h(optional)f(ar)o(gument)e(is)22
+b(a)e('magic')f(w)o(ord)396 1222 y(that)i(will)f(enable)g(reading)f
+(command-line)e(ar)o(guments)h(from)2246 1222 y
+SDict begin H.S end
+ 2246
+1222 a 2246 1222 a
+SDict begin 13 H.A end
+ 2246 1222 a 2246 1222 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2980) cvn H.B /DEST pdfmark
+end
+ 2246 1222
+a Fx(stdin)p FC(.)i(If)g(the)h(\002rst)f(command-line)e(ar)o(gument)g
+(is)396 1330 y(not)i(the)g('magic')f(w)o(ord,)h(all)g(command)f(line)h
+(ar)o(guments)e(will)j(be)f(ignored.)e(This)j(allo)n(ws)f(to)g(start)h
+(the)f(program)396 1438 y(with)h(completely)d(arbitrary)h(command-line)
+e(ar)o(guments.)-2 1622 y
+SDict begin H.S end
+ -2 1622 a -2 1622 a
+SDict begin 13 H.A end
+ -2 1622
+a -2 1622 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2981) cvn H.B /DEST pdfmark
+end
+ -2 1622 a -2 1622 a
+SDict begin H.S end
+ -2 1622 a -2 1622 a
+SDict begin 13 H.A end
+ -2
+1622 a -2 1622 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2982) cvn H.B /DEST pdfmark
+end
+ -2 1622 a 396 1712 a Fy(--enable-install-name=)1197
+1712 y
+SDict begin H.S end
+ 1197 1712 a 1197 1712 a
+SDict begin 13 H.A end
+ 1197 1712 a 1197 1712
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2983) cvn H.B /DEST pdfmark
+end
+ 1197 1712 a Fl(NAME)24 b FC(will)d(rename)e(e)n(v)o(ery)f(installed)j
+(\002le)f(from)2629 1712 y
+SDict begin H.S end
+ 2629 1712 a 2629 1712 a
+SDict begin 13 H.A end
+ 2629
+1712 a 2629 1712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2984) cvn H.B /DEST pdfmark
+end
+ 2629 1712 a Fx(samhain)f FC(to)3016
+1712 y
+SDict begin H.S end
+ 3016 1712 a 3016 1712 a
+SDict begin 13 H.A end
+ 3016 1712 a 3016 1712
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2985) cvn H.B /DEST pdfmark
+end
+ 3016 1712 a Fx(N)n(AME)j FC(when)e(doing)f(a)396 1820
+y
+SDict begin H.S end
+ 396 1820 a 396 1820 a
+SDict begin 13 H.A end
+ 396 1820 a 396 1820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2986) cvn H.B /DEST pdfmark
+end
+ 396 1820
+a Fy(mak)o(e)i(install)f FC(\(standalone/client)f(installation\),)g
+(and)g(lik)o(e)n(wise)i(rename)e(installed)h(\002les)h(from)3240
+1820 y
+SDict begin H.S end
+ 3240 1820 a 3240 1820 a
+SDict begin 13 H.A end
+ 3240 1820 a 3240 1820
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2987) cvn H.B /DEST pdfmark
+end
+ 3240 1820 a Fx(yule)f FC(to)3485 1820 y
+SDict begin H.S end
+ 3485 1820 a
+3485 1820 a
+SDict begin 13 H.A end
+ 3485 1820 a 3485 1820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2988) cvn H.B /DEST pdfmark
+end
+ 3485 1820 a Fx(N)n(AME)396
+1928 y FC(when)g(doing)f(a)864 1928 y
+SDict begin H.S end
+ 864 1928 a 864
+1928 a
+SDict begin 13 H.A end
+ 864 1928 a 864 1928 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2989) cvn H.B /DEST pdfmark
+end
+ 864 1928 a Fy(mak)o(e)i(install)g
+FC(\(serv)o(er)e(installation\).)g(Also,)h(the)g(boot)g(scripts)g
+(\(samhain.startSuSE,)396 2036 y(samhain.startDebian,)e
+(samhain.startRedHat\))g(will)j(be)f(updated)f(accordingly)-5
+b(.)17 b(Files)k(created)f(by)3368 2036 y
+SDict begin H.S end
+ 3368 2036 a
+3368 2036 a
+SDict begin 13 H.A end
+ 3368 2036 a 3368 2036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2990) cvn H.B /DEST pdfmark
+end
+ 3368 2036 a FC(samhain)396
+2143 y(\(e.g.)g(the)g(database\))f(will)i(also)f(ha)n(v)o(e)1500
+2143 y
+SDict begin H.S end
+ 1500 2143 a 1500 2143 a
+SDict begin 13 H.A end
+ 1500 2143 a 1500 2143
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2991) cvn H.B /DEST pdfmark
+end
+ 1500 2143 a Fx(samhain)f FC(replaced)g(by)2208 2143
+y
+SDict begin H.S end
+ 2208 2143 a 2208 2143 a
+SDict begin 13 H.A end
+ 2208 2143 a 2208 2143 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2992) cvn H.B /DEST pdfmark
+end
+ 2208
+2143 a Fx(N)n(AME)j FC(in)f(their)f(\002lenames.)-2 2161
+y
+SDict begin H.S end
+ -2 2161 a -2 2161 a
+SDict begin 11.7 H.A end
+ -2 2161 a -2 2161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2993) cvn H.B /DEST pdfmark
+end
+ -2 2161 a -2
+2286 a
+SDict begin H.S end
+ -2 2286 a -2 2286 a
+SDict begin 11.7 H.A end
+ -2 2286 a -2 2286 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2995) cvn H.B /DEST pdfmark
+end
+ -2 2286
+a 562 2365 a Fw(TIP:)g Fv(The)g(man)g(pages)f(ha)o(v)n(e)h(f)n(ar)f
+(too)h(m)o(uch)h(speci\002c)f(inf)n(or)r(mation)d(enab)o(ling)g(an)j
+(intr)q(uder)e(to)i(inf)n(er)f(the)562 2462 y(presence)g(of)h(samhain.)
+f(There)g(is)i(no)f(point)f(in)h(changing)2278 2462 y
+SDict begin H.S end
+
+2278 2462 a 2278 2462 a
+SDict begin 11.7 H.A end
+ 2278 2462 a 2278 2462 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2996) cvn H.B /DEST pdfmark
+end
+ 2278
+2462 a Fq(samhain)g Fv(to)2665 2462 y
+SDict begin H.S end
+ 2665 2462 a 2665
+2462 a
+SDict begin 11.7 H.A end
+ 2665 2462 a 2665 2462 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2997) cvn H.B /DEST pdfmark
+end
+ 2665 2462 a Fq(NAME)28
+b Fv(there)19 b(\227)h(this)g(w)o(ould)f(r)o(ather)562
+2559 y(help)g(an)h(intr)q(uder)e(to)i(\002nd)h(out)e(what)1631
+2559 y
+SDict begin H.S end
+ 1631 2559 a 1631 2559 a
+SDict begin 11.7 H.A end
+ 1631 2559 a 1631 2559
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:2998) cvn H.B /DEST pdfmark
+end
+ 1631 2559 a Fq(NAME)28 b Fv(is)o(.)20 b(Y)-10 b(ou)19
+b(probab)o(ly)f(w)o(ant)h(to)i(a)o(v)n(oid)e(installing)e
+(man8/samhain.8)562 2657 y(and)j(man5/samhainrc.5.)39
+2806 y
+SDict begin H.S end
+ 39 2806 a 39 2806 a
+SDict begin 13 H.A end
+ 39 2806 a 39 2806 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KHIDE) cvn H.B /DEST pdfmark
+end
+ 39 2806
+a 396 3134 a Fp(9.1.1.)36 b(Using)e(kernel)g(modules)h(to)e(hide)h
+(samhain)i(\(Lin)o(ux/ix86)396 3290 y(onl)n(y\))679 3290
+y
+SDict begin H.S end
+ 679 3290 a 679 3290 a
+SDict begin 18.72 H.A end
+ 679 3290 a 679 3290 a
+SDict begin [ /View [/XYZ H.V] /Dest (11.65.34.2) cvn H.B /DEST pdfmark
+end
+ 679 3290
+a -2 3314 a
+SDict begin H.S end
+ -2 3314 a -2 3314 a
+SDict begin 11.7 H.A end
+ -2 3314 a -2 3314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3001) cvn H.B /DEST pdfmark
+end
+ -2
+3314 a -2 3439 a
+SDict begin H.S end
+ -2 3439 a -2 3439 a
+SDict begin 11.7 H.A end
+ -2 3439 a -2 3439
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3003) cvn H.B /DEST pdfmark
+end
+ -2 3439 a 562 3511 a Fw(Impor)q(tant:)20 b Fv(These)f(modules)h
+(modify)f(the)h(r)q(unning)e(k)o(er)r(nel.)g(Please)i(read)f(this)h
+(section)f(carefully)g(\(in)562 3608 y(par)s(ticular)f(the)i(ca)o(v)n
+(eats)g(noted)f(at)h(the)f(end\),)g(and)h(test)g(the)g(modules)f(bef)n
+(ore)f(installing.)f(Without)h(proper)562 3705 y(testing)h(it)h(ma)n(y)
+h(happen)d(that)h(y)o(ou)h(need)f(to)h(reboot)f(into)g(single)g(user)h
+(mode)g(to)g(remo)o(v)n(e)g(the)f(modules)g(and)562 3803
+y(to)h(mak)o(e)g(y)o(our)g(system)h(useab)o(le)d(again)h(...)-2
+4118 y
+SDict begin H.S end
+ -2 4118 a -2 4118 a
+SDict begin 13 H.A end
+ -2 4118 a -2 4118 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3004) cvn H.B /DEST pdfmark
+end
+ -2 4118
+a 396 4226 a FC(If)h(the)h(con\002gure)d(option)1162
+4226 y
+SDict begin H.S end
+ 1162 4226 a 1162 4226 a
+SDict begin 13 H.A end
+ 1162 4226 a 1162 4226
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3005) cvn H.B /DEST pdfmark
+end
+ 1162 4226 a Fy(--enable-khide=SYSTEM_MAP)j FC(is)g(used,)f(tw)o(o)g
+(\(pre-2.6)e(k)o(ernel\))h(or)h(one)g(\(2.6)396 4334
+y(k)o(ernel\))f(loadable)g(k)o(ernel)h(module\(s\))e(will)j(be)f(b)n
+(uilt.)g(These)g(are)g(named)2563 4334 y
+SDict begin H.S end
+ 2563 4334 a
+2563 4334 a
+SDict begin 13 H.A end
+ 2563 4334 a 2563 4334 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3006) cvn H.B /DEST pdfmark
+end
+ 2563 4334 a Fr(samhain_hide.o)42
+b(/)396 4442 y(samhain_erase.o)18 b FC(\(pre-2.6\))g(or)1493
+4442 y
+SDict begin H.S end
+ 1493 4442 a 1493 4442 a
+SDict begin 13 H.A end
+ 1493 4442 a 1493 4442
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3007) cvn H.B /DEST pdfmark
+end
+ 1493 4442 a Fr(samhain_hide.ko)g FC(\(2.6\).)-2 4626
+y
+SDict begin H.S end
+ -2 4626 a -2 4626 a
+SDict begin 13 H.A end
+ -2 4626 a -2 4626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3008) cvn H.B /DEST pdfmark
+end
+ -2 4626 a 396
+4716 a FC(SYSTEM_MAP)i(must)g(be)g(the)h(path)e(to)i(the)f(System.map)f
+(\002le)i(for)e(your)g(current)g(k)o(ernel)g(\(e.g.)396
+4824 y
+SDict begin H.S end
+ 396 4824 a 396 4824 a
+SDict begin 13 H.A end
+ 396 4824 a 396 4824 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3009) cvn H.B /DEST pdfmark
+end
+ 396
+4824 a Fr(/boot/System.map-rh-2.4.18-3)p FC(\).)1721
+4824 y
+SDict begin H.S end
+ 1721 4824 a 1721 4824 a
+SDict begin 13 H.A end
+ 1721 4824 a 1721 4824
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3010) cvn H.B /DEST pdfmark
+end
+ 1721 4824 a Fr(samhain_hide.o)f FC(will)j(hide)f(e)n(v)o(ery)f
+(\002le/directory/process)396 4932 y(with)i(the)f(string)g(N)m(AME)g
+(\(from)f(the)h(con\002gure)e(option)2058 4932 y
+SDict begin H.S end
+ 2058
+4932 a 2058 4932 a
+SDict begin 13 H.A end
+ 2058 4932 a 2058 4932 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3011) cvn H.B /DEST pdfmark
+end
+ 2058 4932
+a Fy(--enable-install-name=N)n(AME)p FC(\).)h(If)i(the)f(con\002gure)
+396 5040 y(option)629 5040 y
+SDict begin H.S end
+ 629 5040 a 629 5040 a
+SDict begin 13 H.A end
+ 629
+5040 a 629 5040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3012) cvn H.B /DEST pdfmark
+end
+ 629 5040 a Fy(--enable-install-name)f
+FC(is)i(not)f(used,)f(N)m(AME)i(is)g(set)g(to)2335 5040
+y
+SDict begin H.S end
+ 2335 5040 a 2335 5040 a
+SDict begin 13 H.A end
+ 2335 5040 a 2335 5040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3013) cvn H.B /DEST pdfmark
+end
+ 2335
+5040 a FC(samhain.)e(T)-7 b(o)21 b(hide)e(the)i(module)d(itself,)j(the)
+396 5148 y(second)f(module)917 5148 y
+SDict begin H.S end
+ 917 5148 a 917
+5148 a
+SDict begin 13 H.A end
+ 917 5148 a 917 5148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3014) cvn H.B /DEST pdfmark
+end
+ 917 5148 a Fr(samhain_erase.o)f
+FC(is)i(pro)o(vided.)c(Loading)i(and)g(immediately)g(thereafter)g
+(unloading)f(this)396 5255 y(module)h(will)i(hide)f(an)o(y)f(module)g
+(with)h(the)h(string)e(N)m(AME)i(in)f(its)h(name.)2558
+5255 y
+SDict begin H.S end
+ 2558 5255 a 2558 5255 a
+SDict begin 13 H.A end
+ 2558 5255 a 2558 5255
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3015) cvn H.B /DEST pdfmark
+end
+ 2558 5255 a Fy(mak)o(e)f(install)h FC(will)g(install)f(the)h(k)o
+(ernel)396 5363 y(modules)e(to)i(the)f(appropriate)e(place.)h(The)o(y)h
+(will)h(be)f(loaded)f(when)g(booting)g(into)h(runle)n(v)o(el)e(2,)i(3,)
+g(4,)g(or)g(5.)p Black 3661 5805 a Fx(83)p Black eop
+end
+%%Page: 84 89
+TeXDict begin 84 88 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.84) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3056) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2365 104 a Fx(Chapter)20
+b(9.)g(Additional)f(F)-6 b(eatur)m(es)19 b(\227)i(Stealth)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3016) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(W)m(ith)g(2.6)e(k)o(ernels,)h(only)f(one)h(k)o
+(ernel)f(module)1791 309 y
+SDict begin H.S end
+ 1791 309 a 1791 309 a
+SDict begin 13 H.A end
+ 1791
+309 a 1791 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3017) cvn H.B /DEST pdfmark
+end
+ 1791 309 a Fr(samhain_hide.ko)f FC(will)j(be)f(b)n
+(uild.)g(This)g(module)f(is)396 417 y(self-hiding,)g(i.e.)h(the)g
+(separate)1335 417 y
+SDict begin H.S end
+ 1335 417 a 1335 417 a
+SDict begin 13 H.A end
+ 1335 417 a
+1335 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3018) cvn H.B /DEST pdfmark
+end
+ 1335 417 a Fr(samhain_erase)e FC(module)h(is)i(not)f(needed)
+f(an)o(ymore.)f(Otherwise)i(it)h(w)o(orks)e(as)396 525
+y(described)g(abo)o(v)o(e.)f(Self-hiding)g(can)h(be)h(switched)f(of)n
+(f)g(by)h(passing)f(the)h(option)f(')l(remo)o(v)o(eme=0')c(to)20
+b(the)g(module:)396 632 y
+SDict begin H.S end
+ 396 632 a 396 632 a
+SDict begin 13 H.A end
+ 396 632
+a 396 632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3019) cvn H.B /DEST pdfmark
+end
+ 396 632 a Fy(insmod)h(./samhain_hide.k)o(o)f(r)o(emo)o(v)o
+(eme=0)-2 809 y
+SDict begin H.S end
+ -2 809 a -2 809 a
+SDict begin 13 H.A end
+ -2 809 a -2 809 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3020) cvn H.B /DEST pdfmark
+end
+ -2
+809 a 396 906 a FC(Building)g(a)g(linux)g(k)o(ernel)f(module)g
+(requires)g(a)i(proper)d(b)n(uild)i(en)m(vironment.)d(Y)-9
+b(ou)19 b(should)h(ha)n(v)o(e)f(a)i(link)396 1014 y
+SDict begin H.S end
+ 396
+1014 a 396 1014 a
+SDict begin 13 H.A end
+ 396 1014 a 396 1014 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3021) cvn H.B /DEST pdfmark
+end
+ 396 1014 a Fr
+(/lib/modules/`uname)42 b(-r`/build)19 b FC(which)h(points)g(to)g(a)h
+(functional)d(b)n(uild)i(en)m(vironment.)d(Usually)-5
+b(,)19 b(you)396 1122 y(need)h(to)g(install)h(the)f(k)o(ernel)f
+(sources)h(for)g(your)f(k)o(ernel,)g(and)g(e)n(v)o(entually)g(\(if)h
+(compiling)e(the)j(modules)e(f)o(ails\))h(you)396 1230
+y(may)g(need)f(to)i(con\002gure)d(the)i(k)o(ernel)g(source)f(for)h
+(your)f(k)o(ernel:)-2 1331 y
+SDict begin H.S end
+ -2 1331 a -2 1331 a
+SDict begin 11.7 H.A end
+ -2 1331
+a -2 1331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3022) cvn H.B /DEST pdfmark
+end
+ -2 1331 a 486 1410 a
+SDict begin H.S end
+ 486 1410 a 486 1410
+a
+SDict begin 11.7 H.A end
+ 486 1410 a 486 1410 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3023) cvn H.B /DEST pdfmark
+end
+ 486 1410 a Ft(sh$)647 1410 y
+SDict begin H.S end
+
+647 1410 a 647 1410 a
+SDict begin 11.7 H.A end
+ 647 1410 a 647 1410 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3024) cvn H.B /DEST pdfmark
+end
+ 647 1410
+a Fs(cd)41 b(/your/kernel/sourc)q(e/d)q(ire)q(cto)q(ry)486
+1508 y
+SDict begin H.S end
+ 486 1508 a 486 1508 a
+SDict begin 11.7 H.A end
+ 486 1508 a 486 1508 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3025) cvn H.B /DEST pdfmark
+end
+ 486
+1508 a Ft(sh$)647 1508 y
+SDict begin H.S end
+ 647 1508 a 647 1508 a
+SDict begin 11.7 H.A end
+ 647 1508
+a 647 1508 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3026) cvn H.B /DEST pdfmark
+end
+ 647 1508 a Fs(make)h(mrproper)486 1605 y
+SDict begin H.S end
+
+486 1605 a 486 1605 a
+SDict begin 11.7 H.A end
+ 486 1605 a 486 1605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3027) cvn H.B /DEST pdfmark
+end
+ 486 1605
+a Ft(sh$)647 1605 y
+SDict begin H.S end
+ 647 1605 a 647 1605 a
+SDict begin 11.7 H.A end
+ 647 1605 a
+647 1605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3028) cvn H.B /DEST pdfmark
+end
+ 647 1605 a Fs(make)g(cloneconfig)486 1702
+y
+SDict begin H.S end
+ 486 1702 a 486 1702 a
+SDict begin 11.7 H.A end
+ 486 1702 a 486 1702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3029) cvn H.B /DEST pdfmark
+end
+ 486 1702
+a Ft(sh$)647 1702 y
+SDict begin H.S end
+ 647 1702 a 647 1702 a
+SDict begin 11.7 H.A end
+ 647 1702 a
+647 1702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3030) cvn H.B /DEST pdfmark
+end
+ 647 1702 a Fs(make)g(dep)k Fr(\(obsolete)d(for)i(2.6\))486
+1799 y
+SDict begin H.S end
+ 486 1799 a 486 1799 a
+SDict begin 11.7 H.A end
+ 486 1799 a 486 1799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3031) cvn H.B /DEST pdfmark
+end
+ 486
+1799 a Ft(sh$)647 1799 y
+SDict begin H.S end
+ 647 1799 a 647 1799 a
+SDict begin 11.7 H.A end
+ 647 1799
+a 647 1799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3032) cvn H.B /DEST pdfmark
+end
+ 647 1799 a Fs(make)d(modules)47 b Fr(\(only)d(for)h(2.6\))
+486 1896 y
+SDict begin H.S end
+ 486 1896 a 486 1896 a
+SDict begin 11.7 H.A end
+ 486 1896 a 486 1896
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3033) cvn H.B /DEST pdfmark
+end
+ 486 1896 a Ft(sh$)647 1896 y
+SDict begin H.S end
+ 647 1896 a 647 1896 a
+SDict begin 11.7 H.A end
+
+647 1896 a 647 1896 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3034) cvn H.B /DEST pdfmark
+end
+ 647 1896 a Fs(cd)c(/lib/modules/`unam)q(e)46
+b(-r`)486 1993 y
+SDict begin H.S end
+ 486 1993 a 486 1993 a
+SDict begin 11.7 H.A end
+ 486 1993 a 486
+1993 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3035) cvn H.B /DEST pdfmark
+end
+ 486 1993 a Ft(sh$)647 1993 y
+SDict begin H.S end
+ 647 1993 a 647 1993
+a
+SDict begin 11.7 H.A end
+ 647 1993 a 647 1993 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3036) cvn H.B /DEST pdfmark
+end
+ 647 1993 a Fs(ln)41 b(-s)g(/your/kernel/sourc)q
+(e/d)q(ire)q(cto)q(ry)47 b(build)-2 2090 y
+SDict begin H.S end
+ -2 2090 a
+-2 2090 a
+SDict begin 11.7 H.A end
+ -2 2090 a -2 2090 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3037) cvn H.B /DEST pdfmark
+end
+ -2 2090 a 745 2190 2668
+17 v 745 3078 17 889 v 1673 2385 a Fp(CA)-10 b(VEA)f(T)34
+b(NO)-5 b(.)34 b(1)786 2553 y
+SDict begin H.S end
+ 786 2553 a 786 2553 a
+SDict begin 11.7 H.A end
+ 786
+2553 a 786 2553 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3039) cvn H.B /DEST pdfmark
+end
+ 786 2553 a 95 x Fv(The)20 b(modules)f(are)h(k)o(er)r
+(nel-speci\002c)o(,)e(and)2032 2648 y
+SDict begin H.S end
+ 2032 2648 a 2032
+2648 a
+SDict begin 11.7 H.A end
+ 2032 2648 a 2032 2648 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3040) cvn H.B /DEST pdfmark
+end
+ 2032 2648 a Fq(MUST)30
+b Fv(be)20 b(recompiled)e(whene)n(v)n(er)h(the)786 2745
+y(currently)h(used)f(k)o(er)r(nel)g(is)i(recompiled)d(or)i(replaced)e
+(b)o(y)j(another)d(one)h(\(e)n(v)n(en)h(if)g(the)786
+2843 y(k)o(er)r(nel)f(v)n(ersion)h(is)h(identical\).)c(F)l(ailure)h(to)
+i(do)g(so)h(might)e(lead)g(to)i(a)f(k)o(er)r(nel)e(panic.)i(The)786
+2940 y(same)h(is)g(tr)q(ue)e(if)h(the)1398 2940 y
+SDict begin H.S end
+ 1398
+2940 a 1398 2940 a
+SDict begin 11.7 H.A end
+ 1398 2940 a 1398 2940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3041) cvn H.B /DEST pdfmark
+end
+ 1398 2940
+a Ft(System.map)k Fv(that)c(y)o(ou)f(ha)o(v)n(e)h(speci\002ed)f(is)i
+(not)f(the)f(one)786 3037 y(corresponding)f(to)i(y)o(our)f(current)h(k)
+o(er)r(nel.)p 3396 3078 17 889 v 745 3095 2668 17 v -2
+3105 a
+SDict begin H.S end
+ -2 3105 a -2 3105 a
+SDict begin 11.7 H.A end
+ -2 3105 a -2 3105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3042) cvn H.B /DEST pdfmark
+end
+ -2 3105
+a 745 3205 2668 17 v 745 4183 17 978 v 1673 3400 a Fp(CA)-10
+b(VEA)f(T)34 b(NO)-5 b(.)34 b(2)786 3568 y
+SDict begin H.S end
+ 786 3568 a
+786 3568 a
+SDict begin 11.7 H.A end
+ 786 3568 a 786 3568 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3044) cvn H.B /DEST pdfmark
+end
+ 786 3568 a 95 x Fv(When)19
+b(the)1127 3663 y
+SDict begin H.S end
+ 1127 3663 a 1127 3663 a
+SDict begin 11.7 H.A end
+ 1127 3663 a
+1127 3663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3045) cvn H.B /DEST pdfmark
+end
+ 1127 3663 a Ft(samhain_hide)25 b Fv(module)19
+b(is)h(hidden,)e(the)i(k)o(er)r(nel)f(doesn't)f(kno)o(w)i(an)o(ymore)
+786 3760 y(about)f(its)i(e)n(xistence)o(,)d(thus)i(it)h(cannot)e(be)h
+(remo)o(v)n(ed)f(e)n(xcept)h(b)o(y)g(rebooting.)d(On)j(pre-2.6)786
+3858 y(k)o(er)r(nels)o(,)f(hiding)f(the)1413 3858 y
+SDict begin H.S end
+ 1413
+3858 a 1413 3858 a
+SDict begin 11.7 H.A end
+ 1413 3858 a 1413 3858 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3046) cvn H.B /DEST pdfmark
+end
+ 1413 3858
+a Ft(samhain_hide.o)25 b Fv(module)19 b(requires)g(loading/unloadi)o
+(ng)14 b(the)786 3955 y
+SDict begin H.S end
+ 786 3955 a 786 3955 a
+SDict begin 11.7 H.A end
+ 786 3955
+a 786 3955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3047) cvn H.B /DEST pdfmark
+end
+ 786 3955 a Ft(samhain_erase.o)26 b Fv(module)o(.)19
+b(On)h(2.6)g(k)o(er)r(nels)o(,)f(the)2349 3955 y
+SDict begin H.S end
+ 2349
+3955 a 2349 3955 a
+SDict begin 11.7 H.A end
+ 2349 3955 a 2349 3955 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3048) cvn H.B /DEST pdfmark
+end
+ 2349 3955
+a Ft(samhain_hide.ko)26 b Fv(module)19 b(will)786 4052
+y(automatically)f(hide)h(itself)h(after)f(loading,)e(EXCEPT)j(if)g(y)o
+(ou)g(pass)g(the)g(option)786 4149 y(')l(remo)o(v)n(eme=0')f(to)h(the)f
+(module:)1766 4149 y
+SDict begin H.S end
+ 1766 4149 a 1766 4149 a
+SDict begin 11.7 H.A end
+ 1766 4149
+a 1766 4149 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3049) cvn H.B /DEST pdfmark
+end
+ 1766 4149 a Fw(insmod)h(./samhain_hide)q(.k)o(o)15
+b(remo)o(veme=0)p 3396 4183 17 978 v 745 4199 2668 17
+v -2 4210 a
+SDict begin H.S end
+ -2 4210 a -2 4210 a
+SDict begin 11.7 H.A end
+ -2 4210 a -2 4210 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3050) cvn H.B /DEST pdfmark
+end
+ -2
+4210 a Black 3661 5805 a Fx(84)p Black eop end
+%%Page: 85 90
+TeXDict begin 85 89 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.85) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2365 104 a
+Fx(Chapter)20 b(9.)g(Additional)f(F)-6 b(eatur)m(es)19
+b(\227)i(Stealth)p Black 745 242 2668 17 v 745 1588 17
+1346 v 898 437 a Fp(CA)-10 b(VEA)f(T)34 b(NO)-5 b(.)35
+b(3)e(-)g(Impor)r(tant)h(Lin)o(ux)g(2.6)g(issue)786 628
+y
+SDict begin H.S end
+ 786 628 a 786 628 a
+SDict begin 11.7 H.A end
+ 786 628 a 786 628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3052) cvn H.B /DEST pdfmark
+end
+ 786 628 a 73
+x Fv(The)20 b(stealth)f(module)g(b)o(uilds)f(\002ne)i(on)g(Lin)o(ux)g
+(2.6)f(\(if)h(the)g(b)o(uild)e(system)k(is)e(proper)q(ly)786
+798 y(con\002gured)f(\227)i(see)f(abo)o(v)n(e\).)f(It)h(w)o(as)h
+(tested)e(on)h(tw)o(o)g(systems:)i(2.6.5-7.104-smp)786
+895 y(\(SuSE)e(9.1\))g(and)f(2.6.6)g(\(no)h(SMP\).)g(It)g(only)g(w)o
+(or)q(k)o(ed)g(on)g(the)f(latter)g(system,)i(while)e(the)786
+992 y(\002rst)j(one)d(w)o(as)i(rendered)c(un)o(useab)o(le)h(\(ls)i(and)
+g(ps)g(didn't)f(w)o(or)q(k)h(an)o(ymore\).)f(Not)h(sure)786
+1089 y(about)f(the)h(reason.)786 1256 y
+SDict begin H.S end
+ 786 1256 a 786
+1256 a
+SDict begin 11.7 H.A end
+ 786 1256 a 786 1256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3053) cvn H.B /DEST pdfmark
+end
+ 786 1256 a 96 x Fv(Because)g(on)g(2.6)f
+(the)h(module)f(will)g(b)o(y)i(def)n(ault)c(automatically)h(hide)h
+(itself)n(,)g(and)g(cannot)786 1449 y(be)h(remo)o(v)n(ed)g(then)f(\(e)n
+(xcept)g(b)o(y)i(rebooting\),)c(y)o(ou)i(should)2485
+1449 y
+SDict begin H.S end
+ 2485 1449 a 2485 1449 a
+SDict begin 11.7 H.A end
+ 2485 1449 a 2485 1449
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3054) cvn H.B /DEST pdfmark
+end
+ 2485 1449 a Fq(TEST)30 b Fv(the)20 b(module)f(with)g(the)786
+1547 y(option)g(')l(remo)o(v)n(eme=0',)f(lik)o(e)h(e)o(.g.:)1813
+1547 y
+SDict begin H.S end
+ 1813 1547 a 1813 1547 a
+SDict begin 11.7 H.A end
+ 1813 1547 a 1813 1547
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3055) cvn H.B /DEST pdfmark
+end
+ 1813 1547 a Fw(insmod)h(./samhain_hide)q(.k)o(o)c(remo)o(veme=0)p
+3396 1588 17 1346 v 745 1605 2668 17 v -2 1615 a
+SDict begin H.S end
+ -2 1615
+a -2 1615 a
+SDict begin 11.7 H.A end
+ -2 1615 a -2 1615 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3056) cvn H.B /DEST pdfmark
+end
+ -2 1615 a -2 1781 a
+SDict begin H.S end
+ -2
+1781 a -2 1781 a
+SDict begin 11.7 H.A end
+ -2 1781 a -2 1781 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3058) cvn H.B /DEST pdfmark
+end
+ -2 1781 a 562 1836
+a Fw(TIP:)k Fv(Hidden)f(\002les)h(can)h(still)e(be)h(accessed)g(if)h
+(their)e(names)h(are)f(kno)o(wn,)h(thus)g(using)f(the)h(option)562
+1933 y
+SDict begin H.S end
+ 562 1933 a 562 1933 a
+SDict begin 11.7 H.A end
+ 562 1933 a 562 1933 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3059) cvn H.B /DEST pdfmark
+end
+ 562
+1933 a Fw(--enab)o(le-install-name)c Fv(to)k(rename)f(installed)f
+(\002les)i(is)h(recommended)d(f)n(or)i(secur)q(ity)-7
+b(.)39 2072 y
+SDict begin H.S end
+ 39 2072 a 39 2072 a
+SDict begin 11.7 H.A end
+ 39 2072 a 39 2072 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3060) cvn H.B /DEST pdfmark
+end
+
+39 2072 a -2 2238 a
+SDict begin H.S end
+ -2 2238 a -2 2238 a
+SDict begin 11.7 H.A end
+ -2 2238 a -2
+2238 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3062) cvn H.B /DEST pdfmark
+end
+ -2 2238 a 562 2335 a Fw(TIP:)20 b Fv(Using)g(the)g(modules)f(at)
+h(system)h(boot)e(ma)n(y)i(cause)f(prob)o(lems)f(with)g(the)h(GNOME)h
+(\(1.2\))3332 2335 y
+SDict begin H.S end
+ 3332 2335 a 3332 2335 a
+SDict begin 11.7 H.A end
+ 3332 2335
+a 3332 2335 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3063) cvn H.B /DEST pdfmark
+end
+ 3332 2335 a Fw(gdm)g Fv(displa)n(y)562
+2432 y(manager)e(\(seen)h(on)f(SuSE)h(7.4)g(with)g(the)f(Ximian)g
+(desktop;)g(no)h(prob)o(lems)f(obser)r(v)n(ed)g(with)h(kdm\).)g(In)h
+(case)562 2529 y(of)f(prob)o(lems)o(,)f(y)o(ou)g(ma)n(y)i(need)e(to)h
+(reboot)f(into)g(single-user)f(mode)i(and)f(edit)g(the)h(boot)f(init)g
+(scr)q(ipt)i(...)-2 2845 y
+SDict begin H.S end
+ -2 2845 a -2 2845 a
+SDict begin 13 H.A end
+ -2 2845
+a -2 2845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PACKING-THE-EXECUTABLE) cvn
+H.B /DEST pdfmark end
+ -2 2845 a 377 x Fu(9.2.)39 b(P)l(ac)m(king)f(the)h(e)n(x)o
+(ecutab)o(le)1855 3222 y
+SDict begin H.S end
+ 1855 3222 a 1855 3222 a
+SDict begin 22.464 H.A end
+ 1855
+3222 a 1855 3222 a
+SDict begin [ /View [/XYZ H.V] /Dest (11.66.1) cvn H.B /DEST pdfmark
+end
+ 1855 3222 a -2 3420 a
+SDict begin H.S end
+ -2 3420 a -2
+3420 a
+SDict begin 13 H.A end
+ -2 3420 a -2 3420 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3066) cvn H.B /DEST pdfmark
+end
+ -2 3420 a 396 3496 a FC(F)o(or)20
+b(e)n(v)o(en)f(more)h(stealthyness,)f(it)i(is)g(possible)f(to)g(pack)g
+(and)f(encrypt)g(the)2570 3496 y
+SDict begin H.S end
+ 2570 3496 a 2570 3496
+a
+SDict begin 13 H.A end
+ 2570 3496 a 2570 3496 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3067) cvn H.B /DEST pdfmark
+end
+ 2570 3496 a FC(samhain)h(e)o(x)o(ecutable.)e
+(The)i(pack)o(er)f(is)396 3604 y(just)i(moderately)d(ef)n(fecti)n(v)o
+(e,)h(b)n(ut)h(portable.)f(Note)h(that)g(the)g(encryption)e(k)o(e)o(y)i
+(of)f(course)h(must)g(be)g(present)g(in)g(the)396 3712
+y(pack)o(ed)f(e)o(x)o(ecutable,)f(thus)i(this)h(is)g(no)f(secure)g
+(encryption,)d(b)n(ut)k(rather)e(is)i(intended)e(for)g(obfuscation)g
+(of)g(the)396 3820 y(e)o(x)o(ecutable.)f(There)i(is)h(a)f(mak)o(e)g
+(tar)o(get)f(for)h(packing)f(the)2070 3820 y
+SDict begin H.S end
+ 2070 3820
+a 2070 3820 a
+SDict begin 13 H.A end
+ 2070 3820 a 2070 3820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3068) cvn H.B /DEST pdfmark
+end
+ 2070 3820 a FC(samhain)g(e)o(x)o
+(ecutable:)-2 4004 y
+SDict begin H.S end
+ -2 4004 a -2 4004 a
+SDict begin 13 H.A end
+ -2 4004 a -2
+4004 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3069) cvn H.B /DEST pdfmark
+end
+ -2 4004 a -2 4004 a
+SDict begin H.S end
+ -2 4004 a -2 4004 a
+SDict begin 13 H.A end
+ -2 4004
+a -2 4004 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3070) cvn H.B /DEST pdfmark
+end
+ -2 4004 a 396 4094 a Fy(mak)o(e)i(samhain.pk)-2
+4277 y
+SDict begin H.S end
+ -2 4277 a -2 4277 a
+SDict begin 13 H.A end
+ -2 4277 a -2 4277 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3071) cvn H.B /DEST pdfmark
+end
+ -2 4277
+a 396 4368 a FC(On)f(e)o(x)o(ecution,)880 4368 y
+SDict begin H.S end
+ 880
+4368 a 880 4368 a
+SDict begin 13 H.A end
+ 880 4368 a 880 4368 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3072) cvn H.B /DEST pdfmark
+end
+ 880 4368 a Fy(samhain.pk)h
+FC(will)g(unpack)d(into)i(a)h(temporary)d(\002le)j(and)e(e)o(x)o(ecute)
+g(this,)i(passing)f(along)f(all)396 4476 y(command)f(line)j(ar)o
+(guments.)d(The)h(temporary)f(\002le)j(is)g(created)f(in)2336
+4476 y
+SDict begin H.S end
+ 2336 4476 a 2336 4476 a
+SDict begin 13 H.A end
+ 2336 4476 a 2336 4476
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3073) cvn H.B /DEST pdfmark
+end
+ 2336 4476 a Fr(/tmp)p FC(,)g(if)h(the)f(stick)o(y)g(bit)g(is)h(set)g
+(on)f(this)396 4584 y(directory)-5 b(,)18 b(and)i(in)958
+4584 y
+SDict begin H.S end
+ 958 4584 a 958 4584 a
+SDict begin 13 H.A end
+ 958 4584 a 958 4584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3074) cvn H.B /DEST pdfmark
+end
+ 958
+4584 a Fr(/usr/bin)f FC(otherwise.)h(The)g(\002lename)f(is)i(chosen)f
+(at)g(random,)f(and)g(the)h(\002le)h(is)g(only)f(opened)396
+4691 y(if)h(it)g(does)f(not)f(e)o(xist)i(already)e(\(otherwise)g(a)i
+(ne)n(w)f(random)e(\002lename)i(will)h(be)f(tried\).)f(The)h(\002le)h
+(permission)e(is)i(set)396 4799 y(to)g(700.)-2 4966 y
+SDict begin H.S end
+
+-2 4966 a -2 4966 a
+SDict begin 13 H.A end
+ -2 4966 a -2 4966 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3075) cvn H.B /DEST pdfmark
+end
+ -2 4966 a 396
+5073 a FC(The)f(directory)f(entry)g(for)h(the)g(unpack)o(ed)e(e)o(x)o
+(ecutable)g(will)j(be)f(deleted)g(after)f(e)o(x)o(ecuting)g(it,)h(b)n
+(ut)g(on)g(systems)396 5181 y(with)h(a)622 5181 y
+SDict begin H.S end
+ 622
+5181 a 622 5181 a
+SDict begin 13 H.A end
+ 622 5181 a 622 5181 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3076) cvn H.B /DEST pdfmark
+end
+ 622 5181 a Fr(/proc)f
+FC(\002lesystem,)g(the)h(deleted)e(entry)g(may)h(sho)n(w)g(up)g(there.)
+f(In)h(particular)m(,)f(this)h(is)h(the)g(case)f(for)396
+5289 y(Linux.)f(Y)-9 b(ou)20 b(should)f(be)h(a)o(w)o(are)g(that)g(this)
+h(may)f(raise)g(suspicion.)p Black 3661 5805 a Fx(85)p
+Black eop end
+%%Page: 86 91
+TeXDict begin 86 90 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.86) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2365 104 a
+Fx(Chapter)20 b(9.)g(Additional)f(F)-6 b(eatur)m(es)19
+b(\227)i(Stealth)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2
+226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3077) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(On)f(Linux,)f(the)881
+309 y
+SDict begin H.S end
+ 881 309 a 881 309 a
+SDict begin 13 H.A end
+ 881 309 a 881 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3078) cvn H.B /DEST pdfmark
+end
+ 881 309
+a Fr(/proc)g FC(\002lesystem)i(is)g(used)f(to)g(call)h(the)f(unpack)o
+(ed)e(e)o(x)o(ecutable)h(without)g(a)i(race)f(condition,)e(by)396
+417 y(e)o(x)o(ecuting)737 417 y
+SDict begin H.S end
+ 737 417 a 737 417 a
+SDict begin 13 H.A end
+ 737
+417 a 737 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3079) cvn H.B /DEST pdfmark
+end
+ 737 417 a Fr(/proc/self/fd/NN)p FC(,)g(where)i(NN)g(is)
+h(the)g(\002le)g(descriptor)d(to)j(which)e(the)i(unpack)o(ed)d(e)o(x)o
+(ecutable)396 525 y(has)j(been)e(written.)h(On)g(other)f(systems,)i
+(the)f(\002lename)g(of)g(the)g(unpack)o(ed)e(e)o(x)o(ecutable)g(must)i
+(be)h(used,)e(which)396 632 y(creates)h(a)h(race)f(condition)e(\(the)i
+(\002le)h(may)f(be)g(modi\002ed)f(between)g(creation)h(and)f(e)o(x)o
+(ecution\).)-2 817 y
+SDict begin H.S end
+ -2 817 a -2 817 a
+SDict begin 13 H.A end
+ -2 817 a -2 817
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3080) cvn H.B /DEST pdfmark
+end
+ -2 817 a 396 906 a FC(The)h(pack)o(ed)f(e)o(x)o(ecutable)f(will)j
+(not)f(honour)e(the)i(SUID)h(bit.)p Black 3660 5805 a
+Fx(86)p Black eop end
+%%Page: 87 92
+TeXDict begin 87 91 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.87) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOYMENT) cvn H.B /DEST pdfmark
+end
+ -2 226 a 125 x
+Fz(Chapter)48 b(10.)f(Deplo)m(yment)h(to)g(remote)g(hosts)3304
+351 y
+SDict begin H.S end
+ 3304 351 a 3304 351 a
+SDict begin 26.957 H.A end
+ 3304 351 a 3304 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.0) cvn H.B /DEST pdfmark end
+ 3304
+351 a -2 441 a
+SDict begin H.S end
+ -2 441 a -2 441 a
+SDict begin 13 H.A end
+ -2 441 a -2 441 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY.SH) cvn H.B /DEST pdfmark
+end
+ -2
+441 a 341 x Fu(10.1.)39 b(Method)f(A:)h(The)g(deplo)m(yment)e(system)
+2731 782 y
+SDict begin H.S end
+ 2731 782 a 2731 782 a
+SDict begin 22.464 H.A end
+ 2731 782 a 2731 782
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.1) cvn H.B /DEST pdfmark
+end
+ 2731 782 a -2 978 a
+SDict begin H.S end
+ -2 978 a -2 978 a
+SDict begin 13 H.A end
+ -2 978 a -2 978
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3085) cvn H.B /DEST pdfmark
+end
+ -2 978 a -2 978 a
+SDict begin H.S end
+ -2 978 a -2 978 a
+SDict begin 13 H.A end
+ -2 978 a -2 978
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3086) cvn H.B /DEST pdfmark
+end
+ -2 978 a 396 1056 a FC(samhain)20 b(includes)f(a)i(system)f(to)h(f)o
+(acilitate)f(deplo)o(yment)e(of)i(the)g(client)g(to)h(remote)e(hosts.)h
+(This)g(system)h(enables)396 1164 y(you)f(to:)g(b)n(uild)g(and)f(store)
+i(binary)d(packages)h(for)h(dif)n(ferent)f(operating)f(systems,)i
+(install)h(them,)f(create)g(baseline)396 1272 y(databases)g(upon)f
+(installation,)g(update)h(the)g(serv)o(er)f(con\002guration,)e(and)j
+(maintain)f(the)i(client)f(database)396 1380 y(required)f(by)g(the)920
+1380 y
+SDict begin H.S end
+ 920 1380 a 920 1380 a
+SDict begin 13 H.A end
+ 920 1380 a 920 1380 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3087) cvn H.B /DEST pdfmark
+end
+ 920
+1380 a FC(beltane)g(web-based)g(console.)-2 1564 y
+SDict begin H.S end
+ -2
+1564 a -2 1564 a
+SDict begin 13 H.A end
+ -2 1564 a -2 1564 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3088) cvn H.B /DEST pdfmark
+end
+ -2 1564 a 396 1654
+a FC(The)h(system)h(comprises)e(a)i(shell)f(script)1595
+1654 y
+SDict begin H.S end
+ 1595 1654 a 1595 1654 a
+SDict begin 13 H.A end
+ 1595 1654 a 1595 1654
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3089) cvn H.B /DEST pdfmark
+end
+ 1595 1654 a Fy(deploy)-6 b(.sh)21 b FC(that)f(will)h(be)f(installed)g
+(in)h(the)f(same)g(directory)f(as)i(the)396 1762 y
+SDict begin H.S end
+ 396
+1762 a 396 1762 a
+SDict begin 13 H.A end
+ 396 1762 a 396 1762 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3090) cvn H.B /DEST pdfmark
+end
+ 396 1762 a FC(samhain/yule)e
+(\(by)g(def)o(ault,)1262 1762 y
+SDict begin H.S end
+ 1262 1762 a 1262 1762
+a
+SDict begin 13 H.A end
+ 1262 1762 a 1262 1762 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3091) cvn H.B /DEST pdfmark
+end
+ 1262 1762 a Fr(/usr/local/sbin)p
+FC(\),)f(and)i(a)g(directory)f(tree)h(that)g(will)h(be)f(installed)g
+(belo)n(w)g(the)396 1870 y
+SDict begin H.S end
+ 396 1870 a 396 1870 a
+SDict begin 13 H.A end
+ 396
+1870 a 396 1870 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3092) cvn H.B /DEST pdfmark
+end
+ 396 1870 a FC(samhain/yule)f(data)h(directory)e
+(\(see)p 0 TeXcolorgray 1494 1870 a
+SDict begin H.S end
+ 1494 1870 a FC(Section)i(10.1.2)
+1974 1870 y
+SDict begin 13 H.L end
+ 1974 1870 a 1974 1870 a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOY-LAYOUT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1974 1870 a Black
+-3 w FC(>\).)g(The)g(script)g(and)g(the)g(directory)e(tree)j(can)f(be)g
+(relocated)396 1978 y(freely)-5 b(.)19 b(There)g(is)i(a)g
+(con\002guration)d(\002le)1564 1978 y
+SDict begin H.S end
+ 1564 1978 a 1564
+1978 a
+SDict begin 13 H.A end
+ 1564 1978 a 1564 1978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3094) cvn H.B /DEST pdfmark
+end
+ 1564 1978 a Fr(~/.deploy.conf)h
+FC(that)h(is)h(created)f(in)g(the)g(home)f(directory)g(of)h(the)396
+2086 y(user)g(when)756 2086 y
+SDict begin H.S end
+ 756 2086 a 756 2086 a
+SDict begin 13 H.A end
+ 756
+2086 a 756 2086 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3095) cvn H.B /DEST pdfmark
+end
+ 756 2086 a Fy(deploy)-6 b(.sh)20 b
+FC(is)h(run)f(for)f(the)i(\002rst)g(time,)f(where)f(you)h(can)g
+(specify)f(the)h(def)o(ault)g(for)f(the)i(top)e(le)n(v)o(el)396
+2194 y(directory)g(of)h(the)g(system.)-2 2212 y
+SDict begin H.S end
+ -2 2212
+a -2 2212 a
+SDict begin 11.7 H.A end
+ -2 2212 a -2 2212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3096) cvn H.B /DEST pdfmark
+end
+ -2 2212 a -2 2336 a
+SDict begin H.S end
+ -2
+2336 a -2 2336 a
+SDict begin 11.7 H.A end
+ -2 2336 a -2 2336 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3098) cvn H.B /DEST pdfmark
+end
+ -2 2336 a 562 2415
+a Fw(Note:)g Fv(In)g(the)g(f)n(ollo)o(wing,)d(an)1414
+2415 y
+SDict begin H.S end
+ 1414 2415 a 1414 2415 a
+SDict begin 11.7 H.A end
+ 1414 2415 a 1414 2415
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3099) cvn H.B /DEST pdfmark
+end
+ 1414 2415 a Fq(architecture)j Fv(is)h(just)f(a)g(label)f(f)n(or)g
+(some)i(g)o(roup)e(of)h(hosts)o(,)g(typically)g(a)562
+2512 y(par)s(ticular)e(oper)o(ating)g(system)j(\(or)f(some)h(par)s
+(ticular)d(installation)f(thereof\).)h(As)j(long)e(as)h(y)o(ou)g(kno)o
+(w)g(what)562 2609 y(the)g(label)f(means)o(,)g(y)o(ou)h(can)g(choose)g
+(it)g(freely)f(\(alphan)o(umer)q(ic)f(+)i(underscore\).)-2
+2667 y
+SDict begin H.S end
+ -2 2667 a -2 2667 a
+SDict begin 11.7 H.A end
+ -2 2667 a -2 2667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3100) cvn H.B /DEST pdfmark
+end
+ -2 2667
+a 562 2748 a Fv(The)g(architecture)e(f)n(or)i(a)g(b)o(uild/install)c
+(host)k(\(i.e)o(.)f(the)h(association)e(betw)o(een)h(a)h(host)g(and)f
+(the)562 2845 y(architecture-speci\002c)f(con\002gur)o(ation)g(data\))h
+(is)i(currently)e(speci\002ed)h(via)g(a)g(command-line)e(option.)-2
+3161 y
+SDict begin H.S end
+ -2 3161 a -2 3161 a
+SDict begin 13 H.A end
+ -2 3161 a -2 3161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3101) cvn H.B /DEST pdfmark
+end
+ -2 3161
+a 396 3269 a FC(The)i(system)h(allo)n(ws)f(to)g(use)h(per)n
+(-architecture)c(customized)i(b)n(uild)h(options,)f(as)i(well)g(as)g
+(per)n(-host)e(customized)396 3377 y(runtime)g(con\002guration)f
+(\002les.)-2 3561 y
+SDict begin H.S end
+ -2 3561 a -2 3561 a
+SDict begin 13 H.A end
+ -2 3561 a -2
+3561 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3102) cvn H.B /DEST pdfmark
+end
+ -2 3561 a 396 3651 a FC(By)j(def)o(ault,)e(the)h(system)h(will)g
+(search)e(for)h(a)h(suf)n(\002ciently)e(adv)n(anced)f(incarnation)g(of)
+2925 3651 y
+SDict begin H.S end
+ 2925 3651 a 2925 3651 a
+SDict begin 13 H.A end
+ 2925 3651 a 2925
+3651 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3103) cvn H.B /DEST pdfmark
+end
+ 2925 3651 a FC(dialog)i(to)g(pro)o(vide)e(a)j(nice)396
+3759 y(user)f(interf)o(ace.)f(Y)-9 b(ou)20 b(can)g(switch)h(this)f(of)n
+(f)g(in)g(f)o(a)n(v)n(our)f(of)h(a)h(plain)f(console)f(interf)o(ace,)g
+(if)i(you)e(prefer)g(\(or)g(if)i(you)396 3866 y(w)o(ant)g(to)f(run)f
+(the)i(script)f(non-interacti)n(v)o(ely\).)-2 4050 y
+SDict begin H.S end
+
+-2 4050 a -2 4050 a
+SDict begin 13 H.A end
+ -2 4050 a -2 4050 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3104) cvn H.B /DEST pdfmark
+end
+ -2 4050 a 396
+4140 a FC(T)-7 b(o)21 b(use)f(this)h(system,)f(you)f(must)h(\002rst)h
+(install)g(it)g(with)f(the)h(command:)-2 4241 y
+SDict begin H.S end
+ -2 4241
+a -2 4241 a
+SDict begin 11.7 H.A end
+ -2 4241 a -2 4241 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3105) cvn H.B /DEST pdfmark
+end
+ -2 4241 a -2 4241 a
+SDict begin H.S end
+ -2
+4241 a -2 4241 a
+SDict begin 11.7 H.A end
+ -2 4241 a -2 4241 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3106) cvn H.B /DEST pdfmark
+end
+ -2 4241 a 396 4321
+a Ft(sh$)558 4321 y
+SDict begin H.S end
+ 558 4321 a 558 4321 a
+SDict begin 11.7 H.A end
+ 558 4321 a
+558 4321 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3107) cvn H.B /DEST pdfmark
+end
+ 558 4321 a Fs(make)41 b(install-deploy)-2
+4330 y
+SDict begin H.S end
+ -2 4330 a -2 4330 a
+SDict begin 11.7 H.A end
+ -2 4330 a -2 4330 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3108) cvn H.B /DEST pdfmark
+end
+ -2 4330
+a -2 4496 a
+SDict begin H.S end
+ -2 4496 a -2 4496 a
+SDict begin 11.7 H.A end
+ -2 4496 a -2 4496 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3110) cvn H.B /DEST pdfmark
+end
+ -2
+4496 a 562 4584 a Fw(Installation)18 b(tip:)h Fv(This)h(system)i(is)f
+(some)o(what)d(tied)i(to)g(the)f(ser)r(v)n(er)i(\(yule\).)e(While)g(y)o
+(ou)h(can)g(saf)n(ely)f(install)g(it)562 4681 y(later)l(,)g(installing)
+f(it)i(together)e(with)i(the)f(ser)r(v)n(er)i(will)e(tak)o(e)h(care)g
+(that)f(the)h(def)n(aults)e(are)i(already)f(correct.)562
+4778 y(Upon)h(\002rst)h(in)o(v)n(ocation)d(a)i(con\002gur)o(ation)e
+(\002le)1883 4778 y
+SDict begin H.S end
+ 1883 4778 a 1883 4778 a
+SDict begin 11.7 H.A end
+ 1883 4778
+a 1883 4778 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3111) cvn H.B /DEST pdfmark
+end
+ 1883 4778 a Ft(~/.deploy.conf)26 b Fv(will)19
+b(be)h(wr)q(itten,)f(where)g(y)o(ou)h(can)g(modify)562
+4875 y(the)g(def)n(aults)e(settings)o(.)39 5014 y
+SDict begin H.S end
+ 39
+5014 a 39 5014 a
+SDict begin 11.7 H.A end
+ 39 5014 a 39 5014 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3112) cvn H.B /DEST pdfmark
+end
+ 39 5014 a Black
+-2 5805 a
+SDict begin H.S end
+ -2 5805 a -2 5805 a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-REQ) cvn H.B /DEST pdfmark
+end
+ -2
+5805 a 3658 5874 a Fx(87)p Black eop end
+%%Page: 88 93
+TeXDict begin 88 92 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.88) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black 745 242 2668 17 v 745 1393 17 1151 v 1413 437 a
+Fp(Bac)n(kwar)n(d)35 b(compatibility)786 628 y
+SDict begin H.S end
+ 786 628
+a 786 628 a
+SDict begin 11.7 H.A end
+ 786 628 a 786 628 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3114) cvn H.B /DEST pdfmark
+end
+ 786 628 a 73 x Fv(The)20
+b(deplo)n(yment)e(system)j(has)f(been)f(completely)g(re)n(vised)h(in)f
+(v)n(ersion)h(2.0)g(of)786 798 y(samhain.)f(It)i(will)1297
+798 y
+SDict begin H.S end
+ 1297 798 a 1297 798 a
+SDict begin 11.7 H.A end
+ 1297 798 a 1297 798 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3115) cvn H.B /DEST pdfmark
+end
+ 1297
+798 a Fq(not)27 b Fv(w)o(or)q(k)20 b(with)g(samhain)f(v)n(ersions)h
+(belo)o(w)f(2.0)h(\(i.e)o(.)f(y)o(ou)h(cannot)786 895
+y(install)f(them)h(using)f(this)h(system\).)i(Ho)o(w)o(e)n(v)n(er)l(,)d
+(the)h(def)n(ault)e(location)g(and)h(f)n(or)r(mat)g(of)h(the)786
+992 y(client)g(database)e(\(used)h(b)o(y)i(the)1740 992
+y
+SDict begin H.S end
+ 1740 992 a 1740 992 a
+SDict begin 11.7 H.A end
+ 1740 992 a 1740 992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3116) cvn H.B /DEST pdfmark
+end
+ 1740 992
+a Fv(beltane)d(w)o(eb-based)h(console\))g(has)h(not)g(changed.)786
+1175 y
+SDict begin H.S end
+ 786 1175 a 786 1175 a
+SDict begin 11.7 H.A end
+ 786 1175 a 786 1175 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3117) cvn H.B /DEST pdfmark
+end
+ 786
+1175 a 80 x Fv(Installing)e(the)i(ne)o(w)f(v)n(ersion)h(of)g(the)f
+(deplo)n(y)g(system)j(will)d(not)h(o)o(v)n(erwr)q(ite)f(the)g(old)786
+1352 y(v)n(ersion)h(\(deplo)n(y)-7 b(.sh)17 b(will)i(be)h(installed)e
+(as)i(deplo)n(y2.sh,)d(if)j(an)g(old)f(v)n(ersion)g(is)h(detected\).)p
+3396 1393 17 1151 v 745 1410 2668 17 v -2 1420 a
+SDict begin H.S end
+ -2 1420
+a -2 1420 a
+SDict begin 13 H.A end
+ -2 1420 a -2 1420 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-REQ) cvn H.B /DEST pdfmark
+end
+ -2 1420 a 396 1691 a
+Fp(10.1.1.)36 b(Requirements)1590 1691 y
+SDict begin H.S end
+ 1590 1691 a
+1590 1691 a
+SDict begin 18.72 H.A end
+ 1590 1691 a 1590 1691 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.35.2) cvn H.B /DEST pdfmark
+end
+ 1590 1691 a -2 1882
+a
+SDict begin H.S end
+ -2 1882 a -2 1882 a
+SDict begin 13 H.A end
+ -2 1882 a -2 1882 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3120) cvn H.B /DEST pdfmark
+end
+ -2 1882 a -2
+1882 a
+SDict begin H.S end
+ -2 1882 a -2 1882 a
+SDict begin 13 H.A end
+ -2 1882 a -2 1882 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3121) cvn H.B /DEST pdfmark
+end
+ -2 1882
+a -2 1906 a
+SDict begin H.S end
+ -2 1906 a -2 1906 a
+SDict begin 13 H.A end
+ -2 1906 a -2 1906 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3122) cvn H.B /DEST pdfmark
+end
+ -2
+1906 a Black 463 2054 a FC(1.)p Black 546 2054 a
+SDict begin H.S end
+ 546
+2054 a 546 2054 a
+SDict begin 13 H.A end
+ 546 2054 a 546 2054 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3123) cvn H.B /DEST pdfmark
+end
+ 546 2054 a FC(Y)-9
+b(ou)19 b(must)i(ha)n(v)o(e)e(compiled)g(and)h(installed)g(the)g(serv)o
+(er)f(\()2202 2054 y
+SDict begin H.S end
+ 2202 2054 a 2202 2054 a
+SDict begin 13 H.A end
+ 2202 2054
+a 2202 2054 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3124) cvn H.B /DEST pdfmark
+end
+ 2202 2054 a FC(yule\))g(on)h(the)g(local)g(host)g(where)g
+(you)f(use)i(the)546 2162 y(deplo)o(y)e(system.)-2 2180
+y
+SDict begin H.S end
+ -2 2180 a -2 2180 a
+SDict begin 13 H.A end
+ -2 2180 a -2 2180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3125) cvn H.B /DEST pdfmark
+end
+ -2 2180 a Black
+463 2311 a FC(2.)p Black 546 2311 a
+SDict begin H.S end
+ 546 2311 a 546 2311
+a
+SDict begin 13 H.A end
+ 546 2311 a 546 2311 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3126) cvn H.B /DEST pdfmark
+end
+ 546 2311 a FC(Y)-9 b(ou)19 b(must)i(ha)n(v)o(e)
+e(installed)h(the)g(deplo)o(yment)e(system)j(by)f(using)2449
+2311 y
+SDict begin H.S end
+ 2449 2311 a 2449 2311 a
+SDict begin 13 H.A end
+ 2449 2311 a 2449 2311
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3127) cvn H.B /DEST pdfmark
+end
+ 2449 2311 a Fy(mak)o(e)h(deploy-install)p FC(.)e(This)h(will)h
+(install)546 2419 y(the)f(script)873 2419 y
+SDict begin H.S end
+ 873 2419
+a 873 2419 a
+SDict begin 13 H.A end
+ 873 2419 a 873 2419 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3128) cvn H.B /DEST pdfmark
+end
+ 873 2419 a Fr(deploy.sh)f
+FC(into)h(the)1570 2419 y
+SDict begin H.S end
+ 1570 2419 a 1570 2419 a
+SDict begin 13 H.A end
+ 1570
+2419 a 1570 2419 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3129) cvn H.B /DEST pdfmark
+end
+ 1570 2419 a Fr(sbindir)f FC(\(def)o(ault)2182
+2419 y
+SDict begin H.S end
+ 2182 2419 a 2182 2419 a
+SDict begin 13 H.A end
+ 2182 2419 a 2182 2419
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3130) cvn H.B /DEST pdfmark
+end
+ 2182 2419 a Fr(/usr/local/sbin)p FC(,)f(b)n(ut)i(depends)f(on)h(your)
+546 2527 y(con\002gure)e(options\),)h(and)g(the)i(deplo)o(yment)c
+(system)k(into)546 2635 y
+SDict begin H.S end
+ 546 2635 a 546 2635 a
+SDict begin 13 H.A end
+ 546 2635
+a 546 2635 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3131) cvn H.B /DEST pdfmark
+end
+ 546 2635 a Fr(localstatedir/install_name/profiles)15
+b FC(\(def)o(ault)2414 2635 y
+SDict begin H.S end
+ 2414 2635 a 2414 2635 a
+SDict begin 13 H.A end
+
+2414 2635 a 2414 2635 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3132) cvn H.B /DEST pdfmark
+end
+ 2414 2635 a Fr(/var/lib/yule/profiles)p
+FC(,)i(b)n(ut)546 2743 y(depends)i(on)g(your)g(con\002gure)g
+(options\).)-2 2927 y
+SDict begin H.S end
+ -2 2927 a -2 2927 a
+SDict begin 13 H.A end
+ -2 2927 a -2
+2927 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3133) cvn H.B /DEST pdfmark
+end
+ -2 2927 a 546 3017 a FC(If)h(you)f(already)g(ha)n(v)o(e)h
+(installed)g(the)g(deprecated)e(v)o(ersion)h(1)i(deplo)o(yment)d
+(system,)i(the)g(script)g(will)h(be)546 3125 y(installed)f(as)938
+3125 y
+SDict begin H.S end
+ 938 3125 a 938 3125 a
+SDict begin 13 H.A end
+ 938 3125 a 938 3125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3134) cvn H.B /DEST pdfmark
+end
+ 938
+3125 a Fr(deploy2.sh)p FC(.)438 3243 y
+SDict begin H.S end
+ 438 3243 a 438
+3243 a
+SDict begin 13 H.A end
+ 438 3243 a 438 3243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3135) cvn H.B /DEST pdfmark
+end
+ 438 3243 a Black 463 3393
+a FC(3.)p Black 546 3393 a
+SDict begin H.S end
+ 546 3393 a 546 3393 a
+SDict begin 13 H.A end
+ 546
+3393 a 546 3393 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3136) cvn H.B /DEST pdfmark
+end
+ 546 3393 a FC(F)o(or)g(each)f(architecture)g(that)h
+(you)g(de\002ne,)f(there)h(must)g(be)g(\(at)g(least\))h(one)2719
+3393 y
+SDict begin H.S end
+ 2719 3393 a 2719 3393 a
+SDict begin 13 H.A end
+ 2719 3393 a 2719 3393
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3137) cvn H.B /DEST pdfmark
+end
+ 2719 3393 a Fx(b)n(uild)e(host)j FC(where)e(de)n(v)o(elopment)546
+3501 y(tools)g(\(C)h(compiler)m(,)d(mak)o(e,)i(strip\))g(are)g(a)n(v)n
+(ailable)f(to)i(b)n(uild)f(the)g(client)g(e)o(x)o(ecutable.)-2
+3519 y
+SDict begin H.S end
+ -2 3519 a -2 3519 a
+SDict begin 13 H.A end
+ -2 3519 a -2 3519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3138) cvn H.B /DEST pdfmark
+end
+ -2 3519
+a Black 463 3650 a FC(4.)p Black 546 3650 a
+SDict begin H.S end
+ 546 3650
+a 546 3650 a
+SDict begin 13 H.A end
+ 546 3650 a 546 3650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3139) cvn H.B /DEST pdfmark
+end
+ 546 3650 a FC(On)g(each)g(remote)f
+(where)h(you)f(w)o(ant)h(to)h(b)n(uild)e(or)h(install,)h(you)e(should)g
+(be)h(able)g(to)h(login)e(as)i(root)f(with)g(ssh)546
+3758 y(using)f(RSA)j(authentication,)c(such)h(that)i(ssh-agent)e(can)h
+(be)g(used.)39 3897 y
+SDict begin H.S end
+ 39 3897 a 39 3897 a
+SDict begin 11.7 H.A end
+ 39 3897 a 39
+3897 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3140) cvn H.B /DEST pdfmark
+end
+ 39 3897 a -2 4021 a
+SDict begin H.S end
+ -2 4021 a -2 4021 a
+SDict begin 11.7 H.A end
+ -2 4021
+a -2 4021 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3142) cvn H.B /DEST pdfmark
+end
+ -2 4021 a 562 4118 a Fw(TIP:)g Fv(T)-9 b(o)20
+b(use)g(RSA-based)f(authentication)d(in)k(a)1994 4118
+y
+SDict begin H.S end
+ 1994 4118 a 1994 4118 a
+SDict begin 11.7 H.A end
+ 1994 4118 a 1994 4118 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3143) cvn H.B /DEST pdfmark
+end
+ 1994
+4118 a Fq(secure)i Fv(w)o(a)n(y)-7 b(,)20 b(y)o(ou)f(ma)n(y)i(proceed)e
+(as)h(f)n(ollo)o(ws:)-2 4176 y
+SDict begin H.S end
+ -2 4176 a -2 4176 a
+SDict begin 11.7 H.A end
+ -2
+4176 a -2 4176 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3144) cvn H.B /DEST pdfmark
+end
+ -2 4176 a 562 4257 a Fv(Use)716 4257
+y
+SDict begin H.S end
+ 716 4257 a 716 4257 a
+SDict begin 11.7 H.A end
+ 716 4257 a 716 4257 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3145) cvn H.B /DEST pdfmark
+end
+ 716 4257
+a Fw(ssh-ke)o(yg)q(en)c Fv(to)21 b(create)e(a)h(pub)o(lic/pr)q(iv)n
+(ate)d(k)o(e)o(y)j(pair)l(.)f(Don't)h(f)n(orget)e(to)i(set)h(a)f
+(passphr)o(ase)f(f)n(or)h(the)562 4354 y(pr)q(iv)n(ate)g(k)o(e)o(y)g
+(\()966 4354 y
+SDict begin H.S end
+ 966 4354 a 966 4354 a
+SDict begin 11.7 H.A end
+ 966 4354 a 966 4354
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3146) cvn H.B /DEST pdfmark
+end
+ 966 4354 a Fw(ssh-ke)o(yg)q(en)c Fv(will)j(ask)j(f)n(or)d(it\).)-2
+4412 y
+SDict begin H.S end
+ -2 4412 a -2 4412 a
+SDict begin 11.7 H.A end
+ -2 4412 a -2 4412 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3147) cvn H.B /DEST pdfmark
+end
+ -2 4412
+a 562 4493 a Fv(Cop)n(y)h(the)g(pub)o(lic)e(k)o(e)o(y)i(\()1253
+4493 y
+SDict begin H.S end
+ 1253 4493 a 1253 4493 a
+SDict begin 11.7 H.A end
+ 1253 4493 a 1253 4493
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3148) cvn H.B /DEST pdfmark
+end
+ 1253 4493 a Ft(HOME/.ssh/identity)q(.pu)q(b)27 b Fv(f)n(or)19
+b(the)h(ssh)h(protocol)e(v)n(ersion)g(1,)562 4590 y
+SDict begin H.S end
+ 562
+4590 a 562 4590 a
+SDict begin 11.7 H.A end
+ 562 4590 a 562 4590 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3149) cvn H.B /DEST pdfmark
+end
+ 562 4590 a Ft
+(HOME/.ssh/id_rsa.p)q(ub)27 b Fv(f)n(or)20 b(ssh)h(protocol)d(v)n
+(ersion)i(2\))g(to)2349 4590 y
+SDict begin H.S end
+ 2349 4590 a 2349 4590
+a
+SDict begin 11.7 H.A end
+ 2349 4590 a 2349 4590 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3150) cvn H.B /DEST pdfmark
+end
+ 2349 4590 a Ft(HOME/.ssh/authoriz)q(ed_)q
+(key)q(s)27 b Fv(on)20 b(an)o(y)562 4687 y(remote)g(host)g(where)f(y)o
+(ou)h(w)o(ant)f(to)h(log)g(in.)1822 4687 y
+SDict begin H.S end
+ 1822 4687
+a 1822 4687 a
+SDict begin 11.7 H.A end
+ 1822 4687 a 1822 4687 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3151) cvn H.B /DEST pdfmark
+end
+ 1822 4687 a Fq(Do)g(not)g(cop)n
+(y)g(the)g(pr)q(iv)n(ate)f(k)o(e)o(y)2750 4687 y
+SDict begin H.S end
+ 2750
+4687 a 2750 4687 a
+SDict begin 11.7 H.A end
+ 2750 4687 a 2750 4687 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3152) cvn H.B /DEST pdfmark
+end
+ 2750 4687
+a Ft(HOME/.ssh/identity)27 b Fv(\(ssh)562 4784 y(protocol)19
+b(v)n(ersion)h(1\))g(or)1283 4784 y
+SDict begin H.S end
+ 1283 4784 a 1283
+4784 a
+SDict begin 11.7 H.A end
+ 1283 4784 a 1283 4784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3153) cvn H.B /DEST pdfmark
+end
+ 1283 4784 a Ft(HOME/.ssh/id_rsa)26
+b Fv(\(ssh)21 b(protocol)e(v)n(ersion)h(2\))g(to)g(an)o(y)g(untr)q
+(usted)e(host)i(!)-2 4842 y
+SDict begin H.S end
+ -2 4842 a -2 4842 a
+SDict begin 11.7 H.A end
+ -2 4842
+a -2 4842 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3154) cvn H.B /DEST pdfmark
+end
+ -2 4842 a 562 4923 a Fv(On)h(y)o(our)e(centr)o(al)h(host,)f
+(e)n(x)n(ecute)g(the)h(commands)g(\(use)g("ssh-agent)f(-c")h(if)g(y)o
+(ou)g(are)g(using)f(a)h(csh-style)562 5020 y(shell\):)-2
+5119 y
+SDict begin H.S end
+ -2 5119 a -2 5119 a
+SDict begin 10.53 H.A end
+ -2 5119 a -2 5119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3155) cvn H.B /DEST pdfmark
+end
+ -2 5119
+a -2 5119 a
+SDict begin H.S end
+ -2 5119 a -2 5119 a
+SDict begin 10.53 H.A end
+ -2 5119 a -2 5119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3156) cvn H.B /DEST pdfmark
+end
+ -2
+5119 a 562 5191 a Fo(bash$)742 5191 y
+SDict begin H.S end
+ 742 5191 a 742
+5191 a
+SDict begin 10.53 H.A end
+ 742 5191 a 742 5191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3157) cvn H.B /DEST pdfmark
+end
+ 742 5191 a Fn(eval)39 b(`ssh-agent)h(-s`)
+-2 5199 y
+SDict begin H.S end
+ -2 5199 a -2 5199 a
+SDict begin 10.53 H.A end
+ -2 5199 a -2 5199 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3158) cvn H.B /DEST pdfmark
+end
+ -2
+5199 a 562 5278 a Fo(bash$)742 5278 y
+SDict begin H.S end
+ 742 5278 a 742
+5278 a
+SDict begin 10.53 H.A end
+ 742 5278 a 742 5278 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3159) cvn H.B /DEST pdfmark
+end
+ 742 5278 a Fn(ssh-add)p
+Black 3661 5805 a Fx(88)p Black eop end
+%%Page: 89 94
+TeXDict begin 89 93 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.89) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3160) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 562 309 a Fv(Y)-10 b(ou)20 b(can)g(then)f(ssh/scp)i(without)d
+(typing)i(the)f(passphr)o(ase)g(again,)g(until)g(y)o(ou)g(e)n(xit)h
+(the)g(current)f(shell.)-2 541 y
+SDict begin H.S end
+ -2 541 a -2 541 a
+SDict begin 13 H.A end
+ -2
+541 a -2 541 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-LAYOUT) cvn H.B /DEST
+pdfmark end
+ -2 541 a 396 869 a Fp(10.1.2.)36 b(La)n(y)m(out)e(of)f
+(the)g(deplo)n(yment)i(system)2685 869 y
+SDict begin H.S end
+ 2685 869 a 2685
+869 a
+SDict begin 18.72 H.A end
+ 2685 869 a 2685 869 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.36.2) cvn H.B /DEST pdfmark
+end
+ 2685 869 a -2 977 a
+SDict begin H.S end
+ -2 977
+a -2 977 a
+SDict begin 11.7 H.A end
+ -2 977 a -2 977 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3163) cvn H.B /DEST pdfmark
+end
+ -2 977 a 396 1049 a Fr
+(\(localstatedir\)/\(install_name\)/profiles/)1383 1147
+y(|)1383 1244 y(|)1383 1341 y(|--)44 b(source)g(------------>)e
+(\(tarballs\))1383 1438 y(|)1383 1535 y(|--)i(configs)g(----------->)e
+(\(default)i(configs\))1383 1632 y(|)1383 1729 y(|--)g(archpkg)1383
+1827 y(|)179 b(|)1383 1924 y(|)g(|--)44 b(architecture)f(->)h
+(\(compiled)g(package,)f(setup)h(script\))1383 2021 y(|)1383
+2118 y(|--)g(hosts)1383 2215 y(|)179 b(|)1383 2312 y(|)g(|--)44
+b(hostname)g(----->)f(\(optional)h(host-specific)e(config\))1383
+2409 y(|)1383 2506 y(|--)i(libexec)g(----------->)e(\(scripts\))1383
+2604 y(|)1383 2701 y(|--)i(private)g(----------->)e(\(gpg)j(key\))1383
+2798 y(|)1383 2895 y(|--)f(tmp)-2 2914 y
+SDict begin H.S end
+ -2 2914 a -2
+2914 a
+SDict begin 13 H.A end
+ -2 2914 a -2 2914 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-LAYOUT-CONFIGS) cvn
+H.B /DEST pdfmark end
+ -2 2914 a 396 3191 a Fj(10.1.2.1.)29
+b(The)f(con\002gs)f(subdirector)q(y)2002 3191 y
+SDict begin H.S end
+ 2002
+3191 a 2002 3191 a
+SDict begin 15.6 H.A end
+ 2002 3191 a 2002 3191 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.36.7.3) cvn H.B /DEST pdfmark
+end
+ 2002 3191
+a -2 3379 a
+SDict begin H.S end
+ -2 3379 a -2 3379 a
+SDict begin 13 H.A end
+ -2 3379 a -2 3379 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3166) cvn H.B /DEST pdfmark
+end
+ -2
+3379 a 396 3465 a FC(The)546 3465 y
+SDict begin H.S end
+ 546 3465 a 546 3465
+a
+SDict begin 13 H.A end
+ 546 3465 a 546 3465 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3167) cvn H.B /DEST pdfmark
+end
+ 546 3465 a Fr(configs)20 b FC(subdirectory)d
+(holds)j(for)g(each)g(architecture)e(at)j(least)g(tw)o(o)f(\002les)h
+(\(e)o(xample)e(\002les)i(will)g(be)f(placed)396 3572
+y(there)g(upon)f(installation)h(of)f(the)i(deplo)o(yment)d(system\):)-2
+3590 y
+SDict begin H.S end
+ -2 3590 a -2 3590 a
+SDict begin 13 H.A end
+ -2 3590 a -2 3590 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3168) cvn H.B /DEST pdfmark
+end
+ -2 3590
+a -2 3715 a
+SDict begin H.S end
+ -2 3715 a -2 3715 a
+SDict begin 13 H.A end
+ -2 3715 a -2 3715 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3170) cvn H.B /DEST pdfmark
+end
+ -2
+3715 a 396 3805 a Ff(<)p FC(architecture)p Ff(>)p FC(.con\002gure)d
+(\(required\))-2 3823 y
+SDict begin H.S end
+ -2 3823 a -2 3823 a
+SDict begin 13 H.A end
+ -2 3823 a
+-2 3823 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3171) cvn H.B /DEST pdfmark
+end
+ -2 3823 a Black Black 562 3954 a
+SDict begin H.S end
+ 562 3954 a
+562 3954 a
+SDict begin 13 H.A end
+ 562 3954 a 562 3954 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3172) cvn H.B /DEST pdfmark
+end
+ 562 3954 a FC(The)20
+b(con\002gure)e(options)i(for)f(this)i(architecture;)e(one)g(option)g
+(per)h(line,)g(each)g(enclosed)f(in)i(single)f(quotes.)-2
+4138 y
+SDict begin H.S end
+ -2 4138 a -2 4138 a
+SDict begin 13 H.A end
+ -2 4138 a -2 4138 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3173) cvn H.B /DEST pdfmark
+end
+ -2 4138
+a 562 4228 a FC(If)g(this)h(\002le)g(does)f(not)g(e)o(xist,)g(it)h
+(will)g(be)f(copied)f(from)2143 4228 y
+SDict begin H.S end
+ 2143 4228 a 2143
+4228 a
+SDict begin 13 H.A end
+ 2143 4228 a 2143 4228 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3174) cvn H.B /DEST pdfmark
+end
+ 2143 4228 a Fr(generic.configure)p
+FC(,)f(which)h(is)i(created)f(upon)562 4336 y(installation,)g(and)f
+(holds)h(\(only\))f(some)h(minimum)f(options.)-2 4538
+y
+SDict begin H.S end
+ -2 4538 a -2 4538 a
+SDict begin 13 H.A end
+ -2 4538 a -2 4538 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3176) cvn H.B /DEST pdfmark
+end
+ -2 4538 a 396
+4646 a Ff(<)p FC(architecture)p Ff(>)p FC(.samhainrc)d(\(required\))-2
+4663 y
+SDict begin H.S end
+ -2 4663 a -2 4663 a
+SDict begin 13 H.A end
+ -2 4663 a -2 4663 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3177) cvn H.B /DEST pdfmark
+end
+ -2 4663
+a Black Black 562 4795 a
+SDict begin H.S end
+ 562 4795 a 562 4795 a
+SDict begin 13 H.A end
+ 562 4795
+a 562 4795 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3178) cvn H.B /DEST pdfmark
+end
+ 562 4795 a FC(The)k(def)o(ault)g(runtime)f
+(con\002guration)e(\002le)k(for)f(a)g(client)g(running)e(on)i(this)h
+(architecture.)d(It)j(is)g(possible)f(to)562 4903 y(o)o(v)o(erride)e
+(this)j(on)f(installation)f(with)i(a)f(\002le)1844 4903
+y
+SDict begin H.S end
+ 1844 4903 a 1844 4903 a
+SDict begin 13 H.A end
+ 1844 4903 a 1844 4903 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3179) cvn H.B /DEST pdfmark
+end
+ 1844
+4903 a Fr(hosts/)p Fh(<)p Fr(hostname)p Fh(>)p Fr(/samhainrc)p
+FC(.)p Black 3661 5805 a Fx(89)p Black eop end
+%%Page: 90 95
+TeXDict begin 90 94 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.90) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3181) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Ff(<)p FC(architecture)p Ff(>)p FC(.preinstall)c
+(\(optional\))-2 327 y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2
+327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3182) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458
+a
+SDict begin 13 H.A end
+ 562 458 a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3183) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(The)j(shell)h(script)f(to)g(run)g
+(before)f(installing)g(a)i(client.)f(T)-7 b(ypically)19
+b(this)i(script)f(w)o(ould)g(shutdo)n(wn)e(the)562 566
+y(running)g(client,)i(if)h(there)f(is)h(one.)-2 750 y
+SDict begin H.S end
+
+-2 750 a -2 750 a
+SDict begin 13 H.A end
+ -2 750 a -2 750 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3184) cvn H.B /DEST pdfmark
+end
+ -2 750 a 562 840
+a FC(Def)o(aults)g(to)949 840 y
+SDict begin H.S end
+ 949 840 a 949 840 a
+SDict begin 13 H.A end
+ 949
+840 a 949 840 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3185) cvn H.B /DEST pdfmark
+end
+ 949 840 a Fr(libexec/preinstall)p FC(.)-2
+1041 y
+SDict begin H.S end
+ -2 1041 a -2 1041 a
+SDict begin 13 H.A end
+ -2 1041 a -2 1041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3187) cvn H.B /DEST pdfmark
+end
+ -2 1041
+a 396 1149 a Ff(<)p FC(architecture)p Ff(>)p FC(.postinstall)c
+(\(optional\))-2 1167 y
+SDict begin H.S end
+ -2 1167 a -2 1167 a
+SDict begin 13 H.A end
+ -2 1167 a
+-2 1167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3188) cvn H.B /DEST pdfmark
+end
+ -2 1167 a Black Black 562 1299 a
+SDict begin H.S end
+ 562 1299 a
+562 1299 a
+SDict begin 13 H.A end
+ 562 1299 a 562 1299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3189) cvn H.B /DEST pdfmark
+end
+ 562 1299 a FC(The)j(shell)h(script)f
+(to)g(run)g(after)g(installing)f(a)i(client.)f(This)g(script)h(recei)n
+(v)o(es)e(the)h(client)g(passw)o(ord)g(as)h(\002rst)562
+1407 y(\(and)f(only\))f(ar)o(gument,)e(and)j(typically)f(w)o(ould)h
+(set)h(the)f(passw)o(ord)f(in)i(the)f(client)g(binary)-5
+b(.)-2 1591 y
+SDict begin H.S end
+ -2 1591 a -2 1591 a
+SDict begin 13 H.A end
+ -2 1591 a -2 1591 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3190) cvn H.B /DEST pdfmark
+end
+
+-2 1591 a 562 1681 a FC(Def)o(aults)21 b(to)949 1681
+y
+SDict begin H.S end
+ 949 1681 a 949 1681 a
+SDict begin 13 H.A end
+ 949 1681 a 949 1681 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3191) cvn H.B /DEST pdfmark
+end
+ 949 1681
+a Fr(libexec/postinstall)p FC(.)-2 1882 y
+SDict begin H.S end
+ -2 1882 a -2
+1882 a
+SDict begin 13 H.A end
+ -2 1882 a -2 1882 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3193) cvn H.B /DEST pdfmark
+end
+ -2 1882 a 396 1990 a Ff(<)p
+FC(architecture)p Ff(>)p FC(.initscript)c(\(optional\))-2
+2008 y
+SDict begin H.S end
+ -2 2008 a -2 2008 a
+SDict begin 13 H.A end
+ -2 2008 a -2 2008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3194) cvn H.B /DEST pdfmark
+end
+ -2 2008
+a Black Black 562 2139 a
+SDict begin H.S end
+ 562 2139 a 562 2139 a
+SDict begin 13 H.A end
+ 562 2139
+a 562 2139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3195) cvn H.B /DEST pdfmark
+end
+ 562 2139 a FC(The)j(shell)h(script)f(to)g
+(initialize/update)f(the)h(baseline)g(database)g(\002le)h(installing)e
+(a)i(client.)-2 2323 y
+SDict begin H.S end
+ -2 2323 a -2 2323 a
+SDict begin 13 H.A end
+ -2 2323 a
+-2 2323 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3196) cvn H.B /DEST pdfmark
+end
+ -2 2323 a 562 2413 a FC(Def)o(aults)g(to)949
+2413 y
+SDict begin H.S end
+ 949 2413 a 949 2413 a
+SDict begin 13 H.A end
+ 949 2413 a 949 2413 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3197) cvn H.B /DEST pdfmark
+end
+ 949
+2413 a Fr(libexec/initscript)p FC(.)-2 2573 y
+SDict begin H.S end
+ -2 2573
+a -2 2573 a
+SDict begin 13 H.A end
+ -2 2573 a -2 2573 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-LAYOUT-ARCHPKG) cvn
+H.B /DEST pdfmark end
+ -2 2573 a 396 2869 a
+Fj(10.1.2.2.)29 b(The)f(ar)n(c)o(hpkg)g(subdirector)q(y)2033
+2869 y
+SDict begin H.S end
+ 2033 2869 a 2033 2869 a
+SDict begin 15.6 H.A end
+ 2033 2869 a 2033 2869
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.36.8.3) cvn H.B /DEST pdfmark
+end
+ 2033 2869 a -2 3057 a
+SDict begin H.S end
+ -2 3057 a -2 3057 a
+SDict begin 13 H.A end
+ -2 3057 a
+-2 3057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3200) cvn H.B /DEST pdfmark
+end
+ -2 3057 a 396 3143 a FC(The)546 3143 y
+SDict begin H.S end
+ 546
+3143 a 546 3143 a
+SDict begin 13 H.A end
+ 546 3143 a 546 3143 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3201) cvn H.B /DEST pdfmark
+end
+ 546 3143 a Fr(archpkg)20
+b FC(directory)e(holds)i(for)f(each)h(architecture)f(a)h(subdirectory)
+2598 3143 y
+SDict begin H.S end
+ 2598 3143 a 2598 3143 a
+SDict begin 13 H.A end
+ 2598 3143 a 2598
+3143 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3202) cvn H.B /DEST pdfmark
+end
+ 2598 3143 a Fr(archpkg/)p Fh(<)p Fr(architecture)p
+Fh(>)p FC(,)396 3251 y(where)g(compiled)f(binary)f(installer)j
+(packages)e(are)h(stored.)-2 3435 y
+SDict begin H.S end
+ -2 3435 a -2 3435
+a
+SDict begin 13 H.A end
+ -2 3435 a -2 3435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3203) cvn H.B /DEST pdfmark
+end
+ -2 3435 a 396 3525 a FC(F)o(or)g(each)g(b)n
+(uild,)f(up)h(to)h(four)e(\002les)i(will)g(be)f(stored:)g(\(a\))g(the)g
+(binary)f(installer)h(package)396 3632 y
+SDict begin H.S end
+ 396 3632 a 396
+3632 a
+SDict begin 13 H.A end
+ 396 3632 a 396 3632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3204) cvn H.B /DEST pdfmark
+end
+ 396 3632 a Fr(samhain-)p
+Fh(<)p Fr(version)p Fh(>)p Fr(.)p Fh(<)p Fr(format)p
+Fh(>)p FC(,)c(\(b\))k(the)g(con\002gure)e(options)h(used)396
+3740 y(\()424 3740 y
+SDict begin H.S end
+ 424 3740 a 424 3740 a
+SDict begin 13 H.A end
+ 424 3740 a
+424 3740 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3205) cvn H.B /DEST pdfmark
+end
+ 424 3740 a Fr(configure-)p Fh(<)p Fr(version)p
+Fh(>)p Fr(.)p Fh(<)p Fr(format)p Fh(>)p FC(\),)c(\(c\))20
+b(the)g(samhain-install.sh)f(script)h(generated)e(during)h(the)h(b)n
+(uild)396 3848 y(\()424 3848 y
+SDict begin H.S end
+ 424 3848 a 424 3848 a
+SDict begin 13 H.A end
+
+424 3848 a 424 3848 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3206) cvn H.B /DEST pdfmark
+end
+ 424 3848 a Fr(install-)p Fh(<)p
+Fr(version)p Fh(>)p Fr(.)p Fh(<)p Fr(format)p Fh(>)p
+FC(\),)15 b(and)20 b(\(only)f(for)g(pack)o(ed)h(e)o(x)o(ecutables\))e
+(the)i(client)g(passw)o(ord)g(set)h(in)396 3956 y(the)f(e)o(x)o
+(ecutable)f(\()920 3956 y
+SDict begin H.S end
+ 920 3956 a 920 3956 a
+SDict begin 13 H.A end
+ 920 3956
+a 920 3956 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3207) cvn H.B /DEST pdfmark
+end
+ 920 3956 a Fr(PASSWD-)p Fh(<)p Fr(version)p
+Fh(>)p Fr(.)p Fh(<)p Fr(format)p Fh(>)p FC(\).)-2 4065
+y
+SDict begin H.S end
+ -2 4065 a -2 4065 a
+SDict begin 13 H.A end
+ -2 4065 a -2 4065 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-CUSTOMIZE) cvn H.B /DEST
+pdfmark end
+ -2 4065 a 396
+4378 a Fp(10.1.3.)36 b(Customizing)f(the)e(system)2168
+4378 y
+SDict begin H.S end
+ 2168 4378 a 2168 4378 a
+SDict begin 18.72 H.A end
+ 2168 4378 a 2168 4378
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.37.2) cvn H.B /DEST pdfmark
+end
+ 2168 4378 a -2 4404 a
+SDict begin H.S end
+ -2 4404 a -2 4404 a
+SDict begin 13 H.A end
+ -2 4404 a
+-2 4404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3210) cvn H.B /DEST pdfmark
+end
+ -2 4404 a 396 4665 a Fj(10.1.3.1.)c(Setting)f(default)g
+(options)1891 4665 y
+SDict begin H.S end
+ 1891 4665 a 1891 4665 a
+SDict begin 15.6 H.A end
+ 1891 4665
+a 1891 4665 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.37.9.3) cvn H.B /DEST pdfmark
+end
+ 1891 4665 a -2 4853 a
+SDict begin H.S end
+ -2 4853 a -2 4853
+a
+SDict begin 13 H.A end
+ -2 4853 a -2 4853 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3212) cvn H.B /DEST pdfmark
+end
+ -2 4853 a 396 4939 a FC(If)20 b(you)g(w)o(ant)g
+(to)g(change)f(the)h(def)o(ault)g(options,)f(you)g(can)h(set)h(some)f
+(of)g(them)g(via)g(a)h(con\002guration)c(\002le)396 5047
+y
+SDict begin H.S end
+ 396 5047 a 396 5047 a
+SDict begin 13 H.A end
+ 396 5047 a 396 5047 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3213) cvn H.B /DEST pdfmark
+end
+ 396 5047
+a Fr(~/.deploy.conf)p FC(,)h(which)i(is)h(created)f(upon)e(the)j
+(\002rst)g(in)m(v)n(ocation)d(of)2541 5047 y
+SDict begin H.S end
+ 2541 5047
+a 2541 5047 a
+SDict begin 13 H.A end
+ 2541 5047 a 2541 5047 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3214) cvn H.B /DEST pdfmark
+end
+ 2541 5047 a Fy(deploy)-6
+b(.sh)p FC(.)-2 5075 y
+SDict begin H.S end
+ -2 5075 a -2 5075 a
+SDict begin 13 H.A end
+ -2 5075 a
+-2 5075 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3215) cvn H.B /DEST pdfmark
+end
+ -2 5075 a Black 3661 5805 a Fx(90)p Black eop
+end
+%%Page: 91 96
+TeXDict begin 91 95 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.91) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3257) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2401 104 a Fx(Chapter)20
+b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p Black 396
+309 a Fj(10.1.3.2.)29 b(Ad)o(ding)e(suppor)r(t)g(f)n(or)h(an)f(ar)n(c)o
+(hitecture)2450 309 y
+SDict begin H.S end
+ 2450 309 a 2450 309 a
+SDict begin 15.6 H.A end
+ 2450 309
+a 2450 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.37.10.3) cvn H.B /DEST
+pdfmark end
+ 2450 309 a -2 497 a
+SDict begin H.S end
+ -2 497 a -2 497 a
+SDict begin 13 H.A end
+ -2
+497 a -2 497 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3217) cvn H.B /DEST pdfmark
+end
+ -2 497 a 396 583 a FC(T)-7 b(o)21 b(add)e(support)g(for)
+h(another)e(architecture)h Ff(<)p FC(arch)p Ff(>)p FC(,)g(just)h
+(create)g(the)g(tw)o(o)h(\002les)2812 583 y
+SDict begin H.S end
+ 2812 583
+a 2812 583 a
+SDict begin 13 H.A end
+ 2812 583 a 2812 583 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3218) cvn H.B /DEST pdfmark
+end
+ 2812 583 a Fh(<)p
+Fr(arch)p Fh(>)p Fr(.configure)396 691 y FC(\(con\002gure)d(options\))h
+(and)1192 691 y
+SDict begin H.S end
+ 1192 691 a 1192 691 a
+SDict begin 13 H.A end
+ 1192 691 a 1192
+691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3219) cvn H.B /DEST pdfmark
+end
+ 1192 691 a Fh(<)p Fr(arch)p Fh(>)p Fr(.samhainrc)f
+FC(\(runtime)g(con\002guration\))f(in)k(the)2965 691
+y
+SDict begin H.S end
+ 2965 691 a 2965 691 a
+SDict begin 13 H.A end
+ 2965 691 a 2965 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3220) cvn H.B /DEST pdfmark
+end
+ 2965 691
+a Fr(configs)f FC(directory)e(of)396 799 y(the)i(deplo)o(yment)e
+(system)j(\(see)p 0 TeXcolorgray 1336 799 a
+SDict begin H.S end
+ 1336 799
+a FC(Section)f(10.1.2)1816 799 y
+SDict begin 13 H.L end
+ 1816 799 a 1816 799
+a
+SDict begin [ /Subtype /Link /Dest (0:DEPLOY-LAYOUT) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1816 799 a Black -2 w FC(>\).)-2 983 y
+SDict begin H.S end
+ -2 983 a -2
+983 a
+SDict begin 13 H.A end
+ -2 983 a -2 983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3222) cvn H.B /DEST pdfmark
+end
+ -2 983 a 396 1073 a FC(Upon)f(installation)h
+(of)g(the)g(system,)h(a)f(template)g(\002le)1967 1073
+y
+SDict begin H.S end
+ 1967 1073 a 1967 1073 a
+SDict begin 13 H.A end
+ 1967 1073 a 1967 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3223) cvn H.B /DEST pdfmark
+end
+ 1967
+1073 a Fr(generic.configure)e FC(is)j(created,)e(which)h(contains)f
+(the)396 1180 y(minimum)g(options)g(for)h(a)g(client.)-2
+1209 y
+SDict begin H.S end
+ -2 1209 a -2 1209 a
+SDict begin 13 H.A end
+ -2 1209 a -2 1209 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3224) cvn H.B /DEST pdfmark
+end
+ -2 1209
+a 396 1486 a Fj(10.1.3.3.)29 b(P)m(er)n(-ar)n(c)o(hitecture)g
+(pre-/postinstallation)f(scripts)2901 1486 y
+SDict begin H.S end
+ 2901 1486
+a 2901 1486 a
+SDict begin 15.6 H.A end
+ 2901 1486 a 2901 1486 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.37.11.3) cvn H.B /DEST
+pdfmark end
+ 2901 1486 a -2
+1673 a
+SDict begin H.S end
+ -2 1673 a -2 1673 a
+SDict begin 13 H.A end
+ -2 1673 a -2 1673 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3226) cvn H.B /DEST pdfmark
+end
+ -2 1673
+a -2 1839 a
+SDict begin H.S end
+ -2 1839 a -2 1839 a
+SDict begin 13 H.A end
+ -2 1839 a -2 1839 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3227) cvn H.B /DEST pdfmark
+end
+ -2
+1839 a 396 1926 a FC(The)20 b(def)o(ault)g(scripts)g(for)g
+(preinstallation)e(\(shutting)h(do)n(wn)h(the)g(running)e(client\))i
+(and)f(postinstallation)h(\(setting)396 2034 y(the)g(client)h(passw)o
+(ord,)e(\002xing)g(the)i(local)f(con\002guration)d(\002le\),)k(and)e
+(the)h(script)h(for)e(database)h(initialization)f(are)396
+2142 y(located)h(in)g(the)864 2142 y
+SDict begin H.S end
+ 864 2142 a 864 2142
+a
+SDict begin 13 H.A end
+ 864 2142 a 864 2142 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3228) cvn H.B /DEST pdfmark
+end
+ 864 2142 a Fr(libexec)g FC(directory)-5
+b(.)18 b(Y)-9 b(ou)19 b(can)h(o)o(v)o(erride)e(them)i(for)g(some)g
+(\(or)f(all\))i(architectures)d(by)i(storing)396 2250
+y(architecture-speci\002c)e(\002les)1249 2250 y
+SDict begin H.S end
+ 1249
+2250 a 1249 2250 a
+SDict begin 13 H.A end
+ 1249 2250 a 1249 2250 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3229) cvn H.B /DEST pdfmark
+end
+ 1249 2250
+a Fh(<)p Fr(arch)p Fh(>)p Fr(.preinstall)p FC(,)2083
+2250 y
+SDict begin H.S end
+ 2083 2250 a 2083 2250 a
+SDict begin 13 H.A end
+ 2083 2250 a 2083 2250
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3230) cvn H.B /DEST pdfmark
+end
+ 2083 2250 a Fh(<)p Fr(arch)p Fh(>)p Fr(.postinstall)p
+FC(,)2961 2250 y
+SDict begin H.S end
+ 2961 2250 a 2961 2250 a
+SDict begin 13 H.A end
+ 2961 2250 a
+2961 2250 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3231) cvn H.B /DEST pdfmark
+end
+ 2961 2250 a Fh(<)p Fr(arch)p Fh(>)p Fr(.initscrip)396
+2358 y FC(in)j(the)604 2358 y
+SDict begin H.S end
+ 604 2358 a 604 2358 a
+SDict begin 13 H.A end
+ 604
+2358 a 604 2358 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3232) cvn H.B /DEST pdfmark
+end
+ 604 2358 a Fr(configs)e FC(directory)-5
+b(.)-2 2386 y
+SDict begin H.S end
+ -2 2386 a -2 2386 a
+SDict begin 13 H.A end
+ -2 2386 a -2 2386 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3233) cvn H.B /DEST pdfmark
+end
+
+-2 2386 a 396 2664 a Fj(10.1.3.4.)29 b(P)m(er)n(-host)f(runtime)g
+(con\002guration)2269 2664 y
+SDict begin H.S end
+ 2269 2664 a 2269 2664 a
+SDict begin 15.6 H.A end
+
+2269 2664 a 2269 2664 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.37.12.3) cvn H.B /DEST
+pdfmark end
+ 2269 2664 a -2 2852 a
+SDict begin H.S end
+ -2 2852
+a -2 2852 a
+SDict begin 13 H.A end
+ -2 2852 a -2 2852 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3235) cvn H.B /DEST pdfmark
+end
+ -2 2852 a 396 2938 a
+FC(If)20 b(you)g(w)o(ant)g(to)g(o)o(v)o(erride)e(the)i(runtime)f
+(con\002guration)f(\002le)2171 2938 y
+SDict begin H.S end
+ 2171 2938 a 2171
+2938 a
+SDict begin 13 H.A end
+ 2171 2938 a 2171 2938 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3236) cvn H.B /DEST pdfmark
+end
+ 2171 2938 a Fr(configs/)p
+Fh(<)p Fr(arch)p Fh(>)p Fr(.samhainrc)e FC(on)k(a)h(per)n(-host)396
+3046 y(basis,)g(you)e(need)h(to)g(store)g(a)h(host-speci\002c)e
+(runtime)g(con\002guration)f(\002le)j(as)396 3154 y
+SDict begin H.S end
+ 396
+3154 a 396 3154 a
+SDict begin 13 H.A end
+ 396 3154 a 396 3154 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3237) cvn H.B /DEST pdfmark
+end
+ 396 3154 a Fr(hosts/)p
+Fh(<)p Fr(hostname)p Fh(>)p Fr(/samhainrc)p FC(,)16 b(before)j(you)g
+(run)2143 3154 y
+SDict begin H.S end
+ 2143 3154 a 2143 3154 a
+SDict begin 13 H.A end
+ 2143 3154 a
+2143 3154 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3238) cvn H.B /DEST pdfmark
+end
+ 2143 3154 a Fy(deploy)-6 b(.sh)20 b(install)p
+FC(.)-2 3265 y
+SDict begin H.S end
+ -2 3265 a -2 3265 a
+SDict begin 13 H.A end
+ -2 3265 a -2 3265
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-SCRIPT) cvn H.B /DEST
+pdfmark end
+ -2 3265 a 396 3575 a Fp(10.1.4.)36 b(Using)e(the)g(deplo)n(y)-10
+b(.sh)35 b(script)2277 3575 y
+SDict begin H.S end
+ 2277 3575 a 2277 3575 a
+SDict begin 18.72 H.A end
+
+2277 3575 a 2277 3575 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.38.2) cvn H.B /DEST pdfmark
+end
+ 2277 3575 a -2 3602 a
+SDict begin H.S end
+ -2 3602
+a -2 3602 a
+SDict begin 11.7 H.A end
+ -2 3602 a -2 3602 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3241) cvn H.B /DEST pdfmark
+end
+ -2 3602 a -2 3726 a
+SDict begin H.S end
+ -2
+3726 a -2 3726 a
+SDict begin 11.7 H.A end
+ -2 3726 a -2 3726 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3243) cvn H.B /DEST pdfmark
+end
+ -2 3726 a 562 3797
+a Fw(Tip:)20 b Fv(When)f(r)q(un)h(f)n(or)g(the)f(\002rst)i(time)o(,)
+1619 3797 y
+SDict begin H.S end
+ 1619 3797 a 1619 3797 a
+SDict begin 11.7 H.A end
+ 1619 3797 a 1619
+3797 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3244) cvn H.B /DEST pdfmark
+end
+ 1619 3797 a Fw(deplo)o(y)-6 b(.sh)17 b Fv(will)i(create)h(a)g
+(con\002gur)o(ation)e(\002le)2960 3797 y
+SDict begin H.S end
+ 2960 3797 a
+2960 3797 a
+SDict begin 11.7 H.A end
+ 2960 3797 a 2960 3797 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3245) cvn H.B /DEST pdfmark
+end
+ 2960 3797 a Ft(~/.deploy.conf)26
+b Fv(with)562 3894 y(some)21 b(def)n(ault)d(con\002gur)o(ation)f
+(options)o(.)i(Y)-10 b(ou)19 b(ma)n(y)i(w)o(ant)e(to)h(re)n(vie)o(w)f
+(this)h(\002le)o(.)g(Note)g(that)f(y)o(ou)h(can)g(o)o(v)n(err)q(ide)562
+3991 y(all)g(options)e(there)i(with)f(command-line)f(options;)h(the)g
+(con\002gur)o(ation)f(\002le)i(is)h(just)f(f)n(or)g(con)o(v)n(enience)o
+(,)d(if)j(y)o(ou)562 4088 y(don't)f(lik)o(e)g(the)h(def)n(aults)e(and)i
+(don't)e(w)o(ant)i(to)g(type)g(the)g(corresponding)d(option)h(on)i(the)
+g(command)f(line)562 4186 y(e)n(v)n(er)r(y)i(time)o(.)-2
+4501 y
+SDict begin H.S end
+ -2 4501 a -2 4501 a
+SDict begin 13 H.A end
+ -2 4501 a -2 4501 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3246) cvn H.B /DEST pdfmark
+end
+ -2 4501
+a -2 4501 a
+SDict begin H.S end
+ -2 4501 a -2 4501 a
+SDict begin 13 H.A end
+ -2 4501 a -2 4501 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3247) cvn H.B /DEST pdfmark
+end
+ -2
+4501 a 396 4609 a Fy(deploy)-6 b(.sh)21 b FC(can)f(be)g(in)m(v)n(ok)o
+(ed)e(in)j(three)e(w)o(ays:)-2 4710 y
+SDict begin H.S end
+ -2 4710 a -2 4710
+a
+SDict begin 11.7 H.A end
+ -2 4710 a -2 4710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3248) cvn H.B /DEST pdfmark
+end
+ -2 4710 a -2 4710 a
+SDict begin H.S end
+ -2 4710 a -2
+4710 a
+SDict begin 11.7 H.A end
+ -2 4710 a -2 4710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3249) cvn H.B /DEST pdfmark
+end
+ -2 4710 a 396 4789 a Ft(bash$)596
+4789 y
+SDict begin H.S end
+ 596 4789 a 596 4789 a
+SDict begin 11.7 H.A end
+ 596 4789 a 596 4789 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3250) cvn H.B /DEST pdfmark
+end
+ 596
+4789 a Fs(deploy.sh)45 b(--help)396 4886 y Fr(This)f(will)h(provide)e
+(a)i(general)f(overview.)-2 4898 y
+SDict begin H.S end
+ -2 4898 a -2 4898
+a
+SDict begin 11.7 H.A end
+ -2 4898 a -2 4898 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3251) cvn H.B /DEST pdfmark
+end
+ -2 4898 a 396 4983 a Ft(bash$)596
+4983 y
+SDict begin H.S end
+ 596 4983 a 596 4983 a
+SDict begin 11.7 H.A end
+ 596 4983 a 596 4983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3252) cvn H.B /DEST pdfmark
+end
+ 596
+4983 a Fs(deploy.sh)h(--help)e(command)396 5081 y Fr(This)h(will)h
+(provide)e(help)h(on)h(a)g(specific)e(command)h(\(where)g(command)f
+(can)i(be)f(any)g(of:)396 5178 y('clean',)g('download',)f('checksrc',)g
+('build',)g(or)i('install'.)-2 5187 y
+SDict begin H.S end
+ -2 5187 a -2 5187
+a
+SDict begin 11.7 H.A end
+ -2 5187 a -2 5187 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3253) cvn H.B /DEST pdfmark
+end
+ -2 5187 a 396 5275 a Ft(bash$)596
+5275 y
+SDict begin H.S end
+ 596 5275 a 596 5275 a
+SDict begin 11.7 H.A end
+ 596 5275 a 596 5275 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3254) cvn H.B /DEST pdfmark
+end
+ 596
+5275 a Fs(deploy.sh)g([options])f(command)396 5372 y
+Fr(This)g(will)h(run)f('command')f(with)h(the)h(specified)e(options.)p
+Black 3661 5805 a Fx(91)p Black eop end
+%%Page: 92 97
+TeXDict begin 92 96 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.92) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3255) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(A)g(log)f(of)g(the)g(last)h(run)e(will)i(be)f(k)o
+(ept)g(in)1581 309 y
+SDict begin H.S end
+ 1581 309 a 1581 309 a
+SDict begin 13 H.A end
+ 1581 309 a
+1581 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3256) cvn H.B /DEST pdfmark
+end
+ 1581 309 a Fr(tmp/logfile.lastrun)396 583
+y Fx(command)h FC(can)f(be)g(an)o(y)g(of)f(the)i(follo)n(wing:)-2
+601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3259) cvn H.B /DEST pdfmark
+end
+ -2 601 a -2
+725 a
+SDict begin H.S end
+ -2 725 a -2 725 a
+SDict begin 13 H.A end
+ -2 725 a -2 725 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3261) cvn H.B /DEST pdfmark
+end
+ -2 725 a 396
+815 a FC(info)-2 816 y
+SDict begin H.S end
+ -2 816 a -2 816 a
+SDict begin 13 H.A end
+ -2 816 a -2
+816 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3262) cvn H.B /DEST pdfmark
+end
+ -2 816 a Black Black 562 965 a
+SDict begin H.S end
+ 562 965 a 562 965
+a
+SDict begin 13 H.A end
+ 562 965 a 562 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3263) cvn H.B /DEST pdfmark
+end
+ 562 965 a FC(Pro)o(vides)e(information)f(on)i
+(installed)g(clients,)g(or)g(a)n(v)n(ailable)g(installer)g(packages.)-2
+1066 y
+SDict begin H.S end
+ -2 1066 a -2 1066 a
+SDict begin 13 H.A end
+ -2 1066 a -2 1066 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3265) cvn H.B /DEST pdfmark
+end
+ -2 1066
+a 396 1156 a FC(clean)-2 1157 y
+SDict begin H.S end
+ -2 1157 a -2 1157 a
+SDict begin 13 H.A end
+ -2
+1157 a -2 1157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3266) cvn H.B /DEST pdfmark
+end
+ -2 1157 a Black Black 562 1305 a
+SDict begin H.S end
+ 562
+1305 a 562 1305 a
+SDict begin 13 H.A end
+ 562 1305 a 562 1305 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3267) cvn H.B /DEST pdfmark
+end
+ 562 1305 a FC(Remo)o(v)o(es)g
+(source)f(tarballs)h(from)f(the)1697 1305 y
+SDict begin H.S end
+ 1697 1305
+a 1697 1305 a
+SDict begin 13 H.A end
+ 1697 1305 a 1697 1305 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3268) cvn H.B /DEST pdfmark
+end
+ 1697 1305 a Fr(source)g
+FC(subdirectory)f(of)i(the)g(deplo)o(y)f(system.)h(Remo)o(v)o(es)g
+(unused)562 1413 y(installer)h(packages)e(from)g(the)1480
+1413 y
+SDict begin H.S end
+ 1480 1413 a 1480 1413 a
+SDict begin 13 H.A end
+ 1480 1413 a 1480 1413
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3269) cvn H.B /DEST pdfmark
+end
+ 1480 1413 a Fr(archpkg/)p Fh(<)p Fr(arch)p Fh(>)f FC(subdirectories)h
+(of)h(the)g(deplo)o(y)f(system.)-2 1514 y
+SDict begin H.S end
+ -2 1514 a -2
+1514 a
+SDict begin 13 H.A end
+ -2 1514 a -2 1514 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3271) cvn H.B /DEST pdfmark
+end
+ -2 1514 a 396 1604 a FC(do)n(wnload)-2
+1605 y
+SDict begin H.S end
+ -2 1605 a -2 1605 a
+SDict begin 13 H.A end
+ -2 1605 a -2 1605 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3272) cvn H.B /DEST pdfmark
+end
+ -2 1605
+a Black Black 562 1753 a
+SDict begin H.S end
+ 562 1753 a 562 1753 a
+SDict begin 13 H.A end
+ 562 1753
+a 562 1753 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3273) cvn H.B /DEST pdfmark
+end
+ 562 1753 a FC(Do)n(wnload)g(a)h(source)g(tarball)g(from)f
+(the)h(distrib)n(ution)f(site,)i(v)o(erify)e(the)h(GnuPG)g(signature)f
+(\(gpg)g(must)h(be)562 1861 y(installed\),)g(and)f(install)i(it)g(into)
+f(the)1616 1861 y
+SDict begin H.S end
+ 1616 1861 a 1616 1861 a
+SDict begin 13 H.A end
+ 1616 1861 a
+1616 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3274) cvn H.B /DEST pdfmark
+end
+ 1616 1861 a Fr(source)g FC(subdirectory)e(of)i(the)g(deplo)
+o(y)f(system.)3072 1861 y
+SDict begin H.S end
+ 3072 1861 a 3072 1861 a
+SDict begin 13 H.A end
+ 3072
+1861 a 3072 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3275) cvn H.B /DEST pdfmark
+end
+ 3072 1861 a Fx(Requir)m(es)h FC(one)f(of:)562
+1969 y
+SDict begin H.S end
+ 562 1969 a 562 1969 a
+SDict begin 13 H.A end
+ 562 1969 a 562 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3276) cvn H.B /DEST pdfmark
+end
+ 562
+1969 a Fy(wget)p FC(,)770 1969 y
+SDict begin H.S end
+ 770 1969 a 770 1969
+a
+SDict begin 13 H.A end
+ 770 1969 a 770 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3277) cvn H.B /DEST pdfmark
+end
+ 770 1969 a Fy(curl)p FC(,)954
+1969 y
+SDict begin H.S end
+ 954 1969 a 954 1969 a
+SDict begin 13 H.A end
+ 954 1969 a 954 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3278) cvn H.B /DEST pdfmark
+end
+ 954
+1969 a Fy(links)p FC(,)1167 1969 y
+SDict begin H.S end
+ 1167 1969 a 1167 1969
+a
+SDict begin 13 H.A end
+ 1167 1969 a 1167 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3279) cvn H.B /DEST pdfmark
+end
+ 1167 1969 a Fy(lynx)p FC(,)1360
+1969 y
+SDict begin H.S end
+ 1360 1969 a 1360 1969 a
+SDict begin 13 H.A end
+ 1360 1969 a 1360 1969
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3280) cvn H.B /DEST pdfmark
+end
+ 1360 1969 a Fy(fetch)p FC(,)h(or)1667 1969 y
+SDict begin H.S end
+ 1667 1969
+a 1667 1969 a
+SDict begin 13 H.A end
+ 1667 1969 a 1667 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3281) cvn H.B /DEST pdfmark
+end
+ 1667 1969 a Fy(lwp-r)o(equest)p
+FC(.)-2 2069 y
+SDict begin H.S end
+ -2 2069 a -2 2069 a
+SDict begin 13 H.A end
+ -2 2069 a -2 2069
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3283) cvn H.B /DEST pdfmark
+end
+ -2 2069 a 396 2160 a FC(checksrc)-2 2161 y
+SDict begin H.S end
+ -2 2161
+a -2 2161 a
+SDict begin 13 H.A end
+ -2 2161 a -2 2161 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3284) cvn H.B /DEST pdfmark
+end
+ -2 2161 a Black Black
+562 2310 a
+SDict begin H.S end
+ 562 2310 a 562 2310 a
+SDict begin 13 H.A end
+ 562 2310 a 562 2310
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3285) cvn H.B /DEST pdfmark
+end
+ 562 2310 a FC(Check)g(the)g(GnuPG)g(signatures)g(of)g(a)n(v)n
+(ailable)f(source)h(tarballs)g(in)g(the)2661 2310 y
+SDict begin H.S end
+ 2661
+2310 a 2661 2310 a
+SDict begin 13 H.A end
+ 2661 2310 a 2661 2310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3286) cvn H.B /DEST pdfmark
+end
+ 2661 2310
+a Fr(source)g FC(subdirectory)e(of)i(the)562 2417 y(deplo)o(y)f(system)
+i(\(gpg)e(must)h(be)g(installed\).)f(Optionally)g(delete)h(tarballs)h
+(with)f(no/in)m(v)n(alid)e(signature.)-2 2518 y
+SDict begin H.S end
+ -2 2518
+a -2 2518 a
+SDict begin 13 H.A end
+ -2 2518 a -2 2518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3288) cvn H.B /DEST pdfmark
+end
+ -2 2518 a 396 2608 a
+FC(b)n(uild)-2 2609 y
+SDict begin H.S end
+ -2 2609 a -2 2609 a
+SDict begin 13 H.A end
+ -2 2609 a -2
+2609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3289) cvn H.B /DEST pdfmark
+end
+ -2 2609 a Black Black 562 2758 a
+SDict begin H.S end
+ 562 2758 a 562
+2758 a
+SDict begin 13 H.A end
+ 562 2758 a 562 2758 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3290) cvn H.B /DEST pdfmark
+end
+ 562 2758 a FC(Build)j(a)f(binary)f
+(installer)h(package)f(for)h(the)g(chosen)f(architecture)g(from)g(one)h
+(of)f(the)i(tarballs)f(in)g(the)562 2866 y
+SDict begin H.S end
+ 562 2866 a
+562 2866 a
+SDict begin 13 H.A end
+ 562 2866 a 562 2866 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3291) cvn H.B /DEST pdfmark
+end
+ 562 2866 a Fr(source)g
+FC(subdirectory)-5 b(,)17 b(and)j(store)g(it)h(in)f(the)1900
+2866 y
+SDict begin H.S end
+ 1900 2866 a 1900 2866 a
+SDict begin 13 H.A end
+ 1900 2866 a 1900 2866
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3292) cvn H.B /DEST pdfmark
+end
+ 1900 2866 a Fr(archpkg/)p Fh(<)p Fr(architecture)p
+Fh(>)d FC(subdirectory)h(\(which)562 2974 y(will)j(be)f(created)g(if)g
+(it)h(does)f(not)g(e)o(xist)g(yet\).)g(Requires)g(a)g(\002le)2357
+2974 y
+SDict begin H.S end
+ 2357 2974 a 2357 2974 a
+SDict begin 13 H.A end
+ 2357 2974 a 2357 2974
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3293) cvn H.B /DEST pdfmark
+end
+ 2357 2974 a Fh(<)p Fr(architecture)p Fh(>)p Fr(.configure)d
+FC(and)i(a)562 3082 y(\002le)689 3082 y
+SDict begin H.S end
+ 689 3082 a 689
+3082 a
+SDict begin 13 H.A end
+ 689 3082 a 689 3082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3294) cvn H.B /DEST pdfmark
+end
+ 689 3082 a Fh(<)p Fr(architecture)p
+Fh(>)p Fr(.samhainrc)e FC(in)j(the)2023 3082 y
+SDict begin H.S end
+ 2023 3082
+a 2023 3082 a
+SDict begin 13 H.A end
+ 2023 3082 a 2023 3082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3295) cvn H.B /DEST pdfmark
+end
+ 2023 3082 a Fr(configs)g
+FC(subdirectory)-5 b(.)-2 3183 y
+SDict begin H.S end
+ -2 3183 a -2 3183 a
+SDict begin 13 H.A end
+
+-2 3183 a -2 3183 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3297) cvn H.B /DEST pdfmark
+end
+ -2 3183 a 396 3273 a FC(install)-2
+3274 y
+SDict begin H.S end
+ -2 3274 a -2 3274 a
+SDict begin 13 H.A end
+ -2 3274 a -2 3274 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3298) cvn H.B /DEST pdfmark
+end
+ -2 3274
+a Black Black 562 3422 a
+SDict begin H.S end
+ 562 3422 a 562 3422 a
+SDict begin 13 H.A end
+ 562 3422
+a 562 3422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3299) cvn H.B /DEST pdfmark
+end
+ 562 3422 a FC(Cop)o(y)20 b(a)h(pre-b)n(uilt)e(binary)g
+(package)f(\(b)n(uilt)i(with)2018 3422 y
+SDict begin H.S end
+ 2018 3422 a
+2018 3422 a
+SDict begin 13 H.A end
+ 2018 3422 a 2018 3422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3300) cvn H.B /DEST pdfmark
+end
+ 2018 3422 a Fy(deploy)-6
+b(.sh)20 b(b)n(uild)p FC(\))i(to)e(a)h(remote)e(host,)h(stop)g(the)g
+(client)562 3530 y(running)e(there)i(\(if)g(an)o(y\),)e(install)j(the)f
+(\(ne)n(w\))f(client,)h(update)f(the)h(serv)o(er)f(con\002guration)f
+(\002le)i(and)g(reload)f(the)562 3638 y(serv)o(er)m(,)g(initialize)h
+(the)h(\002le)f(signature)g(database)f(and)h(fetch)g(it)g(from)g(the)g
+(remote)f(host.)-2 3739 y
+SDict begin H.S end
+ -2 3739 a -2 3739 a
+SDict begin 13 H.A end
+ -2 3739
+a -2 3739 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3302) cvn H.B /DEST pdfmark
+end
+ -2 3739 a 396 3829 a FC(uninstall)-2 3830
+y
+SDict begin H.S end
+ -2 3830 a -2 3830 a
+SDict begin 13 H.A end
+ -2 3830 a -2 3830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3303) cvn H.B /DEST pdfmark
+end
+ -2 3830 a Black
+Black 562 3978 a
+SDict begin H.S end
+ 562 3978 a 562 3978 a
+SDict begin 13 H.A end
+ 562 3978 a 562
+3978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3304) cvn H.B /DEST pdfmark
+end
+ 562 3978 a FC(Remo)o(v)o(e)g(a)i(samhain)e(client)i(that)f(w)o
+(as)h(pre)n(viously)d(installed)i(with)2552 3978 y
+SDict begin H.S end
+ 2552
+3978 a 2552 3978 a
+SDict begin 13 H.A end
+ 2552 3978 a 2552 3978 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3305) cvn H.B /DEST pdfmark
+end
+ 2552 3978
+a Fy(deploy)-6 b(.sh)20 b(install)p FC(.)-2 3996 y
+SDict begin H.S end
+ -2
+3996 a -2 3996 a
+SDict begin 13 H.A end
+ -2 3996 a -2 3996 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-SH-GENERAL) cvn H.B
+/DEST pdfmark end
+ -2 3996 a 396 4266
+a Fj(10.1.4.1.)29 b(General)e(options)1570 4266 y
+SDict begin H.S end
+ 1570
+4266 a 1570 4266 a
+SDict begin 15.6 H.A end
+ 1570 4266 a 1570 4266 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.38.13.3) cvn H.B /DEST
+pdfmark end
+ 1570 4266
+a -2 4452 a
+SDict begin H.S end
+ -2 4452 a -2 4452 a
+SDict begin 13 H.A end
+ -2 4452 a -2 4452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3308) cvn H.B /DEST pdfmark
+end
+ -2
+4452 a -2 4452 a
+SDict begin H.S end
+ -2 4452 a -2 4452 a
+SDict begin 13 H.A end
+ -2 4452 a -2 4452
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3309) cvn H.B /DEST pdfmark
+end
+ -2 4452 a 396 4540 a Fy(-q)21 b(|)g(--quiet)f(|)h(--quiet=2)f
+FC(Produce)e(output)h(suitable)h(for)g(logging.)e(Note)i(that)h
+(--quiet=2)d(implies)i(--yes)g(\(see)396 4647 y(belo)n(w\).)-2
+4828 y
+SDict begin H.S end
+ -2 4828 a -2 4828 a
+SDict begin 13 H.A end
+ -2 4828 a -2 4828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3310) cvn H.B /DEST pdfmark
+end
+ -2 4828
+a -2 4828 a
+SDict begin H.S end
+ -2 4828 a -2 4828 a
+SDict begin 13 H.A end
+ -2 4828 a -2 4828 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3311) cvn H.B /DEST pdfmark
+end
+ -2
+4828 a 396 4921 a Fy(-s)h(|)g(--simulate)f FC(Print)g(what)g(w)o(ould)g
+(be)g(done,)f(b)n(ut)h(do)g(not)g(actually)f(change)g(the)h(system.)-2
+5105 y
+SDict begin H.S end
+ -2 5105 a -2 5105 a
+SDict begin 13 H.A end
+ -2 5105 a -2 5105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3312) cvn H.B /DEST pdfmark
+end
+ -2 5105
+a -2 5105 a
+SDict begin H.S end
+ -2 5105 a -2 5105 a
+SDict begin 13 H.A end
+ -2 5105 a -2 5105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3313) cvn H.B /DEST pdfmark
+end
+ -2
+5105 a 396 5195 a Fy(-y)g(|)h(--y)o(es)f FC(Assume)g(yes)h(as)g(answer)
+f(to)g(all)h(prompts)e(and)g(run)h(non-interacti)n(v)o(ely)-5
+b(.)p Black 3661 5805 a Fx(92)p Black eop end
+%%Page: 93 98
+TeXDict begin 93 97 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.93) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3314) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3315) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(-o)f Ff(<)p Fy(\002le)p Ff(>)g Fy(|)h(--log\002le=)p
+Ff(<)p Fy(\002le)p Ff(>)e FC(Specify)g(an)i(output)d(\002le)j(for)f
+(messages)g(that)h(w)o(ould)e(go)h(to)g(stdout)g(otherwise.)396
+417 y(Has)h(no)f(ef)n(fect)g(on)f(stderr)h(\(error)f(messages\).)-2
+601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3316) cvn H.B /DEST pdfmark
+end
+ -2 601 a -2
+601 a
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3317) cvn H.B /DEST pdfmark
+end
+ -2 601 a 396
+691 a Fy(-d)i Ff(<)p Fy(dialog)p Ff(>)e Fy(|)i(--dialog=)p
+Ff(<)p Fy(dialog)p Ff(>)c FC(Specify)i(your)g(preferred)f("dialog")h
+(clone)h(\(e.g.)f(Xdialog\).)g(Use)i("no")e(to)396 799
+y(force)h(plain)f(te)o(xt.)-2 910 y
+SDict begin H.S end
+ -2 910 a -2 910 a
+SDict begin 13 H.A end
+
+-2 910 a -2 910 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-INFO) cvn H.B /DEST
+pdfmark end
+ -2 910 a 396 1220 a Fp(10.1.5.)36 b(deplo)n(y)-10
+b(.sh)35 b(inf)n(o)1591 1220 y
+SDict begin H.S end
+ 1591 1220 a 1591 1220
+a
+SDict begin 18.72 H.A end
+ 1591 1220 a 1591 1220 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.39.2) cvn H.B /DEST pdfmark
+end
+ 1591 1220 a -2 1411 a
+SDict begin H.S end
+ -2 1411
+a -2 1411 a
+SDict begin 13 H.A end
+ -2 1411 a -2 1411 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3320) cvn H.B /DEST pdfmark
+end
+ -2 1411 a 396 1494 a
+FC(This)21 b(command)d(will)j(sho)n(w)f(information)d(for)j(hosts)g(in)
+h(the)f(client)g(database)g(\(def)o(ault\),)e(or)i(for)g(a)n(v)n
+(ailable)396 1602 y(binary)f(installer)h(packages.)-2
+1620 y
+SDict begin H.S end
+ -2 1620 a -2 1620 a
+SDict begin 13 H.A end
+ -2 1620 a -2 1620 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-INFO-OPT) cvn H.B /DEST
+pdfmark end
+ -2 1620
+a 396 1889 a Fj(10.1.5.1.)29 b(Speci\002c)f(options)1581
+1889 y
+SDict begin H.S end
+ 1581 1889 a 1581 1889 a
+SDict begin 15.6 H.A end
+ 1581 1889 a 1581 1889
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.39.14.3) cvn H.B /DEST
+pdfmark end
+ 1581 1889 a -2 2076 a
+SDict begin H.S end
+ -2 2076 a -2 2076 a
+SDict begin 13 H.A end
+ -2 2076 a
+-2 2076 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3323) cvn H.B /DEST pdfmark
+end
+ -2 2076 a -2 2076 a
+SDict begin H.S end
+ -2 2076 a -2 2076 a
+SDict begin 13 H.A end
+ -2
+2076 a -2 2076 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3324) cvn H.B /DEST pdfmark
+end
+ -2 2076 a 396 2163 a Fy(--packages)19
+b FC(Sho)n(w)h(information)e(for)h(a)n(v)n(ailable)h(installer)g
+(packages)f(rather)h(than)f(for)h(clients.)-2 2275 y
+SDict begin H.S end
+
+-2 2275 a -2 2275 a
+SDict begin 13 H.A end
+ -2 2275 a -2 2275 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-CLEAN) cvn H.B /DEST
+pdfmark end
+ -2 2275 a 396
+2585 a Fp(10.1.6.)36 b(deplo)n(y)-10 b(.sh)35 b(c)n(lean)1676
+2585 y
+SDict begin H.S end
+ 1676 2585 a 1676 2585 a
+SDict begin 18.72 H.A end
+ 1676 2585 a 1676 2585
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.40.2) cvn H.B /DEST pdfmark
+end
+ 1676 2585 a -2 2775 a
+SDict begin H.S end
+ -2 2775 a -2 2775 a
+SDict begin 13 H.A end
+ -2 2775 a
+-2 2775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3327) cvn H.B /DEST pdfmark
+end
+ -2 2775 a 396 2859 a FC(This)21 b(command)d(will)j(clean)f
+(unused)f(\002les:)i(source)e(tarballs)h(in)h(the)2407
+2859 y
+SDict begin H.S end
+ 2407 2859 a 2407 2859 a
+SDict begin 13 H.A end
+ 2407 2859 a 2407 2859
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3328) cvn H.B /DEST pdfmark
+end
+ 2407 2859 a Fr(source)f FC(subdirectory)-5 b(,)17 b(and)j(unused)396
+2967 y(installer)h(packages)e(in)h(the)1217 2967 y
+SDict begin H.S end
+ 1217
+2967 a 1217 2967 a
+SDict begin 13 H.A end
+ 1217 2967 a 1217 2967 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3329) cvn H.B /DEST pdfmark
+end
+ 1217 2967
+a Fr(archpkg/)p Fh(<)p Fr(arch)p Fh(>)e FC(subdirectories.)-2
+2985 y
+SDict begin H.S end
+ -2 2985 a -2 2985 a
+SDict begin 13 H.A end
+ -2 2985 a -2 2985 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-CLEAN-OPT) cvn H.B /DEST
+pdfmark end
+ -2 2985
+a 396 3254 a Fj(10.1.6.1.)29 b(Speci\002c)f(options)1581
+3254 y
+SDict begin H.S end
+ 1581 3254 a 1581 3254 a
+SDict begin 15.6 H.A end
+ 1581 3254 a 1581 3254
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.40.15.3) cvn H.B /DEST
+pdfmark end
+ 1581 3254 a -2 3440 a
+SDict begin H.S end
+ -2 3440 a -2 3440 a
+SDict begin 13 H.A end
+ -2 3440 a
+-2 3440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3332) cvn H.B /DEST pdfmark
+end
+ -2 3440 a 396 3528 a FC(There)20 b(are)g(no)g(speci\002c)g
+(options)f(for)h(this)g(command.)-2 3639 y
+SDict begin H.S end
+ -2 3639 a
+-2 3639 a
+SDict begin 13 H.A end
+ -2 3639 a -2 3639 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-DOWNLOAD) cvn H.B /DEST
+pdfmark end
+ -2 3639 a 396 3949 a Fp(10.1.7.)36
+b(deplo)n(y)-10 b(.sh)35 b(do)n(wnload)1929 3949 y
+SDict begin H.S end
+ 1929
+3949 a 1929 3949 a
+SDict begin 18.72 H.A end
+ 1929 3949 a 1929 3949 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.41.2) cvn H.B /DEST pdfmark
+end
+ 1929 3949
+a -2 4140 a
+SDict begin H.S end
+ -2 4140 a -2 4140 a
+SDict begin 13 H.A end
+ -2 4140 a -2 4140 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3335) cvn H.B /DEST pdfmark
+end
+ -2
+4140 a 396 4223 a FC(This)21 b(command)d(will)j(do)n(wnload)d(a)i
+(source)g(tarball)g(from)f(the)h(distrib)n(ution)f(website,)h(v)o
+(erify)f(its)i(GnuPG)396 4331 y(signature,)e(and)h(install)h(it)f(into)
+g(the)1446 4331 y
+SDict begin H.S end
+ 1446 4331 a 1446 4331 a
+SDict begin 13 H.A end
+ 1446 4331 a
+1446 4331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3336) cvn H.B /DEST pdfmark
+end
+ 1446 4331 a Fr(source)f FC(subdirectory)-5
+b(.)17 b(This)k(command)d(requires)h(that)h(either)3346
+4331 y
+SDict begin H.S end
+ 3346 4331 a 3346 4331 a
+SDict begin 13 H.A end
+ 3346 4331 a 3346 4331
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3337) cvn H.B /DEST pdfmark
+end
+ 3346 4331 a Fy(wget)g FC(or)396 4439 y
+SDict begin H.S end
+ 396 4439 a 396
+4439 a
+SDict begin 13 H.A end
+ 396 4439 a 396 4439 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3338) cvn H.B /DEST pdfmark
+end
+ 396 4439 a Fy(lynx)g FC(is)h(in)g(your)e
+(P)-8 b(A)f(TH.)-2 4457 y
+SDict begin H.S end
+ -2 4457 a -2 4457 a
+SDict begin 11.7 H.A end
+ -2 4457
+a -2 4457 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3339) cvn H.B /DEST pdfmark
+end
+ -2 4457 a -2 4582 a
+SDict begin H.S end
+ -2 4582 a -2 4582 a
+SDict begin 11.7 H.A end
+ -2
+4582 a -2 4582 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3341) cvn H.B /DEST pdfmark
+end
+ -2 4582 a 562 4661 a Fw(Man)o(ual)20
+b(installation)d(of)j(sour)o(ce:)e Fv(This)i(note)g(applies)e(if)i(y)o
+(ou)g(w)o(ant)f(to)h(do)o(wnload)e(source)i(man)o(ually)562
+4758 y(instead.)f(Samhain)f(distr)q(ib)o(ution)f(tarballs)i(contain)f
+(e)n(xactly)i(tw)o(o)h(\002les:)f(\002rst,)h(a)f(source)g(tarball)e
+(with)i(the)562 4855 y(source)g(code)o(,)g(and)f(second,)h(its)g(Gn)o
+(uPG)g(signature)o(.)e(F)n(or)i(installation)c(into)k(the)2920
+4855 y
+SDict begin H.S end
+ 2920 4855 a 2920 4855 a
+SDict begin 11.7 H.A end
+ 2920 4855 a 2920 4855
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3342) cvn H.B /DEST pdfmark
+end
+ 2920 4855 a Ft(source)j Fv(subdirector)r(y)-7 b(,)18
+b(the)562 4952 y(distr)q(ib)o(ution)f(tarball)h(m)o(ust)j(be)f(unpac)o
+(k)o(ed,)e(and)h(both)g(the)h(source)g(source)g(tarball)e(and)h(its)i
+(Gn)o(uPG)562 5049 y(signature)d(mo)o(v)n(ed)i(into)g(the)1398
+5049 y
+SDict begin H.S end
+ 1398 5049 a 1398 5049 a
+SDict begin 11.7 H.A end
+ 1398 5049 a 1398 5049
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3343) cvn H.B /DEST pdfmark
+end
+ 1398 5049 a Ft(source)j Fv(subdirector)r(y)-7 b(.)39
+5199 y
+SDict begin H.S end
+ 39 5199 a 39 5199 a
+SDict begin 13 H.A end
+ 39 5199 a 39 5199 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-DOWNLOAD-OPT) cvn H.B
+/DEST pdfmark end
+ 39 5199
+a Black 3661 5805 a Fx(93)p Black eop end
+%%Page: 94 99
+TeXDict begin 94 98 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.94) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black 396 309 a Fj(10.1.7.1.)29 b(Speci\002c)f(options)1581
+309 y
+SDict begin H.S end
+ 1581 309 a 1581 309 a
+SDict begin 15.6 H.A end
+ 1581 309 a 1581 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.41.16.3) cvn H.B /DEST
+pdfmark end
+ 1581
+309 a -2 495 a
+SDict begin H.S end
+ -2 495 a -2 495 a
+SDict begin 13 H.A end
+ -2 495 a -2 495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3346) cvn H.B /DEST pdfmark
+end
+ -2
+495 a -2 495 a
+SDict begin H.S end
+ -2 495 a -2 495 a
+SDict begin 13 H.A end
+ -2 495 a -2 495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3347) cvn H.B /DEST pdfmark
+end
+ -2
+495 a 396 583 a Fy(--v)o(ersion=)p Ff(<)p Fy(v)o(ersion)p
+Ff(>)18 b FC(The)i(v)o(ersion)e(of)i(samhain)f(to)h(do)n(wnload.)d(The)
+i(def)o(ault)g(is)i("current")d(to)i(do)n(wnload)e(the)396
+691 y(current)h(v)o(ersion.)-2 785 y
+SDict begin H.S end
+ -2 785 a -2 785
+a
+SDict begin 13 H.A end
+ -2 785 a -2 785 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-CHECKSRC) cvn H.B /DEST
+pdfmark end
+ -2 785 a 396 1112 a Fp(10.1.8.)36
+b(deplo)n(y)-10 b(.sh)35 b(c)o(hec)n(ksr)n(c)1885 1112
+y
+SDict begin H.S end
+ 1885 1112 a 1885 1112 a
+SDict begin 18.72 H.A end
+ 1885 1112 a 1885 1112 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.42.2) cvn H.B /DEST pdfmark
+end
+ 1885
+1112 a -2 1303 a
+SDict begin H.S end
+ -2 1303 a -2 1303 a
+SDict begin 13 H.A end
+ -2 1303 a -2 1303
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3350) cvn H.B /DEST pdfmark
+end
+ -2 1303 a 396 1386 a FC(This)21 b(command)d(will)j(check)e(the)h
+(GnuPG)g(signatures)g(of)f(source)h(tarballs)g(in)g(the)2827
+1386 y
+SDict begin H.S end
+ 2827 1386 a 2827 1386 a
+SDict begin 13 H.A end
+ 2827 1386 a 2827 1386
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3351) cvn H.B /DEST pdfmark
+end
+ 2827 1386 a Fr(source)f FC(subdirectory)-5 b(.)-2 1404
+y
+SDict begin H.S end
+ -2 1404 a -2 1404 a
+SDict begin 13 H.A end
+ -2 1404 a -2 1404 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-CHECKSRC-OPT) cvn H.B
+/DEST pdfmark end
+ -2 1404 a 396
+1673 a Fj(10.1.8.1.)29 b(Speci\002c)f(options)1581 1673
+y
+SDict begin H.S end
+ 1581 1673 a 1581 1673 a
+SDict begin 15.6 H.A end
+ 1581 1673 a 1581 1673 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.42.17.3) cvn H.B /DEST
+pdfmark end
+ 1581
+1673 a -2 1860 a
+SDict begin H.S end
+ -2 1860 a -2 1860 a
+SDict begin 13 H.A end
+ -2 1860 a -2 1860
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3354) cvn H.B /DEST pdfmark
+end
+ -2 1860 a -2 1860 a
+SDict begin H.S end
+ -2 1860 a -2 1860 a
+SDict begin 13 H.A end
+ -2 1860 a -2
+1860 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3355) cvn H.B /DEST pdfmark
+end
+ -2 1860 a 396 1947 a Fy(--delete)20 b FC(Delete)g(source)g
+(tarballs)g(if)g(PGP)h(signature)e(cannot)h(be)g(v)o(eri\002ed.)-2
+2059 y
+SDict begin H.S end
+ -2 2059 a -2 2059 a
+SDict begin 13 H.A end
+ -2 2059 a -2 2059 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-BUILD) cvn H.B /DEST
+pdfmark end
+ -2 2059
+a 396 2369 a Fp(10.1.9.)36 b(deplo)n(y)-10 b(.sh)35 b(b)n(uild)1657
+2369 y
+SDict begin H.S end
+ 1657 2369 a 1657 2369 a
+SDict begin 18.72 H.A end
+ 1657 2369 a 1657 2369
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.43.2) cvn H.B /DEST pdfmark
+end
+ 1657 2369 a -2 2560 a
+SDict begin H.S end
+ -2 2560 a -2 2560 a
+SDict begin 13 H.A end
+ -2 2560 a
+-2 2560 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3358) cvn H.B /DEST pdfmark
+end
+ -2 2560 a 396 2643 a FC(This)21 b(command)d(will)j(create)f
+(a)g(temporary)e(directory)h(on)h(a)g(remote)f(b)n(uild)h(host,)g(cop)o
+(y)f(the)i(selected)f(v)o(ersion)f(of)396 2751 y(the)h(source)g(there,)
+f(b)n(uild)h(the)g(selected)h(format)e(of)h(the)g(binary)f(installer)h
+(package,)e(retrie)n(v)o(e)h(and)h(store)g(the)396 2859
+y(package)f(into)h(the)961 2859 y
+SDict begin H.S end
+ 961 2859 a 961 2859
+a
+SDict begin 13 H.A end
+ 961 2859 a 961 2859 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3359) cvn H.B /DEST pdfmark
+end
+ 961 2859 a Fr(archpkg/)p Fh(<)p
+Fr(architecture)p Fh(>)d FC(subdirectory)-5 b(,)17 b(and)j(remo)o(v)o
+(e)e(the)i(temporary)e(b)n(uild)396 2967 y(directory)-5
+b(.)-2 3151 y
+SDict begin H.S end
+ -2 3151 a -2 3151 a
+SDict begin 13 H.A end
+ -2 3151 a -2 3151 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3360) cvn H.B /DEST pdfmark
+end
+
+-2 3151 a 396 3241 a FC(F)o(or)20 b(each)g(b)n(uild,)f(up)h(to)h(four)e
+(\002les)i(will)g(be)f(stored:)g(\(a\))g(the)g(binary)f(installer)h
+(package)396 3348 y
+SDict begin H.S end
+ 396 3348 a 396 3348 a
+SDict begin 13 H.A end
+ 396 3348 a
+396 3348 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3361) cvn H.B /DEST pdfmark
+end
+ 396 3348 a Fr(samhain-)p Fh(<)p Fr(version)p
+Fh(>)p Fr(.)p Fh(<)p Fr(format)p Fh(>)p FC(,)c(\(b\))k(the)g
+(con\002gure)e(options)h(used)396 3456 y(\()424 3456
+y
+SDict begin H.S end
+ 424 3456 a 424 3456 a
+SDict begin 13 H.A end
+ 424 3456 a 424 3456 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3362) cvn H.B /DEST pdfmark
+end
+ 424 3456
+a Fr(configure-)p Fh(<)p Fr(version)p Fh(>)p Fr(.)p Fh(<)p
+Fr(format)p Fh(>)p FC(\),)c(\(c\))20 b(the)g(samhain-install.sh)f
+(script)h(generated)e(during)h(the)h(b)n(uild)396 3564
+y(\()424 3564 y
+SDict begin H.S end
+ 424 3564 a 424 3564 a
+SDict begin 13 H.A end
+ 424 3564 a 424
+3564 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3363) cvn H.B /DEST pdfmark
+end
+ 424 3564 a Fr(install-)p Fh(<)p Fr(version)p Fh(>)p
+Fr(.)p Fh(<)p Fr(format)p Fh(>)p FC(\),)15 b(and)20 b(\(only)f(for)g
+(pack)o(ed)h(e)o(x)o(ecutables\))e(the)i(client)g(passw)o(ord)g(set)h
+(in)396 3672 y(the)f(e)o(x)o(ecutable)f(\()920 3672 y
+SDict begin H.S end
+
+920 3672 a 920 3672 a
+SDict begin 13 H.A end
+ 920 3672 a 920 3672 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3364) cvn H.B /DEST pdfmark
+end
+ 920 3672
+a Fr(PASSWD-)p Fh(<)p Fr(version)p Fh(>)p Fr(.)p Fh(<)p
+Fr(format)p Fh(>)p FC(\).)-2 3687 y
+SDict begin H.S end
+ -2 3687 a -2 3687
+a
+SDict begin 11.7 H.A end
+ -2 3687 a -2 3687 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3365) cvn H.B /DEST pdfmark
+end
+ -2 3687 a -2 3812 a
+SDict begin H.S end
+ -2 3812 a -2
+3812 a
+SDict begin 11.7 H.A end
+ -2 3812 a -2 3812 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3367) cvn H.B /DEST pdfmark
+end
+ -2 3812 a 562 3894 a Fw(P)n(ac)o(ka)o(g)q(e)
+f(f)o(ormats:)h Fv(Note)g(that)h(the)f(b)o(uild)f(host)i(m)o(ust)h(pro)
+o(vide)e(the)h(required)d(tools)j(if)g(y)o(ou)g(w)o(ant)f(to)h(b)o
+(uild)f(a)562 3991 y(pac)o(kage)g(f)n(or)h(the)f(nativ)n(e)h(pac)o
+(kage)e(manager)h(\(i.e)o(.)g(deb)m(,)g(r)r(pm,)i(tbz2,)f(depot)e
+(\(HP-UX\),)i(or)g(solar)q(is)g(pkg\).)g(On)562 4088
+y(RPM-based)g(Lin)o(ux)f(distr)q(ib)o(utions)e(and)j(Gentoo)e(Lin)o
+(ux,)i(b)o(uilding)d(of)j(RPMs)h(and)e(tbz2s)o(,)h(respectiv)n(ely)-7
+b(,)562 4185 y(should)19 b(just)h(w)o(or)q(k.)h(Debian)d(requires)h
+(additional)e(pac)o(kages)i(f)n(or)g(b)o(uilding)e(debs)o(.)-2
+4243 y
+SDict begin H.S end
+ -2 4243 a -2 4243 a
+SDict begin 11.7 H.A end
+ -2 4243 a -2 4243 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3368) cvn H.B /DEST pdfmark
+end
+ -2 4243
+a 562 4324 a Fv(The)j("r)q(un")f(binar)r(y)g(pac)o(kage)g(f)n(or)r(mat)
+g(does)h(not)f(require)g(additional)d(tools)k(\(it)g(is)h(a)f(self-e)n
+(xtr)o(acting)e(tar)562 4421 y(pac)o(kage)h(based)g(on)h(the)1317
+4421 y
+SDict begin H.S end
+ 1317 4421 a 1317 4421 a
+SDict begin 11.7 H.A end
+ 1317 4421 a 1317 4421
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3369) cvn H.B /DEST pdfmark
+end
+ 1317 4421 a Fv(mak)o(eself)f(application,)e(which)i(is)i(included)d
+(in)i(the)g(samhain)f(distr)q(ib)o(ution\).)d(Use)562
+4518 y
+SDict begin H.S end
+ 562 4518 a 562 4518 a
+SDict begin 11.7 H.A end
+ 562 4518 a 562 4518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3370) cvn H.B /DEST pdfmark
+end
+ 562
+4518 a Fw(/bin/sh)j Fh(<)p Fw(pac)o(ka)o(g)q(e)p Fh(>)e
+Fw(--help)i Fv(f)n(or)h(details)o(.)39 4668 y
+SDict begin H.S end
+ 39 4668
+a 39 4668 a
+SDict begin 13 H.A end
+ 39 4668 a 39 4668 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-BUILD-OPT) cvn H.B /DEST
+pdfmark end
+ 39 4668 a 396 4963 a
+Fj(10.1.9.1.)29 b(Speci\002c)f(options)1581 4963 y
+SDict begin H.S end
+ 1581
+4963 a 1581 4963 a
+SDict begin 15.6 H.A end
+ 1581 4963 a 1581 4963 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.43.18.3) cvn H.B /DEST
+pdfmark end
+ 1581 4963
+a -2 5150 a
+SDict begin H.S end
+ -2 5150 a -2 5150 a
+SDict begin 13 H.A end
+ -2 5150 a -2 5150 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3373) cvn H.B /DEST pdfmark
+end
+ -2
+5150 a -2 5150 a
+SDict begin H.S end
+ -2 5150 a -2 5150 a
+SDict begin 13 H.A end
+ -2 5150 a -2 5150
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3374) cvn H.B /DEST pdfmark
+end
+ -2 5150 a 396 5237 a Fy(--host=)p Ff(<)p Fy(hostname)p
+Ff(>)19 b FC(The)h(b)n(uild)f(host.)p Black 3661 5805
+a Fx(94)p Black eop end
+%%Page: 95 100
+TeXDict begin 95 99 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.95) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3375) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3376) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(--ar)o(ch=)p Ff(<)p Fy(ar)o(ch)p Ff(>)d
+FC(The)h(architecture)g(to)h(b)n(uild)g(for)-5 b(.)20
+b(This)g(is)h(used)f(to)h(get)f(the)g("./con\002gure")e(options)h(from)
+g(the)396 417 y(\002le)523 417 y
+SDict begin H.S end
+ 523 417 a 523 417 a
+SDict begin 13 H.A end
+
+523 417 a 523 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3377) cvn H.B /DEST pdfmark
+end
+ 523 417 a Fr(configs/)p Fh(<)p Fr(arch)p
+Fh(>)p Fr(.configure)p FC(,)d(and)k(to)g(store)h(the)f(binary)f
+(package)f(into)i(the)g(directory)396 525 y
+SDict begin H.S end
+ 396 525 a
+396 525 a
+SDict begin 13 H.A end
+ 396 525 a 396 525 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3378) cvn H.B /DEST pdfmark
+end
+ 396 525 a Fr(archpkg/)p
+Fh(<)p Fr(arch)p Fh(>)p FC(.)-2 702 y
+SDict begin H.S end
+ -2 702 a -2 702
+a
+SDict begin 13 H.A end
+ -2 702 a -2 702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3379) cvn H.B /DEST pdfmark
+end
+ -2 702 a -2 702 a
+SDict begin H.S end
+ -2 702 a -2 702
+a
+SDict begin 13 H.A end
+ -2 702 a -2 702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3380) cvn H.B /DEST pdfmark
+end
+ -2 702 a 396 799 a Fy(--v)o(ersion=)p
+Ff(<)p Fy(v)o(ersion)p Ff(>)f FC(The)h(v)o(ersion)e(of)i(samhain)g(you)
+f(w)o(ant)h(to)h(b)n(uild.)e(Must)i(be)f(in)g(the)3085
+799 y
+SDict begin H.S end
+ 3085 799 a 3085 799 a
+SDict begin 13 H.A end
+ 3085 799 a 3085 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3381) cvn H.B /DEST pdfmark
+end
+ 3085
+799 a Fr(source)396 906 y FC(subdirectory)-5 b(.)-2 1090
+y
+SDict begin H.S end
+ -2 1090 a -2 1090 a
+SDict begin 13 H.A end
+ -2 1090 a -2 1090 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3382) cvn H.B /DEST pdfmark
+end
+ -2 1090 a -2
+1090 a
+SDict begin H.S end
+ -2 1090 a -2 1090 a
+SDict begin 13 H.A end
+ -2 1090 a -2 1090 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3383) cvn H.B /DEST pdfmark
+end
+ -2 1090
+a 396 1180 a Fy(--f)n(ormat=)p Ff(<)p Fy(run|r)o
+(pm|deb|tbz2|depot|solaris-pkg)p Ff(>)18 b FC(The)i(format)f(of)h(the)g
+(binary)f(installer)h(package.)396 1288 y("run")f(is)j(a)e(portable)f
+(\(Unix\))g(package)g(based)h(on)1870 1288 y
+SDict begin H.S end
+ 1870 1288
+a 1870 1288 a
+SDict begin 13 H.A end
+ 1870 1288 a 1870 1288 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3384) cvn H.B /DEST pdfmark
+end
+ 1870 1288 a FC(mak)o(eself,)g
+("deb")f(is)i(a)g(Debian)e(package,)g("tbz2")g(is)j(a)e(binary)396
+1396 y(Gentoo)f(Linux)h(package,)e("rpm")h(is)i(an)g(RPM)g(package,)d
+("depot")h(is)i(an)f(HP-UX)h(binary)e(package,)f(and)396
+1504 y("solaris-pkg")h(for)g(Sun)h(Solaris.)-2 1688 y
+SDict begin H.S end
+
+-2 1688 a -2 1688 a
+SDict begin 13 H.A end
+ -2 1688 a -2 1688 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3385) cvn H.B /DEST pdfmark
+end
+ -2 1688 a -2
+1688 a
+SDict begin H.S end
+ -2 1688 a -2 1688 a
+SDict begin 13 H.A end
+ -2 1688 a -2 1688 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3386) cvn H.B /DEST pdfmark
+end
+ -2 1688
+a 396 1778 a Fy(--pack)o(ed=)p Ff(<)p Fy(passw)o(ord)p
+Ff(>)g FC(Build)g(a)g(pack)o(ed)g(e)o(x)o(ecutable,)e(and)h(set)i(the)f
+(client)h(passw)o(ord)e(before)g(packing.)-2 1962 y
+SDict begin H.S end
+ -2
+1962 a -2 1962 a
+SDict begin 13 H.A end
+ -2 1962 a -2 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3387) cvn H.B /DEST pdfmark
+end
+ -2 1962 a -2 1962
+a
+SDict begin H.S end
+ -2 1962 a -2 1962 a
+SDict begin 13 H.A end
+ -2 1962 a -2 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3388) cvn H.B /DEST pdfmark
+end
+ -2 1962 a 396
+2052 a Fy(--user=)p Ff(<)p Fy(user)o(name)p Ff(>)h FC(Login)f(as)i
+Ff(<)p FC(username)p Ff(>)d FC(on)h(the)i(b)n(uild)e(host)i(\(def)o
+(aults)e(to)h(root\).)-2 2236 y
+SDict begin H.S end
+ -2 2236 a -2 2236 a
+SDict begin 13 H.A end
+ -2
+2236 a -2 2236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3389) cvn H.B /DEST pdfmark
+end
+ -2 2236 a -2 2236 a
+SDict begin H.S end
+ -2 2236 a -2 2236
+a
+SDict begin 13 H.A end
+ -2 2236 a -2 2236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3390) cvn H.B /DEST pdfmark
+end
+ -2 2236 a 396 2326 a Fy(--add-path=)p
+Ff(<)p Fy(path)p Ff(>)e FC(Append)h Ff(<)p FC(path)p
+Ff(>)g FC(to)h(the)g(P)-8 b(A)f(TH)21 b(v)n(ariable)e(on)h(the)g(b)n
+(uild)g(host.)-2 2438 y
+SDict begin H.S end
+ -2 2438 a -2 2438 a
+SDict begin 13 H.A end
+ -2 2438 a
+-2 2438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-INSTALL) cvn H.B /DEST
+pdfmark end
+ -2 2438 a 396 2748 a Fp(10.1.10.)37 b(deplo)n(y)-10
+b(.sh)35 b(install)1785 2748 y
+SDict begin H.S end
+ 1785 2748 a 1785 2748
+a
+SDict begin 18.72 H.A end
+ 1785 2748 a 1785 2748 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.44.2) cvn H.B /DEST pdfmark
+end
+ 1785 2748 a -2 2938 a
+SDict begin H.S end
+ -2 2938
+a -2 2938 a
+SDict begin 13 H.A end
+ -2 2938 a -2 2938 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3393) cvn H.B /DEST pdfmark
+end
+ -2 2938 a 396 3022 a
+FC(This)21 b(command)d(will)j(create)f(a)g(temporary)e(directory)h(on)h
+(a)g(remote)f(host,)h(cop)o(y)g(the)g(selected)g(v)o(ersion)f(of)h(the)
+396 3130 y(installer)h(package,)d(its)j(corresponding)c
+(samhain-install.sh)i(script,)h(the)g(runtime)f(con\002guration)e
+(\002le,)k(and)f(the)396 3237 y(preinstall,)g(postinstall,)g
+(initscripts)g(scripts)g(there.)g(It)g(will)h(then:)-2
+3421 y
+SDict begin H.S end
+ -2 3421 a -2 3421 a
+SDict begin 13 H.A end
+ -2 3421 a -2 3421 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3394) cvn H.B /DEST pdfmark
+end
+ -2 3421
+a 396 3511 a FC(\(A\))f(run)g(the)786 3511 y
+SDict begin H.S end
+ 786 3511
+a 786 3511 a
+SDict begin 13 H.A end
+ 786 3511 a 786 3511 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3395) cvn H.B /DEST pdfmark
+end
+ 786 3511 a Fr(preinstall)f
+FC(script)h(on)g(the)g(client,)g(which)g(shuts)g(do)n(wn)f(the)i
+(running)d(samhain)h(daemon)g(\(if)396 3619 y(there)h(is)h(an)o(y\).)-2
+3803 y
+SDict begin H.S end
+ -2 3803 a -2 3803 a
+SDict begin 13 H.A end
+ -2 3803 a -2 3803 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3396) cvn H.B /DEST pdfmark
+end
+ -2 3803
+a 396 3893 a FC(\(B\))g(install)f(the)h(binary)e(installer)h(package)e
+(on)i(the)g(client.)-2 4077 y
+SDict begin H.S end
+ -2 4077 a -2 4077 a
+SDict begin 13 H.A end
+ -2
+4077 a -2 4077 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3397) cvn H.B /DEST pdfmark
+end
+ -2 4077 a 396 4167 a FC(\(C\))h(run)e(the)781
+4167 y
+SDict begin H.S end
+ 781 4167 a 781 4167 a
+SDict begin 13 H.A end
+ 781 4167 a 781 4167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3398) cvn H.B /DEST pdfmark
+end
+ 781
+4167 a Fr(postinstall)g FC(script)h(on)g(the)g(client,)g(which)g(sets)h
+(the)g(client)f(passw)o(ord)f(\(unless)h(the)g(binary)f(is)396
+4275 y(pack)o(ed\),)g(and)g(replaces)h(the)g(def)o(ault)g(runtime)f
+(con\002guration)e(\002le)k(with)g(the)f(proper)e(one.)i(The)f(latter)i
+(step)f(is)396 4383 y(required,)e(because)996 4383 y
+SDict begin H.S end
+
+996 4383 a 996 4383 a
+SDict begin 13 H.A end
+ 996 4383 a 996 4383 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3399) cvn H.B /DEST pdfmark
+end
+ 996 4383
+a Fy(deploy)-6 b(.sh)20 b(b)n(uild)h FC(b)n(uilds)e(from)f(the)i
+(pristine)f(source,)f(so)i(the)f(runtime)f(con\002guration)f(\002le)j
+(in)396 4491 y(the)g(installer)h(package)d(is)k(just)e(the)h(def)o
+(ault)e(one.)-2 4675 y
+SDict begin H.S end
+ -2 4675 a -2 4675 a
+SDict begin 13 H.A end
+ -2 4675 a
+-2 4675 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3400) cvn H.B /DEST pdfmark
+end
+ -2 4675 a 396 4765 a FC(\(D\))h(cop)o(y)g(the)g(proper)e
+(client)i(runtime)f(con\002guration)f(\002le)j(to)f(the)g(serv)o(er)g
+(data)g(directory)e(\(as)396 4873 y
+SDict begin H.S end
+ 396 4873 a 396 4873
+a
+SDict begin 13 H.A end
+ 396 4873 a 396 4873 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3401) cvn H.B /DEST pdfmark
+end
+ 396 4873 a Fr(rc.)p Fh(<)p Fr(client_name)p
+Fh(>)p FC(\),)g(\002x)i(the)g(serv)o(er)f(con\002guration)f(\002le,)j
+(and)e(restart)h(the)h(serv)o(er)e(\(which)g(will)i(f)o(ail)396
+4981 y(non-f)o(atally)d(if)j(the)f(serv)o(er)g(is)h(not)e(running\).)-2
+5165 y
+SDict begin H.S end
+ -2 5165 a -2 5165 a
+SDict begin 13 H.A end
+ -2 5165 a -2 5165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3402) cvn H.B /DEST pdfmark
+end
+ -2 5165
+a 396 5255 a FC(\(E\))h(run)f(the)777 5255 y
+SDict begin H.S end
+ 777 5255
+a 777 5255 a
+SDict begin 13 H.A end
+ 777 5255 a 777 5255 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3403) cvn H.B /DEST pdfmark
+end
+ 777 5255 a Fr(initscript)g
+FC(script)h(on)g(the)g(client,)g(which)g(initializes)g(\(or)g
+(updates\))f(the)h(baseline)g(database.)p Black 3661
+5805 a Fx(95)p Black eop end
+%%Page: 96 101
+TeXDict begin 96 100 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.96) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3442) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2401 104 a Fx(Chapter)20
+b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p Black -2
+226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3404) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396
+309 a FC(\(F\))f(retrie)n(v)o(e)f(the)i(baseline)e(database,)h(cop)o(y)
+f(it)i(to)f(the)h(serv)o(er)e(data)h(directory)e(\(as)2807
+309 y
+SDict begin H.S end
+ 2807 309 a 2807 309 a
+SDict begin 13 H.A end
+ 2807 309 a 2807 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3405) cvn H.B /DEST pdfmark
+end
+ 2807
+309 a Fr(file.)p Fh(<)p Fr(client_name)p Fh(>)p FC(\),)396
+417 y(and)i(remo)o(v)o(e)e(the)i(temporary)e(directory)h(on)h(the)g
+(client.)-2 435 y
+SDict begin H.S end
+ -2 435 a -2 435 a
+SDict begin 11.7 H.A end
+ -2 435 a -2 435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3406) cvn H.B /DEST pdfmark
+end
+
+-2 435 a -2 559 a
+SDict begin H.S end
+ -2 559 a -2 559 a
+SDict begin 11.7 H.A end
+ -2 559 a -2 559 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3408) cvn H.B /DEST pdfmark
+end
+
+-2 559 a 562 638 a Fw(The)g(runtime)g(con\002guration)d(\002le:)i
+Fv(If)1725 638 y
+SDict begin H.S end
+ 1725 638 a 1725 638 a
+SDict begin 11.7 H.A end
+ 1725 638 a 1725
+638 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3409) cvn H.B /DEST pdfmark
+end
+ 1725 638 a Ft(hosts/)p Fi(<)p Ft(hostname)p Fi(>)p
+Ft(/)p Fi(<)p Ft(arch)p Fi(>)p Ft(.s)q(amh)q(ain)q(rc)27
+b Fv(or)562 735 y
+SDict begin H.S end
+ 562 735 a 562 735 a
+SDict begin 11.7 H.A end
+ 562 735 a 562 735
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3410) cvn H.B /DEST pdfmark
+end
+ 562 735 a Ft(hosts/)p Fi(<)p Ft(hostname)p Fi(>)p Ft(/samh)q(ain)q
+(rc)g Fv(e)n(xists)o(,)20 b(this)g(will)g(be)g(used)g(\(in)f(this)h
+(order)g(of)g(pref)n(erence\),)d(otherwise)562 833 y
+SDict begin H.S end
+
+562 833 a 562 833 a
+SDict begin 11.7 H.A end
+ 562 833 a 562 833 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3411) cvn H.B /DEST pdfmark
+end
+ 562 833 a Ft(configs/)p
+Fi(<)p Ft(arch)p Fi(>)p Ft(.samhai)q(nrc)28 b Fv(will)19
+b(be)h(used.)f(If)i(the)e(latter)g(does)h(not)g(e)n(xist,)g(the)f
+(command)h(will)f(f)n(ail.)39 971 y
+SDict begin H.S end
+ 39 971 a 39 971 a
+SDict begin 11.7 H.A end
+
+39 971 a 39 971 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3412) cvn H.B /DEST pdfmark
+end
+ 39 971 a -2 1137 a
+SDict begin H.S end
+ -2 1137 a -2 1137
+a
+SDict begin 11.7 H.A end
+ -2 1137 a -2 1137 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3414) cvn H.B /DEST pdfmark
+end
+ -2 1137 a 562 1234 a Fw(T)-6 b(ransparent)18
+b(handling)g(of)i(par)q(ticular)f(b)o(uild)g(options:)f
+Fv(The)i(b)o(uild)e(options)h('--enab)o(le-stealth=)o(..)-8
+b(')15 b(is)562 1332 y(handled)j(b)o(y)i(deter)r(mining)d(the)j
+(argument)e(from)i(the)g(con\002gure)f(options)g(that)g(w)o(ere)h(used)
+g(f)n(or)g(the)f(b)o(uild,)562 1429 y(and)h(prepar)q(ing)d(the)j(r)q
+(untime)f(con\002gur)o(ation)f(\002le)i(appropr)q(iately)-7
+b(.)16 b(I.e)o(.,)j(y)o(ou)h(should)f(pro)o(vide)g(a)h('nor)r(mal',)562
+1526 y(plain-te)n(xt)e(con\002gur)o(ation)g(\002le)o(.)-2
+1584 y
+SDict begin H.S end
+ -2 1584 a -2 1584 a
+SDict begin 11.7 H.A end
+ -2 1584 a -2 1584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3415) cvn H.B /DEST pdfmark
+end
+ -2 1584
+a 562 1664 a Fv(The)i(b)o(uild)e(option)g('--with-nocl=..)-7
+b(')16 b(is)21 b(handled)d(b)o(y)i(deter)r(mining)d(the)j(argument)e
+(\(which)i(is)g(required)e(f)n(or)562 1762 y(database)g
+(initialization\))e(from)k(the)g(con\002gure)f(options)g(that)g(w)o
+(ere)h(used)g(f)n(or)g(the)f(b)o(uild,)f(and)i(passing)f(it)h(to)562
+1859 y(the)687 1859 y
+SDict begin H.S end
+ 687 1859 a 687 1859 a
+SDict begin 11.7 H.A end
+ 687 1859
+a 687 1859 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3416) cvn H.B /DEST pdfmark
+end
+ 687 1859 a Ft(initscript)k Fv(scr)q(ipt.)39
+2008 y
+SDict begin H.S end
+ 39 2008 a 39 2008 a
+SDict begin 13 H.A end
+ 39 2008 a 39 2008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-INSTALL-OPT) cvn H.B
+/DEST pdfmark end
+ 39 2008
+a 396 2304 a Fj(10.1.10.1.)29 b(Speci\002c)g(options)1637
+2304 y
+SDict begin H.S end
+ 1637 2304 a 1637 2304 a
+SDict begin 15.6 H.A end
+ 1637 2304 a 1637 2304
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.44.19.3) cvn H.B /DEST
+pdfmark end
+ 1637 2304 a -2 2490 a
+SDict begin H.S end
+ -2 2490 a -2 2490 a
+SDict begin 13 H.A end
+ -2 2490 a
+-2 2490 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3419) cvn H.B /DEST pdfmark
+end
+ -2 2490 a -2 2490 a
+SDict begin H.S end
+ -2 2490 a -2 2490 a
+SDict begin 13 H.A end
+ -2
+2490 a -2 2490 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3420) cvn H.B /DEST pdfmark
+end
+ -2 2490 a 396 2578 a Fy(--host=)p Ff(<)p
+Fy(hostname)p Ff(>)19 b FC(The)h(host)g(on)f(which)h(to)g(install.)-2
+2747 y
+SDict begin H.S end
+ -2 2747 a -2 2747 a
+SDict begin 13 H.A end
+ -2 2747 a -2 2747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3421) cvn H.B /DEST pdfmark
+end
+ -2 2747
+a -2 2747 a
+SDict begin H.S end
+ -2 2747 a -2 2747 a
+SDict begin 13 H.A end
+ -2 2747 a -2 2747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3422) cvn H.B /DEST pdfmark
+end
+ -2
+2747 a 396 2852 a Fy(--ar)o(ch=)p Ff(<)p Fy(ar)o(ch)p
+Ff(>)e FC(The)h(architecture)g(to)h(install.)h(This)f(is)h(used)f(to)h
+(get)f(the)g(installer)g(package)f(from)g(the)396 2960
+y(directory)717 2960 y
+SDict begin H.S end
+ 717 2960 a 717 2960 a
+SDict begin 13 H.A end
+ 717 2960
+a 717 2960 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3423) cvn H.B /DEST pdfmark
+end
+ 717 2960 a Fr(archpkg/)p Fh(<)p Fr(arch)p
+Fh(>)p Fr(/)p FC(.)-2 3144 y
+SDict begin H.S end
+ -2 3144 a -2 3144 a
+SDict begin 13 H.A end
+ -2 3144
+a -2 3144 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3424) cvn H.B /DEST pdfmark
+end
+ -2 3144 a -2 3144 a
+SDict begin H.S end
+ -2 3144 a -2 3144 a
+SDict begin 13 H.A end
+ -2
+3144 a -2 3144 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3425) cvn H.B /DEST pdfmark
+end
+ -2 3144 a 396 3234 a Fy(--v)o(ersion=)p
+Ff(<)p Fy(v)o(ersion)p Ff(>)g FC(The)h(v)o(ersion)e(of)i(samhain)g(you)
+f(w)o(ant)h(to)h(install.)f(An)g(installer)h(package)d(for)i(this)396
+3341 y(v)o(ersion)f(must)h(e)o(xist)h(in)f(the)1226 3341
+y
+SDict begin H.S end
+ 1226 3341 a 1226 3341 a
+SDict begin 13 H.A end
+ 1226 3341 a 1226 3341 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3426) cvn H.B /DEST pdfmark
+end
+ 1226
+3341 a Fr(archpkg/)p Fh(<)p Fr(arch)p Fh(>)p Fr(/)e FC(subdirectory)-5
+b(.)-2 3526 y
+SDict begin H.S end
+ -2 3526 a -2 3526 a
+SDict begin 13 H.A end
+ -2 3526 a -2 3526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3427) cvn H.B /DEST pdfmark
+end
+
+-2 3526 a -2 3526 a
+SDict begin H.S end
+ -2 3526 a -2 3526 a
+SDict begin 13 H.A end
+ -2 3526 a -2
+3526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3428) cvn H.B /DEST pdfmark
+end
+ -2 3526 a 396 3615 a Fy(--f)n(ormat=)p Ff(<)p
+Fy(run|r)o(pm|deb|tbz2|depot|solaris-pkg)p Ff(>)18 b
+FC(The)i(format)f(of)h(the)g(binary)f(installer)h(package.)396
+3723 y("run")f(is)j(a)e(portable)f(\(Unix\))g(package)g(based)h(on)1870
+3723 y
+SDict begin H.S end
+ 1870 3723 a 1870 3723 a
+SDict begin 13 H.A end
+ 1870 3723 a 1870 3723
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3429) cvn H.B /DEST pdfmark
+end
+ 1870 3723 a FC(mak)o(eself,)g("deb")f(is)i(a)g(Debian)e(package,)g
+("tbz2")g(is)j(a)e(binary)396 3831 y(Gentoo)f(Linux)h(package,)e("rpm")
+h(is)i(an)g(RPM)g(package,)d("depot")h(is)i(an)f(HP-UX)h(binary)e
+(package,)f(and)396 3939 y("solaris-pkg")h(for)g(Sun)h(Solaris.)-2
+4123 y
+SDict begin H.S end
+ -2 4123 a -2 4123 a
+SDict begin 13 H.A end
+ -2 4123 a -2 4123 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3430) cvn H.B /DEST pdfmark
+end
+ -2 4123
+a -2 4123 a
+SDict begin H.S end
+ -2 4123 a -2 4123 a
+SDict begin 13 H.A end
+ -2 4123 a -2 4123 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3431) cvn H.B /DEST pdfmark
+end
+ -2
+4123 a 396 4213 a Fy(--yule_exec=)p Ff(<)p Fy(path)p
+Ff(>)d FC(P)o(ath)k(to)f(the)g(yule)g(e)o(x)o(ecutable.)-2
+4397 y
+SDict begin H.S end
+ -2 4397 a -2 4397 a
+SDict begin 13 H.A end
+ -2 4397 a -2 4397 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3432) cvn H.B /DEST pdfmark
+end
+ -2 4397
+a -2 4397 a
+SDict begin H.S end
+ -2 4397 a -2 4397 a
+SDict begin 13 H.A end
+ -2 4397 a -2 4397 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3433) cvn H.B /DEST pdfmark
+end
+ -2
+4397 a 396 4487 a Fy(--yule_conf=)p Ff(<)p Fy(path)p
+Ff(>)e FC(P)o(ath)i(to)g(the)g(yule)g(con\002guration)d(\002le.)-2
+4671 y
+SDict begin H.S end
+ -2 4671 a -2 4671 a
+SDict begin 13 H.A end
+ -2 4671 a -2 4671 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3434) cvn H.B /DEST pdfmark
+end
+ -2 4671
+a -2 4671 a
+SDict begin H.S end
+ -2 4671 a -2 4671 a
+SDict begin 13 H.A end
+ -2 4671 a -2 4671 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3435) cvn H.B /DEST pdfmark
+end
+ -2
+4671 a 396 4761 a Fy(--yule_data=)p Ff(<)p Fy(path)p
+Ff(>)g FC(P)o(ath)j(to)h(the)f(yule)g(data)g(directory)-5
+b(.)-2 4945 y
+SDict begin H.S end
+ -2 4945 a -2 4945 a
+SDict begin 13 H.A end
+ -2 4945 a -2 4945 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3436) cvn H.B /DEST pdfmark
+end
+
+-2 4945 a -2 4945 a
+SDict begin H.S end
+ -2 4945 a -2 4945 a
+SDict begin 13 H.A end
+ -2 4945 a -2
+4945 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3437) cvn H.B /DEST pdfmark
+end
+ -2 4945 a 396 5035 a Fy(--no-init)20 b FC(Do)g(not)g(initialize)
+g(the)g(\002le)h(signature)e(\(baseline\))g(database)h(\(and)f
+(consequentially)-5 b(,)17 b(do)j(not)g(replace)396 5143
+y(the)518 5143 y
+SDict begin H.S end
+ 518 5143 a 518 5143 a
+SDict begin 13 H.A end
+ 518 5143 a 518
+5143 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3438) cvn H.B /DEST pdfmark
+end
+ 518 5143 a Fr(file.)p Fh(<)p Fr(host)p Fh(>)f
+FC(\002le)i(on)f(serv)o(er)-5 b(.)p Black 3660 5805 a
+Fx(96)p Black eop end
+%%Page: 97 102
+TeXDict begin 97 101 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.97) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3439) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3440) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(--no-r)o(c\002le)e FC(Do)h(not)g(replace)f(the)1398
+309 y
+SDict begin H.S end
+ 1398 309 a 1398 309 a
+SDict begin 13 H.A end
+ 1398 309 a 1398 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3441) cvn H.B /DEST pdfmark
+end
+ 1398
+309 a Fr(rc.)p Fh(<)p Fr(host)p Fh(>)g FC(\002le)i(on)e(serv)o(er)-5
+b(.)396 583 y Fy(--no-start)19 b FC(Do)h(not)g(start)g(up)g(the)g
+(client)h(after)e(installation.)-2 767 y
+SDict begin H.S end
+ -2 767 a -2
+767 a
+SDict begin 13 H.A end
+ -2 767 a -2 767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3444) cvn H.B /DEST pdfmark
+end
+ -2 767 a -2 767 a
+SDict begin H.S end
+ -2 767 a -2
+767 a
+SDict begin 13 H.A end
+ -2 767 a -2 767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3445) cvn H.B /DEST pdfmark
+end
+ -2 767 a 396 857 a Fy(--local=)p
+Ff(<)p Fy(command)p Ff(>)f FC(An)i(optional)e(command)g(e)o(x)o(ecuted)
+g(locally)i(\(i.e.)f(on)h(the)g(serv)o(er\))e(twice)i(\(with)g(the)g
+(last)396 965 y(ar)o(gument)e(set)j(to)f('\002rst')h(and)e(')-5
+b(second',)19 b(respecti)n(v)o(ely)-5 b(.)18 b(First)j(is)g(after)f
+(client)g(con\002g)g(\002le)g(installation)g(\(i.e.)396
+1073 y(before)f(baseline)h(database)f(initialisation)h(on)g(the)g
+(client\),)g(second)f(is)i(just)g(before)e(client)h(startup.)g(W)m(ill)
+h(be)396 1180 y(called)f(as)705 1180 y
+SDict begin H.S end
+ 705 1180 a 705
+1180 a
+SDict begin 13 H.A end
+ 705 1180 a 705 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3446) cvn H.B /DEST pdfmark
+end
+ 705 1180 a Fy(command)1076
+1180 y
+SDict begin H.S end
+ 1076 1180 a 1076 1180 a
+SDict begin 13 H.A end
+ 1076 1180 a 1076 1180
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3447) cvn H.B /DEST pdfmark
+end
+ 1076 1180 a Fl(hostname)1456 1180 y
+SDict begin H.S end
+ 1456 1180 a 1456
+1180 a
+SDict begin 13 H.A end
+ 1456 1180 a 1456 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3448) cvn H.B /DEST pdfmark
+end
+ 1456 1180 a Fl(arch)1657
+1180 y
+SDict begin H.S end
+ 1657 1180 a 1657 1180 a
+SDict begin 13 H.A end
+ 1657 1180 a 1657 1180
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3449) cvn H.B /DEST pdfmark
+end
+ 1657 1180 a Fl(basedir)1996 1180 y
+SDict begin H.S end
+ 1996 1180 a 1996
+1180 a
+SDict begin 13 H.A end
+ 1996 1180 a 1996 1180 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3450) cvn H.B /DEST pdfmark
+end
+ 1996 1180 a Fl(yule_data)2420
+1180 y
+SDict begin H.S end
+ 2420 1180 a 2420 1180 a
+SDict begin 13 H.A end
+ 2420 1180 a 2420 1180
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3451) cvn H.B /DEST pdfmark
+end
+ 2420 1180 a Fl(first|second)s FC(.)-2 1293 y
+SDict begin H.S end
+ -2 1293
+a -2 1293 a
+SDict begin 13 H.A end
+ -2 1293 a -2 1293 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-UNINSTALL) cvn H.B /DEST
+pdfmark end
+ -2 1293 a 396 1602 a
+Fp(10.1.11.)37 b(deplo)n(y)-10 b(.sh)35 b(uninstall)1931
+1602 y
+SDict begin H.S end
+ 1931 1602 a 1931 1602 a
+SDict begin 18.72 H.A end
+ 1931 1602 a 1931 1602
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.45.2) cvn H.B /DEST pdfmark
+end
+ 1931 1602 a -2 1793 a
+SDict begin H.S end
+ -2 1793 a -2 1793 a
+SDict begin 13 H.A end
+ -2 1793 a
+-2 1793 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3454) cvn H.B /DEST pdfmark
+end
+ -2 1793 a 396 1876 a FC(This)20 b(command)e(will)j(remo)o(v)o
+(e)d(a)j(samhain)e(client)h(that)g(w)o(as)h(pre)n(viously)d(installed)i
+(by)f(using)3158 1876 y
+SDict begin H.S end
+ 3158 1876 a 3158 1876 a
+SDict begin 13 H.A end
+ 3158
+1876 a 3158 1876 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3455) cvn H.B /DEST pdfmark
+end
+ 3158 1876 a Fy(deploy)-6 b(.sh)20
+b(install)p FC(.)-2 1894 y
+SDict begin H.S end
+ -2 1894 a -2 1894 a
+SDict begin 13 H.A end
+ -2 1894
+a -2 1894 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-UNINSTALL-OPT) cvn H.B
+/DEST pdfmark end
+ -2 1894 a 396 2163 a Fj(10.1.11.1.)29 b(Speci\002c)g
+(options)1637 2163 y
+SDict begin H.S end
+ 1637 2163 a 1637 2163 a
+SDict begin 15.6 H.A end
+ 1637 2163
+a 1637 2163 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.45.20.3) cvn H.B /DEST
+pdfmark end
+ 1637 2163 a -2 2350 a
+SDict begin H.S end
+ -2 2350 a -2 2350
+a
+SDict begin 13 H.A end
+ -2 2350 a -2 2350 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3458) cvn H.B /DEST pdfmark
+end
+ -2 2350 a -2 2350 a
+SDict begin H.S end
+ -2 2350 a -2
+2350 a
+SDict begin 13 H.A end
+ -2 2350 a -2 2350 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3459) cvn H.B /DEST pdfmark
+end
+ -2 2350 a 396 2437 a Fy(--host=)p
+Ff(<)p Fy(hostname)p Ff(>)19 b FC(The)h(host)g(on)f(which)h(to)g
+(uninstall.)-2 2534 y
+SDict begin H.S end
+ -2 2534 a -2 2534 a
+SDict begin 13 H.A end
+ -2 2534 a -2
+2534 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEPLOY-MISC) cvn H.B /DEST
+pdfmark end
+ -2 2534 a 396 2859 a Fp(10.1.12.)37 b(Usa)o(g)q(e)e(notes)1572
+2859 y
+SDict begin H.S end
+ 1572 2859 a 1572 2859 a
+SDict begin 18.72 H.A end
+ 1572 2859 a 1572 2859
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.67.46.2) cvn H.B /DEST pdfmark
+end
+ 1572 2859 a -2 2885 a
+SDict begin H.S end
+ -2 2885 a -2 2885 a
+SDict begin 11.7 H.A end
+ -2 2885 a
+-2 2885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3462) cvn H.B /DEST pdfmark
+end
+ -2 2885 a 745 2985 2668 17 v 745 3637 17 652
+v 1842 3138 a Fp(W)-5 b(arning)786 3331 y
+SDict begin H.S end
+ 786 3331 a
+786 3331 a
+SDict begin 11.7 H.A end
+ 786 3331 a 786 3331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3464) cvn H.B /DEST pdfmark
+end
+ 786 3331 a 71 x Fv(On)21
+b(Solar)q(is)o(,)e(the)g(P)-9 b(A)g(TH)21 b(en)o(vironment)c(v)n(ar)q
+(iab)o(le)h(on)i(the)g(remote)f(host)h(\(where)f(y)o(ou)786
+3499 y(b)o(uild)g(or)h(deplo)n(y\))e(ma)n(y)j(get)f(set)g(according)f
+(to)h(/etc/def)n(ault/su,)c(which)k(ma)n(y)h(be)786 3596
+y(diff)n(erent)d(from)i(what)g(y)o(ou)f(w)o(ould)h(e)n(xpect)f(\(noted)
+g(b)o(y)h(S)o(.)g(Baile)o(y\).)p 3396 3637 17 652 v 745
+3653 2668 17 v -2 3830 a
+SDict begin H.S end
+ -2 3830 a -2 3830 a
+SDict begin 13 H.A end
+ -2 3830
+a -2 3830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:NATIVE-PACKAGES) cvn H.B /DEST
+pdfmark end
+ -2 3830 a 319 x Fu(10.2.)39 b(Method)f(B:)h(The)g(native)f
+(pac)m(ka)o(g)q(e)g(mana)o(g)q(er)3058 4149 y
+SDict begin H.S end
+ 3058 4149
+a 3058 4149 a
+SDict begin 22.464 H.A end
+ 3058 4149 a 3058 4149 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.1) cvn H.B /DEST pdfmark
+end
+ 3058 4149 a -2
+4347 a
+SDict begin H.S end
+ -2 4347 a -2 4347 a
+SDict begin 13 H.A end
+ -2 4347 a -2 4347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3467) cvn H.B /DEST pdfmark
+end
+ -2 4347
+a -2 4347 a
+SDict begin H.S end
+ -2 4347 a -2 4347 a
+SDict begin 13 H.A end
+ -2 4347 a -2 4347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3468) cvn H.B /DEST pdfmark
+end
+ -2
+4347 a 396 4423 a FC(Samhain)20 b(pro)o(vides)e(an)i(easy)g(method)f
+(to)i(create)1855 4423 y
+SDict begin H.S end
+ 1855 4423 a 1855 4423 a
+SDict begin 13 H.A end
+ 1855
+4423 a 1855 4423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3469) cvn H.B /DEST pdfmark
+end
+ 1855 4423 a Fx(custom)e(binary)h(pac)n(ka)o(g)o(es)f
+FC(with)i(the)f(nati)n(v)o(e)f(package)396 4531 y(manager)g(of)h(your)f
+(operating)f(system.)i(Basically)-5 b(,)20 b(this)h(w)o(orks)f(lik)o
+(e:)-2 4632 y
+SDict begin H.S end
+ -2 4632 a -2 4632 a
+SDict begin 11.7 H.A end
+ -2 4632 a -2 4632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3470) cvn H.B /DEST pdfmark
+end
+
+-2 4632 a -2 4632 a
+SDict begin H.S end
+ -2 4632 a -2 4632 a
+SDict begin 11.7 H.A end
+ -2 4632 a -2
+4632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3471) cvn H.B /DEST pdfmark
+end
+ -2 4632 a 396 4712 a Ft(bash$)596 4712 y
+SDict begin H.S end
+ 596 4712
+a 596 4712 a
+SDict begin 11.7 H.A end
+ 596 4712 a 596 4712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3472) cvn H.B /DEST pdfmark
+end
+ 596 4712 a Fs(./configure)46
+b([your)c(preferred)i(options])-2 4721 y
+SDict begin H.S end
+ -2 4721 a -2
+4721 a
+SDict begin 11.7 H.A end
+ -2 4721 a -2 4721 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3473) cvn H.B /DEST pdfmark
+end
+ -2 4721 a 396 4809 a Ft(bash$)596
+4809 y
+SDict begin H.S end
+ 596 4809 a 596 4809 a
+SDict begin 11.7 H.A end
+ 596 4809 a 596 4809 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3474) cvn H.B /DEST pdfmark
+end
+ 596
+4809 a Fs(make)g(rpm|deb|tbz2|depot|s)q(ola)q(ris)q(-p)q(kg)-2
+4992 y
+SDict begin H.S end
+ -2 4992 a -2 4992 a
+SDict begin 13 H.A end
+ -2 4992 a -2 4992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3475) cvn H.B /DEST pdfmark
+end
+ -2 4992
+a 396 5083 a FC(I.e.)20 b(the)g(binary)f(package)g(will)i(be)f(b)n
+(uilt)g(with)h(the)f(compile)f(options)g(chosen)h(in)g(the)g(preceding)
+3242 5083 y
+SDict begin H.S end
+ 3242 5083 a 3242 5083 a
+SDict begin 13 H.A end
+ 3242 5083 a 3242
+5083 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3476) cvn H.B /DEST pdfmark
+end
+ 3242 5083 a Fy(./con\002gur)o(e)396 5191 y FC(command.)e
+(Supported)g(package)h(formats)g(are:)1840 5191 y
+SDict begin H.S end
+ 1840
+5191 a 1840 5191 a
+SDict begin 13 H.A end
+ 1840 5191 a 1840 5191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3477) cvn H.B /DEST pdfmark
+end
+ 1840 5191
+a Fx(rpm)h FC(\(e.g.)f(Redhat,)h(SuSE,)g(...\),)2797
+5191 y
+SDict begin H.S end
+ 2797 5191 a 2797 5191 a
+SDict begin 13 H.A end
+ 2797 5191 a 2797 5191
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3478) cvn H.B /DEST pdfmark
+end
+ 2797 5191 a Fx(deb)f FC(\(Debian\),)3274 5191 y
+SDict begin H.S end
+ 3274
+5191 a 3274 5191 a
+SDict begin 13 H.A end
+ 3274 5191 a 3274 5191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3479) cvn H.B /DEST pdfmark
+end
+ 3274 5191
+a Fx(tbz2)h FC(\(Gentoo)396 5299 y(Linux\),)664 5299
+y
+SDict begin H.S end
+ 664 5299 a 664 5299 a
+SDict begin 13 H.A end
+ 664 5299 a 664 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3480) cvn H.B /DEST pdfmark
+end
+ 664 5299
+a Fx(depot)g FC(\(HP-UX\),)g(and)1362 5299 y
+SDict begin H.S end
+ 1362 5299
+a 1362 5299 a
+SDict begin 13 H.A end
+ 1362 5299 a 1362 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3481) cvn H.B /DEST pdfmark
+end
+ 1362 5299 a Fx(solaris-pkg)f
+FC(\(Solaris\).)-2 5315 y
+SDict begin H.S end
+ -2 5315 a -2 5315 a
+SDict begin 11.7 H.A end
+ -2 5315
+a -2 5315 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3482) cvn H.B /DEST pdfmark
+end
+ -2 5315 a Black 3658 5805 a Fx(97)p Black
+eop end
+%%Page: 98 103
+TeXDict begin 98 102 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.98) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 11.7 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3484) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 562 309 a Fw(TIP:)f Fv(The)g(binar)r(y)f(pac)o(kage)g(will)g(use)
+i(the)e(OS-speci\002c)2195 309 y
+SDict begin H.S end
+ 2195 309 a 2195 309
+a
+SDict begin 11.7 H.A end
+ 2195 309 a 2195 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3485) cvn H.B /DEST pdfmark
+end
+ 2195 309 a Ft(samhainrc.OS)25
+b Fv(con\002gur)o(ation)18 b(\002le)i(from)g(the)562
+406 y(source)g(director)r(y)-7 b(,)19 b(thus)h(if)g(y)o(ou)g(customiz)o
+(e)g(this)o(,)g(y)o(our)f(pac)o(kage)g(will)g(contain)g(y)o(our)h
+(customiz)o(ed)f(v)n(ersion.)39 544 y
+SDict begin H.S end
+ 39 544 a 39 544
+a
+SDict begin 11.7 H.A end
+ 39 544 a 39 544 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3486) cvn H.B /DEST pdfmark
+end
+ 39 544 a -2 711 a
+SDict begin H.S end
+ -2 711 a -2 711
+a
+SDict begin 11.7 H.A end
+ -2 711 a -2 711 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3488) cvn H.B /DEST pdfmark
+end
+ -2 711 a 562 808 a Fw(TIP:)h Fv(Upon)g
+(installation,)c(the)k(pac)o(kage)e(will)i(not)g(automatically)d
+(initializ)o(e)h(the)h(baseline)f(database)o(,)g(and)562
+905 y(not)i(star)s(t)g(the)g(daemon)e(\(though)h(it)h(will)f(install)g
+(the)h(r)q(unle)n(v)n(el)e(scr)q(ipt)i(to)g(star)s(t)g(upon)f(boot\).)
+39 1043 y
+SDict begin H.S end
+ 39 1043 a 39 1043 a
+SDict begin 11.7 H.A end
+ 39 1043 a 39 1043 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3489) cvn H.B /DEST pdfmark
+end
+ 39
+1043 a -2 1209 a
+SDict begin H.S end
+ -2 1209 a -2 1209 a
+SDict begin 11.7 H.A end
+ -2 1209 a -2 1209
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3491) cvn H.B /DEST pdfmark
+end
+ -2 1209 a 562 1307 a Fw(NO)m(TE:)i Fv(F)n(or)e(reasons)h(e)n
+(xplained)d(in)p 0 TeXcolorgray 1647 1307 a
+SDict begin H.S end
+ 1647 1307
+a Fv(Section)i(11.2)2064 1307 y
+SDict begin 11.7 H.L end
+ 2064 1307 a 2064 1307
+a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2064 1307 a Black -2 w Fv(>,)h(w)o(e)h(do)f(not)f(recommend)h(to)g
+(distr)q(ib)o(ute)d(binar)r(y)562 1404 y(pac)o(kages)i(to)h(third)g
+(par)s(ties)o(.)e(On)j(the)e(other)g(hand,)g(it)h(is)h(perf)n(ectly)e
+(ok)h(to)h(use)f(a)g(self-b)o(uilt)e(binar)r(y)h(pac)o(kage)562
+1501 y(to)h(install/distr)q(ib)o(ute)1181 1501 y
+SDict begin H.S end
+ 1181
+1501 a 1181 1501 a
+SDict begin 11.7 H.A end
+ 1181 1501 a 1181 1501 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3493) cvn H.B /DEST pdfmark
+end
+ 1181 1501
+a Fv(samhain)f(on)h(y)o(our)f(machine/within)e(y)o(our)j(o)o(wn)f(netw)
+o(or)q(k.)39 1650 y
+SDict begin H.S end
+ 39 1650 a 39 1650 a
+SDict begin 13 H.A end
+ 39 1650 a 39
+1650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:RPM) cvn H.B /DEST pdfmark
+end
+ 39 1650 a 396 1978 a Fp(10.2.1.)36 b(Building)f(an)e(RPM)1745
+1978 y
+SDict begin H.S end
+ 1745 1978 a 1745 1978 a
+SDict begin 18.72 H.A end
+ 1745 1978 a 1745 1978
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.47.2) cvn H.B /DEST pdfmark
+end
+ 1745 1978 a -2 2005 a
+SDict begin H.S end
+ -2 2005 a -2 2005 a
+SDict begin 13 H.A end
+ -2 2005 a
+-2 2005 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CUSTOMRPM) cvn H.B /DEST pdfmark
+end
+ -2 2005 a 396 2266 a Fj(10.2.1.1.)c(Custom)e(RPM)1431
+2266 y
+SDict begin H.S end
+ 1431 2266 a 1431 2266 a
+SDict begin 15.6 H.A end
+ 1431 2266 a 1431 2266
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.47.21.3) cvn H.B /DEST
+pdfmark end
+ 1431 2266 a -2 2433 a
+SDict begin H.S end
+ -2 2433 a -2 2433 a
+SDict begin 13 H.A end
+ -2 2433 a
+-2 2433 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3498) cvn H.B /DEST pdfmark
+end
+ -2 2433 a 396 2540 a FC(If)20 b(you)g(run)749
+2540 y
+SDict begin H.S end
+ 749 2540 a 749 2540 a
+SDict begin 13 H.A end
+ 749 2540 a 749 2540 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3499) cvn H.B /DEST pdfmark
+end
+ 749
+2540 a Fy(./con\002gur)o(e)f FC(in)i(the)f(source)f(directory)-5
+b(,)18 b(a)j(spec)f(\002le)2278 2540 y
+SDict begin H.S end
+ 2278 2540 a 2278
+2540 a
+SDict begin 13 H.A end
+ 2278 2540 a 2278 2540 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3500) cvn H.B /DEST pdfmark
+end
+ 2278 2540 a Fr(samhain.spec)f
+FC(will)h(be)h(created)e(from)396 2648 y
+SDict begin H.S end
+ 396 2648 a 396
+2648 a
+SDict begin 13 H.A end
+ 396 2648 a 396 2648 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3501) cvn H.B /DEST pdfmark
+end
+ 396 2648 a Fr(samhain.spec.in)p
+FC(.)f(Y)-9 b(ou)20 b(can)g(then)g(use)1696 2648 y
+SDict begin H.S end
+ 1696
+2648 a 1696 2648 a
+SDict begin 13 H.A end
+ 1696 2648 a 1696 2648 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3502) cvn H.B /DEST pdfmark
+end
+ 1696 2648
+a Fy(mak)o(e)h(r)o(pm)g FC(to)f(create)g(source)f(and)h(binary)f(RPMs,)
+i(or)3336 2648 y
+SDict begin H.S end
+ 3336 2648 a 3336 2648 a
+SDict begin 13 H.A end
+ 3336 2648 a
+3336 2648 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3503) cvn H.B /DEST pdfmark
+end
+ 3336 2648 a Fy(mak)o(e)g(sr)o(pm)396 2756
+y FC(to)g(create)f(just)g(the)g(source)g(RPM.)-2 2940
+y
+SDict begin H.S end
+ -2 2940 a -2 2940 a
+SDict begin 13 H.A end
+ -2 2940 a -2 2940 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3504) cvn H.B /DEST pdfmark
+end
+ -2 2940 a 396
+3029 a FC(The)g(RPM)h(will)g(be)f(located)g(in)1337 3029
+y
+SDict begin H.S end
+ 1337 3029 a 1337 3029 a
+SDict begin 13 H.A end
+ 1337 3029 a 1337 3029 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3505) cvn H.B /DEST pdfmark
+end
+ 1337
+3029 a Fr(/usr/src/\(distribution-specific\)/RPMS/i3)o(86)p
+FC(.)15 b(Installing)k(the)396 3137 y(RPM)i(will)742
+3137 y
+SDict begin H.S end
+ 742 3137 a 742 3137 a
+SDict begin 13 H.A end
+ 742 3137 a 742 3137 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3506) cvn H.B /DEST pdfmark
+end
+ 742
+3137 a Fx(not)f(initialize)h FC(the)f(database)f(automatically)-5
+b(.)-2 3321 y
+SDict begin H.S end
+ -2 3321 a -2 3321 a
+SDict begin 13 H.A end
+ -2 3321 a -2 3321 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3507) cvn H.B /DEST pdfmark
+end
+
+-2 3321 a 396 3411 a FC(If)20 b(an)o(ything)e(f)o(ails)j(during)e(the)h
+(b)n(uild)g(\(and)f(after)h(installation)g(has)g(be)o(gun\),)e(just)j
+(cd)f(into)g(the)g(b)n(uild)g(directory)396 3519 y(and)g(do)g(a)698
+3519 y
+SDict begin H.S end
+ 698 3519 a 698 3519 a
+SDict begin 13 H.A end
+ 698 3519 a 698 3519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3508) cvn H.B /DEST pdfmark
+end
+ 698
+3519 a Fy(mak)o(e)h(uninstall)g(&&)g(mak)o(e)g(uninstall-boot)p
+FC(.)e(If)h(b)n(uilding)f(for)g(a)i(non-RedHat)d(system,)i(the)h(error)
+396 3627 y(messages)g(will)g(tell)f(you)g(which)f(\002le)i(paths)f(in)h
+(the)f(spec)g(\002le)h(were)f(incorrect.)-2 3656 y
+SDict begin H.S end
+ -2
+3656 a -2 3656 a
+SDict begin 13 H.A end
+ -2 3656 a -2 3656 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:VANILLARPM) cvn H.B /DEST pdfmark
+end
+ -2 3656 a 396 3933
+a Fj(10.2.1.2.)29 b(Single-host)1354 3933 y
+SDict begin H.S end
+ 1354 3933
+a 1354 3933 a
+SDict begin 15.6 H.A end
+ 1354 3933 a 1354 3933 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.47.22.3) cvn H.B /DEST
+pdfmark end
+ 1354 3933 a -2
+4121 a
+SDict begin H.S end
+ -2 4121 a -2 4121 a
+SDict begin 13 H.A end
+ -2 4121 a -2 4121 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3511) cvn H.B /DEST pdfmark
+end
+ -2 4121
+a 396 4207 a FC(If)20 b(you)g(w)o(ant)g(to)g(create)g(an)g(RPM)h(for)f
+(a)h(single-host)e(v)o(ersion)g(of)h(samhain)f(without)g(an)o(y)h(f)o
+(anc)o(y)f(options,)g(you)396 4315 y(can)h(just)h(run)-2
+4416 y
+SDict begin H.S end
+ -2 4416 a -2 4416 a
+SDict begin 11.7 H.A end
+ -2 4416 a -2 4416 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3512) cvn H.B /DEST pdfmark
+end
+ -2 4416
+a -2 4416 a
+SDict begin H.S end
+ -2 4416 a -2 4416 a
+SDict begin 11.7 H.A end
+ -2 4416 a -2 4416 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3513) cvn H.B /DEST pdfmark
+end
+ -2
+4416 a 396 4495 a Ft(bash$)638 4495 y
+SDict begin H.S end
+ 638 4495 a 638
+4495 a
+SDict begin 11.7 H.A end
+ 638 4495 a 638 4495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3514) cvn H.B /DEST pdfmark
+end
+ 638 4495 a Fs(rpmbuild)43
+b(-ta)f(samhain-)1483 4495 y
+SDict begin H.S end
+ 1483 4495 a 1483 4495 a
+SDict begin 11.7 H.A end
+
+1483 4495 a 1483 4495 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3515) cvn H.B /DEST pdfmark
+end
+ 1483 4495 a Fd(version)q Fs(.tar.g)q(z)-2
+4670 y
+SDict begin H.S end
+ -2 4670 a -2 4670 a
+SDict begin 13 H.A end
+ -2 4670 a -2 4670 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3516) cvn H.B /DEST pdfmark
+end
+ -2 4670
+a 396 4769 a FC(on)20 b(the)g(tarball)g(\(there)f(is)j(a)e(def)o(ault)g
+(spec)g(\002le)h(in)f(there\).)-2 4953 y
+SDict begin H.S end
+ -2 4953 a -2
+4953 a
+SDict begin 13 H.A end
+ -2 4953 a -2 4953 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3517) cvn H.B /DEST pdfmark
+end
+ -2 4953 a 396 5043 a FC(The)g(RPM)h(will)g
+(be)f(located)g(in)1337 5043 y
+SDict begin H.S end
+ 1337 5043 a 1337 5043
+a
+SDict begin 13 H.A end
+ 1337 5043 a 1337 5043 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3518) cvn H.B /DEST pdfmark
+end
+ 1337 5043 a Fr
+(/usr/src/\(distribution-specific\)/RPMS/i3)o(86)p FC(.)15
+b(Installing)k(the)396 5151 y(RPM)i(will)742 5151 y
+SDict begin H.S end
+ 742
+5151 a 742 5151 a
+SDict begin 13 H.A end
+ 742 5151 a 742 5151 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3519) cvn H.B /DEST pdfmark
+end
+ 742 5151 a Fx(not)f(initialize)
+h FC(the)f(baseline)g(database)f(automatically)-5 b(.)-2
+5262 y
+SDict begin H.S end
+ -2 5262 a -2 5262 a
+SDict begin 13 H.A end
+ -2 5262 a -2 5262 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:HPUX) cvn H.B /DEST pdfmark
+end
+ -2 5262
+a Black 3661 5805 a Fx(98)p Black eop end
+%%Page: 99 104
+TeXDict begin 99 103 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.99) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black 396 313 a Fp(10.2.2.)36 b(Building)f(an)e(HP-UX)g(pac)n(ka)o(g)q
+(e)2358 313 y
+SDict begin H.S end
+ 2358 313 a 2358 313 a
+SDict begin 18.72 H.A end
+ 2358 313 a 2358 313
+a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.48.2) cvn H.B /DEST pdfmark
+end
+ 2358 313 a -2 506 a
+SDict begin H.S end
+ -2 506 a -2 506 a
+SDict begin 13 H.A end
+ -2 506 a -2 506
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3522) cvn H.B /DEST pdfmark
+end
+ -2 506 a 396 587 a FC(First)21 b(run)701 587 y
+SDict begin H.S end
+ 701
+587 a 701 587 a
+SDict begin 13 H.A end
+ 701 587 a 701 587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3523) cvn H.B /DEST pdfmark
+end
+ 701 587 a Fy(./con\002gur)o(e)e
+FC(in)h(the)g(source)g(directory)e(with)j(your)e(preferred)f(options,)h
+(then)g(do)h(a)3139 587 y
+SDict begin H.S end
+ 3139 587 a 3139 587 a
+SDict begin 13 H.A end
+ 3139
+587 a 3139 587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3524) cvn H.B /DEST pdfmark
+end
+ 3139 587 a Fy(mak)o(e)g(depot)p FC(.)g(The)396
+695 y(result)g(should)g(be)g(a)g(package)f(named)1535
+695 y
+SDict begin H.S end
+ 1535 695 a 1535 695 a
+SDict begin 13 H.A end
+ 1535 695 a 1535 695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3525) cvn H.B /DEST pdfmark
+end
+ 1535
+695 a Fr(samhain.depot)p FC(,)g(that)h(can)g(be)g(installed)g(with)3010
+695 y
+SDict begin H.S end
+ 3010 695 a 3010 695 a
+SDict begin 13 H.A end
+ 3010 695 a 3010 695 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3526) cvn H.B /DEST pdfmark
+end
+ 3010
+695 a Fy(swinstall)p FC(.)h(Installing)396 803 y(the)f(package)f(will)
+961 803 y
+SDict begin H.S end
+ 961 803 a 961 803 a
+SDict begin 13 H.A end
+ 961 803 a 961 803 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3527) cvn H.B /DEST pdfmark
+end
+ 961
+803 a Fx(not)h(initialize)g FC(the)h(baseline)e(database)h
+(automatically)-5 b(.)-2 831 y
+SDict begin H.S end
+ -2 831 a -2 831 a
+SDict begin 13 H.A end
+ -2 831
+a -2 831 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SOL) cvn H.B /DEST pdfmark
+end
+ -2 831 a 396 1141 a Fp(10.2.3.)36 b(Building)f(a)e(Solaris)h
+(pac)n(ka)o(g)q(e)2312 1141 y
+SDict begin H.S end
+ 2312 1141 a 2312 1141 a
+SDict begin 18.72 H.A end
+
+2312 1141 a 2312 1141 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.49.2) cvn H.B /DEST pdfmark
+end
+ 2312 1141 a -2 1168 a
+SDict begin H.S end
+ -2 1168
+a -2 1168 a
+SDict begin 11.7 H.A end
+ -2 1168 a -2 1168 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3530) cvn H.B /DEST pdfmark
+end
+ -2 1168 a -2 1292 a
+SDict begin H.S end
+ -2
+1292 a -2 1292 a
+SDict begin 11.7 H.A end
+ -2 1292 a -2 1292 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3532) cvn H.B /DEST pdfmark
+end
+ -2 1292 a 562 1363
+a Fw(NO)m(TE:)21 b Fv(This)e(is)i(e)n(xper)q(imental)d(and)h(not)h(w)o
+(ell)f(tested.)g(Constr)q(uctiv)n(e)h(f)n(eedbac)o(k)e(from)i(e)n(xper)
+q(ienced)e(Solar)q(is)562 1460 y(administr)o(ators)g(is)j(w)o(elcome)o
+(.)-2 1775 y
+SDict begin H.S end
+ -2 1775 a -2 1775 a
+SDict begin 13 H.A end
+ -2 1775 a -2 1775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3533) cvn H.B /DEST pdfmark
+end
+
+-2 1775 a 396 1883 a FC(First)g(run)701 1883 y
+SDict begin H.S end
+ 701 1883
+a 701 1883 a
+SDict begin 13 H.A end
+ 701 1883 a 701 1883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3534) cvn H.B /DEST pdfmark
+end
+ 701 1883 a Fy(./con\002gur)o(e)e
+FC(in)h(the)g(source)g(directory)e(with)j(your)e(preferred)f(options,)h
+(then)g(do)h(a)3139 1883 y
+SDict begin H.S end
+ 3139 1883 a 3139 1883 a
+SDict begin 13 H.A end
+ 3139
+1883 a 3139 1883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3535) cvn H.B /DEST pdfmark
+end
+ 3139 1883 a Fy(mak)o(e)396 1991 y(solaris-pkg)p
+FC(.)g(The)g(result)g(should)f(be)h(a)h(package)e(named)2119
+1991 y
+SDict begin H.S end
+ 2119 1991 a 2119 1991 a
+SDict begin 13 H.A end
+ 2119 1991 a 2119 1991
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3536) cvn H.B /DEST pdfmark
+end
+ 2119 1991 a Fr(samhain.pkg)p FC(.)-2 2020 y
+SDict begin H.S end
+ -2 2020
+a -2 2020 a
+SDict begin 13 H.A end
+ -2 2020 a -2 2020 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:TBZ2) cvn H.B /DEST pdfmark
+end
+ -2 2020 a 396 2330 a
+Fp(10.2.4.)36 b(Building)f(a)e(Gentoo)h(Lin)o(ux)g(pac)n(ka)o(g)q(e)
+2683 2330 y
+SDict begin H.S end
+ 2683 2330 a 2683 2330 a
+SDict begin 18.72 H.A end
+ 2683 2330 a 2683
+2330 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.50.2) cvn H.B /DEST pdfmark
+end
+ 2683 2330 a -2 2522 a
+SDict begin H.S end
+ -2 2522 a -2 2522 a
+SDict begin 13 H.A end
+ -2 2522
+a -2 2522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3539) cvn H.B /DEST pdfmark
+end
+ -2 2522 a 396 2604 a FC(First)21 b(run)701
+2604 y
+SDict begin H.S end
+ 701 2604 a 701 2604 a
+SDict begin 13 H.A end
+ 701 2604 a 701 2604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3540) cvn H.B /DEST pdfmark
+end
+ 701
+2604 a Fy(./con\002gur)o(e)e([y)n(our)g(pr)o(eferr)o(ed)g(options])h
+FC(in)g(the)g(source)g(directory)e(\(reminder:)h(use)3242
+2604 y
+SDict begin H.S end
+ 3242 2604 a 3242 2604 a
+SDict begin 13 H.A end
+ 3242 2604 a 3242 2604
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3541) cvn H.B /DEST pdfmark
+end
+ 3242 2604 a Fy(./con\002gur)o(e)396 2712 y(--pr)o(e\002x=USR)p
+FC(,)g(NO)m(T)1101 2712 y
+SDict begin H.S end
+ 1101 2712 a 1101 2712 a
+SDict begin 13 H.A end
+ 1101
+2712 a 1101 2712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3542) cvn H.B /DEST pdfmark
+end
+ 1101 2712 a Fy(./con\002gur)o(e)g(--pr)o
+(e\002x=/usr)h FC(for)f(standard)g(paths\),)h(then)f(do)h(a)2953
+2712 y
+SDict begin H.S end
+ 2953 2712 a 2953 2712 a
+SDict begin 13 H.A end
+ 2953 2712 a 2953 2712
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3543) cvn H.B /DEST pdfmark
+end
+ 2953 2712 a Fy(mak)o(e)g(tbz2)p FC(.)g(The)3510 2712
+y
+SDict begin H.S end
+ 3510 2712 a 3510 2712 a
+SDict begin 13 H.A end
+ 3510 2712 a 3510 2712 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3544) cvn H.B /DEST pdfmark
+end
+ 3510
+2712 a Fr(.tbz2)396 2820 y FC(package)f(will)i(be)f(in)1023
+2820 y
+SDict begin H.S end
+ 1023 2820 a 1023 2820 a
+SDict begin 13 H.A end
+ 1023 2820 a 1023 2820
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3545) cvn H.B /DEST pdfmark
+end
+ 1023 2820 a Fr(/usr/portage/packages/All)d FC(\(this)j(is)h(just)g
+(ho)n(w)f(Gentoo)f(package)g(b)n(uilding)396 2928 y(w)o(orks\).)-2
+3108 y
+SDict begin H.S end
+ -2 3108 a -2 3108 a
+SDict begin 13 H.A end
+ -2 3108 a -2 3108 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3546) cvn H.B /DEST pdfmark
+end
+ -2 3108
+a 396 3202 a FC(The)h(Gentoo)f(package)g(thus)h(created)g(will)1674
+3202 y
+SDict begin H.S end
+ 1674 3202 a 1674 3202 a
+SDict begin 13 H.A end
+ 1674 3202 a 1674 3202
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3547) cvn H.B /DEST pdfmark
+end
+ 1674 3202 a Fx(not)f(initialize)i FC(the)f(database)g(automatically)e
+(upon)h(installation.)h(The)396 3309 y
+SDict begin H.S end
+ 396 3309 a 396
+3309 a
+SDict begin 13 H.A end
+ 396 3309 a 396 3309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3548) cvn H.B /DEST pdfmark
+end
+ 396 3309 a Fr(.tbz2)g FC(package)f(\002le)
+i(will)g(be)f(in)1395 3309 y
+SDict begin H.S end
+ 1395 3309 a 1395 3309 a
+SDict begin 13 H.A end
+
+1395 3309 a 1395 3309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3549) cvn H.B /DEST pdfmark
+end
+ 1395 3309 a Fr(/usr/portage/packages/All)d
+FC(\(this)j(is)h(just)g(ho)n(w)f(Gentoo)f(package)396
+3417 y(b)n(uilding)g(w)o(orks\).)-2 3435 y
+SDict begin H.S end
+ -2 3435 a
+-2 3435 a
+SDict begin 11.7 H.A end
+ -2 3435 a -2 3435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3550) cvn H.B /DEST pdfmark
+end
+ -2 3435 a -2 3560 a
+SDict begin H.S end
+ -2
+3560 a -2 3560 a
+SDict begin 11.7 H.A end
+ -2 3560 a -2 3560 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3552) cvn H.B /DEST pdfmark
+end
+ -2 3560 a 562 3639
+a Fw(NO)m(TE:)i Fv(If)f(y)o(ou)g(just)g(w)o(ant)f(to)h(install)f(on)h
+(y)o(our)f(o)o(wn)h(system,)h(r)o(ather)e(than)h(b)o(uilding)c(a)21
+b(pac)o(kage)d(f)n(or)i(other)562 3736 y(machines)o(,)f(y)o(ou)h(can)g
+(use)h(the)e(command)1818 3736 y
+SDict begin H.S end
+ 1818 3736 a 1818 3736
+a
+SDict begin 11.7 H.A end
+ 1818 3736 a 1818 3736 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3553) cvn H.B /DEST pdfmark
+end
+ 1818 3736 a Fw(make)h(emer)o(g)q(e)f
+Fv(\(after)g(r)q(unning)2782 3736 y
+SDict begin H.S end
+ 2782 3736 a 2782
+3736 a
+SDict begin 11.7 H.A end
+ 2782 3736 a 2782 3736 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3554) cvn H.B /DEST pdfmark
+end
+ 2782 3736 a Fw(./con\002gure)p
+Fv(,)f(of)i(course\).)-2 3969 y
+SDict begin H.S end
+ -2 3969 a -2 3969 a
+SDict begin 13 H.A end
+ -2
+3969 a -2 3969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DEB) cvn H.B /DEST pdfmark
+end
+ -2 3969 a 396 4297 a Fp(10.2.5.)36 b(Building)f(a)e
+(Debian)i(pac)n(ka)o(g)q(e)2312 4297 y
+SDict begin H.S end
+ 2312 4297 a 2312
+4297 a
+SDict begin 18.72 H.A end
+ 2312 4297 a 2312 4297 a
+SDict begin [ /View [/XYZ H.V] /Dest (12.68.51.2) cvn H.B /DEST pdfmark
+end
+ 2312 4297 a -2 4489 a
+SDict begin H.S end
+
+-2 4489 a -2 4489 a
+SDict begin 13 H.A end
+ -2 4489 a -2 4489 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3557) cvn H.B /DEST pdfmark
+end
+ -2 4489 a 396
+4571 a FC(First)21 b(run)701 4571 y
+SDict begin H.S end
+ 701 4571 a 701 4571
+a
+SDict begin 13 H.A end
+ 701 4571 a 701 4571 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3558) cvn H.B /DEST pdfmark
+end
+ 701 4571 a Fy(./con\002gur)o(e)e
+FC(in)h(the)g(source)g(directory)e(\(reminder:)h(use)2364
+4571 y
+SDict begin H.S end
+ 2364 4571 a 2364 4571 a
+SDict begin 13 H.A end
+ 2364 4571 a 2364 4571
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3559) cvn H.B /DEST pdfmark
+end
+ 2364 4571 a Fy(./con\002gur)o(e)g(--pr)o(e\002x=USR)p
+FC(,)g(NO)m(T)396 4679 y
+SDict begin H.S end
+ 396 4679 a 396 4679 a
+SDict begin 13 H.A end
+ 396 4679
+a 396 4679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3560) cvn H.B /DEST pdfmark
+end
+ 396 4679 a Fy(./con\002gur)o(e)g(--pr)o(e\002x=/usr)h
+FC(for)g(standard)f(paths\),)g(then)h(do)g(a)2248 4679
+y
+SDict begin H.S end
+ 2248 4679 a 2248 4679 a
+SDict begin 13 H.A end
+ 2248 4679 a 2248 4679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3561) cvn H.B /DEST pdfmark
+end
+ 2248
+4679 a Fy(mak)o(e)h(deb)p FC(.)g(The)2783 4679 y
+SDict begin H.S end
+ 2783
+4679 a 2783 4679 a
+SDict begin 13 H.A end
+ 2783 4679 a 2783 4679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3562) cvn H.B /DEST pdfmark
+end
+ 2783 4679
+a Fr(.deb)f FC(package)e(and)i(the)396 4787 y(corresponding)892
+4787 y
+SDict begin H.S end
+ 892 4787 a 892 4787 a
+SDict begin 13 H.A end
+ 892 4787 a 892 4787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3563) cvn H.B /DEST pdfmark
+end
+ 892
+4787 a Fr(.dsc)g FC(\002le)h(will)g(be)f(in)g(the)h(directory)d(abo)o
+(v)o(e)h(the)h(source)f(directory)g(\(this)h(is)h(just)g(ho)n(w)e
+(Debian)396 4895 y(package)g(b)n(uilding)g(w)o(orks\).)-2
+5079 y
+SDict begin H.S end
+ -2 5079 a -2 5079 a
+SDict begin 13 H.A end
+ -2 5079 a -2 5079 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3564) cvn H.B /DEST pdfmark
+end
+ -2 5079
+a 396 5169 a FC(Y)-9 b(ou)19 b(will)i(need)e(the)g(follo)n(wing)f
+(additional)h(Debian)g(packages)f(in)i(order)f(to)g(b)n(uild)h(a)g
+(Debian)f(packages:)3495 5169 y
+SDict begin H.S end
+ 3495 5169 a 3495 5169
+a
+SDict begin 13 H.A end
+ 3495 5169 a 3495 5169 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3565) cvn H.B /DEST pdfmark
+end
+ 3495 5169 a Fy(apt-get)396
+5276 y(fak)o(er)o(oot)p FC(,)735 5276 y
+SDict begin H.S end
+ 735 5276 a 735
+5276 a
+SDict begin 13 H.A end
+ 735 5276 a 735 5276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3566) cvn H.B /DEST pdfmark
+end
+ 735 5276 a Fy(apt-get)g(debmak)o(e)p
+FC(,)1368 5276 y
+SDict begin H.S end
+ 1368 5276 a 1368 5276 a
+SDict begin 13 H.A end
+ 1368 5276 a
+1368 5276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3567) cvn H.B /DEST pdfmark
+end
+ 1368 5276 a Fy(apt-get)g(debhelper)p FC(,)2035
+5276 y
+SDict begin H.S end
+ 2035 5276 a 2035 5276 a
+SDict begin 13 H.A end
+ 2035 5276 a 2035 5276
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3568) cvn H.B /DEST pdfmark
+end
+ 2035 5276 a Fy(apt-get)g(de)o(vscripts)p FC(,)h(and)2845
+5276 y
+SDict begin H.S end
+ 2845 5276 a 2845 5276 a
+SDict begin 13 H.A end
+ 2845 5276 a 2845 5276
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3569) cvn H.B /DEST pdfmark
+end
+ 2845 5276 a Fy(apt-get)f(cpio)p FC(.)p Black 3661 5805
+a Fx(99)p Black eop end
+%%Page: 100 105
+TeXDict begin 100 104 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.100) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2401 104 a
+Fx(Chapter)20 b(10.)f(Deployment)g(to)h(r)m(emote)h(hosts)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3570) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(The)f(Debian)g(package)e(thus)j(created)e(will)1669
+309 y
+SDict begin H.S end
+ 1669 309 a 1669 309 a
+SDict begin 13 H.A end
+ 1669 309 a 1669 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3571) cvn H.B /DEST pdfmark
+end
+ 1669
+309 a Fx(not)h(initialize)g FC(the)g(database)g(automatically)f(upon)f
+(installation.)i(It)396 417 y(will)h(be)f(located)g(in)g(the)1113
+417 y
+SDict begin H.S end
+ 1113 417 a 1113 417 a
+SDict begin 13 H.A end
+ 1113 417 a 1113 417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3572) cvn H.B /DEST pdfmark
+end
+ 1113
+417 a Fx(par)m(ent)g(dir)m(ectory)g FC(of)g(the)g(source)f(directory)g
+(\(that')-5 b(s)20 b(just)h(the)f(w)o(ay)g(the)h(Debian)e(b)n(uild)396
+525 y(system)i(w)o(orks\).)p Black 3620 5805 a Fx(100)p
+Black eop end
+%%Page: 101 106
+TeXDict begin 101 105 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.101) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SECURITY-DESIGN) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Chapter)48 b(11.)f(Security)g(Design)2284 351 y
+SDict begin H.S end
+ 2284
+351 a 2284 351 a
+SDict begin 26.957 H.A end
+ 2284 351 a 2284 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.0) cvn H.B /DEST pdfmark end
+ 2284 351 a -2
+443 a
+SDict begin H.S end
+ -2 443 a -2 443 a
+SDict begin 13 H.A end
+ -2 443 a -2 443 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SECURITY-USAGE) cvn H.B /DEST
+pdfmark end
+ -2 443 a 339
+x Fu(11.1.)39 b(Usa)o(g)q(e)789 782 y
+SDict begin H.S end
+ 789 782 a 789 782
+a
+SDict begin 22.464 H.A end
+ 789 782 a 789 782 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.69.1) cvn H.B /DEST pdfmark
+end
+ 789 782 a -2 980 a
+SDict begin H.S end
+ -2 980 a -2
+980 a
+SDict begin 13 H.A end
+ -2 980 a -2 980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3577) cvn H.B /DEST pdfmark
+end
+ -2 980 a 396 1056 a FC(It)21
+b(is)g(recommended)c(to:)-2 1223 y
+SDict begin H.S end
+ -2 1223 a -2 1223
+a
+SDict begin 13 H.A end
+ -2 1223 a -2 1223 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3578) cvn H.B /DEST pdfmark
+end
+ -2 1223 a -2 1223 a
+SDict begin H.S end
+ -2 1223 a -2
+1223 a
+SDict begin 13 H.A end
+ -2 1223 a -2 1223 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3579) cvn H.B /DEST pdfmark
+end
+ -2 1223 a -2 1233 a
+SDict begin H.S end
+ -2 1233
+a -2 1233 a
+SDict begin 13 H.A end
+ -2 1233 a -2 1233 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3580) cvn H.B /DEST pdfmark
+end
+ -2 1233 a Black 396 1392
+a FB(\225)p Black 479 1392 a
+SDict begin H.S end
+ 479 1392 a 479 1392 a
+SDict begin 13 H.A end
+ 479
+1392 a 479 1392 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3581) cvn H.B /DEST pdfmark
+end
+ 479 1392 a 479 1392 a
+SDict begin H.S end
+ 479 1392 a 479
+1392 a
+SDict begin 13 H.A end
+ 479 1392 a 479 1392 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3582) cvn H.B /DEST pdfmark
+end
+ 479 1392 a Fx(compile)j(a)g(static)h
+(binary)e FC(\(not)h(link)o(ed)f(to)i(shared)e(libraries\),)g(using)h
+(the)g(con\002gure)f(option)3199 1392 y
+SDict begin H.S end
+ 3199 1392 a 3199
+1392 a
+SDict begin 13 H.A end
+ 3199 1392 a 3199 1392 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3583) cvn H.B /DEST pdfmark
+end
+ 3199 1392 a Fy(--enable-static)479
+1500 y FC(if)i(possible)f(\(not)f(possible)h(on)g(Solaris)g(\227)h
+(this)g(is)g(a)f(Solaris)h(problem,)d(not)i(a)h(problem)d(of)3166
+1500 y
+SDict begin H.S end
+ 3166 1500 a 3166 1500 a
+SDict begin 13 H.A end
+ 3166 1500 a 3166 1500
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3584) cvn H.B /DEST pdfmark
+end
+ 3166 1500 a FC(samhain\))-2 1518 y
+SDict begin H.S end
+ -2 1518 a -2 1518
+a
+SDict begin 13 H.A end
+ -2 1518 a -2 1518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3585) cvn H.B /DEST pdfmark
+end
+ -2 1518 a Black 396 1650 a FB(\225)p
+Black 479 1650 a
+SDict begin H.S end
+ 479 1650 a 479 1650 a
+SDict begin 13 H.A end
+ 479 1650 a 479
+1650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3586) cvn H.B /DEST pdfmark
+end
+ 479 1650 a 479 1650 a
+SDict begin H.S end
+ 479 1650 a 479 1650 a
+SDict begin 13 H.A end
+ 479
+1650 a 479 1650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3587) cvn H.B /DEST pdfmark
+end
+ 479 1650 a Fx(strip)j(the)g(binary)e
+FC(\(on)g(i386)h(Linux/FreeBSD,)f(also)h(use)h(the)f(pro)o(vided)2607
+1650 y
+SDict begin H.S end
+ 2607 1650 a 2607 1650 a
+SDict begin 13 H.A end
+ 2607 1650 a 2607 1650
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3588) cvn H.B /DEST pdfmark
+end
+ 2607 1650 a Fy(sstrip)h FC(utility:)3068 1650 y
+SDict begin H.S end
+ 3068
+1650 a 3068 1650 a
+SDict begin 13 H.A end
+ 3068 1650 a 3068 1650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3589) cvn H.B /DEST pdfmark
+end
+ 3068 1650
+a Fy(strip)g(samhain)f(&&)479 1758 y(sstrip)h(samhain)p
+FC(\).)f(This)h(will)g(help)e(some)n(what)h(against)f(intruders)g(that)
+h(try)g(to)h(run)e(it)i(under)e(a)i(deb)n(ugger)d(...)-2
+1776 y
+SDict begin H.S end
+ -2 1776 a -2 1776 a
+SDict begin 11.7 H.A end
+ -2 1776 a -2 1776 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3590) cvn H.B /DEST pdfmark
+end
+ -2 1776
+a -2 1900 a
+SDict begin H.S end
+ -2 1900 a -2 1900 a
+SDict begin 11.7 H.A end
+ -2 1900 a -2 1900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3592) cvn H.B /DEST pdfmark
+end
+ -2
+1900 a 645 1979 a Fw(NO)m(TE:)895 1979 y
+SDict begin H.S end
+ 895 1979 a 895
+1979 a
+SDict begin 11.7 H.A end
+ 895 1979 a 895 1979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3593) cvn H.B /DEST pdfmark
+end
+ 895 1979 a Fw(make)i(install)f
+Fv(will)g(alw)o(a)n(ys)h(str)q(ip)g(the)f(e)n(xcutab)o(les)o(.)f(T)-9
+b(r)r(ying)20 b(to)g(str)q(ip)g(again)e(b)o(y)i(hand)f(ma)n(y)i(corr)q
+(upt)645 2076 y(the)f(e)n(x)n(ecutab)o(le)o(.)438 2417
+y
+SDict begin H.S end
+ 438 2417 a 438 2417 a
+SDict begin 13 H.A end
+ 438 2417 a 438 2417 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3594) cvn H.B /DEST pdfmark
+end
+ 438 2417
+a Black 396 2566 a FB(\225)p Black 479 2566 a
+SDict begin H.S end
+ 479 2566
+a 479 2566 a
+SDict begin 13 H.A end
+ 479 2566 a 479 2566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3595) cvn H.B /DEST pdfmark
+end
+ 479 2566 a 479 2566
+a
+SDict begin H.S end
+ 479 2566 a 479 2566 a
+SDict begin 13 H.A end
+ 479 2566 a 479 2566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3596) cvn H.B /DEST pdfmark
+end
+ 479 2566
+a Fx(use)h(signed)e(database/con\002gur)o(ation)c(\002les)21
+b FC(using)e(the)h(con\002gure)f(option)2683 2566 y
+SDict begin H.S end
+ 2683
+2566 a 2683 2566 a
+SDict begin 13 H.A end
+ 2683 2566 a 2683 2566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3597) cvn H.B /DEST pdfmark
+end
+ 2683 2566
+a Fy(--with-gpg=P)-6 b(A)e(TH_T)o(O_GPG)p FC(,)479 2674
+y
+SDict begin H.S end
+ 479 2674 a 479 2674 a
+SDict begin 13 H.A end
+ 479 2674 a 479 2674 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3598) cvn H.B /DEST pdfmark
+end
+ 479 2674
+a Fx(and)22 b FC(compile)d(in)h(the)h(\002ngerprint)d(of)i(the)g
+(signing)f(k)o(e)o(y)h(\()2138 2674 y
+SDict begin H.S end
+ 2138 2674 a 2138
+2674 a
+SDict begin 13 H.A end
+ 2138 2674 a 2138 2674 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3599) cvn H.B /DEST pdfmark
+end
+ 2138 2674 a 20 w Fy(--with-fp=...)p
+FC(\))-2 2692 y
+SDict begin H.S end
+ -2 2692 a -2 2692 a
+SDict begin 13 H.A end
+ -2 2692 a -2 2692
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3600) cvn H.B /DEST pdfmark
+end
+ -2 2692 a Black 396 2824 a FB(\225)p Black 479 2824
+a
+SDict begin H.S end
+ 479 2824 a 479 2824 a
+SDict begin 13 H.A end
+ 479 2824 a 479 2824 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3601) cvn H.B /DEST pdfmark
+end
+ 479 2824
+a 479 2824 a
+SDict begin H.S end
+ 479 2824 a 479 2824 a
+SDict begin 13 H.A end
+ 479 2824 a 479 2824
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3602) cvn H.B /DEST pdfmark
+end
+ 479 2824 a Fx(tak)o(e)h(a)f(look)g(at)g(the)g(stealth)g(options)f
+FC(-)i(while)f(')-5 b(security)20 b(by)g(obscurity')2600
+2824 y
+SDict begin H.S end
+ 2600 2824 a 2600 2824 a
+SDict begin 13 H.A end
+ 2600 2824 a 2600 2824
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3603) cvn H.B /DEST pdfmark
+end
+ 2600 2824 a Fx(only)g FC(is)h(a)f(v)o(ery)f(bad)h(idea,)g(it)h
+(certainly)479 2932 y(helps)f(if)h(an)f(intruder)f(does)g(not)h(kno)n
+(w)f(what)i(defenses)e(you)g(ha)n(v)o(e)h(in)g(place)-2
+3247 y
+SDict begin H.S end
+ -2 3247 a -2 3247 a
+SDict begin 13 H.A end
+ -2 3247 a -2 3247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3604) cvn H.B /DEST pdfmark
+end
+ -2 3247
+a 396 3355 a FC(If)g(you)g(use)g(a)807 3355 y
+SDict begin H.S end
+ 807 3355
+a 807 3355 a
+SDict begin 13 H.A end
+ 807 3355 a 807 3355 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3605) cvn H.B /DEST pdfmark
+end
+ 807 3355 a Fx(pr)m(ecompiled)1242
+3355 y
+SDict begin H.S end
+ 1242 3355 a 1242 3355 a
+SDict begin 13 H.A end
+ 1242 3355 a 1242 3355
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3606) cvn H.B /DEST pdfmark
+end
+ 1242 3355 a FC(samhain)f(e)o(x)o(ecutable)f(\(e.g.)i(from)f(a)h
+(binary)f(distrib)n(ution\),)g(in)h(principle)f(a)396
+3463 y(prospecti)n(v)o(e)f(intruder)h(could)g(easily)i(obtain)e(a)i
+(cop)o(y)e(of)h(the)g(e)o(x)o(ecutable)e(and)i(analyze)f(it)i(in)g(adv)
+n(ance.)d(This)i(will)396 3571 y(enable)g(her/him)f(to)h(generate)f(f)o
+(ak)o(e)h(audit)g(trails)h(and/or)d(generate)h(a)i(trojan)e(for)h(this)
+h(particular)e(binary)396 3679 y(distrib)n(ution.)-2
+3846 y
+SDict begin H.S end
+ -2 3846 a -2 3846 a
+SDict begin 13 H.A end
+ -2 3846 a -2 3846 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3607) cvn H.B /DEST pdfmark
+end
+ -2 3846
+a 396 3953 a FC(F)o(or)h(this)h(reason,)e(it)i(is)g(possible)f(for)g
+(the)g(user)g(to)g(add)g(more)f(k)o(e)o(y)h(material)g(into)f(the)i
+(binary)e(e)o(x)o(ecutable.)f(This)i(is)396 4061 y(done)f(with)i(the)f
+(command:)-2 4228 y
+SDict begin H.S end
+ -2 4228 a -2 4228 a
+SDict begin 13 H.A end
+ -2 4228 a -2
+4228 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3608) cvn H.B /DEST pdfmark
+end
+ -2 4228 a -2 4228 a
+SDict begin H.S end
+ -2 4228 a -2 4228 a
+SDict begin 13 H.A end
+ -2 4228
+a -2 4228 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3609) cvn H.B /DEST pdfmark
+end
+ -2 4228 a 396 4335 a Fy(samhain)h(--add-k)o(ey=)1106
+4335 y
+SDict begin H.S end
+ 1106 4335 a 1106 4335 a
+SDict begin 13 H.A end
+ 1106 4335 a 1106 4335
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3610) cvn H.B /DEST pdfmark
+end
+ 1106 4335 a Fl(key@/path/to/executable)-2 4518 y
+SDict begin H.S end
+ -2
+4518 a -2 4518 a
+SDict begin 13 H.A end
+ -2 4518 a -2 4518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3611) cvn H.B /DEST pdfmark
+end
+ -2 4518 a 396 4609
+a FC(This)g(will)g(read)e(the)h(\002le)1127 4609 y
+SDict begin H.S end
+ 1127
+4609 a 1127 4609 a
+SDict begin 13 H.A end
+ 1127 4609 a 1127 4609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3612) cvn H.B /DEST pdfmark
+end
+ 1127 4609
+a Fr(/path/to/executable)p FC(,)e(add)h(the)h(k)o(e)o(y)2422
+4609 y
+SDict begin H.S end
+ 2422 4609 a 2422 4609 a
+SDict begin 13 H.A end
+ 2422 4609 a 2422 4609
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3613) cvn H.B /DEST pdfmark
+end
+ 2422 4609 a Fx(k)o(e)n(y)p FC(,)g(which)f(should)h(not)f(contain)h(a)
+g('@')396 4717 y(\(because)f(it)h(has)f(a)h(special)g(meaning,)d
+(separating)h(k)o(e)o(y)h(from)g(path\),)f(o)o(v)o(erwrite)f(an)o(y)i
+(k)o(e)o(y)g(pre)n(viously)e(set)j(by)f(this)396 4825
+y(command,)f(and)i(write)g(the)g(ne)n(w)g(binary)f(to)i(the)f(location)
+2105 4825 y
+SDict begin H.S end
+ 2105 4825 a 2105 4825 a
+SDict begin 13 H.A end
+ 2105 4825 a 2105
+4825 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3614) cvn H.B /DEST pdfmark
+end
+ 2105 4825 a Fr(/path/to/executable.out)d FC(\(i.e.)j(with)g
+(.out)396 4932 y(appended\).)e(Y)-9 b(ou)19 b(should)g(then)h(cop)o(y)f
+(the)i(ne)n(w)f(binary)e(to)j(the)f(location)f(of)h(the)g(old)g(one)g
+(\(i.e.)g(o)o(v)o(erwrite)e(the)i(old)396 5040 y(one\).)-2
+5066 y
+SDict begin H.S end
+ -2 5066 a -2 5066 a
+SDict begin 13 H.A end
+ -2 5066 a -2 5066 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:KEYPAD) cvn H.B /DEST pdfmark
+end
+ -2 5066
+a Black 3620 5805 a Fx(101)p Black eop end
+%%Page: 102 107
+TeXDict begin 102 106 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.102) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2799 104 a
+Fx(Chapter)20 b(11.)f(Security)h(Design)p Black -2 330
+a Fu(11.2.)39 b(Integrity)f(of)h(the)g(e)n(x)o(ecutab)o(le)2133
+330 y
+SDict begin H.S end
+ 2133 330 a 2133 330 a
+SDict begin 22.464 H.A end
+ 2133 330 a 2133 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.70.1) cvn H.B /DEST pdfmark
+end
+ 2133
+330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3617) cvn H.B /DEST pdfmark
+end
+ -2
+528 a 396 604 a FC(Each)20 b(samhain)f(e)o(x)o(ecutable)g(contains)g(a)
+i(compiled-in)d(k)o(e)o(y)-5 b(,)19 b(that)h(is)h(used)f(when)g(the)g
+(signatures)f(of)h(emails)396 712 y(and/or)f(log\002le)h(entries)g(are)
+g(v)o(eri\002ed.)f(By)i(def)o(ault,)e(a)i(cryptographically)16
+b(strong)j(random)g(k)o(e)o(y)g(is)i(generated)e(by)396
+820 y(the)518 820 y
+SDict begin H.S end
+ 518 820 a 518 820 a
+SDict begin 13 H.A end
+ 518 820 a 518
+820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3618) cvn H.B /DEST pdfmark
+end
+ 518 820 a Fy(con\002gur)o(e)h FC(script)g(at)h(compile)e(time.)h
+(Thus,)g(each)g(b)n(uild)f(is)i(unique,)e(and)h(signature)f(v)o
+(eri\002cation)f(will)j(f)o(ail)g(if)396 928 y(a)g(dif)n(ferent)d(b)n
+(uild)i(is)h(used,)f(e)o(xcept)f(if)i(the)f(compiled-in)e(k)o(e)o(y)h
+(w)o(as)i(set)g(to)g(a)f(common)f(v)n(alue)g(for)h(both)f(b)n(uilds.)-2
+1112 y
+SDict begin H.S end
+ -2 1112 a -2 1112 a
+SDict begin 13 H.A end
+ -2 1112 a -2 1112 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3619) cvn H.B /DEST pdfmark
+end
+ -2 1112
+a 396 1202 a FC(T)-7 b(o)21 b(set)g(a)f(user)n(-de\002ned)f(k)o(e)o(y)
+-5 b(,)19 b(there)g(is)i(an)g(option)-2 1386 y
+SDict begin H.S end
+ -2 1386
+a -2 1386 a
+SDict begin 13 H.A end
+ -2 1386 a -2 1386 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3620) cvn H.B /DEST pdfmark
+end
+ -2 1386 a -2 1386 a
+SDict begin H.S end
+ -2
+1386 a -2 1386 a
+SDict begin 13 H.A end
+ -2 1386 a -2 1386 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3621) cvn H.B /DEST pdfmark
+end
+ -2 1386 a 396 1476
+a Fy(./con\002gur)o(e)e(--enable-base=)1310 1476 y
+SDict begin H.S end
+ 1310
+1476 a 1310 1476 a
+SDict begin 13 H.A end
+ 1310 1476 a 1310 1476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3622) cvn H.B /DEST pdfmark
+end
+ 1310 1476
+a Fl(B1,B2)-2 1659 y
+SDict begin H.S end
+ -2 1659 a -2 1659 a
+SDict begin 13 H.A end
+ -2 1659 a -2
+1659 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3623) cvn H.B /DEST pdfmark
+end
+ -2 1659 a 396 1750 a FC(where)h(B1,B2)g(should)f(be)h(tw)o(o)h
+(inte)o(gers)e(in)i(the)f(range)f(0...2147483647.)-2
+1934 y
+SDict begin H.S end
+ -2 1934 a -2 1934 a
+SDict begin 13 H.A end
+ -2 1934 a -2 1934 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3624) cvn H.B /DEST pdfmark
+end
+ -2 1934
+a 396 2024 a FC(The)h(k)o(e)o(y)g(generated)e(by)1132
+2024 y
+SDict begin H.S end
+ 1132 2024 a 1132 2024 a
+SDict begin 13 H.A end
+ 1132 2024 a 1132 2024
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3625) cvn H.B /DEST pdfmark
+end
+ 1132 2024 a Fy(con\002gur)o(e)h FC(is)i(printed)e(in)i(the)f
+(con\002gure)e(script')-5 b(s)21 b(output.)e(It)h(is)h(recommended)c
+(that)396 2132 y(you)j(sa)n(v)o(e)g(this)h(k)o(e)o(y)e(and)h(use)g(it)h
+(for)f(further)e(b)n(uilds.)-2 2316 y
+SDict begin H.S end
+ -2 2316 a -2 2316
+a
+SDict begin 13 H.A end
+ -2 2316 a -2 2316 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3626) cvn H.B /DEST pdfmark
+end
+ -2 2316 a 396 2406 a FC(Whene)n(v)o(er)h(you)g
+(try)h(to)g(v)o(erify)f(the)h(inte)o(grity)f(of)h(e-mails)g(or)g(log)g
+(\002le)h(entries,)f(this)h(compiled-in)d(k)o(e)o(y)h(is)i(used)f(\(to)
+396 2514 y(be)g(more)g(speci\002c:)g(the)g(signature)g(k)o(e)o(y)f(is)i
+(encrypted)d(with)j(a)f(one-time)f(pad)h(generated)e(from)h(the)i
+(message)396 2622 y(itself)g(and)f(the)g(compiled-in)e(k)o(e)o(y\).)h
+(As)i(a)f(result,)g(if)h(e)o(x)o(ecutable)d(B)j(is)g(used)f(to)h(v)o
+(erify)e(the)h(inte)o(grity)f(of)g(e-mails)396 2730 y(sent)i(by)f(e)o
+(x)o(ecutable)e(A,)1129 2730 y
+SDict begin H.S end
+ 1129 2730 a 1129 2730
+a
+SDict begin 13 H.A end
+ 1129 2730 a 1129 2730 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3627) cvn H.B /DEST pdfmark
+end
+ 1129 2730 a Fx(inte)m(grity)i(veri\002cation)
+f(will)i(fail)g FC(if)f(the)h(compiled-in)d(k)o(e)o(ys)h(of)h(A)h(and)f
+(B)h(do)f(not)f(match.)396 2838 y(This)i(can)f(be)g(used)g(to)g(check)f
+(the)i(inte)o(grity)d(of)i(A)h(in)f(a)h(straightforw)o(ard)d(w)o(ay)i
+(\(check)f(e-mails)h(on)g(another)f(host,)396 2946 y(using)h(a)h(dif)n
+(ferent)d(e)o(x)o(ecutable)g(compiled)h(with)h(the)h(same)f(k)o(e)o
+(y\).)-2 3130 y
+SDict begin H.S end
+ -2 3130 a -2 3130 a
+SDict begin 13 H.A end
+ -2 3130 a -2 3130
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3628) cvn H.B /DEST pdfmark
+end
+ -2 3130 a 396 3219 a FC(Ob)o(viously)-5 b(,)18 b(this)j(scheme)f(can)
+g(be)g(brok)o(en,)e(b)n(ut)i(it)h(requires)e(an)h(intruder)f(to)h
+(disassemble/decompile)e(and)396 3327 y(analyze)i(the)g(e)o(xisting)
+1075 3327 y
+SDict begin H.S end
+ 1075 3327 a 1075 3327 a
+SDict begin 13 H.A end
+ 1075 3327 a 1075
+3327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3629) cvn H.B /DEST pdfmark
+end
+ 1075 3327 a FC(samhain)g(e)o(x)o(ecutable,)e(rather)h(than)h
+(simply)g(replace)f(it)i(with)f(a)h(precompiled)d(trojan.)-2
+3511 y
+SDict begin H.S end
+ -2 3511 a -2 3511 a
+SDict begin 13 H.A end
+ -2 3511 a -2 3511 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3630) cvn H.B /DEST pdfmark
+end
+ -2 3511
+a 396 3601 a FC(Ho)n(we)n(v)o(er)m(,)g(if)j(you)e(use)i(a)1139
+3601 y
+SDict begin H.S end
+ 1139 3601 a 1139 3601 a
+SDict begin 13 H.A end
+ 1139 3601 a 1139 3601
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3631) cvn H.B /DEST pdfmark
+end
+ 1139 3601 a Fx(pr)m(ecompiled)1574 3601 y
+SDict begin H.S end
+ 1574 3601
+a 1574 3601 a
+SDict begin 13 H.A end
+ 1574 3601 a 1574 3601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3632) cvn H.B /DEST pdfmark
+end
+ 1574 3601 a FC(samhain)f(e)o(x)o
+(ecutable)e(\(e.g.)h(from)g(a)i(binary)e(distrib)n(ution\),)f(in)i
+(principle)396 3709 y(a)h(prospecti)n(v)o(e)d(intruder)h(could)g
+(easily)h(obtain)g(a)g(cop)o(y)g(of)f(the)i(e)o(x)o(ecutable)d(and)i
+(analyze)f(it)i(in)f(adv)n(ance.)f(This)396 3817 y(will)i(enable)f
+(her/him)f(to)h(generate)f(f)o(ak)o(e)h(audit)g(trails)h(and/or)d
+(generate)h(a)i(trojan)e(for)h(this)h(particular)e(binary)396
+3925 y(distrib)n(ution.)-2 4092 y
+SDict begin H.S end
+ -2 4092 a -2 4092 a
+SDict begin 13 H.A end
+
+-2 4092 a -2 4092 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3633) cvn H.B /DEST pdfmark
+end
+ -2 4092 a 396 4199 a FC(F)o(or)h(this)h(reason,)e
+(it)i(is)g(possible)f(for)g(the)g(user)g(to)g(add)g(more)f(k)o(e)o(y)h
+(material)g(into)f(the)i(binary)e(e)o(x)o(ecutable.)f(This)i(is)396
+4307 y(done)f(with)i(the)f(command:)-2 4474 y
+SDict begin H.S end
+ -2 4474
+a -2 4474 a
+SDict begin 13 H.A end
+ -2 4474 a -2 4474 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3634) cvn H.B /DEST pdfmark
+end
+ -2 4474 a -2 4474 a
+SDict begin H.S end
+ -2
+4474 a -2 4474 a
+SDict begin 13 H.A end
+ -2 4474 a -2 4474 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3635) cvn H.B /DEST pdfmark
+end
+ -2 4474 a 396 4581
+a Fy(samhain)h(--add-k)o(ey=)1106 4581 y
+SDict begin H.S end
+ 1106 4581 a
+1106 4581 a
+SDict begin 13 H.A end
+ 1106 4581 a 1106 4581 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3636) cvn H.B /DEST pdfmark
+end
+ 1106 4581 a Fl
+(key@/path/to/executable)-2 4764 y
+SDict begin H.S end
+ -2 4764 a -2 4764
+a
+SDict begin 13 H.A end
+ -2 4764 a -2 4764 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3637) cvn H.B /DEST pdfmark
+end
+ -2 4764 a 396 4855 a FC(This)g(will)g(read)e(the)
+h(\002le)1127 4855 y
+SDict begin H.S end
+ 1127 4855 a 1127 4855 a
+SDict begin 13 H.A end
+ 1127 4855
+a 1127 4855 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3638) cvn H.B /DEST pdfmark
+end
+ 1127 4855 a Fr(/path/to/executable)p FC(,)e(add)h(the)h
+(k)o(e)o(y)2422 4855 y
+SDict begin H.S end
+ 2422 4855 a 2422 4855 a
+SDict begin 13 H.A end
+ 2422 4855
+a 2422 4855 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3639) cvn H.B /DEST pdfmark
+end
+ 2422 4855 a Fx(k)o(e)n(y)p FC(,)g(which)f(should)h(not)f
+(contain)h(a)g('@')396 4963 y(\(because)f(it)h(has)f(a)h(special)g
+(meaning,)d(separating)h(k)o(e)o(y)h(from)g(path\),)f(o)o(v)o(erwrite)f
+(an)o(y)i(k)o(e)o(y)g(pre)n(viously)e(set)j(by)f(this)396
+5071 y(command,)f(and)i(write)g(the)g(ne)n(w)g(binary)f(to)i(the)f
+(location)2105 5071 y
+SDict begin H.S end
+ 2105 5071 a 2105 5071 a
+SDict begin 13 H.A end
+ 2105 5071
+a 2105 5071 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3640) cvn H.B /DEST pdfmark
+end
+ 2105 5071 a Fr(/path/to/executable.out)d
+FC(\(i.e.)j(with)g(.out)396 5179 y(appended\).)-2 5197
+y
+SDict begin H.S end
+ -2 5197 a -2 5197 a
+SDict begin 11.7 H.A end
+ -2 5197 a -2 5197 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3641) cvn H.B /DEST pdfmark
+end
+ -2 5197 a Black
+3620 5805 a Fx(102)p Black eop end
+%%Page: 103 108
+TeXDict begin 103 107 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.103) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2799 104 a
+Fx(Chapter)20 b(11.)f(Security)h(Design)p Black 745 242
+2668 17 v 745 797 17 555 v 1790 396 a Fp(W)-7 b(ARNING)786
+563 y
+SDict begin H.S end
+ 786 563 a 786 563 a
+SDict begin 11.7 H.A end
+ 786 563 a 786 563 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3643) cvn H.B /DEST pdfmark
+end
+ 786 563
+a 96 x Fv(Using)20 b(a)h(precompiled)c(samhain)i(e)n(x)n(ecutab)o(le)e
+(from)k(a)f(binar)r(y)f(pac)o(kage)g(distr)q(ib)o(ution)e(is)786
+756 y(not)j(recommended)e(unless)i(y)o(ou)g(add)f(in)h(k)o(e)o(y)g
+(mater)q(ial)f(as)h(descr)q(ibed)f(abo)o(v)n(e)o(.)p
+3396 797 17 555 v 745 813 2668 17 v -2 907 a
+SDict begin H.S end
+ -2 907 a
+-2 907 a
+SDict begin 13 H.A end
+ -2 907 a -2 907 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CLIENT-INTEGRITY) cvn H.B /DEST
+pdfmark end
+ -2 907 a 320 x Fu(11.3.)39
+b(Client)f(e)n(x)o(ecutab)o(le)f(integrity)2140 1227
+y
+SDict begin H.S end
+ 2140 1227 a 2140 1227 a
+SDict begin 22.464 H.A end
+ 2140 1227 a 2140 1227 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.71.1) cvn H.B /DEST pdfmark
+end
+ 2140
+1227 a -2 1425 a
+SDict begin H.S end
+ -2 1425 a -2 1425 a
+SDict begin 13 H.A end
+ -2 1425 a -2 1425
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3646) cvn H.B /DEST pdfmark
+end
+ -2 1425 a 396 1501 a FC(If)20 b(you)g(use)749 1501
+y
+SDict begin H.S end
+ 749 1501 a 749 1501 a
+SDict begin 13 H.A end
+ 749 1501 a 749 1501 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3647) cvn H.B /DEST pdfmark
+end
+ 749 1501
+a FC(samhain)f(in)i(a)f(client/serv)o(er)f(setup,)h(the)g(client)h
+(needs)e(to)i(authenticate)e(to)h(the)g(serv)o(er)f(using)h(a)396
+1609 y(passw)o(ord)g(that)g(is)h(located)f(within)g(the)g(client)g(e)o
+(x)o(ecutable,)e(at)j(one)e(of)h(se)n(v)o(eral)g(possible)g(places)g
+(\(where)f(the)396 1717 y(v)n(alid)h(place)g(for)f(your)g(particular)g
+(b)n(uild)h(is)h(chosen)f(at)g(random)f(at)h(compile)g(time\).)f(If)h
+(the)h(passw)o(ord)e(is)i(set,)g(the)396 1825 y(alternati)n(v)o(e)e
+(places)h(are)g(\002lled)h(with)f(random)f(v)n(alues.)-2
+2009 y
+SDict begin H.S end
+ -2 2009 a -2 2009 a
+SDict begin 13 H.A end
+ -2 2009 a -2 2009 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3648) cvn H.B /DEST pdfmark
+end
+ -2 2009
+a 396 2098 a FC(Upon)g(authentication)g(to)h(the)g(serv)o(er)m(,)f
+(client)h(and)g(serv)o(er)f(ne)o(gotiate)g(ephemeral)g(k)o(e)o(ys)g
+(for)h(signing)f(and)396 2206 y(encrypting)f(further)h(communication.)
+-2 2390 y
+SDict begin H.S end
+ -2 2390 a -2 2390 a
+SDict begin 13 H.A end
+ -2 2390 a -2 2390 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3649) cvn H.B /DEST pdfmark
+end
+ -2
+2390 a 396 2480 a FC(This)i(implies)f(that)g(an)g(intruder)f(needs)h
+(to)g(analyse)g(the)g(running)e(process)i(to)g(obtain)f(kno)n(wledge)f
+(of)i(the)396 2588 y(signing/encryption)d(k)o(e)o(ys)j(in)g(order)f(to)
+h(successfully)g(f)o(ak)o(e)g(a)g(v)n(alid)g(communication)d(with)k
+(the)f(serv)o(er)m(,)f(or)h(she)396 2696 y(needs)g(to)g
+(analyse/disassemble)f(the)i(e)o(x)o(ecutable)d(in)i(order)f(to)i
+(\002nd)e(the)i(passw)o(ord.)-2 2725 y
+SDict begin H.S end
+ -2 2725 a -2 2725
+a
+SDict begin 13 H.A end
+ -2 2725 a -2 2725 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SERVER-SECURITY) cvn H.B /DEST
+pdfmark end
+ -2 2725 a 359 x Fu(11.4.)39 b(The)g(ser)q(ver)
+1085 3084 y
+SDict begin H.S end
+ 1085 3084 a 1085 3084 a
+SDict begin 22.464 H.A end
+ 1085 3084 a 1085
+3084 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.72.1) cvn H.B /DEST pdfmark
+end
+ 1085 3084 a -2 3252 a
+SDict begin H.S end
+ -2 3252 a -2 3252 a
+SDict begin 13 H.A end
+ -2 3252
+a -2 3252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3652) cvn H.B /DEST pdfmark
+end
+ -2 3252 a 396 3358 a FC(The)20 b(serv)o(er)f(does)h(not)g
+(need)g(root)f(pri)n(vile)o(ges.)g(Therefore,)f(if)i(it)h(is)g(started)
+f(with)h(root)e(pri)n(vile)o(ges,)g(it)i(will)g(drop)396
+3466 y(them)f(irre)n(v)n(ocably)e(after)i(startup.)g(If)g(a)g(pri)n
+(vile)o(ged)e(port)i(\(belo)n(w)f(1024\))f(must)j(be)f(opened,)e(the)i
+(serv)o(er)g(will)h(\002rst)396 3574 y(open)e(it,)i(then)f(drop)f
+(root,)g(and)h(only)f(thereafter)g(accept)h(an)o(y)f(connection)f(on)i
+(the)g(port.)-2 3758 y
+SDict begin H.S end
+ -2 3758 a -2 3758 a
+SDict begin 13 H.A end
+ -2 3758 a
+-2 3758 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3653) cvn H.B /DEST pdfmark
+end
+ -2 3758 a 396 3848 a FC(The)g(serv)o(er)f(can)h(be)h
+(chrooted,)d(and)h(actually)h(has)g(a)h(con\002g)e(\002le)i(option)e
+(to)h(do)g(so)h(by)e(itself)i(\(which)f(means)f(that)396
+3955 y(you)h(don')o(t)e(need)i(to)g(cop)o(y)f(shared)h(libraries)f
+(into)h(the)h(chroot)e(en)m(vironment\).)-2 4139 y
+SDict begin H.S end
+ -2
+4139 a -2 4139 a
+SDict begin 13 H.A end
+ -2 4139 a -2 4139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3654) cvn H.B /DEST pdfmark
+end
+ -2 4139 a 396 4229
+a FC(\(If)h(your)f(clients)h(are)h(con\002gured)c(to)k(do)n(wnload)d
+(baseline)i(databases)g(and)f(con\002guration)f(\002les)j(from)e(the)
+396 4337 y(serv)o(er:\))g(The)h(serv)o(er)g(does)f(not)h(need)g(write)g
+(access)h(to)f(the)h(directory)d(where)i(client)g(baseline)g(databases)
+f(and)396 4445 y(con\002guration)f(\002les)j(are)f(stored,)f(and)h(it)h
+(w)o(ould)e(be)i(wise)g(to)f(den)o(y)f(such)h(access)h(\(cho)n(wn)d(to)
+j(some)f(other)f(user)m(,)396 4553 y(and)h(allo)n(w)g(group)f(read)g
+(access)i(for)e(the)i(serv)o(er\).)-2 4582 y
+SDict begin H.S end
+ -2 4582
+a -2 4582 a
+SDict begin 13 H.A end
+ -2 4582 a -2 4582 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DESIGN) cvn H.B /DEST pdfmark
+end
+ -2 4582 a 359 x Fu(11.5.)39
+b(General)893 4941 y
+SDict begin H.S end
+ 893 4941 a 893 4941 a
+SDict begin 22.464 H.A end
+ 893 4941 a
+893 4941 a
+SDict begin [ /View [/XYZ H.V] /Dest (13.73.1) cvn H.B /DEST pdfmark
+end
+ 893 4941 a -2 5109 a
+SDict begin H.S end
+ -2 5109 a -2 5109 a
+SDict begin 13 H.A end
+ -2
+5109 a -2 5109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3657) cvn H.B /DEST pdfmark
+end
+ -2 5109 a 396 5215 a FC(Ob)o(viously)-5
+b(,)18 b(a)j(security)e(application)g(should)g(not)h(open)f(up)h
+(security)g(holes)g(by)f(itself.)i(Therefore,)d(an)i(inportant)396
+5323 y(aspect)g(in)h(the)f(de)n(v)o(elopment)d(of)1368
+5323 y
+SDict begin H.S end
+ 1368 5323 a 1368 5323 a
+SDict begin 13 H.A end
+ 1368 5323 a 1368 5323
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3658) cvn H.B /DEST pdfmark
+end
+ 1368 5323 a FC(samhain)j(has)g(been)g(the)g(security)f(of)h(the)h
+(program)d(itself.)i(While)3326 5323 y
+SDict begin H.S end
+ 3326 5323 a 3326
+5323 a
+SDict begin 13 H.A end
+ 3326 5323 a 3326 5323 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3659) cvn H.B /DEST pdfmark
+end
+ 3326 5323 a FC(samhain)p
+Black 3620 5805 a Fx(103)p Black eop end
+%%Page: 104 109
+TeXDict begin 104 108 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.104) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2799 104 a
+Fx(Chapter)20 b(11.)f(Security)h(Design)p Black 396 309
+a FC(comes)g(with)h(no)e(w)o(arranty)g(\(see)i(the)f(license\),)g(much)
+f(ef)n(fort)g(has)h(been)g(in)m(v)o(ested)f(to)h(identify)f(security)
+396 417 y(problems)g(and)h(a)n(v)n(oid)g(them.)-2 601
+y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3660) cvn H.B /DEST pdfmark
+end
+ -2 601 a 396 691
+a FC(As)h(the)f(client)h(requires)e(root)g(pri)n(vile)o(ges,)g(while)h
+(the)g(serv)o(er)g(does)g(not,)f(the)i(clients)f(has)g(no)g(open)f
+(sock)o(et)h(to)396 799 y(listen)h(on)f(the)g(netw)o(ork.)f
+(Consequently)-5 b(,)17 b(all)k(client/serv)o(er)e(connections)f(are)j
+(initiated)e(by)h(the)g(client.)-2 983 y
+SDict begin H.S end
+ -2 983 a -2
+983 a
+SDict begin 13 H.A end
+ -2 983 a -2 983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3661) cvn H.B /DEST pdfmark
+end
+ -2 983 a 396 1073 a FC(T)-7 b(o)21
+b(a)n(v)n(oid)f(b)n(uf)n(fer)e(o)o(v)o(er\003o)n(ws,)h(only)g(secure)h
+(string)g(handling)e(functions)h(are)h(used)g(to)g(limit)h(the)f
+(amount)f(of)h(data)396 1180 y(copied)f(into)h(a)h(b)n(uf)n(fer)e(to)h
+(the)g(size)h(of)f(the)g(respecti)n(v)o(e)f(b)n(uf)n(fer)g(\(unless)h
+(it)h(is)g(kno)n(wn)e(in)h(adv)n(ance)f(that)h(the)g(data)396
+1288 y(will)h(\002t)g(into)f(the)g(b)n(uf)n(fer\).)-2
+1469 y
+SDict begin H.S end
+ -2 1469 a -2 1469 a
+SDict begin 13 H.A end
+ -2 1469 a -2 1469 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3662) cvn H.B /DEST pdfmark
+end
+ -2 1469
+a 396 1562 a FC(On)g(startup,)g(the)g(timezone)f(is)i(sa)n(v)o(ed,)f
+(and)g(all)g(en)m(vironment)e(v)n(ariables)h(are)h(set)h(to)f(zero)g
+(thereafter)-5 b(.)19 b(Signal)396 1670 y(handlers,)g(timers,)h(and)g
+(\002le)h(creation)e(mask)h(are)g(reset,)g(and)g(the)g(core)g(dump)f
+(size)h(is)i(set)e(to)h(zero.)e(If)h(started)g(as)396
+1778 y(daemon,)f(all)h(\002le)h(descriptors)e(are)h(closed,)g(and)g
+(the)g(\002rst)h(three)f(streams)g(are)g(opened)f(to)3034
+1778 y
+SDict begin H.S end
+ 3034 1778 a 3034 1778 a
+SDict begin 13 H.A end
+ 3034 1778 a 3034 1778
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3663) cvn H.B /DEST pdfmark
+end
+ 3034 1778 a Fr(/dev/null)p FC(.)-2 1962 y
+SDict begin H.S end
+ -2 1962 a
+-2 1962 a
+SDict begin 13 H.A end
+ -2 1962 a -2 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3664) cvn H.B /DEST pdfmark
+end
+ -2 1962 a 396 2052 a FC(If)h(e)o(xternal)
+f(programs)g(are)h(used)g(\(in)g(the)g(entrop)o(y)e(gatherer)m(,)g(if)
+2279 2052 y
+SDict begin H.S end
+ 2279 2052 a 2279 2052 a
+SDict begin 13 H.A end
+ 2279 2052 a 2279
+2052 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3665) cvn H.B /DEST pdfmark
+end
+ 2279 2052 a Fr(/dev/random)h FC(is)i(not)e(a)n(v)n(ailable\),)h
+(the)o(y)f(are)396 2160 y(in)m(v)n(ok)o(ed)g(directly)g(\(without)g
+(using)h(the)g(shell\),)g(with)g(the)h(full)f(path,)f(and)h(with)g(a)h
+(limited)f(en)m(vironment)d(\(by)396 2268 y(def)o(ault)j(only)f(the)h
+(timezone\).)f(Pri)n(vile)o(ged)g(credentials)g(are)h(dropped)e(before)
+h(calling)g(the)i(e)o(xternal)e(program.)-2 2452 y
+SDict begin H.S end
+ -2
+2452 a -2 2452 a
+SDict begin 13 H.A end
+ -2 2452 a -2 2452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3666) cvn H.B /DEST pdfmark
+end
+ -2 2452 a 396 2542
+a FC(W)m(ith)i(respect)f(to)g(its)h(o)n(wn)f(\002les)h
+(\(con\002guration,)c(database,)i(the)h(log)g(\002le,)h(and)f(its)h
+(lock\),)e(on)h(access)3365 2542 y
+SDict begin H.S end
+ 3365 2542 a 3365 2542
+a
+SDict begin 13 H.A end
+ 3365 2542 a 3365 2542 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3667) cvn H.B /DEST pdfmark
+end
+ 3365 2542 a FC(samhain)396
+2650 y(checks)g(the)g(complete)f(path)h(for)g(write)g(access)h(by)e
+(untrusted)g(users.)h(Some)g(care)g(has)h(been)e(tak)o(en)h(to)g(a)n(v)
+n(oid)g(race)396 2758 y(conditions)f(on)h(\002le)h(access)f(as)h(f)o
+(ar)f(as)h(possible.)-2 2942 y
+SDict begin H.S end
+ -2 2942 a -2 2942 a
+SDict begin 13 H.A end
+ -2
+2942 a -2 2942 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3668) cvn H.B /DEST pdfmark
+end
+ -2 2942 a 396 3032 a FC(Critical)g(information,)d
+(including)g(session)j(k)o(e)o(ys)e(and)h(data)g(read)g(from)f(\002les)
+i(for)f(computing)e(checksums,)g(is)396 3140 y(k)o(ept)i(in)g(memory)f
+(for)h(which)f(paging)g(is)i(disabled)f(\(if)g(the)g(operating)e
+(system)j(supports)e(this\).)h(This)g(w)o(ay)g(it)h(is)396
+3248 y(a)n(v)n(oided)f(that)g(such)g(information)e(is)j(transfered)d
+(to)j(a)f(persistent)g(sw)o(ap)h(store)f(medium,)f(where)g(it)i(might)f
+(be)396 3356 y(accessible)h(to)f(unauthorized)d(users.)-2
+3522 y
+SDict begin H.S end
+ -2 3522 a -2 3522 a
+SDict begin 13 H.A end
+ -2 3522 a -2 3522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3669) cvn H.B /DEST pdfmark
+end
+ -2 3522
+a 396 3630 a FC(Random)i(numbers)g(are)h(generated)f(from)g(a)h
+(pseudo-random)d(number)h(generator)g(\(PRNG\))j(with)f(a)h(period)e
+(of)396 3738 y(2^88)g(\(actually)h(by)g(mixing)f(the)h(output)f(from)g
+(three)h(instances)g(of)g(the)g(PRNG\).)g(The)g(internal)g(state)h(of)e
+(the)396 3845 y(PRNG)i(is)h(seeded)d(from)g(a)i(strong)e(entrop)o(y)g
+(source)g(\(if)h(a)n(v)n(ailable,)2377 3845 y
+SDict begin H.S end
+ 2377 3845
+a 2377 3845 a
+SDict begin 13 H.A end
+ 2377 3845 a 2377 3845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3670) cvn H.B /DEST pdfmark
+end
+ 2377 3845 a Fr(/dev/random)f
+FC(is)i(used,)f(else)g(lots)h(of)396 3953 y(system)f(statistics)h(is)g
+(pooled)d(and)h(mix)o(ed)f(with)i(a)g(hash)g(function\).)d(The)i(PRNG)i
+(is)f(re-seeded)e(from)h(the)h(entrop)o(y)396 4061 y(source)g(at)g(re)o
+(gular)f(interv)n(als)h(\(one)f(hour\).)-2 4245 y
+SDict begin H.S end
+ -2
+4245 a -2 4245 a
+SDict begin 13 H.A end
+ -2 4245 a -2 4245 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3671) cvn H.B /DEST pdfmark
+end
+ -2 4245 a 396 4335
+a FC(Numbers)g(generated)g(from)g(a)h(PRNG)h(can)f(be)g(predicted,)e
+(if)j(the)f(internal)f(state)i(of)f(the)g(PRNG)h(can)f(be)g(inferred.)
+396 4443 y(T)-7 b(o)21 b(a)n(v)n(oid)f(this,)g(the)g(internal)g(state)h
+(of)e(the)i(PRNG)g(is)g(hidden)e(by)g(hashing)g(the)i(output)e(with)h
+(a)h(hash)f(function.)p Black 3620 5805 a Fx(104)p Black
+eop end
+%%Page: 105 110
+TeXDict begin 105 109 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.105) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMPILATION-OPTIONS) cvn H.B
+/DEST pdfmark end
+ -2 226 a 125 x
+Fz(Appendix)48 b(A.)g(List)g(of)g(options)h(f)m(or)f(the)g
+(./con\002gure)-2 575 y(script)467 575 y
+SDict begin H.S end
+ 467 575 a 467
+575 a
+SDict begin 26.957 H.A end
+ 467 575 a 467 575 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.0) cvn H.B /DEST pdfmark end
+ 467 575 a -2 664 a
+SDict begin H.S end
+ -2 664 a
+-2 664 a
+SDict begin 13 H.A end
+ -2 664 a -2 664 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMPILATION-OPTIONS-GENERAL)
+cvn H.B /DEST pdfmark end
+ -2 664 a 342 x Fu(A.1.)39
+b(General)837 1006 y
+SDict begin H.S end
+ 837 1006 a 837 1006 a
+SDict begin 22.464 H.A end
+ 837 1006 a
+837 1006 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.74.1) cvn H.B /DEST pdfmark
+end
+ 837 1006 a -2 1008 a
+SDict begin H.S end
+ -2 1008 a -2 1008 a
+SDict begin 13 H.A end
+ -2
+1008 a -2 1008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3676) cvn H.B /DEST pdfmark
+end
+ -2 1008 a -2 1132 a
+SDict begin H.S end
+ -2 1132 a -2 1132
+a
+SDict begin 13 H.A end
+ -2 1132 a -2 1132 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3678) cvn H.B /DEST pdfmark
+end
+ -2 1132 a 396 1238 a FC(--with-rnd=e)o(gd/de)n
+(v/unix/d)o(ef)o(au)o(lt)-2 1256 y
+SDict begin H.S end
+ -2 1256 a -2 1256
+a
+SDict begin 13 H.A end
+ -2 1256 a -2 1256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3679) cvn H.B /DEST pdfmark
+end
+ -2 1256 a Black Black 562 1388
+a
+SDict begin H.S end
+ 562 1388 a 562 1388 a
+SDict begin 13 H.A end
+ 562 1388 a 562 1388 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3680) cvn H.B /DEST pdfmark
+end
+ 562 1388
+a FC(The)20 b(entrop)o(y)f(gatherer)f(to)i(use.)h('e)o(gd')d(is)j(the)g
+(Entrop)o(y)d(Gathering)h(Daemon)g(\(EGD\),)g(')l(de)n(v')g(is)562
+1496 y(/de)n(v/random,)e('unix')i(is)i(the)f(b)n(uilt-in)g(Unix)g
+(entrop)o(y)e(gatherer)h(\(similar)h(to)g(EGD\),)g(and)f(')l(def)o
+(ault')g(will)562 1604 y(check)h(for)f(/de)n(v/random)f(\002rst,)i(and)
+g(use)g('unix')f(as)i(f)o(allback.)-2 1699 y
+SDict begin H.S end
+ -2 1699
+a -2 1699 a
+SDict begin 13 H.A end
+ -2 1699 a -2 1699 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3682) cvn H.B /DEST pdfmark
+end
+ -2 1699 a 396 1795 a
+FC(--with-e)o(gd-sock)o(et=N)m(AME)-2 1813 y
+SDict begin H.S end
+ -2 1813
+a -2 1813 a
+SDict begin 13 H.A end
+ -2 1813 a -2 1813 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3683) cvn H.B /DEST pdfmark
+end
+ -2 1813 a Black Black
+562 1944 a
+SDict begin H.S end
+ 562 1944 a 562 1944 a
+SDict begin 13 H.A end
+ 562 1944 a 562 1944
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3684) cvn H.B /DEST pdfmark
+end
+ 562 1944 a FC(The)f(path)g(to)g(the)g(EGD)h(sock)o(et.)f(Def)o(ault)g
+(is)1873 1944 y
+SDict begin H.S end
+ 1873 1944 a 1873 1944 a
+SDict begin 13 H.A end
+ 1873 1944 a 1873
+1944 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3685) cvn H.B /DEST pdfmark
+end
+ 1873 1944 a Fr(localstatedir/lib/samhain/entropy)15
+b FC(\(see)p 0 TeXcolorgray 562 2052 a
+SDict begin H.S end
+ 562 2052 a FC(Section)20
+b(A.5)955 2052 y
+SDict begin 13 H.L end
+ 955 2052 a 955 2052 a
+SDict begin [ /Subtype /Link /Dest (0:PATHS) cvn /H /I /Border [0 0
+0] /Color [1 0 0] H.B /ANN pdfmark end
+ 955 2052 a Black
+-1 w FC(\).)-2 2150 y
+SDict begin H.S end
+ -2 2150 a -2 2150 a
+SDict begin 13 H.A end
+ -2 2150 a -2
+2150 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3688) cvn H.B /DEST pdfmark
+end
+ -2 2150 a 396 2243 a FC(--with-identity=USER)-2
+2261 y
+SDict begin H.S end
+ -2 2261 a -2 2261 a
+SDict begin 13 H.A end
+ -2 2261 a -2 2261 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3689) cvn H.B /DEST pdfmark
+end
+ -2 2261
+a Black Black 562 2392 a
+SDict begin H.S end
+ 562 2392 a 562 2392 a
+SDict begin 13 H.A end
+ 562 2392
+a 562 2392 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3690) cvn H.B /DEST pdfmark
+end
+ 562 2392 a FC(The)g(username)f(to)h(use)h(when)e(dropping)
+f(root)h(pri)n(vile)o(ges)g(\(def)o(ault)2566 2392 y
+SDict begin H.S end
+
+2566 2392 a 2566 2392 a
+SDict begin 13 H.A end
+ 2566 2392 a 2566 2392 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3691) cvn H.B /DEST pdfmark
+end
+ 2566
+2392 a Fx(nobody)p FC(\).)-2 2493 y
+SDict begin H.S end
+ -2 2493 a -2 2493
+a
+SDict begin 13 H.A end
+ -2 2493 a -2 2493 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3693) cvn H.B /DEST pdfmark
+end
+ -2 2493 a 396 2583 a FC(--with-sender=SENDER)-2
+2584 y
+SDict begin H.S end
+ -2 2584 a -2 2584 a
+SDict begin 13 H.A end
+ -2 2584 a -2 2584 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3694) cvn H.B /DEST pdfmark
+end
+ -2 2584
+a Black Black 562 2733 a
+SDict begin H.S end
+ 562 2733 a 562 2733 a
+SDict begin 13 H.A end
+ 562 2733
+a 562 2733 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3695) cvn H.B /DEST pdfmark
+end
+ 562 2733 a FC(The)h(username)f(of)h(the)g(sender)g(for)f
+(e-mail,)h(or)g(a)g(complete)f(e-mail)h(address.)g(If)g(only)f(a)i
+(username)e(is)562 2841 y(gi)n(v)o(en,)785 2841 y
+SDict begin H.S end
+ 785
+2841 a 785 2841 a
+SDict begin 13 H.A end
+ 785 2841 a 785 2841 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3696) cvn H.B /DEST pdfmark
+end
+ 785 2841 a Fx
+(SENDER@{FQDN_of_local_host})e FC(will)k(be)f(used)g(for)g(the)g
+(sender)-5 b(.)19 b(Def)o(ault)h(is)3238 2841 y
+SDict begin H.S end
+ 3238
+2841 a 3238 2841 a
+SDict begin 13 H.A end
+ 3238 2841 a 3238 2841 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3697) cvn H.B /DEST pdfmark
+end
+ 3238 2841
+a Fx(daemon)p FC(.)-2 2942 y
+SDict begin H.S end
+ -2 2942 a -2 2942 a
+SDict begin 13 H.A end
+ -2 2942
+a -2 2942 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3699) cvn H.B /DEST pdfmark
+end
+ -2 2942 a 396 3032 a FC(--with-recipient=ADDR)-2
+3050 y
+SDict begin H.S end
+ -2 3050 a -2 3050 a
+SDict begin 13 H.A end
+ -2 3050 a -2 3050 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3700) cvn H.B /DEST pdfmark
+end
+ -2 3050
+a Black Black 562 3181 a
+SDict begin H.S end
+ 562 3181 a 562 3181 a
+SDict begin 13 H.A end
+ 562 3181
+a 562 3181 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3701) cvn H.B /DEST pdfmark
+end
+ 562 3181 a FC(The)g(recepient\(s\))f(for)g(e-mail,)h
+(seperated)f(by)h(whitespace)g(\(max.)f(8\).)g(Y)-9 b(ou)20
+b(can)g(add)g(recepients)f(in)h(the)562 3289 y(con\002guration)e
+(\002le)j(as)g(well.)-2 3390 y
+SDict begin H.S end
+ -2 3390 a -2 3390 a
+SDict begin 13 H.A end
+ -2
+3390 a -2 3390 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3703) cvn H.B /DEST pdfmark
+end
+ -2 3390 a 396 3480 a FC(--with-trusted=UID)-2
+3481 y
+SDict begin H.S end
+ -2 3481 a -2 3481 a
+SDict begin 13 H.A end
+ -2 3481 a -2 3481 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3704) cvn H.B /DEST pdfmark
+end
+ -2 3481
+a Black Black 562 3629 a
+SDict begin H.S end
+ 562 3629 a 562 3629 a
+SDict begin 13 H.A end
+ 562 3629
+a 562 3629 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3705) cvn H.B /DEST pdfmark
+end
+ 562 3629 a FC(T)m(rusted)f(users)g(\(must)g(be)g(a)h
+(comma-separated)c(list)k(of)f(numerical)f(UIDs\).)h(Only)g(required)e
+(if)j(the)562 3737 y(con\002guration)d(\002le)j(must)f(be)g(on)g(a)g
+(path)g(writeable)g(by)g(others)f(than)2580 3737 y
+SDict begin H.S end
+ 2580
+3737 a 2580 3737 a
+SDict begin 13 H.A end
+ 2580 3737 a 2580 3737 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3706) cvn H.B /DEST pdfmark
+end
+ 2580 3737
+a Fx(r)l(oot)j FC(and)e(the)3000 3737 y
+SDict begin H.S end
+ 3000 3737 a 3000
+3737 a
+SDict begin 13 H.A end
+ 3000 3737 a 3000 3737 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3707) cvn H.B /DEST pdfmark
+end
+ 3000 3737 a Fx(ef)o(fective)g
+FC(user)-5 b(.)-2 3838 y
+SDict begin H.S end
+ -2 3838 a -2 3838 a
+SDict begin 13 H.A end
+ -2 3838
+a -2 3838 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3709) cvn H.B /DEST pdfmark
+end
+ -2 3838 a 396 3928 a FC(--with-timeserv)o(er=HOST)-2
+3929 y
+SDict begin H.S end
+ -2 3929 a -2 3929 a
+SDict begin 13 H.A end
+ -2 3929 a -2 3929 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3710) cvn H.B /DEST pdfmark
+end
+ -2 3929
+a Black Black 562 4078 a
+SDict begin H.S end
+ 562 4078 a 562 4078 a
+SDict begin 13 H.A end
+ 562 4078
+a 562 4078 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3711) cvn H.B /DEST pdfmark
+end
+ 562 4078 a FC(Set)21 b(host)f(address)g(for)g(time)g(serv)
+o(er)f(\(def)o(ault)g(is)j(to)e(use)g(o)n(wn)g(clock\).)f(Y)-9
+b(ou)20 b(can)g(set)h(this)f(in)h(the)562 4186 y(con\002guration)d
+(\002le)j(as)g(well.)f(An)g(address)g(in)g(the)h(con\002guration)c
+(\002le)k(will)g(tak)o(e)f(precedence.)e(Note)i(that)562
+4294 y(the)h(simple)f(')o(time')f(service)h(\(port)f(37/tcp\))g(is)i
+(used.)-2 4395 y
+SDict begin H.S end
+ -2 4395 a -2 4395 a
+SDict begin 13 H.A end
+ -2 4395 a -2 4395
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3713) cvn H.B /DEST pdfmark
+end
+ -2 4395 a 396 4485 a FC(--with-alttimeserv)o(er=HOST)-2
+4486 y
+SDict begin H.S end
+ -2 4486 a -2 4486 a
+SDict begin 13 H.A end
+ -2 4486 a -2 4486 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3714) cvn H.B /DEST pdfmark
+end
+ -2 4486
+a Black Black 562 4634 a
+SDict begin H.S end
+ 562 4634 a 562 4634 a
+SDict begin 13 H.A end
+ 562 4634
+a 562 4634 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3715) cvn H.B /DEST pdfmark
+end
+ 562 4634 a FC(Set)g(host)f(address)g(for)g(an)g(alternati)
+n(v)o(e)f(\(backup\))e(time)k(serv)o(er)-5 b(.)-2 4735
+y
+SDict begin H.S end
+ -2 4735 a -2 4735 a
+SDict begin 13 H.A end
+ -2 4735 a -2 4735 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3717) cvn H.B /DEST pdfmark
+end
+ -2 4735 a 396
+4825 a FC(--enable-stealth=XOR_V)-11 b(AL)-2 4835 y
+SDict begin H.S end
+ -2
+4835 a -2 4835 a
+SDict begin 13 H.A end
+ -2 4835 a -2 4835 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3718) cvn H.B /DEST pdfmark
+end
+ -2 4835 a Black
+Black 562 4974 a
+SDict begin H.S end
+ 562 4974 a 562 4974 a
+SDict begin 13 H.A end
+ 562 4974 a 562
+4974 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3719) cvn H.B /DEST pdfmark
+end
+ 562 4974 a FC(Enable)20 b(stealth)g(mode,)f(and)h(set)h(XOR_V)
+-11 b(AL.)19 b(XOR_V)-11 b(AL)20 b(must)h(be)f(decimal,)f(in)h(the)h
+(range)e(127)g(--)h(255,)562 5082 y(and)g(will)h(be)f(used)g(to)g
+(obfuscate)f(literal)i(strings.)p Black -2 5805 a
+SDict begin H.S end
+ -2
+5805 a -2 5805 a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3726) cvn H.B /DEST pdfmark
+end
+ -2 5805 a 3620 5874
+a Fx(105)p Black eop end
+%%Page: 106 111
+TeXDict begin 106 110 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.106) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2016 104 a
+Fx(Appendix)19 b(A.)h(List)h(of)g(options)e(for)h(the)h(./con\002gur)m
+(e)d(script)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3721) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(--enable-micro-stealth=XOR_V)-11
+b(AL)-2 319 y
+SDict begin H.S end
+ -2 319 a -2 319 a
+SDict begin 13 H.A end
+ -2 319 a -2 319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3722) cvn H.B /DEST pdfmark
+end
+ -2
+319 a Black Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458
+a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3723) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(As)675 458 y
+SDict begin H.S end
+ 675 458 a 675 458
+a
+SDict begin 13 H.A end
+ 675 458 a 675 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3724) cvn H.B /DEST pdfmark
+end
+ 675 458 a Fy(--with-stealth)p FC(,)19
+b(b)n(ut)h(without)f(ste)o(ganographic)e(hidden)i(con\002guration)e
+(\002le.)396 649 y(--enable-nocl=PW)-2 650 y
+SDict begin H.S end
+ -2 650 a
+-2 650 a
+SDict begin 13 H.A end
+ -2 650 a -2 650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3727) cvn H.B /DEST pdfmark
+end
+ -2 650 a Black Black 562 799
+a
+SDict begin H.S end
+ 562 799 a 562 799 a
+SDict begin 13 H.A end
+ 562 799 a 562 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3728) cvn H.B /DEST pdfmark
+end
+ 562 799 a FC(Command)i(line)h
+(parsing)f(is)j(disabled,)d(b)n(ut)h(command-line)d(ar)o(guments)i
+(will)h(be)h(read)e(from)g(STDIN)i(if)562 906 y(the)g(\002rst)f
+(command)f(line)h(ar)o(gument)e(is)j(PW)-8 b(.)21 b(PW="")g(\(empty)e
+(string\))h(will)h(disable)f(command)e(line)562 1014
+y(parsing)h(completely)-5 b(.)19 b(This)h(option)f(may)h(be)g(used)g
+(as)h(addition)d(to)j(--enable\(-micro\)-stealth)16 b(to)k(pre)n(v)o
+(ent)562 1122 y(interacti)n(v)o(e)f(enforcement)f(of)i(telltale)h
+(output.)-2 1223 y
+SDict begin H.S end
+ -2 1223 a -2 1223 a
+SDict begin 13 H.A end
+ -2 1223 a -2 1223
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3730) cvn H.B /DEST pdfmark
+end
+ -2 1223 a 396 1313 a FC(--enable-install-name=N)m(AME)-2
+1314 y
+SDict begin H.S end
+ -2 1314 a -2 1314 a
+SDict begin 13 H.A end
+ -2 1314 a -2 1314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3731) cvn H.B /DEST pdfmark
+end
+ -2 1314
+a Black Black 562 1463 a
+SDict begin H.S end
+ 562 1463 a 562 1463 a
+SDict begin 13 H.A end
+ 562 1463
+a 562 1463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3732) cvn H.B /DEST pdfmark
+end
+ 562 1463 a FC(Upon)f(installation,)f(rename)g(e)n(v)o(ery)
+g(\002le)i(from)1954 1463 y
+SDict begin H.S end
+ 1954 1463 a 1954 1463 a
+SDict begin 13 H.A end
+ 1954
+1463 a 1954 1463 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3733) cvn H.B /DEST pdfmark
+end
+ 1954 1463 a Fr(samhain)f FC(\(or)2406
+1463 y
+SDict begin H.S end
+ 2406 1463 a 2406 1463 a
+SDict begin 13 H.A end
+ 2406 1463 a 2406 1463
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3734) cvn H.B /DEST pdfmark
+end
+ 2406 1463 a Fr(yule)g FC(for)g(the)g(serv)o(er\))f(to)3181
+1463 y
+SDict begin H.S end
+ 3181 1463 a 3181 1463 a
+SDict begin 13 H.A end
+ 3181 1463 a 3181 1463
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3735) cvn H.B /DEST pdfmark
+end
+ 3181 1463 a Fr(NAME)p FC(.)h(T)-7 b(o)20 b(be)562 1571
+y(used)g(in)h(conjunction)c(with)k(--with-\(micro-\)stealth.)-2
+1672 y
+SDict begin H.S end
+ -2 1672 a -2 1672 a
+SDict begin 13 H.A end
+ -2 1672 a -2 1672 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3737) cvn H.B /DEST pdfmark
+end
+ -2 1672
+a 396 1762 a FC(--enable-khide=SYSTEM_MAP)-2 1772 y
+SDict begin H.S end
+ -2
+1772 a -2 1772 a
+SDict begin 13 H.A end
+ -2 1772 a -2 1772 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3738) cvn H.B /DEST pdfmark
+end
+ -2 1772 a Black
+Black 562 1911 a
+SDict begin H.S end
+ 562 1911 a 562 1911 a
+SDict begin 13 H.A end
+ 562 1911 a 562
+1911 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3739) cvn H.B /DEST pdfmark
+end
+ 562 1911 a FC(\(Linux)e(only\))g(compile)g(k)o(ernel)h(modules)f
+(to)h(hide)g(all)h(\002les)g(with)f(N)m(AME)g(\(from)562
+2019 y(--enable-install-name=N)m(AME\))c(within)k(the)g(path.)g(By)g
+(def)o(ault,)g(N)m(AME)g(is)h(')-5 b(samhain')19 b(for)h(the)562
+2127 y(client/standalone)f(v)o(ersion,)f(and)i('yule')f(for)h(the)g
+(serv)o(er)-5 b(.)19 b(SYSTEM_MAP)h(must)g(be)g(the)h(path)e(to)i(the)
+562 2235 y
+SDict begin H.S end
+ 562 2235 a 562 2235 a
+SDict begin 13 H.A end
+ 562 2235 a 562 2235
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3740) cvn H.B /DEST pdfmark
+end
+ 562 2235 a Fr(System.map)e FC(\002le)i(corresponding)c(to)j(the)h(k)o
+(ernel.)-2 2336 y
+SDict begin H.S end
+ -2 2336 a -2 2336 a
+SDict begin 13 H.A end
+ -2 2336 a -2 2336
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3742) cvn H.B /DEST pdfmark
+end
+ -2 2336 a 396 2426 a FC(--enable-base=B1,B2)-2 2438
+y
+SDict begin H.S end
+ -2 2438 a -2 2438 a
+SDict begin 13 H.A end
+ -2 2438 a -2 2438 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3743) cvn H.B /DEST pdfmark
+end
+ -2 2438 a Black
+Black 562 2575 a
+SDict begin H.S end
+ 562 2575 a 562 2575 a
+SDict begin 13 H.A end
+ 562 2575 a 562
+2575 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3744) cvn H.B /DEST pdfmark
+end
+ 562 2575 a FC(Set)g(compiled-in)d(k)o(e)o(y)i(for)f(email)i(and)
+e(log\002le)h(signature)f(v)o(eri\002cation.)g(ONE)h(string)g(\(no)f
+(space\))h(made)g(of)562 2683 y(TW)o(O)h(comma-separated)d(inte)o(gers)
+h(in)h(the)g(range)g(0)g(--)g(2147483647.)c(See)p 0 TeXcolorgray
+2808 2683 a
+SDict begin H.S end
+ 2808 2683 a FC(Section)k(11.2)3225 2683 y
+SDict begin 13 H.L end
+
+3225 2683 a 3225 2683 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3225 2683 a Black -2 w FC(>)h(for)e(details)i
+(on)562 2791 y(this)g(option.)-2 2892 y
+SDict begin H.S end
+ -2 2892 a -2
+2892 a
+SDict begin 13 H.A end
+ -2 2892 a -2 2892 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3747) cvn H.B /DEST pdfmark
+end
+ -2 2892 a 396 2982 a FC(--enable-db-reload)
+-2 2983 y
+SDict begin H.S end
+ -2 2983 a -2 2983 a
+SDict begin 13 H.A end
+ -2 2983 a -2 2983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3748) cvn H.B /DEST pdfmark
+end
+ -2
+2983 a Black Black 562 3131 a
+SDict begin H.S end
+ 562 3131 a 562 3131 a
+SDict begin 13 H.A end
+ 562
+3131 a 562 3131 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3749) cvn H.B /DEST pdfmark
+end
+ 562 3131 a FC([CLIENT)f(ONL)-8 b(Y])20
+b(Enable)f(reload)g(of)h(\002le)h(database)e(on)h(SIGHUP)h
+(\(otherwise,)e(only)g(the)h(con\002g)g(\002le)562 3239
+y(will)h(be)f(read)g(again\).)-2 3340 y
+SDict begin H.S end
+ -2 3340 a -2
+3340 a
+SDict begin 13 H.A end
+ -2 3340 a -2 3340 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3751) cvn H.B /DEST pdfmark
+end
+ -2 3340 a 396 3430 a FC(--enable-xml-log)-2
+3448 y
+SDict begin H.S end
+ -2 3448 a -2 3448 a
+SDict begin 13 H.A end
+ -2 3448 a -2 3448 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3752) cvn H.B /DEST pdfmark
+end
+ -2 3448
+a Black Black 562 3580 a
+SDict begin H.S end
+ 562 3580 a 562 3580 a
+SDict begin 13 H.A end
+ 562 3580
+a 562 3580 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3753) cvn H.B /DEST pdfmark
+end
+ 562 3580 a FC(Enable)g(XML)g(format)f(for)g(the)i(log)f
+(\002le.)-2 3681 y
+SDict begin H.S end
+ -2 3681 a -2 3681 a
+SDict begin 13 H.A end
+ -2 3681 a -2 3681
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3755) cvn H.B /DEST pdfmark
+end
+ -2 3681 a 396 3771 a FC(--with-database=mysql/postgresql/oracle/o)o
+(db)o(c)-2 3789 y
+SDict begin H.S end
+ -2 3789 a -2 3789 a
+SDict begin 13 H.A end
+ -2 3789 a -2 3789
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3756) cvn H.B /DEST pdfmark
+end
+ -2 3789 a Black Black 562 3920 a
+SDict begin H.S end
+ 562 3920 a 562 3920
+a
+SDict begin 13 H.A end
+ 562 3920 a 562 3920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3757) cvn H.B /DEST pdfmark
+end
+ 562 3920 a FC(Support)f(logging)f(to)j(a)f
+(relational)g(database)f(\(MySQL,)h(PostgreSQL,)f(Oracle)h(or)g
+(unixODBC\).)f(Oracle)562 4028 y(and)h(unixODBC)g(are)g(not)g(fully)g
+(tested.)-2 4129 y
+SDict begin H.S end
+ -2 4129 a -2 4129 a
+SDict begin 13 H.A end
+ -2 4129 a -2 4129
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3759) cvn H.B /DEST pdfmark
+end
+ -2 4129 a 396 4219 a FC(--with-prelude)-2 4237 y
+SDict begin H.S end
+ -2
+4237 a -2 4237 a
+SDict begin 13 H.A end
+ -2 4237 a -2 4237 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3760) cvn H.B /DEST pdfmark
+end
+ -2 4237 a Black
+Black 562 4368 a
+SDict begin H.S end
+ 562 4368 a 562 4368 a
+SDict begin 13 H.A end
+ 562 4368 a 562
+4368 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3761) cvn H.B /DEST pdfmark
+end
+ 562 4368 a FC(Support)f(logging)f(to)j(the)f(Prelude)f(IDS)i
+(system.)f(Requires)g(the)g(libprelude)f(library)-5 b(.)-2
+4469 y
+SDict begin H.S end
+ -2 4469 a -2 4469 a
+SDict begin 13 H.A end
+ -2 4469 a -2 4469 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3763) cvn H.B /DEST pdfmark
+end
+ -2 4469
+a 396 4559 a FC(--with-libprelude-pre\002x=PFX)-2 4577
+y
+SDict begin H.S end
+ -2 4577 a -2 4577 a
+SDict begin 13 H.A end
+ -2 4577 a -2 4577 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3764) cvn H.B /DEST pdfmark
+end
+ -2 4577 a Black
+Black 562 4709 a
+SDict begin H.S end
+ 562 4709 a 562 4709 a
+SDict begin 13 H.A end
+ 562 4709 a 562
+4709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3765) cvn H.B /DEST pdfmark
+end
+ 562 4709 a FC(Pre\002x)20 b(where)g(libprelude)e(is)k
+(installed.)d(This)i(will)g(be)f(used)g(to)g(search)2670
+4709 y
+SDict begin H.S end
+ 2670 4709 a 2670 4709 a
+SDict begin 13 H.A end
+ 2670 4709 a 2670 4709
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3766) cvn H.B /DEST pdfmark
+end
+ 2670 4709 a Fy(libpr)o(elude-con\002g)f FC(in)i(the)562
+4817 y
+SDict begin H.S end
+ 562 4817 a 562 4817 a
+SDict begin 13 H.A end
+ 562 4817 a 562 4817 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3767) cvn H.B /DEST pdfmark
+end
+ 562
+4817 a Fr(PFX/bin/)f FC(directory)-5 b(.)-2 4918 y
+SDict begin H.S end
+ -2
+4918 a -2 4918 a
+SDict begin 13 H.A end
+ -2 4918 a -2 4918 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3769) cvn H.B /DEST pdfmark
+end
+ -2 4918 a 396 5008
+a FC(--enable-deb)n(ug)-2 5026 y
+SDict begin H.S end
+ -2 5026 a -2 5026 a
+SDict begin 13 H.A end
+
+-2 5026 a -2 5026 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3770) cvn H.B /DEST pdfmark
+end
+ -2 5026 a Black Black 562 5157 a
+SDict begin H.S end
+
+562 5157 a 562 5157 a
+SDict begin 13 H.A end
+ 562 5157 a 562 5157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3771) cvn H.B /DEST pdfmark
+end
+ 562 5157
+a FC(Enable)20 b(deb)n(ugging.)d(W)m(ill)k(slo)n(w)g(do)n(wn)e(things,)
+g(increase)h(resource)f(usage,)g(and)h(may)g(leak)g(information)562
+5265 y(that)h(should)e(be)h(k)o(ept)g(secure.)f(W)m(ill)i(dump)e
+('core')g(and)h(')-5 b(samhain_backtrace')17 b(in)j(the)g(root)g
+(directory)e(on)562 5373 y(se)o(gf)o(ault.)i(Do)g(not)g(use)g(in)g
+(production)e(code.)p Black 3618 5805 a Fx(106)p Black
+eop end
+%%Page: 107 112
+TeXDict begin 107 111 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.107) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2016 104 a
+Fx(Appendix)19 b(A.)h(List)h(of)g(options)e(for)h(the)h(./con\002gur)m
+(e)d(script)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3773) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(--enable-ptrace)-2 327
+y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3774) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black
+Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3775) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(Periodically)h(check)h(whether)f(a)h(deb)n(ugger)e(is)k
+(attached,)d(and)g(abort)h(if)g(yes.)g(Only)g(tak)o(es)h(ef)n(fect)e
+(if)562 566 y
+SDict begin H.S end
+ 562 566 a 562 566 a
+SDict begin 13 H.A end
+ 562 566 a 562 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3776) cvn H.B /DEST pdfmark
+end
+
+562 566 a Fy(--enable-deb)n(ug)h FC(is)h(not)f(used.)g(Only)f(tested)i
+(on)f(Linux.)-2 667 y
+SDict begin H.S end
+ -2 667 a -2 667 a
+SDict begin 13 H.A end
+ -2 667 a -2 667
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3778) cvn H.B /DEST pdfmark
+end
+ -2 667 a 396 757 a FC(--with-c\003ags=FLA)m(GS)-2 775
+y
+SDict begin H.S end
+ -2 775 a -2 775 a
+SDict begin 13 H.A end
+ -2 775 a -2 775 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3779) cvn H.B /DEST pdfmark
+end
+ -2 775 a Black
+Black 562 906 a
+SDict begin H.S end
+ 562 906 a 562 906 a
+SDict begin 13 H.A end
+ 562 906 a 562 906
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3780) cvn H.B /DEST pdfmark
+end
+ 562 906 a FC(Additional)f(\003ags)i(to)f(pass)h(to)f(the)g(compiler)
+-5 b(.)-2 1007 y
+SDict begin H.S end
+ -2 1007 a -2 1007 a
+SDict begin 13 H.A end
+ -2 1007 a -2 1007
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3782) cvn H.B /DEST pdfmark
+end
+ -2 1007 a 396 1097 a FC(--with-libs=LIBS)-2 1098 y
+SDict begin H.S end
+
+-2 1098 a -2 1098 a
+SDict begin 13 H.A end
+ -2 1098 a -2 1098 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3783) cvn H.B /DEST pdfmark
+end
+ -2 1098 a Black
+Black 562 1247 a
+SDict begin H.S end
+ 562 1247 a 562 1247 a
+SDict begin 13 H.A end
+ 562 1247 a 562
+1247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3784) cvn H.B /DEST pdfmark
+end
+ 562 1247 a FC(Additional)19 b(libraries)h(to)g(link)g(with.)-2
+1331 y
+SDict begin H.S end
+ -2 1331 a -2 1331 a
+SDict begin 13 H.A end
+ -2 1331 a -2 1331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3786) cvn H.B /DEST pdfmark
+end
+ -2 1331
+a 396 1438 a FC(--disable-lar)o(ge\002le)-2 1456 y
+SDict begin H.S end
+ -2
+1456 a -2 1456 a
+SDict begin 13 H.A end
+ -2 1456 a -2 1456 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3787) cvn H.B /DEST pdfmark
+end
+ -2 1456 a Black
+Black 562 1587 a
+SDict begin H.S end
+ 562 1587 a 562 1587 a
+SDict begin 13 H.A end
+ 562 1587 a 562
+1587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3788) cvn H.B /DEST pdfmark
+end
+ 562 1587 a FC(Disable)h(support)e(for)g(lar)o(ge)g(\002les)i(\()
+p Ff(>)f FC(2GB\).)g(Lar)o(ge)f(\002le)i(support)e(is)i(enabled)e
+(automatically)g(if)h(your)562 1695 y(system)h(supports)e(it.)-2
+1796 y
+SDict begin H.S end
+ -2 1796 a -2 1796 a
+SDict begin 13 H.A end
+ -2 1796 a -2 1796 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3790) cvn H.B /DEST pdfmark
+end
+ -2 1796
+a 396 1886 a FC(--enable-udp)-2 1904 y
+SDict begin H.S end
+ -2 1904 a -2 1904
+a
+SDict begin 13 H.A end
+ -2 1904 a -2 1904 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3791) cvn H.B /DEST pdfmark
+end
+ -2 1904 a Black Black 562 2036
+a
+SDict begin H.S end
+ 562 2036 a 562 2036 a
+SDict begin 13 H.A end
+ 562 2036 a 562 2036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3792) cvn H.B /DEST pdfmark
+end
+ 562 2036
+a FC(This)i(options)e(enables)h(code)f(to)i(listen)f(on)g(port)f
+(514/upd,)f(i.e.)i(the)h(syslog)e(port.)h(Thus)g(the)g(serv)o(er)f(can)
+562 2143 y(recei)n(v)o(e)g(syslog)h(reports)g(from)f(remote)g(hosts)i
+(\(if)f(the)o(y)f(are)h(con\002gured)e(to)i(send\),)g(and)f(log)h(them)
+g(to)g(an)o(y)g(of)562 2251 y(the)h(log)e(f)o(acilities)i(supported)d
+(by)i(samhain.)f(If)h(you)g(compile)f(in)h(support)f(for)h(this,)g(you)
+f(still)j(need)d(to)562 2359 y(enable)h(it)h(in)f(the)g(runtime)f
+(con\002guration)f(\002le.)-2 2419 y
+SDict begin H.S end
+ -2 2419 a -2 2419
+a
+SDict begin 13 H.A end
+ -2 2419 a -2 2419 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMPILATION-CHECKS) cvn H.B
+/DEST pdfmark end
+ -2 2419 a 359 x Fu(A.2.)39 b(Optional)f(modules)f
+(to)j(perf)m(or)e(ad)o(ditional)f(c)o(hec)m(ks)3379 2778
+y
+SDict begin H.S end
+ 3379 2778 a 3379 2778 a
+SDict begin 22.464 H.A end
+ 3379 2778 a 3379 2778 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.75.1) cvn H.B /DEST pdfmark
+end
+ 3379
+2778 a -2 2974 a
+SDict begin H.S end
+ -2 2974 a -2 2974 a
+SDict begin 13 H.A end
+ -2 2974 a -2 2974
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3795) cvn H.B /DEST pdfmark
+end
+ -2 2974 a 396 3052 a FC(These)20 b(are)g(all)h(client-only)e
+(options,)g(as)i(the)f(serv)o(er)f(does)h(not)g(perform)e(an)o(y)h
+(checks)h(\(if)g(you)g(w)o(ant)g(to)g(run)396 3160 y(checks)g(on)g(the)
+g(log)g(serv)o(er)f(host,)h(you)f(need)h(to)g(run)g(a)g(client)g(there)
+g(as)h(well\).)-2 3178 y
+SDict begin H.S end
+ -2 3178 a -2 3178 a
+SDict begin 13 H.A end
+ -2 3178
+a -2 3178 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3796) cvn H.B /DEST pdfmark
+end
+ -2 3178 a -2 3302 a
+SDict begin H.S end
+ -2 3302 a -2 3302 a
+SDict begin 13 H.A end
+ -2
+3302 a -2 3302 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3798) cvn H.B /DEST pdfmark
+end
+ -2 3302 a 396 3392 a FC(--enable-login-w)o(atch)-2
+3410 y
+SDict begin H.S end
+ -2 3410 a -2 3410 a
+SDict begin 13 H.A end
+ -2 3410 a -2 3410 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3799) cvn H.B /DEST pdfmark
+end
+ -2 3410
+a Black Black 562 3542 a
+SDict begin H.S end
+ 562 3542 a 562 3542 a
+SDict begin 13 H.A end
+ 562 3542
+a 562 3542 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3800) cvn H.B /DEST pdfmark
+end
+ 562 3542 a FC([CLIENT)f(ONL)-8 b(Y])20 b(Compile)f(in)i
+(the)f(module)f(to)h(w)o(atch)g(for)g(login/logout)d(e)n(v)o(ents.)-2
+3643 y
+SDict begin H.S end
+ -2 3643 a -2 3643 a
+SDict begin 13 H.A end
+ -2 3643 a -2 3643 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3802) cvn H.B /DEST pdfmark
+end
+ -2 3643
+a 396 3733 a FC(--enable-mounts-check)-2 3734 y
+SDict begin H.S end
+ -2 3734
+a -2 3734 a
+SDict begin 13 H.A end
+ -2 3734 a -2 3734 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3803) cvn H.B /DEST pdfmark
+end
+ -2 3734 a Black Black
+562 3882 a
+SDict begin H.S end
+ 562 3882 a 562 3882 a
+SDict begin 13 H.A end
+ 562 3882 a 562 3882
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3804) cvn H.B /DEST pdfmark
+end
+ 562 3882 a FC([CLIENT)j(ONL)-8 b(Y])20 b(Compile)f(in)i(the)f(module)
+f(to)h(check)f(for)h(correct)f(mount)g(options.)-2 3983
+y
+SDict begin H.S end
+ -2 3983 a -2 3983 a
+SDict begin 13 H.A end
+ -2 3983 a -2 3983 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3806) cvn H.B /DEST pdfmark
+end
+ -2 3983 a 396
+4073 a FC(--enable-user\002les)-2 4074 y
+SDict begin H.S end
+ -2 4074 a -2
+4074 a
+SDict begin 13 H.A end
+ -2 4074 a -2 4074 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3807) cvn H.B /DEST pdfmark
+end
+ -2 4074 a Black Black 562
+4223 a
+SDict begin H.S end
+ 562 4223 a 562 4223 a
+SDict begin 13 H.A end
+ 562 4223 a 562 4223 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3808) cvn H.B /DEST pdfmark
+end
+ 562
+4223 a FC([CLIENT)h(ONL)-8 b(Y])20 b(Compile)f(in)i(the)f(module)f(to)h
+(check)f(for)h(\002les)h(in)f(user)g(home)g(directories)f(\(i.e.)h
+(with)562 4330 y(paths)g(relati)n(v)o(e)g(to)g($HOME)g(for)f(all)i
+(users\).)-2 4431 y
+SDict begin H.S end
+ -2 4431 a -2 4431 a
+SDict begin 13 H.A end
+ -2 4431 a -2
+4431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3810) cvn H.B /DEST pdfmark
+end
+ -2 4431 a 396 4521 a FC(--enable-suidcheck)-2
+4522 y
+SDict begin H.S end
+ -2 4522 a -2 4522 a
+SDict begin 13 H.A end
+ -2 4522 a -2 4522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3811) cvn H.B /DEST pdfmark
+end
+ -2 4522
+a Black Black 562 4671 a
+SDict begin H.S end
+ 562 4671 a 562 4671 a
+SDict begin 13 H.A end
+ 562 4671
+a 562 4671 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3812) cvn H.B /DEST pdfmark
+end
+ 562 4671 a FC([CLIENT)f(ONL)-8 b(Y])20 b(Compile)f(in)i
+(the)f(module)f(to)h(check)f(\002le)i(system)g(for)e(SUID/SGID)h
+(binaries)g(not)g(in)562 4779 y(the)h(database.)-2 4863
+y
+SDict begin H.S end
+ -2 4863 a -2 4863 a
+SDict begin 13 H.A end
+ -2 4863 a -2 4863 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3814) cvn H.B /DEST pdfmark
+end
+ -2 4863 a 396
+4970 a FC(--with-kcheck=SYSTEM_MAP)-2 4980 y
+SDict begin H.S end
+ -2 4980
+a -2 4980 a
+SDict begin 13 H.A end
+ -2 4980 a -2 4980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3815) cvn H.B /DEST pdfmark
+end
+ -2 4980 a Black Black
+562 5119 a
+SDict begin H.S end
+ 562 5119 a 562 5119 a
+SDict begin 13 H.A end
+ 562 5119 a 562 5119
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3816) cvn H.B /DEST pdfmark
+end
+ 562 5119 a FC([CLIENT)f(ONL)-8 b(Y])20 b(\(Linux/FreeBSD)e(only\))h
+(Compile)h(in)g(the)h(module)d(to)j(check)e(for)h(runtime)f(k)o(ernel)
+562 5227 y(modi\002cations)g(\(e.g.)g(clobbered)g(k)o(ernel)g
+(syscalls\))i(to)f(detect)g(k)o(ernel-le)n(v)o(el)e(rootkits.)h
+(SYSTEM_MAP)562 5335 y(must)i(be)f(the)g(path)g(to)g(the)1337
+5335 y
+SDict begin H.S end
+ 1337 5335 a 1337 5335 a
+SDict begin 13 H.A end
+ 1337 5335 a 1337 5335
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3817) cvn H.B /DEST pdfmark
+end
+ 1337 5335 a Fr(System.map)f FC(\002le)i(corresponding)c(to)j(the)g(k)
+o(ernel.)-2 5395 y
+SDict begin H.S end
+ -2 5395 a -2 5395 a
+SDict begin 13 H.A end
+ -2 5395 a -2 5395
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:OPENPGP-SIGNATURES) cvn H.B
+/DEST pdfmark end
+ -2 5395 a Black 3617 5805 a Fx(107)p Black eop end
+%%Page: 108 113
+TeXDict begin 108 112 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.108) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2016 104 a
+Fx(Appendix)19 b(A.)h(List)h(of)g(options)e(for)h(the)h(./con\002gur)m
+(e)d(script)p Black -2 330 a Fu(A.3.)39 b(OpenPGP)e(Signatures)h(on)h
+(Con\002guration/Database)-2 517 y(Files)326 517 y
+SDict begin H.S end
+ 326
+517 a 326 517 a
+SDict begin 22.464 H.A end
+ 326 517 a 326 517 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.76.1) cvn H.B /DEST pdfmark
+end
+ 326 517 a -2 519
+a
+SDict begin H.S end
+ -2 519 a -2 519 a
+SDict begin 13 H.A end
+ -2 519 a -2 519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3820) cvn H.B /DEST pdfmark
+end
+ -2 519 a -2 643
+a
+SDict begin H.S end
+ -2 643 a -2 643 a
+SDict begin 13 H.A end
+ -2 643 a -2 643 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3822) cvn H.B /DEST pdfmark
+end
+ -2 643 a 396 749
+a FC(--with-gpg=P)-8 b(A)f(TH)-2 767 y
+SDict begin H.S end
+ -2 767 a -2 767
+a
+SDict begin 13 H.A end
+ -2 767 a -2 767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3823) cvn H.B /DEST pdfmark
+end
+ -2 767 a Black Black 562 899 a
+SDict begin H.S end
+ 562
+899 a 562 899 a
+SDict begin 13 H.A end
+ 562 899 a 562 899 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3824) cvn H.B /DEST pdfmark
+end
+ 562 899 a FC(Use)21
+b(GnuPG)f(to)g(v)o(erify)f(database/con\002guration)e(\002le.)j(The)g
+(public)f(k)o(e)o(y)h(of)g(the)g(ef)n(fecti)n(v)o(e)f(user)m(,)g
+(usually)562 1007 y(root,)h(\(in)851 1007 y
+SDict begin H.S end
+ 851 1007
+a 851 1007 a
+SDict begin 13 H.A end
+ 851 1007 a 851 1007 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3825) cvn H.B /DEST pdfmark
+end
+ 851 1007 a Fr(~/.gnupg/pubring.gpg)p
+FC(\))d(will)k(be)f(used.)-2 1105 y
+SDict begin H.S end
+ -2 1105 a -2 1105
+a
+SDict begin 13 H.A end
+ -2 1105 a -2 1105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3827) cvn H.B /DEST pdfmark
+end
+ -2 1105 a 396 1198 a FC(--with-checksum=CHECKSUM)
+-2 1199 y
+SDict begin H.S end
+ -2 1199 a -2 1199 a
+SDict begin 13 H.A end
+ -2 1199 a -2 1199 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3828) cvn H.B /DEST pdfmark
+end
+ -2
+1199 a Black Black 562 1347 a
+SDict begin H.S end
+ 562 1347 a 562 1347 a
+SDict begin 13 H.A end
+ 562
+1347 a 562 1347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3829) cvn H.B /DEST pdfmark
+end
+ 562 1347 a FC(Compile)g(in)g(TIGER)h(checksum)d(of)i
+(the)1784 1347 y
+SDict begin H.S end
+ 1784 1347 a 1784 1347 a
+SDict begin 13 H.A end
+ 1784 1347 a
+1784 1347 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3830) cvn H.B /DEST pdfmark
+end
+ 1784 1347 a Fy(gpg)g FC(binary)-5 b(.)19
+b(CHECKSUM)i(must)f(be)g(the)g(full)g(line)h(output)e(by)562
+1455 y
+SDict begin H.S end
+ 562 1455 a 562 1455 a
+SDict begin 13 H.A end
+ 562 1455 a 562 1455 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3831) cvn H.B /DEST pdfmark
+end
+ 562
+1455 a FC(samhain)h(or)950 1455 y
+SDict begin H.S end
+ 950 1455 a 950 1455
+a
+SDict begin 13 H.A end
+ 950 1455 a 950 1455 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3832) cvn H.B /DEST pdfmark
+end
+ 950 1455 a Fy(gpg)g FC(when)f(computing)f(the)i
+(checksum.)-2 1556 y
+SDict begin H.S end
+ -2 1556 a -2 1556 a
+SDict begin 13 H.A end
+ -2 1556 a -2
+1556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3834) cvn H.B /DEST pdfmark
+end
+ -2 1556 a 396 1646 a FC(--with-fp=FINGERPRINT)-2
+1664 y
+SDict begin H.S end
+ -2 1664 a -2 1664 a
+SDict begin 13 H.A end
+ -2 1664 a -2 1664 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3835) cvn H.B /DEST pdfmark
+end
+ -2 1664
+a Black Black 562 1795 a
+SDict begin H.S end
+ 562 1795 a 562 1795 a
+SDict begin 13 H.A end
+ 562 1795
+a 562 1795 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3836) cvn H.B /DEST pdfmark
+end
+ 562 1795 a FC(Compile)g(in)g(the)h(\002ngerprint)d(of)i
+(the)g(k)o(e)o(y)g(used)g(to)g(sign)g(the)g(con\002guration/database)d
+(\002le.)j(If)g(used,)562 1903 y(samhain)g(will)h(v)o(erify)d(the)j
+(\002ngerprint,)d(b)n(ut)i(still)h(report)e(on)h(the)g(used)g(public)g
+(k)o(e)o(y)-5 b(.)-2 1963 y
+SDict begin H.S end
+ -2 1963 a -2 1963 a
+SDict begin 13 H.A end
+ -2 1963
+a -2 1963 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CLIENT-SERVER-CONNECTIVITY)
+cvn H.B /DEST pdfmark end
+ -2 1963 a 359 x Fu(A.4.)39 b(Client/Ser)q(ver)e
+(Connectivity)2091 2322 y
+SDict begin H.S end
+ 2091 2322 a 2091 2322 a
+SDict begin 22.464 H.A end
+ 2091
+2322 a 2091 2322 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.77.1) cvn H.B /DEST pdfmark
+end
+ 2091 2322 a -2 2352 a
+SDict begin H.S end
+ -2 2352 a -2
+2352 a
+SDict begin 13 H.A end
+ -2 2352 a -2 2352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3839) cvn H.B /DEST pdfmark
+end
+ -2 2352 a -2 2476 a
+SDict begin H.S end
+ -2 2476
+a -2 2476 a
+SDict begin 13 H.A end
+ -2 2476 a -2 2476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3841) cvn H.B /DEST pdfmark
+end
+ -2 2476 a 396 2554 a
+FC(--enable-netw)o(ork=client/serv)o(er)-2 2555 y
+SDict begin H.S end
+ -2
+2555 a -2 2555 a
+SDict begin 13 H.A end
+ -2 2555 a -2 2555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3842) cvn H.B /DEST pdfmark
+end
+ -2 2555 a Black
+Black 562 2704 a
+SDict begin H.S end
+ 562 2704 a 562 2704 a
+SDict begin 13 H.A end
+ 562 2704 a 562
+2704 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3843) cvn H.B /DEST pdfmark
+end
+ 562 2704 a FC(Compile)20 b(a)h(client)f(or)g(serv)o(er)m(,)f
+(rather)g(than)h(a)g(standalone)f(v)o(ersion.)-2 2805
+y
+SDict begin H.S end
+ -2 2805 a -2 2805 a
+SDict begin 13 H.A end
+ -2 2805 a -2 2805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3845) cvn H.B /DEST pdfmark
+end
+ -2 2805 a 396
+2895 a FC(--disable-encrypt)-2 2913 y
+SDict begin H.S end
+ -2 2913 a -2 2913
+a
+SDict begin 13 H.A end
+ -2 2913 a -2 2913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3846) cvn H.B /DEST pdfmark
+end
+ -2 2913 a Black Black 562 3044
+a
+SDict begin H.S end
+ 562 3044 a 562 3044 a
+SDict begin 13 H.A end
+ 562 3044 a 562 3044 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3847) cvn H.B /DEST pdfmark
+end
+ 562 3044
+a FC(Disable)i(encryption)d(for)h(client/serv)o(er)g(communication.)-2
+3145 y
+SDict begin H.S end
+ -2 3145 a -2 3145 a
+SDict begin 13 H.A end
+ -2 3145 a -2 3145 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3849) cvn H.B /DEST pdfmark
+end
+ -2 3145
+a 396 3235 a FC(--enable-encrypt=1)-2 3253 y
+SDict begin H.S end
+ -2 3253
+a -2 3253 a
+SDict begin 13 H.A end
+ -2 3253 a -2 3253 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3850) cvn H.B /DEST pdfmark
+end
+ -2 3253 a Black Black
+562 3385 a
+SDict begin H.S end
+ 562 3385 a 562 3385 a
+SDict begin 13 H.A end
+ 562 3385 a 562 3385
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3851) cvn H.B /DEST pdfmark
+end
+ 562 3385 a FC(Use)i(v)o(ersion)e(1)h(encryption)e(for)i(client/serv)o
+(er)f(communication.)e(Samhain)i(1.8.x)g(introduces)f(an)562
+3493 y(enhanced)h(v)o(ersion)f(\(v)o(ersion)h(2\))h(of)g(the)g
+(client/serv)o(er)f(encryption.)f(By)i(def)o(ault,)f(the)i(serv)o(er)e
+(is)i(backw)o(ard)562 3600 y(compatible,)e(i.e.)h(it)h(can)f
+(communicate)e(with)i(both)g(v)o(ersion)f(1)h(\(pre-1.8.x\))d(and)i(v)o
+(ersion)g(2)h(clients.)562 3708 y(Building)g(the)g(serv)o(er)f(with)i
+(the)f(--enable-encrypt=1)c(option)i(mak)o(es)j(it)f(impossible)g(to)g
+(communicate)562 3816 y(with)h(v)o(ersion)e(2)h(clients.)-2
+3900 y
+SDict begin H.S end
+ -2 3900 a -2 3900 a
+SDict begin 13 H.A end
+ -2 3900 a -2 3900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3853) cvn H.B /DEST pdfmark
+end
+ -2 3900
+a 396 4007 a FC(--disable-srp)-2 4025 y
+SDict begin H.S end
+ -2 4025 a -2
+4025 a
+SDict begin 13 H.A end
+ -2 4025 a -2 4025 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3854) cvn H.B /DEST pdfmark
+end
+ -2 4025 a Black Black 562
+4157 a
+SDict begin H.S end
+ 562 4157 a 562 4157 a
+SDict begin 13 H.A end
+ 562 4157 a 562 4157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3855) cvn H.B /DEST pdfmark
+end
+ 562
+4157 a FC(Disable)h(the)f(use)g(of)g(the)g(zero-kno)n(wledge)d(SRP)k
+(protocol)e(to)h(authenticate)f(to)h(log)g(serv)o(er)m(,)f(and)h(use)g
+(a)562 4265 y(\(f)o(aster)m(,)g(b)n(ut)g(less)h(secure\))f
+(challenge-response)d(protocol.)2318 4265 y
+SDict begin H.S end
+ 2318 4265
+a 2318 4265 a
+SDict begin 13 H.A end
+ 2318 4265 a 2318 4265 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3856) cvn H.B /DEST pdfmark
+end
+ 2318 4265 a Fx(This)k(must)f(be)g
+(set)h(to)g(the)f(same)g(value)g(for)562 4373 y(client)h(and)e(server)
+-9 b(,)21 b(i.e)o(.)f(either)g(disabled)f(for)i(client)f(and)f(server)
+-9 b(,)21 b(or)g(for)f(none)f(of)i(both.)-2 4473 y
+SDict begin H.S end
+ -2
+4473 a -2 4473 a
+SDict begin 13 H.A end
+ -2 4473 a -2 4473 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3858) cvn H.B /DEST pdfmark
+end
+ -2 4473 a 396 4564
+a FC(--with-libwrap[=P)-8 b(A)f(TH])-2 4581 y
+SDict begin H.S end
+ -2 4581
+a -2 4581 a
+SDict begin 13 H.A end
+ -2 4581 a -2 4581 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3859) cvn H.B /DEST pdfmark
+end
+ -2 4581 a Black Black
+562 4713 a
+SDict begin H.S end
+ 562 4713 a 562 4713 a
+SDict begin 13 H.A end
+ 562 4713 a 562 4713
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3860) cvn H.B /DEST pdfmark
+end
+ 562 4713 a FC([SER)i(VER)21 b(ONL)-8 b(Y])20 b(Build)g(the)h(serv)o
+(er)e(with)h(support)f(for)h(libwrap)f(\(W)m(ietse)i(V)-9
+b(enema')k(s)19 b(TCP)i(wrappers)562 4821 y(library\).)e(In)943
+4821 y
+SDict begin H.S end
+ 943 4821 a 943 4821 a
+SDict begin 13 H.A end
+ 943 4821 a 943 4821 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3861) cvn H.B /DEST pdfmark
+end
+ 943
+4821 a Fr(/etc/hosts.allow)f FC(and/or)1914 4821 y
+SDict begin H.S end
+ 1914
+4821 a 1914 4821 a
+SDict begin 13 H.A end
+ 1914 4821 a 1914 4821 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3862) cvn H.B /DEST pdfmark
+end
+ 1914 4821
+a Fr(/etc/hosts.deny)p FC(,)g(use)i('yule')f(or)h(the)g(name)g
+(de\002ned)562 4929 y(with)h(--enable-install-name=N)m(AME)16
+b(for)j(the)i(name)e(of)h(the)g(daemon.)-2 5013 y
+SDict begin H.S end
+ -2
+5013 a -2 5013 a
+SDict begin 13 H.A end
+ -2 5013 a -2 5013 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3864) cvn H.B /DEST pdfmark
+end
+ -2 5013 a 396 5120
+a FC(--with-port=POR)-5 b(T)-2 5138 y
+SDict begin H.S end
+ -2 5138 a -2 5138
+a
+SDict begin 13 H.A end
+ -2 5138 a -2 5138 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3865) cvn H.B /DEST pdfmark
+end
+ -2 5138 a Black Black 562 5269
+a
+SDict begin H.S end
+ 562 5269 a 562 5269 a
+SDict begin 13 H.A end
+ 562 5269 a 562 5269 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3866) cvn H.B /DEST pdfmark
+end
+ 562 5269
+a FC(The)20 b(port)g(on)f(which)h(the)g(serv)o(er)g(will)h(listen)f
+(\(def)o(ault)f(is)i(49777\),)d(or)i(to)g(which)g(the)g(client)h(will)f
+(connect,)562 5377 y(respecti)n(v)o(ely)-5 b(.)996 5377
+y
+SDict begin H.S end
+ 996 5377 a 996 5377 a
+SDict begin 13 H.A end
+ 996 5377 a 996 5377 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3867) cvn H.B /DEST pdfmark
+end
+ 996 5377
+a Fx(This)21 b(must)g(be)f(set)h(to)f(the)g(same)h(value)e(for)i
+(client)f(and)f(server)-9 b(.)21 b FC(Only)f(needed)f(if)h(this)h(port)
+f(is)p Black 3620 5805 a Fx(108)p Black eop end
+%%Page: 109 114
+TeXDict begin 109 113 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.109) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3923) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2016 104 a Fx(Appendix)19
+b(A.)h(List)h(of)g(options)e(for)h(the)h(./con\002gur)m(e)d(script)p
+Black 562 309 a FC(already)h(used)g(by)g(some)h(other)e(application.)g
+(Port)i(numbers)e(belo)n(w)h(1024)f(require)3025 309
+y
+SDict begin H.S end
+ 3025 309 a 3025 309 a
+SDict begin 13 H.A end
+ 3025 309 a 3025 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3868) cvn H.B /DEST pdfmark
+end
+ 3025 309
+a Fx(r)l(oot)k FC(pri)n(vile)o(ges)c(for)h(the)562 417
+y(serv)o(er)-5 b(.)-2 500 y
+SDict begin H.S end
+ -2 500 a -2 500 a
+SDict begin 13 H.A end
+ -2 500
+a -2 500 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3870) cvn H.B /DEST pdfmark
+end
+ -2 500 a 396 608 a FC(--with-logserv)o(er=HOST)-2
+626 y
+SDict begin H.S end
+ -2 626 a -2 626 a
+SDict begin 13 H.A end
+ -2 626 a -2 626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3871) cvn H.B /DEST pdfmark
+end
+ -2 626 a Black
+Black 562 757 a
+SDict begin H.S end
+ 562 757 a 562 757 a
+SDict begin 13 H.A end
+ 562 757 a 562 757
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3872) cvn H.B /DEST pdfmark
+end
+ 562 757 a FC([CLIENT)20 b(ONL)-8 b(Y])20 b(The)f(host)i(address)e(of)
+h(the)g(log)g(serv)o(er)-5 b(.)20 b(This)g(can)g(be)g(set)h(in)g(the)f
+(con\002guration)d(\002le.)k(A)562 865 y(compiled-in)d(address)i(is)h
+(only)f(required)e(if)i(you)g(w)o(ant)g(to)g(fetch)g(the)g
+(con\002guration)e(\002le)j(from)e(the)h(log)562 973
+y(serv)o(er)-5 b(.)20 b(An)g(address)g(in)g(the)g(con\002guration)e
+(\002le)j(will)g(tak)o(e)f(precedence.)-2 1074 y
+SDict begin H.S end
+ -2 1074
+a -2 1074 a
+SDict begin 13 H.A end
+ -2 1074 a -2 1074 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3874) cvn H.B /DEST pdfmark
+end
+ -2 1074 a 396 1164 a
+FC(--with-altlogserv)o(er=HOST)-2 1182 y
+SDict begin H.S end
+ -2 1182 a -2
+1182 a
+SDict begin 13 H.A end
+ -2 1182 a -2 1182 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3875) cvn H.B /DEST pdfmark
+end
+ -2 1182 a Black Black 562
+1313 a
+SDict begin H.S end
+ 562 1313 a 562 1313 a
+SDict begin 13 H.A end
+ 562 1313 a 562 1313 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3876) cvn H.B /DEST pdfmark
+end
+ 562
+1313 a FC([CLIENT)g(ONL)-8 b(Y])20 b(The)f(host)i(address)e(of)h(an)g
+(alternati)n(v)o(e)f(\(backup\))f(log)i(serv)o(er)-5
+b(.)-2 1373 y
+SDict begin H.S end
+ -2 1373 a -2 1373 a
+SDict begin 13 H.A end
+ -2 1373 a -2 1373 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:PATHS) cvn H.B /DEST pdfmark
+end
+
+-2 1373 a 359 x Fu(A.5.)39 b(P)l(aths)689 1732 y
+SDict begin H.S end
+ 689
+1732 a 689 1732 a
+SDict begin 22.464 H.A end
+ 689 1732 a 689 1732 a
+SDict begin [ /View [/XYZ H.V] /Dest (14.78.1) cvn H.B /DEST pdfmark
+end
+ 689 1732 a -2
+1900 a
+SDict begin H.S end
+ -2 1900 a -2 1900 a
+SDict begin 13 H.A end
+ -2 1900 a -2 1900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3879) cvn H.B /DEST pdfmark
+end
+ -2 1900
+a 396 2006 a FC(Compiled-in)19 b(paths)h(may)g(be)g(as)h(long)e(as)i
+(255)e(chars.)h(If)g(the)2204 2006 y
+SDict begin H.S end
+ 2204 2006 a 2204
+2006 a
+SDict begin 13 H.A end
+ 2204 2006 a 2204 2006 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3880) cvn H.B /DEST pdfmark
+end
+ 2204 2006 a Fy(--with-stealth)f
+FC(option)g(is)i(used,)f(the)g(limit)g(is)i(127)396 2114
+y(chars.)e(The)g(paths)g(to)g(the)g(database,)g(log)g(\002le,)g(and)g
+(pid/lock)f(\002le)i(can)f(be)g(o)o(v)o(erridden)d(in)j(the)g
+(con\002guration)e(\002le)396 2222 y(\(see)p 0 TeXcolorgray
+551 2222 a
+SDict begin H.S end
+ 551 2222 a FC(Section)i(C.1)939 2222 y
+SDict begin 13 H.L end
+ 939
+2222 a 939 2222 a
+SDict begin [ /Subtype /Link /Dest (0:CONFIGFILE) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 939 2222 a Black -1 w FC(>\).)-2 2237
+y
+SDict begin H.S end
+ -2 2237 a -2 2237 a
+SDict begin 11.7 H.A end
+ -2 2237 a -2 2237 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3882) cvn H.B /DEST pdfmark
+end
+ -2 2237 a -2
+2361 a
+SDict begin H.S end
+ -2 2361 a -2 2361 a
+SDict begin 11.7 H.A end
+ -2 2361 a -2 2361 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3884) cvn H.B /DEST pdfmark
+end
+ -2 2361
+a 562 2443 a Fw(TIP:)g Fv(If)h(using)e(NFS)h(with)g(clients)f(on)h
+(diff)n(erent)e(hosts)i(accesing)g(the)f(same)i(\002les)o(,)f(y)o(ou)g
+(can)g(set)g(the)562 2541 y(database)o(,)e(log)h(\002le)o(,)g(and)g
+(pid/loc)o(k)g(\002le)h(names)f(to)h("A)l(UT)m(O")f(in)h(the)f
+(con\002gur)o(ation)e(\002le)j(to)g(simply)g(tac)o(k)g(on)f(the)562
+2638 y(hostname)g(on)h(the)g(compiled-in)d(path.)i(The)h(same)g(length)
+f(limits)h(apply)-7 b(.)39 2787 y
+SDict begin H.S end
+ 39 2787 a 39 2787 a
+SDict begin 13 H.A end
+
+39 2787 a 39 2787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3885) cvn H.B /DEST pdfmark
+end
+ 39 2787 a -2 2953 a
+SDict begin H.S end
+ -2 2953 a -2
+2953 a
+SDict begin 13 H.A end
+ -2 2953 a -2 2953 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3887) cvn H.B /DEST pdfmark
+end
+ -2 2953 a 396 3061 a FC(--pre\002x=PREFIX)-2
+3079 y
+SDict begin H.S end
+ -2 3079 a -2 3079 a
+SDict begin 13 H.A end
+ -2 3079 a -2 3079 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3888) cvn H.B /DEST pdfmark
+end
+ -2 3079
+a Black Black 562 3211 a
+SDict begin H.S end
+ 562 3211 a 562 3211 a
+SDict begin 13 H.A end
+ 562 3211
+a 562 3211 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3889) cvn H.B /DEST pdfmark
+end
+ 562 3211 a FC(The)20 b(install)h(pre\002x.)e(Def)o(ault)h
+(is)h(none,)e(and)h(using)f(the)i(Filesystem)f(Hierarchy)e(Standard)h
+(2.2)h(directory)562 3318 y(layout.)f(If)h(you)g(prefer)f(the)h(GNU)g
+(layout)g(\(e)n(v)o(erything)d(under)i(/usr/local\),)g(use)h
+(--pre\002x=/usr/local.)e(See)p 0 TeXcolorgray 562 3426
+a
+SDict begin H.S end
+ 562 3426 a FC(Section)i(2.10)979 3426 y
+SDict begin 13 H.L end
+ 979 3426 a
+979 3426 a
+SDict begin [ /Subtype /Link /Dest (0:LAYOUT) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 979 3426 a Black -2 w FC(>)h(for)f(details.)-2
+3510 y
+SDict begin H.S end
+ -2 3510 a -2 3510 a
+SDict begin 13 H.A end
+ -2 3510 a -2 3510 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3892) cvn H.B /DEST pdfmark
+end
+ -2 3510
+a 396 3617 a FC(--sbindir=DIR)-2 3618 y
+SDict begin H.S end
+ -2 3618 a -2
+3618 a
+SDict begin 13 H.A end
+ -2 3618 a -2 3618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3893) cvn H.B /DEST pdfmark
+end
+ -2 3618 a Black Black 562
+3767 a
+SDict begin H.S end
+ 562 3767 a 562 3767 a
+SDict begin 13 H.A end
+ 562 3767 a 562 3767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3894) cvn H.B /DEST pdfmark
+end
+ 562
+3767 a FC(The)g(binary)f(directory)f(\(def)o(ault)i(is)1620
+3767 y
+SDict begin H.S end
+ 1620 3767 a 1620 3767 a
+SDict begin 13 H.A end
+ 1620 3767 a 1620 3767
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3895) cvn H.B /DEST pdfmark
+end
+ 1620 3767 a Fr(/usr/local/sbin)p FC(\))-2 3868 y
+SDict begin H.S end
+ -2
+3868 a -2 3868 a
+SDict begin 13 H.A end
+ -2 3868 a -2 3868 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3897) cvn H.B /DEST pdfmark
+end
+ -2 3868 a 396 3958
+a FC(--localstatedir=DPFX)-2 3959 y
+SDict begin H.S end
+ -2 3959 a -2 3959
+a
+SDict begin 13 H.A end
+ -2 3959 a -2 3959 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3898) cvn H.B /DEST pdfmark
+end
+ -2 3959 a Black Black 562 4107
+a
+SDict begin H.S end
+ 562 4107 a 562 4107 a
+SDict begin 13 H.A end
+ 562 4107 a 562 4107 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3899) cvn H.B /DEST pdfmark
+end
+ 562 4107
+a FC(The)g(state)h(data)f(directory)e(pre\002x)i(\(def)o(ault)f(is)1933
+4107 y
+SDict begin H.S end
+ 1933 4107 a 1933 4107 a
+SDict begin 13 H.A end
+ 1933 4107 a 1933 4107
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3900) cvn H.B /DEST pdfmark
+end
+ 1933 4107 a Fr(/var)p FC(\).)g(Data)i(will)f(be)g(written)g(to)h
+(DPFX/lib/)3295 4107 y
+SDict begin H.S end
+ 3295 4107 a 3295 4107 a
+SDict begin 13 H.A end
+ 3295 4107
+a 3295 4107 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3901) cvn H.B /DEST pdfmark
+end
+ 3295 4107 a Fx(install_name)p FC(.)-2 4208
+y
+SDict begin H.S end
+ -2 4208 a -2 4208 a
+SDict begin 13 H.A end
+ -2 4208 a -2 4208 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3903) cvn H.B /DEST pdfmark
+end
+ -2 4208 a 396
+4298 a FC(--with-state-dir=DIR)-2 4299 y
+SDict begin H.S end
+ -2 4299 a -2
+4299 a
+SDict begin 13 H.A end
+ -2 4299 a -2 4299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3904) cvn H.B /DEST pdfmark
+end
+ -2 4299 a Black Black 562
+4448 a
+SDict begin H.S end
+ 562 4448 a 562 4448 a
+SDict begin 13 H.A end
+ 562 4448 a 562 4448 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3905) cvn H.B /DEST pdfmark
+end
+ 562
+4448 a FC(The)f(state)h(data)f(directory)f(\(def)o(ault)g(is)1719
+4448 y
+SDict begin H.S end
+ 1719 4448 a 1719 4448 a
+SDict begin 13 H.A end
+ 1719 4448 a 1719 4448
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3906) cvn H.B /DEST pdfmark
+end
+ 1719 4448 a Fr(DPFX/lib/install_name)p FC(\).)d(Data)21
+b(will)g(be)f(written)g(to)g(this)562 4555 y(directory)-5
+b(.)-2 4656 y
+SDict begin H.S end
+ -2 4656 a -2 4656 a
+SDict begin 13 H.A end
+ -2 4656 a -2 4656 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3908) cvn H.B /DEST pdfmark
+end
+
+-2 4656 a 396 4746 a FC(--mandir=MPREFIX)-2 4747 y
+SDict begin H.S end
+ -2
+4747 a -2 4747 a
+SDict begin 13 H.A end
+ -2 4747 a -2 4747 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3909) cvn H.B /DEST pdfmark
+end
+ -2 4747 a Black
+Black 562 4896 a
+SDict begin H.S end
+ 562 4896 a 562 4896 a
+SDict begin 13 H.A end
+ 562 4896 a 562
+4896 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3910) cvn H.B /DEST pdfmark
+end
+ 562 4896 a FC(The)20 b(man)g(directory)e(directory)h(pre\002x)g
+(\(def)o(ault)g(is)2085 4896 y
+SDict begin H.S end
+ 2085 4896 a 2085 4896
+a
+SDict begin 13 H.A end
+ 2085 4896 a 2085 4896 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3911) cvn H.B /DEST pdfmark
+end
+ 2085 4896 a Fr(/usr/local/share/man)p
+FC(\).)-2 4997 y
+SDict begin H.S end
+ -2 4997 a -2 4997 a
+SDict begin 13 H.A end
+ -2 4997 a -2 4997
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3913) cvn H.B /DEST pdfmark
+end
+ -2 4997 a 396 5087 a FC(--with-tmp-dir=TPFX)-2 5105
+y
+SDict begin H.S end
+ -2 5105 a -2 5105 a
+SDict begin 13 H.A end
+ -2 5105 a -2 5105 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3914) cvn H.B /DEST pdfmark
+end
+ -2 5105 a Black
+Black 562 5236 a
+SDict begin H.S end
+ 562 5236 a 562 5236 a
+SDict begin 13 H.A end
+ 562 5236 a 562
+5236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3915) cvn H.B /DEST pdfmark
+end
+ 562 5236 a FC(The)h(directory)f(where)g(tmp)h(\002les)h(are)f
+(created)g(\(con\002g/database)e(do)n(wnloads)g(from)h(serv)o(er)m(,)g
+(e)o(xtracted)562 5344 y(PGP-signed)h(parts)g(of)g(con\002g/database)e
+(\002les\))j(\(def)o(ault)e(is)2330 5344 y
+SDict begin H.S end
+ 2330 5344
+a 2330 5344 a
+SDict begin 13 H.A end
+ 2330 5344 a 2330 5344 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3916) cvn H.B /DEST pdfmark
+end
+ 2330 5344 a Fx(HOME)r
+FC(\).)p Black 3620 5805 a Fx(109)p Black eop end
+%%Page: 110 115
+TeXDict begin 110 114 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.110) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2016 104 a
+Fx(Appendix)19 b(A.)h(List)h(of)g(options)e(for)h(the)h(./con\002gur)m
+(e)d(script)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226
+a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3918) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a FC(--with-con\002g-\002le=FILE)-2
+327 y
+SDict begin H.S end
+ -2 327 a -2 327 a
+SDict begin 13 H.A end
+ -2 327 a -2 327 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3919) cvn H.B /DEST pdfmark
+end
+ -2 327 a Black
+Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3920) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(The)i(full)g(path)g(of)g(the)g(con\002guration)e(\002le)
+i(\(def)o(ault)g(is)2169 458 y
+SDict begin H.S end
+ 2169 458 a 2169 458 a
+SDict begin 13 H.A end
+
+2169 458 a 2169 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3921) cvn H.B /DEST pdfmark
+end
+ 2169 458 a Fr(/etc/\(install_name\)rc)p
+FC(\).)396 649 y(--with-log-\002le=FILE)-2 667 y
+SDict begin H.S end
+ -2 667
+a -2 667 a
+SDict begin 13 H.A end
+ -2 667 a -2 667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3924) cvn H.B /DEST pdfmark
+end
+ -2 667 a Black Black 562
+799 a
+SDict begin H.S end
+ 562 799 a 562 799 a
+SDict begin 13 H.A end
+ 562 799 a 562 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3925) cvn H.B /DEST pdfmark
+end
+ 562 799
+a FC(The)g(path)g(of)g(the)g(log)g(\002le)h(\(def)o(ault)e(is)1696
+799 y
+SDict begin H.S end
+ 1696 799 a 1696 799 a
+SDict begin 13 H.A end
+ 1696 799 a 1696 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3926) cvn H.B /DEST pdfmark
+end
+ 1696
+799 a Fr(DPFX/log/samhain_log)p FC(\).)-2 900 y
+SDict begin H.S end
+ -2 900
+a -2 900 a
+SDict begin 13 H.A end
+ -2 900 a -2 900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3928) cvn H.B /DEST pdfmark
+end
+ -2 900 a 396 989 a FC
+(--with-pid-\002le=FILE)-2 1007 y
+SDict begin H.S end
+ -2 1007 a -2 1007 a
+SDict begin 13 H.A end
+
+-2 1007 a -2 1007 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3929) cvn H.B /DEST pdfmark
+end
+ -2 1007 a Black Black 562 1139 a
+SDict begin H.S end
+
+562 1139 a 562 1139 a
+SDict begin 13 H.A end
+ 562 1139 a 562 1139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3930) cvn H.B /DEST pdfmark
+end
+ 562 1139
+a FC(The)h(path)g(of)g(the)g(PID)h(\002le)f(\(def)o(ault)f(is)1724
+1139 y
+SDict begin H.S end
+ 1724 1139 a 1724 1139 a
+SDict begin 13 H.A end
+ 1724 1139 a 1724 1139
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3931) cvn H.B /DEST pdfmark
+end
+ 1724 1139 a Fr(DPFX/run/\(install_name\).pid)p FC(\).)-2
+1240 y
+SDict begin H.S end
+ -2 1240 a -2 1240 a
+SDict begin 13 H.A end
+ -2 1240 a -2 1240 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3933) cvn H.B /DEST pdfmark
+end
+ -2 1240
+a 396 1330 a FC(--with-html-\002le=FILE)-2 1331 y
+SDict begin H.S end
+ -2
+1331 a -2 1331 a
+SDict begin 13 H.A end
+ -2 1331 a -2 1331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3934) cvn H.B /DEST pdfmark
+end
+ -2 1331 a Black
+Black 562 1479 a
+SDict begin H.S end
+ 562 1479 a 562 1479 a
+SDict begin 13 H.A end
+ 562 1479 a 562
+1479 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3935) cvn H.B /DEST pdfmark
+end
+ 562 1479 a FC([SER)-7 b(VER)21 b(ONL)-8 b(Y])20
+b(The)g(path)g(of)g(the)g(HTML)g(status)h(\002le)f(where)g(the)g
+(current)f(status)i(of)f(clients)g(is)562 1587 y(displayed)f(\(def)o
+(ault)g(is)1256 1587 y
+SDict begin H.S end
+ 1256 1587 a 1256 1587 a
+SDict begin 13 H.A end
+ 1256 1587
+a 1256 1587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3936) cvn H.B /DEST pdfmark
+end
+ 1256 1587 a Fr(DPFX/log/\(install_name\).html)p
+FC(\).)-2 1688 y
+SDict begin H.S end
+ -2 1688 a -2 1688 a
+SDict begin 13 H.A end
+ -2 1688 a -2 1688
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3938) cvn H.B /DEST pdfmark
+end
+ -2 1688 a 396 1778 a FC(--with-console=P)-8 b(A)f(TH)-2
+1779 y
+SDict begin H.S end
+ -2 1779 a -2 1779 a
+SDict begin 13 H.A end
+ -2 1779 a -2 1779 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3939) cvn H.B /DEST pdfmark
+end
+ -2 1779
+a Black Black 562 1928 a
+SDict begin H.S end
+ 562 1928 a 562 1928 a
+SDict begin 13 H.A end
+ 562 1928
+a 562 1928 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3940) cvn H.B /DEST pdfmark
+end
+ 562 1928 a FC(The)20 b(path)g(of)g(the)g(console)f(\(def)o
+(ault)h(is)1717 1928 y
+SDict begin H.S end
+ 1717 1928 a 1717 1928 a
+SDict begin 13 H.A end
+ 1717 1928
+a 1717 1928 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3941) cvn H.B /DEST pdfmark
+end
+ 1717 1928 a Fr(/dev/console)p FC(\).)e(This)i(may)g(be)g
+(a)h(FIFO.)-2 2029 y
+SDict begin H.S end
+ -2 2029 a -2 2029 a
+SDict begin 13 H.A end
+ -2 2029 a -2
+2029 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3943) cvn H.B /DEST pdfmark
+end
+ -2 2029 a 396 2119 a FC(--with-altconsole=P)-8
+b(A)f(TH)-2 2120 y
+SDict begin H.S end
+ -2 2120 a -2 2120 a
+SDict begin 13 H.A end
+ -2 2120 a -2 2120
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3944) cvn H.B /DEST pdfmark
+end
+ -2 2120 a Black Black 562 2268 a
+SDict begin H.S end
+ 562 2268 a 562 2268
+a
+SDict begin 13 H.A end
+ 562 2268 a 562 2268 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3945) cvn H.B /DEST pdfmark
+end
+ 562 2268 a FC(The)20 b(path)g(of)g(a)g(second)g
+(console)f(\(def)o(ault)g(is)i(none\).)e(This)h(may)g(be)g(a)h(FIFO.)f
+(If)g(de\002ned,)f(console)h(output)562 2376 y(will)h(al)o(w)o(ays)g
+(go)f(to)g(both)f(console)h(de)n(vices)f(\(b)n(ut)h(note)g(that)g
+(console)g(de)n(vices)f(are)h(only)g(used)g(when)562
+2484 y(running)e(as)j(daemon\).)p Black 3620 5805 a Fx(110)p
+Black eop end
+%%Page: 111 116
+TeXDict begin 111 115 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.111) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMMAND-LINE) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Appendix)48 b(B.)g(List)g(of)g(command)g(line)g(options)3441
+351 y
+SDict begin H.S end
+ 3441 351 a 3441 351 a
+SDict begin 26.957 H.A end
+ 3441 351 a 3441 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (15.0) cvn H.B /DEST pdfmark end
+ 3441
+351 a -2 441 a
+SDict begin H.S end
+ -2 441 a -2 441 a
+SDict begin 13 H.A end
+ -2 441 a -2 441 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMMAND-LINE-GENERAL) cvn H.B
+/DEST pdfmark end
+ -2
+441 a 341 x Fu(B.1.)39 b(General)837 782 y
+SDict begin H.S end
+ 837 782 a
+837 782 a
+SDict begin 22.464 H.A end
+ 837 782 a 837 782 a
+SDict begin [ /View [/XYZ H.V] /Dest (15.79.1) cvn H.B /DEST pdfmark
+end
+ 837 782 a -2 950 a
+SDict begin H.S end
+ -2 950
+a -2 950 a
+SDict begin 13 H.A end
+ -2 950 a -2 950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3950) cvn H.B /DEST pdfmark
+end
+ -2 950 a -2 950 a
+SDict begin H.S end
+ -2 950
+a -2 950 a
+SDict begin 13 H.A end
+ -2 950 a -2 950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3951) cvn H.B /DEST pdfmark
+end
+ -2 950 a -2 979 a
+SDict begin H.S end
+ -2 979
+a -2 979 a
+SDict begin 13 H.A end
+ -2 979 a -2 979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3952) cvn H.B /DEST pdfmark
+end
+ -2 979 a Black 463 1155
+a FC(1.)p Black 546 1155 a
+SDict begin H.S end
+ 546 1155 a 546 1155 a
+SDict begin 13 H.A end
+ 546
+1155 a 546 1155 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3953) cvn H.B /DEST pdfmark
+end
+ 546 1155 a 546 1155 a
+SDict begin H.S end
+ 546 1155 a 546
+1155 a
+SDict begin 13 H.A end
+ 546 1155 a 546 1155 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3954) cvn H.B /DEST pdfmark
+end
+ 546 1155 a Fx(-D,)20 b(--daemon)e
+FC(Run)i(as)h(daemon.)-2 1166 y
+SDict begin H.S end
+ -2 1166 a -2 1166 a
+SDict begin 13 H.A end
+ -2
+1166 a -2 1166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3955) cvn H.B /DEST pdfmark
+end
+ -2 1166 a Black 463 1304 a FC(2.)p Black
+546 1304 a
+SDict begin H.S end
+ 546 1304 a 546 1304 a
+SDict begin 13 H.A end
+ 546 1304 a 546 1304
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3956) cvn H.B /DEST pdfmark
+end
+ 546 1304 a 546 1304 a
+SDict begin H.S end
+ 546 1304 a 546 1304 a
+SDict begin 13 H.A end
+ 546 1304
+a 546 1304 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3957) cvn H.B /DEST pdfmark
+end
+ 546 1304 a Fx(--for)m(e)m(gr)l(ound)e FC(Stay)i(in)f(the)g
+(fore)o(ground,)d(do)i(not)h(run)g(as)g(daemon.)-2 1322
+y
+SDict begin H.S end
+ -2 1322 a -2 1322 a
+SDict begin 13 H.A end
+ -2 1322 a -2 1322 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3958) cvn H.B /DEST pdfmark
+end
+ -2 1322 a Black
+463 1454 a FC(3.)p Black 546 1454 a
+SDict begin H.S end
+ 546 1454 a 546 1454
+a
+SDict begin 13 H.A end
+ 546 1454 a 546 1454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3959) cvn H.B /DEST pdfmark
+end
+ 546 1454 a 546 1454 a
+SDict begin H.S end
+ 546 1454
+a 546 1454 a
+SDict begin 13 H.A end
+ 546 1454 a 546 1454 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3960) cvn H.B /DEST pdfmark
+end
+ 546 1454 a Fx(-f)o(,)g(--for)m(e)o
+(ver)i FC(Loop)d(fore)n(v)o(er)m(,)e(e)n(v)o(en)i(if)i(not)f(daemon.)-2
+1472 y
+SDict begin H.S end
+ -2 1472 a -2 1472 a
+SDict begin 13 H.A end
+ -2 1472 a -2 1472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3961) cvn H.B /DEST pdfmark
+end
+ -2 1472
+a Black 463 1603 a FC(4.)p Black 546 1603 a
+SDict begin H.S end
+ 546 1603
+a 546 1603 a
+SDict begin 13 H.A end
+ 546 1603 a 546 1603 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3962) cvn H.B /DEST pdfmark
+end
+ 546 1603 a 546 1603
+a
+SDict begin H.S end
+ 546 1603 a 546 1603 a
+SDict begin 13 H.A end
+ 546 1603 a 546 1603 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3963) cvn H.B /DEST pdfmark
+end
+ 546 1603
+a Fx(--bind-addr)m(ess=)p Ff(<)p Fx(IP-Addr)m(ess)p Ff(>)14
+b FC(Use)21 b(this)f(IP)g(address)f(\(i.e.)h(interf)o(ace\))e(for)h
+(outgoing)f(connections)g(\(e.g.)546 1711 y(on)h(multi-interf)o(ace)g
+(machines\).)-2 1726 y
+SDict begin H.S end
+ -2 1726 a -2 1726 a
+SDict begin 13 H.A end
+ -2 1726 a
+-2 1726 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3964) cvn H.B /DEST pdfmark
+end
+ -2 1726 a Black 463 1861 a FC(5.)p Black 546
+1861 a
+SDict begin H.S end
+ 546 1861 a 546 1861 a
+SDict begin 13 H.A end
+ 546 1861 a 546 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3965) cvn H.B /DEST pdfmark
+end
+ 546
+1861 a 546 1861 a
+SDict begin H.S end
+ 546 1861 a 546 1861 a
+SDict begin 13 H.A end
+ 546 1861 a 546
+1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3966) cvn H.B /DEST pdfmark
+end
+ 546 1861 a Fx(-s)h Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-syslo)
+o(g-se)o(verity=)p Ff(<)p Fx(ar)m(g)p Ff(>)f FC(Set)j(the)f(se)n(v)o
+(erity)f(threshold)g(for)h(syslog.)3124 1861 y
+SDict begin H.S end
+ 3124 1861
+a 3124 1861 a
+SDict begin 13 H.A end
+ 3124 1861 a 3124 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3967) cvn H.B /DEST pdfmark
+end
+ 3124 1861 a Fx(ar)m(g)g
+FC(may)g(be)g(one)g(of)546 1969 y
+SDict begin H.S end
+ 546 1969 a 546 1969
+a
+SDict begin 13 H.A end
+ 546 1969 a 546 1969 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3968) cvn H.B /DEST pdfmark
+end
+ 546 1969 a Fy(none,)g(deb)n(ug,)h(inf)n(o,)e
+(notice,)h(war)o(n,)g(mark,)g(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 1986 y
+SDict begin H.S end
+ -2 1986 a -2 1986 a
+SDict begin 13 H.A end
+ -2 1986 a -2 1986
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3969) cvn H.B /DEST pdfmark
+end
+ -2 1986 a Black 463 2118 a FC(6.)p Black 546 2118 a
+SDict begin H.S end
+
+546 2118 a 546 2118 a
+SDict begin 13 H.A end
+ 546 2118 a 546 2118 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3970) cvn H.B /DEST pdfmark
+end
+ 546 2118
+a 546 2118 a
+SDict begin H.S end
+ 546 2118 a 546 2118 a
+SDict begin 13 H.A end
+ 546 2118 a 546 2118
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3971) cvn H.B /DEST pdfmark
+end
+ 546 2118 a Fx(-l)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-lo)o(g-se)o
+(verity=)p Ff(<)p Fx(ar)m(g)p Ff(>)e FC(Set)k(the)f(se)n(v)o(erity)g
+(threshold)e(for)i(log\002le.)3014 2118 y
+SDict begin H.S end
+ 3014 2118 a
+3014 2118 a
+SDict begin 13 H.A end
+ 3014 2118 a 3014 2118 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3972) cvn H.B /DEST pdfmark
+end
+ 3014 2118 a Fx(ar)m(g)g
+FC(may)f(be)i(one)e(of)546 2226 y
+SDict begin H.S end
+ 546 2226 a 546 2226
+a
+SDict begin 13 H.A end
+ 546 2226 a 546 2226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3973) cvn H.B /DEST pdfmark
+end
+ 546 2226 a Fy(none,)h(deb)n(ug,)h(inf)n(o,)e
+(notice,)h(war)o(n,)g(mark,)g(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 2243 y
+SDict begin H.S end
+ -2 2243 a -2 2243 a
+SDict begin 13 H.A end
+ -2 2243 a -2 2243
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3974) cvn H.B /DEST pdfmark
+end
+ -2 2243 a Black 463 2375 a FC(7.)p Black 546 2375 a
+SDict begin H.S end
+
+546 2375 a 546 2375 a
+SDict begin 13 H.A end
+ 546 2375 a 546 2375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3975) cvn H.B /DEST pdfmark
+end
+ 546 2375
+a 546 2375 a
+SDict begin H.S end
+ 546 2375 a 546 2375 a
+SDict begin 13 H.A end
+ 546 2375 a 546 2375
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3976) cvn H.B /DEST pdfmark
+end
+ 546 2375 a Fx(-m)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-mail-se)o
+(verity=)p Ff(<)p Fx(ar)m(g)p Ff(>)f FC(Set)i(the)h(se)n(v)o(erity)e
+(threshold)g(for)g(e-mail.)3093 2375 y
+SDict begin H.S end
+ 3093 2375 a 3093
+2375 a
+SDict begin 13 H.A end
+ 3093 2375 a 3093 2375 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3977) cvn H.B /DEST pdfmark
+end
+ 3093 2375 a Fx(ar)m(g)h
+FC(may)g(be)g(one)f(of)546 2483 y
+SDict begin H.S end
+ 546 2483 a 546 2483
+a
+SDict begin 13 H.A end
+ 546 2483 a 546 2483 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3978) cvn H.B /DEST pdfmark
+end
+ 546 2483 a Fy(none,)h(deb)n(ug,)h(inf)n(o,)e
+(notice,)h(war)o(n,)g(mark,)g(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 2500 y
+SDict begin H.S end
+ -2 2500 a -2 2500 a
+SDict begin 13 H.A end
+ -2 2500 a -2 2500
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3979) cvn H.B /DEST pdfmark
+end
+ -2 2500 a Black 463 2633 a FC(8.)p Black 546 2633 a
+SDict begin H.S end
+
+546 2633 a 546 2633 a
+SDict begin 13 H.A end
+ 546 2633 a 546 2633 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3980) cvn H.B /DEST pdfmark
+end
+ 546 2633
+a 546 2633 a
+SDict begin H.S end
+ 546 2633 a 546 2633 a
+SDict begin 13 H.A end
+ 546 2633 a 546 2633
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3981) cvn H.B /DEST pdfmark
+end
+ 546 2633 a Fx(--set-database-se)o(verity=)p Ff(<)p
+Fx(ar)m(g)p Ff(>)15 b FC(Set)21 b(the)g(se)n(v)o(erity)e(threshold)g
+(for)g(logging)g(to)h(a)h(RDBMS.)3350 2633 y
+SDict begin H.S end
+ 3350 2633
+a 3350 2633 a
+SDict begin 13 H.A end
+ 3350 2633 a 3350 2633 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3982) cvn H.B /DEST pdfmark
+end
+ 3350 2633 a Fx(ar)m(g)f
+FC(may)f(be)546 2741 y(one)g(of)776 2741 y
+SDict begin H.S end
+ 776 2741 a
+776 2741 a
+SDict begin 13 H.A end
+ 776 2741 a 776 2741 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3983) cvn H.B /DEST pdfmark
+end
+ 776 2741 a Fy(none,)h(deb)n(ug,)h(inf)
+n(o,)f(notice,)g(war)o(n,)f(mark,)i(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 2758 y
+SDict begin H.S end
+ -2 2758 a -2 2758 a
+SDict begin 13 H.A end
+ -2 2758 a -2 2758
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3984) cvn H.B /DEST pdfmark
+end
+ -2 2758 a Black 463 2890 a FC(9.)p Black 546 2890 a
+SDict begin H.S end
+
+546 2890 a 546 2890 a
+SDict begin 13 H.A end
+ 546 2890 a 546 2890 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3985) cvn H.B /DEST pdfmark
+end
+ 546 2890
+a 546 2890 a
+SDict begin H.S end
+ 546 2890 a 546 2890 a
+SDict begin 13 H.A end
+ 546 2890 a 546 2890
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3986) cvn H.B /DEST pdfmark
+end
+ 546 2890 a Fx(--set-pr)m(elude-se)o(verity=)p Ff(<)p
+Fx(ar)m(g)p Ff(>)c FC(Set)21 b(the)f(se)n(v)o(erity)g(threshold)e(for)i
+(logging)e(to)j(the)f(Prelude)f(IDS)i(system.)546 2998
+y
+SDict begin H.S end
+ 546 2998 a 546 2998 a
+SDict begin 13 H.A end
+ 546 2998 a 546 2998 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3987) cvn H.B /DEST pdfmark
+end
+ 546 2998
+a Fx(ar)m(g)f FC(may)f(be)i(one)e(of)1172 2998 y
+SDict begin H.S end
+ 1172
+2998 a 1172 2998 a
+SDict begin 13 H.A end
+ 1172 2998 a 1172 2998 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3988) cvn H.B /DEST pdfmark
+end
+ 1172 2998
+a Fy(none,)h(deb)n(ug,)h(inf)n(o,)f(notice,)f(war)o(n,)h(mark,)g(err)-8
+b(,)21 b(crit,)f(alert)p FC(.)-2 3016 y
+SDict begin H.S end
+ -2 3016 a -2
+3016 a
+SDict begin 13 H.A end
+ -2 3016 a -2 3016 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3989) cvn H.B /DEST pdfmark
+end
+ -2 3016 a Black 421 3148 a
+FC(10.)p Black 546 3148 a
+SDict begin H.S end
+ 546 3148 a 546 3148 a
+SDict begin 13 H.A end
+ 546 3148
+a 546 3148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3990) cvn H.B /DEST pdfmark
+end
+ 546 3148 a 546 3148 a
+SDict begin H.S end
+ 546 3148 a 546 3148
+a
+SDict begin 13 H.A end
+ 546 3148 a 546 3148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3991) cvn H.B /DEST pdfmark
+end
+ 546 3148 a Fx(-p)g Ff(<)p Fx(ar)m(g)p
+Ff(>)p Fx(,)f(--set-print-se)o(verity=)p Ff(<)p Fx(ar)m(g)p
+Ff(>)e FC(Set)k(the)f(se)n(v)o(erity)f(threshold)g(for)h
+(terminal/console.)3430 3148 y
+SDict begin H.S end
+ 3430 3148 a 3430 3148
+a
+SDict begin 13 H.A end
+ 3430 3148 a 3430 3148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3992) cvn H.B /DEST pdfmark
+end
+ 3430 3148 a Fx(ar)m(g)g FC(may)546
+3256 y(be)g(one)f(of)875 3256 y
+SDict begin H.S end
+ 875 3256 a 875 3256 a
+SDict begin 13 H.A end
+
+875 3256 a 875 3256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3993) cvn H.B /DEST pdfmark
+end
+ 875 3256 a Fy(none,)i(deb)n(ug,)f(inf)n(o,)g
+(notice,)g(war)o(n,)f(mark,)i(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 3272 y
+SDict begin H.S end
+ -2 3272 a -2 3272 a
+SDict begin 13 H.A end
+ -2 3272 a -2 3272
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3994) cvn H.B /DEST pdfmark
+end
+ -2 3272 a Black 421 3405 a FC(11.)p Black 546 3405
+a
+SDict begin H.S end
+ 546 3405 a 546 3405 a
+SDict begin 13 H.A end
+ 546 3405 a 546 3405 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3995) cvn H.B /DEST pdfmark
+end
+ 546 3405
+a 546 3405 a
+SDict begin H.S end
+ 546 3405 a 546 3405 a
+SDict begin 13 H.A end
+ 546 3405 a 546 3405
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3996) cvn H.B /DEST pdfmark
+end
+ 546 3405 a Fx(-x)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-e)n
+(xtern-se)o(verity=)p Ff(<)p Fx(ar)m(g)p Ff(>)f FC(Set)i(the)h(se)n(v)o
+(erity)e(threshold)g(for)g(e)o(xternal)g(program\(s\).)3572
+3405 y
+SDict begin H.S end
+ 3572 3405 a 3572 3405 a
+SDict begin 13 H.A end
+ 3572 3405 a 3572 3405
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3997) cvn H.B /DEST pdfmark
+end
+ 3572 3405 a Fx(ar)m(g)546 3513 y FC(may)g(be)i(one)e(of)1039
+3513 y
+SDict begin H.S end
+ 1039 3513 a 1039 3513 a
+SDict begin 13 H.A end
+ 1039 3513 a 1039 3513
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3998) cvn H.B /DEST pdfmark
+end
+ 1039 3513 a Fy(none,)h(deb)n(ug,)h(inf)n(o,)f(notice,)f(war)o(n,)h
+(mark,)g(err)-8 b(,)21 b(crit,)f(alert)p FC(.)-2 3531
+y
+SDict begin H.S end
+ -2 3531 a -2 3531 a
+SDict begin 13 H.A end
+ -2 3531 a -2 3531 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:3999) cvn H.B /DEST pdfmark
+end
+ -2 3531 a Black
+421 3662 a FC(12.)p Black 546 3662 a
+SDict begin H.S end
+ 546 3662 a 546 3662
+a
+SDict begin 13 H.A end
+ 546 3662 a 546 3662 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4000) cvn H.B /DEST pdfmark
+end
+ 546 3662 a 546 3662 a
+SDict begin H.S end
+ 546 3662
+a 546 3662 a
+SDict begin 13 H.A end
+ 546 3662 a 546 3662 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4001) cvn H.B /DEST pdfmark
+end
+ 546 3662 a Fx(-L)g
+Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)e(--verify-lo)o(g=)p Ff(<)p
+Fx(ar)m(g)p Ff(>)e FC(V)-9 b(erify)19 b(the)g(inte)o(grity)f(of)h(the)h
+(log)f(\002le)h(and)f(print)g(the)g(entries)h(\()3436
+3662 y
+SDict begin H.S end
+ 3436 3662 a 3436 3662 a
+SDict begin 13 H.A end
+ 3436 3662 a 3436 3662
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4002) cvn H.B /DEST pdfmark
+end
+ 3436 3662 a Fx(ar)m(g)f FC(is)h(the)546 3770 y(path)f(of)h(the)h(log)
+e(\002le\).)-2 3788 y
+SDict begin H.S end
+ -2 3788 a -2 3788 a
+SDict begin 13 H.A end
+ -2 3788 a -2
+3788 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4003) cvn H.B /DEST pdfmark
+end
+ -2 3788 a Black 421 3920 a FC(13.)p Black 546
+3920 a
+SDict begin H.S end
+ 546 3920 a 546 3920 a
+SDict begin 13 H.A end
+ 546 3920 a 546 3920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4004) cvn H.B /DEST pdfmark
+end
+ 546
+3920 a 546 3920 a
+SDict begin H.S end
+ 546 3920 a 546 3920 a
+SDict begin 13 H.A end
+ 546 3920 a 546
+3920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4005) cvn H.B /DEST pdfmark
+end
+ 546 3920 a Fx(-j,)h(--just-list)i FC(Modify)c(-L)j(to)f(just)h
+(list)g(the)f(log\002le,)g(rather)f(than)h(v)o(erify)f(\(to)h
+(de-obfuscate)e(the)i(log\002le)g(if)546 4028 y(you)f(ha)n(v)o(e)h
+(compiled)e(for)i(stealth)g(mode\).)1804 4028 y
+SDict begin H.S end
+ 1804
+4028 a 1804 4028 a
+SDict begin 13 H.A end
+ 1804 4028 a 1804 4028 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4006) cvn H.B /DEST pdfmark
+end
+ 1804 4028
+a Fx(Or)m(der)h(matter)o(s:)f FC(this)h(must)f(come)g(before)f(-L.)-2
+4046 y
+SDict begin H.S end
+ -2 4046 a -2 4046 a
+SDict begin 13 H.A end
+ -2 4046 a -2 4046 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4007) cvn H.B /DEST pdfmark
+end
+ -2 4046
+a Black 421 4177 a FC(14.)p Black 546 4177 a
+SDict begin H.S end
+ 546 4177
+a 546 4177 a
+SDict begin 13 H.A end
+ 546 4177 a 546 4177 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4008) cvn H.B /DEST pdfmark
+end
+ 546 4177 a 546 4177
+a
+SDict begin H.S end
+ 546 4177 a 546 4177 a
+SDict begin 13 H.A end
+ 546 4177 a 546 4177 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4009) cvn H.B /DEST pdfmark
+end
+ 546 4177
+a Fx(-M)h Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--verify-mail=)p
+Ff(<)p Fx(ar)m(g)p Ff(>)f FC(V)-9 b(erify)19 b(the)h(inte)o(grity)f(of)
+h(e-mailed)f(messages)i(\()3099 4177 y
+SDict begin H.S end
+ 3099 4177 a 3099
+4177 a
+SDict begin 13 H.A end
+ 3099 4177 a 3099 4177 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4010) cvn H.B /DEST pdfmark
+end
+ 3099 4177 a Fx(ar)m(g)e
+FC(is)i(the)g(path)e(of)546 4285 y(the)h(mail)g(box\).)-2
+4300 y
+SDict begin H.S end
+ -2 4300 a -2 4300 a
+SDict begin 13 H.A end
+ -2 4300 a -2 4300 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4011) cvn H.B /DEST pdfmark
+end
+ -2 4300
+a Black 421 4434 a FC(15.)p Black 546 4434 a
+SDict begin H.S end
+ 546 4434
+a 546 4434 a
+SDict begin 13 H.A end
+ 546 4434 a 546 4434 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4012) cvn H.B /DEST pdfmark
+end
+ 546 4434 a 546 4434
+a
+SDict begin H.S end
+ 546 4434 a 546 4434 a
+SDict begin 13 H.A end
+ 546 4434 a 546 4434 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4013) cvn H.B /DEST pdfmark
+end
+ 546 4434
+a Fx(-V)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--add-k)o(e)n(y=)p
+Ff(<)p Fx(ar)m(g)p Ff(>)d FC(Add)j(k)o(e)o(y)h(material)g(to)g(the)g
+(compiled-in)e(k)o(e)o(y)i(\(see)p 0 TeXcolorgray 3078
+4434 a
+SDict begin H.S end
+ 3078 4434 a FC(Section)g(11.2)3495 4434 y
+SDict begin 13 H.L end
+ 3495
+4434 a 3495 4434 a
+SDict begin [ /Subtype /Link /Dest (0:KEYPAD) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3495 4434 a Black -2 w FC(>\).)3609
+4434 y
+SDict begin H.S end
+ 3609 4434 a 3609 4434 a
+SDict begin 13 H.A end
+ 3609 4434 a 3609 4434
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4015) cvn H.B /DEST pdfmark
+end
+ 3609 4434 a Fx(ar)m(g)546 4542 y FC(must)g(be)g(of)g(the)g(form)1221
+4542 y
+SDict begin H.S end
+ 1221 4542 a 1221 4542 a
+SDict begin 13 H.A end
+ 1221 4542 a 1221 4542
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4016) cvn H.B /DEST pdfmark
+end
+ 1221 4542 a Fx(k)o(e)n(y@/path/to/e)n(xecutable)p FC(.)d(Output)j
+(will)h(be)f(written)g(to)546 4650 y
+SDict begin H.S end
+ 546 4650 a 546 4650
+a
+SDict begin 13 H.A end
+ 546 4650 a 546 4650 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4017) cvn H.B /DEST pdfmark
+end
+ 546 4650 a Fr(/path/to/executable.out)p
+FC(.)-2 4662 y
+SDict begin H.S end
+ -2 4662 a -2 4662 a
+SDict begin 13 H.A end
+ -2 4662 a -2 4662
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4018) cvn H.B /DEST pdfmark
+end
+ -2 4662 a Black 421 4800 a FC(16.)p Black 546 4800
+a
+SDict begin H.S end
+ 546 4800 a 546 4800 a
+SDict begin 13 H.A end
+ 546 4800 a 546 4800 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4019) cvn H.B /DEST pdfmark
+end
+ 546 4800
+a 546 4800 a
+SDict begin H.S end
+ 546 4800 a 546 4800 a
+SDict begin 13 H.A end
+ 546 4800 a 546 4800
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4020) cvn H.B /DEST pdfmark
+end
+ 546 4800 a Fx(-H)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--hash-string=)p
+Ff(<)p Fx(ar)m(g)p Ff(>)e FC(Print)j(the)g(hash)g(of)g(a)h(string)e(/)i
+(the)f(checksum)f(of)h(a)h(\002le,)f(and)g(e)o(xit.)g(If)546
+4908 y
+SDict begin H.S end
+ 546 4908 a 546 4908 a
+SDict begin 13 H.A end
+ 546 4908 a 546 4908 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4021) cvn H.B /DEST pdfmark
+end
+ 546
+4908 a Fx(ar)m(g)g FC(starts)h(with)f(a)h('/',)f(it)g(is)i(assumed)d
+(to)i(be)f(a)g(\002le,)h(otherwise)f(a)g(string.)g(This)g(function)f
+(is)i(useful)e(to)i(test)546 5016 y(the)f(hash)g(algorithm.)-2
+5034 y
+SDict begin H.S end
+ -2 5034 a -2 5034 a
+SDict begin 13 H.A end
+ -2 5034 a -2 5034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4022) cvn H.B /DEST pdfmark
+end
+ -2 5034
+a Black 421 5165 a FC(17.)p Black 546 5165 a
+SDict begin H.S end
+ 546 5165
+a 546 5165 a
+SDict begin 13 H.A end
+ 546 5165 a 546 5165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4023) cvn H.B /DEST pdfmark
+end
+ 546 5165 a 546 5165
+a
+SDict begin H.S end
+ 546 5165 a 546 5165 a
+SDict begin 13 H.A end
+ 546 5165 a 546 5165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4024) cvn H.B /DEST pdfmark
+end
+ 546 5165
+a Fx(-z)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--tr)o(acele)o(vel=)p
+Ff(<)p Fx(ar)m(g)p Ff(>)f FC(If)i(compiled)e(with)j(--enable-deb)n(ug:)
+c(ar)o(g)i Ff(>)h FC(0)g(to)h(switch)f(on)g(deb)n(ug)546
+5273 y(output.)e(If)i(compiled)f(with)i(--enable-trace:)c(ar)o(g)j
+Ff(>)g FC(0)g(max.)g(le)n(v)o(el)g(for)f(call)i(tracing.)-2
+5291 y
+SDict begin H.S end
+ -2 5291 a -2 5291 a
+SDict begin 13 H.A end
+ -2 5291 a -2 5291 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4025) cvn H.B /DEST pdfmark
+end
+ -2 5291
+a Black 3620 5805 a Fx(111)p Black eop end
+%%Page: 112 117
+TeXDict begin 112 116 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.112) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2354 104 a
+Fx(Appendix)18 b(B.)i(List)i(of)e(command)f(line)h(options)p
+Black Black 421 309 a FC(18.)p Black 546 309 a
+SDict begin H.S end
+ 546 309
+a 546 309 a
+SDict begin 13 H.A end
+ 546 309 a 546 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4026) cvn H.B /DEST pdfmark
+end
+ 546 309 a 546 309 a
+SDict begin H.S end
+ 546
+309 a 546 309 a
+SDict begin 13 H.A end
+ 546 309 a 546 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4027) cvn H.B /DEST pdfmark
+end
+ 546 309 a Fx(-i)g
+Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--milestone=)p Ff(<)p
+Fx(ar)m(g)p Ff(>)f FC(If)i(compiled)f(with)h(--enable-trace:)e(trace)i
+(from)f(milestone)h(ar)o(g)f(to)546 417 y(ar)o(g+1.)f(If)i(ar)o(g)f(=)i
+(-1,)f(trace)g(all.)-2 435 y
+SDict begin H.S end
+ -2 435 a -2 435 a
+SDict begin 13 H.A end
+ -2 435
+a -2 435 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4028) cvn H.B /DEST pdfmark
+end
+ -2 435 a Black 421 566 a FC(19.)p Black 546
+566 a
+SDict begin H.S end
+ 546 566 a 546 566 a
+SDict begin 13 H.A end
+ 546 566 a 546 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4029) cvn H.B /DEST pdfmark
+end
+ 546 566
+a 546 566 a
+SDict begin H.S end
+ 546 566 a 546 566 a
+SDict begin 13 H.A end
+ 546 566 a 546 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4030) cvn H.B /DEST pdfmark
+end
+ 546
+566 a Fx(-d)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--list-database=)p
+Ff(<)p Fx(ar)m(g)p Ff(>)d FC(List)21 b(the)f(database)g(\002le)2427
+566 y
+SDict begin H.S end
+ 2427 566 a 2427 566 a
+SDict begin 13 H.A end
+ 2427 566 a 2427 566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4031) cvn H.B /DEST pdfmark
+end
+ 2427
+566 a Fx(ar)m(g)g FC(\(use)g(\223def)o(ault\224)f(for)g(the)i
+(compiled-in)546 674 y(path\).)-2 692 y
+SDict begin H.S end
+ -2 692 a -2 692
+a
+SDict begin 13 H.A end
+ -2 692 a -2 692 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4032) cvn H.B /DEST pdfmark
+end
+ -2 692 a Black 421 823 a FC(20.)p
+Black 546 823 a
+SDict begin H.S end
+ 546 823 a 546 823 a
+SDict begin 13 H.A end
+ 546 823 a 546 823
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4033) cvn H.B /DEST pdfmark
+end
+ 546 823 a 546 823 a
+SDict begin H.S end
+ 546 823 a 546 823 a
+SDict begin 13 H.A end
+ 546 823 a 546
+823 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4034) cvn H.B /DEST pdfmark
+end
+ 546 823 a Fx(-a,)e(--full-detail)g FC(Modify)g(-d)h(to)g(list)h
+(full)f(details)h(\(numeric)d(mode,)h(o)n(wner)m(,)g(group,)f(all)j
+(three)f(timestamps)546 931 y(\(ctime,)f(mtime,)h(atime\),)g(and)f(the)
+i(checksum.)1943 931 y
+SDict begin H.S end
+ 1943 931 a 1943 931 a
+SDict begin 13 H.A end
+ 1943 931
+a 1943 931 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4035) cvn H.B /DEST pdfmark
+end
+ 1943 931 a Fx(Or)m(der)g(matter)o(s:)f FC(this)h(must)f
+(come)g(before)f(-d.)-2 946 y
+SDict begin H.S end
+ -2 946 a -2 946 a
+SDict begin 13 H.A end
+ -2 946
+a -2 946 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4036) cvn H.B /DEST pdfmark
+end
+ -2 946 a Black 421 1081 a FC(21.)p Black 546
+1081 a
+SDict begin H.S end
+ 546 1081 a 546 1081 a
+SDict begin 13 H.A end
+ 546 1081 a 546 1081 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4037) cvn H.B /DEST pdfmark
+end
+ 546
+1081 a 546 1081 a
+SDict begin H.S end
+ 546 1081 a 546 1081 a
+SDict begin 13 H.A end
+ 546 1081 a 546
+1081 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4038) cvn H.B /DEST pdfmark
+end
+ 546 1081 a 20 w Fx(--delimited)j FC(Same)e(as)h(--full-detail,)d
+(b)n(ut)i(with)1967 1081 y
+SDict begin H.S end
+ 1967 1081 a 1967 1081 a
+SDict begin 13 H.A end
+ 1967
+1081 a 1967 1081 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4039) cvn H.B /DEST pdfmark
+end
+ 1967 1081 a Fx(comma-delimited)g FC(\002elds.)-2
+1093 y
+SDict begin H.S end
+ -2 1093 a -2 1093 a
+SDict begin 13 H.A end
+ -2 1093 a -2 1093 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4040) cvn H.B /DEST pdfmark
+end
+ -2 1093
+a Black 421 1230 a FC(22.)p Black 546 1230 a
+SDict begin H.S end
+ 546 1230
+a 546 1230 a
+SDict begin 13 H.A end
+ 546 1230 a 546 1230 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4041) cvn H.B /DEST pdfmark
+end
+ 546 1230 a 546 1230
+a
+SDict begin H.S end
+ 546 1230 a 546 1230 a
+SDict begin 13 H.A end
+ 546 1230 a 546 1230 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4042) cvn H.B /DEST pdfmark
+end
+ 546 1230
+a Fx(-c,)g(--copyright)f FC(Print)i(cop)o(yright)d(information)g(and)h
+(e)o(xit.)-2 1248 y
+SDict begin H.S end
+ -2 1248 a -2 1248 a
+SDict begin 13 H.A end
+ -2 1248 a -2
+1248 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4043) cvn H.B /DEST pdfmark
+end
+ -2 1248 a Black 421 1380 a FC(23.)p Black 546
+1380 a
+SDict begin H.S end
+ 546 1380 a 546 1380 a
+SDict begin 13 H.A end
+ 546 1380 a 546 1380 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4044) cvn H.B /DEST pdfmark
+end
+ 546
+1380 a 546 1380 a
+SDict begin H.S end
+ 546 1380 a 546 1380 a
+SDict begin 13 H.A end
+ 546 1380 a 546
+1380 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4045) cvn H.B /DEST pdfmark
+end
+ 546 1380 a Fx(-h,)g(--help)g FC(Print)i(a)f(short)g(help)g(on)g
+(command)e(line)i(options)f(and)h(e)o(xit.)-2 1398 y
+SDict begin H.S end
+
+-2 1398 a -2 1398 a
+SDict begin 13 H.A end
+ -2 1398 a -2 1398 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4046) cvn H.B /DEST pdfmark
+end
+ -2 1398 a Black
+421 1529 a FC(24.)p Black 546 1529 a
+SDict begin H.S end
+ 546 1529 a 546 1529
+a
+SDict begin 13 H.A end
+ 546 1529 a 546 1529 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4047) cvn H.B /DEST pdfmark
+end
+ 546 1529 a 546 1529 a
+SDict begin H.S end
+ 546 1529
+a 546 1529 a
+SDict begin 13 H.A end
+ 546 1529 a 546 1529 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4048) cvn H.B /DEST pdfmark
+end
+ 546 1529 a Fx(--tr)o(ace-enable)d
+FC(Print)j(a)h(trace)f(of)g(the)g(e)o(x)o(ecution)e(\003o)n(w)-5
+b(.)-2 1530 y
+SDict begin H.S end
+ -2 1530 a -2 1530 a
+SDict begin 13 H.A end
+ -2 1530 a -2 1530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4049) cvn H.B /DEST pdfmark
+end
+
+-2 1530 a Black 421 1679 a FC(25.)p Black 546 1679 a
+SDict begin H.S end
+
+546 1679 a 546 1679 a
+SDict begin 13 H.A end
+ 546 1679 a 546 1679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4050) cvn H.B /DEST pdfmark
+end
+ 546 1679
+a 546 1679 a
+SDict begin H.S end
+ 546 1679 a 546 1679 a
+SDict begin 13 H.A end
+ 546 1679 a 546 1679
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4051) cvn H.B /DEST pdfmark
+end
+ 546 1679 a Fx(--tr)o(ace-lo)o(g\002le=)p Ff(<)p Fx(ar)m(g)p
+Ff(>)16 b FC(Use)21 b(\002le)1600 1679 y
+SDict begin H.S end
+ 1600 1679 a
+1600 1679 a
+SDict begin 13 H.A end
+ 1600 1679 a 1600 1679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4052) cvn H.B /DEST pdfmark
+end
+ 1600 1679 a Fx(ar)m(g)f
+FC(to)g(log)g(the)g(trace.)-2 1838 y
+SDict begin H.S end
+ -2 1838 a -2 1838
+a
+SDict begin 13 H.A end
+ -2 1838 a -2 1838 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SAMHAIN-COMMAND-LINE) cvn H.B
+/DEST pdfmark end
+ -2 1838 a 377 x Fu(B.2.)39 b(samhain)885
+2215 y
+SDict begin H.S end
+ 885 2215 a 885 2215 a
+SDict begin 22.464 H.A end
+ 885 2215 a 885 2215 a
+SDict begin [ /View [/XYZ H.V] /Dest (15.80.1) cvn H.B /DEST pdfmark
+end
+ 885
+2215 a -2 2217 a
+SDict begin H.S end
+ -2 2217 a -2 2217 a
+SDict begin 13 H.A end
+ -2 2217 a -2 2217
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4056) cvn H.B /DEST pdfmark
+end
+ -2 2217 a -2 2246 a
+SDict begin H.S end
+ -2 2246 a -2 2246 a
+SDict begin 13 H.A end
+ -2 2246 a -2
+2246 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4057) cvn H.B /DEST pdfmark
+end
+ -2 2246 a Black 463 2422 a FC(1.)p Black 546 2422
+a
+SDict begin H.S end
+ 546 2422 a 546 2422 a
+SDict begin 13 H.A end
+ 546 2422 a 546 2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4058) cvn H.B /DEST pdfmark
+end
+ 546 2422
+a 546 2422 a
+SDict begin H.S end
+ 546 2422 a 546 2422 a
+SDict begin 13 H.A end
+ 546 2422 a 546 2422
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4059) cvn H.B /DEST pdfmark
+end
+ 546 2422 a Fx(-t)20 b Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-c)o(hec)
+n(ksum-test=)p Ff(<)p Fx(ar)m(g)p Ff(>)e FC(Set)k(\002le)g(checking)d
+(to)2516 2422 y
+SDict begin H.S end
+ 2516 2422 a 2516 2422 a
+SDict begin 13 H.A end
+ 2516 2422 a 2516
+2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4060) cvn H.B /DEST pdfmark
+end
+ 2516 2422 a Fx(init)q FC(,)2669 2422 y
+SDict begin H.S end
+ 2669 2422
+a 2669 2422 a
+SDict begin 13 H.A end
+ 2669 2422 a 2669 2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4061) cvn H.B /DEST pdfmark
+end
+ 2669 2422 a Fx(update)p
+FC(,)h(or)3027 2422 y
+SDict begin H.S end
+ 3027 2422 a 3027 2422 a
+SDict begin 13 H.A end
+ 3027 2422
+a 3027 2422 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4062) cvn H.B /DEST pdfmark
+end
+ 3027 2422 a Fx(c)o(hec)n(k)q FC(.)h(Use)3406
+2422 y
+SDict begin H.S end
+ 3406 2422 a 3406 2422 a
+SDict begin 13 H.A end
+ 3406 2422 a 3406 2422
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4063) cvn H.B /DEST pdfmark
+end
+ 3406 2422 a Fx(init)i FC(to)546 2530 y(create)e(the)g(database,)1214
+2530 y
+SDict begin H.S end
+ 1214 2530 a 1214 2530 a
+SDict begin 13 H.A end
+ 1214 2530 a 1214 2530
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4064) cvn H.B /DEST pdfmark
+end
+ 1214 2530 a Fx(update)f FC(to)h(update)f(it,)i(and)2017
+2530 y
+SDict begin H.S end
+ 2017 2530 a 2017 2530 a
+SDict begin 13 H.A end
+ 2017 2530 a 2017 2530
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4065) cvn H.B /DEST pdfmark
+end
+ 2017 2530 a Fx(c)o(hec)n(k)g FC(to)f(check)g(\002les)h(against)e(the)
+h(database.)-2 2548 y
+SDict begin H.S end
+ -2 2548 a -2 2548 a
+SDict begin 11.7 H.A end
+ -2 2548 a -2
+2548 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4066) cvn H.B /DEST pdfmark
+end
+ -2 2548 a -2 2673 a
+SDict begin H.S end
+ -2 2673 a -2 2673 a
+SDict begin 11.7 H.A end
+ -2 2673
+a -2 2673 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4068) cvn H.B /DEST pdfmark
+end
+ -2 2673 a 712 2752 a Fw(TIP:)g Fv(Y)-10 b(es)o(,)19
+b(it)h(is)h(nor)r(mal)e(that)1562 2752 y
+SDict begin H.S end
+ 1562 2752 a
+1562 2752 a
+SDict begin 11.7 H.A end
+ 1562 2752 a 1562 2752 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4069) cvn H.B /DEST pdfmark
+end
+ 1562 2752 a Fq(update)g
+Fv(tak)o(es)h(m)o(uch)h(more)f(time)g(than)2732 2752
+y
+SDict begin H.S end
+ 2732 2752 a 2732 2752 a
+SDict begin 11.7 H.A end
+ 2732 2752 a 2732 2752 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4070) cvn H.B /DEST pdfmark
+end
+ 2732
+2752 a Fq(init)7 b Fv(.)39 3092 y
+SDict begin H.S end
+ 39 3092 a 39 3092 a
+SDict begin 13 H.A end
+
+39 3092 a 39 3092 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4071) cvn H.B /DEST pdfmark
+end
+ 39 3092 a Black 463 3242 a FC(2.)p
+Black 546 3242 a
+SDict begin H.S end
+ 546 3242 a 546 3242 a
+SDict begin 13 H.A end
+ 546 3242 a 546
+3242 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4072) cvn H.B /DEST pdfmark
+end
+ 546 3242 a 546 3242 a
+SDict begin H.S end
+ 546 3242 a 546 3242 a
+SDict begin 13 H.A end
+ 546
+3242 a 546 3242 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4073) cvn H.B /DEST pdfmark
+end
+ 546 3242 a Fx(-i,)20 b(--inter)o(active)f
+FC(Use)i(interacti)n(v)o(e)e(mode)g(for)1908 3242 y
+SDict begin H.S end
+ 1908
+3242 a 1908 3242 a
+SDict begin 13 H.A end
+ 1908 3242 a 1908 3242 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4074) cvn H.B /DEST pdfmark
+end
+ 1908 3242
+a Fx(update)g FC(\(ask)h(before)f(updating)f(an)i(entry\).)-2
+3260 y
+SDict begin H.S end
+ -2 3260 a -2 3260 a
+SDict begin 13 H.A end
+ -2 3260 a -2 3260 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4075) cvn H.B /DEST pdfmark
+end
+ -2 3260
+a Black 463 3391 a FC(3.)p Black 546 3391 a
+SDict begin H.S end
+ 546 3391
+a 546 3391 a
+SDict begin 13 H.A end
+ 546 3391 a 546 3391 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4076) cvn H.B /DEST pdfmark
+end
+ 546 3391 a 546 3391
+a
+SDict begin H.S end
+ 546 3391 a 546 3391 a
+SDict begin 13 H.A end
+ 546 3391 a 546 3391 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4077) cvn H.B /DEST pdfmark
+end
+ 546 3391
+a Fx(-e)g Ff(<)p Fx(ar)m(g)p Ff(>)p Fx(,)f(--set-e)n(xport-se)o
+(verity=)p Ff(<)p Fx(ar)m(g)p Ff(>)e FC(Set)k(the)f(se)n(v)o(erity)g
+(threshold)e(for)i(forw)o(arding)e(messages)i(to)546
+3499 y(the)g(log)g(serv)o(er)-5 b(.)1033 3499 y
+SDict begin H.S end
+ 1033
+3499 a 1033 3499 a
+SDict begin 13 H.A end
+ 1033 3499 a 1033 3499 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4078) cvn H.B /DEST pdfmark
+end
+ 1033 3499
+a Fx(ar)m(g)20 b FC(may)g(be)g(one)g(of)1660 3499 y
+SDict begin H.S end
+ 1660
+3499 a 1660 3499 a
+SDict begin 13 H.A end
+ 1660 3499 a 1660 3499 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4079) cvn H.B /DEST pdfmark
+end
+ 1660 3499
+a Fy(none,)g(deb)n(ug,)h(inf)n(o,)e(notice,)h(war)o(n,)g(mark,)g(err)-8
+b(,)20 b(crit,)g(alert)p FC(.)-2 3517 y
+SDict begin H.S end
+ -2 3517 a -2
+3517 a
+SDict begin 13 H.A end
+ -2 3517 a -2 3517 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4080) cvn H.B /DEST pdfmark
+end
+ -2 3517 a Black 463 3649 a
+FC(4.)p Black 546 3649 a
+SDict begin H.S end
+ 546 3649 a 546 3649 a
+SDict begin 13 H.A end
+ 546 3649
+a 546 3649 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4081) cvn H.B /DEST pdfmark
+end
+ 546 3649 a 546 3649 a
+SDict begin H.S end
+ 546 3649 a 546 3649
+a
+SDict begin 13 H.A end
+ 546 3649 a 546 3649 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4082) cvn H.B /DEST pdfmark
+end
+ 546 3649 a Fx(-r)g Ff(<)p Fx(ar)m(g)p
+Ff(>)p Fx(,)f(--r)m(ecur)o(sion=)p Ff(<)p Fx(ar)m(g)p
+Ff(>)f FC(Set)j(the)f(def)o(ault)g(recursion)e(le)n(v)o(el)i(for)g
+(directories)f(\(0)h(--)g(99\).)-2 3666 y
+SDict begin H.S end
+ -2 3666 a -2
+3666 a
+SDict begin 13 H.A end
+ -2 3666 a -2 3666 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4083) cvn H.B /DEST pdfmark
+end
+ -2 3666 a Black 463 3798 a
+FC(5.)p Black 546 3798 a
+SDict begin H.S end
+ 546 3798 a 546 3798 a
+SDict begin 13 H.A end
+ 546 3798
+a 546 3798 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4084) cvn H.B /DEST pdfmark
+end
+ 546 3798 a 546 3798 a
+SDict begin H.S end
+ 546 3798 a 546 3798
+a
+SDict begin 13 H.A end
+ 546 3798 a 546 3798 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4085) cvn H.B /DEST pdfmark
+end
+ 546 3798 a Fx(--init2stdout)f
+FC(Write)i(the)f(database)g(to)g(stdout)g(when)g(performing)d(the)j
+(initialization.)-2 3857 y
+SDict begin H.S end
+ -2 3857 a -2 3857 a
+SDict begin 13 H.A end
+ -2 3857
+a -2 3857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:COMMAND-LINE-YULE) cvn H.B
+/DEST pdfmark end
+ -2 3857 a 360 x Fu(B.3.)39 b(yule)589 4217
+y
+SDict begin H.S end
+ 589 4217 a 589 4217 a
+SDict begin 22.464 H.A end
+ 589 4217 a 589 4217 a
+SDict begin [ /View [/XYZ H.V] /Dest (15.81.1) cvn H.B /DEST pdfmark
+end
+ 589 4217
+a -2 4246 a
+SDict begin H.S end
+ -2 4246 a -2 4246 a
+SDict begin 13 H.A end
+ -2 4246 a -2 4246 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4089) cvn H.B /DEST pdfmark
+end
+ -2
+4246 a -2 4275 a
+SDict begin H.S end
+ -2 4275 a -2 4275 a
+SDict begin 13 H.A end
+ -2 4275 a -2 4275
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4090) cvn H.B /DEST pdfmark
+end
+ -2 4275 a Black 463 4423 a FC(1.)p Black 546 4423 a
+SDict begin H.S end
+
+546 4423 a 546 4423 a
+SDict begin 13 H.A end
+ 546 4423 a 546 4423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4091) cvn H.B /DEST pdfmark
+end
+ 546 4423
+a 546 4423 a
+SDict begin H.S end
+ 546 4423 a 546 4423 a
+SDict begin 13 H.A end
+ 546 4423 a 546 4423
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4092) cvn H.B /DEST pdfmark
+end
+ 546 4423 a Fx(-S,)19 b(--server)k FC(Run)d(as)h(serv)o(er)-5
+b(.)19 b(Only)h(required)f(if)h(the)g(binary)f(is)i(dual-purpose.)-2
+4441 y
+SDict begin H.S end
+ -2 4441 a -2 4441 a
+SDict begin 13 H.A end
+ -2 4441 a -2 4441 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4093) cvn H.B /DEST pdfmark
+end
+ -2 4441
+a Black 463 4573 a FC(2.)p Black 546 4573 a
+SDict begin H.S end
+ 546 4573
+a 546 4573 a
+SDict begin 13 H.A end
+ 546 4573 a 546 4573 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4094) cvn H.B /DEST pdfmark
+end
+ 546 4573 a 546 4573
+a
+SDict begin H.S end
+ 546 4573 a 546 4573 a
+SDict begin 13 H.A end
+ 546 4573 a 546 4573 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4095) cvn H.B /DEST pdfmark
+end
+ 546 4573
+a Fx(-q,)e(--quali\002ed)h FC(Log)g(recei)n(v)o(ed)e(messages)j(with)f
+(the)g(fully)g(quali\002ed)f(name)h(of)g(client)g(host.)-2
+4591 y
+SDict begin H.S end
+ -2 4591 a -2 4591 a
+SDict begin 13 H.A end
+ -2 4591 a -2 4591 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4096) cvn H.B /DEST pdfmark
+end
+ -2 4591
+a Black 463 4722 a FC(3.)p Black 546 4722 a
+SDict begin H.S end
+ 546 4722
+a 546 4722 a
+SDict begin 13 H.A end
+ 546 4722 a 546 4722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4097) cvn H.B /DEST pdfmark
+end
+ 546 4722 a 546 4722
+a
+SDict begin H.S end
+ 546 4722 a 546 4722 a
+SDict begin 13 H.A end
+ 546 4722 a 546 4722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4098) cvn H.B /DEST pdfmark
+end
+ 546 4722
+a 20 w Fx(--c)o(hr)l(oot=)p Ff(<)p Fx(ar)m(g)p Ff(>)e
+FC(Chroot)h(to)h(to)h(the)f(directory)2016 4722 y
+SDict begin H.S end
+ 2016
+4722 a 2016 4722 a
+SDict begin 13 H.A end
+ 2016 4722 a 2016 4722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4099) cvn H.B /DEST pdfmark
+end
+ 2016 4722
+a Fx(ar)m(g)g FC(\(should)f(be)h(an)h(absolute)e(path.)-2
+4740 y
+SDict begin H.S end
+ -2 4740 a -2 4740 a
+SDict begin 13 H.A end
+ -2 4740 a -2 4740 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4100) cvn H.B /DEST pdfmark
+end
+ -2 4740
+a Black 463 4872 a FC(4.)p Black 546 4872 a
+SDict begin H.S end
+ 546 4872
+a 546 4872 a
+SDict begin 13 H.A end
+ 546 4872 a 546 4872 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4101) cvn H.B /DEST pdfmark
+end
+ 546 4872 a 546 4872
+a
+SDict begin H.S end
+ 546 4872 a 546 4872 a
+SDict begin 13 H.A end
+ 546 4872 a 546 4872 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4102) cvn H.B /DEST pdfmark
+end
+ 546 4872
+a Fx(-G,)h(--g)o(en-passwor)m(d)g FC(Generate)f(a)i(random)d(passw)o
+(ord)i(suitable)g(for)f(use)i(in)f(the)g(follo)n(wing)f(option)g(\(16)
+546 4980 y(he)o(xadecimal)f(digits\).)-2 4998 y
+SDict begin H.S end
+ -2 4998
+a -2 4998 a
+SDict begin 13 H.A end
+ -2 4998 a -2 4998 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4103) cvn H.B /DEST pdfmark
+end
+ -2 4998 a Black 463 5129
+a FC(5.)p Black 546 5129 a
+SDict begin H.S end
+ 546 5129 a 546 5129 a
+SDict begin 13 H.A end
+ 546
+5129 a 546 5129 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4104) cvn H.B /DEST pdfmark
+end
+ 546 5129 a 546 5129 a
+SDict begin H.S end
+ 546 5129 a 546
+5129 a
+SDict begin 13 H.A end
+ 546 5129 a 546 5129 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4105) cvn H.B /DEST pdfmark
+end
+ 546 5129 a Fx(-P)i Ff(<)p
+Fx(ar)m(g)p Ff(>)p Fx(,)f(--passwor)m(d=)p Ff(<)p Fx(ar)m(g)p
+Ff(>)e FC(Compute)j(a)g(client)g(re)o(gistry)g(entry)-5
+b(.)2684 5129 y
+SDict begin H.S end
+ 2684 5129 a 2684 5129 a
+SDict begin 13 H.A end
+ 2684 5129 a 2684
+5129 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4106) cvn H.B /DEST pdfmark
+end
+ 2684 5129 a Fx(ar)m(g)20 b FC(is)h(the)g(chosen)e(passw)o(ord)g
+(\(16)546 5237 y(he)o(xadecimal)f(digits\).)p Black 3620
+5805 a Fx(112)p Black eop end
+%%Page: 113 118
+TeXDict begin 113 117 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.113) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:THE-CONFIGURATION-FILE) cvn
+H.B /DEST pdfmark end
+ -2 226 a 125 x
+Fz(Appendix)48 b(C.)g(List)g(of)g(con\002guration)h(\002le)f(options)
+3680 351 y
+SDict begin H.S end
+ 3680 351 a 3680 351 a
+SDict begin 26.957 H.A end
+ 3680 351 a 3680 351
+a
+SDict begin [ /View [/XYZ H.V] /Dest (16.0) cvn H.B /DEST pdfmark end
+ 3680 351 a -2 443 a
+SDict begin H.S end
+ -2 443 a -2 443 a
+SDict begin 13 H.A end
+ -2 443 a -2 443
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGFILE) cvn H.B /DEST pdfmark
+end
+ -2 443 a 339 x Fu(C.1.)39 b(General)837 782 y
+SDict begin H.S end
+ 837 782
+a 837 782 a
+SDict begin 22.464 H.A end
+ 837 782 a 837 782 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.82.1) cvn H.B /DEST pdfmark
+end
+ 837 782 a -2 950 a
+SDict begin H.S end
+ -2
+950 a -2 950 a
+SDict begin 13 H.A end
+ -2 950 a -2 950 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4111) cvn H.B /DEST pdfmark
+end
+ -2 950 a 396 1056 a
+FC(The)20 b(con\002guration)e(\002le)i(for)1254 1056
+y
+SDict begin H.S end
+ 1254 1056 a 1254 1056 a
+SDict begin 13 H.A end
+ 1254 1056 a 1254 1056 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4112) cvn H.B /DEST pdfmark
+end
+ 1254
+1056 a FC(samhain)g(is)h(named)1870 1056 y
+SDict begin H.S end
+ 1870 1056
+a 1870 1056 a
+SDict begin 13 H.A end
+ 1870 1056 a 1870 1056 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4113) cvn H.B /DEST pdfmark
+end
+ 1870 1056 a Fr(samhainrc)e
+FC(by)h(def)o(ault.)f(Also)i(by)e(def)o(ault,)h(it)g(is)i(placed)d(in)
+396 1164 y
+SDict begin H.S end
+ 396 1164 a 396 1164 a
+SDict begin 13 H.A end
+ 396 1164 a 396 1164
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4114) cvn H.B /DEST pdfmark
+end
+ 396 1164 a Fr(/etc)p FC(.)h(\(Name)g(and)f(location)h(is)h
+(con\002gurable)d(at)i(compile)f(time\).)h(The)g(distrib)n(ution)f
+(package)g(comes)h(with)g(a)396 1272 y(commented)e(sample)i
+(con\002guration)e(\002le.)-2 1456 y
+SDict begin H.S end
+ -2 1456 a -2 1456
+a
+SDict begin 13 H.A end
+ -2 1456 a -2 1456 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4115) cvn H.B /DEST pdfmark
+end
+ -2 1456 a 396 1546 a FC(This)j(section)f
+(introduces)e(the)i(general)f(structure)h(of)g(the)g(con\002guration)d
+(\002le.)k(Details)g(on)f(indi)n(vidual)e(entries)i(in)396
+1654 y(the)g(con\002guration)e(\002les)j(are)f(discussed)g(in)p
+0 TeXcolorgray 1688 1654 a
+SDict begin H.S end
+ 1688 1654 a FC(Section)f(5.4)2062
+1654 y
+SDict begin 13 H.L end
+ 2062 1654 a 2062 1654 a
+SDict begin [ /Subtype /Link /Dest (0:FILEDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2062 1654 a Black -1 w
+FC(>)i(\(which)e(\002les)i(to)g(monitor\),)p 0 TeXcolorgray
+2957 1654 a
+SDict begin H.S end
+ 2957 1654 a FC(Section)e(4.1)3331 1654 y
+SDict begin 13 H.L end
+
+3331 1654 a 3331 1654 a
+SDict begin [ /Subtype /Link /Dest (0:LOGDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 3331 1654 a Black -1 w FC(>)i(\(what)396
+1762 y(should)e(be)i(logged,)d(which)i(logging)e(f)o(acilities)j
+(should)e(be)h(used,)g(and)g(ho)n(w)f(these)i(f)o(acilities)g(are)f
+(properly)396 1870 y(con\002gured\),)e(and)p 0 TeXcolorgray
+961 1870 a
+SDict begin H.S end
+ 961 1870 a FC(Section)i(5.11)1378 1870 y
+SDict begin 13 H.L end
+ 1378
+1870 a 1378 1870 a
+SDict begin [ /Subtype /Link /Dest (0:MONDEF) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1378 1870 a Black -2 w FC(>)h(\(monitoring)c
+(login/logout)h(e)n(v)o(ents\).)-2 2054 y
+SDict begin H.S end
+ -2 2054 a -2
+2054 a
+SDict begin 13 H.A end
+ -2 2054 a -2 2054 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4119) cvn H.B /DEST pdfmark
+end
+ -2 2054 a 396 2144 a FC(The)i
+(con\002guration)e(\002le)i(contains)g(se)n(v)o(eral)1686
+2144 y
+SDict begin H.S end
+ 1686 2144 a 1686 2144 a
+SDict begin 13 H.A end
+ 1686 2144 a 1686 2144
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4120) cvn H.B /DEST pdfmark
+end
+ 1686 2144 a Fx(sections)p FC(,)g(indicated)g(by)2424
+2144 y
+SDict begin H.S end
+ 2424 2144 a 2424 2144 a
+SDict begin 13 H.A end
+ 2424 2144 a 2424 2144
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4121) cvn H.B /DEST pdfmark
+end
+ 2424 2144 a Fx(headings)f FC(in)2830 2144 y
+SDict begin H.S end
+ 2830 2144
+a 2830 2144 a
+SDict begin 13 H.A end
+ 2830 2144 a 2830 2144 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4122) cvn H.B /DEST pdfmark
+end
+ 2830 2144 a Fx(squar)m(e)h(br)o
+(ac)n(k)o(ets)p FC(.)g(Each)396 2252 y(section)g(may)g(hold)f(zero)h
+(or)g(more)1429 2252 y
+SDict begin H.S end
+ 1429 2252 a 1429 2252 a
+SDict begin 13 H.A end
+ 1429 2252
+a 1429 2252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4123) cvn H.B /DEST pdfmark
+end
+ 1429 2252 a Fy(k)o(ey=)1600 2252 y
+SDict begin H.S end
+ 1600
+2252 a 1600 2252 a
+SDict begin 13 H.A end
+ 1600 2252 a 1600 2252 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4124) cvn H.B /DEST pdfmark
+end
+ 1600 2252
+a Fl(value)g FC(pairs.)g(K)n(e)o(ys)g(are)h(not)e(case)i(sensiti)n(v)o
+(e,)f(and)f(space)i(around)d(the)396 2360 y('=')i(is)h(allo)n(wed.)f
+(Blank)g(lines)g(and)g(lines)g(starting)g(with)h('#')e(are)h(comments.)
+f(Ev)o(erything)f(before)g(the)j(\002rst)396 2468 y(section)f(and)g
+(after)g(an)1065 2468 y
+SDict begin H.S end
+ 1065 2468 a 1065 2468 a
+SDict begin 13 H.A end
+ 1065
+2468 a 1065 2468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4125) cvn H.B /DEST pdfmark
+end
+ 1065 2468 a Fy([EOF])g FC(is)h(ignored.)d(The)1833
+2468 y
+SDict begin H.S end
+ 1833 2468 a 1833 2468 a
+SDict begin 13 H.A end
+ 1833 2468 a 1833 2468
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4126) cvn H.B /DEST pdfmark
+end
+ 1833 2468 a Fy([EOF])h FC(end-of-\002le)g(mark)o(er)g(is)i(optional.)
+d(The)i(\002le)h(thus)f(looks)396 2575 y(lik)o(e:)-2
+2659 y
+SDict begin H.S end
+ -2 2659 a -2 2659 a
+SDict begin 11.7 H.A end
+ -2 2659 a -2 2659 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4127) cvn H.B /DEST pdfmark
+end
+ -2 2659
+a 486 2756 a Fr(#)45 b(this)f(is)g(a)h(comment)486 2853
+y([Section)e(heading])486 2950 y(key1=value)486 3047
+y(key2=value)486 3241 y([Another)g(section])486 3338
+y(key3=value)486 3436 y(key4=value)-2 3613 y
+SDict begin H.S end
+ -2 3613
+a -2 3613 a
+SDict begin 13 H.A end
+ -2 3613 a -2 3613 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4128) cvn H.B /DEST pdfmark
+end
+ -2 3613 a 396 3710 a
+FC(F)o(or)20 b(boolean)f(v)n(alues)g(the)i(follo)n(wing)d(are)i(equi)n
+(v)n(alent)f(\(case-insensiti)n(v)o(e\):)f(T)m(rue,)i(Y)-8
+b(es,)20 b(or)g(1.)g(Lik)o(e)n(wise,)g(the)396 3817 y(follo)n(wing)f
+(are)h(equi)n(v)n(alent)e(\(case-insensiti)n(v)o(e\):)h(F)o(alse,)h
+(No,)g(or)g(0.)-2 4001 y
+SDict begin H.S end
+ -2 4001 a -2 4001 a
+SDict begin 13 H.A end
+ -2 4001
+a -2 4001 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4129) cvn H.B /DEST pdfmark
+end
+ -2 4001 a 396 4091 a FC(In)g(lists,)i(v)n(alues)d(can)h(be)
+g(separated)g(by)f(space,)h(tabs,)h(or)f(commas.)-2 4109
+y
+SDict begin H.S end
+ -2 4109 a -2 4109 a
+SDict begin 11.7 H.A end
+ -2 4109 a -2 4109 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4130) cvn H.B /DEST pdfmark
+end
+ -2 4109 a -2
+4234 a
+SDict begin H.S end
+ -2 4234 a -2 4234 a
+SDict begin 11.7 H.A end
+ -2 4234 a -2 4234 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4132) cvn H.B /DEST pdfmark
+end
+ -2 4234
+a 562 4313 a Fw(TIP:)g Fv(Each)g(section)g(ma)n(y)g(occur)h(m)o
+(ultiple)d(times)o(.)39 4452 y
+SDict begin H.S end
+ 39 4452 a 39 4452 a
+SDict begin 11.7 H.A end
+ 39
+4452 a 39 4452 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4133) cvn H.B /DEST pdfmark
+end
+ 39 4452 a -2 4618 a
+SDict begin H.S end
+ -2 4618 a -2 4618
+a
+SDict begin 11.7 H.A end
+ -2 4618 a -2 4618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4135) cvn H.B /DEST pdfmark
+end
+ -2 4618 a 562 4715 a Fw(NO)m(TE:)i
+Fv(Y)-10 b(ou)19 b(can)g(e)n(xplicitely)f(end)h(the)g(con\002gur)o
+(ation)e(\002le)j(with)f(an)2525 4715 y
+SDict begin H.S end
+ 2525 4715 a 2525
+4715 a
+SDict begin 11.7 H.A end
+ 2525 4715 a 2525 4715 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4136) cvn H.B /DEST pdfmark
+end
+ 2525 4715 a Fw([EOF])h
+Fv(\(on)f(a)h(separ)o(ate)e(line\),)g(b)o(ut)h(this)g(is)562
+4812 y(not)h(required,)e(unless)h(there)g(is)i(junk)f(be)o(y)o(ond.)39
+4962 y
+SDict begin H.S end
+ 39 4962 a 39 4962 a
+SDict begin 13 H.A end
+ 39 4962 a 39 4962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONDITIONALS) cvn H.B /DEST
+pdfmark end
+ 39 4962
+a Black 3620 5805 a Fx(113)p Black eop end
+%%Page: 114 119
+TeXDict begin 114 118 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.114) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4174) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black 396 313 a Fp(C.1.1.)35 b(Conditionals)1470 313
+y
+SDict begin H.S end
+ 1470 313 a 1470 313 a
+SDict begin 18.72 H.A end
+ 1470 313 a 1470 313 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.82.52.2) cvn H.B /DEST pdfmark
+end
+ 1470 313
+a -2 480 a
+SDict begin H.S end
+ -2 480 a -2 480 a
+SDict begin 13 H.A end
+ -2 480 a -2 480 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4139) cvn H.B /DEST pdfmark
+end
+ -2 480
+a 396 587 a FC(Conditional)19 b(inclusion)g(of)h(entries)g(for)g(some)g
+(host\(s\))g(is)h(supported)d(via)i(an)o(y)g(number)e(of)i
+(@hostname/@end)396 695 y(directi)n(v)o(es.)f(@hostname)h(and)f(@end)h
+(must)h(each)e(be)i(on)e(separate)h(lines.)g(Lines)h(in)f(between)f
+(will)i(only)f(be)g(read)396 803 y(if)468 803 y
+SDict begin H.S end
+ 468 803
+a 468 803 a
+SDict begin 13 H.A end
+ 468 803 a 468 803 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4140) cvn H.B /DEST pdfmark
+end
+ 468 803 a Fx(hostname)f
+FC(\(which)g(may)h(be)g(a)g(re)o(gular)f(e)o(xpression\))f(matches)i
+(the)g(local)h(host.)-2 987 y
+SDict begin H.S end
+ -2 987 a -2 987 a
+SDict begin 13 H.A end
+ -2 987
+a -2 987 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4141) cvn H.B /DEST pdfmark
+end
+ -2 987 a 396 1077 a FC(Lik)o(e)n(wise,)f(conditional)f
+(inclusion)g(of)h(entries)g(based)g(on)f(system)i(type)e(is)j
+(supported)c(via)i(an)o(y)f(number)g(of)396 1185 y
+($sysname:release:machine/$end)d(directi)n(v)o(es.)1848
+1185 y
+SDict begin H.S end
+ 1848 1185 a 1848 1185 a
+SDict begin 13 H.A end
+ 1848 1185 a 1848 1185
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4142) cvn H.B /DEST pdfmark
+end
+ 1848 1185 a Fx(sysname:r)m(elease:mac)o(hine)h FC(for)i(the)i(local)f
+(host)g(can)g(be)396 1293 y(determined)f(using)g(the)h(command)1462
+1293 y
+SDict begin H.S end
+ 1462 1293 a 1462 1293 a
+SDict begin 13 H.A end
+ 1462 1293 a 1462 1293
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4143) cvn H.B /DEST pdfmark
+end
+ 1462 1293 a Fy(uname)g(-srm)h FC(and)f(may)f(be)h(a)h(re)o(gular)e(e)
+o(xpression.)-2 1477 y
+SDict begin H.S end
+ -2 1477 a -2 1477 a
+SDict begin 13 H.A end
+ -2 1477 a
+-2 1477 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4144) cvn H.B /DEST pdfmark
+end
+ -2 1477 a 396 1567 a FC(A)477 1567 y
+SDict begin H.S end
+ 477 1567
+a 477 1567 a
+SDict begin 13 H.A end
+ 477 1567 a 477 1567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4145) cvn H.B /DEST pdfmark
+end
+ 477 1567 a Fy('!')h
+FC(in)g(front)f(of)h(the)1060 1567 y
+SDict begin H.S end
+ 1060 1567 a 1060
+1567 a
+SDict begin 13 H.A end
+ 1060 1567 a 1060 1567 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4146) cvn H.B /DEST pdfmark
+end
+ 1060 1567 a Fy('@'/'\\$')f
+FC(will)i(in)m(v)o(ert)e(its)j(meaning.)c(Conditionals)h(may)h(be)g
+(nested)g(up)g(to)g(15)g(le)n(v)o(els.)-2 1668 y
+SDict begin H.S end
+ -2 1668
+a -2 1668 a
+SDict begin 11.7 H.A end
+ -2 1668 a -2 1668 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4147) cvn H.B /DEST pdfmark
+end
+ -2 1668 a 486 1747 a
+Fr(@hostname)486 1844 y(#)45 b(only)f(read)g(if)g(hostname)g(matches)g
+(local)g(host)486 1941 y(@end)486 2038 y(!@hostname)486
+2135 y(#)h(not)f(read)g(if)h(hostname)e(matches)h(local)g(host)486
+2232 y(@end)486 2329 y(#)486 2427 y($sysname:release:machine)486
+2524 y(#)h(only)f(read)g(if)g(sysname:release:machine)d(matches)j
+(local)g(host)486 2621 y($end)486 2718 y(!$sysname:release:machine)486
+2815 y(#)h(not)f(read)g(if)h(sysname:release:machine)c(matches)88
+b(local)44 b(host)486 2912 y($end)-2 3087 y
+SDict begin H.S end
+ -2 3087 a
+-2 3087 a
+SDict begin 13 H.A end
+ -2 3087 a -2 3087 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:FILES-TO-CHECK) cvn H.B /DEST
+pdfmark end
+ -2 3087 a 368 x Fu(C.2.)39
+b(Files)g(to)g(c)o(hec)m(k)1247 3455 y
+SDict begin H.S end
+ 1247 3455 a 1247
+3455 a
+SDict begin 22.464 H.A end
+ 1247 3455 a 1247 3455 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.83.1) cvn H.B /DEST pdfmark
+end
+ 1247 3455 a -2 3623 a
+SDict begin H.S end
+
+-2 3623 a -2 3623 a
+SDict begin 13 H.A end
+ -2 3623 a -2 3623 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4150) cvn H.B /DEST pdfmark
+end
+ -2 3623 a 396
+3729 a FC(Allo)n(wed)20 b(section)g(headings)f(\(see)p
+0 TeXcolorgray 1427 3729 a
+SDict begin H.S end
+ 1427 3729 a FC(Section)h(5.4.1)1865
+3729 y
+SDict begin 13 H.L end
+ 1865 3729 a 1865 3729 a
+SDict begin [ /Subtype /Link /Dest (0:POLICY) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1865 3729 a Black -2 w
+FC(>)h(for)e(more)h(details\))g(are:)-2 3913 y
+SDict begin H.S end
+ -2 3913
+a -2 3913 a
+SDict begin 13 H.A end
+ -2 3913 a -2 3913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4152) cvn H.B /DEST pdfmark
+end
+ -2 3913 a -2 3913 a
+SDict begin H.S end
+ -2
+3913 a -2 3913 a
+SDict begin 13 H.A end
+ -2 3913 a -2 3913 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4153) cvn H.B /DEST pdfmark
+end
+ -2 3913 a 396 4003
+a Fy([Attrib)n(utes])p FC(,)856 4003 y
+SDict begin H.S end
+ 856 4003 a 856
+4003 a
+SDict begin 13 H.A end
+ 856 4003 a 856 4003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4154) cvn H.B /DEST pdfmark
+end
+ 856 4003 a Fy([LogFiles])p
+FC(,)1257 4003 y
+SDict begin H.S end
+ 1257 4003 a 1257 4003 a
+SDict begin 13 H.A end
+ 1257 4003 a
+1257 4003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4155) cvn H.B /DEST pdfmark
+end
+ 1257 4003 a Fy([Gr)o(o)o(wingLogFiles])p
+FC(,)1970 4003 y
+SDict begin H.S end
+ 1970 4003 a 1970 4003 a
+SDict begin 13 H.A end
+ 1970 4003 a
+1970 4003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4156) cvn H.B /DEST pdfmark
+end
+ 1970 4003 a Fy([Ignor)o(eAll])p FC(,)2406
+4003 y
+SDict begin H.S end
+ 2406 4003 a 2406 4003 a
+SDict begin 13 H.A end
+ 2406 4003 a 2406 4003
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4157) cvn H.B /DEST pdfmark
+end
+ 2406 4003 a Fy([Ignor)o(eNone])p FC(,)2921 4003 y
+SDict begin H.S end
+ 2921
+4003 a 2921 4003 a
+SDict begin 13 H.A end
+ 2921 4003 a 2921 4003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4158) cvn H.B /DEST pdfmark
+end
+ 2921 4003
+a Fy([ReadOnly])p FC(,)3378 4003 y
+SDict begin H.S end
+ 3378 4003 a 3378 4003
+a
+SDict begin 13 H.A end
+ 3378 4003 a 3378 4003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4159) cvn H.B /DEST pdfmark
+end
+ 3378 4003 a Fy([User0])p FC(,)396
+4111 y
+SDict begin H.S end
+ 396 4111 a 396 4111 a
+SDict begin 13 H.A end
+ 396 4111 a 396 4111 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4160) cvn H.B /DEST pdfmark
+end
+ 396
+4111 a Fy([User1])p FC(,)g(and)841 4111 y
+SDict begin H.S end
+ 841 4111 a
+841 4111 a
+SDict begin 13 H.A end
+ 841 4111 a 841 4111 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4161) cvn H.B /DEST pdfmark
+end
+ 841 4111 a Fy([Pr)o(elink])-2
+4290 y
+SDict begin H.S end
+ -2 4290 a -2 4290 a
+SDict begin 13 H.A end
+ -2 4290 a -2 4290 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4162) cvn H.B /DEST pdfmark
+end
+ -2 4290
+a 396 4385 a FC(Placing)g(an)g(entry)g(under)e(one)i(of)g(these)g
+(headings)f(will)i(select)g(the)f(respecti)n(v)o(e)f(polic)o(y)g(for)h
+(that)g(entry)f(\(see)p 0 TeXcolorgray 396 4493 a
+SDict begin H.S end
+ 396
+4493 a FC(Section)h(5.4.1)834 4493 y
+SDict begin 13 H.L end
+ 834 4493 a 834 4493
+a
+SDict begin [ /Subtype /Link /Dest (0:POLICY) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 834 4493 a Black -2 w FC(>\).)g(Entries)g(under)f(the)h(abo)o(v)o(e)f
+(section)h(headings)e(must)j(be)f(of)g(the)g(form:)-2
+4677 y
+SDict begin H.S end
+ -2 4677 a -2 4677 a
+SDict begin 13 H.A end
+ -2 4677 a -2 4677 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4164) cvn H.B /DEST pdfmark
+end
+ -2 4677
+a -2 4677 a
+SDict begin H.S end
+ -2 4677 a -2 4677 a
+SDict begin 13 H.A end
+ -2 4677 a -2 4677 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4165) cvn H.B /DEST pdfmark
+end
+ -2
+4677 a 396 4767 a Fy(dir=)549 4767 y
+SDict begin H.S end
+ 549 4767 a 549 4767
+a
+SDict begin 13 H.A end
+ 549 4767 a 549 4767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4166) cvn H.B /DEST pdfmark
+end
+ 549 4767 a Fl([optional)44 b(numerical)f
+(recursion)h(depth]path)-2 4943 y
+SDict begin H.S end
+ -2 4943 a -2 4943 a
+SDict begin 13 H.A end
+
+-2 4943 a -2 4943 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4167) cvn H.B /DEST pdfmark
+end
+ -2 4943 a -2 4943 a
+SDict begin H.S end
+ -2 4943 a -2
+4943 a
+SDict begin 13 H.A end
+ -2 4943 a -2 4943 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4168) cvn H.B /DEST pdfmark
+end
+ -2 4943 a 396 5041 a Fy(\002le=)549
+5041 y
+SDict begin H.S end
+ 549 5041 a 549 5041 a
+SDict begin 13 H.A end
+ 549 5041 a 549 5041 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4169) cvn H.B /DEST pdfmark
+end
+ 549
+5041 a Fl(path)-2 5062 y
+SDict begin H.S end
+ -2 5062 a -2 5062 a
+SDict begin 13 H.A end
+ -2 5062
+a -2 5062 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SEVERITY-OF-EVENTS) cvn H.B
+/DEST pdfmark end
+ -2 5062 a Black 3620 5805 a Fx(114)p Black
+eop end
+%%Page: 115 120
+TeXDict begin 115 119 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.115) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4222) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 330 a Fu(C.3.)39 b(Se)n(verity)f(of)h(e)n(vents)1526
+330 y
+SDict begin H.S end
+ 1526 330 a 1526 330 a
+SDict begin 22.464 H.A end
+ 1526 330 a 1526 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.84.1) cvn H.B /DEST pdfmark
+end
+ 1526
+330 a -2 526 a
+SDict begin H.S end
+ -2 526 a -2 526 a
+SDict begin 13 H.A end
+ -2 526 a -2 526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4172) cvn H.B /DEST pdfmark
+end
+ -2
+526 a 396 604 a FC(Section)20 b(heading)f(\(see)p 0 TeXcolorgray
+1104 604 a
+SDict begin H.S end
+ 1104 604 a FC(Section)h(4.1.1)1542 604 y
+SDict begin 13 H.L end
+ 1542
+604 a 1542 604 a
+SDict begin [ /Subtype /Link /Dest (0:SEVERITYDEF) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1542 604 a Black -2 w FC(>)h(for)e(more)g(details\):)
+396 878 y Fy([Ev)o(entSe)o(v)o(erity])-2 1061 y
+SDict begin H.S end
+ -2 1061
+a -2 1061 a
+SDict begin 13 H.A end
+ -2 1061 a -2 1061 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4176) cvn H.B /DEST pdfmark
+end
+ -2 1061 a 396 1152 a
+FC(Entries:)-2 1319 y
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319 a -2
+1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4177) cvn H.B /DEST pdfmark
+end
+ -2 1319 a -2 1319 a
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319
+a -2 1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4178) cvn H.B /DEST pdfmark
+end
+ -2 1319 a 396 1426 a Fy(Se)o(v)o(erityReadOnly=)1094
+1426 y
+SDict begin H.S end
+ 1094 1426 a 1094 1426 a
+SDict begin 13 H.A end
+ 1094 1426 a 1094 1426
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4179) cvn H.B /DEST pdfmark
+end
+ 1094 1426 a Fl(severity)-2 1609 y
+SDict begin H.S end
+ -2 1609 a -2 1609
+a
+SDict begin 13 H.A end
+ -2 1609 a -2 1609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4180) cvn H.B /DEST pdfmark
+end
+ -2 1609 a -2 1609 a
+SDict begin H.S end
+ -2 1609 a -2
+1609 a
+SDict begin 13 H.A end
+ -2 1609 a -2 1609 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4181) cvn H.B /DEST pdfmark
+end
+ -2 1609 a 396 1700 a Fy(Se)o(v)o
+(erityLogFiles=)1038 1700 y
+SDict begin H.S end
+ 1038 1700 a 1038 1700 a
+SDict begin 13 H.A end
+ 1038
+1700 a 1038 1700 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4182) cvn H.B /DEST pdfmark
+end
+ 1038 1700 a Fl(severity)-2 1883 y
+SDict begin H.S end
+
+-2 1883 a -2 1883 a
+SDict begin 13 H.A end
+ -2 1883 a -2 1883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4183) cvn H.B /DEST pdfmark
+end
+ -2 1883 a -2
+1883 a
+SDict begin H.S end
+ -2 1883 a -2 1883 a
+SDict begin 13 H.A end
+ -2 1883 a -2 1883 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4184) cvn H.B /DEST pdfmark
+end
+ -2 1883
+a 396 1974 a Fy(Se)o(v)o(erityGr)o(o)o(wingLogs=)1217
+1974 y
+SDict begin H.S end
+ 1217 1974 a 1217 1974 a
+SDict begin 13 H.A end
+ 1217 1974 a 1217 1974
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4185) cvn H.B /DEST pdfmark
+end
+ 1217 1974 a Fl(severity)-2 2157 y
+SDict begin H.S end
+ -2 2157 a -2 2157
+a
+SDict begin 13 H.A end
+ -2 2157 a -2 2157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4186) cvn H.B /DEST pdfmark
+end
+ -2 2157 a -2 2157 a
+SDict begin H.S end
+ -2 2157 a -2
+2157 a
+SDict begin 13 H.A end
+ -2 2157 a -2 2157 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4187) cvn H.B /DEST pdfmark
+end
+ -2 2157 a 396 2248 a Fy(Se)o(v)o(erityIgnor)
+o(eNone=)1153 2248 y
+SDict begin H.S end
+ 1153 2248 a 1153 2248 a
+SDict begin 13 H.A end
+ 1153 2248
+a 1153 2248 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4188) cvn H.B /DEST pdfmark
+end
+ 1153 2248 a Fl(severity)-2 2431 y
+SDict begin H.S end
+ -2 2431
+a -2 2431 a
+SDict begin 13 H.A end
+ -2 2431 a -2 2431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4189) cvn H.B /DEST pdfmark
+end
+ -2 2431 a -2 2431 a
+SDict begin H.S end
+ -2
+2431 a -2 2431 a
+SDict begin 13 H.A end
+ -2 2431 a -2 2431 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4190) cvn H.B /DEST pdfmark
+end
+ -2 2431 a 396 2522
+a Fy(Se)o(v)o(erityIgnor)o(eAll=)1074 2522 y
+SDict begin H.S end
+ 1074 2522
+a 1074 2522 a
+SDict begin 13 H.A end
+ 1074 2522 a 1074 2522 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4191) cvn H.B /DEST pdfmark
+end
+ 1074 2522 a Fl(severity)-2
+2705 y
+SDict begin H.S end
+ -2 2705 a -2 2705 a
+SDict begin 13 H.A end
+ -2 2705 a -2 2705 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4192) cvn H.B /DEST pdfmark
+end
+ -2 2705
+a -2 2705 a
+SDict begin H.S end
+ -2 2705 a -2 2705 a
+SDict begin 13 H.A end
+ -2 2705 a -2 2705 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4193) cvn H.B /DEST pdfmark
+end
+ -2
+2705 a 396 2796 a Fy(Se)o(v)o(erityAttrib)n(utes=)1096
+2796 y
+SDict begin H.S end
+ 1096 2796 a 1096 2796 a
+SDict begin 13 H.A end
+ 1096 2796 a 1096 2796
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4194) cvn H.B /DEST pdfmark
+end
+ 1096 2796 a Fl(severity)-2 2979 y
+SDict begin H.S end
+ -2 2979 a -2 2979
+a
+SDict begin 13 H.A end
+ -2 2979 a -2 2979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4195) cvn H.B /DEST pdfmark
+end
+ -2 2979 a -2 2979 a
+SDict begin H.S end
+ -2 2979 a -2
+2979 a
+SDict begin 13 H.A end
+ -2 2979 a -2 2979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4196) cvn H.B /DEST pdfmark
+end
+ -2 2979 a 396 3070 a Fy(Se)o(v)o
+(erityUser0=)941 3070 y
+SDict begin H.S end
+ 941 3070 a 941 3070 a
+SDict begin 13 H.A end
+ 941 3070
+a 941 3070 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4197) cvn H.B /DEST pdfmark
+end
+ 941 3070 a Fl(severity)-2 3253 y
+SDict begin H.S end
+ -2 3253
+a -2 3253 a
+SDict begin 13 H.A end
+ -2 3253 a -2 3253 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4198) cvn H.B /DEST pdfmark
+end
+ -2 3253 a -2 3253 a
+SDict begin H.S end
+ -2
+3253 a -2 3253 a
+SDict begin 13 H.A end
+ -2 3253 a -2 3253 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4199) cvn H.B /DEST pdfmark
+end
+ -2 3253 a 396 3344
+a Fy(Se)o(v)o(erityUser1=)941 3344 y
+SDict begin H.S end
+ 941 3344 a 941 3344
+a
+SDict begin 13 H.A end
+ 941 3344 a 941 3344 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4200) cvn H.B /DEST pdfmark
+end
+ 941 3344 a Fl(severity)-2 3527
+y
+SDict begin H.S end
+ -2 3527 a -2 3527 a
+SDict begin 13 H.A end
+ -2 3527 a -2 3527 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4201) cvn H.B /DEST pdfmark
+end
+ -2 3527 a -2
+3527 a
+SDict begin H.S end
+ -2 3527 a -2 3527 a
+SDict begin 13 H.A end
+ -2 3527 a -2 3527 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4202) cvn H.B /DEST pdfmark
+end
+ -2 3527
+a 396 3618 a Fy(Se)o(v)o(erityPr)o(elink=)995 3618 y
+SDict begin H.S end
+
+995 3618 a 995 3618 a
+SDict begin 13 H.A end
+ 995 3618 a 995 3618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4203) cvn H.B /DEST pdfmark
+end
+ 995 3618
+a Fl(severity)-2 3801 y
+SDict begin H.S end
+ -2 3801 a -2 3801 a
+SDict begin 13 H.A end
+ -2 3801 a
+-2 3801 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4204) cvn H.B /DEST pdfmark
+end
+ -2 3801 a -2 3801 a
+SDict begin H.S end
+ -2 3801 a -2 3801 a
+SDict begin 13 H.A end
+ -2
+3801 a -2 3801 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4205) cvn H.B /DEST pdfmark
+end
+ -2 3801 a 396 3892 a Fy(Se)o(v)o(erityFiles=)899
+3892 y
+SDict begin H.S end
+ 899 3892 a 899 3892 a
+SDict begin 13 H.A end
+ 899 3892 a 899 3892 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4206) cvn H.B /DEST pdfmark
+end
+ 899
+3892 a Fl(severity)-2 4075 y
+SDict begin H.S end
+ -2 4075 a -2 4075 a
+SDict begin 13 H.A end
+ -2 4075
+a -2 4075 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4207) cvn H.B /DEST pdfmark
+end
+ -2 4075 a -2 4075 a
+SDict begin H.S end
+ -2 4075 a -2 4075 a
+SDict begin 13 H.A end
+ -2
+4075 a -2 4075 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4208) cvn H.B /DEST pdfmark
+end
+ -2 4075 a 396 4166 a Fy(Se)o(v)o(erityDirs=)885
+4166 y
+SDict begin H.S end
+ 885 4166 a 885 4166 a
+SDict begin 13 H.A end
+ 885 4166 a 885 4166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4209) cvn H.B /DEST pdfmark
+end
+ 885
+4166 a Fl(severity)-2 4349 y
+SDict begin H.S end
+ -2 4349 a -2 4349 a
+SDict begin 13 H.A end
+ -2 4349
+a -2 4349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4210) cvn H.B /DEST pdfmark
+end
+ -2 4349 a -2 4349 a
+SDict begin H.S end
+ -2 4349 a -2 4349 a
+SDict begin 13 H.A end
+ -2
+4349 a -2 4349 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4211) cvn H.B /DEST pdfmark
+end
+ -2 4349 a 396 4440 a Fy(Se)o(v)o(erityNames=)973
+4440 y
+SDict begin H.S end
+ 973 4440 a 973 4440 a
+SDict begin 13 H.A end
+ 973 4440 a 973 4440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4212) cvn H.B /DEST pdfmark
+end
+ 973
+4440 a Fl(severity)-2 4623 y
+SDict begin H.S end
+ -2 4623 a -2 4623 a
+SDict begin 13 H.A end
+ -2 4623
+a -2 4623 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4213) cvn H.B /DEST pdfmark
+end
+ -2 4623 a -2 4623 a
+SDict begin H.S end
+ -2 4623 a -2 4623 a
+SDict begin 13 H.A end
+ -2
+4623 a -2 4623 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4214) cvn H.B /DEST pdfmark
+end
+ -2 4623 a 396 4714 a Fx(se)o(verity)i
+FC(may)f(be)g(one)f(of)1167 4714 y
+SDict begin H.S end
+ 1167 4714 a 1167 4714
+a
+SDict begin 13 H.A end
+ 1167 4714 a 1167 4714 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4215) cvn H.B /DEST pdfmark
+end
+ 1167 4714 a Fy(none,)i(deb)n(ug,)f(inf)n(o,)g
+(notice,)g(war)o(n,)f(mark,)i(err)-8 b(,)20 b(crit,)g(alert)p
+FC(.)-2 4742 y
+SDict begin H.S end
+ -2 4742 a -2 4742 a
+SDict begin 13 H.A end
+ -2 4742 a -2 4742
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:LOGGING-THRESHOLDS) cvn H.B
+/DEST pdfmark end
+ -2 4742 a 359 x Fu(C.4.)39 b(Log)o(ging)e(thresholds)1641
+5101 y
+SDict begin H.S end
+ 1641 5101 a 1641 5101 a
+SDict begin 22.464 H.A end
+ 1641 5101 a 1641 5101
+a
+SDict begin [ /View [/XYZ H.V] /Dest (16.85.1) cvn H.B /DEST pdfmark
+end
+ 1641 5101 a -2 5299 a
+SDict begin H.S end
+ -2 5299 a -2 5299 a
+SDict begin 13 H.A end
+ -2 5299 a
+-2 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4218) cvn H.B /DEST pdfmark
+end
+ -2 5299 a 396 5375 a FC(Section)20 b(heading)f(\(see)p
+0 TeXcolorgray 1104 5375 a
+SDict begin H.S end
+ 1104 5375 a FC(Section)h(4.3)1479
+5375 y
+SDict begin 13 H.L end
+ 1479 5375 a 1479 5375 a
+SDict begin [ /Subtype /Link /Dest (0:THRESHOLDS) cvn /H /I /Border
+[0 0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 1479 5375 a Black -1 w
+FC(>)g(for)g(more)f(details\):)p Black 3620 5805 a Fx(115)p
+Black eop end
+%%Page: 116 121
+TeXDict begin 116 120 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.116) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4266) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4220) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4221) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy([Log])396 583 y FC(Entries:)-2 750
+y
+SDict begin H.S end
+ -2 750 a -2 750 a
+SDict begin 13 H.A end
+ -2 750 a -2 750 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4223) cvn H.B /DEST pdfmark
+end
+ -2 750 a -2 750
+a
+SDict begin H.S end
+ -2 750 a -2 750 a
+SDict begin 13 H.A end
+ -2 750 a -2 750 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4224) cvn H.B /DEST pdfmark
+end
+ -2 750 a 396 857
+a Fy(MailSe)o(v)o(erity=)899 857 y
+SDict begin H.S end
+ 899 857 a 899 857
+a
+SDict begin 13 H.A end
+ 899 857 a 899 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4225) cvn H.B /DEST pdfmark
+end
+ 899 857 a Fl(list)43 b(of)i([optional)e
+(specifier]threshold)-2 1040 y
+SDict begin H.S end
+ -2 1040 a -2 1040 a
+SDict begin 13 H.A end
+ -2
+1040 a -2 1040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4226) cvn H.B /DEST pdfmark
+end
+ -2 1040 a -2 1040 a
+SDict begin H.S end
+ -2 1040 a -2 1040
+a
+SDict begin 13 H.A end
+ -2 1040 a -2 1040 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4227) cvn H.B /DEST pdfmark
+end
+ -2 1040 a 396 1131 a Fy(PrintSe)o(v)o(erity=)918
+1131 y
+SDict begin H.S end
+ 918 1131 a 918 1131 a
+SDict begin 13 H.A end
+ 918 1131 a 918 1131 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4228) cvn H.B /DEST pdfmark
+end
+ 918
+1131 a Fl(list)g(of)h([optional)f(specifier]threshold)-2
+1314 y
+SDict begin H.S end
+ -2 1314 a -2 1314 a
+SDict begin 13 H.A end
+ -2 1314 a -2 1314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4229) cvn H.B /DEST pdfmark
+end
+ -2 1314
+a -2 1314 a
+SDict begin H.S end
+ -2 1314 a -2 1314 a
+SDict begin 13 H.A end
+ -2 1314 a -2 1314 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4230) cvn H.B /DEST pdfmark
+end
+ -2
+1314 a 396 1405 a Fy(LogSe)o(v)o(erity=)872 1405 y
+SDict begin H.S end
+ 872
+1405 a 872 1405 a
+SDict begin 13 H.A end
+ 872 1405 a 872 1405 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4231) cvn H.B /DEST pdfmark
+end
+ 872 1405 a Fl(list)g(of)h
+([optional)f(specifier]threshold)-2 1587 y
+SDict begin H.S end
+ -2 1587 a
+-2 1587 a
+SDict begin 13 H.A end
+ -2 1587 a -2 1587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4232) cvn H.B /DEST pdfmark
+end
+ -2 1587 a -2 1587 a
+SDict begin H.S end
+ -2
+1587 a -2 1587 a
+SDict begin 13 H.A end
+ -2 1587 a -2 1587 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4233) cvn H.B /DEST pdfmark
+end
+ -2 1587 a 396 1679
+a Fy(SyslogSe)o(v)o(erity=)960 1679 y
+SDict begin H.S end
+ 960 1679 a 960
+1679 a
+SDict begin 13 H.A end
+ 960 1679 a 960 1679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4234) cvn H.B /DEST pdfmark
+end
+ 960 1679 a Fl(list)f(of)j([optional)e
+(specifier]threshold)-2 1861 y
+SDict begin H.S end
+ -2 1861 a -2 1861 a
+SDict begin 13 H.A end
+ -2
+1861 a -2 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4235) cvn H.B /DEST pdfmark
+end
+ -2 1861 a -2 1861 a
+SDict begin H.S end
+ -2 1861 a -2 1861
+a
+SDict begin 13 H.A end
+ -2 1861 a -2 1861 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4236) cvn H.B /DEST pdfmark
+end
+ -2 1861 a 396 1953 a Fy(Pr)o(eludeSe)o(v)o
+(erity=)1009 1953 y
+SDict begin H.S end
+ 1009 1953 a 1009 1953 a
+SDict begin 13 H.A end
+ 1009 1953
+a 1009 1953 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4237) cvn H.B /DEST pdfmark
+end
+ 1009 1953 a Fl(list)f(of)j([optional)e
+(specifier]threshold)-2 2135 y
+SDict begin H.S end
+ -2 2135 a -2 2135 a
+SDict begin 13 H.A end
+ -2
+2135 a -2 2135 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4238) cvn H.B /DEST pdfmark
+end
+ -2 2135 a -2 2135 a
+SDict begin H.S end
+ -2 2135 a -2 2135
+a
+SDict begin 13 H.A end
+ -2 2135 a -2 2135 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4239) cvn H.B /DEST pdfmark
+end
+ -2 2135 a 396 2227 a Fy(ExportSe)o(v)o(erity=)983
+2227 y
+SDict begin H.S end
+ 983 2227 a 983 2227 a
+SDict begin 13 H.A end
+ 983 2227 a 983 2227 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4240) cvn H.B /DEST pdfmark
+end
+ 983
+2227 a Fl(list)f(of)j([optional)e(specifier]threshold)-2
+2409 y
+SDict begin H.S end
+ -2 2409 a -2 2409 a
+SDict begin 13 H.A end
+ -2 2409 a -2 2409 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4241) cvn H.B /DEST pdfmark
+end
+ -2 2409
+a -2 2409 a
+SDict begin H.S end
+ -2 2409 a -2 2409 a
+SDict begin 13 H.A end
+ -2 2409 a -2 2409 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4242) cvn H.B /DEST pdfmark
+end
+ -2
+2409 a 396 2500 a Fy(Exter)o(nalSe)o(v)o(erity=)1042
+2500 y
+SDict begin H.S end
+ 1042 2500 a 1042 2500 a
+SDict begin 13 H.A end
+ 1042 2500 a 1042 2500
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4243) cvn H.B /DEST pdfmark
+end
+ 1042 2500 a Fl(list)f(of)i([optional)g(specifier]threshold)-2
+2683 y
+SDict begin H.S end
+ -2 2683 a -2 2683 a
+SDict begin 13 H.A end
+ -2 2683 a -2 2683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4244) cvn H.B /DEST pdfmark
+end
+ -2 2683
+a -2 2683 a
+SDict begin H.S end
+ -2 2683 a -2 2683 a
+SDict begin 13 H.A end
+ -2 2683 a -2 2683 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4245) cvn H.B /DEST pdfmark
+end
+ -2
+2683 a 396 2774 a Fy(DatabaseSe)o(v)o(erity=)1062 2774
+y
+SDict begin H.S end
+ 1062 2774 a 1062 2774 a
+SDict begin 13 H.A end
+ 1062 2774 a 1062 2774 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4246) cvn H.B /DEST pdfmark
+end
+ 1062
+2774 a Fl(list)e(of)i([optional)f(specifier]threshold)-2
+2957 y
+SDict begin H.S end
+ -2 2957 a -2 2957 a
+SDict begin 13 H.A end
+ -2 2957 a -2 2957 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4247) cvn H.B /DEST pdfmark
+end
+ -2 2957
+a -2 2957 a
+SDict begin H.S end
+ -2 2957 a -2 2957 a
+SDict begin 13 H.A end
+ -2 2957 a -2 2957 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4248) cvn H.B /DEST pdfmark
+end
+ -2
+2957 a 396 3048 a Fx(thr)m(eshold)22 b FC(may)e(be)g(one)f(of)1223
+3048 y
+SDict begin H.S end
+ 1223 3048 a 1223 3048 a
+SDict begin 13 H.A end
+ 1223 3048 a 1223 3048
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4249) cvn H.B /DEST pdfmark
+end
+ 1223 3048 a Fy(none,)h(deb)n(ug,)h(inf)n(o,)f(notice,)g(war)o(n,)f
+(mark,)i(err)-8 b(,)20 b(crit,)g(alert)p FC(.)-2 3232
+y
+SDict begin H.S end
+ -2 3232 a -2 3232 a
+SDict begin 13 H.A end
+ -2 3232 a -2 3232 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4250) cvn H.B /DEST pdfmark
+end
+ -2 3232 a 396
+3322 a FC(The)g(optional)f(speci\002er)h(may)g(be)g(one)g(of)f('*',)h
+('!',)f(or)h('=',)g(which)f(are)i(interpreted)d(as)j('all',)f('e)o
+(xcluding',)d(and)396 3430 y('only',)i(respecti)n(v)o(ely)-5
+b(.)18 b(Examples:)h(specifying)g('*')g(is)i(equal)f(to)g(specify)g(')l
+(deb)n(ug';)e(specifying)g('!*')i(is)h(equal)e(to)396
+3538 y(specifying)g('none';)f('info,!alert')g(is)j(the)f(range)g(from)f
+('info')g(to)h('crit';)g(and)f('info,!=mark')e(is)k(info)f(and)f(abo)o
+(v)o(e,)396 3646 y(b)n(ut)h(e)o(xcluding)e('mark'.)-2
+3675 y
+SDict begin H.S end
+ -2 3675 a -2 3675 a
+SDict begin 13 H.A end
+ -2 3675 a -2 3675 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:WATCHING-LOGIN-LOGOUT-EVENTS)
+cvn H.B /DEST pdfmark end
+ -2 3675
+a 359 x Fu(C.5.)39 b(W)-6 b(atc)o(hing)38 b(login/logout)f(e)n(vents)
+2294 4034 y
+SDict begin H.S end
+ 2294 4034 a 2294 4034 a
+SDict begin 22.464 H.A end
+ 2294 4034 a 2294
+4034 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.86.1) cvn H.B /DEST pdfmark
+end
+ 2294 4034 a -2 4232 a
+SDict begin H.S end
+ -2 4232 a -2 4232 a
+SDict begin 13 H.A end
+ -2 4232
+a -2 4232 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4253) cvn H.B /DEST pdfmark
+end
+ -2 4232 a 396 4308 a FC(Section)20 b(heading:)-2
+4492 y
+SDict begin H.S end
+ -2 4492 a -2 4492 a
+SDict begin 13 H.A end
+ -2 4492 a -2 4492 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4254) cvn H.B /DEST pdfmark
+end
+ -2 4492
+a -2 4492 a
+SDict begin H.S end
+ -2 4492 a -2 4492 a
+SDict begin 13 H.A end
+ -2 4492 a -2 4492 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4255) cvn H.B /DEST pdfmark
+end
+ -2
+4492 a 396 4582 a Fy([Utmp])-2 4765 y
+SDict begin H.S end
+ -2 4765 a -2 4765
+a
+SDict begin 13 H.A end
+ -2 4765 a -2 4765 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4256) cvn H.B /DEST pdfmark
+end
+ -2 4765 a 396 4856 a FC(Entries:)-2
+5022 y
+SDict begin H.S end
+ -2 5022 a -2 5022 a
+SDict begin 13 H.A end
+ -2 5022 a -2 5022 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4257) cvn H.B /DEST pdfmark
+end
+ -2 5022
+a -2 5022 a
+SDict begin H.S end
+ -2 5022 a -2 5022 a
+SDict begin 13 H.A end
+ -2 5022 a -2 5022 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4258) cvn H.B /DEST pdfmark
+end
+ -2
+5022 a 396 5130 a Fy(LoginCheckActi)o(v)o(e=)1102 5130
+y
+SDict begin H.S end
+ 1102 5130 a 1102 5130 a
+SDict begin 13 H.A end
+ 1102 5130 a 1102 5130 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4259) cvn H.B /DEST pdfmark
+end
+ 1102
+5130 a Fl(boolean)g FC(\227)h('1')e(to)i(switch)f(on,)g('0')f(to)i
+(switch)f(of)n(f.)-2 5312 y
+SDict begin H.S end
+ -2 5312 a -2 5312 a
+SDict begin 13 H.A end
+ -2 5312
+a -2 5312 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4260) cvn H.B /DEST pdfmark
+end
+ -2 5312 a -2 5312 a
+SDict begin H.S end
+ -2 5312 a -2 5312 a
+SDict begin 13 H.A end
+ -2
+5312 a -2 5312 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4261) cvn H.B /DEST pdfmark
+end
+ -2 5312 a 396 5404 a Fy(LoginCheckInter)o(v)o(al=)1162
+5404 y
+SDict begin H.S end
+ 1162 5404 a 1162 5404 a
+SDict begin 13 H.A end
+ 1162 5404 a 1162 5404
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4262) cvn H.B /DEST pdfmark
+end
+ 1162 5404 a Fl(seconds)g FC(\227)g(Interv)n(al)f(between)h(checks.)p
+Black 3618 5805 a Fx(116)p Black eop end
+%%Page: 117 122
+TeXDict begin 117 121 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.117) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4308) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4263) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4264) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(Se)o(v)o(erityLogin=)941 309 y
+SDict begin H.S end
+ 941
+309 a 941 309 a
+SDict begin 13 H.A end
+ 941 309 a 941 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4265) cvn H.B /DEST pdfmark
+end
+ 941 309 a Fl(severity)25
+b FC(\227)c(Se)n(v)o(erity)e(for)h(login)f(e)n(v)o(ents.)396
+583 y Fy(Se)o(v)o(erityLoginMulti=)p Fl(severity)25 b
+FC(\227)c(Se)n(v)o(erity)e(for)h(multiple)f(logins)h(by)g(same)g(user)
+-5 b(.)-2 767 y
+SDict begin H.S end
+ -2 767 a -2 767 a
+SDict begin 13 H.A end
+ -2 767 a -2 767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4269) cvn H.B /DEST pdfmark
+end
+ -2
+767 a -2 767 a
+SDict begin H.S end
+ -2 767 a -2 767 a
+SDict begin 13 H.A end
+ -2 767 a -2 767 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4270) cvn H.B /DEST pdfmark
+end
+ -2
+767 a 396 857 a Fy(Se)o(v)o(erityLogout=)988 857 y
+SDict begin H.S end
+ 988
+857 a 988 857 a
+SDict begin 13 H.A end
+ 988 857 a 988 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4271) cvn H.B /DEST pdfmark
+end
+ 988 857 a Fl(severity)24
+b FC(\227)d(Se)n(v)o(erity)e(for)h(logout)f(e)n(v)o(ents.)-2
+885 y
+SDict begin H.S end
+ -2 885 a -2 885 a
+SDict begin 13 H.A end
+ -2 885 a -2 885 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHECKING-FOR-KERNEL-MODULE-ROOTKITS)
+cvn H.B /DEST pdfmark end
+ -2 885 a 359
+x Fu(C.6.)39 b(Chec)m(king)e(f)m(or)j(kernel)e(module)g(r)m(ootkits)
+2749 1244 y
+SDict begin H.S end
+ 2749 1244 a 2749 1244 a
+SDict begin 22.464 H.A end
+ 2749 1244 a 2749
+1244 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.87.1) cvn H.B /DEST pdfmark
+end
+ 2749 1244 a -2 1442 a
+SDict begin H.S end
+ -2 1442 a -2 1442 a
+SDict begin 13 H.A end
+ -2 1442
+a -2 1442 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4274) cvn H.B /DEST pdfmark
+end
+ -2 1442 a 396 1518 a FC(Section)20 b(heading:)-2
+1702 y
+SDict begin H.S end
+ -2 1702 a -2 1702 a
+SDict begin 13 H.A end
+ -2 1702 a -2 1702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4275) cvn H.B /DEST pdfmark
+end
+ -2 1702
+a -2 1702 a
+SDict begin H.S end
+ -2 1702 a -2 1702 a
+SDict begin 13 H.A end
+ -2 1702 a -2 1702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4276) cvn H.B /DEST pdfmark
+end
+ -2
+1702 a 396 1792 a Fy([K)n(er)o(nel])-2 1971 y
+SDict begin H.S end
+ -2 1971
+a -2 1971 a
+SDict begin 13 H.A end
+ -2 1971 a -2 1971 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4277) cvn H.B /DEST pdfmark
+end
+ -2 1971 a 396 2066 a
+FC(Entries:)-2 2233 y
+SDict begin H.S end
+ -2 2233 a -2 2233 a
+SDict begin 13 H.A end
+ -2 2233 a -2
+2233 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4278) cvn H.B /DEST pdfmark
+end
+ -2 2233 a -2 2233 a
+SDict begin H.S end
+ -2 2233 a -2 2233 a
+SDict begin 13 H.A end
+ -2 2233
+a -2 2233 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4279) cvn H.B /DEST pdfmark
+end
+ -2 2233 a 396 2340 a Fy(K)n(er)o(nelCheckActi)o(v)o(e=)1136
+2340 y
+SDict begin H.S end
+ 1136 2340 a 1136 2340 a
+SDict begin 13 H.A end
+ 1136 2340 a 1136 2340
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4280) cvn H.B /DEST pdfmark
+end
+ 1136 2340 a Fl(boolean)g FC(\227)g(')o(true')f(to)h(switch)h(on,)e
+('f)o(alse')h(to)h(switch)f(of)n(f.)-2 2518 y
+SDict begin H.S end
+ -2 2518
+a -2 2518 a
+SDict begin 13 H.A end
+ -2 2518 a -2 2518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4281) cvn H.B /DEST pdfmark
+end
+ -2 2518 a -2 2518 a
+SDict begin H.S end
+ -2
+2518 a -2 2518 a
+SDict begin 13 H.A end
+ -2 2518 a -2 2518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4282) cvn H.B /DEST pdfmark
+end
+ -2 2518 a 396 2614
+a Fy(K)n(er)o(nelCheckInter)o(v)o(al=)1196 2614 y
+SDict begin H.S end
+ 1196
+2614 a 1196 2614 a
+SDict begin 13 H.A end
+ 1196 2614 a 1196 2614 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4283) cvn H.B /DEST pdfmark
+end
+ 1196 2614
+a Fl(seconds)f FC(\227)i(Interv)n(al)e(between)g(checks.)-2
+2782 y
+SDict begin H.S end
+ -2 2782 a -2 2782 a
+SDict begin 13 H.A end
+ -2 2782 a -2 2782 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4284) cvn H.B /DEST pdfmark
+end
+ -2 2782
+a -2 2782 a
+SDict begin H.S end
+ -2 2782 a -2 2782 a
+SDict begin 13 H.A end
+ -2 2782 a -2 2782 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4285) cvn H.B /DEST pdfmark
+end
+ -2
+2782 a 396 2888 a Fy(K)n(er)o(nelCheckIDT=)1058 2888
+y
+SDict begin H.S end
+ 1058 2888 a 1058 2888 a
+SDict begin 13 H.A end
+ 1058 2888 a 1058 2888 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4286) cvn H.B /DEST pdfmark
+end
+ 1058
+2888 a Fl(boolean)i FC(\227)g(Check)f(the)g(Interrupt)e(Descriptor)h(T)
+-7 b(able)20 b(\(def)o(ault)f(true\).)-2 3072 y
+SDict begin H.S end
+ -2 3072
+a -2 3072 a
+SDict begin 13 H.A end
+ -2 3072 a -2 3072 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4287) cvn H.B /DEST pdfmark
+end
+ -2 3072 a -2 3072 a
+SDict begin H.S end
+ -2
+3072 a -2 3072 a
+SDict begin 13 H.A end
+ -2 3072 a -2 3072 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4288) cvn H.B /DEST pdfmark
+end
+ -2 3072 a 396 3162
+a Fy(Se)o(v)o(erityK)n(er)o(nel=)975 3162 y
+SDict begin H.S end
+ 975 3162
+a 975 3162 a
+SDict begin 13 H.A end
+ 975 3162 a 975 3162 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4289) cvn H.B /DEST pdfmark
+end
+ 975 3162 a Fl(severity)25
+b FC(\227)20 b(Se)n(v)o(erity)f(for)h(e)n(v)o(ents.)-2
+3346 y
+SDict begin H.S end
+ -2 3346 a -2 3346 a
+SDict begin 13 H.A end
+ -2 3346 a -2 3346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4290) cvn H.B /DEST pdfmark
+end
+ -2 3346
+a -2 3346 a
+SDict begin H.S end
+ -2 3346 a -2 3346 a
+SDict begin 13 H.A end
+ -2 3346 a -2 3346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4291) cvn H.B /DEST pdfmark
+end
+ -2
+3346 a 396 3436 a Fy(K)n(er)o(nelSystemCall)f(=)1127
+3436 y
+SDict begin H.S end
+ 1127 3436 a 1127 3436 a
+SDict begin 13 H.A end
+ 1127 3436 a 1127 3436
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4292) cvn H.B /DEST pdfmark
+end
+ 1127 3436 a Fl(address)i FC(\227)f(the)h(address)e(of)h(system_call)g
+(\(grep)f(system_call)h(System.map\))-2 3620 y
+SDict begin H.S end
+ -2 3620
+a -2 3620 a
+SDict begin 13 H.A end
+ -2 3620 a -2 3620 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4293) cvn H.B /DEST pdfmark
+end
+ -2 3620 a -2 3620 a
+SDict begin H.S end
+ -2
+3620 a -2 3620 a
+SDict begin 13 H.A end
+ -2 3620 a -2 3620 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4294) cvn H.B /DEST pdfmark
+end
+ -2 3620 a 396 3710
+a Fy(K)n(er)o(nelSyscallT)-8 b(able)20 b(=)1166 3710
+y
+SDict begin H.S end
+ 1166 3710 a 1166 3710 a
+SDict begin 13 H.A end
+ 1166 3710 a 1166 3710 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4295) cvn H.B /DEST pdfmark
+end
+ 1166
+3710 a Fl(address)g FC(\227)h(the)f(address)g(of)g(sys_call_table)f
+(\(grep)g(')h(sys_call_table')396 3818 y(System.map\))-2
+4002 y
+SDict begin H.S end
+ -2 4002 a -2 4002 a
+SDict begin 13 H.A end
+ -2 4002 a -2 4002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4296) cvn H.B /DEST pdfmark
+end
+ -2 4002
+a -2 4002 a
+SDict begin H.S end
+ -2 4002 a -2 4002 a
+SDict begin 13 H.A end
+ -2 4002 a -2 4002 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4297) cvn H.B /DEST pdfmark
+end
+ -2
+4002 a 396 4092 a Fy(K)n(er)o(nelPr)o(ocRoot)d(=)1061
+4092 y
+SDict begin H.S end
+ 1061 4092 a 1061 4092 a
+SDict begin 13 H.A end
+ 1061 4092 a 1061 4092
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4298) cvn H.B /DEST pdfmark
+end
+ 1061 4092 a Fl(address)j FC(\227)h(the)f(address)g(of)g(proc_root)e
+(\(grep)g(')j(proc_root$')c(System.map\))-2 4276 y
+SDict begin H.S end
+ -2
+4276 a -2 4276 a
+SDict begin 13 H.A end
+ -2 4276 a -2 4276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4299) cvn H.B /DEST pdfmark
+end
+ -2 4276 a -2 4276
+a
+SDict begin H.S end
+ -2 4276 a -2 4276 a
+SDict begin 13 H.A end
+ -2 4276 a -2 4276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4300) cvn H.B /DEST pdfmark
+end
+ -2 4276 a 396
+4366 a Fy(K)n(er)o(nelPr)o(ocRootIops)g(=)1214 4366 y
+SDict begin H.S end
+
+1214 4366 a 1214 4366 a
+SDict begin 13 H.A end
+ 1214 4366 a 1214 4366 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4301) cvn H.B /DEST pdfmark
+end
+ 1214
+4366 a Fl(address)j FC(\227)g(the)h(address)e(of)h(proc_root_inode_ope)
+o(ration)o(s)15 b(\(grep)396 4474 y(proc_root_inode_ope)o(ration)o(s)g
+(System.map\))-2 4658 y
+SDict begin H.S end
+ -2 4658 a -2 4658 a
+SDict begin 13 H.A end
+ -2 4658 a
+-2 4658 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4302) cvn H.B /DEST pdfmark
+end
+ -2 4658 a -2 4658 a
+SDict begin H.S end
+ -2 4658 a -2 4658 a
+SDict begin 13 H.A end
+ -2
+4658 a -2 4658 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4303) cvn H.B /DEST pdfmark
+end
+ -2 4658 a 396 4748 a Fy(K)n(er)o(nelPr)o(ocRootLookup)
+i(=)1338 4748 y
+SDict begin H.S end
+ 1338 4748 a 1338 4748 a
+SDict begin 13 H.A end
+ 1338 4748 a 1338
+4748 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4304) cvn H.B /DEST pdfmark
+end
+ 1338 4748 a Fl(address)j FC(\227)h(the)f(address)g(of)g
+(proc_root_lookup)15 b(\(grep)j(proc_root_lookup)396
+4856 y(System.map\))-2 4884 y
+SDict begin H.S end
+ -2 4884 a -2 4884 a
+SDict begin 13 H.A end
+ -2
+4884 a -2 4884 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHECKING-FOR-SUID-FILES) cvn
+H.B /DEST pdfmark end
+ -2 4884 a Black 3617 5805 a Fx(117)p
+Black eop end
+%%Page: 118 123
+TeXDict begin 118 122 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.118) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2249 104 a
+Fx(Appendix)18 b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j
+(options)p Black -2 330 a Fu(C.7.)39 b(Chec)m(king)e(f)m(or)j
+(SUID/SGID)d(\002les)2273 330 y
+SDict begin H.S end
+ 2273 330 a 2273 330 a
+SDict begin 22.464 H.A end
+
+2273 330 a 2273 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.88.1) cvn H.B /DEST pdfmark
+end
+ 2273 330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2
+528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4307) cvn H.B /DEST pdfmark
+end
+ -2 528 a 396 604 a FC(Section)20
+b(heading:)396 878 y Fy([SuidCheck])-2 1057 y
+SDict begin H.S end
+ -2 1057
+a -2 1057 a
+SDict begin 13 H.A end
+ -2 1057 a -2 1057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4310) cvn H.B /DEST pdfmark
+end
+ -2 1057 a 396 1152 a
+FC(Entries:)-2 1319 y
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319 a -2
+1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4311) cvn H.B /DEST pdfmark
+end
+ -2 1319 a -2 1319 a
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319
+a -2 1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4312) cvn H.B /DEST pdfmark
+end
+ -2 1319 a 396 1426 a Fy(SuidCheckActi)o(v)o(e=)1055
+1426 y
+SDict begin H.S end
+ 1055 1426 a 1055 1426 a
+SDict begin 13 H.A end
+ 1055 1426 a 1055 1426
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4313) cvn H.B /DEST pdfmark
+end
+ 1055 1426 a Fl(boolean)h FC(\227)g('1')e(to)i(switch)f(on,)g('0')f
+(to)i(switch)f(of)n(f.)-2 1604 y
+SDict begin H.S end
+ -2 1604 a -2 1604 a
+SDict begin 13 H.A end
+
+-2 1604 a -2 1604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4314) cvn H.B /DEST pdfmark
+end
+ -2 1604 a -2 1604 a
+SDict begin H.S end
+ -2 1604 a -2
+1604 a
+SDict begin 13 H.A end
+ -2 1604 a -2 1604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4315) cvn H.B /DEST pdfmark
+end
+ -2 1604 a 396 1700 a Fy(SuidCheckExclude=)
+1116 1700 y
+SDict begin H.S end
+ 1116 1700 a 1116 1700 a
+SDict begin 13 H.A end
+ 1116 1700 a 1116
+1700 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4316) cvn H.B /DEST pdfmark
+end
+ 1116 1700 a Fl(path)i FC(\227)f(A)g(directory)d(\(and)h(its)j
+(subdirectories\))c(to)i(e)o(xclude)f(from)g(the)h(check.)f(Only)396
+1808 y(one)h(directory)e(can)i(be)g(speci\002ed)g(this)h(w)o(ay)-5
+b(.)-2 1992 y
+SDict begin H.S end
+ -2 1992 a -2 1992 a
+SDict begin 13 H.A end
+ -2 1992 a -2 1992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4317) cvn H.B /DEST pdfmark
+end
+
+-2 1992 a -2 1992 a
+SDict begin H.S end
+ -2 1992 a -2 1992 a
+SDict begin 13 H.A end
+ -2 1992 a -2
+1992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4318) cvn H.B /DEST pdfmark
+end
+ -2 1992 a 396 2082 a Fy(SuidCheckSchedule=)1148
+2082 y
+SDict begin H.S end
+ 1148 2082 a 1148 2082 a
+SDict begin 13 H.A end
+ 1148 2082 a 1148 2082
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4319) cvn H.B /DEST pdfmark
+end
+ 1148 2082 a Fl(schedule)21 b FC(\227)g(Crontab-lik)o(e)e(schedule)g
+(for)g(checks.)-2 2250 y
+SDict begin H.S end
+ -2 2250 a -2 2250 a
+SDict begin 13 H.A end
+ -2 2250
+a -2 2250 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4320) cvn H.B /DEST pdfmark
+end
+ -2 2250 a -2 2250 a
+SDict begin H.S end
+ -2 2250 a -2 2250 a
+SDict begin 13 H.A end
+ -2
+2250 a -2 2250 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4321) cvn H.B /DEST pdfmark
+end
+ -2 2250 a 396 2356 a Fy(Se)o(v)o(eritySuidCheck=)1120
+2356 y
+SDict begin H.S end
+ 1120 2356 a 1120 2356 a
+SDict begin 13 H.A end
+ 1120 2356 a 1120 2356
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4322) cvn H.B /DEST pdfmark
+end
+ 1120 2356 a Fl(severity)26 b FC(\227)21 b(Se)n(v)o(erity)e(for)g(e)n
+(v)o(ents.)-2 2540 y
+SDict begin H.S end
+ -2 2540 a -2 2540 a
+SDict begin 13 H.A end
+ -2 2540 a -2
+2540 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4323) cvn H.B /DEST pdfmark
+end
+ -2 2540 a -2 2540 a
+SDict begin H.S end
+ -2 2540 a -2 2540 a
+SDict begin 13 H.A end
+ -2 2540
+a -2 2540 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4324) cvn H.B /DEST pdfmark
+end
+ -2 2540 a 396 2630 a Fy(SuidCheckFps=)959
+2630 y
+SDict begin H.S end
+ 959 2630 a 959 2630 a
+SDict begin 13 H.A end
+ 959 2630 a 959 2630 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4325) cvn H.B /DEST pdfmark
+end
+ 959
+2630 a Fl(fps)j FC(\227)f(Limit)f(\002les)h(per)f(seconds)g(for)f(SUID)
+i(check.)-2 2658 y
+SDict begin H.S end
+ -2 2658 a -2 2658 a
+SDict begin 13 H.A end
+ -2 2658 a -2 2658
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHECKING-MOUNTS) cvn H.B /DEST
+pdfmark end
+ -2 2658 a 360 x Fu(C.8.)39 b(Chec)m(king)e(f)m(or)j(mount)e(options)
+2210 3018 y
+SDict begin H.S end
+ 2210 3018 a 2210 3018 a
+SDict begin 22.464 H.A end
+ 2210 3018 a 2210
+3018 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.89.1) cvn H.B /DEST pdfmark
+end
+ 2210 3018 a -2 3216 a
+SDict begin H.S end
+ -2 3216 a -2 3216 a
+SDict begin 13 H.A end
+ -2 3216
+a -2 3216 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4328) cvn H.B /DEST pdfmark
+end
+ -2 3216 a 396 3292 a FC(Section)20 b(heading:)-2
+3476 y
+SDict begin H.S end
+ -2 3476 a -2 3476 a
+SDict begin 13 H.A end
+ -2 3476 a -2 3476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4329) cvn H.B /DEST pdfmark
+end
+ -2 3476
+a -2 3476 a
+SDict begin H.S end
+ -2 3476 a -2 3476 a
+SDict begin 13 H.A end
+ -2 3476 a -2 3476 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4330) cvn H.B /DEST pdfmark
+end
+ -2
+3476 a 396 3565 a Fy([Mounts])-2 3744 y
+SDict begin H.S end
+ -2 3744 a -2
+3744 a
+SDict begin 13 H.A end
+ -2 3744 a -2 3744 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4331) cvn H.B /DEST pdfmark
+end
+ -2 3744 a 396 3839 a FC(Entries:)-2
+4006 y
+SDict begin H.S end
+ -2 4006 a -2 4006 a
+SDict begin 13 H.A end
+ -2 4006 a -2 4006 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4332) cvn H.B /DEST pdfmark
+end
+ -2 4006
+a -2 4006 a
+SDict begin H.S end
+ -2 4006 a -2 4006 a
+SDict begin 13 H.A end
+ -2 4006 a -2 4006 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4333) cvn H.B /DEST pdfmark
+end
+ -2
+4006 a 396 4113 a Fy(MountCheckActi)o(v)o(e=)1134 4113
+y
+SDict begin H.S end
+ 1134 4113 a 1134 4113 a
+SDict begin 13 H.A end
+ 1134 4113 a 1134 4113 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4334) cvn H.B /DEST pdfmark
+end
+ 1134
+4113 a Fl(boolean)g FC(\227)h('1')f(to)g(switch)g(on,)g('0')g(to)g
+(switch)g(of)n(f.)-2 4291 y
+SDict begin H.S end
+ -2 4291 a -2 4291 a
+SDict begin 13 H.A end
+ -2 4291
+a -2 4291 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4335) cvn H.B /DEST pdfmark
+end
+ -2 4291 a -2 4291 a
+SDict begin H.S end
+ -2 4291 a -2 4291 a
+SDict begin 13 H.A end
+ -2
+4291 a -2 4291 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4336) cvn H.B /DEST pdfmark
+end
+ -2 4291 a 396 4387 a Fy(MountCheckInter)o(v)o(al=)1194
+4387 y
+SDict begin H.S end
+ 1194 4387 a 1194 4387 a
+SDict begin 13 H.A end
+ 1194 4387 a 1194 4387
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4337) cvn H.B /DEST pdfmark
+end
+ 1194 4387 a Fl(seconds)g FC(\227)h(Interv)n(al)d(between)i(checks.)-2
+4555 y
+SDict begin H.S end
+ -2 4555 a -2 4555 a
+SDict begin 13 H.A end
+ -2 4555 a -2 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4338) cvn H.B /DEST pdfmark
+end
+ -2 4555
+a -2 4555 a
+SDict begin H.S end
+ -2 4555 a -2 4555 a
+SDict begin 13 H.A end
+ -2 4555 a -2 4555 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4339) cvn H.B /DEST pdfmark
+end
+ -2
+4555 a 396 4661 a Fy(Se)o(v)o(erityMountMissing=)1249
+4661 y
+SDict begin H.S end
+ 1249 4661 a 1249 4661 a
+SDict begin 13 H.A end
+ 1249 4661 a 1249 4661
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4340) cvn H.B /DEST pdfmark
+end
+ 1249 4661 a Fl(severity)26 b FC(\227)21 b(Se)n(v)o(erity)e(for)h
+(missing)g(mounts.)-2 4845 y
+SDict begin H.S end
+ -2 4845 a -2 4845 a
+SDict begin 13 H.A end
+ -2 4845
+a -2 4845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4341) cvn H.B /DEST pdfmark
+end
+ -2 4845 a -2 4845 a
+SDict begin H.S end
+ -2 4845 a -2 4845 a
+SDict begin 13 H.A end
+ -2
+4845 a -2 4845 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4342) cvn H.B /DEST pdfmark
+end
+ -2 4845 a 396 4935 a Fy(Se)o(v)o(erityOptionMissing=)
+1259 4935 y
+SDict begin H.S end
+ 1259 4935 a 1259 4935 a
+SDict begin 13 H.A end
+ 1259 4935 a 1259
+4935 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4343) cvn H.B /DEST pdfmark
+end
+ 1259 4935 a Fl(severity)25 b FC(\227)c(Se)n(v)o(erity)e(for)h
+(missing)g(mount)f(options.)-2 5119 y
+SDict begin H.S end
+ -2 5119 a -2 5119
+a
+SDict begin 13 H.A end
+ -2 5119 a -2 5119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4344) cvn H.B /DEST pdfmark
+end
+ -2 5119 a -2 5119 a
+SDict begin H.S end
+ -2 5119 a -2
+5119 a
+SDict begin 13 H.A end
+ -2 5119 a -2 5119 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4345) cvn H.B /DEST pdfmark
+end
+ -2 5119 a 396 5209 a Fy(CheckMount=)909
+5209 y
+SDict begin H.S end
+ 909 5209 a 909 5209 a
+SDict begin 13 H.A end
+ 909 5209 a 909 5209 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4346) cvn H.B /DEST pdfmark
+end
+ 909
+5209 a Fl(/path)44 b([mount)g(options])20 b FC(\227)g(Mount)g(point)f
+(to)h(check.)g(Mount)f(options)g(must)h(be)g(gi)n(v)o(en)396
+5317 y(as)h(comma-separated)c(list,)22 b(separated)d(by)h(a)g(blank)f
+(from)h(the)g(preceding)e(mount)h(point.)-2 5346 y
+SDict begin H.S end
+ -2
+5346 a -2 5346 a
+SDict begin 13 H.A end
+ -2 5346 a -2 5346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CHECKING-USERFILES) cvn H.B
+/DEST pdfmark end
+ -2 5346 a Black
+3620 5805 a Fx(118)p Black eop end
+%%Page: 119 124
+TeXDict begin 119 123 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.119) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4389) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 330 a Fu(C.9.)39 b(Chec)m(king)e(f)m(or)j(user)f(\002les)1843
+330 y
+SDict begin H.S end
+ 1843 330 a 1843 330 a
+SDict begin 22.464 H.A end
+ 1843 330 a 1843 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.90.1) cvn H.B /DEST pdfmark
+end
+ 1843
+330 a -2 528 a
+SDict begin H.S end
+ -2 528 a -2 528 a
+SDict begin 13 H.A end
+ -2 528 a -2 528 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4349) cvn H.B /DEST pdfmark
+end
+ -2
+528 a 396 604 a FC(Section)20 b(heading:)-2 788 y
+SDict begin H.S end
+ -2
+788 a -2 788 a
+SDict begin 13 H.A end
+ -2 788 a -2 788 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4350) cvn H.B /DEST pdfmark
+end
+ -2 788 a -2 788 a
+SDict begin H.S end
+ -2
+788 a -2 788 a
+SDict begin 13 H.A end
+ -2 788 a -2 788 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4351) cvn H.B /DEST pdfmark
+end
+ -2 788 a 396 878 a Fy([UserFiles])-2
+1057 y
+SDict begin H.S end
+ -2 1057 a -2 1057 a
+SDict begin 13 H.A end
+ -2 1057 a -2 1057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4352) cvn H.B /DEST pdfmark
+end
+ -2 1057
+a 396 1152 a FC(Entries:)-2 1319 y
+SDict begin H.S end
+ -2 1319 a -2 1319
+a
+SDict begin 13 H.A end
+ -2 1319 a -2 1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4353) cvn H.B /DEST pdfmark
+end
+ -2 1319 a -2 1319 a
+SDict begin H.S end
+ -2 1319 a -2
+1319 a
+SDict begin 13 H.A end
+ -2 1319 a -2 1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4354) cvn H.B /DEST pdfmark
+end
+ -2 1319 a 396 1426 a Fy(User\002lesActi)o(v)
+o(e=)972 1426 y
+SDict begin H.S end
+ 972 1426 a 972 1426 a
+SDict begin 13 H.A end
+ 972 1426 a 972
+1426 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4355) cvn H.B /DEST pdfmark
+end
+ 972 1426 a Fl(boolean)h FC(\227)g('1')e(to)h(switch)h(on,)f('0')
+f(to)h(switch)h(of)n(f.)-2 1604 y
+SDict begin H.S end
+ -2 1604 a -2 1604 a
+SDict begin 13 H.A end
+
+-2 1604 a -2 1604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4356) cvn H.B /DEST pdfmark
+end
+ -2 1604 a -2 1604 a
+SDict begin H.S end
+ -2 1604 a -2
+1604 a
+SDict begin 13 H.A end
+ -2 1604 a -2 1604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4357) cvn H.B /DEST pdfmark
+end
+ -2 1604 a 396 1700 a Fy(User\002lesName=)955
+1700 y
+SDict begin H.S end
+ 955 1700 a 955 1700 a
+SDict begin 13 H.A end
+ 955 1700 a 955 1700 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4358) cvn H.B /DEST pdfmark
+end
+ 955
+1700 a Fl(filename)44 b(policy)27 b FC(\227)20 b(Files)i(to)e(check)f
+(for)h(under)f(each)h($HOME.)f(Allo)n(wed)h(v)n(alues)f(for)396
+1808 y('polic)o(y')g(are:)h(allignore,)e(attrib)n(utes,)i(log\002les,)g
+(loggro)n(w)-5 b(,)18 b(noignore)g(\(def)o(ault\),)h(readonly)-5
+b(,)17 b(user0,)i(user1.)-2 1992 y
+SDict begin H.S end
+ -2 1992 a -2 1992
+a
+SDict begin 13 H.A end
+ -2 1992 a -2 1992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4359) cvn H.B /DEST pdfmark
+end
+ -2 1992 a -2 1992 a
+SDict begin H.S end
+ -2 1992 a -2
+1992 a
+SDict begin 13 H.A end
+ -2 1992 a -2 1992 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4360) cvn H.B /DEST pdfmark
+end
+ -2 1992 a 396 2082 a Fy
+(User\002lesCheckUids=)1134 2082 y
+SDict begin H.S end
+ 1134 2082 a 1134 2082
+a
+SDict begin 13 H.A end
+ 1134 2082 a 1134 2082 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4361) cvn H.B /DEST pdfmark
+end
+ 1134 2082 a Fl(uid)46 b(list)20
+b FC(\227)h(A)f(list)i(of)d(UIDs)i(where)f(we)g(w)o(ant)h(to)f(check.)f
+(The)h(def)o(ault)f(is)i(all.)396 2190 y(Ranges)f(\(e.g.)g(100-500\))d
+(are)j(allo)n(wed.)f(If)h(there)g(is)h(an)f(open)f(range)h(\(e.g.)f
+(1000-\),)f(it)j(must)f(be)g(last)h(in)f(the)h(list.)-2
+2218 y
+SDict begin H.S end
+ -2 2218 a -2 2218 a
+SDict begin 13 H.A end
+ -2 2218 a -2 2218 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DATABASE) cvn H.B /DEST pdfmark
+end
+ -2 2218
+a 360 x Fu(C.10.)39 b(Database)1021 2578 y
+SDict begin H.S end
+ 1021 2578
+a 1021 2578 a
+SDict begin 22.464 H.A end
+ 1021 2578 a 1021 2578 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.91.1) cvn H.B /DEST pdfmark
+end
+ 1021 2578 a -2
+2745 a
+SDict begin H.S end
+ -2 2745 a -2 2745 a
+SDict begin 13 H.A end
+ -2 2745 a -2 2745 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4364) cvn H.B /DEST pdfmark
+end
+ -2 2745
+a 396 2851 a FC(Section)20 b(heading:)-2 3036 y
+SDict begin H.S end
+ -2 3036
+a -2 3036 a
+SDict begin 13 H.A end
+ -2 3036 a -2 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4365) cvn H.B /DEST pdfmark
+end
+ -2 3036 a -2 3036 a
+SDict begin H.S end
+ -2
+3036 a -2 3036 a
+SDict begin 13 H.A end
+ -2 3036 a -2 3036 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4366) cvn H.B /DEST pdfmark
+end
+ -2 3036 a 396 3125
+a Fy([Database])-2 3304 y
+SDict begin H.S end
+ -2 3304 a -2 3304 a
+SDict begin 13 H.A end
+ -2 3304
+a -2 3304 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4367) cvn H.B /DEST pdfmark
+end
+ -2 3304 a 396 3399 a FC(Entries:)-2 3566
+y
+SDict begin H.S end
+ -2 3566 a -2 3566 a
+SDict begin 13 H.A end
+ -2 3566 a -2 3566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4368) cvn H.B /DEST pdfmark
+end
+ -2 3566 a -2
+3566 a
+SDict begin H.S end
+ -2 3566 a -2 3566 a
+SDict begin 13 H.A end
+ -2 3566 a -2 3566 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4369) cvn H.B /DEST pdfmark
+end
+ -2 3566
+a 396 3673 a Fy(SetDBHost=)836 3673 y
+SDict begin H.S end
+ 836 3673 a 836
+3673 a
+SDict begin 13 H.A end
+ 836 3673 a 836 3673 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4370) cvn H.B /DEST pdfmark
+end
+ 836 3673 a Fl(db_host)f
+FC(\227)i(Host)g(where)e(the)h(DB)h(serv)o(er)f(runs)f(\(def)o(ault:)h
+(localhost\).)f(Should)g(be)h(numeric)f(IP)396 3781 y(address)h(for)g
+(PostgreSQL.)-2 3965 y
+SDict begin H.S end
+ -2 3965 a -2 3965 a
+SDict begin 13 H.A end
+ -2 3965 a
+-2 3965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4371) cvn H.B /DEST pdfmark
+end
+ -2 3965 a -2 3965 a
+SDict begin H.S end
+ -2 3965 a -2 3965 a
+SDict begin 13 H.A end
+ -2
+3965 a -2 3965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4372) cvn H.B /DEST pdfmark
+end
+ -2 3965 a 396 4055 a Fy(SetDBName=)877
+4055 y
+SDict begin H.S end
+ 877 4055 a 877 4055 a
+SDict begin 13 H.A end
+ 877 4055 a 877 4055 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4373) cvn H.B /DEST pdfmark
+end
+ 877
+4055 a Fl(db_name)g FC(\227)h(Name)f(of)g(the)g(database)f(\(def)o
+(ault:)h(samhain\).)-2 4236 y
+SDict begin H.S end
+ -2 4236 a -2 4236 a
+SDict begin 13 H.A end
+ -2
+4236 a -2 4236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4374) cvn H.B /DEST pdfmark
+end
+ -2 4236 a -2 4236 a
+SDict begin H.S end
+ -2 4236 a -2 4236
+a
+SDict begin 13 H.A end
+ -2 4236 a -2 4236 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4375) cvn H.B /DEST pdfmark
+end
+ -2 4236 a 396 4329 a Fy(SetDBT)-8
+b(able=)864 4329 y
+SDict begin H.S end
+ 864 4329 a 864 4329 a
+SDict begin 13 H.A end
+ 864 4329 a 864
+4329 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4376) cvn H.B /DEST pdfmark
+end
+ 864 4329 a Fl(db_table)21 b FC(\227)f(Name)g(of)g(the)h
+(database)e(table)h(\(def)o(ault:)f(log\).)-2 4513 y
+SDict begin H.S end
+
+-2 4513 a -2 4513 a
+SDict begin 13 H.A end
+ -2 4513 a -2 4513 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4377) cvn H.B /DEST pdfmark
+end
+ -2 4513 a -2
+4513 a
+SDict begin H.S end
+ -2 4513 a -2 4513 a
+SDict begin 13 H.A end
+ -2 4513 a -2 4513 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4378) cvn H.B /DEST pdfmark
+end
+ -2 4513
+a 396 4603 a Fy(SetDB)o(User=)834 4603 y
+SDict begin H.S end
+ 834 4603 a 834
+4603 a
+SDict begin 13 H.A end
+ 834 4603 a 834 4603 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4379) cvn H.B /DEST pdfmark
+end
+ 834 4603 a Fl(db_user)24
+b FC(\227)d(Connect)f(as)g(this)h(user)f(\(def)o(ault:)f(samhain\).)-2
+4784 y
+SDict begin H.S end
+ -2 4784 a -2 4784 a
+SDict begin 13 H.A end
+ -2 4784 a -2 4784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4380) cvn H.B /DEST pdfmark
+end
+ -2 4784
+a -2 4784 a
+SDict begin H.S end
+ -2 4784 a -2 4784 a
+SDict begin 13 H.A end
+ -2 4784 a -2 4784 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4381) cvn H.B /DEST pdfmark
+end
+ -2
+4784 a 396 4877 a Fy(SetDBP)o(assw)o(ord=)1009 4877 y
+SDict begin H.S end
+
+1009 4877 a 1009 4877 a
+SDict begin 13 H.A end
+ 1009 4877 a 1009 4877 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4382) cvn H.B /DEST pdfmark
+end
+ 1009
+4877 a Fl(db_password)j FC(\227)f(Use)g(this)g(passw)o(ord)e(\(def)o
+(ault:)g(none\).)-2 5061 y
+SDict begin H.S end
+ -2 5061 a -2 5061 a
+SDict begin 13 H.A end
+ -2 5061
+a -2 5061 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4383) cvn H.B /DEST pdfmark
+end
+ -2 5061 a -2 5061 a
+SDict begin H.S end
+ -2 5061 a -2 5061 a
+SDict begin 13 H.A end
+ -2
+5061 a -2 5061 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4384) cvn H.B /DEST pdfmark
+end
+ -2 5061 a 396 5151 a Fy(SetDBSer)o(v)o(erTstamp=)1175
+5151 y
+SDict begin H.S end
+ 1175 5151 a 1175 5151 a
+SDict begin 13 H.A end
+ 1175 5151 a 1175 5151
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4385) cvn H.B /DEST pdfmark
+end
+ 1175 5151 a Fl(boolean)i FC(\227)g(Log)e(serv)o(er)g(timestamp)h(for)
+g(client)g(messages)g(\(def)o(ault:)f(true\).)p Black
+3620 5805 a Fx(119)p Black eop end
+%%Page: 120 125
+TeXDict begin 120 124 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.120) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4431) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4386) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4387) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(UseP)n(ersistent=)921 309 y
+SDict begin H.S end
+ 921 309
+a 921 309 a
+SDict begin 13 H.A end
+ 921 309 a 921 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4388) cvn H.B /DEST pdfmark
+end
+ 921 309 a Fl(boolean)h
+FC(\227)g(Use)g(a)f(persistent)g(connection)e(\(def)o(ault:)i(true\).)
+396 583 y Fy(AddT)-8 b(oDBHash=)p Fl(field)24 b FC(\227)d(Add)f(a)g
+(database)g(\002eld)g(to)h(the)f(set)h(of)f(\002elds)g(that)h(are)f
+(used)g(for)f(tagging)g(the)h(log)396 691 y(record)f(with)h(an)h(MD5)f
+(hash.)-2 702 y
+SDict begin H.S end
+ -2 702 a -2 702 a
+SDict begin 13 H.A end
+ -2 702 a -2 702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MISCELLANEOUS) cvn H.B /DEST
+pdfmark end
+ -2
+702 a 376 x Fu(C.11.)39 b(Miscellaneous)1365 1078 y
+SDict begin H.S end
+ 1365
+1078 a 1365 1078 a
+SDict begin 22.464 H.A end
+ 1365 1078 a 1365 1078 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.92.1) cvn H.B /DEST pdfmark
+end
+ 1365 1078
+a -2 1246 a
+SDict begin H.S end
+ -2 1246 a -2 1246 a
+SDict begin 13 H.A end
+ -2 1246 a -2 1246 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4394) cvn H.B /DEST pdfmark
+end
+ -2
+1246 a 396 1352 a FC(Section)20 b(heading:)-2 1536 y
+SDict begin H.S end
+
+-2 1536 a -2 1536 a
+SDict begin 13 H.A end
+ -2 1536 a -2 1536 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4395) cvn H.B /DEST pdfmark
+end
+ -2 1536 a -2
+1536 a
+SDict begin H.S end
+ -2 1536 a -2 1536 a
+SDict begin 13 H.A end
+ -2 1536 a -2 1536 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4396) cvn H.B /DEST pdfmark
+end
+ -2 1536
+a 396 1626 a Fy([Misc])-2 1804 y
+SDict begin H.S end
+ -2 1804 a -2 1804 a
+SDict begin 13 H.A end
+
+-2 1804 a -2 1804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4397) cvn H.B /DEST pdfmark
+end
+ -2 1804 a 396 1900 a FC(Entries:)-2
+2067 y
+SDict begin H.S end
+ -2 2067 a -2 2067 a
+SDict begin 13 H.A end
+ -2 2067 a -2 2067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4398) cvn H.B /DEST pdfmark
+end
+ -2 2067
+a -2 2067 a
+SDict begin H.S end
+ -2 2067 a -2 2067 a
+SDict begin 13 H.A end
+ -2 2067 a -2 2067 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4399) cvn H.B /DEST pdfmark
+end
+ -2
+2067 a 396 2174 a Fy(Daemon=)739 2174 y
+SDict begin H.S end
+ 739 2174 a 739
+2174 a
+SDict begin 13 H.A end
+ 739 2174 a 739 2174 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4400) cvn H.B /DEST pdfmark
+end
+ 739 2174 a Fl(boolean)g
+FC(\227)h(Whether)f(to)g(become)f(a)i(daemon)d(\(def)o(ault:)h(no\))-2
+2355 y
+SDict begin H.S end
+ -2 2355 a -2 2355 a
+SDict begin 13 H.A end
+ -2 2355 a -2 2355 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4401) cvn H.B /DEST pdfmark
+end
+ -2 2355
+a -2 2355 a
+SDict begin H.S end
+ -2 2355 a -2 2355 a
+SDict begin 13 H.A end
+ -2 2355 a -2 2355 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4402) cvn H.B /DEST pdfmark
+end
+ -2
+2355 a 396 2448 a Fy(MessageHeader=)1007 2448 y
+SDict begin H.S end
+ 1007
+2448 a 1007 2448 a
+SDict begin 13 H.A end
+ 1007 2448 a 1007 2448 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4403) cvn H.B /DEST pdfmark
+end
+ 1007 2448
+a Fl("\\\045S)43 b(\\\045T)i(\\\045F)f(\\\045L)g(\\\045C")20
+b FC(\227)h(Specify)f(custom)f(format)g(for)h(message)g(header)-5
+b(.)-2 2632 y
+SDict begin H.S end
+ -2 2632 a -2 2632 a
+SDict begin 13 H.A end
+ -2 2632 a -2 2632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4404) cvn H.B /DEST pdfmark
+end
+
+-2 2632 a -2 2632 a
+SDict begin H.S end
+ -2 2632 a -2 2632 a
+SDict begin 13 H.A end
+ -2 2632 a -2
+2632 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4405) cvn H.B /DEST pdfmark
+end
+ -2 2632 a 396 2722 a Fy(V)d(ersionString=)934
+2722 y
+SDict begin H.S end
+ 934 2722 a 934 2722 a
+SDict begin 13 H.A end
+ 934 2722 a 934 2722 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4406) cvn H.B /DEST pdfmark
+end
+ 934
+2722 a Fl(string)25 b FC(\227)20 b(Set)h(v)o(ersion)e(string)h(to)g
+(include)g(in)g(\002le)h(signature)e(database)g(\(along)g(with)396
+2830 y(hostname)g(and)h(date\).)-2 3011 y
+SDict begin H.S end
+ -2 3011 a -2
+3011 a
+SDict begin 13 H.A end
+ -2 3011 a -2 3011 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4407) cvn H.B /DEST pdfmark
+end
+ -2 3011 a -2 3011 a
+SDict begin H.S end
+ -2 3011
+a -2 3011 a
+SDict begin 13 H.A end
+ -2 3011 a -2 3011 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4408) cvn H.B /DEST pdfmark
+end
+ -2 3011 a 396 3104 a
+Fy(SetRe)o(v)o(erseLookup=)1111 3104 y
+SDict begin H.S end
+ 1111 3104 a 1111
+3104 a
+SDict begin 13 H.A end
+ 1111 3104 a 1111 3104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4409) cvn H.B /DEST pdfmark
+end
+ 1111 3104 a Fl(boolean)g
+FC(\227)h(If)f(f)o(alse,)g(skip)g(re)n(v)o(erse)f(lookups)g(when)h
+(connecting)e(to)i(a)h(host)f(kno)n(wn)e(by)396 3212
+y(name)i(rather)f(than)h(IP)g(address.)-2 3379 y
+SDict begin H.S end
+ -2 3379
+a -2 3379 a
+SDict begin 13 H.A end
+ -2 3379 a -2 3379 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4410) cvn H.B /DEST pdfmark
+end
+ -2 3379 a -2 3379 a
+SDict begin H.S end
+ -2
+3379 a -2 3379 a
+SDict begin 13 H.A end
+ -2 3379 a -2 3379 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4411) cvn H.B /DEST pdfmark
+end
+ -2 3379 a 396 3486
+a Fy(HideSetup=)817 3486 y
+SDict begin H.S end
+ 817 3486 a 817 3486 a
+SDict begin 13 H.A end
+ 817
+3486 a 817 3486 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4412) cvn H.B /DEST pdfmark
+end
+ 817 3486 a Fl(boolean)h FC(\227)g(Don')o(t)e(log)g
+(names)h(of)g(con\002g/database)e(\002les)k(on)d(startup.)-2
+3670 y
+SDict begin H.S end
+ -2 3670 a -2 3670 a
+SDict begin 13 H.A end
+ -2 3670 a -2 3670 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4413) cvn H.B /DEST pdfmark
+end
+ -2 3670
+a -2 3670 a
+SDict begin H.S end
+ -2 3670 a -2 3670 a
+SDict begin 13 H.A end
+ -2 3670 a -2 3670 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4414) cvn H.B /DEST pdfmark
+end
+ -2
+3670 a 396 3760 a Fy(SyslogF)n(acility=)937 3760 y
+SDict begin H.S end
+ 937
+3760 a 937 3760 a
+SDict begin 13 H.A end
+ 937 3760 a 937 3760 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4415) cvn H.B /DEST pdfmark
+end
+ 937 3760 a Fl(LOG_xxx)k
+FC(\227)e(Set)g(syslog)e(f)o(acility)i(\(def)o(ault)e(is)i(LOG_A)-5
+b(UTHPRIV\).)-2 3944 y
+SDict begin H.S end
+ -2 3944 a -2 3944 a
+SDict begin 13 H.A end
+ -2 3944 a
+-2 3944 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4416) cvn H.B /DEST pdfmark
+end
+ -2 3944 a -2 3944 a
+SDict begin H.S end
+ -2 3944 a -2 3944 a
+SDict begin 13 H.A end
+ -2
+3944 a -2 3944 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4417) cvn H.B /DEST pdfmark
+end
+ -2 3944 a 396 4034 a Fy(MA)g(CT)f(ype=)810
+4034 y
+SDict begin H.S end
+ 810 4034 a 810 4034 a
+SDict begin 13 H.A end
+ 810 4034 a 810 4034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4418) cvn H.B /DEST pdfmark
+end
+ 810
+4034 a Fl(HASH-TIGER/HMAC-TIGER)20 b FC(\227)g(Set)h(type)f(of)g
+(message)g(authentication)e(code)h(\(HMA)m(C\).)h(Must)396
+4142 y(be)g(identical)g(on)g(client)g(and)g(serv)o(er)-5
+b(.)-2 4308 y
+SDict begin H.S end
+ -2 4308 a -2 4308 a
+SDict begin 13 H.A end
+ -2 4308 a -2 4308 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4419) cvn H.B /DEST pdfmark
+end
+
+-2 4308 a -2 4308 a
+SDict begin H.S end
+ -2 4308 a -2 4308 a
+SDict begin 13 H.A end
+ -2 4308 a -2
+4308 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4420) cvn H.B /DEST pdfmark
+end
+ -2 4308 a 396 4416 a Fy(SetLoopT)o(ime=)922 4416
+y
+SDict begin H.S end
+ 922 4416 a 922 4416 a
+SDict begin 13 H.A end
+ 922 4416 a 922 4416 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4421) cvn H.B /DEST pdfmark
+end
+ 922 4416
+a Fl(seconds)20 b FC(\227)h(Interv)n(al)e(between)g(timestamp)h
+(messages)g(\(60\).)-2 4600 y
+SDict begin H.S end
+ -2 4600 a -2 4600 a
+SDict begin 13 H.A end
+ -2
+4600 a -2 4600 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4422) cvn H.B /DEST pdfmark
+end
+ -2 4600 a -2 4600 a
+SDict begin H.S end
+ -2 4600 a -2 4600
+a
+SDict begin 13 H.A end
+ -2 4600 a -2 4600 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4423) cvn H.B /DEST pdfmark
+end
+ -2 4600 a 396 4690 a Fy(SetConsole=)836
+4690 y
+SDict begin H.S end
+ 836 4690 a 836 4690 a
+SDict begin 13 H.A end
+ 836 4690 a 836 4690 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4424) cvn H.B /DEST pdfmark
+end
+ 836
+4690 a Fl(device)g FC(\227)g(Set)h(the)f(console)g(de)n(vice)f(\(/de)n
+(v/console\).)-2 4870 y
+SDict begin H.S end
+ -2 4870 a -2 4870 a
+SDict begin 13 H.A end
+ -2 4870 a
+-2 4870 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4425) cvn H.B /DEST pdfmark
+end
+ -2 4870 a -2 4870 a
+SDict begin H.S end
+ -2 4870 a -2 4870 a
+SDict begin 13 H.A end
+ -2
+4870 a -2 4870 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4426) cvn H.B /DEST pdfmark
+end
+ -2 4870 a 396 4964 a Fy(MessageQueueActi)o(v)o(e=)1199
+4964 y
+SDict begin H.S end
+ 1199 4964 a 1199 4964 a
+SDict begin 13 H.A end
+ 1199 4964 a 1199 4964
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4427) cvn H.B /DEST pdfmark
+end
+ 1199 4964 a Fl(boolean)h FC(\227)h(Use)f(SysV)h(IPC)g(message)f
+(queue)f(\(f)o(alse\).)-2 5148 y
+SDict begin H.S end
+ -2 5148 a -2 5148 a
+SDict begin 13 H.A end
+
+-2 5148 a -2 5148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4428) cvn H.B /DEST pdfmark
+end
+ -2 5148 a -2 5148 a
+SDict begin H.S end
+ -2 5148 a -2
+5148 a
+SDict begin 13 H.A end
+ -2 5148 a -2 5148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4429) cvn H.B /DEST pdfmark
+end
+ -2 5148 a 396 5237 a Fy(Pr)o(eludeMapT)-8
+b(oInf)n(o=)1120 5237 y
+SDict begin H.S end
+ 1120 5237 a 1120 5237 a
+SDict begin 13 H.A end
+ 1120
+5237 a 1120 5237 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4430) cvn H.B /DEST pdfmark
+end
+ 1120 5237 a Fl(list)44 b(of)g(samhain)g(severities)
+20 b FC(\227)g(The)g(se)n(v)o(erities)g(that)g(should)g(be)g(mapped)e
+(to)396 5345 y(impact)i(se)n(v)o(erity)f('info')g(in)h(prelude)f
+(reports)g(\(def)o(ault:)h(none\).)e(This)j(option)e(is)i(only)e(a)n(v)
+n(ailable)h(with)g(libprelude)p Black 3620 5805 a Fx(120)p
+Black eop end
+%%Page: 121 126
+TeXDict begin 121 125 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.121) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2249 104 a
+Fx(Appendix)18 b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j
+(options)p Black 396 309 a FC(0.9.)396 583 y Fy(Pr)o(eludeMapT)-8
+b(oLo)o(w=)p Fl(list)44 b(of)h(samhain)e(severities)20
+b FC(\227)h(The)f(se)n(v)o(erities)g(that)g(should)f(be)h(mapped)f(to)
+396 691 y(impact)h(se)n(v)o(erity)f(')o(lo)n(w')h(in)g(prelude)f
+(reports)g(\(def)o(ault:)h(none\).)e(This)i(option)f(is)j(only)d(a)n(v)
+n(ailable)h(with)g(libprelude)396 799 y(0.9.)-2 966 y
+SDict begin H.S end
+
+-2 966 a -2 966 a
+SDict begin 13 H.A end
+ -2 966 a -2 966 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4434) cvn H.B /DEST pdfmark
+end
+ -2 966 a -2 966 a
+SDict begin H.S end
+
+-2 966 a -2 966 a
+SDict begin 13 H.A end
+ -2 966 a -2 966 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4435) cvn H.B /DEST pdfmark
+end
+ -2 966 a 396 1073
+a Fy(Pr)o(eludeMapT)-8 b(oMedium=)1273 1073 y
+SDict begin H.S end
+ 1273 1073
+a 1273 1073 a
+SDict begin 13 H.A end
+ 1273 1073 a 1273 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4436) cvn H.B /DEST pdfmark
+end
+ 1273 1073 a Fl(list)45
+b(of)g(samhain)e(severities)20 b FC(\227)h(The)e(se)n(v)o(erities)h
+(that)h(should)e(be)396 1180 y(mapped)g(to)h(impact)g(se)n(v)o(erity)f
+('medium')f(in)j(prelude)e(reports)g(\(def)o(ault:)g(none\).)g(This)h
+(option)f(is)i(only)e(a)n(v)n(ailable)396 1288 y(with)i(libprelude)d
+(0.9.)-2 1472 y
+SDict begin H.S end
+ -2 1472 a -2 1472 a
+SDict begin 13 H.A end
+ -2 1472 a -2 1472
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4437) cvn H.B /DEST pdfmark
+end
+ -2 1472 a -2 1472 a
+SDict begin H.S end
+ -2 1472 a -2 1472 a
+SDict begin 13 H.A end
+ -2 1472 a -2
+1472 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4438) cvn H.B /DEST pdfmark
+end
+ -2 1472 a 396 1562 a Fy(Pr)o(eludeMapT)-8 b(oHigh=)1150
+1562 y
+SDict begin H.S end
+ 1150 1562 a 1150 1562 a
+SDict begin 13 H.A end
+ 1150 1562 a 1150 1562
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4439) cvn H.B /DEST pdfmark
+end
+ 1150 1562 a Fl(list)44 b(of)g(samhain)g(severities)19
+b FC(\227)i(The)f(se)n(v)o(erities)g(that)g(should)f(be)i(mapped)396
+1670 y(to)g(impact)e(se)n(v)o(erity)h('high')e(in)j(prelude)d(reports)i
+(\(def)o(ault:)f(none\).)f(This)j(option)e(is)i(only)e(a)n(v)n(ailable)
+h(with)396 1778 y(libprelude)f(0.9.)-2 1962 y
+SDict begin H.S end
+ -2 1962
+a -2 1962 a
+SDict begin 13 H.A end
+ -2 1962 a -2 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4440) cvn H.B /DEST pdfmark
+end
+ -2 1962 a -2 1962 a
+SDict begin H.S end
+ -2
+1962 a -2 1962 a
+SDict begin 13 H.A end
+ -2 1962 a -2 1962 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4441) cvn H.B /DEST pdfmark
+end
+ -2 1962 a 396 2052
+a Fy(Pr)o(eludePr)o(o\002le=)954 2052 y
+SDict begin H.S end
+ 954 2052 a 954
+2052 a
+SDict begin 13 H.A end
+ 954 2052 a 954 2052 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4442) cvn H.B /DEST pdfmark
+end
+ 954 2052 a Fl(profile)f
+FC(\227)j(Set)g(the)f(pro\002le)g(\(sensor)f(name\))g(for)h(use)g(with)
+h(the)f(Prelude)f(IDS.)i(This)f(option)396 2160 y(is)h(only)f(a)n(v)n
+(ailable)f(with)i(libprelude)d(0.9.)i(Def)o(ault)f(is)j(')-5
+b(samhain')19 b(\(prelude)f(0.9\))h(or)h('Samhain')f(\(prelude)f
+(0.8\).)-2 2344 y
+SDict begin H.S end
+ -2 2344 a -2 2344 a
+SDict begin 13 H.A end
+ -2 2344 a -2 2344
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4443) cvn H.B /DEST pdfmark
+end
+ -2 2344 a -2 2344 a
+SDict begin H.S end
+ -2 2344 a -2 2344 a
+SDict begin 13 H.A end
+ -2 2344 a -2
+2344 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4444) cvn H.B /DEST pdfmark
+end
+ -2 2344 a 396 2434 a Fy(SetMailT)o(ime=)903 2434
+y
+SDict begin H.S end
+ 903 2434 a 903 2434 a
+SDict begin 13 H.A end
+ 903 2434 a 903 2434 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4445) cvn H.B /DEST pdfmark
+end
+ 903 2434
+a Fl(seconds)i FC(\227)h(Maximum)e(time)h(interv)n(al)g(between)f(mail)
+h(messages)h(\(86400)d(sec\).)-2 2618 y
+SDict begin H.S end
+ -2 2618 a -2
+2618 a
+SDict begin 13 H.A end
+ -2 2618 a -2 2618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4446) cvn H.B /DEST pdfmark
+end
+ -2 2618 a -2 2618 a
+SDict begin H.S end
+ -2 2618
+a -2 2618 a
+SDict begin 13 H.A end
+ -2 2618 a -2 2618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4447) cvn H.B /DEST pdfmark
+end
+ -2 2618 a 396 2708 a
+Fy(SetMailNum=)895 2708 y
+SDict begin H.S end
+ 895 2708 a 895 2708 a
+SDict begin 13 H.A end
+ 895 2708
+a 895 2708 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4448) cvn H.B /DEST pdfmark
+end
+ 895 2708 a Fl(0)45 b(--)g(127)22 b FC(\227)e(Maximum)f
+(number)f(of)i(pending)f(mails)h(on)g(internal)f(queue)g(\(10\).)-2
+2892 y
+SDict begin H.S end
+ -2 2892 a -2 2892 a
+SDict begin 13 H.A end
+ -2 2892 a -2 2892 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4449) cvn H.B /DEST pdfmark
+end
+ -2 2892
+a -2 2892 a
+SDict begin H.S end
+ -2 2892 a -2 2892 a
+SDict begin 13 H.A end
+ -2 2892 a -2 2892 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4450) cvn H.B /DEST pdfmark
+end
+ -2
+2892 a 396 2982 a Fy(SetMailAddr)o(ess=)1009 2982 y
+SDict begin H.S end
+ 1009
+2982 a 1009 2982 a
+SDict begin 13 H.A end
+ 1009 2982 a 1009 2982 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4451) cvn H.B /DEST pdfmark
+end
+ 1009 2982
+a Fl(recepient)h FC(\227)g(Add)g(a)h(recepient)e(e-mail)h(address)f
+(\(max.)g(8\).)-2 3166 y
+SDict begin H.S end
+ -2 3166 a -2 3166 a
+SDict begin 13 H.A end
+ -2 3166
+a -2 3166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4452) cvn H.B /DEST pdfmark
+end
+ -2 3166 a -2 3166 a
+SDict begin H.S end
+ -2 3166 a -2 3166 a
+SDict begin 13 H.A end
+ -2
+3166 a -2 3166 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4453) cvn H.B /DEST pdfmark
+end
+ -2 3166 a 396 3256 a Fy(SetMailRelay=)924
+3256 y
+SDict begin H.S end
+ 924 3256 a 924 3256 a
+SDict begin 13 H.A end
+ 924 3256 a 924 3256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4454) cvn H.B /DEST pdfmark
+end
+ 924
+3256 a Fl(IP)44 b(address)20 b FC(\227)h(The)e(mail)i(relay)f(\(for)f
+(of)n(fsite)h(mail;)g(def)o(ault:)g(none\).)-2 3440 y
+SDict begin H.S end
+
+-2 3440 a -2 3440 a
+SDict begin 13 H.A end
+ -2 3440 a -2 3440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4455) cvn H.B /DEST pdfmark
+end
+ -2 3440 a -2
+3440 a
+SDict begin H.S end
+ -2 3440 a -2 3440 a
+SDict begin 13 H.A end
+ -2 3440 a -2 3440 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4456) cvn H.B /DEST pdfmark
+end
+ -2 3440
+a 396 3530 a Fy(MailSubject=)877 3530 y
+SDict begin H.S end
+ 877 3530 a 877
+3530 a
+SDict begin 13 H.A end
+ 877 3530 a 877 3530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4457) cvn H.B /DEST pdfmark
+end
+ 877 3530 a Fl(string)25
+b FC(\227)c(Custom)f(format)f(for)h(the)g(email)g(subject)g(\(none\).)
+-2 3714 y
+SDict begin H.S end
+ -2 3714 a -2 3714 a
+SDict begin 13 H.A end
+ -2 3714 a -2 3714 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4458) cvn H.B /DEST pdfmark
+end
+ -2
+3714 a -2 3714 a
+SDict begin H.S end
+ -2 3714 a -2 3714 a
+SDict begin 13 H.A end
+ -2 3714 a -2 3714
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4459) cvn H.B /DEST pdfmark
+end
+ -2 3714 a 396 3804 a Fy(SetMailSender=)969 3804 y
+SDict begin H.S end
+ 969
+3804 a 969 3804 a
+SDict begin 13 H.A end
+ 969 3804 a 969 3804 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4460) cvn H.B /DEST pdfmark
+end
+ 969 3804 a Fl(string)26
+b FC(\227)20 b(Sender)g(for)f(the)h('From:')f(\002eld.)-2
+3980 y
+SDict begin H.S end
+ -2 3980 a -2 3980 a
+SDict begin 13 H.A end
+ -2 3980 a -2 3980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4461) cvn H.B /DEST pdfmark
+end
+ -2 3980
+a -2 3980 a
+SDict begin H.S end
+ -2 3980 a -2 3980 a
+SDict begin 13 H.A end
+ -2 3980 a -2 3980 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4462) cvn H.B /DEST pdfmark
+end
+ -2
+3980 a 396 4078 a Fy(SetMailFilterAnd=)1071 4078 y
+SDict begin H.S end
+ 1071
+4078 a 1071 4078 a
+SDict begin 13 H.A end
+ 1071 4078 a 1071 4078 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4463) cvn H.B /DEST pdfmark
+end
+ 1071 4078
+a Fl(list)g FC(\227)h(De\002nes)g(a)g(list)h(of)e(strings)g(all)h(of)g
+(which)f(must)g(match)g(a)h(message,)f(otherwise)g(it)396
+4186 y(will)i(not)f(be)g(mailed.)-2 4353 y
+SDict begin H.S end
+ -2 4353 a
+-2 4353 a
+SDict begin 13 H.A end
+ -2 4353 a -2 4353 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4464) cvn H.B /DEST pdfmark
+end
+ -2 4353 a -2 4353 a
+SDict begin H.S end
+ -2
+4353 a -2 4353 a
+SDict begin 13 H.A end
+ -2 4353 a -2 4353 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4465) cvn H.B /DEST pdfmark
+end
+ -2 4353 a 396 4460
+a Fy(SetMailFilterOr=)1021 4460 y
+SDict begin H.S end
+ 1021 4460 a 1021 4460
+a
+SDict begin 13 H.A end
+ 1021 4460 a 1021 4460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4466) cvn H.B /DEST pdfmark
+end
+ 1021 4460 a Fl(list)f FC(\227)i(De\002nes)f
+(a)h(list)g(of)f(strings)g(at)h(least)g(one)e(of)h(which)g(must)g
+(match)g(a)h(message,)396 4568 y(otherwise)f(it)h(will)g(not)f(be)g
+(mailed.)-2 4735 y
+SDict begin H.S end
+ -2 4735 a -2 4735 a
+SDict begin 13 H.A end
+ -2 4735 a -2 4735
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4467) cvn H.B /DEST pdfmark
+end
+ -2 4735 a -2 4735 a
+SDict begin H.S end
+ -2 4735 a -2 4735 a
+SDict begin 13 H.A end
+ -2 4735 a -2
+4735 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4468) cvn H.B /DEST pdfmark
+end
+ -2 4735 a 396 4842 a Fy(SetMailFilterNot=)1049
+4842 y
+SDict begin H.S end
+ 1049 4842 a 1049 4842 a
+SDict begin 13 H.A end
+ 1049 4842 a 1049 4842
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4469) cvn H.B /DEST pdfmark
+end
+ 1049 4842 a Fl(list)f FC(\227)i(De\002nes)f(a)h(list)g(of)f(strings)g
+(none)f(of)h(which)g(should)f(match)g(a)i(message,)396
+4950 y(otherwise)f(it)h(will)g(not)f(be)g(mailed.)-2
+5117 y
+SDict begin H.S end
+ -2 5117 a -2 5117 a
+SDict begin 13 H.A end
+ -2 5117 a -2 5117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4470) cvn H.B /DEST pdfmark
+end
+ -2 5117
+a -2 5117 a
+SDict begin H.S end
+ -2 5117 a -2 5117 a
+SDict begin 13 H.A end
+ -2 5117 a -2 5117 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4471) cvn H.B /DEST pdfmark
+end
+ -2
+5117 a 396 5224 a Fy(SamhainP)o(ath=)923 5224 y
+SDict begin H.S end
+ 923 5224
+a 923 5224 a
+SDict begin 13 H.A end
+ 923 5224 a 923 5224 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4472) cvn H.B /DEST pdfmark
+end
+ 923 5224 a Fl(path)h
+FC(\227)f(The)g(path)g(of)g(the)g(process)g(image.)p
+Black 3620 5805 a Fx(121)p Black eop end
+%%Page: 122 127
+TeXDict begin 122 126 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.122) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4524) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4473) cvn H.B /DEST pdfmark
+end
+ -2
+226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4474) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a Fy(SetBindAddr)o(ess=)1013 309 y
+SDict begin H.S end
+ 1013
+309 a 1013 309 a
+SDict begin 13 H.A end
+ 1013 309 a 1013 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4475) cvn H.B /DEST pdfmark
+end
+ 1013 309 a Fl(IP)46
+b(address)20 b FC(\227)g(The)g(IP)h(address)f(\(i.e.)f(interf)o(ace)h
+(on)g(multi-interf)o(ace)e(box\))h(to)h(use)h(for)396
+417 y(outgoing)d(connections)h(\(e.g.)g(e-mail\).)-2
+601 y
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4476) cvn H.B /DEST pdfmark
+end
+ -2 601 a -2
+601 a
+SDict begin H.S end
+ -2 601 a -2 601 a
+SDict begin 13 H.A end
+ -2 601 a -2 601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4477) cvn H.B /DEST pdfmark
+end
+ -2 601 a 396
+691 a Fy(SetT)o(imeSer)o(v)o(er=)971 691 y
+SDict begin H.S end
+ 971 691 a
+971 691 a
+SDict begin 13 H.A end
+ 971 691 a 971 691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4478) cvn H.B /DEST pdfmark
+end
+ 971 691 a Fl(IP)44 b(address)20
+b FC(\227)h(The)f(time)g(serv)o(er)-5 b(.)20 b(Note)g(that)g(the)g
+(simple)h(')o(time')e(service)h(\(port)f(37/tcp\))396
+799 y(is)i(used.)-2 965 y
+SDict begin H.S end
+ -2 965 a -2 965 a
+SDict begin 13 H.A end
+ -2 965 a
+-2 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4479) cvn H.B /DEST pdfmark
+end
+ -2 965 a -2 965 a
+SDict begin H.S end
+ -2 965 a -2 965 a
+SDict begin 13 H.A end
+ -2 965 a
+-2 965 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4480) cvn H.B /DEST pdfmark
+end
+ -2 965 a 396 1073 a Fy(T)-6 b(rustedUser=)884
+1073 y
+SDict begin H.S end
+ 884 1073 a 884 1073 a
+SDict begin 13 H.A end
+ 884 1073 a 884 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4481) cvn H.B /DEST pdfmark
+end
+ 884
+1073 a Fl(username\(,username,..\))p FC(.)18 b(\227)i(List)h(of)f
+(additional)f(trusted)h(users.)-2 1247 y
+SDict begin H.S end
+ -2 1247 a -2
+1247 a
+SDict begin 13 H.A end
+ -2 1247 a -2 1247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4482) cvn H.B /DEST pdfmark
+end
+ -2 1247 a -2 1247 a
+SDict begin H.S end
+ -2 1247
+a -2 1247 a
+SDict begin 13 H.A end
+ -2 1247 a -2 1247 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4483) cvn H.B /DEST pdfmark
+end
+ -2 1247 a 396 1346 a
+Fy(SetLog\002leP)o(ath=)965 1346 y
+SDict begin H.S end
+ 965 1346 a 965 1346
+a
+SDict begin 13 H.A end
+ 965 1346 a 965 1346 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4484) cvn H.B /DEST pdfmark
+end
+ 965 1346 a Fl(AUTO)43 b(or)i(/path)20
+b FC(\227)g(P)o(ath)g(to)f(log)h(\002le)g(\(A)-5 b(UT)o(O)19
+b(to)h(tack)f(hostname)f(on)i(compiled-in)d(path\).)-2
+1530 y
+SDict begin H.S end
+ -2 1530 a -2 1530 a
+SDict begin 13 H.A end
+ -2 1530 a -2 1530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4485) cvn H.B /DEST pdfmark
+end
+ -2 1530
+a -2 1530 a
+SDict begin H.S end
+ -2 1530 a -2 1530 a
+SDict begin 13 H.A end
+ -2 1530 a -2 1530 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4486) cvn H.B /DEST pdfmark
+end
+ -2
+1530 a 396 1620 a Fy(SetLock\002leP)o(ath=)1006 1620
+y
+SDict begin H.S end
+ 1006 1620 a 1006 1620 a
+SDict begin 13 H.A end
+ 1006 1620 a 1006 1620 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4487) cvn H.B /DEST pdfmark
+end
+ 1006
+1620 a Fl(AUTO)44 b(or)g(/path)q FC(\227)20 b(P)o(ath)g(to)h(lock)e
+(\002le)i(\(A)-5 b(UT)o(O)20 b(to)g(tack)g(hostname)f(on)h(compiled-in)
+396 1728 y(path\).)-2 1912 y
+SDict begin H.S end
+ -2 1912 a -2 1912 a
+SDict begin 13 H.A end
+ -2 1912
+a -2 1912 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4488) cvn H.B /DEST pdfmark
+end
+ -2 1912 a 396 2002 a FC(The)g(follo)n(wing)f(options)g(are)
+h(only)f(rele)n(v)n(ant)g(for)h(standalone)f(or)h(client)g(e)o(x)o
+(ecutables:)-2 2186 y
+SDict begin H.S end
+ -2 2186 a -2 2186 a
+SDict begin 13 H.A end
+ -2 2186 a -2
+2186 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4489) cvn H.B /DEST pdfmark
+end
+ -2 2186 a -2 2186 a
+SDict begin H.S end
+ -2 2186 a -2 2186 a
+SDict begin 13 H.A end
+ -2 2186
+a -2 2186 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4490) cvn H.B /DEST pdfmark
+end
+ -2 2186 a 396 2276 a Fy(SetNiceLe)o(v)o(el=)903
+2276 y
+SDict begin H.S end
+ 903 2276 a 903 2276 a
+SDict begin 13 H.A end
+ 903 2276 a 903 2276 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4491) cvn H.B /DEST pdfmark
+end
+ 903
+2276 a Fl(-19..19)f FC(\227)i(Set)g(scheduling)d(priority)h(during)g
+(\002le)i(check.)e(\227)h(\(see)h('man)e(nice'\).)-2
+2460 y
+SDict begin H.S end
+ -2 2460 a -2 2460 a
+SDict begin 13 H.A end
+ -2 2460 a -2 2460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4492) cvn H.B /DEST pdfmark
+end
+ -2 2460
+a -2 2460 a
+SDict begin H.S end
+ -2 2460 a -2 2460 a
+SDict begin 13 H.A end
+ -2 2460 a -2 2460 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4493) cvn H.B /DEST pdfmark
+end
+ -2
+2460 a 396 2550 a Fy(SetIOLimit=)849 2550 y
+SDict begin H.S end
+ 849 2550
+a 849 2550 a
+SDict begin 13 H.A end
+ 849 2550 a 849 2550 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4494) cvn H.B /DEST pdfmark
+end
+ 849 2550 a Fl(bps)i
+FC(\227)g(Set)g(IO)f(limits)h(\(kilobytes)e(per)h(second\))f(for)g
+(\002le)i(check.)-2 2734 y
+SDict begin H.S end
+ -2 2734 a -2 2734 a
+SDict begin 13 H.A end
+ -2 2734
+a -2 2734 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4495) cvn H.B /DEST pdfmark
+end
+ -2 2734 a -2 2734 a
+SDict begin H.S end
+ -2 2734 a -2 2734 a
+SDict begin 13 H.A end
+ -2
+2734 a -2 2734 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4496) cvn H.B /DEST pdfmark
+end
+ -2 2734 a 396 2824 a Fy(SetFilecheckT)o(ime=)1074
+2824 y
+SDict begin H.S end
+ 1074 2824 a 1074 2824 a
+SDict begin 13 H.A end
+ 1074 2824 a 1074 2824
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4497) cvn H.B /DEST pdfmark
+end
+ 1074 2824 a Fl(seconds)f FC(\227)h(Interv)n(al)e(between)g(\002le)i
+(checks)f(\(600\).)-2 3005 y
+SDict begin H.S end
+ -2 3005 a -2 3005 a
+SDict begin 13 H.A end
+ -2 3005
+a -2 3005 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4498) cvn H.B /DEST pdfmark
+end
+ -2 3005 a -2 3005 a
+SDict begin H.S end
+ -2 3005 a -2 3005 a
+SDict begin 13 H.A end
+ -2
+3005 a -2 3005 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4499) cvn H.B /DEST pdfmark
+end
+ -2 3005 a 396 3098 a Fy(FileCheckScheduleOne=)1269
+3098 y
+SDict begin H.S end
+ 1269 3098 a 1269 3098 a
+SDict begin 13 H.A end
+ 1269 3098 a 1269 3098
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4500) cvn H.B /DEST pdfmark
+end
+ 1269 3098 a Fl(schedule)p FC(\227)g(Crontab-lik)o(e)f(schedule)g(for)
+g(\002le)i(checks.)-2 3266 y
+SDict begin H.S end
+ -2 3266 a -2 3266 a
+SDict begin 13 H.A end
+ -2 3266
+a -2 3266 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4501) cvn H.B /DEST pdfmark
+end
+ -2 3266 a -2 3266 a
+SDict begin H.S end
+ -2 3266 a -2 3266 a
+SDict begin 13 H.A end
+ -2
+3266 a -2 3266 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4502) cvn H.B /DEST pdfmark
+end
+ -2 3266 a 396 3372 a Fy(UseHardlinkCheck=)1126
+3372 y
+SDict begin H.S end
+ 1126 3372 a 1126 3372 a
+SDict begin 13 H.A end
+ 1126 3372 a 1126 3372
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4503) cvn H.B /DEST pdfmark
+end
+ 1126 3372 a Fl(boolean)q FC(\227)f(Compare)f(number)f(of)i(hardlinks)
+f(to)h(number)f(of)h(subdirectories)e(for)396 3480 y(directories.)-2
+3647 y
+SDict begin H.S end
+ -2 3647 a -2 3647 a
+SDict begin 13 H.A end
+ -2 3647 a -2 3647 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4504) cvn H.B /DEST pdfmark
+end
+ -2 3647
+a -2 3647 a
+SDict begin H.S end
+ -2 3647 a -2 3647 a
+SDict begin 13 H.A end
+ -2 3647 a -2 3647 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4505) cvn H.B /DEST pdfmark
+end
+ -2
+3647 a 396 3754 a Fy(HardlinkOffset=)989 3754 y
+SDict begin H.S end
+ 989 3754
+a 989 3754 a
+SDict begin 13 H.A end
+ 989 3754 a 989 3754 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4506) cvn H.B /DEST pdfmark
+end
+ 989 3754 a Fl(N)10
+b Fy(:)1072 3754 y
+SDict begin H.S end
+ 1072 3754 a 1072 3754 a
+SDict begin 13 H.A end
+ 1072 3754
+a 1072 3754 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4507) cvn H.B /DEST pdfmark
+end
+ 1072 3754 a Fl(/path)19 b FC(\227)i(Exception)d(\(use)i
+(multiple)g(times)g(for)g(multiple)g(e)o(xceptions\).)e(N)i(is)h(of)n
+(fset)396 3862 y(\(actual)f(-)g(e)o(xpected)f(hardlinks\))f(for)1481
+3862 y
+SDict begin H.S end
+ 1481 3862 a 1481 3862 a
+SDict begin 13 H.A end
+ 1481 3862 a 1481 3862
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4508) cvn H.B /DEST pdfmark
+end
+ 1481 3862 a Fr(/path)p FC(.)-2 4046 y
+SDict begin H.S end
+ -2 4046 a -2
+4046 a
+SDict begin 13 H.A end
+ -2 4046 a -2 4046 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4509) cvn H.B /DEST pdfmark
+end
+ -2 4046 a -2 4046 a
+SDict begin H.S end
+ -2 4046
+a -2 4046 a
+SDict begin 13 H.A end
+ -2 4046 a -2 4046 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4510) cvn H.B /DEST pdfmark
+end
+ -2 4046 a 396 4136 a
+Fy(AddOKChars=)942 4136 y
+SDict begin H.S end
+ 942 4136 a 942 4136 a
+SDict begin 13 H.A end
+ 942 4136
+a 942 4136 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4511) cvn H.B /DEST pdfmark
+end
+ 942 4136 a Fl(N1,)44 b(N2,)g(..)21 b FC(\227)f(List)h(of)e
+(acceptable)g(characters)g(\(byte)g(v)n(alue\(s\)\))f(for)h(the)h
+(check)f(for)g(weird)396 4244 y(\002lenames.)h(Nn)g(may)g(be)g(he)o(x)f
+(\(leading)g('0x':)g(0xNN\),)g(octal)i(\(leading)d(zero:)i(0NNN\),)g
+(or)g(decimal.)f(Use)i('all')396 4352 y(for)f(all.)-2
+4519 y
+SDict begin H.S end
+ -2 4519 a -2 4519 a
+SDict begin 13 H.A end
+ -2 4519 a -2 4519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4512) cvn H.B /DEST pdfmark
+end
+ -2 4519
+a -2 4519 a
+SDict begin H.S end
+ -2 4519 a -2 4519 a
+SDict begin 13 H.A end
+ -2 4519 a -2 4519 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4513) cvn H.B /DEST pdfmark
+end
+ -2
+4519 a 396 4626 a Fy(Ignor)o(eAdded=)913 4626 y
+SDict begin H.S end
+ 913 4626
+a 913 4626 a
+SDict begin 13 H.A end
+ 913 4626 a 913 4626 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4514) cvn H.B /DEST pdfmark
+end
+ 913 4626 a Fl(path_regex)5
+b FC(\227)19 b(Ignore)f(if)j(this)g(\002le/directory)d(is)j
+(added/created.)-2 4810 y
+SDict begin H.S end
+ -2 4810 a -2 4810 a
+SDict begin 13 H.A end
+ -2 4810
+a -2 4810 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4515) cvn H.B /DEST pdfmark
+end
+ -2 4810 a -2 4810 a
+SDict begin H.S end
+ -2 4810 a -2 4810 a
+SDict begin 13 H.A end
+ -2
+4810 a -2 4810 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4516) cvn H.B /DEST pdfmark
+end
+ -2 4810 a 396 4900 a Fy(Ignor)o(eMissing=)954
+4900 y
+SDict begin H.S end
+ 954 4900 a 954 4900 a
+SDict begin 13 H.A end
+ 954 4900 a 954 4900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4517) cvn H.B /DEST pdfmark
+end
+ 954
+4900 a Fl(path_regex)5 b FC(\227)19 b(Ignore)g(if)h(this)h
+(\002le/directory)e(is)i(missing/deleted.)-2 5084 y
+SDict begin H.S end
+ -2
+5084 a -2 5084 a
+SDict begin 13 H.A end
+ -2 5084 a -2 5084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4518) cvn H.B /DEST pdfmark
+end
+ -2 5084 a -2 5084
+a
+SDict begin H.S end
+ -2 5084 a -2 5084 a
+SDict begin 13 H.A end
+ -2 5084 a -2 5084 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4519) cvn H.B /DEST pdfmark
+end
+ -2 5084 a 396
+5174 a Fy(ReportOnlyOnce=)1054 5174 y
+SDict begin H.S end
+ 1054 5174 a 1054
+5174 a
+SDict begin 13 H.A end
+ 1054 5174 a 1054 5174 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4520) cvn H.B /DEST pdfmark
+end
+ 1054 5174 a Fl(boolean)e
+FC(\227)i(Report)f(only)f(once)g(on)h(a)h(modi\002ed)e(\002le)i
+(\(yes\).)p Black 3620 5805 a Fx(122)p Black eop end
+%%Page: 123 128
+TeXDict begin 123 127 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.123) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2249 104 a
+Fx(Appendix)18 b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j
+(options)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a
+-2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4521) cvn H.B /DEST pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a
+-2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4522) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a Fy(ReportFullDetail=)1049
+309 y
+SDict begin H.S end
+ 1049 309 a 1049 309 a
+SDict begin 13 H.A end
+ 1049 309 a 1049 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4523) cvn H.B /DEST pdfmark
+end
+ 1049
+309 a Fl(boolean)f FC(\227)i(Report)f(in)g(full)g(detail)h(on)e
+(modi\002ed)g(\002les)i(\(no\).)396 583 y Fy(UseLocalT)o(ime=)p
+Fl(boolean)g FC(\227)f(Report)g(\002le)h(timestamps)f(in)g(local)g
+(time)h(rather)e(than)h(GMT)g(\(no\).)f(Do)h(not)g(use)396
+691 y(this)h(with)f(Beltane.)-2 857 y
+SDict begin H.S end
+ -2 857 a -2 857
+a
+SDict begin 13 H.A end
+ -2 857 a -2 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4527) cvn H.B /DEST pdfmark
+end
+ -2 857 a -2 857 a
+SDict begin H.S end
+ -2 857 a -2 857
+a
+SDict begin 13 H.A end
+ -2 857 a -2 857 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4528) cvn H.B /DEST pdfmark
+end
+ -2 857 a 396 965 a Fy(ChecksumT)-8
+b(est=)960 965 y
+SDict begin H.S end
+ 960 965 a 960 965 a
+SDict begin 13 H.A end
+ 960 965 a 960 965
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4529) cvn H.B /DEST pdfmark
+end
+ 960 965 a Fl(none/init/update/check)22 b FC(\227)f(The)f(def)o(ault)f
+(action)h(\(def)o(ault)f(is)i(none\).)-2 1145 y
+SDict begin H.S end
+ -2 1145
+a -2 1145 a
+SDict begin 13 H.A end
+ -2 1145 a -2 1145 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4530) cvn H.B /DEST pdfmark
+end
+ -2 1145 a -2 1145 a
+SDict begin H.S end
+ -2
+1145 a -2 1145 a
+SDict begin 13 H.A end
+ -2 1145 a -2 1145 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4531) cvn H.B /DEST pdfmark
+end
+ -2 1145 a 396 1239
+a Fy(SetPr)o(elinkP)o(ath=)982 1239 y
+SDict begin H.S end
+ 982 1239 a 982
+1239 a
+SDict begin 13 H.A end
+ 982 1239 a 982 1239 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4532) cvn H.B /DEST pdfmark
+end
+ 982 1239 a Fl(path)f FC(\227)h(The)f(path)
+f(to)i(the)f(prelink)f(binary)g(\(def)o(ault)g(is)2650
+1239 y
+SDict begin H.S end
+ 2650 1239 a 2650 1239 a
+SDict begin 13 H.A end
+ 2650 1239 a 2650 1239
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4533) cvn H.B /DEST pdfmark
+end
+ 2650 1239 a Fr(/usr/sbin/prelink)p FC(\).)-2 1423 y
+SDict begin H.S end
+
+-2 1423 a -2 1423 a
+SDict begin 13 H.A end
+ -2 1423 a -2 1423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4534) cvn H.B /DEST pdfmark
+end
+ -2 1423 a -2
+1423 a
+SDict begin H.S end
+ -2 1423 a -2 1423 a
+SDict begin 13 H.A end
+ -2 1423 a -2 1423 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4535) cvn H.B /DEST pdfmark
+end
+ -2 1423
+a 396 1513 a Fy(SetPr)o(elinkChecksum=)1189 1513 y
+SDict begin H.S end
+ 1189
+1513 a 1189 1513 a
+SDict begin 13 H.A end
+ 1189 1513 a 1189 1513 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4536) cvn H.B /DEST pdfmark
+end
+ 1189 1513
+a Fl(checksum)k FC(\227)e(The)f(checksum)f(of)h(the)g(prelink)f(binary)
+-5 b(.)-2 1697 y
+SDict begin H.S end
+ -2 1697 a -2 1697 a
+SDict begin 13 H.A end
+ -2 1697 a -2 1697
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4537) cvn H.B /DEST pdfmark
+end
+ -2 1697 a -2 1697 a
+SDict begin H.S end
+ -2 1697 a -2 1697 a
+SDict begin 13 H.A end
+ -2 1697 a -2
+1697 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4538) cvn H.B /DEST pdfmark
+end
+ -2 1697 a 396 1786 a Fy(SetLogSer)o(v)o(er=)927
+1786 y
+SDict begin H.S end
+ 927 1786 a 927 1786 a
+SDict begin 13 H.A end
+ 927 1786 a 927 1786 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4539) cvn H.B /DEST pdfmark
+end
+ 927
+1786 a Fl(IP)44 b(address)20 b FC(\227)g(The)g(log)g(serv)o(er)-5
+b(.)-2 1971 y
+SDict begin H.S end
+ -2 1971 a -2 1971 a
+SDict begin 13 H.A end
+ -2 1971 a -2 1971 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4540) cvn H.B /DEST pdfmark
+end
+
+-2 1971 a -2 1971 a
+SDict begin H.S end
+ -2 1971 a -2 1971 a
+SDict begin 13 H.A end
+ -2 1971 a -2
+1971 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4541) cvn H.B /DEST pdfmark
+end
+ -2 1971 a 396 2060 a Fy(SetDatabaseP)o(ath=)1049
+2060 y
+SDict begin H.S end
+ 1049 2060 a 1049 2060 a
+SDict begin 13 H.A end
+ 1049 2060 a 1049 2060
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4542) cvn H.B /DEST pdfmark
+end
+ 1049 2060 a Fl(AUTO)42 b(or)j(/path)q FC(\227)20 b(P)o(ath)g(to)g
+(database)g(\(A)-5 b(UT)o(O)19 b(to)i(tack)f(hostname)f(on)h
+(compiled-in)396 2168 y(path\).)-2 2352 y
+SDict begin H.S end
+ -2 2352 a -2
+2352 a
+SDict begin 13 H.A end
+ -2 2352 a -2 2352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4543) cvn H.B /DEST pdfmark
+end
+ -2 2352 a -2 2352 a
+SDict begin H.S end
+ -2 2352
+a -2 2352 a
+SDict begin 13 H.A end
+ -2 2352 a -2 2352 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4544) cvn H.B /DEST pdfmark
+end
+ -2 2352 a 396 2442 a
+Fy(DigestAlgo=)832 2442 y
+SDict begin H.S end
+ 832 2442 a 832 2442 a
+SDict begin 13 H.A end
+ 832 2442
+a 832 2442 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4545) cvn H.B /DEST pdfmark
+end
+ 832 2442 a Fl(SHA1)43 b(or)i(MD5)21 b FC(\227)g(Use)g
+(SHA1)f(or)g(MD5)g(instead)g(of)g(the)g(TIGER)h(checksum)d(\(def)o
+(ault:)396 2550 y(TIGER192\).)-2 2731 y
+SDict begin H.S end
+ -2 2731 a -2
+2731 a
+SDict begin 13 H.A end
+ -2 2731 a -2 2731 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4546) cvn H.B /DEST pdfmark
+end
+ -2 2731 a -2 2731 a
+SDict begin H.S end
+ -2 2731
+a -2 2731 a
+SDict begin 13 H.A end
+ -2 2731 a -2 2731 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4547) cvn H.B /DEST pdfmark
+end
+ -2 2731 a 396 2824 a
+Fy(RedefReadOnly=)1012 2824 y
+SDict begin H.S end
+ 1012 2824 a 1012 2824 a
+SDict begin 13 H.A end
+
+1012 2824 a 1012 2824 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4548) cvn H.B /DEST pdfmark
+end
+ 1012 2824 a Fl(+XXX)43 b(or)i(-XXX)26
+b FC(\227)21 b(Add)f(or)g(subtract)f(test)i(XXX)g(from)e(the)h
+(ReadOnly)g(polic)o(y)-5 b(.)-2 3008 y
+SDict begin H.S end
+ -2 3008 a -2 3008
+a
+SDict begin 13 H.A end
+ -2 3008 a -2 3008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4549) cvn H.B /DEST pdfmark
+end
+ -2 3008 a -2 3008 a
+SDict begin H.S end
+ -2 3008 a -2
+3008 a
+SDict begin 13 H.A end
+ -2 3008 a -2 3008 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4550) cvn H.B /DEST pdfmark
+end
+ -2 3008 a 396 3098 a Fy(RedefAttrib)n(utes=)
+1014 3098 y
+SDict begin H.S end
+ 1014 3098 a 1014 3098 a
+SDict begin 13 H.A end
+ 1014 3098 a 1014
+3098 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4551) cvn H.B /DEST pdfmark
+end
+ 1014 3098 a Fl(+XXX)44 b(or)g(-XXX)27 b FC(\227)21
+b(Add)f(or)f(subtract)h(test)h(XXX)g(from)e(the)h(Attrib)n(utes)g
+(polic)o(y)-5 b(.)-2 3282 y
+SDict begin H.S end
+ -2 3282 a -2 3282 a
+SDict begin 13 H.A end
+ -2 3282
+a -2 3282 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4552) cvn H.B /DEST pdfmark
+end
+ -2 3282 a -2 3282 a
+SDict begin H.S end
+ -2 3282 a -2 3282 a
+SDict begin 13 H.A end
+ -2
+3282 a -2 3282 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4553) cvn H.B /DEST pdfmark
+end
+ -2 3282 a 396 3372 a Fy(RedefLogFiles=)956
+3372 y
+SDict begin H.S end
+ 956 3372 a 956 3372 a
+SDict begin 13 H.A end
+ 956 3372 a 956 3372 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4554) cvn H.B /DEST pdfmark
+end
+ 956
+3372 a Fl(+XXX)44 b(or)g(-XXX)27 b FC(\227)21 b(Add)e(or)h(subtract)g
+(test)h(XXX)g(from)e(the)h(LogFiles)g(polic)o(y)-5 b(.)-2
+3556 y
+SDict begin H.S end
+ -2 3556 a -2 3556 a
+SDict begin 13 H.A end
+ -2 3556 a -2 3556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4555) cvn H.B /DEST pdfmark
+end
+ -2 3556
+a -2 3556 a
+SDict begin H.S end
+ -2 3556 a -2 3556 a
+SDict begin 13 H.A end
+ -2 3556 a -2 3556 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4556) cvn H.B /DEST pdfmark
+end
+ -2
+3556 a 396 3646 a Fy(RedefGr)o(o)o(wingLogFiles=)1269
+3646 y
+SDict begin H.S end
+ 1269 3646 a 1269 3646 a
+SDict begin 13 H.A end
+ 1269 3646 a 1269 3646
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4557) cvn H.B /DEST pdfmark
+end
+ 1269 3646 a Fl(-XXX)42 b(or)i(~XXX)27 b FC(\227)21
+b(Add)f(or)g(subtract)f(test)i(XXX)g(from)e(the)h(Gro)n(wingLogFiles)
+396 3754 y(polic)o(y)-5 b(.)-2 3938 y
+SDict begin H.S end
+ -2 3938 a -2 3938
+a
+SDict begin 13 H.A end
+ -2 3938 a -2 3938 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4558) cvn H.B /DEST pdfmark
+end
+ -2 3938 a -2 3938 a
+SDict begin H.S end
+ -2 3938 a -2
+3938 a
+SDict begin 13 H.A end
+ -2 3938 a -2 3938 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4559) cvn H.B /DEST pdfmark
+end
+ -2 3938 a 396 4028 a Fy(RedefIgnor)o(eAll=)
+992 4028 y
+SDict begin H.S end
+ 992 4028 a 992 4028 a
+SDict begin 13 H.A end
+ 992 4028 a 992 4028
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4560) cvn H.B /DEST pdfmark
+end
+ 992 4028 a Fl(+XXX)43 b(or)i(-XXX)26 b FC(\227)21 b(Add)f(or)g
+(subtract)f(test)i(XXX)g(from)e(the)h(IgnoreAll)f(polic)o(y)-5
+b(.)-2 4212 y
+SDict begin H.S end
+ -2 4212 a -2 4212 a
+SDict begin 13 H.A end
+ -2 4212 a -2 4212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4561) cvn H.B /DEST pdfmark
+end
+
+-2 4212 a -2 4212 a
+SDict begin H.S end
+ -2 4212 a -2 4212 a
+SDict begin 13 H.A end
+ -2 4212 a -2
+4212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4562) cvn H.B /DEST pdfmark
+end
+ -2 4212 a 396 4302 a Fy(RedefIgnor)o(eNone=)1071
+4302 y
+SDict begin H.S end
+ 1071 4302 a 1071 4302 a
+SDict begin 13 H.A end
+ 1071 4302 a 1071 4302
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4563) cvn H.B /DEST pdfmark
+end
+ 1071 4302 a Fl(+XXX)42 b(or)j(-XXX)27 b FC(\227)20
+b(Add)g(or)g(subtract)g(test)h(XXX)f(from)f(the)i(IgnoreNone)c(polic)o
+(y)-5 b(.)-2 4486 y
+SDict begin H.S end
+ -2 4486 a -2 4486 a
+SDict begin 13 H.A end
+ -2 4486 a -2
+4486 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4564) cvn H.B /DEST pdfmark
+end
+ -2 4486 a -2 4486 a
+SDict begin H.S end
+ -2 4486 a -2 4486 a
+SDict begin 13 H.A end
+ -2 4486
+a -2 4486 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4565) cvn H.B /DEST pdfmark
+end
+ -2 4486 a 396 4576 a Fy(RedefUser0=)859 4576
+y
+SDict begin H.S end
+ 859 4576 a 859 4576 a
+SDict begin 13 H.A end
+ 859 4576 a 859 4576 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4566) cvn H.B /DEST pdfmark
+end
+ 859 4576
+a Fl(+XXX)44 b(or)g(-XXX)27 b FC(\227)21 b(Add)e(or)h(subtract)g(test)h
+(XXX)g(from)e(the)h(User0)g(polic)o(y)-5 b(.)-2 4760
+y
+SDict begin H.S end
+ -2 4760 a -2 4760 a
+SDict begin 13 H.A end
+ -2 4760 a -2 4760 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4567) cvn H.B /DEST pdfmark
+end
+ -2 4760 a -2
+4760 a
+SDict begin H.S end
+ -2 4760 a -2 4760 a
+SDict begin 13 H.A end
+ -2 4760 a -2 4760 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4568) cvn H.B /DEST pdfmark
+end
+ -2 4760
+a 396 4850 a Fy(RedefUser1=)859 4850 y
+SDict begin H.S end
+ 859 4850 a 859
+4850 a
+SDict begin 13 H.A end
+ 859 4850 a 859 4850 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4569) cvn H.B /DEST pdfmark
+end
+ 859 4850 a Fl(+XXX)44 b(or)g(-XXX)27
+b FC(\227)21 b(Add)e(or)h(subtract)g(test)h(XXX)g(from)e(the)h(User1)g
+(polic)o(y)-5 b(.)-2 5034 y
+SDict begin H.S end
+ -2 5034 a -2 5034 a
+SDict begin 13 H.A end
+ -2 5034
+a -2 5034 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4570) cvn H.B /DEST pdfmark
+end
+ -2 5034 a 396 5124 a FC(The)20 b(follo)n(wing)f(options)g
+(are)h(only)f(rele)n(v)n(ant)g(for)h(the)g(serv)o(er:)p
+Black 3620 5805 a Fx(123)p Black eop end
+%%Page: 124 129
+TeXDict begin 124 128 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.124) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2249 104 a
+Fx(Appendix)18 b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j
+(options)p Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a
+-2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4571) cvn H.B /DEST pdfmark
+end
+ -2 226 a -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a
+-2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4572) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309 a Fy(SetUseSock)o(et=)918 309
+y
+SDict begin H.S end
+ 918 309 a 918 309 a
+SDict begin 13 H.A end
+ 918 309 a 918 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4573) cvn H.B /DEST pdfmark
+end
+ 918 309 a Fl(boolean)g
+FC(\227)h(If)f(unset,)g(do)g(not)g(open)f(the)h(command)e(sock)o(et)i
+(\(serv)o(er)f(only\).)g(This)h(sock)o(et)396 417 y(allo)n(ws)h(to)f
+(advise)g(the)g(serv)o(er)f(to)h(transmit)g(commands)e(to)i(clients)h
+(as)g(soon)e(as)i(the)o(y)e(connect)g(to)h(the)g(serv)o(er)g(ne)o(xt)
+396 525 y(time.)-2 691 y
+SDict begin H.S end
+ -2 691 a -2 691 a
+SDict begin 13 H.A end
+ -2 691 a -2
+691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4574) cvn H.B /DEST pdfmark
+end
+ -2 691 a -2 691 a
+SDict begin H.S end
+ -2 691 a -2 691 a
+SDict begin 13 H.A end
+ -2 691 a -2
+691 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4575) cvn H.B /DEST pdfmark
+end
+ -2 691 a 396 799 a Fy(SetSock)o(etAllo)o(wUid=)1125
+799 y
+SDict begin H.S end
+ 1125 799 a 1125 799 a
+SDict begin 13 H.A end
+ 1125 799 a 1125 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4576) cvn H.B /DEST pdfmark
+end
+ 1125
+799 a Fl(UID)j FC(\227)d(Which)f(user)g(can)f(connect)g(to)h(the)g
+(command)e(sock)o(et.)i(The)f(def)o(ault)h(is)g(0)h(\(root\).)-2
+979 y
+SDict begin H.S end
+ -2 979 a -2 979 a
+SDict begin 13 H.A end
+ -2 979 a -2 979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4577) cvn H.B /DEST pdfmark
+end
+ -2 979 a -2
+979 a
+SDict begin H.S end
+ -2 979 a -2 979 a
+SDict begin 13 H.A end
+ -2 979 a -2 979 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4578) cvn H.B /DEST pdfmark
+end
+ -2 979 a 396
+1073 a Fy(SetSock)o(etP)o(assw)o(ord=)1129 1073 y
+SDict begin H.S end
+ 1129
+1073 a 1129 1073 a
+SDict begin 13 H.A end
+ 1129 1073 a 1129 1073 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4579) cvn H.B /DEST pdfmark
+end
+ 1129 1073
+a Fl(password)i FC(\227)f(P)o(assw)o(ord)f(\(max.)f(14)h(chars,)f(no)h
+('@'\))g(for)g(passw)o(ord-based)396 1180 y(authentication)e(on)i(the)g
+(command)f(sock)o(et)h(\(only)f(if)h(the)g(OS)h(does)f(not)g(support)f
+(passing)h(credentials)f(via)396 1288 y(sock)o(ets\).)-2
+1469 y
+SDict begin H.S end
+ -2 1469 a -2 1469 a
+SDict begin 13 H.A end
+ -2 1469 a -2 1469 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4580) cvn H.B /DEST pdfmark
+end
+ -2 1469
+a -2 1469 a
+SDict begin H.S end
+ -2 1469 a -2 1469 a
+SDict begin 13 H.A end
+ -2 1469 a -2 1469 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4581) cvn H.B /DEST pdfmark
+end
+ -2
+1469 a 396 1562 a Fy(SetChr)o(ootDir=)928 1562 y
+SDict begin H.S end
+ 928
+1562 a 928 1562 a
+SDict begin 13 H.A end
+ 928 1562 a 928 1562 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4582) cvn H.B /DEST pdfmark
+end
+ 928 1562 a Fl(path)g
+FC(\227)i(If)f(set,)h(chroot)e(to)h(this)h(directory)d(\(serv)o(er)h
+(only\).)-2 1746 y
+SDict begin H.S end
+ -2 1746 a -2 1746 a
+SDict begin 13 H.A end
+ -2 1746 a -2 1746
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4583) cvn H.B /DEST pdfmark
+end
+ -2 1746 a -2 1746 a
+SDict begin H.S end
+ -2 1746 a -2 1746 a
+SDict begin 13 H.A end
+ -2 1746 a -2
+1746 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4584) cvn H.B /DEST pdfmark
+end
+ -2 1746 a 396 1836 a Fy(SetStripDomain=)1016 1836
+y
+SDict begin H.S end
+ 1016 1836 a 1016 1836 a
+SDict begin 13 H.A end
+ 1016 1836 a 1016 1836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4585) cvn H.B /DEST pdfmark
+end
+ 1016
+1836 a Fl(boolean)h FC(\227)h(Whether)f(to)g(strip)g(the)g(domain)f
+(from)g(the)i(client)f(hostname)f(when)g(logging)396
+1944 y(client)h(messages)h(\(serv)o(er)e(only;)g(def)o(ault:)h(yes\).)
+-2 2128 y
+SDict begin H.S end
+ -2 2128 a -2 2128 a
+SDict begin 13 H.A end
+ -2 2128 a -2 2128 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4586) cvn H.B /DEST pdfmark
+end
+ -2
+2128 a -2 2128 a
+SDict begin H.S end
+ -2 2128 a -2 2128 a
+SDict begin 13 H.A end
+ -2 2128 a -2 2128
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4587) cvn H.B /DEST pdfmark
+end
+ -2 2128 a 396 2218 a Fy(SetClientFr)o(omAccept=)1214
+2218 y
+SDict begin H.S end
+ 1214 2218 a 1214 2218 a
+SDict begin 13 H.A end
+ 1214 2218 a 1214 2218
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4588) cvn H.B /DEST pdfmark
+end
+ 1214 2218 a Fl(boolean)f FC(\227)i(If)f(true,)f(use)i(client)f
+(address)g(as)g(kno)n(wn)f(to)h(the)h(communication)396
+2326 y(layer)-5 b(.)20 b(Else)h(\(def)o(ault\))e(use)h(client)g(name)g
+(as)h(claimed)e(by)h(the)g(client,)g(try)g(to)h(v)o(erify)d(against)i
+(the)g(address)g(kno)n(wn)396 2434 y(to)h(the)f(communication)d(layer)m
+(,)i(and)h(accept)g(\(with)g(a)g(w)o(arning)f(message\))h(e)n(v)o(en)f
+(if)i(this)f(f)o(ails.)-2 2618 y
+SDict begin H.S end
+ -2 2618 a -2 2618 a
+SDict begin 13 H.A end
+
+-2 2618 a -2 2618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4589) cvn H.B /DEST pdfmark
+end
+ -2 2618 a -2 2618 a
+SDict begin H.S end
+ -2 2618 a -2
+2618 a
+SDict begin 13 H.A end
+ -2 2618 a -2 2618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4590) cvn H.B /DEST pdfmark
+end
+ -2 2618 a 396 2708 a Fy(UseClientSe)o(v)o
+(erity=)1079 2708 y
+SDict begin H.S end
+ 1079 2708 a 1079 2708 a
+SDict begin 13 H.A end
+ 1079 2708
+a 1079 2708 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4591) cvn H.B /DEST pdfmark
+end
+ 1079 2708 a Fl(boolean)f FC(\227)i(If)f(set)h(to)g
+('yes',)e(don')o(t)g(assign)h(a)h(special)f(se)n(v)o(erity)f
+(\(priority\))f(to)j(client)396 2816 y(messages.)-2 3000
+y
+SDict begin H.S end
+ -2 3000 a -2 3000 a
+SDict begin 13 H.A end
+ -2 3000 a -2 3000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4592) cvn H.B /DEST pdfmark
+end
+ -2 3000 a -2
+3000 a
+SDict begin H.S end
+ -2 3000 a -2 3000 a
+SDict begin 13 H.A end
+ -2 3000 a -2 3000 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4593) cvn H.B /DEST pdfmark
+end
+ -2 3000
+a 396 3090 a Fy(UseClientClass=)978 3090 y
+SDict begin H.S end
+ 978 3090 a
+978 3090 a
+SDict begin 13 H.A end
+ 978 3090 a 978 3090 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4594) cvn H.B /DEST pdfmark
+end
+ 978 3090 a Fl(boolean)g
+FC(\227)g(If)f(set)h(to)f('yes',)g(don')o(t)e(assign)j(a)f(special)h
+(class)g(to)f(client)g(messages.)-2 3274 y
+SDict begin H.S end
+ -2 3274 a
+-2 3274 a
+SDict begin 13 H.A end
+ -2 3274 a -2 3274 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4595) cvn H.B /DEST pdfmark
+end
+ -2 3274 a -2 3274 a
+SDict begin H.S end
+ -2
+3274 a -2 3274 a
+SDict begin 13 H.A end
+ -2 3274 a -2 3274 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4596) cvn H.B /DEST pdfmark
+end
+ -2 3274 a 396 3364
+a Fy(SetSer)o(v)o(erP)n(ort=)944 3364 y
+SDict begin H.S end
+ 944 3364 a 944
+3364 a
+SDict begin 13 H.A end
+ 944 3364 a 944 3364 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4597) cvn H.B /DEST pdfmark
+end
+ 944 3364 a Fl(port)43 b(number)22
+b FC(\227)d(The)f(port)g(that)h(the)f(serv)o(er)g(should)f(use)i(for)f
+(listening)g(\(def)o(ault)f(is)i(49777\).)-2 3548 y
+SDict begin H.S end
+ -2
+3548 a -2 3548 a
+SDict begin 13 H.A end
+ -2 3548 a -2 3548 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4598) cvn H.B /DEST pdfmark
+end
+ -2 3548 a -2 3548
+a
+SDict begin H.S end
+ -2 3548 a -2 3548 a
+SDict begin 13 H.A end
+ -2 3548 a -2 3548 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4599) cvn H.B /DEST pdfmark
+end
+ -2 3548 a 396
+3638 a Fy(SetSer)o(v)o(erInterface=)1112 3638 y
+SDict begin H.S end
+ 1112
+3638 a 1112 3638 a
+SDict begin 13 H.A end
+ 1112 3638 a 1112 3638 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4600) cvn H.B /DEST pdfmark
+end
+ 1112 3638
+a Fl(IP)43 b(address)20 b FC(\227)h(The)f(IP)g(address)g(\(i.e.)g
+(interf)o(ace)f(on)h(multi-interf)o(ace)e(box\))h(that)h(the)396
+3746 y(serv)o(er)g(should)f(use)h(for)g(listening)g(\(def)o(ault)f(is)i
+(all\).)f(Use)h(IN)m(ADDR_ANY)f(to)g(reset)h(to)f(all.)-2
+3930 y
+SDict begin H.S end
+ -2 3930 a -2 3930 a
+SDict begin 13 H.A end
+ -2 3930 a -2 3930 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4601) cvn H.B /DEST pdfmark
+end
+ -2 3930
+a -2 3930 a
+SDict begin H.S end
+ -2 3930 a -2 3930 a
+SDict begin 13 H.A end
+ -2 3930 a -2 3930 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4602) cvn H.B /DEST pdfmark
+end
+ -2
+3930 a 396 4020 a Fy(Se)o(v)o(erityLookup=)1010 4020
+y
+SDict begin H.S end
+ 1010 4020 a 1010 4020 a
+SDict begin 13 H.A end
+ 1010 4020 a 1010 4020 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4603) cvn H.B /DEST pdfmark
+end
+ 1010
+4020 a Fl(severity)25 b FC(\227)c(Se)n(v)o(erity)e(for)h(name)f(lookup)
+g(errors)g(when)h(v)o(erifying)e(\(on)h(the)h(serv)o(er)g(side\))396
+4128 y(that)h(the)f(sock)o(et)g(peer)f(matches)h(the)g(hostname)f
+(claimed)h(by)g(the)g(client.)g(See)h(the)f(preceding)e(option.)-2
+4312 y
+SDict begin H.S end
+ -2 4312 a -2 4312 a
+SDict begin 13 H.A end
+ -2 4312 a -2 4312 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4604) cvn H.B /DEST pdfmark
+end
+ -2 4312
+a -2 4312 a
+SDict begin H.S end
+ -2 4312 a -2 4312 a
+SDict begin 13 H.A end
+ -2 4312 a -2 4312 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4605) cvn H.B /DEST pdfmark
+end
+ -2
+4312 a 396 4402 a Fy(UseSeparateLogs=)1058 4402 y
+SDict begin H.S end
+ 1058
+4402 a 1058 4402 a
+SDict begin 13 H.A end
+ 1058 4402 a 1058 4402 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4606) cvn H.B /DEST pdfmark
+end
+ 1058 4402
+a Fl(boolean)i FC(\227)g(If)g(true,)g(messages)g(from)f(dif)n(ferent)g
+(clients)i(will)f(be)h(logged)d(to)j(separate)396 4510
+y(log)f(\002les)h(\(the)f(name)g(of)g(the)g(client)g(will)h(be)f
+(appended)e(to)i(the)h(name)e(of)h(the)g(main)g(log)g(\002le)h(to)f
+(construct)f(the)396 4618 y(log\002le)h(name\).)f(Def)o(ault:)h(f)o
+(alse.)-2 4802 y
+SDict begin H.S end
+ -2 4802 a -2 4802 a
+SDict begin 13 H.A end
+ -2 4802 a -2 4802
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4607) cvn H.B /DEST pdfmark
+end
+ -2 4802 a -2 4802 a
+SDict begin H.S end
+ -2 4802 a -2 4802 a
+SDict begin 13 H.A end
+ -2 4802 a -2
+4802 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4608) cvn H.B /DEST pdfmark
+end
+ -2 4802 a 396 4892 a Fy(SetClientT)o(imeLimit=)1152
+4892 y
+SDict begin H.S end
+ 1152 4892 a 1152 4892 a
+SDict begin 13 H.A end
+ 1152 4892 a 1152 4892
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4609) cvn H.B /DEST pdfmark
+end
+ 1152 4892 a Fl(seconds)g FC(\227)h(T)m(ime)f(limit)h(until)f(ne)o(xt)
+f(client)i(message)f(\(serv)o(er)n(-only\).)-2 5076 y
+SDict begin H.S end
+
+-2 5076 a -2 5076 a
+SDict begin 13 H.A end
+ -2 5076 a -2 5076 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4610) cvn H.B /DEST pdfmark
+end
+ -2 5076 a -2
+5076 a
+SDict begin H.S end
+ -2 5076 a -2 5076 a
+SDict begin 13 H.A end
+ -2 5076 a -2 5076 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4611) cvn H.B /DEST pdfmark
+end
+ -2 5076
+a 396 5165 a Fy(SetUDP)-6 b(Acti)o(v)o(e=)944 5165 y
+SDict begin H.S end
+
+944 5165 a 944 5165 a
+SDict begin 13 H.A end
+ 944 5165 a 944 5165 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4612) cvn H.B /DEST pdfmark
+end
+ 944 5165
+a Fl(boolean)20 b FC(\227)g(yule)g(1.2.8+:)f(Listen)h(on)g(514/udp)e
+(\(syslog\).)h(Def)o(ault:)h(f)o(alse.)p Black 3620 5805
+a Fx(124)p Black eop end
+%%Page: 125 130
+TeXDict begin 125 129 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.125) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4659) cvn H.B /DEST pdfmark
+end
+ -2 35 a 2249 104 a Fx(Appendix)18
+b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j(options)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4613) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(Remarks:)g(\(i\))834 309 y
+SDict begin H.S end
+ 834 309
+a 834 309 a
+SDict begin 13 H.A end
+ 834 309 a 834 309 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4614) cvn H.B /DEST pdfmark
+end
+ 834 309 a Fy(r)o(oot)f
+FC(and)h(the)g(ef)n(fecti)n(v)o(e)f(user)h(are)g(al)o(w)o(ays)h
+(trusted.)e(\(ii\))h(If)g(no)g(time)g(serv)o(er)g(is)h(gi)n(v)o(en,)e
+(the)h(local)396 417 y(host)g(clock)g(is)h(used.)f(\(iii\))g(If)g(the)g
+(path)g(of)g(the)g(process)g(image)g(is)h(gi)n(v)o(en,)d(the)j(process)
+e(image)h(will)h(be)396 525 y(checksummed)d(at)j(startup)e(and)h(e)o
+(xit,)g(and)f(both)h(checksums)f(compared.)-2 553 y
+SDict begin H.S end
+ -2
+553 a -2 553 a
+SDict begin 13 H.A end
+ -2 553 a -2 553 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:EXTERNAL) cvn H.B /DEST pdfmark
+end
+ -2 553 a 359 x Fu(C.12.)39
+b(External)949 912 y
+SDict begin H.S end
+ 949 912 a 949 912 a
+SDict begin 22.464 H.A end
+ 949 912 a 949
+912 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.93.1) cvn H.B /DEST pdfmark
+end
+ 949 912 a -2 1080 a
+SDict begin H.S end
+ -2 1080 a -2 1080 a
+SDict begin 13 H.A end
+ -2 1080
+a -2 1080 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4617) cvn H.B /DEST pdfmark
+end
+ -2 1080 a 396 1186 a FC(De\002nition)20 b(of)g(an)g
+(arbitrary)e(number)h(of)h(e)o(xternal)f(programs/scripts)f(\(see)p
+0 TeXcolorgray 2629 1186 a
+SDict begin H.S end
+ 2629 1186 a FC(Chapter)i(7)2955
+1186 y
+SDict begin 13 H.L end
+ 2955 1186 a 2955 1186 a
+SDict begin [ /Subtype /Link /Dest (0:EXTERN) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 2955 1186 a Black -1 w
+FC(>\).)g(Section)g(heading:)-2 1370 y
+SDict begin H.S end
+ -2 1370 a -2 1370
+a
+SDict begin 13 H.A end
+ -2 1370 a -2 1370 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4619) cvn H.B /DEST pdfmark
+end
+ -2 1370 a -2 1370 a
+SDict begin H.S end
+ -2 1370 a -2
+1370 a
+SDict begin 13 H.A end
+ -2 1370 a -2 1370 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4620) cvn H.B /DEST pdfmark
+end
+ -2 1370 a 396 1460 a Fy([Exter)o(nal])-2
+1638 y
+SDict begin H.S end
+ -2 1638 a -2 1638 a
+SDict begin 13 H.A end
+ -2 1638 a -2 1638 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4621) cvn H.B /DEST pdfmark
+end
+ -2 1638
+a 396 1734 a FC(Entries:)-2 1901 y
+SDict begin H.S end
+ -2 1901 a -2 1901
+a
+SDict begin 13 H.A end
+ -2 1901 a -2 1901 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4622) cvn H.B /DEST pdfmark
+end
+ -2 1901 a -2 1901 a
+SDict begin H.S end
+ -2 1901 a -2
+1901 a
+SDict begin 13 H.A end
+ -2 1901 a -2 1901 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4623) cvn H.B /DEST pdfmark
+end
+ -2 1901 a 396 2008 a Fy(OpenCommand=)1011
+2008 y
+SDict begin H.S end
+ 1011 2008 a 1011 2008 a
+SDict begin 13 H.A end
+ 1011 2008 a 1011 2008
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4624) cvn H.B /DEST pdfmark
+end
+ 1011 2008 a Fl(/full/path/to/program)h FC(\227)g(Starts)f(ne)n(w)g
+(command)f(de\002nition.)-2 2191 y
+SDict begin H.S end
+ -2 2191 a -2 2191
+a
+SDict begin 13 H.A end
+ -2 2191 a -2 2191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4625) cvn H.B /DEST pdfmark
+end
+ -2 2191 a -2 2191 a
+SDict begin H.S end
+ -2 2191 a -2
+2191 a
+SDict begin 13 H.A end
+ -2 2191 a -2 2191 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4626) cvn H.B /DEST pdfmark
+end
+ -2 2191 a 396 2282 a Fy(SetT)-6
+b(ype=)728 2282 y
+SDict begin H.S end
+ 728 2282 a 728 2282 a
+SDict begin 13 H.A end
+ 728 2282 a 728
+2282 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4627) cvn H.B /DEST pdfmark
+end
+ 728 2282 a Fl(log/srv)27 b FC(\227)20 b(T)-7 b(ype/purpose)18
+b(of)i(the)g(program.)-2 2466 y
+SDict begin H.S end
+ -2 2466 a -2 2466 a
+SDict begin 13 H.A end
+ -2
+2466 a -2 2466 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4628) cvn H.B /DEST pdfmark
+end
+ -2 2466 a -2 2466 a
+SDict begin H.S end
+ -2 2466 a -2 2466
+a
+SDict begin 13 H.A end
+ -2 2466 a -2 2466 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4629) cvn H.B /DEST pdfmark
+end
+ -2 2466 a 396 2556 a Fy(SetCommandline=)1057
+2556 y
+SDict begin H.S end
+ 1057 2556 a 1057 2556 a
+SDict begin 13 H.A end
+ 1057 2556 a 1057 2556
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4630) cvn H.B /DEST pdfmark
+end
+ 1057 2556 a Fl(list)g FC(\227)h(The)f(command)e(line.)-2
+2723 y
+SDict begin H.S end
+ -2 2723 a -2 2723 a
+SDict begin 13 H.A end
+ -2 2723 a -2 2723 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4631) cvn H.B /DEST pdfmark
+end
+ -2 2723
+a -2 2723 a
+SDict begin H.S end
+ -2 2723 a -2 2723 a
+SDict begin 13 H.A end
+ -2 2723 a -2 2723 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4632) cvn H.B /DEST pdfmark
+end
+ -2
+2723 a 396 2830 a Fy(SetEn)m(vir)o(on=)841 2830 y
+SDict begin H.S end
+ 841
+2830 a 841 2830 a
+SDict begin 13 H.A end
+ 841 2830 a 841 2830 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4633) cvn H.B /DEST pdfmark
+end
+ 841 2830 a Fl(KEY=value)h
+FC(\227)h(En)m(vironment)d(v)n(ariable)i(\(can)h(be)g(repeated\).)-2
+3014 y
+SDict begin H.S end
+ -2 3014 a -2 3014 a
+SDict begin 13 H.A end
+ -2 3014 a -2 3014 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4634) cvn H.B /DEST pdfmark
+end
+ -2 3014
+a -2 3014 a
+SDict begin H.S end
+ -2 3014 a -2 3014 a
+SDict begin 13 H.A end
+ -2 3014 a -2 3014 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4635) cvn H.B /DEST pdfmark
+end
+ -2
+3014 a 396 3104 a Fy(SetChecksum=)927 3104 y
+SDict begin H.S end
+ 927 3104
+a 927 3104 a
+SDict begin 13 H.A end
+ 927 3104 a 927 3104 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4636) cvn H.B /DEST pdfmark
+end
+ 927 3104 a Fl(TIGER)45
+b(checksum)23 b FC(\227)e(Checksum)e(of)h(the)g(program.)-2
+3288 y
+SDict begin H.S end
+ -2 3288 a -2 3288 a
+SDict begin 13 H.A end
+ -2 3288 a -2 3288 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4637) cvn H.B /DEST pdfmark
+end
+ -2 3288
+a -2 3288 a
+SDict begin H.S end
+ -2 3288 a -2 3288 a
+SDict begin 13 H.A end
+ -2 3288 a -2 3288 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4638) cvn H.B /DEST pdfmark
+end
+ -2
+3288 a 396 3378 a Fy(SetCr)o(edentials=)964 3378 y
+SDict begin H.S end
+ 964
+3378 a 964 3378 a
+SDict begin 13 H.A end
+ 964 3378 a 964 3378 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4639) cvn H.B /DEST pdfmark
+end
+ 964 3378 a Fl(username)f
+FC(\227)i(User)f(whose)g(credentials)f(shall)i(be)f(used.)-2
+3545 y
+SDict begin H.S end
+ -2 3545 a -2 3545 a
+SDict begin 13 H.A end
+ -2 3545 a -2 3545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4640) cvn H.B /DEST pdfmark
+end
+ -2 3545
+a -2 3545 a
+SDict begin H.S end
+ -2 3545 a -2 3545 a
+SDict begin 13 H.A end
+ -2 3545 a -2 3545 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4641) cvn H.B /DEST pdfmark
+end
+ -2
+3545 a 396 3652 a Fy(SetFilterNot=)883 3652 y
+SDict begin H.S end
+ 883 3652
+a 883 3652 a
+SDict begin 13 H.A end
+ 883 3652 a 883 3652 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4642) cvn H.B /DEST pdfmark
+end
+ 883 3652 a Fl(list)f
+FC(\227)h(W)-7 b(ords)21 b(not)f(allo)n(wed)f(in)i(message.)-2
+3836 y
+SDict begin H.S end
+ -2 3836 a -2 3836 a
+SDict begin 13 H.A end
+ -2 3836 a -2 3836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4643) cvn H.B /DEST pdfmark
+end
+ -2 3836
+a -2 3836 a
+SDict begin H.S end
+ -2 3836 a -2 3836 a
+SDict begin 13 H.A end
+ -2 3836 a -2 3836 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4644) cvn H.B /DEST pdfmark
+end
+ -2
+3836 a 396 3926 a Fy(SetFilterAnd=)905 3926 y
+SDict begin H.S end
+ 905 3926
+a 905 3926 a
+SDict begin 13 H.A end
+ 905 3926 a 905 3926 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4645) cvn H.B /DEST pdfmark
+end
+ 905 3926 a Fl(list)f
+FC(\227)h(W)-7 b(ords)20 b(required)e(\(ALL\))i(in)g(message.)-2
+4110 y
+SDict begin H.S end
+ -2 4110 a -2 4110 a
+SDict begin 13 H.A end
+ -2 4110 a -2 4110 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4646) cvn H.B /DEST pdfmark
+end
+ -2 4110
+a -2 4110 a
+SDict begin H.S end
+ -2 4110 a -2 4110 a
+SDict begin 13 H.A end
+ -2 4110 a -2 4110 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4647) cvn H.B /DEST pdfmark
+end
+ -2
+4110 a 396 4200 a Fy(SetFilterOr=)855 4200 y
+SDict begin H.S end
+ 855 4200
+a 855 4200 a
+SDict begin 13 H.A end
+ 855 4200 a 855 4200 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4648) cvn H.B /DEST pdfmark
+end
+ 855 4200 a Fl(list)f
+FC(\227)i(W)-7 b(ords)20 b(required)f(\(at)h(least)h(one\))e(in)i
+(message.)-2 4384 y
+SDict begin H.S end
+ -2 4384 a -2 4384 a
+SDict begin 13 H.A end
+ -2 4384 a -2
+4384 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4649) cvn H.B /DEST pdfmark
+end
+ -2 4384 a -2 4384 a
+SDict begin H.S end
+ -2 4384 a -2 4384 a
+SDict begin 13 H.A end
+ -2 4384
+a -2 4384 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4650) cvn H.B /DEST pdfmark
+end
+ -2 4384 a 396 4474 a Fy(SetDeadtime=)896
+4474 y
+SDict begin H.S end
+ 896 4474 a 896 4474 a
+SDict begin 13 H.A end
+ 896 4474 a 896 4474 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4651) cvn H.B /DEST pdfmark
+end
+ 896
+4474 a Fl(seconds)f FC(\227)g(Deadtime)g(between)f(consecuti)n(v)o(e)g
+(calls.)-2 4641 y
+SDict begin H.S end
+ -2 4641 a -2 4641 a
+SDict begin 13 H.A end
+ -2 4641 a -2 4641
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4652) cvn H.B /DEST pdfmark
+end
+ -2 4641 a -2 4641 a
+SDict begin H.S end
+ -2 4641 a -2 4641 a
+SDict begin 13 H.A end
+ -2 4641 a -2
+4641 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4653) cvn H.B /DEST pdfmark
+end
+ -2 4641 a 396 4748 a Fy(SetDefault=)818 4748 y
+SDict begin H.S end
+
+818 4748 a 818 4748 a
+SDict begin 13 H.A end
+ 818 4748 a 818 4748 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4654) cvn H.B /DEST pdfmark
+end
+ 818 4748
+a Fl(boolean)h FC(\227)g(Set)h(def)o(ault)f(en)m(vironment)d(\(HOME)j
+(from)f(/etc/passwd,)h(SHELL=/bin/sh,)396 4856 y(P)-8
+b(A)f(TH=/sbin:/usr/sbin:/bin:/usr/bin\).)-2 4881 y
+SDict begin H.S end
+ -2
+4881 a -2 4881 a
+SDict begin 13 H.A end
+ -2 4881 a -2 4881 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:CONFIGFILE-CLIENTS) cvn H.B
+/DEST pdfmark end
+ -2 4881 a Black
+3620 5805 a Fx(125)p Black eop end
+%%Page: 126 131
+TeXDict begin 126 130 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.126) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2249 104 a
+Fx(Appendix)18 b(C.)j(List)g(of)g(con\002gur)o(ation)c(\002le)j
+(options)p Black -2 330 a Fu(C.13.)39 b(Clients)861 330
+y
+SDict begin H.S end
+ 861 330 a 861 330 a
+SDict begin 22.464 H.A end
+ 861 330 a 861 330 a
+SDict begin [ /View [/XYZ H.V] /Dest (16.94.1) cvn H.B /DEST pdfmark
+end
+ 861 330 a -2
+498 a
+SDict begin H.S end
+ -2 498 a -2 498 a
+SDict begin 13 H.A end
+ -2 498 a -2 498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4657) cvn H.B /DEST pdfmark
+end
+ -2 498 a 396
+604 a FC(This)21 b(section)f(is)h(rele)n(v)n(ant)e(for)1298
+604 y
+SDict begin H.S end
+ 1298 604 a 1298 604 a
+SDict begin 13 H.A end
+ 1298 604 a 1298 604 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4658) cvn H.B /DEST pdfmark
+end
+ 1298
+604 a FC(yule)h(only)-5 b(.)19 b(Section)h(heading:)396
+878 y Fy([Clients])-2 1057 y
+SDict begin H.S end
+ -2 1057 a -2 1057 a
+SDict begin 13 H.A end
+ -2 1057
+a -2 1057 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4661) cvn H.B /DEST pdfmark
+end
+ -2 1057 a 396 1152 a FC(Entries)g(must)g(be)h(of)e(the)i
+(form:)-2 1319 y
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319 a -2 1319
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4662) cvn H.B /DEST pdfmark
+end
+ -2 1319 a -2 1319 a
+SDict begin H.S end
+ -2 1319 a -2 1319 a
+SDict begin 13 H.A end
+ -2 1319 a -2
+1319 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4663) cvn H.B /DEST pdfmark
+end
+ -2 1319 a 396 1426 a Fy(Client=)660 1426 y
+SDict begin H.S end
+ 660
+1426 a 660 1426 a
+SDict begin 13 H.A end
+ 660 1426 a 660 1426 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4664) cvn H.B /DEST pdfmark
+end
+ 660 1426 a Fl
+(hostname@salt@verifier)-2 1594 y
+SDict begin H.S end
+ -2 1594 a -2 1594 a
+SDict begin 13 H.A end
+
+-2 1594 a -2 1594 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4665) cvn H.B /DEST pdfmark
+end
+ -2 1594 a 396 1700 a FC(See)p 0 TeXcolorgray
+537 1700 a
+SDict begin H.S end
+ 537 1700 a FC(Section)f(6.3)912 1700 y
+SDict begin 13 H.L end
+ 912
+1700 a 912 1700 a
+SDict begin [ /Subtype /Link /Dest (0:CLIENTS) cvn /H /I /Border [0
+0 0] /Color [1 0 0] H.B /ANN pdfmark end
+ 912 1700 a Black -2 w FC(>)h(on)f(ho)n(w)f(to)i
+(compute)e(a)h(v)n(alid)g(entry)-5 b(.)-2 1884 y
+SDict begin H.S end
+ -2 1884
+a -2 1884 a
+SDict begin 13 H.A end
+ -2 1884 a -2 1884 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4667) cvn H.B /DEST pdfmark
+end
+ -2 1884 a 396 1974 a
+FC(The)20 b(hostname)f(must)h(be)g(the)h(same)f(name)g(that)g(the)g
+(client)g(retrie)n(v)o(es)g(from)f(the)h(host)g(on)g(which)g(it)g
+(runs.)396 2082 y(Usually)-5 b(,)20 b(this)g(will)h(be)f(a)h(fully)f
+(quali\002ed)f(hostname,)g(no)g(numerical)g(address.)h(Ho)n(we)n(v)o
+(er)m(,)e(there)i(is)h(no)e(method)396 2190 y(that)i(guarantees)d(to)j
+(yield)e(the)i(fully)e(quali\002ed)h(hostname)f(\(it)h(is)h(not)f(e)n
+(v)o(en)f(guaranteed)f(that)j(a)f(host)g(has)h(one)e(...\).)396
+2298 y(The)h(only)f(w)o(ay)i(to)f(kno)n(w)f(for)h(sure)g(is)h(to)f(set)
+h(up)f(the)g(client,)g(and)g(check)f(whether)g(the)i(connection)d(is)j
+(refused)e(by)396 2406 y(the)h(serv)o(er)g(with)g(a)h(message)f(lik)o
+(e)1413 2406 y
+SDict begin H.S end
+ 1413 2406 a 1413 2406 a
+SDict begin 13 H.A end
+ 1413 2406 a 1413
+2406 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4668) cvn H.B /DEST pdfmark
+end
+ 1413 2406 a Fy(Connection)g(attempt)f(fr)o(om)h(unr)o(egister)o
+(ed)f(host)2965 2406 y
+SDict begin H.S end
+ 2965 2406 a 2965 2406 a
+SDict begin 13 H.A end
+ 2965 2406
+a 2965 2406 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4669) cvn H.B /DEST pdfmark
+end
+ 2965 2406 a Fl(hostname)h FC(In)g(that)g(case,)396
+2514 y
+SDict begin H.S end
+ 396 2514 a 396 2514 a
+SDict begin 13 H.A end
+ 396 2514 a 396 2514 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4670) cvn H.B /DEST pdfmark
+end
+ 396
+2514 a Fx(hostname)f FC(is)i(what)g(you)e(should)g(use.)-2
+2532 y
+SDict begin H.S end
+ -2 2532 a -2 2532 a
+SDict begin 11.7 H.A end
+ -2 2532 a -2 2532 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4671) cvn H.B /DEST pdfmark
+end
+ -2 2532
+a 745 2631 2668 17 v 745 3839 17 1208 v 1843 2785 a Fp(CA)-10
+b(VEA)f(T)786 2953 y
+SDict begin H.S end
+ 786 2953 a 786 2953 a
+SDict begin 11.7 H.A end
+ 786 2953 a
+786 2953 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4673) cvn H.B /DEST pdfmark
+end
+ 786 2953 a 95 x Fv(Prob)o(lems)19 b(and)h(oddities)e
+(encountered)f(in)j(client/ser)r(v)n(er)f(setups)h(\(lik)o(e)f(client)
+786 3145 y(messages)i(from)1318 3145 y
+SDict begin H.S end
+ 1318 3145 a 1318
+3145 a
+SDict begin 11.7 H.A end
+ 1318 3145 a 1318 3145 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4674) cvn H.B /DEST pdfmark
+end
+ 1318 3145 a Fq(127.0.0.1)p
+Fv(,)c(ser)r(v)n(er)k(w)o(ar)r(nings)d(about)h(unkno)o(wn/unresolv)n
+(ed)d(peer)l(,)786 3242 y(etc.)k(are)1055 3242 y
+SDict begin H.S end
+ 1055
+3242 a 1055 3242 a
+SDict begin 11.7 H.A end
+ 1055 3242 a 1055 3242 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4675) cvn H.B /DEST pdfmark
+end
+ 1055 3242
+a Fq(alw)o(a)n(ys)h Fv(\(at)e(least)g(so)h(f)n(ar\))f(due)g(to)g
+(incorrect)f(con\002gur)o(ation)f(of)j(the)f(DNS)g(or)h(the)786
+3340 y(/etc/hosts)g(\002le)o(.)786 3507 y
+SDict begin H.S end
+ 786 3507 a
+786 3507 a
+SDict begin 11.7 H.A end
+ 786 3507 a 786 3507 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4676) cvn H.B /DEST pdfmark
+end
+ 786 3507 a 96 x Fv(A)h(sur)r(pr)q
+(isingly)e(large)g(n)o(umber)g(of)h(hosts)h(are)e(not)h(ab)o(le)e(to)j
+(deter)r(mine)c(the)j(o)o(wn)786 3700 y(hostname)o(,)f(or)h(re)n(v)n
+(erse)g(lookup)f(adresses)h(on)g(the)f(o)o(wn)h(local)f(netw)o(or)q(k.)
+h(Don't)f(bother)786 3797 y(asking)h(about)f(such)h(prob)o(lems)f(\227)
+h(\002x)i(y)o(our)e(DNS)o(.)p 3396 3839 17 1208 v 745
+3855 2668 17 v Black 3618 5805 a Fx(126)p Black eop end
+%%Page: 127 132
+TeXDict begin 127 131 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.127) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:DATABASE-FIELDS) cvn H.B /DEST
+pdfmark end
+ -2 226 a 125 x
+Fz(Appendix)48 b(D)-5 b(.)48 b(List)g(of)g(database)f(\002elds)2853
+351 y
+SDict begin H.S end
+ 2853 351 a 2853 351 a
+SDict begin 26.957 H.A end
+ 2853 351 a 2853 351 a
+SDict begin [ /View [/XYZ H.V] /Dest (17.0) cvn H.B /DEST pdfmark end
+ 2853
+351 a -2 607 a
+SDict begin H.S end
+ -2 607 a -2 607 a
+SDict begin 13 H.A end
+ -2 607 a -2 607 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4679) cvn H.B /DEST pdfmark
+end
+ -2
+607 a 396 679 a FC(The)20 b(database)g(may)f(hold)h(\(i\))g(internal)f
+(message)h(from)2042 679 y
+SDict begin H.S end
+ 2042 679 a 2042 679 a
+SDict begin 13 H.A end
+ 2042
+679 a 2042 679 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4680) cvn H.B /DEST pdfmark
+end
+ 2042 679 a FC(yule,)g(the)g(log)g(serv)o(er)m(,)f(and)
+g(\(ii\))i(client)f(messages.)g(The)396 787 y(latter)h(result)f(in)878
+787 y
+SDict begin H.S end
+ 878 787 a 878 787 a
+SDict begin 13 H.A end
+ 878 787 a 878 787 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4681) cvn H.B /DEST pdfmark
+end
+ 878 787
+a Fx(two)h FC(ro)n(ws:)f(one)g(for)f(the)h(client)h(message,)e(and)h
+(one)g(for)f(the)i(serv)o(er)e(message)h(recording)e(the)396
+895 y(arri)n(v)n(al)i(of)f(the)i(client)f(message,)g(the)g(originating)
+e(remote)h(host,)h(and)g(the)g(timestamp.)g(The)f(dif)n(ferent)g
+(message)396 1003 y(types)h(can)g(be)g(recognized)e(by)i(the)1438
+1003 y
+SDict begin H.S end
+ 1438 1003 a 1438 1003 a
+SDict begin 13 H.A end
+ 1438 1003 a 1438 1003
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4682) cvn H.B /DEST pdfmark
+end
+ 1438 1003 a Fx(lo)o(g_r)m(ef)32 b FC(\002eld)21 b(\(see)f(belo)n
+(w\).)-2 1187 y
+SDict begin H.S end
+ -2 1187 a -2 1187 a
+SDict begin 13 H.A end
+ -2 1187 a -2 1187
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4683) cvn H.B /DEST pdfmark
+end
+ -2 1187 a 396 1277 a FC(Man)o(y)f(database)h(\002elds)h(record)e
+(details)h(of)g(\002les)h(\(see)1991 1277 y
+SDict begin H.S end
+ 1991 1277
+a 1991 1277 a
+SDict begin 13 H.A end
+ 1991 1277 a 1991 1277 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4684) cvn H.B /DEST pdfmark
+end
+ 1991 1277 a Fy(man)f(stat)p
+FC(\),)f(before)g(\(_old\))g(and)g(after)h(\(_ne)n(w\))f(a)i(detected)
+396 1385 y(modi\002cation.)e(F)o(or)g(some)h(items,)h(both)e(numeric)g
+(\(iXXX\))h(and)g(string)f(v)n(alues)h(are)g(reported,)e(because)i(the)
+396 1493 y(translation)g(between)f(both)g(is)i(host-speci\002c.)f(This)
+g(allo)n(ws)g(to)h(perform)d(updates)h(of)h(the)g(\002le)h(signature)
+396 1601 y(database\(s\))e(on)h(the)g(serv)o(er)g(side.)g(Other)g
+(\002elds)g(are)h(listed)f(belo)n(w)-5 b(.)19 b(Basically)-5
+b(,)20 b(most)h(of)e(the)i(\002elds)f(supply)396 1709
+y(additional)f(information)f(for)1279 1709 y
+SDict begin H.S end
+ 1279 1709
+a 1279 1709 a
+SDict begin 13 H.A end
+ 1279 1709 a 1279 1709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4685) cvn H.B /DEST pdfmark
+end
+ 1279 1709 a Fx(lo)o(g_msg)i
+FC(if)g(rele)n(v)n(ant.)-2 1725 y
+SDict begin H.S end
+ -2 1725 a -2 1725 a
+SDict begin 13 H.A end
+
+-2 1725 a -2 1725 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:GEN-DB-FIELDS) cvn H.B /DEST
+pdfmark end
+ -2 1725 a 361 x Fu(D)l(.1.)38 b(General)832
+2086 y
+SDict begin H.S end
+ 832 2086 a 832 2086 a
+SDict begin 22.464 H.A end
+ 832 2086 a 832 2086 a
+SDict begin [ /View [/XYZ H.V] /Dest (17.95.1) cvn H.B /DEST pdfmark
+end
+ 832
+2086 a -2 2088 a
+SDict begin H.S end
+ -2 2088 a -2 2088 a
+SDict begin 13 H.A end
+ -2 2088 a -2 2088
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4688) cvn H.B /DEST pdfmark
+end
+ -2 2088 a -2 2212 a
+SDict begin H.S end
+ -2 2212 a -2 2212 a
+SDict begin 13 H.A end
+ -2 2212 a -2
+2212 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4690) cvn H.B /DEST pdfmark
+end
+ -2 2212 a 396 2318 a FC(log_inde)o(x)-2 2336 y
+SDict begin H.S end
+
+-2 2336 a -2 2336 a
+SDict begin 13 H.A end
+ -2 2336 a -2 2336 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4691) cvn H.B /DEST pdfmark
+end
+ -2 2336 a Black
+Black 562 2468 a
+SDict begin H.S end
+ 562 2468 a 562 2468 a
+SDict begin 13 H.A end
+ 562 2468 a 562
+2468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4692) cvn H.B /DEST pdfmark
+end
+ 562 2468 a FC(Unique)19 b(inde)o(x)g(of)h(the)h(message)f
+(\(primary)e(k)o(e)o(y\).)-2 2569 y
+SDict begin H.S end
+ -2 2569 a -2 2569
+a
+SDict begin 13 H.A end
+ -2 2569 a -2 2569 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4694) cvn H.B /DEST pdfmark
+end
+ -2 2569 a 396 2658 a FC(log_ref)-2
+2676 y
+SDict begin H.S end
+ -2 2676 a -2 2676 a
+SDict begin 13 H.A end
+ -2 2676 a -2 2676 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4695) cvn H.B /DEST pdfmark
+end
+ -2 2676
+a Black Black 562 2808 a
+SDict begin H.S end
+ 562 2808 a 562 2808 a
+SDict begin 13 H.A end
+ 562 2808
+a 562 2808 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4696) cvn H.B /DEST pdfmark
+end
+ 562 2808 a FC(Zero)i(for)f(internal)h(serv)o(er)f
+(messages,)h(NULL)g(for)g(messages)g(recei)n(v)o(ed)f(from)g(a)i
+(client,)562 2916 y(log_inde)o(x\(client_message\))15
+b(for)20 b(serv)o(er)f(timestamp)h(of)g(client)g(message.)-2
+3017 y
+SDict begin H.S end
+ -2 3017 a -2 3017 a
+SDict begin 13 H.A end
+ -2 3017 a -2 3017 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4698) cvn H.B /DEST pdfmark
+end
+ -2 3017
+a 396 3107 a FC(log_host)-2 3125 y
+SDict begin H.S end
+ -2 3125 a -2 3125
+a
+SDict begin 13 H.A end
+ -2 3125 a -2 3125 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4699) cvn H.B /DEST pdfmark
+end
+ -2 3125 a Black Black 562 3256
+a
+SDict begin H.S end
+ 562 3256 a 562 3256 a
+SDict begin 13 H.A end
+ 562 3256 a 562 3256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4700) cvn H.B /DEST pdfmark
+end
+ 562 3256
+a FC(The)g(host)g(where)g(the)g(message)g(originates.)-2
+3357 y
+SDict begin H.S end
+ -2 3357 a -2 3357 a
+SDict begin 13 H.A end
+ -2 3357 a -2 3357 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4702) cvn H.B /DEST pdfmark
+end
+ -2 3357
+a 396 3447 a FC(log_time)-2 3465 y
+SDict begin H.S end
+ -2 3465 a -2 3465
+a
+SDict begin 13 H.A end
+ -2 3465 a -2 3465 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4703) cvn H.B /DEST pdfmark
+end
+ -2 3465 a Black Black 562 3597
+a
+SDict begin H.S end
+ 562 3597 a 562 3597 a
+SDict begin 13 H.A end
+ 562 3597 a 562 3597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4704) cvn H.B /DEST pdfmark
+end
+ 562 3597
+a FC(The)g(timestamp)g(of)g(the)g(message.)-2 3698 y
+SDict begin H.S end
+
+-2 3698 a -2 3698 a
+SDict begin 13 H.A end
+ -2 3698 a -2 3698 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4706) cvn H.B /DEST pdfmark
+end
+ -2 3698 a 396
+3788 a FC(log_se)n(v)-2 3806 y
+SDict begin H.S end
+ -2 3806 a -2 3806 a
+SDict begin 13 H.A end
+ -2
+3806 a -2 3806 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4707) cvn H.B /DEST pdfmark
+end
+ -2 3806 a Black Black 562 3937 a
+SDict begin H.S end
+ 562
+3937 a 562 3937 a
+SDict begin 13 H.A end
+ 562 3937 a 562 3937 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4708) cvn H.B /DEST pdfmark
+end
+ 562 3937 a FC(The)g(se)n(v)o
+(erity/priority)e(of)h(the)i(message.)-2 4038 y
+SDict begin H.S end
+ -2 4038
+a -2 4038 a
+SDict begin 13 H.A end
+ -2 4038 a -2 4038 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4710) cvn H.B /DEST pdfmark
+end
+ -2 4038 a 396 4128 a
+FC(log_msg)-2 4146 y
+SDict begin H.S end
+ -2 4146 a -2 4146 a
+SDict begin 13 H.A end
+ -2 4146 a -2
+4146 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4711) cvn H.B /DEST pdfmark
+end
+ -2 4146 a Black Black 562 4277 a
+SDict begin H.S end
+ 562 4277 a 562
+4277 a
+SDict begin 13 H.A end
+ 562 4277 a 562 4277 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4712) cvn H.B /DEST pdfmark
+end
+ 562 4277 a FC(The)f(message)g(itself.)-2
+4378 y
+SDict begin H.S end
+ -2 4378 a -2 4378 a
+SDict begin 13 H.A end
+ -2 4378 a -2 4378 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4714) cvn H.B /DEST pdfmark
+end
+ -2 4378
+a 396 4468 a FC(log_hash)-2 4486 y
+SDict begin H.S end
+ -2 4486 a -2 4486
+a
+SDict begin 13 H.A end
+ -2 4486 a -2 4486 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4715) cvn H.B /DEST pdfmark
+end
+ -2 4486 a Black Black 562 4618
+a
+SDict begin H.S end
+ 562 4618 a 562 4618 a
+SDict begin 13 H.A end
+ 562 4618 a 562 4618 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4716) cvn H.B /DEST pdfmark
+end
+ 562 4618
+a FC(A)h(checksum)e(o)o(v)o(er)g(the)h(union)f(of)h(user)n
+(-de\002neable)e(\002elds.)-2 4702 y
+SDict begin H.S end
+ -2 4702 a -2 4702
+a
+SDict begin 13 H.A end
+ -2 4702 a -2 4702 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4718) cvn H.B /DEST pdfmark
+end
+ -2 4702 a 396 4809 a FC(entry_status)-2
+4827 y
+SDict begin H.S end
+ -2 4827 a -2 4827 a
+SDict begin 13 H.A end
+ -2 4827 a -2 4827 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4719) cvn H.B /DEST pdfmark
+end
+ -2 4827
+a Black Black 562 4958 a
+SDict begin H.S end
+ 562 4958 a 562 4958 a
+SDict begin 13 H.A end
+ 562 4958
+a 562 4958 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4720) cvn H.B /DEST pdfmark
+end
+ 562 4958 a FC(NEW)j(for)f(ne)n(w)g(entries.)f(Used)i(by)f
+(the)1727 4958 y
+SDict begin H.S end
+ 1727 4958 a 1727 4958 a
+SDict begin 13 H.A end
+ 1727 4958 a
+1727 4958 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4721) cvn H.B /DEST pdfmark
+end
+ 1727 4958 a FC(Beltane)g(frontend)e(to)j(track)e(the)i
+(status)f(of)g(a)h(message.)-2 5059 y
+SDict begin H.S end
+ -2 5059 a -2 5059
+a
+SDict begin 13 H.A end
+ -2 5059 a -2 5059 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4723) cvn H.B /DEST pdfmark
+end
+ -2 5059 a 396 5149 a FC(path)-2
+5167 y
+SDict begin H.S end
+ -2 5167 a -2 5167 a
+SDict begin 13 H.A end
+ -2 5167 a -2 5167 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4724) cvn H.B /DEST pdfmark
+end
+ -2 5167
+a Black Black 562 5299 a
+SDict begin H.S end
+ 562 5299 a 562 5299 a
+SDict begin 13 H.A end
+ 562 5299
+a 562 5299 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4725) cvn H.B /DEST pdfmark
+end
+ 562 5299 a FC(P)o(ath)f(of)g(a)h(\002le)g(\(whene)n(v)o
+(er)d(a)i(message)g(refers)g(to)g(a)h(\002le\).)p Black
+-2 5805 a
+SDict begin H.S end
+ -2 5805 a -2 5805 a
+SDict begin 13 H.A end
+ -2 5805 a -2 5805 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4731) cvn H.B /DEST pdfmark
+end
+ -2
+5805 a 3617 5874 a Fx(127)p Black eop end
+%%Page: 128 133
+TeXDict begin 128 132 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.128) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black -2 35 a
+SDict begin H.S end
+ -2
+35 a -2 35 a
+SDict begin 13 H.A end
+ -2 35 a -2 35 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MOD-DB-FIELDS) cvn H.B /DEST
+pdfmark end
+ -2 35 a 2582 104 a Fx(Appendix)18
+b(D.)j(List)g(of)g(database)d(\002elds)p Black -2 226
+a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4727) cvn H.B /DEST pdfmark
+end
+ -2 226 a 396 309
+a FC(userid)-2 310 y
+SDict begin H.S end
+ -2 310 a -2 310 a
+SDict begin 13 H.A end
+ -2 310 a -2 310
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4728) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black Black 562 458 a
+SDict begin H.S end
+ 562 458 a 562 458 a
+SDict begin 13 H.A end
+
+562 458 a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4729) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(UID)j(of)f(the)g(current)f(user)h(if)g
+(rele)n(v)n(ant)f(\(e.g.)g(if)i(access)g(to)f(a)h(\002le)g(f)o(ails\).)
+396 649 y(grp)-2 667 y
+SDict begin H.S end
+ -2 667 a -2 667 a
+SDict begin 13 H.A end
+ -2 667 a -2
+667 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4732) cvn H.B /DEST pdfmark
+end
+ -2 667 a Black Black 562 799 a
+SDict begin H.S end
+ 562 799 a 562 799
+a
+SDict begin 13 H.A end
+ 562 799 a 562 799 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4733) cvn H.B /DEST pdfmark
+end
+ 562 799 a FC(Name)f(of)g(a)h(group)d(\(for)h
+(messages)i(reporting)d(problems)h(with)h(a)h(GID,)f(e.g.)f(no)h(entry)
+f(in)i(/etc/group\).)-2 900 y
+SDict begin H.S end
+ -2 900 a -2 900 a
+SDict begin 13 H.A end
+ -2 900
+a -2 900 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4735) cvn H.B /DEST pdfmark
+end
+ -2 900 a 396 989 a FC(program)-2 1007 y
+SDict begin H.S end
+ -2
+1007 a -2 1007 a
+SDict begin 13 H.A end
+ -2 1007 a -2 1007 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4736) cvn H.B /DEST pdfmark
+end
+ -2 1007 a Black
+Black 562 1139 a
+SDict begin H.S end
+ 562 1139 a 562 1139 a
+SDict begin 13 H.A end
+ 562 1139 a 562
+1139 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4737) cvn H.B /DEST pdfmark
+end
+ 562 1139 a FC(Name)f(of)g(the)g(current)f(process)h(\(startup)f
+(message\).)-2 1240 y
+SDict begin H.S end
+ -2 1240 a -2 1240 a
+SDict begin 13 H.A end
+ -2 1240 a -2
+1240 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4739) cvn H.B /DEST pdfmark
+end
+ -2 1240 a 396 1330 a FC(subroutine)-2 1331 y
+SDict begin H.S end
+ -2
+1331 a -2 1331 a
+SDict begin 13 H.A end
+ -2 1331 a -2 1331 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4740) cvn H.B /DEST pdfmark
+end
+ -2 1331 a Black
+Black 562 1479 a
+SDict begin H.S end
+ 562 1479 a 562 1479 a
+SDict begin 13 H.A end
+ 562 1479 a 562
+1479 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4741) cvn H.B /DEST pdfmark
+end
+ 562 1479 a FC(Name)h(of)g(an)g(internal)g(subroutine)e(\(in)i
+(messages)g(reporting)e(f)o(ailure)i(of)g(a)h(subroutine\).)-2
+1580 y
+SDict begin H.S end
+ -2 1580 a -2 1580 a
+SDict begin 13 H.A end
+ -2 1580 a -2 1580 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4743) cvn H.B /DEST pdfmark
+end
+ -2 1580
+a 396 1670 a FC(status)-2 1671 y
+SDict begin H.S end
+ -2 1671 a -2 1671 a
+SDict begin 13 H.A end
+
+-2 1671 a -2 1671 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4744) cvn H.B /DEST pdfmark
+end
+ -2 1671 a Black Black 562 1820 a
+SDict begin H.S end
+
+562 1820 a 562 1820 a
+SDict begin 13 H.A end
+ 562 1820 a 562 1820 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4745) cvn H.B /DEST pdfmark
+end
+ 562 1820
+a FC(Exit)f(status)h(v)n(alue)f(of)g(samhain.)-2 1904
+y
+SDict begin H.S end
+ -2 1904 a -2 1904 a
+SDict begin 13 H.A end
+ -2 1904 a -2 1904 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4747) cvn H.B /DEST pdfmark
+end
+ -2 1904 a 396
+2011 a FC(hash)-2 2012 y
+SDict begin H.S end
+ -2 2012 a -2 2012 a
+SDict begin 13 H.A end
+ -2 2012
+a -2 2012 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4748) cvn H.B /DEST pdfmark
+end
+ -2 2012 a Black Black 562 2160 a
+SDict begin H.S end
+ 562 2160
+a 562 2160 a
+SDict begin 13 H.A end
+ 562 2160 a 562 2160 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4749) cvn H.B /DEST pdfmark
+end
+ 562 2160 a FC(Checksum)g(of)f
+(con\002guration)f(\002le)j(\(if)f(gpg)f(not)h(used\).)f(Startup)h
+(message.)-2 2261 y
+SDict begin H.S end
+ -2 2261 a -2 2261 a
+SDict begin 13 H.A end
+ -2 2261 a -2
+2261 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4751) cvn H.B /DEST pdfmark
+end
+ -2 2261 a 396 2351 a FC(path_data,)f(hash_data)-2
+2369 y
+SDict begin H.S end
+ -2 2369 a -2 2369 a
+SDict begin 13 H.A end
+ -2 2369 a -2 2369 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4752) cvn H.B /DEST pdfmark
+end
+ -2 2369
+a Black Black 562 2500 a
+SDict begin H.S end
+ 562 2500 a 562 2500 a
+SDict begin 13 H.A end
+ 562 2500
+a 562 2500 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4753) cvn H.B /DEST pdfmark
+end
+ 562 2500 a FC(P)o(ath)h(and)g(checksum)f(of)h(data)g
+(\002le)h(\(if)f(gpg)f(not)h(used\).)f(Startup)h(message.)-2
+2601 y
+SDict begin H.S end
+ -2 2601 a -2 2601 a
+SDict begin 13 H.A end
+ -2 2601 a -2 2601 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4755) cvn H.B /DEST pdfmark
+end
+ -2 2601
+a 396 2691 a FC(k)o(e)o(y_uid,)e(k)o(e)o(y_id)-2 2709
+y
+SDict begin H.S end
+ -2 2709 a -2 2709 a
+SDict begin 13 H.A end
+ -2 2709 a -2 2709 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4756) cvn H.B /DEST pdfmark
+end
+ -2 2709 a Black
+Black 562 2841 a
+SDict begin H.S end
+ 562 2841 a 562 2841 a
+SDict begin 13 H.A end
+ 562 2841 a 562
+2841 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4757) cvn H.B /DEST pdfmark
+end
+ 562 2841 a FC(User)j(ID)f(and)g(k)o(e)o(y)f(id)i(of)f(GPG)g(k)o
+(e)o(y)g(used)g(to)g(sign)g(the)h(con\002guration)c(\002le.)k(Startup)e
+(message.)-2 2942 y
+SDict begin H.S end
+ -2 2942 a -2 2942 a
+SDict begin 13 H.A end
+ -2 2942 a -2
+2942 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4759) cvn H.B /DEST pdfmark
+end
+ -2 2942 a 396 3032 a FC(k)o(e)o(y_uid_data)-2
+3050 y
+SDict begin H.S end
+ -2 3050 a -2 3050 a
+SDict begin 13 H.A end
+ -2 3050 a -2 3050 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4760) cvn H.B /DEST pdfmark
+end
+ -2 3050
+a Black Black 562 3181 a
+SDict begin H.S end
+ 562 3181 a 562 3181 a
+SDict begin 13 H.A end
+ 562 3181
+a 562 3181 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4761) cvn H.B /DEST pdfmark
+end
+ 562 3181 a FC(User)i(ID)f(of)g(GPG)h(k)o(e)o(y)e(used)h
+(to)h(sign)f(the)g(data)g(\002le)h(\(dif)n(ferent)d(k)o(e)o(ys)i(for)g
+(con\002guration)d(and)j(data)g(\002le)562 3289 y(cause)g(program)e
+(abort\).)h(Startup)h(f)o(ailure)f(message.)-2 3390 y
+SDict begin H.S end
+
+-2 3390 a -2 3390 a
+SDict begin 13 H.A end
+ -2 3390 a -2 3390 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4763) cvn H.B /DEST pdfmark
+end
+ -2 3390 a 396
+3480 a FC(peer)-2 3498 y
+SDict begin H.S end
+ -2 3498 a -2 3498 a
+SDict begin 13 H.A end
+ -2 3498
+a -2 3498 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4764) cvn H.B /DEST pdfmark
+end
+ -2 3498 a Black Black 562 3630 a
+SDict begin H.S end
+ 562 3630
+a 562 3630 a
+SDict begin 13 H.A end
+ 562 3630 a 562 3630 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4765) cvn H.B /DEST pdfmark
+end
+ 562 3630 a FC(Address)h(of)g(a)h
+(connecting)d(host.)-2 3731 y
+SDict begin H.S end
+ -2 3731 a -2 3731 a
+SDict begin 13 H.A end
+ -2
+3731 a -2 3731 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4767) cvn H.B /DEST pdfmark
+end
+ -2 3731 a 396 3821 a FC(obj)-2 3839
+y
+SDict begin H.S end
+ -2 3839 a -2 3839 a
+SDict begin 13 H.A end
+ -2 3839 a -2 3839 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4768) cvn H.B /DEST pdfmark
+end
+ -2 3839 a Black
+Black 562 3970 a
+SDict begin H.S end
+ 562 3970 a 562 3970 a
+SDict begin 13 H.A end
+ 562 3970 a 562
+3970 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4769) cvn H.B /DEST pdfmark
+end
+ 562 3970 a FC(Generic)i(\002eld)g(to)h(hold)e(additional)g
+(information.)e(Occasionally)i(used.)-2 4071 y
+SDict begin H.S end
+ -2 4071
+a -2 4071 a
+SDict begin 13 H.A end
+ -2 4071 a -2 4071 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4771) cvn H.B /DEST pdfmark
+end
+ -2 4071 a 396 4161 a
+FC(interf)o(ace)-2 4162 y
+SDict begin H.S end
+ -2 4162 a -2 4162 a
+SDict begin 13 H.A end
+ -2 4162
+a -2 4162 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4772) cvn H.B /DEST pdfmark
+end
+ -2 4162 a Black Black 562 4310 a
+SDict begin H.S end
+ 562 4310
+a 562 4310 a
+SDict begin 13 H.A end
+ 562 4310 a 562 4310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4773) cvn H.B /DEST pdfmark
+end
+ 562 4310 a FC(Name)h(of)g(a)h
+(library)e(routine/interf)o(ace)f(\(error)g(messages\).)-2
+4411 y
+SDict begin H.S end
+ -2 4411 a -2 4411 a
+SDict begin 13 H.A end
+ -2 4411 a -2 4411 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4775) cvn H.B /DEST pdfmark
+end
+ -2 4411
+a 396 4501 a FC(dir)-2 4502 y
+SDict begin H.S end
+ -2 4502 a -2 4502 a
+SDict begin 13 H.A end
+ -2
+4502 a -2 4502 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4776) cvn H.B /DEST pdfmark
+end
+ -2 4502 a Black Black 562 4651 a
+SDict begin H.S end
+ 562
+4651 a 562 4651 a
+SDict begin 13 H.A end
+ 562 4651 a 562 4651 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4777) cvn H.B /DEST pdfmark
+end
+ 562 4651 a FC(Name)i(of)g(a)h
+(directory)-5 b(,)18 b(if)i(rele)n(v)n(ant.)-2 4752 y
+SDict begin H.S end
+
+-2 4752 a -2 4752 a
+SDict begin 13 H.A end
+ -2 4752 a -2 4752 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4779) cvn H.B /DEST pdfmark
+end
+ -2 4752 a 396
+4842 a FC(link)o(ed_path)-2 4860 y
+SDict begin H.S end
+ -2 4860 a -2 4860
+a
+SDict begin 13 H.A end
+ -2 4860 a -2 4860 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4780) cvn H.B /DEST pdfmark
+end
+ -2 4860 a Black Black 562 4991
+a
+SDict begin H.S end
+ 562 4991 a 562 4991 a
+SDict begin 13 H.A end
+ 562 4991 a 562 4991 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4781) cvn H.B /DEST pdfmark
+end
+ 562 4991
+a FC(In)g(reports)g(about)f(dangling)f(symlinks.)-2 5092
+y
+SDict begin H.S end
+ -2 5092 a -2 5092 a
+SDict begin 13 H.A end
+ -2 5092 a -2 5092 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4783) cvn H.B /DEST pdfmark
+end
+ -2 5092 a 396
+5182 a FC(port)-2 5200 y
+SDict begin H.S end
+ -2 5200 a -2 5200 a
+SDict begin 13 H.A end
+ -2 5200
+a -2 5200 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4784) cvn H.B /DEST pdfmark
+end
+ -2 5200 a Black Black 562 5332 a
+SDict begin H.S end
+ 562 5332
+a 562 5332 a
+SDict begin 13 H.A end
+ 562 5332 a 562 5332 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4785) cvn H.B /DEST pdfmark
+end
+ 562 5332 a FC(Port)i(number)f(\(in)h
+(reports)f(about)g(connections)g(errors\).)p Black 3620
+5805 a Fx(128)p Black eop end
+%%Page: 129 134
+TeXDict begin 129 133 bop -600 -364 a
+SDict begin /product where{pop product(Distiller)search{pop pop pop
+version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
+closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
+grestore}if}{pop}ifelse}{pop}ifelse}if end
+ -600 -364 a Black
+0 TeXcolorgray -2 134 a
+SDict begin H.S end
+ -2 134 a 0 TeXcolorgray 0 TeXcolorgray
+-2 134 a
+SDict begin H.R end
+ -2 134 a -2 134 a
+SDict begin [ /View [/XYZ H.V] /Dest (page.129) cvn H.B /DEST pdfmark
+end
+ -2 134 a Black 2582 104 a
+Fx(Appendix)18 b(D.)j(List)g(of)g(database)d(\002elds)p
+Black -2 226 a
+SDict begin H.S end
+ -2 226 a -2 226 a
+SDict begin 13 H.A end
+ -2 226 a -2 226 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4787) cvn H.B /DEST pdfmark
+end
+ -2
+226 a 396 309 a FC(service)-2 310 y
+SDict begin H.S end
+ -2 310 a -2 310 a
+SDict begin 13 H.A end
+
+-2 310 a -2 310 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4788) cvn H.B /DEST pdfmark
+end
+ -2 310 a Black Black 562 458 a
+SDict begin H.S end
+ 562
+458 a 562 458 a
+SDict begin 13 H.A end
+ 562 458 a 562 458 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4789) cvn H.B /DEST pdfmark
+end
+ 562 458 a FC(Logging)g(f)o(acility)
+j(or)e(remote)h(service)g(\(f)o(ailure)f(reports\).)-2
+518 y
+SDict begin H.S end
+ -2 518 a -2 518 a
+SDict begin 13 H.A end
+ -2 518 a -2 518 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:MOD-DB-FIELDS) cvn H.B /DEST
+pdfmark end
+ -2 518 a 359
+x Fu(D)l(.2.)38 b(Modules)880 877 y
+SDict begin H.S end
+ 880 877 a 880 877
+a
+SDict begin 22.464 H.A end
+ 880 877 a 880 877 a
+SDict begin [ /View [/XYZ H.V] /Dest (17.96.1) cvn H.B /DEST pdfmark
+end
+ 880 877 a -2 879 a
+SDict begin H.S end
+ -2 879 a -2
+879 a
+SDict begin 13 H.A end
+ -2 879 a -2 879 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4792) cvn H.B /DEST pdfmark
+end
+ -2 879 a -2 1003 a
+SDict begin H.S end
+ -2 1003 a
+-2 1003 a
+SDict begin 13 H.A end
+ -2 1003 a -2 1003 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4794) cvn H.B /DEST pdfmark
+end
+ -2 1003 a 396 1109 a FC(module)-2
+1110 y
+SDict begin H.S end
+ -2 1110 a -2 1110 a
+SDict begin 13 H.A end
+ -2 1110 a -2 1110 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4795) cvn H.B /DEST pdfmark
+end
+ -2 1110
+a Black Black 562 1259 a
+SDict begin H.S end
+ 562 1259 a 562 1259 a
+SDict begin 13 H.A end
+ 562 1259
+a 562 1259 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4796) cvn H.B /DEST pdfmark
+end
+ 562 1259 a FC(Name)20 b(of)g(a)h(samhain)e(module)g
+(\(e.g.)g(the)i(module)d(to)j(w)o(atch)f(login/logout)e(e)n(v)o
+(ents\).)h(Used)h(in)562 1367 y(initialization/error)e(reports)i(for)f
+(a)i(module.)-2 1468 y
+SDict begin H.S end
+ -2 1468 a -2 1468 a
+SDict begin 13 H.A end
+ -2 1468 a
+-2 1468 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4798) cvn H.B /DEST pdfmark
+end
+ -2 1468 a 396 1558 a FC(return_code)-2 1568
+y
+SDict begin H.S end
+ -2 1568 a -2 1568 a
+SDict begin 13 H.A end
+ -2 1568 a -2 1568 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4799) cvn H.B /DEST pdfmark
+end
+ -2 1568 a Black
+Black 562 1707 a
+SDict begin H.S end
+ 562 1707 a 562 1707 a
+SDict begin 13 H.A end
+ 562 1707 a 562
+1707 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4800) cvn H.B /DEST pdfmark
+end
+ 562 1707 a FC(Return)f(code)g(from)f(a)h(module.)f(Used)h(in)h
+(initialization/error)c(reports)j(for)f(a)i(module.)-2
+1808 y
+SDict begin H.S end
+ -2 1808 a -2 1808 a
+SDict begin 13 H.A end
+ -2 1808 a -2 1808 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4802) cvn H.B /DEST pdfmark
+end
+ -2 1808
+a 396 1898 a FC(syscall)-2 1916 y
+SDict begin H.S end
+ -2 1916 a -2 1916 a
+SDict begin 13 H.A end
+
+-2 1916 a -2 1916 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4803) cvn H.B /DEST pdfmark
+end
+ -2 1916 a Black Black 562 2047 a
+SDict begin H.S end
+
+562 2047 a 562 2047 a
+SDict begin 13 H.A end
+ 562 2047 a 562 2047 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4804) cvn H.B /DEST pdfmark
+end
+ 562 2047
+a FC(ID)g(of)f(bad)f(syscall.)i(K)n(ernel)e(checking)g(module.)-2
+2148 y
+SDict begin H.S end
+ -2 2148 a -2 2148 a
+SDict begin 13 H.A end
+ -2 2148 a -2 2148 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4806) cvn H.B /DEST pdfmark
+end
+ -2 2148
+a 396 2238 a FC(ip)-2 2256 y
+SDict begin H.S end
+ -2 2256 a -2 2256 a
+SDict begin 13 H.A end
+ -2 2256
+a -2 2256 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4807) cvn H.B /DEST pdfmark
+end
+ -2 2256 a Black Black 562 2388 a
+SDict begin H.S end
+ 562 2388
+a 562 2388 a
+SDict begin 13 H.A end
+ 562 2388 a 562 2388 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4808) cvn H.B /DEST pdfmark
+end
+ 562 2388 a FC(IP)i(address.)e
+(Login/logout)f(w)o(atch.)i(Also)g(used)g(in)h(recei)n(v)o(ed)d(syslog)
+i(messages)g(\(see)h(belo)n(w\).)-2 2489 y
+SDict begin H.S end
+ -2 2489 a
+-2 2489 a
+SDict begin 13 H.A end
+ -2 2489 a -2 2489 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4810) cvn H.B /DEST pdfmark
+end
+ -2 2489 a 396 2579 a FC(tty)-2
+2597 y
+SDict begin H.S end
+ -2 2597 a -2 2597 a
+SDict begin 13 H.A end
+ -2 2597 a -2 2597 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4811) cvn H.B /DEST pdfmark
+end
+ -2 2597
+a Black Black 562 2728 a
+SDict begin H.S end
+ 562 2728 a 562 2728 a
+SDict begin 13 H.A end
+ 562 2728
+a 562 2728 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4812) cvn H.B /DEST pdfmark
+end
+ 562 2728 a FC(T)-6 b(erminal)20 b(used.)f(Login/logout)f
+(w)o(atch.)-2 2829 y
+SDict begin H.S end
+ -2 2829 a -2 2829 a
+SDict begin 13 H.A end
+ -2 2829 a -2
+2829 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4814) cvn H.B /DEST pdfmark
+end
+ -2 2829 a 396 2919 a FC(time)-2 2920 y
+SDict begin H.S end
+ -2 2920
+a -2 2920 a
+SDict begin 13 H.A end
+ -2 2920 a -2 2920 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4815) cvn H.B /DEST pdfmark
+end
+ -2 2920 a Black Black
+562 3069 a
+SDict begin H.S end
+ 562 3069 a 562 3069 a
+SDict begin 13 H.A end
+ 562 3069 a 562 3069
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4816) cvn H.B /DEST pdfmark
+end
+ 562 3069 a FC(Login/logout)g(time.)i(Also)g(used)g(in)h(some)f(other)
+f(messages)h(\(e.g.)g(time)g(to)g(complete)f(\002le)i(check\).)-2
+3170 y
+SDict begin H.S end
+ -2 3170 a -2 3170 a
+SDict begin 13 H.A end
+ -2 3170 a -2 3170 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4818) cvn H.B /DEST pdfmark
+end
+ -2 3170
+a 396 3260 a FC(fromhost)-2 3261 y
+SDict begin H.S end
+ -2 3261 a -2 3261
+a
+SDict begin 13 H.A end
+ -2 3261 a -2 3261 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4819) cvn H.B /DEST pdfmark
+end
+ -2 3261 a Black Black 562 3409
+a
+SDict begin H.S end
+ 562 3409 a 562 3409 a
+SDict begin 13 H.A end
+ 562 3409 a 562 3409 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4820) cvn H.B /DEST pdfmark
+end
+ 562 3409
+a FC(Host)g(from)e(which)h(user)g(is)h(logged)e(in.)h(Login/logout)d(w)
+o(atch.)-2 3468 y
+SDict begin H.S end
+ -2 3468 a -2 3468 a
+SDict begin 13 H.A end
+ -2 3468 a -2 3468
+a
+SDict begin [ /View [/XYZ H.V] /Dest (0:SYS-DB-FIELDS) cvn H.B /DEST
+pdfmark end
+ -2 3468 a 360 x Fu(D)l(.3.)38 b(Syslog)768 3828 y
+SDict begin H.S end
+ 768
+3828 a 768 3828 a
+SDict begin 22.464 H.A end
+ 768 3828 a 768 3828 a
+SDict begin [ /View [/XYZ H.V] /Dest (17.97.1) cvn H.B /DEST pdfmark
+end
+ 768 3828 a -2
+3859 a
+SDict begin H.S end
+ -2 3859 a -2 3859 a
+SDict begin 13 H.A end
+ -2 3859 a -2 3859 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4823) cvn H.B /DEST pdfmark
+end
+ -2 3859
+a -2 3984 a
+SDict begin H.S end
+ -2 3984 a -2 3984 a
+SDict begin 13 H.A end
+ -2 3984 a -2 3984 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4825) cvn H.B /DEST pdfmark
+end
+ -2
+3984 a 396 4060 a FC(ip)-2 4078 y
+SDict begin H.S end
+ -2 4078 a -2 4078 a
+SDict begin 13 H.A end
+
+-2 4078 a -2 4078 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4826) cvn H.B /DEST pdfmark
+end
+ -2 4078 a Black Black 562 4209 a
+SDict begin H.S end
+
+562 4209 a 562 4209 a
+SDict begin 13 H.A end
+ 562 4209 a 562 4209 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4827) cvn H.B /DEST pdfmark
+end
+ 562 4209
+a FC(IP)21 b(of)f(remote)f(host)h(recei)n(v)o(ed)f(syslog)h(reports.)f
+(Also)h(used)g(in)h(the)f(login/logout)e(w)o(atch)i(module)f(\(see)562
+4317 y(abo)o(v)o(e\).)-2 4415 y
+SDict begin H.S end
+ -2 4415 a -2 4415 a
+SDict begin 13 H.A end
+ -2
+4415 a -2 4415 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4829) cvn H.B /DEST pdfmark
+end
+ -2 4415 a 396 4508 a FC(f)o(acility)-2
+4526 y
+SDict begin H.S end
+ -2 4526 a -2 4526 a
+SDict begin 13 H.A end
+ -2 4526 a -2 4526 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4830) cvn H.B /DEST pdfmark
+end
+ -2 4526
+a Black Black 562 4658 a
+SDict begin H.S end
+ 562 4658 a 562 4658 a
+SDict begin 13 H.A end
+ 562 4658
+a 562 4658 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4831) cvn H.B /DEST pdfmark
+end
+ 562 4658 a FC(Syslog)h(f)o(acility)g(for)g(recei)n(v)o(ed)
+e(syslog)i(reports.)-2 4759 y
+SDict begin H.S end
+ -2 4759 a -2 4759 a
+SDict begin 13 H.A end
+ -2
+4759 a -2 4759 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4833) cvn H.B /DEST pdfmark
+end
+ -2 4759 a 396 4849 a FC(priority)-2
+4867 y
+SDict begin H.S end
+ -2 4867 a -2 4867 a
+SDict begin 13 H.A end
+ -2 4867 a -2 4867 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4834) cvn H.B /DEST pdfmark
+end
+ -2 4867
+a Black Black 562 4998 a
+SDict begin H.S end
+ 562 4998 a 562 4998 a
+SDict begin 13 H.A end
+ 562 4998
+a 562 4998 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4835) cvn H.B /DEST pdfmark
+end
+ 562 4998 a FC(Syslog)g(priority)f(for)h(recei)n(v)o(ed)e
+(syslog)i(reports.)-2 5099 y
+SDict begin H.S end
+ -2 5099 a -2 5099 a
+SDict begin 13 H.A end
+ -2 5099
+a -2 5099 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4837) cvn H.B /DEST pdfmark
+end
+ -2 5099 a 396 5189 a FC(syslog_msg)-2 5207
+y
+SDict begin H.S end
+ -2 5207 a -2 5207 a
+SDict begin 13 H.A end
+ -2 5207 a -2 5207 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4838) cvn H.B /DEST pdfmark
+end
+ -2 5207 a Black
+Black 562 5339 a
+SDict begin H.S end
+ 562 5339 a 562 5339 a
+SDict begin 13 H.A end
+ 562 5339 a 562
+5339 a
+SDict begin [ /View [/XYZ H.V] /Dest (0:4839) cvn H.B /DEST pdfmark
+end
+ 562 5339 a FC(Syslog)g(message)g(for)g(recei)n(v)o(ed)e(syslog)i
+(reports.)p Black 3620 5805 a Fx(129)p Black eop end
+%%Trailer
+
+userdict /end-hook known{end-hook}if
+%%EOF
Index: trunk/docs/README
===================================================================
--- trunk/docs/README	(revision 591)
+++ trunk/docs/README	(revision 1)
@@ -137,5 +137,5 @@
 
 	NOTE: client and server are __distict__ applications, and must be
-	built separately. By default, installation names and paths are
+	built seperately. By default, installation names and paths are
 	different. Do not blame us if you abuse './configure' options to 
 	cause name clashes, if you install both on the same host.
Index: trunk/docs/README.UPGRADE
===================================================================
--- trunk/docs/README.UPGRADE	(revision 591)
+++ trunk/docs/README.UPGRADE	(revision 1)
@@ -1,94 +1,2 @@
-to 4.0.0 and higher: if you use "ReportCheckflags = yes" (off by default),
-  you need to change the database scheme:
-
-  -- mysql:
-	  ALTER TABLE samhain.log ADD COLUMN checkflags_old BIGINT UNSIGNED;
-	  ALTER TABLE samhain.log ADD COLUMN checkflags_new BIGINT UNSIGNED;
-
-  -- postgres:
-	  ALTER TABLE samhain.log ADD COLUMN checkflags_old NUMERIC(20); 
-	  ALTER TABLE samhain.log ADD COLUMN checkflags_new NUMERIC(20);
-
-  --oracle:
-	  ALTER TABLE samhain.log ADD checkflags_old NUMBER(20); 
-	  ALTER TABLE samhain.log ADD checkflags_new NUMBER(20); 
-
-to 2.8.0 and higher: samhain supports IPv6 now, which means that the
-  size of the 'ip' column in the database must be increased from
-  VARCHAR(16) to VARCHAR(46).
-
-  BE SURE TO MAKE A BACKUP BEFORE THIS!
-
-  -- mysql: alter table samhain.log modify ip VARCHAR(46);
-
-  -- postgresql: alter table samhain.log alter column ip type varchar(46);
-
-  -- oracle: alter table samhain.log modify ip VARCHAR2(46);
-
-  
-to 2.4.4 and higher: it is possible now to store the full content of
-  small files in the baseline database. To support this feature with
-  logging to an RDBMS, the DB schema for Oracle needs to be adjusted
-  by converting the link_old, link_new columns from VARCHAR2 to CLOB:
-
-  -- Oracle:
-      ALTER TABLE samhain.log ADD tmp_name CLOB;
-      UPDATE samhain.log SET tmp_name=link_old;
-      ALTER TABLE samhain.log DROP COLUMN link_old;
-      ALTER TABLE samhain.log RENAME COLUMN tmp_name to link_old;
-
-      ALTER TABLE samhain.log ADD tmp_name CLOB;
-      UPDATE samhain.log SET tmp_name=link_new;
-      ALTER TABLE samhain.log DROP COLUMN link_new;
-      ALTER TABLE samhain.log RENAME COLUMN tmp_name to link_new;
-
-  -- Samhain server (yule): if you are logging to the RDBMS via
-     the server (yule), as recommended, you need to also upgrade the 
-     server, because earlier versions had a too restrictive limit on 
-     the maximum length of an SQL query.
-
-    
-to 2.3.3 and higher: a bug has been fixed that resulted in an additional
-  slash at the beginning of the linked path of symlinks in the root
-  directory (symlinks in other directories were not affected)
-
-  -- this may cause spurious warnings about modified links, if you check
-     against a database created with an earlier version of samhain 
-
-from lower to 2.3.x: the database scheme has changed slightly. 
-  To upgrade, use the following SQL commands in the command-line
-  client of your database:
-
-  -- MySQL:
-	ALTER TABLE samhain.log ADD COLUMN acl_old BLOB;
-	ALTER TABLE samhain.log ADD COLUMN acl_new BLOB;
-
-  -- PostgreSQL:
-	ALTER TABLE samhain.log ADD COLUMN acl_old TEXT;
-	ALTER TABLE samhain.log ADD COLUMN acl_new TEXT;
-
-  -- Oracle:
-	ALTER TABLE samhain.log ADD acl_old VARCHAR2(4000);
-	ALTER TABLE samhain.log ADD acl_new VARCHAR2(4000);
-	DROP TRIGGER trigger_on_log;
- 
-
-
-since 2.2.0: server-to-server relay is possible
-
-  -- this implies that problems will arise if your server is misconfigured
-     to connect to itself (SetExportSeverity is explicitely set
-     to a threshold different from 'none', and the logserver is set to 
-     localhost). The server may deadlock in this case.
-
-
-
-since 2.1.0: update and daemon mode can be combined
-
-  -- this implies that '-t update' will start a daemon process if running as
-     daemon is the default specified in the config file. use '--foreground'
-     to avoid starting a daemon process
-
-
 
 from 1.7.x to 1.8.x: client/server encryption protocol has been enhanced
Index: trunk/docs/README.sstrip
===================================================================
--- trunk/docs/README.sstrip	(revision 1)
+++ trunk/docs/README.sstrip	(revision 1)
@@ -0,0 +1,40 @@
+sstrip is a small utility that removes the contents at the end of an
+ELF file that are not part of the program's memory image.
+
+Most ELF executables are built with both a program header table and a
+section header table. However, only the former is required in order
+for the OS to load, link and execute a program. sstrip attempts to
+extract the ELF header, the program header table, and its contents,
+leaving everything else in the bit bucket. It can only remove parts of
+the file that occur at the end, after the parts to be saved. However,
+this almost always includes the section header table, and occasionally
+a few random sections that are not used when running a program.
+
+It should be noted that the GNU bfd library is (understandably)
+dependent on the section header table as an index to the file's
+contents. Thus, an executable file that has no section header table
+cannot be used with gdb, objdump, or any other program based upon the
+bfd library, at all. In fact, the program will not even recognize the
+file as a valid executable. (This limitation is noted in the source
+code comments for bfd, and is marked "FIXME", so this may change at
+some future date. However, I would imagine that it is a pretty
+low-priority item, as executables without a section header table are
+rare in the extreme.) This probably also explains why strip doesn't
+offer the option to do this.
+
+Shared library files may also have their section header table removed.
+Such a library will still function; however, it will no longer be
+possible for a compiler to link a new program against it.
+
+As an added bonus, sstrip also tries to removes trailing zero bytes
+from the end of the file. (This normally cannot be done with an
+executable that has a section header table.)
+
+sstrip is a very simplistic program. It depends upon the common
+practice of putting the parts of the file that contribute to the
+memory image at the front, and the remaining material at the end. This
+permits it to discard the latter material without affecting file
+offsets and memory addresses in what remains. However, the ELF
+standard permits files to be organized in almost any order. So
+although this procedure usually works in practice, it is not meant to
+be taken too seriously.
Index: trunk/docs/TODO
===================================================================
--- trunk/docs/TODO	(revision 1)
+++ trunk/docs/TODO	(revision 1)
@@ -0,0 +1,6 @@
+
+Wishlist:
+
+ - yule -> yule relay
+ - partial checksum of growing logfiles
+ 
Index: trunk/dsys/comBUILD
===================================================================
--- trunk/dsys/comBUILD	(revision 591)
+++ trunk/dsys/comBUILD	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandBUILD() {
@@ -70,5 +52,5 @@
     fi
 
-    tmpdir=`eval echo "${temp_dir}/sh_${src_version}_${arch}_${format}_$$"`
+    tmpdir=`eval echo "/tmp/sh_${src_version}_${arch}_${format}_$$"`
 
     #---------------------------------------------------------------------
Index: trunk/dsys/comCHECKSRC
===================================================================
--- trunk/dsys/comCHECKSRC	(revision 591)
+++ trunk/dsys/comCHECKSRC	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandCHECKSRC() {
Index: trunk/dsys/comCLEAN
===================================================================
--- trunk/dsys/comCLEAN	(revision 591)
+++ trunk/dsys/comCLEAN	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandCLEAN() {
Index: trunk/dsys/comDOWNLOAD
===================================================================
--- trunk/dsys/comDOWNLOAD	(revision 591)
+++ trunk/dsys/comDOWNLOAD	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandDOWNLOAD() {
@@ -129,5 +111,5 @@
     if test -z "$command"
     then
-	printFATAL "No wget, curl, lynx, links, lwp-request, fetch, fget in your \$PATH, cannot download"
+	printFATAL "No wget, curl, lynx, links, lwp-request, fetch in your \$PATH, cannot download"
     fi
 
Index: trunk/dsys/comINSTALL
===================================================================
--- trunk/dsys/comINSTALL	(revision 591)
+++ trunk/dsys/comINSTALL	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandINSTALL() {
@@ -169,5 +151,5 @@
     #---------------------------------------------------------------------
 
-    tmpdir=`eval echo "${temp_dir}/sh_${src_version}_${arch}_${format}_$$"`
+    tmpdir=`eval echo "/tmp/sh_${src_version}_${arch}_${format}_$$"`
 
     if test x"$simulate" = x0
@@ -255,12 +237,4 @@
 	    printINFO "ssh -x -l root ${host} /bin/sh -c '(cd ${tmpdir} && eval ${is_command} ${tmpdir}/samhain-${src_version}.${realformat} ${tmp_iname})'"
         fi
-    elif test "x$format" = "xsolaris-pkg"
-    then
-        if test x"$simulate" = x0
-        then
-            ssh -x -l "root" "${host}" /bin/sh -c \''(cd "'${tmpdir}'" && PATH="'/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH'" && export PATH && eval "'${is_command}'" "'samhain-${src_version}.${realformat} all'") >/dev/null '\'
-        else
-	    printINFO "ssh -x -l root ${host} /bin/sh -c '(cd ${tmpdir} && eval ${is_command} samhain-${src_version}.${realformat}) all'"
-        fi
     elif test "x$format" = "xtbz2"
     then
@@ -329,13 +303,6 @@
 	if test "x$mytest_file" = x; then
 	    rcfile_perm=640;
-	    xgid=`(cat /etc/group; ypcat group) 2>/dev/null |\
-              grep "^samhain:" | awk -F: '{ print $3; }'`
-	    if test "x$xgid" = x; then
-	      rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
-	      rcfile_group=`ls -ld ${yule_data} | awk '{print $4 }'`
-	    else
-	      rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
-	      rcfile_group=samhain
-	    fi
+	    rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
+	    rcfile_group=`ls -ld ${yule_data} | awk '{print $4 }'`
 	else
 	    mytest_file=`basename $mytest_file`
@@ -373,24 +340,7 @@
     #---------------------------------------------------------------------
 
-    instlock="${yule_conf}.lockdir";
-    trap "rm -rf ${instlock}" 1 2 13 15
-
-    if test x"$simulate" = x0
-    then
-	#
-	# A lockfile will not work, because 'root' can write anyway.
-	# However, 'mkdir' an existing directory will fail even for root
-	#
-	until (umask 222; mkdir "${instlock}") 2>/dev/null   # test & set
-	do
-	   printINFO "Waiting for lock"
-	   sleep 1
-	done
-    fi
-
     Replace=`"${yule_exec}" -P "${is_passwd}" | sed s%HOSTNAME%${host}%g`
     if test "x$Replace" = x
     then
-	rm -rf "${instlock}"
 	printFATAL "Could not execute ${yule_exec} -P ${is_passwd}."
     fi
@@ -406,9 +356,5 @@
             then
 	        Seen=y
-		echo "$Replace" >>"$tmpF" 
-		if [ $? -ne 0 ]; then
-			rm -rf "${instlock}"
-			printFATAL "Cannot write new server configuration."
-		fi
+		echo "$Replace" >>"$tmpF" || printFATAL "Cannot write new server configuration."
 	    fi
         else
@@ -417,9 +363,5 @@
 		:
 	    else
-		echo "$line" >>"$tmpF"
-		if [ $? -ne 0 ]; then
-			rm -rf "${instlock}"
-			printFATAL "Cannot write new server configuration."
-		fi
+		echo "$line" >>"$tmpF" || printFATAL "Cannot write new server configuration."
             fi
         fi
@@ -438,27 +380,8 @@
     if test x"$simulate" = x0
     then
-        ageFILE "${yule_conf}"
-	if [ $? -ne 0 ]; then
-		rm -rf "${instlock}"
-		printFATAL "Could not backup ${yule_conf}"
-	fi
-
-        rm -f "${yule_conf}" && cp "$tmpF"  "${yule_conf}"
-	if [ $? -ne 0 ]; then
-		rm -rf "${instlock}"
-		printFATAL "Could not write new server config. Backup is ${yule_conf}.1"
-	fi
-
-        chown ${rcfile_owner}:${rcfile_group} "${yule_conf}"
-	if [ $? -ne 0 ]; then
-		rm -rf "${instlock}"
-		printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${yule_conf}"
-	fi
-
-        chmod ${rcfile_perm} "${yule_conf}"
-	if [ $? -ne 0 ]; then
-		rm -rf "${instlock}"
-		printFATAL "Could not chmod ${rcfile_perm} ${yule_conf}"
-	fi
+        ageFILE "${yule_conf}" || printFATAL "Could not backup ${yule_conf}."
+        rm -f "${yule_conf}" && { cp "$tmpF"  "${yule_conf}" || printFATAL "Could not write new server config. Backup is ${yule_conf}.1"; }
+        chown ${rcfile_owner}:${rcfile_group} "${yule_conf}" || printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${yule_conf}"
+        chmod ${rcfile_perm} "${yule_conf}" || printFATAL "Could not chmod ${rcfile_perm} ${yule_conf}"
     else
         printINFO "Backup and update ${yule_conf}"
@@ -500,5 +423,4 @@
 	sleep 5
 	#
-	rm -rf "${instlock}"
     else
         printINFO "Reloading server configuration."
@@ -506,5 +428,4 @@
 
     printLOG "Server configuration updated and reloaded."
-
 
     #---------------------------------------------------------------------
@@ -553,13 +474,6 @@
 	if test "x$mytest_file" = x; then
 	    rcfile_perm=640;
-	    xgid=`(cat /etc/group; ypcat group) 2>/dev/null |\
-              grep "^samhain:" | awk -F: '{ print $3; }'`
-	    if test "x$xgid" = x; then
-	      rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
-	      rcfile_group=`ls -ld ${yule_data} | awk '{print $4 }'`
-	    else
-	      rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
-	      rcfile_group=samhain
-	    fi
+	    rcfile_owner=`ls -ld ${yule_data} | awk '{print $3 }'`
+	    rcfile_group=`ls -ld ${yule_data} | awk '{print $4 }'`
 	else
 	    mytest_file=`basename $mytest_file`
Index: trunk/dsys/comUNINSTALL
===================================================================
--- trunk/dsys/comUNINSTALL	(revision 591)
+++ trunk/dsys/comUNINSTALL	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 commandUNINSTALL() {
@@ -79,5 +61,5 @@
     #---------------------------------------------------------------------
 
-    tmpdir=`eval echo "${temp_dir}/sh_${src_version}_${arch}_${format}_$$"`
+    tmpdir=`eval echo "/tmp/sh_${src_version}_${arch}_${format}_$$"`
 
     if test x"$simulate" = x0
Index: trunk/dsys/funcBUILD
===================================================================
--- trunk/dsys/funcBUILD	(revision 591)
+++ trunk/dsys/funcBUILD	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 #------------------------------------------------------------------------
Index: trunk/dsys/funcDB
===================================================================
--- trunk/dsys/funcDB	(revision 591)
+++ trunk/dsys/funcDB	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 DBFTEST=0
Index: trunk/dsys/funcDIALOG
===================================================================
--- trunk/dsys/funcDIALOG	(revision 591)
+++ trunk/dsys/funcDIALOG	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 # print without newline
Index: trunk/dsys/funcEXE
===================================================================
--- trunk/dsys/funcEXE	(revision 591)
+++ trunk/dsys/funcEXE	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 findEXE() {
Index: trunk/dsys/funcINSTALL
===================================================================
--- trunk/dsys/funcINSTALL	(revision 591)
+++ trunk/dsys/funcINSTALL	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 getconfopts () {
@@ -62,5 +44,4 @@
     echo "  <client>"
     echo "    <client_host>${host}</client_host>"
-    echo "    <client_group>${hostgroup}</client_group>"
     echo "    <client_os_machine>${arch}</client_os_machine>"
     echo "    <client_install_status>${install_entry}</client_install_status>"
@@ -110,18 +91,4 @@
         DATABASE="${basedir}/${defdatabase}"
     fi
-
-    updlock="${DATABASE}.lockdir"
-    trap "rm -rf ${updlock}" 1 2 13 15
-
-    #
-    # A lockfile will not work, because 'root' can write anyway.
-    # However, 'mkdir' an existing directory will fail even for root
-    #
-    until (umask 222; mkdir "${updlock}") 2>/dev/null   # test & set
-    do
-       printINFO "Waiting for lock"
-       sleep 1
-    done
-
 
     IDATE=`date +"%Y-%m-%d %H:%M:%S"`
@@ -173,10 +140,6 @@
 		if test "x$?" = "x1"
 		then
-		    #
-		    # Write the full entry when client_os_machine is found
-		    #
 		    case "$line" in
 		    *\<client_os_machine\>*\</client_os_machine\>)
-		    echo "    <client_group>${hostgroup}</client_group>"           >>"${tmpF}"
 		    echo "    <client_os_machine>${arch}</client_os_machine>"           >>"${tmpF}"
 		    echo "    <client_install_status>${install_entry}</client_install_status>"    >>"${tmpF}"
@@ -187,25 +150,26 @@
 		    ;;
 
-		    *\<client_group\>*\</client_group\>)
+		    *\<client_install_status\>*\</client_install_status\>)
+                    # echo "    <client_install_status>${install_entry}</client_install_status>"    >>"${tmpF}"
 		    :
 		    ;;
-			
-		    *\<client_install_status\>*\</client_install_status\>)
-		    :
-		    ;;
 
 		    *\<client_install_date\>*\</client_install_date\>)
+                    # echo "    <client_install_date>${IDATE}</client_install_date>"         >>"${tmpF}"
 		    :
 	            ;;
 
 		    *\<client_install_name\>*\</client_install_name\>)
+                    # echo "    <client_install_name>${SH_NAME}</client_install_name>"       >>"${tmpF}"
 		    :
 		    ;;
 
 		    *\<client_install_prefix\>*\</client_install_prefix\>)
+                    # echo "    <client_install_prefix>${SH_PREFIX}</client_install_prefix>" >>"${tmpF}"
 		    :
 		    ;;
 
 		    *\<client_install_version\>*\</client_install_version\>)
+                    # echo "    <client_install_version>${src_version}.${realformat}</client_install_version>" >>"${tmpF}"
 		    :
 		    ;;
@@ -251,5 +215,5 @@
      printINFO "Write ${DATABASE} from scratch"
      echo '<?xml version="1.0" encoding="ISO-8859-1"?>' >"${tmpF}"
-     echo '<!DOCTYPE yule_db SYSTEM "http://la-samhna.de/yule_db-0.2.dtd">' \
+     echo '<!DOCTYPE yule_db SYSTEM "http://la-samhna.de/yule_db-0.1.dtd">' \
 	  >>"${tmpF}"
      echo "<yule_db>"   >>"${tmpF}"
@@ -259,16 +223,7 @@
     fi
 
-    chown ${rcfile_owner}:${rcfile_group} "${DATABASE}"
-    if [ $? -ne 0 ]; then
-    	rm -rf "${updlock}"
-    	printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${DATABASE}"
-    fi
-    chmod ${rcfile_perm} "${DATABASE}"
-    if [ $? -ne 0 ]; then
-    	rm -rf "${updlock}"
-    	printFATAL "Could not chmod ${rcfile_perm} ${DATABASE}"
-    fi
-
-    rm -rf "${updlock}"
+    chown ${rcfile_owner}:${rcfile_group} "${DATABASE}" || printFATAL "Could not chown ${rcfile_owner}:${rcfile_group} ${DATABASE}"
+    chmod ${rcfile_perm} "${DATABASE}" || printFATAL "Could not chmod ${rcfile_perm} ${DATABASE}"
+
 }
 
@@ -400,8 +355,4 @@
 	   command="$command other"
 	fi
-        if test $n -eq 0
-        then
-            printFATAL "No binary packages built yet !"
-        fi
 	    
 	eval ${command}
Index: trunk/dsys/funcPRINT
===================================================================
--- trunk/dsys/funcPRINT	(revision 591)
+++ trunk/dsys/funcPRINT	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 # Fatal error
Index: trunk/dsys/funcSETUP
===================================================================
--- trunk/dsys/funcSETUP	(revision 591)
+++ trunk/dsys/funcSETUP	(revision 1)
@@ -4,22 +4,4 @@
 #
 #########################################################################
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 # test setup
Index: trunk/dsys/initscript
===================================================================
--- trunk/dsys/initscript	(revision 591)
+++ trunk/dsys/initscript	(revision 1)
@@ -1,22 +1,3 @@
 #! /bin/sh
-
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 startup=no
Index: trunk/dsys/postinstall
===================================================================
--- trunk/dsys/postinstall	(revision 591)
+++ trunk/dsys/postinstall	(revision 1)
@@ -1,22 +1,3 @@
 #! /bin/sh
-
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 name=`./samhain-install.sh --print-config name`
Index: trunk/dsys/preinstall
===================================================================
--- trunk/dsys/preinstall	(revision 591)
+++ trunk/dsys/preinstall	(revision 1)
@@ -1,21 +1,3 @@
 #! /bin/sh
-#
-# Copyright Rainer Wichmann (2005)
-#
-# 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.
-#
 
 name=`./samhain-install.sh --print-config name`
Index: trunk/hp_ux.psf.in
===================================================================
--- trunk/hp_ux.psf.in	(revision 591)
+++ trunk/hp_ux.psf.in	(revision 1)
@@ -15,7 +15,4 @@
   directory      /
   is_locatable   false
-
-# Dummy for configure warning
-# datarootdir = @datarootdir@
 
 # Specify a checkremove script that executes during the 
Index: trunk/include/CuTest.h
===================================================================
--- trunk/include/CuTest.h	(revision 591)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/*******************
-
-LICENSE
-
-Copyright (c) 2003 Asim Jalis
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software in
-a product, an acknowledgment in the product documentation would be
-appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and must not
-be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source
-distribution.
-
-**********************/
-
-#ifndef CU_TEST_H
-#define CU_TEST_H
-
-#include <setjmp.h>
-#include <stdarg.h>
-
-/* CuString */
-
-char* CuStrAlloc(int size);
-char* CuStrCopy(const char* old);
-
-#define CU_ALLOC(TYPE)		((TYPE*) malloc(sizeof(TYPE)))
-
-#define HUGE_STRING_LEN	8192
-#define STRING_MAX		256
-#define STRING_INC		256
-
-typedef struct
-{
-	int length;
-	int size;
-	char* buffer;
-} CuString;
-
-void CuStringInit(CuString* str);
-CuString* CuStringNew(void);
-void CuStringRead(CuString* str, const char* path);
-void CuStringAppend(CuString* str, const char* text);
-void CuStringAppendChar(CuString* str, char ch);
-void CuStringAppendFormat(CuString* str, const char* format, ...);
-void CuStringInsert(CuString* str, const char* text, int pos);
-void CuStringResize(CuString* str, int newSize);
-
-/* CuTest */
-
-typedef struct CuTest CuTest;
-
-typedef void (*TestFunction)(CuTest *);
-
-struct CuTest
-{
-	const char* name;
-	TestFunction function;
-	int failed;
-	int ran;
-	const char* message;
-	jmp_buf *jumpBuf;
-};
-
-void CuTestInit(CuTest* t, const char* name, TestFunction function);
-CuTest* CuTestNew(const char* name, TestFunction function);
-void CuTestRun(CuTest* tc);
-
-/* Internal versions of assert functions -- use the public versions */
-void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message);
-void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition);
-void CuAssertStrEquals_LineMsg(CuTest* tc, 
-	const char* file, int line, const char* message, 
-	const char* expected, const char* actual);
-void CuAssertIntEquals_LineMsg(CuTest* tc, 
-	const char* file, int line, const char* message, 
-	int expected, int actual);
-void CuAssertDblEquals_LineMsg(CuTest* tc, 
-	const char* file, int line, const char* message, 
-	double expected, double actual, double delta);
-void CuAssertPtrEquals_LineMsg(CuTest* tc, 
-	const char* file, int line, const char* message, 
-	void* expected, void* actual);
-
-/* public assert functions */
-
-#define CuFail(tc, ms)                        CuFail_Line(  (tc), __FILE__, __LINE__, NULL, (ms))
-#define CuAssert(tc, ms, cond)                CuAssert_Line((tc), __FILE__, __LINE__, (ms), (cond))
-#define CuAssertTrue(tc, cond)                CuAssert_Line((tc), __FILE__, __LINE__, "assert failed", (cond))
-
-#define CuAssertStrEquals(tc,ex,ac)           CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertStrEquals_Msg(tc,ms,ex,ac)    CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-#define CuAssertIntEquals(tc,ex,ac)           CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertIntEquals_Msg(tc,ms,ex,ac)    CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-#define CuAssertDblEquals(tc,ex,ac,dl)        CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac),(dl))
-#define CuAssertDblEquals_Msg(tc,ms,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac),(dl))
-#define CuAssertPtrEquals(tc,ex,ac)           CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
-#define CuAssertPtrEquals_Msg(tc,ms,ex,ac)    CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
-
-#define CuAssertPtrNotNull(tc,p)        CuAssert_Line((tc),__FILE__,__LINE__,"null pointer unexpected",(p != NULL))
-#define CuAssertPtrNotNullMsg(tc,msg,p) CuAssert_Line((tc),__FILE__,__LINE__,(msg),(p != NULL))
-
-/* CuSuite */
-
-#define MAX_TEST_CASES	1024
-
-#define SUITE_ADD_TEST(SUITE,TEST)	CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST))
-
-typedef struct
-{
-	int count;
-	CuTest* list[MAX_TEST_CASES];
-	int failCount;
-
-} CuSuite;
-
-
-void CuSuiteInit(CuSuite* testSuite);
-CuSuite* CuSuiteNew(void);
-void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase);
-void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2);
-void CuSuiteRun(CuSuite* testSuite);
-void CuSuiteSummary(CuSuite* testSuite, CuString* summary);
-void CuSuiteDetails(CuSuite* testSuite, CuString* details);
-
-#endif /* CU_TEST_H */
Index: trunk/include/kern_head.h
===================================================================
--- trunk/include/kern_head.h	(revision 1)
+++ trunk/include/kern_head.h	(revision 1)
@@ -0,0 +1,1382 @@
+
+
+/* i386 sys_call_table for kernel 2.4.x
+ */
+char * callz_2p4[] = {
+    "sys_ni_syscall",    /* 0 - old setup() system call*/
+    "sys_exit",
+    "sys_fork",
+    "sys_read",
+    "sys_write",
+    "sys_open",        /* 5 */
+    "sys_close",
+    "sys_waitpid",
+    "sys_creat",
+    "sys_link",
+    "sys_unlink",        /* 10 */
+    "sys_execve",
+    "sys_chdir",
+    "sys_time",
+    "sys_mknod",
+    "sys_chmod",        /* 15 */
+    "sys_lchown16",
+    "sys_ni_syscall",                /* old break syscall holder */
+    "sys_stat",
+    "sys_lseek",
+    "sys_getpid",        /* 20 */
+    "sys_mount",
+    "sys_oldumount",
+    "sys_setuid16",
+    "sys_getuid16",
+    "sys_stime",        /* 25 */
+    "sys_ptrace",
+    "sys_alarm",
+    "sys_fstat",
+    "sys_pause",
+    "sys_utime",        /* 30 */
+    "sys_ni_syscall",                /* old stty syscall holder */
+    "sys_ni_syscall",                /* old gtty syscall holder */
+    "sys_access",
+    "sys_nice",
+    "sys_ni_syscall",    /* 35 */        /* old ftime syscall holder */
+    "sys_sync",
+    "sys_kill",
+    "sys_rename",
+    "sys_mkdir",
+    "sys_rmdir",        /* 40 */
+    "sys_dup",
+    "sys_pipe",
+    "sys_times",
+    "sys_ni_syscall",                /* old prof syscall holder */
+    "sys_brk",        /* 45 */
+    "sys_setgid16",
+    "sys_getgid16",
+    "sys_signal",
+    "sys_geteuid16",
+    "sys_getegid16",    /* 50 */
+    "sys_acct",
+    "sys_umount",                    /* recycled never used  phys() */
+    "sys_ni_syscall",                /* old lock syscall holder */
+    "sys_ioctl",
+    "sys_fcntl",        /* 55 */
+    "sys_ni_syscall",                /* old mpx syscall holder */
+    "sys_setpgid",
+    "sys_ni_syscall",                /* old ulimit syscall holder */
+    "sys_olduname",
+    "sys_umask",        /* 60 */
+    "sys_chroot",
+    "sys_ustat",
+    "sys_dup2",
+    "sys_getppid",
+    "sys_getpgrp",        /* 65 */
+    "sys_setsid",
+    "sys_sigaction",
+    "sys_sgetmask",
+    "sys_ssetmask",
+    "sys_setreuid16",    /* 70 */
+    "sys_setregid16",
+    "sys_sigsuspend",
+    "sys_sigpending",
+    "sys_sethostname",
+    "sys_setrlimit",    /* 75 */
+    "sys_old_getrlimit",
+    "sys_getrusage",
+    "sys_gettimeofday",
+    "sys_settimeofday",
+    "sys_getgroups16",    /* 80 */
+    "sys_setgroups16",
+    "old_select",
+    "sys_symlink",
+    "sys_lstat",
+    "sys_readlink",        /* 85 */
+    "sys_uselib",
+    "sys_swapon",
+    "sys_reboot",
+    "old_readdir",
+    "old_mmap",        /* 90 */
+    "sys_munmap",
+    "sys_truncate",
+    "sys_ftruncate",
+    "sys_fchmod",
+    "sys_fchown16",        /* 95 */
+    "sys_getpriority",
+    "sys_setpriority",
+    "sys_ni_syscall",                /* old profil syscall holder */
+    "sys_statfs",
+    "sys_fstatfs",        /* 100 */
+    "sys_ioperm",
+    "sys_socketcall",
+    "sys_syslog",
+    "sys_setitimer",
+    "sys_getitimer",    /* 105 */
+    "sys_newstat",
+    "sys_newlstat",
+    "sys_newfstat",
+    "sys_uname",
+    "sys_iopl",        /* 110 */
+    "sys_vhangup",
+    "sys_ni_syscall",    /* old idle system call */
+    "sys_vm86old",
+    "sys_wait4",
+    "sys_swapoff",        /* 115 */
+    "sys_sysinfo",
+    "sys_ipc",
+    "sys_fsync",
+    "sys_sigreturn",
+    "sys_clone",        /* 120 */
+    "sys_setdomainname",
+    "sys_newuname",
+    "sys_modify_ldt",
+    "sys_adjtimex",
+    "sys_mprotect",        /* 125 */
+    "sys_sigprocmask",
+    "sys_create_module",
+    "sys_init_module",
+    "sys_delete_module",
+    "sys_get_kernel_syms",    /* 130 */
+    "sys_quotactl",
+    "sys_getpgid",
+    "sys_fchdir",
+    "sys_bdflush",
+    "sys_sysfs",        /* 135 */
+    "sys_personality",
+    "sys_ni_syscall",    /* for afs_syscall */
+    "sys_setfsuid16",
+    "sys_setfsgid16",
+    "sys_llseek",        /* 140 */
+    "sys_getdents",
+    "sys_select",
+    "sys_flock",
+    "sys_msync",
+    "sys_readv",        /* 145 */
+    "sys_writev",
+    "sys_getsid",
+    "sys_fdatasync",
+    "sys_sysctl",
+    "sys_mlock",        /* 150 */
+    "sys_munlock",
+    "sys_mlockall",
+    "sys_munlockall",
+    "sys_sched_setparam",
+    "sys_sched_getparam",  /* 155 */
+    "sys_sched_setscheduler",
+    "sys_sched_getscheduler",
+    "sys_sched_yield",
+    "sys_sched_get_priority_max",
+    "sys_sched_get_priority_min", /* 160 */
+    "sys_sched_rr_get_interval",
+    "sys_nanosleep",
+    "sys_mremap",
+    "sys_setresuid16",
+    "sys_getresuid16",    /* 165 */
+    "sys_vm86",
+    "sys_query_module",
+    "sys_poll",
+    "sys_nfsservctl",
+    "sys_setresgid16",    /* 170 */
+    "sys_getresgid16",
+    "sys_prctl",
+    "sys_rt_sigreturn",
+    "sys_rt_sigaction",
+    "sys_rt_sigprocmask",    /* 175 */
+    "sys_rt_sigpending",
+    "sys_rt_sigtimedwait",
+    "sys_rt_sigqueueinfo",
+    "sys_rt_sigsuspend",
+    "sys_pread",        /* 180 */
+    "sys_pwrite",
+    "sys_chown16",
+    "sys_getcwd",
+    "sys_capget",
+    "sys_capset",      /* 185 */
+    "sys_sigaltstack",
+    "sys_sendfile",
+    "sys_getpmsg",        /* streams1 */
+    "sys_putpmsg",        /* streams2 */
+    "sys_vfork",      /* 190 */
+    "sys_getrlimit",
+    "sys_mmap2",
+    "sys_truncate64",
+    "sys_ftruncate64",
+    "sys_stat64",        /* 195 */
+    "sys_lstat64",
+    "sys_fstat64",
+    "sys_lchown",
+    "sys_getuid",
+    "sys_getgid",        /* 200 */
+    "sys_geteuid",
+    "sys_getegid",
+    "sys_setreuid",
+    "sys_setregid",
+    "sys_getgroups",    /* 205 */
+    "sys_setgroups",
+    "sys_fchown",
+    "sys_setresuid",
+    "sys_getresuid",
+    "sys_setresgid",    /* 210 */
+    "sys_getresgid",
+    "sys_chown",
+    "sys_setuid",
+    "sys_setgid",
+    "sys_setfsuid",        /* 215 */
+    "sys_setfsgid",
+    "sys_pivot_root",
+    "sys_mincore",
+    "sys_madvise",
+    "sys_getdents64",    /* 220 */
+    "sys_fcntl64",
+    "sys_tux",     /* reserved for TUX */
+    "sys_security",
+    "sys_gettid",
+    "sys_readahead",     /* 225 */
+    "sys_setxattr",
+    "sys_lsetxattr",
+    "sys_fsetxattr",
+    "sys_getxattr",
+    "sys_lgetxattr",     /* 230 */
+    "sys_fgetxattr",
+    "sys_listxattr",
+    "sys_llistxattr",
+    "sys_flistxattr",
+    "sys_removexattr",   /* 235 */
+    "sys_lremovexattr",
+    "sys_fremovexattr",
+    "sys_tkill",
+    "sys_sendfile64",
+    "sys_futex",         /* 240 */
+    "sys_sched_setaffinity",
+    "sys_sched_getaffinity",
+    "sys_set_thread_area",
+    "sys_get_thread_area",   
+    "sys_io_setup",           /* 245 */
+    "sys_io_destroy",         
+    "sys_io_getevents",       
+    "sys_io_submit",          
+    "sys_io_cancel",          
+    "sys_alloc_hugepages",    /* 250 */
+    "sys_free_hugepages",     
+    "sys_exit_group",         
+    "sys_lookup_dcookie",     /* 2.6 */
+    "sys_epoll_create",
+    "sys_epoll_ctl",          /* 255 */
+    "sys_epoll_wait",
+    "sys_remap_file_pages",
+    "sys_set_tid_address",
+    "sys_timer_create",
+    "sys_timer_settime",      /* 260 */
+    "sys_timer_gettime",
+    "sys_timer_getoverrun",
+    "sys_timer_delete",
+    "sys_clock_settime",
+    "sys_clock_gettime",      /* 265 */
+    "sys_clock_getres",
+    "sys_clock_nanosleep",
+    "sys_statfs64",
+    "sys_fstatfs64",
+    "sys_tgkill",             /* 270 */
+    "sys_utimes",
+    "sys_fadvise64_64",
+    "sys_vserver",
+    NULL
+};
+
+
+
+/* i386 sys_call_table for kernel 2.2.x
+ */
+char * callz_2p2[]={
+  "sys_ni_syscall",        /* 0 */
+  "sys_exit",
+  "sys_fork",
+  "sys_read",
+  "sys_write",
+  "sys_open",              /* 5 */
+  "sys_close",
+  "sys_waitpid", 
+  "sys_creat",
+  "sys_link",
+  "sys_unlink",              /* 10 */
+  "sys_execve",
+  "sys_chdir",
+  "sys_time",
+  "sys_mknod",
+  "sys_chmod",              /* 15 */
+  "sys_lchown",
+  "sys_ni_syscall",
+  "sys_stat",
+  "sys_lseek",
+  "sys_getpid",              /* 20 */
+  "sys_mount",
+  "sys_oldumount", 
+  "sys_setuid",
+  "sys_getuid",
+  "sys_stime",              /* 25 */
+  "sys_ptrace",
+  "sys_alarm",
+  "sys_fstat",
+  "sys_pause",
+  "sys_utime",              /* 30 */
+  "sys_ni_syscall",
+  "sys_ni_syscall",
+  "sys_access",
+  "sys_nice",
+  "sys_ni_syscall",              /* 35 */
+  "sys_sync",
+  "sys_kill",
+  "sys_rename",
+  "sys_mkdir",
+  "sys_rmdir",              /* 40 */
+  "sys_dup",
+  "sys_pipe",
+  "sys_times",
+  "sys_ni_syscall",
+  "sys_brk",              /* 45 */
+  "sys_setgid",
+  "sys_getgid",
+  "sys_signal",
+  "sys_geteuid",
+  "sys_getegid",              /* 50 */
+  "sys_acct",
+  "sys_umount",
+  "sys_ni_syscall",
+  "sys_ioctl",
+  "sys_fcntl",              /* 55 */
+  "sys_ni_syscall",
+  "sys_setpgid",
+  "sys_ni_syscall",
+  "sys_olduname",
+  "sys_umask",              /* 60 */
+  "sys_chroot",
+  "sys_ustat",
+  "sys_dup2",
+  "sys_getppid",
+  "sys_getpgrp",              /* 65 */
+  "sys_setsid",
+  "sys_sigaction",
+  "sys_sgetmask",
+  "sys_ssetmask",
+  "sys_setreuid",              /* 70 */
+  "sys_setregid",
+  "sys_sigsuspend",
+  "sys_sigpending",
+  "sys_sethostname",
+  "sys_setrlimit",              /* 75 */
+  "sys_getrlimit",
+  "sys_getrusage",
+  "sys_gettimeofday",
+  "sys_settimeofday",
+  "sys_getgroups",              /* 80 */
+  "sys_setgroups",
+  "old_select",
+  "sys_symlink",
+  "sys_lstat",
+  "sys_readlink",              /* 85 */
+  "sys_uselib",
+  "sys_swapon",
+  "sys_reboot",
+  "old_readdir",
+  "old_mmap",              /* 90 */
+  "sys_munmap",
+  "sys_truncate",
+  "sys_ftruncate",
+  "sys_fchmod",
+  "sys_fchown",              /* 95 */
+  "sys_getpriority",
+  "sys_setpriority",
+  "sys_ni_syscall",
+  "sys_statfs",
+  "sys_fstatfs",              /* 100 */
+  "sys_ioperm",
+  "sys_socketcall",
+  "sys_syslog",
+  "sys_setitimer",
+  "sys_getitimer",              /* 105 */
+  "sys_newstat",
+  "sys_newlstat",
+  "sys_newfstat",
+  "sys_uname",
+  "sys_iopl",              /* 110 */
+  "sys_vhangup",
+  "sys_idle",
+  "sys_vm86old",
+  "sys_wait4",
+  "sys_swapoff",              /* 115 */
+  "sys_sysinfo",
+  "sys_ipc",
+  "sys_fsync",
+  "sys_sigreturn",
+  "sys_clone",              /* 120 */
+  "sys_setdomainname",
+  "sys_newuname",
+  "sys_modify_ldt",
+  "sys_adjtimex",
+  "sys_mprotect",              /* 125 */
+  "sys_sigprocmask",
+  "sys_create_module",
+  "sys_init_module",
+  "sys_delete_module",
+  "sys_get_kernel_syms", /* 130 */
+  "sys_quotactl",
+  "sys_getpgid",
+  "sys_fchdir",
+  "sys_bdflush",
+  "sys_sysfs",              /* 135 */
+  "sys_personality",
+  "sys_ni_syscall",
+  "sys_setfsuid",
+  "sys_setfsgid",
+  "sys_llseek",              /* 140 */
+  "sys_getdents",
+  "sys_select",
+  "sys_flock",
+  "sys_msync",
+  "sys_readv",              /* 145 */
+  "sys_writev",
+  "sys_getsid",
+  "sys_fdatasync",
+  "sys_sysctl",
+  "sys_mlock",              /* 150 */
+  "sys_munlock",
+  "sys_mlockall",
+  "sys_munlockall",
+  "sys_sched_setparam", 
+  "sys_sched_getparam",  /* 155 */
+  "sys_sched_setscheduler",
+  "sys_sched_getscheduler",
+  "sys_sched_yield",
+  "sys_sched_get_priority_max",
+  "sys_sched_get_priority_min", /* 160 */
+  "sys_sched_rr_get_interval",
+  "sys_nanosleep",
+  "sys_mremap",
+  "sys_setresuid",
+  "sys_getresuid",              /* 165 */
+  "sys_vm86",
+  "sys_query_module",
+  "sys_poll",
+  "sys_nfsservctl", 
+  "sys_setresgid",              /* 170 */
+  "sys_getresgid",
+  "sys_prctl",
+  "sys_rt_sigreturn",
+  "sys_rt_sigaction",
+  "sys_rt_sigprocmask", /* 175 */
+  "sys_rt_sigpending",
+  "sys_rt_sigtimedwait",
+  "sys_rt_sigqueueinfo",
+  "sys_rt_sigsuspend",
+  "sys_pread",              /* 180 */
+  "sys_pwrite",
+  "sys_chown",
+  "sys_getcwd",
+  "sys_capget",
+  "sys_capset",              /* 185 */
+  "sys_sigaltstack",
+  "sys_sendfile",
+  "sys_ni_syscall",
+  "sys_ni_syscall",
+  "sys_vfork",              /* 190 */
+  NULL
+};
+
+#if 0
+/* i386 sys_call_table for freebsd
+ */
+char * callz_fbsd[]={
+  "_sysent",          /*   0 */
+  "sys_exit",
+  "_fork",
+  "_read",
+  "_write",
+  "_open",            /*   5 */
+  "_close",
+  "_link",
+  "_unlink",
+  "_chdir",
+  "_fchdir",          /*  10 */
+  "_mknod",
+  "_chmod",
+  "_chown",
+  "_getpid",       
+  "_mount",           /*  15 */
+  "_unmount",
+  "_setuid",
+  "_getuid",
+  "_geteuid",
+  "_ioctl",           /*  20 */
+  "_fcntl",
+  "_setsockopt",
+  "_getsockopt",
+  "_getdirentries",
+  "_getdents",        /*  25 */
+  "_seteuid",
+  "_setegid",
+  "_modstat",
+  "_fstat",
+  "_modfind",         /*  30 */
+  "_getsid",
+  "_setsid",
+  "_kldload",
+  "_kldunload",
+  "_kldfind",         /*  35 */
+  "_kldnext",
+  "_kldstat",
+  "_kldfirstmod",
+  "_kldsym",
+  "___sysctl",	      /*  40 */
+  NULL
+};
+#endif
+
+
+/* i386 sys_call_table for freebsd
+ */
+char * callz_fbsd[]={
+  "_syscall",  /*	 0 */
+  "sys_exit",  /*	 1 */
+  "_fork",     /*	 2 */
+  "_read",     /*	 3 */
+  "_write",    /*	 4 */
+  "_open",     /*	 5 */
+  "_close",    /*	 6 */
+  "_wait4",    /*	 7 */
+  "_nosys",			/* 8 is old creat */
+  "_link",     /*	 9 */
+  "_unlink",   /*	10 */
+  "_nosys",			/* 11 is obsolete execv */
+  "_chdir",    /*	12 */
+  "_fchdir",   /*	13 */
+  "_mknod",    /*	14 */
+  "_chmod",    /*	15 */
+  "_chown",    /*	16 */
+  "_break",    /*	17 */
+  "_getfsstat",/*	18 */
+  "_nosys",	        	/* 19 is old lseek */
+  "_getpid",   /*	20 */
+  "_mount",    /*	21 */
+  "_unmount",  /*	22 */
+  "_setuid",   /*	23 */
+  "_getuid",   /*	24 */
+  "_geteuid",  /*	25 */
+  "_ptrace",   /*	26 */
+  "_recvmsg",  /*	27 */
+  "_sendmsg",  /*	28 */
+  "_recvfrom", /*	29 */
+  "_accept",   /*	30 */
+  "_getpeername", /*	31 */
+  "_getsockname", /*	32 */
+  "_access",   /*	33 */
+  "_chflags",  /*	34 */
+  "_fchflags", /*	35 */
+  "_sync",     /*	36 */
+  "_kill",     /*	37 */
+  "_nosys",			/* 38 is old stat */
+  "_getppid",  /*	39 */
+  "_nosys",		        /* 40 is old lstat */
+  "_dup",      /*	41 */
+  "_pipe",     /*	42 */
+  "_getegid",  /*	43 */
+  "_profil",   /*	44 */
+  "_ktrace",   /*	45 */
+  "_nosys",			/* 46 is old sigaction */
+  "_getgid",   /*	47 */
+  "_nosys",			/* 48 is old sigprocmask */
+  "_getlogin", /*	49 */
+  "_setlogin", /*	50 */
+  "_acct",     /*	51 */
+  "_nosys",			/* 52 is old sigpending */
+  "_sigaltstack", /*	53 */
+  "_ioctl",    /*	54 */
+  "_reboot",   /*	55 */
+  "_revoke",   /*	56 */
+  "_symlink",  /*	57 */
+  "_readlink", /*	58 */
+  "_execve",   /*	59 */
+  "_umask",    /*	60 */
+  "_chroot",   /*	61 */
+  "_nosys",			/* 62 is old fstat */
+  "_nosys",			/* 63 is old getkerninfo */
+  "_nosys",			/* 64 is old getpagesize */
+  "_msync",    /*	65 */
+  "_vfork",    /*	66 */
+  "_nosys",			/* 67 is obsolete vread */
+  "_nosys",			/* 68 is obsolete vwrite */
+  "_sbrk",     /*	69 */
+  "_sstk",     /*	70 */
+  "_nosys",			/* 71 is old mmap */
+  "_vadvise",  /*	72 */
+  "_munmap",   /*	73 */
+  "_mprotect", /*	74 */
+  "_madvise",  /*	75 */
+  "_nosys",			/* 76 is obsolete vhangup */
+  "_nosys",			/* 77 is obsolete vlimit */
+  "_mincore",  /*	78 */
+  "_getgroups",/*	79 */
+  "_setgroups",/*	80 */
+  "_getpgrp",  /*	81 */
+  "_setpgid",  /*	82 */
+  "_setitimer",/*	83 */
+  "_nosys",			/* 84 is old wait */
+  "_swapon",   /*	85 */
+  "_getitimer",/*	86 */
+  "_nosys",			/* 87 is old gethostname */
+  "_nosys",			/* 88 is old sethostname */
+  "_getdtablesize", /*	89 */
+  "_dup2",     /*	90 */
+  "_nosys",			/* 91 is ??? */
+  "_fcntl",    /*	92 */
+  "_select",   /*	93 */
+  "_nosys",			/* 94 is ??? */
+  "_fsync",    /*	95 */
+  "_setpriority", /*	96 */
+  "_socket",   /*	97 */
+  "_connect",  /*	98 */
+  "_nosys",			/* 99 is old accept */
+  "_getpriority", /*	100 */
+  "_nosys",			/* 101 is old send */
+  "_nosys",			/* 102 is old recv */
+  "_nosys",			/* 103 is old sigreturn */
+  "_bind",    /*	104 */
+  "_setsockopt", /*	105 */
+  "_listen",  /*	106 */
+  "_nosys",			/* 107 is obsolete vtimes */
+  "_nosys",			/* 108 is old sigvec */
+  "_nosys",			/* 109 is old sigblock */
+  "_nosys",			/* 110 is old sigsetmask */
+  "_nosys",			/* 111 is old sigsuspend */
+  "_nosys",			/* 112 is old sigstack */
+  "_nosys",			/* 113 is old recvmsg */
+  "_nosys",			/* 114 is old sendmsg */
+  "_nosys",			/* 115 is obsolete vtrace */
+  "_gettimeofday", /*	116 */ 
+  "_getrusage",    /*	117 */
+  "_getsockopt",   /*	118 */
+  "_nosys",			/* 119 is ??? */
+  "_readv",        /*	120 */
+  "_writev",       /*	121 */
+  "_settimeofday", /*	122 */
+  "_fchown",       /*	123 */
+  "_fchmod",       /*	124 */
+  "_nosys",			/* 125 is old recvfrom */
+  "_setreuid",     /*	126 */
+  "_setregid",     /*	127 */
+  "_rename",       /*	128 */
+  "_nosys",			/* 129 is old truncate */
+  "_nosys",			/* 130 is old ftruncate */
+  "_flock",        /*	131 */
+  "_mkfifo",       /*	132 */
+  "_sendto",       /*	133 */
+  "_shutdown",     /*	134 */
+  "_socketpair",   /*	135 */
+  "_mkdir",        /*	136 */
+  "_rmdir",        /*	137 */
+  "_utimes",       /*	138 */
+  "_nosys",			/* 139 is obsolete 4.2 sigreturn */
+  "_adjtime",      /*	140 */
+  "_nosys",			/* 141 is old getpeername */
+  "_nosys",			/* 142 is old gethostid */
+  "_nosys",			/* 143 is old sethostid */
+  "_nosys",			/* 144 is old getrlimit */
+  "_nosys",			/* 145 is old setrlimit */
+  "_nosys",			/* 146 is old killpg */
+  "_setsid",       /*	147 */
+  "_quotactl",     /*	148 */
+  "_nosys",			/* 149 is old quota */
+  "_nosys",			/* 150 is old getsockname */
+  "_nosys",			/* 151 is ??? */
+  "_nosys",			/* 152 is ??? */
+  "_nosys",			/* 153 is ??? */
+  "_nosys",			/* 154 is ??? */
+  "_nfssvc",       /*	155 */
+  "_nosys",		        /* 156 is old getdirentries */
+  "_statfs",       /*	157 */
+  "_fstatfs",      /*	158 */
+  "_nosys",			/* 159 is ??? */
+  "_nosys",			/* 160 is ??? */
+  "_getfh",        /*	161 */
+  "_getdomainname", /*	162 */
+  "_setdomainname", /*	163 */
+  "_uname",        /*	164 */
+  "_sysarch",      /*	165 */
+  "_rtprio",       /*	166 */
+  "_nosys",			/* 167 is ??? */
+  "_nosys",			/* 168 is ??? */
+  "_semsys",       /*	169 */
+  "_msgsys",       /*	170 */
+  "_shmsys",       /*	171 */
+  "_nosys",			/* 172 is ??? */
+  "_pread",        /*	173 */
+  "_pwrite",       /*	174 */
+  "_nosys",			/* 175 is ??? */
+  "_ntp_adjtime",  /*	176 */
+  "_nosys",			/* 177 is ??? */
+  "_nosys",			/* 178 is ??? */
+  "_nosys",			/* 179 is ??? */
+  "_nosys",			/* 180 is ??? */
+  "_setgid",       /*	181 */
+  "_setegid",      /*	182 */
+  "_seteuid",      /*	183 */
+  "_nosys",			/* 184 is ??? */
+  "_nosys",			/* 185 is ??? */
+  "_nosys",			/* 186 is ??? */
+  "_nosys",			/* 187 is ??? */
+  "_stat",         /*	188 */
+  "_fstat",        /*	189 */
+  "_lstat",        /*	190 */
+  "_pathconf",     /*	191 */
+  "_fpathconf",    /*	192 */
+  "_nosys",			/* 193 is ??? */
+  "_getrlimit",    /*	194 */
+  "_setrlimit",    /*	195 */
+  "_getdirentries", /*	196 */
+  "_mmap",         /*	197 */
+  "___syscall",    /*	198 */
+  "_lseek",        /*	199 */
+  "_truncate",     /*	200 */
+  "_ftruncate",    /*	201 */
+  "___sysctl",     /*	202 */
+  "_mlock",        /*	203 */
+  "_munlock",      /*	204 */
+  "_undelete",     /*	205 */
+  "_futimes",      /*	206 */
+  "_getpgid",      /*	207 */
+  "_nosys",			/* 208 is ??? */
+  "_poll",         /*	209 */
+  "_nosys",			/* 210 is ??? */
+  "_nosys",			/* 211 is ??? */
+  "_nosys",			/* 212 is ??? */
+  "_nosys",			/* 213 is ??? */
+  "_nosys",			/* 214 is ??? */
+  "_nosys",			/* 215 is ??? */
+  "_nosys",			/* 216 is ??? */
+  "_nosys",			/* 217 is ??? */
+  "_nosys",			/* 218 is ??? */
+  "_nosys",			/* 219 is ??? */
+  "___semctl",     /*	220 */
+  "_semget",       /*	221 */
+  "_semop",        /*	222 */
+  "_nosys",			/* 223 is ??? */
+  "_msgctl",       /*	224 */
+  "_msgget",       /*	225 */
+  "_msgsnd",       /*	226 */
+  "_msgrcv",       /*	227 */
+  "_shmat",        /*	228 */
+  "_shmctl",       /*	229 */
+  "_shmdt",        /*	230 */
+  "_shmget",       /*	231 */
+  "_clock_gettime", /*	232 */
+  "_clock_settime", /*	233 */
+  "_clock_getres", /*	234 */
+  "_nosys",			/* 235 is ??? */
+  "_nosys",			/* 236 is ??? */
+  "_nosys",			/* 237 is ??? */
+  "_nosys",			/* 238 is ??? */
+  "_nosys",			/* 239 is ??? */
+  "_nanosleep",    /*	240 */
+  "_nosys",			/* 241 is ??? */
+  "_nosys",			/* 242 is ??? */
+  "_nosys",			/* 243 is ??? */
+  "_nosys",			/* 244 is ??? */
+  "_nosys",			/* 245 is ??? */
+  "_nosys",			/* 246 is ??? */
+  "_nosys",			/* 247 is ??? */
+  "_nosys",			/* 248 is ??? */
+  "_nosys",			/* 249 is ??? */
+  "_minherit",     /*	250 */
+  "_rfork",        /*	251 */
+  "_openbsd_poll", /*	252 */
+  "_issetugid",    /*	253 */
+  "_lchown",       /*	254 */
+  "_nosys",			/* 255 is ??? */
+  "_nosys",			/* 256 is ??? */
+  "_nosys",			/* 257 is ??? */
+  "_nosys",			/* 258 is ??? */
+  "_nosys",			/* 259 is ??? */
+  "_nosys",			/* 260 is ??? */
+  "_nosys",			/* 261 is ??? */
+  "_nosys",			/* 262 is ??? */
+  "_nosys",			/* 263 is ??? */
+  "_nosys",			/* 264 is ??? */
+  "_nosys",			/* 265 is ??? */
+  "_nosys",			/* 266 is ??? */
+  "_nosys",			/* 267 is ??? */
+  "_nosys",			/* 268 is ??? */
+  "_nosys",			/* 269 is ??? */
+  "_nosys",			/* 270 is ??? */
+  "_nosys",			/* 271 is ??? */
+  "_getdents",     /*	272 */
+  "_nosys",			/* 273 is ??? */
+  "_lchmod",       /*	274 */
+  "_netbsd_lchown", /*	275 */
+  "_lutimes",      /*	276 */
+  "_netbsd_msync", /*	277 */
+  "_nstat",        /*	278 */
+  "_nfstat",       /*	279 */
+  "_nlstat",       /*	280 */
+  "_nosys",			/* 281 is ??? */
+  "_nosys",			/* 282 is ??? */
+  "_nosys",			/* 283 is ??? */
+  "_nosys",			/* 284 is ??? */
+  "_nosys",			/* 285 is ??? */
+  "_nosys",			/* 286 is ??? */
+  "_nosys",			/* 287 is ??? */
+  "_nosys",			/* 288 is ??? */
+  "_nosys",			/* 289 is ??? */
+  "_nosys",			/* 290 is ??? */
+  "_nosys",			/* 291 is ??? */
+  "_nosys",			/* 292 is ??? */
+  "_nosys",			/* 293 is ??? */
+  "_nosys",			/* 294 is ??? */
+  "_nosys",			/* 295 is ??? */
+  "_nosys",			/* 296 is ??? */
+  "_fhstatfs",     /*	297 */
+  "_fhopen",       /*	298 */
+  "_fhstat",       /*	299 */
+  "_modnext",      /*	300 */
+  "_modstat",      /*	301 */
+  "_modfnext",     /*	302 */
+  "_modfind",      /*	303 */
+  "_kldload",      /*	304 */
+  "_kldunload",    /*	305 */
+  "_kldfind",      /*	306 */
+  "_kldnext",      /*	307 */
+  "_kldstat",      /*	308 */
+  "_kldfirstmod",  /*	309 */
+  "_getsid",       /*	310 */
+  "_setresuid",    /*	311 */
+  "_setresgid",    /*	312 */
+  "_nosys",			/* 313 is obsolete signanosleep */
+  "_aio_return",   /*	314 */
+  "_aio_suspend",  /*	315 */
+  "_aio_cancel",   /*	316 */
+  "_aio_error",    /*	317 */
+  "_aio_read",     /*	318 */
+  "_aio_write",    /*	319 */
+  "_lio_listio",   /*	320 */
+  "_yield",        /*	321 */
+  "_thr_sleep",    /*	322 */
+  "_thr_wakeup",   /*	323 */
+  "_mlockall",     /*	324 */
+  "_munlockall",   /*	325 */
+  "___getcwd",     /*	326 */
+  "_sched_setparam", /*	327 */
+  "_sched_getparam", /*	328 */
+  "_sched_setscheduler", /*	329 */
+  "_sched_getscheduler", /*	330 */
+  "_sched_yield",  /*	331 */
+  "_sched_get_priority_max", /*	332 */
+  "_sched_get_priority_min", /*	333 */
+  "_sched_rr_get_interval", /*	334 */
+  "_utrace",       /*	335 */
+  "_sendfile",     /*	336 */
+  "_kldsym",       /*	337 */
+  "_jail",         /*	338 */
+  "_nosys",			/* 339 is ??? */
+  "_sigprocmask",  /*	340 */
+  "_sigsuspend",   /*	341 */
+  "_sigaction",    /*	342 */
+  "_sigpending",   /*	343 */
+  "_sigreturn",    /*	344 */
+  "_nosys",			/* 345 is ??? */
+  "_nosys",			/* 346 is ??? */
+  "___acl_get_file", /*	347 */
+  "___acl_set_file", /*	348 */
+  "___acl_get_fd", /*	349 */
+  "___acl_set_fd", /*	350 */
+  "___acl_delete_file", /*	351 */
+  "___acl_delete_fd",   /*	352 */
+  "___acl_aclcheck_file", /*	353 */
+  "___acl_aclcheck_fd", /*	354 */
+  "_extattrctl",   /*	355 */
+  "_extattr_set_file", /*	356 */
+  "_extattr_get_file", /*	357 */
+  "_extattr_delete_file", /*	358 */
+  "_aio_waitcomplete", /*	359 */
+  "_getresuid",    /*	360 */
+  "_getresgid",    /*	361 */
+  "_kqueue",       /*	362 */
+  "_kevent",       /*	363 */
+  "_nosys",			/* 364 is ??? */
+  "_nosys",			/* 365 is ??? */
+  "_nosys",			/* 366 is ??? */
+  "_nosys",			/* 367 is ??? */
+  "_nosys",			/* 368 is ??? */
+  "_nosys",			/* 369 is ??? */
+  "_nosys",			/* 370 is ??? */
+  "_nosys",			/* 371 is ??? */
+  "_nosys",			/* 372 is ??? */
+  "_nosys",			/* 373 is ??? */
+  "_nosys",			/* 374 is ??? */
+  "_nosys",			/* 375 is ??? */
+  "_nosys",			/* 376 is ??? */
+  "_nosys",			/* 377 is ??? */
+  "_nosys",			/* 378 is ??? */
+  "_nosys",			/* 379 is ??? */
+  "_nosys",			/* 380 is ??? */
+  "_nosys",			/* 381 is ??? */
+  "_nosys",			/* 382 is ??? */
+  "_nosys",			/* 383 is ??? */
+  "_nosys",			/* 384 is ??? */
+  "_nosys",			/* 385 is ??? */
+  "_nosys",			/* 386 is ??? */
+  "_nosys",			/* 387 is ??? */
+  "_nosys",			/* 388 is ??? */
+  "_nosys",			/* 389 is ??? */
+  "_nosys",			/* 390 is ??? */
+  "_nosys",			/* 391 is ??? */
+  "_nosys",			/* 392 is ??? */
+  "_sendfile",	/* 393 */
+  NULL
+};
+
+/* i386 sys_call_table for freebsd
+ */
+char * callz_fbsd5[]={
+  "_syscall",  /*	 0 */
+  "sys_exit",  /*	 1 */
+  "_fork",     /*	 2 */
+  "_read",     /*	 3 */
+  "_write",    /*	 4 */
+  "_open",     /*	 5 */
+  "_close",    /*	 6 */
+  "_wait4",    /*	 7 */
+  "_nosys",			/* 8 is old creat */
+  "_link",     /*	 9 */
+  "_unlink",   /*	10 */
+  "_nosys",			/* 11 is obsolete execv */
+  "_chdir",    /*	12 */
+  "_fchdir",   /*	13 */
+  "_mknod",    /*	14 */
+  "_chmod",    /*	15 */
+  "_chown",    /*	16 */
+  "_break",    /*	17 */
+  "_nosys",                     /* 18 is old getfsstat */
+  "_nosys",	        	/* 19 is old lseek */
+  "_getpid",   /*	20 */
+  "_mount",    /*	21 */
+  "_unmount",  /*	22 */
+  "_setuid",   /*	23 */
+  "_getuid",   /*	24 */
+  "_geteuid",  /*	25 */
+  "_ptrace",   /*	26 */
+  "_recvmsg",  /*	27 */
+  "_sendmsg",  /*	28 */
+  "_recvfrom", /*	29 */
+  "_accept",   /*	30 */
+  "_getpeername", /*	31 */
+  "_getsockname", /*	32 */
+  "_access",   /*	33 */
+  "_chflags",  /*	34 */
+  "_fchflags", /*	35 */
+  "_sync",     /*	36 */
+  "_kill",     /*	37 */
+  "_nosys",			/* 38 is old stat */
+  "_getppid",  /*	39 */
+  "_nosys",		        /* 40 is old lstat */
+  "_dup",      /*	41 */
+  "_pipe",     /*	42 */
+  "_getegid",  /*	43 */
+  "_profil",   /*	44 */
+  "_ktrace",   /*	45 */
+  "_nosys",			/* 46 is old sigaction */
+  "_getgid",   /*	47 */
+  "_nosys",			/* 48 is old sigprocmask */
+  "_getlogin", /*	49 */
+  "_setlogin", /*	50 */
+  "_acct",     /*	51 */
+  "_nosys",			/* 52 is old sigpending */
+  "_sigaltstack", /*	53 */
+  "_ioctl",    /*	54 */
+  "_reboot",   /*	55 */
+  "_revoke",   /*	56 */
+  "_symlink",  /*	57 */
+  "_readlink", /*	58 */
+  "_execve",   /*	59 */
+  "_umask",    /*	60 */
+  "_chroot",   /*	61 */
+  "_nosys",			/* 62 is old fstat */
+  "_nosys",			/* 63 is old getkerninfo */
+  "_nosys",			/* 64 is old getpagesize */
+  "_msync",    /*	65 */
+  "_vfork",    /*	66 */
+  "_nosys",			/* 67 is obsolete vread */
+  "_nosys",			/* 68 is obsolete vwrite */
+  "_sbrk",     /*	69 */
+  "_sstk",     /*	70 */
+  "_nosys",			/* 71 is old mmap */
+  "_vadvise",  /*	72 */
+  "_munmap",   /*	73 */
+  "_mprotect", /*	74 */
+  "_madvise",  /*	75 */
+  "_nosys",			/* 76 is obsolete vhangup */
+  "_nosys",			/* 77 is obsolete vlimit */
+  "_mincore",  /*	78 */
+  "_getgroups",/*	79 */
+  "_setgroups",/*	80 */
+  "_getpgrp",  /*	81 */
+  "_setpgid",  /*	82 */
+  "_setitimer",/*	83 */
+  "_nosys",			/* 84 is old wait */
+  "_swapon",   /*	85 */
+  "_getitimer",/*	86 */
+  "_nosys",			/* 87 is old gethostname */
+  "_nosys",			/* 88 is old sethostname */
+  "_getdtablesize", /*	89 */
+  "_dup2",     /*	90 */
+  "_nosys",			/* 91 is ??? */
+  "_fcntl",    /*	92 */
+  "_select",   /*	93 */
+  "_nosys",			/* 94 is ??? */
+  "_fsync",    /*	95 */
+  "_setpriority", /*	96 */
+  "_socket",   /*	97 */
+  "_connect",  /*	98 */
+  "_nosys",			/* 99 is old accept */
+  "_getpriority", /*	100 */
+  "_nosys",			/* 101 is old send */
+  "_nosys",			/* 102 is old recv */
+  "_nosys",			/* 103 is old sigreturn */
+  "_bind",    /*	104 */
+  "_setsockopt", /*	105 */
+  "_listen",  /*	106 */
+  "_nosys",			/* 107 is obsolete vtimes */
+  "_nosys",			/* 108 is old sigvec */
+  "_nosys",			/* 109 is old sigblock */
+  "_nosys",			/* 110 is old sigsetmask */
+  "_nosys",			/* 111 is old sigsuspend */
+  "_nosys",			/* 112 is old sigstack */
+  "_nosys",			/* 113 is old recvmsg */
+  "_nosys",			/* 114 is old sendmsg */
+  "_nosys",			/* 115 is obsolete vtrace */
+  "_gettimeofday", /*	116 */ 
+  "_getrusage",    /*	117 */
+  "_getsockopt",   /*	118 */
+  "_nosys",			/* 119 is ??? */
+  "_readv",        /*	120 */
+  "_writev",       /*	121 */
+  "_settimeofday", /*	122 */
+  "_fchown",       /*	123 */
+  "_fchmod",       /*	124 */
+  "_nosys",			/* 125 is old recvfrom */
+  "_setreuid",     /*	126 */
+  "_setregid",     /*	127 */
+  "_rename",       /*	128 */
+  "_nosys",			/* 129 is old truncate */
+  "_nosys",			/* 130 is old ftruncate */
+  "_flock",        /*	131 */
+  "_mkfifo",       /*	132 */
+  "_sendto",       /*	133 */
+  "_shutdown",     /*	134 */
+  "_socketpair",   /*	135 */
+  "_mkdir",        /*	136 */
+  "_rmdir",        /*	137 */
+  "_utimes",       /*	138 */
+  "_nosys",			/* 139 is obsolete 4.2 sigreturn */
+  "_adjtime",      /*	140 */
+  "_nosys",			/* 141 is old getpeername */
+  "_nosys",			/* 142 is old gethostid */
+  "_nosys",			/* 143 is old sethostid */
+  "_nosys",			/* 144 is old getrlimit */
+  "_nosys",			/* 145 is old setrlimit */
+  "_nosys",			/* 146 is old killpg */
+  "_setsid",       /*	147 */
+  "_quotactl",     /*	148 */
+  "_nosys",			/* 149 is old quota */
+  "_nosys",			/* 150 is old getsockname */
+  "_nosys",			/* 151 is ??? */
+  "_nosys",			/* 152 is ??? */
+  "_nosys",			/* 153 is ??? */
+  "_nosys",			/* 154 is ??? */
+  "_nfssvc",       /*	155 */
+  "_nosys",		        /* 156 is old getdirentries */
+  "_nosys",                     /* 157 is old statfs */
+  "_nosys",                     /* 158 is old fstatfs */
+  "_nosys",			/* 159 is ??? */
+  "_lgetfh",       /*   160 */
+  "_getfh",        /*	161 */
+  "_getdomainname", /*	162 */
+  "_setdomainname", /*	163 */
+  "_uname",        /*	164 */
+  "_sysarch",      /*	165 */
+  "_rtprio",       /*	166 */
+  "_nosys",			/* 167 is ??? */
+  "_nosys",			/* 168 is ??? */
+  "_semsys",       /*	169 */
+  "_msgsys",       /*	170 */
+  "_shmsys",       /*	171 */
+  "_nosys",			/* 172 is ??? */
+  "_pread",        /*	173 */
+  "_pwrite",       /*	174 */
+  "_nosys",			/* 175 is ??? */
+  "_ntp_adjtime",  /*	176 */
+  "_nosys",			/* 177 is ??? */
+  "_nosys",			/* 178 is ??? */
+  "_nosys",			/* 179 is ??? */
+  "_nosys",			/* 180 is ??? */
+  "_setgid",       /*	181 */
+  "_setegid",      /*	182 */
+  "_seteuid",      /*	183 */
+  "_nosys",			/* 184 is ??? */
+  "_nosys",			/* 185 is ??? */
+  "_nosys",			/* 186 is ??? */
+  "_nosys",			/* 187 is ??? */
+  "_stat",         /*	188 */
+  "_fstat",        /*	189 */
+  "_lstat",        /*	190 */
+  "_pathconf",     /*	191 */
+  "_fpathconf",    /*	192 */
+  "_nosys",			/* 193 is ??? */
+  "_getrlimit",    /*	194 */
+  "_setrlimit",    /*	195 */
+  "_getdirentries", /*	196 */
+  "_mmap",         /*	197 */
+  "___syscall",    /*	198 */
+  "_lseek",        /*	199 */
+  "_truncate",     /*	200 */
+  "_ftruncate",    /*	201 */
+  "___sysctl",     /*	202 */
+  "_mlock",        /*	203 */
+  "_munlock",      /*	204 */
+  "_undelete",     /*	205 */
+  "_futimes",      /*	206 */
+  "_getpgid",      /*	207 */
+  "_nosys",			/* 208 is ??? */
+  "_poll",         /*	209 */
+  "_nosys",			/* 210 is ??? */
+  "_nosys",			/* 211 is ??? */
+  "_nosys",			/* 212 is ??? */
+  "_nosys",			/* 213 is ??? */
+  "_nosys",			/* 214 is ??? */
+  "_nosys",			/* 215 is ??? */
+  "_nosys",			/* 216 is ??? */
+  "_nosys",			/* 217 is ??? */
+  "_nosys",			/* 218 is ??? */
+  "_nosys",			/* 219 is ??? */
+  "___semctl",     /*	220 */
+  "_semget",       /*	221 */
+  "_semop",        /*	222 */
+  "_nosys",			/* 223 is ??? */
+  "_msgctl",       /*	224 */
+  "_msgget",       /*	225 */
+  "_msgsnd",       /*	226 */
+  "_msgrcv",       /*	227 */
+  "_shmat",        /*	228 */
+  "_shmctl",       /*	229 */
+  "_shmdt",        /*	230 */
+  "_shmget",       /*	231 */
+  "_clock_gettime", /*	232 */
+  "_clock_settime", /*	233 */
+  "_clock_getres", /*	234 */
+  "_nosys",			/* 235 is ??? */
+  "_nosys",			/* 236 is ??? */
+  "_nosys",			/* 237 is ??? */
+  "_nosys",			/* 238 is ??? */
+  "_nosys",			/* 239 is ??? */
+  "_nanosleep",    /*	240 */
+  "_nosys",			/* 241 is ??? */
+  "_nosys",			/* 242 is ??? */
+  "_nosys",			/* 243 is ??? */
+  "_nosys",			/* 244 is ??? */
+  "_nosys",			/* 245 is ??? */
+  "_nosys",			/* 246 is ??? */
+  "_nosys",			/* 247 is ??? */
+  "_nosys",			/* 248 is ??? */
+  "_nosys",			/* 249 is ??? */
+  "_minherit",     /*	250 */
+  "_rfork",        /*	251 */
+  "_openbsd_poll", /*	252 */
+  "_issetugid",    /*	253 */
+  "_lchown",       /*	254 */
+  "_nosys",			/* 255 is ??? */
+  "_nosys",			/* 256 is ??? */
+  "_nosys",			/* 257 is ??? */
+  "_nosys",			/* 258 is ??? */
+  "_nosys",			/* 259 is ??? */
+  "_nosys",			/* 260 is ??? */
+  "_nosys",			/* 261 is ??? */
+  "_nosys",			/* 262 is ??? */
+  "_nosys",			/* 263 is ??? */
+  "_nosys",			/* 264 is ??? */
+  "_nosys",			/* 265 is ??? */
+  "_nosys",			/* 266 is ??? */
+  "_nosys",			/* 267 is ??? */
+  "_nosys",			/* 268 is ??? */
+  "_nosys",			/* 269 is ??? */
+  "_nosys",			/* 270 is ??? */
+  "_nosys",			/* 271 is ??? */
+  "_getdents",     /*	272 */
+  "_nosys",			/* 273 is ??? */
+  "_lchmod",       /*	274 */
+  "_netbsd_lchown", /*	275 */
+  "_lutimes",      /*	276 */
+  "_netbsd_msync", /*	277 */
+  "_nstat",        /*	278 */
+  "_nfstat",       /*	279 */
+  "_nlstat",       /*	280 */
+  "_nosys",			/* 281 is ??? */
+  "_nosys",			/* 282 is ??? */
+  "_nosys",			/* 283 is ??? */
+  "_nosys",			/* 284 is ??? */
+  "_nosys",			/* 285 is ??? */
+  "_nosys",			/* 286 is ??? */
+  "_nosys",			/* 287 is ??? */
+  "_nosys",			/* 288 is ??? */
+  "_nosys",			/* 289 is ??? */
+  "_nosys",			/* 290 is ??? */
+  "_nosys",			/* 291 is ??? */
+  "_nosys",			/* 292 is ??? */
+  "_nosys",			/* 293 is ??? */
+  "_nosys",			/* 294 is ??? */
+  "_nosys",			/* 295 is ??? */
+  "_nosys",			/* 296 is ??? */
+  "_nosys",                     /* 297 is old fhstatfs */
+  "_fhopen",       /*	298 */
+  "_fhstat",       /*	299 */
+  "_modnext",      /*	300 */
+  "_modstat",      /*	301 */
+  "_modfnext",     /*	302 */
+  "_modfind",      /*	303 */
+  "_kldload",      /*	304 */
+  "_kldunload",    /*	305 */
+  "_kldfind",      /*	306 */
+  "_kldnext",      /*	307 */
+  "_kldstat",      /*	308 */
+  "_kldfirstmod",  /*	309 */
+  "_getsid",       /*	310 */
+  "_setresuid",    /*	311 */
+  "_setresgid",    /*	312 */
+  "_nosys",			/* 313 is obsolete signanosleep */
+  "_aio_return",   /*	314 */
+  "_aio_suspend",  /*	315 */
+  "_aio_cancel",   /*	316 */
+  "_aio_error",    /*	317 */
+  "_aio_read",     /*	318 */
+  "_aio_write",    /*	319 */
+  "_lio_listio",   /*	320 */
+  "_yield",        /*	321 */
+  "_thr_sleep",    /*	322 */
+  "_thr_wakeup",   /*	323 */
+  "_mlockall",     /*	324 */
+  "_munlockall",   /*	325 */
+  "___getcwd",     /*	326 */
+  "_sched_setparam", /*	327 */
+  "_sched_getparam", /*	328 */
+  "_sched_setscheduler", /*	329 */
+  "_sched_getscheduler", /*	330 */
+  "_sched_yield",  /*	331 */
+  "_sched_get_priority_max", /*	332 */
+  "_sched_get_priority_min", /*	333 */
+  "_sched_rr_get_interval", /*	334 */
+  "_utrace",       /*	335 */
+  "_nosys",                  /* 336 is old sendfile */
+  "_kldsym",       /*	337 */
+  "_jail",         /*	338 */
+  "_nosys",			/* 339 is ??? */
+  "_sigprocmask",  /*	340 */
+  "_sigsuspend",   /*	341 */
+  "_nosys",                     /* 342 is old sigaction */
+  "_sigpending",   /*	343 */
+  "_nosys",                     /* 344 is old sigreturn */
+  "_sigtimedwait", /*   345 */
+  "_sigwaitinfo",  /*   346 */
+  "___acl_get_file", /*	347 */
+  "___acl_set_file", /*	348 */
+  "___acl_get_fd", /*	349 */
+  "___acl_set_fd", /*	350 */
+  "___acl_delete_file", /*	351 */
+  "___acl_delete_fd",   /*	352 */
+  "___acl_aclcheck_file", /*	353 */
+  "___acl_aclcheck_fd", /*	354 */
+  "_extattrctl",   /*	355 */
+  "_extattr_set_file", /*	356 */
+  "_extattr_get_file", /*	357 */
+  "_extattr_delete_file", /*	358 */
+  "_aio_waitcomplete", /*	359 */
+  "_getresuid",    /*	360 */
+  "_getresgid",    /*	361 */
+  "_kqueue",       /*	362 */
+  "_kevent",       /*	363 */
+  "_nosys",			/* 364 is ??? */
+  "_nosys",			/* 365 is ??? */
+  "_nosys",			/* 366 is ??? */
+  "_nosys",			/* 367 is ??? */
+  "_nosys",			/* 368 is ??? */
+  "_nosys",			/* 369 is ??? */
+  "_nosys",			/* 370 is ??? */
+  "_extattr_set_fd",            /* 371 */
+  "_extattr_get_fd",            /* 372 */
+  "_extattr_delete_fd",         /* 373 */
+  "___setugid",                 /* 374 */
+  "_nfsclnt",                   /* 375 */
+  "_eaccess",                   /* 376 */
+  "_nosys",			/* 377 is ??? */
+  "_nmount",                    /* 378 */
+  "_kse_exit",                  /* 379 */
+  "_kse_wakeup",                /* 380 */
+  "_kse_create",                /* 381 */
+  "_kse_thr_interrupt",         /* 382 */
+  "_kse_release",               /* 383 */
+  "___mac_get_proc",            /* 384 */
+  "___mac_set_proc",            /* 385 */
+  "___mac_get_fd",              /* 386 */
+  "___mac_get_file",            /* 387 */
+  "___mac_set_fd",              /* 388 */
+  "___mac_set_file",            /* 389 */
+  "_kenv",			/* 390 */
+  "_lchflags",                  /* 391 */
+  "_uuidgen",                   /* 392 */
+  "_sendfile",	  /* 393 */
+  "_mac_syscall",	  /* 394 */
+  "_getfsstat",	  /* 395 */
+  "_statfs",	  /* 396 */
+  "_fstatfs",	  /* 397 */
+  "_fhstatfs",	  /* 398 */
+  "_nosys",	  /* 399 */
+  "_ksem_close",  /* 400 */
+  "_ksem_post",	  /* 401 */
+  "_ksem_wait",	  /* 402 */
+  "_ksem_trywait",	  /* 403 */
+  "_ksem_init",	  /* 404 */
+  "_ksem_open",	  /* 405 */
+  "_ksem_unlink",	  /* 406 */
+  "_ksem_getvalue",	  /* 407 */
+  "_ksem_destroy",	  /* 408 */
+  "___mac_get_pid",	  /* 409 */
+  "___mac_get_link",	  /* 410 */
+  "___mac_set_link",	  /* 411 */
+  "_extattr_set_link",	  /* 412 */
+  "_extattr_get_link",	  /* 413 */
+  "_extattr_delete_link",	  /* 414 */
+  "___mac_execve",	  /* 415 */
+  "_sigaction",	  /* 416 */
+  "_sigreturn",	  /* 417 */
+  "_nosys",	  /* 418 */
+  "_nosys",	  /* 419 */
+  "_nosys",	  /* 420 */
+  "_getcontext",	  /* 421 */
+  "_setcontext",	  /* 422 */
+  "_swapcontext",	  /* 423 */
+  "_swapoff",	  /* 424 */
+  "___acl_get_link",	  /* 425 */
+  "___acl_set_link",	  /* 426 */
+  "___acl_delete_link",	  /* 427 */
+  "___acl_aclcheck_link",	  /* 428 */
+  "_sigwait",	  /* 429 */
+  "_thr_create",	  /* 430 */
+  "_thr_exit",	  /* 431 */
+  "_thr_self",	  /* 432 */
+  "_thr_kill",	  /* 433 */
+  "__umtx_lock",	  /* 434 */
+  "__umtx_unlock",	  /* 435 */
+  "_jail_attach",	  /* 436 */
+  "_extattr_list_fd",	  /* 437 */
+  "_extattr_list_file",	  /* 438 */
+  "_extattr_list_link",	  /* 439 */
+  "_kse_switchin",        /* 440 */
+  "_ksem_timedwait",      /* 441 */
+  "_thr_suspend",         /* 442 */
+  "_thr_wake",            /* 443 */
+  "_kldunloadf",          /* 444 */
+  NULL
+};
+
Index: trunk/include/rijndael-alg-fst.h
===================================================================
--- trunk/include/rijndael-alg-fst.h	(revision 591)
+++ trunk/include/rijndael-alg-fst.h	(revision 1)
@@ -1,44 +1,41 @@
-/*	$NetBSD: rijndael-alg-fst.h,v 1.4 2005/12/11 12:20:52 christos Exp $	*/
-/*	$KAME: rijndael-alg-fst.h,v 1.5 2003/07/15 10:47:16 itojun Exp $	*/
-/**
- * rijndael-alg-fst.h
+/*
+ * rijndael-alg-fst.h   v2.3   April '2000
  *
- * @version 3.0 (December 2000)
+ * Optimised ANSI C code
  *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
- *
- * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto@terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''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 AUTHORS OR CONTRIBUTORS 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.
  */
+
+/*@-fixedformalarray@*/
+
 #ifndef __RIJNDAEL_ALG_FST_H
 #define __RIJNDAEL_ALG_FST_H
 
-#define RIJNDAEL_MAXKC	(256/32)
-#define RIJNDAEL_MAXKB	(256/8)
-#define RIJNDAEL_MAXNR	14
+#define MAXKC			(256/32)
+#define MAXROUNDS		14
+
+/* USUAL_TYPES */
+#ifndef USUAL_TYPES
+#define USUAL_TYPES
+typedef unsigned char	byte;
+typedef unsigned char	word8;	
+typedef unsigned short	word16;	
+typedef unsigned int	word32;
+#endif 
 
 #ifdef SH_ENCRYPT
 
-int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
-int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
-void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]);
-void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]);
+int rijndaelKeySched(word8 k[MAXKC][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
+
+int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS);
+
+int rijndaelEncrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
+
+
+int rijndaelDecrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
 
 /* SH_ENCRYPT */
 #endif
-#endif /* __RIJNDAEL_ALG_FST_H */
+
+/* __RIJNDAEL_ALG_FST_H */
+#endif 
+
Index: trunk/include/rijndael-api-fst.h
===================================================================
--- trunk/include/rijndael-api-fst.h	(revision 591)
+++ trunk/include/rijndael-api-fst.h	(revision 1)
@@ -1,39 +1,7 @@
-/*	$NetBSD: rijndael-api-fst.h,v 1.8 2007/01/21 23:00:08 cbiere Exp $	*/
-
-/**
- * rijndael-api-fst.h
+/*
+ * rijndael-api-fst.h   v2.3   April '2000
  *
- * @version 2.9 (December 2000)
+ * Optimised ANSI C code
  *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
- *
- * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto@terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''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 AUTHORS OR CONTRIBUTORS 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.
- *
- * Acknowledgements:
- *
- * We are deeply indebted to the following people for their bug reports,
- * fixes, and improvement suggestions to this implementation. Though we
- * tried to list all contributions, we apologise in advance for any
- * missing reference.
- *
- * Andrew Bales <Andrew.Bales@Honeywell.com>
- * Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
- * John Skodon <skodonj@webquill.com>
  */
 
@@ -41,30 +9,15 @@
 #define __RIJNDAEL_API_FST_H
 
-/* Blocksize: 16 * 8 = 128; 128 * 1 = 128 */
-#define     B_SIZ    16
-#define     BNUM      1
+#include "rijndael-alg-fst.h"
+
+/*  Defines:
+    Add any additional defines you need
+*/
+
+#define     BNUM                  1
+#define     B_SIZ                 16
+#define     STRICT_ALIGN          1 /*  For safety          */
 
 
-#if defined(UINT32)
-typedef unsigned char u8;
-typedef UINT32 u32;
-#else
-
-typedef unsigned char u8;
-#if defined(HAVE_INT_32)
-typedef unsigned int u32;
-#elif defined(HAVE_LONG_32)
-typedef unsigned long u32;
-#elif defined(HAVE_SHORT_32)
-typedef unsigned short u32;
-#else
-#error "No 32 bit integer type found"
-#endif
-
-#endif
-
-#include "rijndael-alg-fst.h"
-
-/*  Generic Defines  */
 #define     DIR_ENCRYPT           0 /*  Are we encrpyting?  */
 #define     DIR_DECRYPT           1 /*  Are we decrpyting?  */
@@ -72,13 +25,10 @@
 #define     MODE_CBC              2 /*  Are we ciphering in CBC mode?   */
 #define     MODE_CFB1             3 /*  Are we ciphering in 1-bit CFB mode? */
-#ifndef     TRUE
 #define     TRUE                  1
-#endif
-#ifndef     FALSE
 #define     FALSE                 0
-#endif
 #define     BITSPERBLOCK        128 /* Default number of bits in a cipher block */
 
-/*  Error Codes  */
+/*  Error Codes - CHANGE POSSIBLE: inclusion of additional error codes  */
+
 #define     BAD_KEY_DIR          -1 /*  Key direction is invalid, e.g., unknown value */
 #define     BAD_KEY_MAT          -2 /*  Key material not of correct length */
@@ -91,46 +41,59 @@
 #define     BAD_OTHER            -9 /*  Unknown error */
 
-/*  Algorithm-specific Defines  */
-#define     RIJNDAEL_MAX_KEY_SIZE         64 /* # of ASCII char's needed to represent a key */
-#define     RIJNDAEL_MAX_IV_SIZE          16 /* # bytes needed to represent an IV  */
+/*  CHANGE POSSIBLE:  inclusion of algorithm specific defines  */
+#define     MAX_KEY_SIZE         64 /* # of ASCII char's needed to represent a key */
+#define     MAX_IV_SIZE          16 /* # bytes needed to represent an IV  */
 
 #ifdef SH_ENCRYPT
 
-/*  Typedefs  */
+/*  Typedefs:
 
-typedef unsigned char   BYTE;
+	Typedef'ed data storage elements.  Add any algorithm specific 
+parameters at the bottom of the structs as appropriate.
+*/
+
+typedef unsigned char   RIJ_BYTE;
 
 /*  The structure for key information */
 typedef struct {
-  u32   rk[4*(RIJNDAEL_MAXNR + 1)];        /* key schedule */
-  u32   ek[4*(RIJNDAEL_MAXNR + 1)];        /* CFB1 key schedule (encryption only) */
-  BYTE  direction;                /* Key used for encrypting or decrypting? */
-  int   keyLen;                   /* Length of the key  */
-  char  keyMaterial[RIJNDAEL_MAX_KEY_SIZE+1];  /* Raw key data in ASCII, e.g., user input or KAT values */
-  int   Nr;                       /* key-length-dependent number of rounds */
+    RIJ_BYTE  direction;                /* Key used for encrypting or decrypting? */
+    int   keyLen;                   /* Length of the key  */
+    char  keyMaterial[MAX_KEY_SIZE+1];  /* Raw key data in ASCII, e.g., user input or KAT values */
+        /*  The following parameters are algorithm dependent, replace or add as necessary  */
+	int   ROUNDS;                   /* key-length-dependent number of rounds */
+    int   blockLen;                 /* block length */
+    word8 keySched[MAXROUNDS+1][4][4];	/* key schedule		*/
 } keyInstance;
 
 /*  The structure for cipher information */
 typedef struct {                    /* changed order of the components */
-    u32  IV[RIJNDAEL_MAX_IV_SIZE / sizeof(u32)];
-			/* A possible Initialization Vector for ciphering */
-    BYTE  mode;                     /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
+    RIJ_BYTE  mode;                     /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
+    RIJ_BYTE  IV[MAX_IV_SIZE];          /* A possible Initialization Vector for ciphering */
+        /*  Add any algorithm specific parameters needed here  */
+    int   blockLen;                 /* Sample: Handles non-128 bit block sizes (if available) */
 } cipherInstance;
 
 /*  Function prototypes  */
+/*  CHANGED: nothing
+	TODO: implement the following extensions to setup 192-bit and 256-bit block lengths:
+        makeKeyEx():    parameter blockLen added
+                        -- this parameter is absolutely necessary if you want to
+                        setup the round keys in a variable block length setting 
+	    cipherInitEx(): parameter blockLen added (for obvious reasons)		
+ */
 
-int rijndael_makeKey(keyInstance *, BYTE, int, const char *);
+int makeKey(keyInstance *key, RIJ_BYTE direction, int keyLen, char *keyMaterial);
 
-int rijndael_cipherInit(cipherInstance *, BYTE, const char *);
+int cipherInit(cipherInstance *cipher, RIJ_BYTE mode, char *IV);
 
-int rijndael_blockEncrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
+int blockEncrypt(cipherInstance *cipher, keyInstance *key,
+		 RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer);
 
-int rijndael_padEncrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
-
-int rijndael_blockDecrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
-
-int rijndael_padDecrypt(cipherInstance *, keyInstance *, const BYTE *, int, BYTE *);
+int blockDecrypt(cipherInstance *cipher, keyInstance *key,
+		 RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer);
 
 /* SH_ENCRYPT */
 #endif
-#endif /* __RIJNDAEL_API_FST_H */
+
+/*  __RIJNDAEL_API_FST_H */
+#endif 
Index: trunk/include/rijndael-boxes-fst.h
===================================================================
--- trunk/include/rijndael-boxes-fst.h	(revision 1)
+++ trunk/include/rijndael-boxes-fst.h	(revision 1)
@@ -0,0 +1,914 @@
+word8 S[256] = {
+ 99, 124, 119, 123, 242, 107, 111, 197,  48,   1, 103,  43, 254, 215, 171, 118, 
+202, 130, 201, 125, 250,  89,  71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 
+183, 253, 147,  38,  54,  63, 247, 204,  52, 165, 229, 241, 113, 216,  49,  21, 
+  4, 199,  35, 195,  24, 150,   5, 154,   7,  18, 128, 226, 235,  39, 178, 117, 
+  9, 131,  44,  26,  27, 110,  90, 160,  82,  59, 214, 179,  41, 227,  47, 132, 
+ 83, 209,   0, 237,  32, 252, 177,  91, 106, 203, 190,  57,  74,  76,  88, 207, 
+208, 239, 170, 251,  67,  77,  51, 133,  69, 249,   2, 127,  80,  60, 159, 168, 
+ 81, 163,  64, 143, 146, 157,  56, 245, 188, 182, 218,  33,  16, 255, 243, 210, 
+205,  12,  19, 236,  95, 151,  68,  23, 196, 167, 126,  61, 100,  93,  25, 115, 
+ 96, 129,  79, 220,  34,  42, 144, 136,  70, 238, 184,  20, 222,  94,  11, 219, 
+224,  50,  58,  10,  73,   6,  36,  92, 194, 211, 172,  98, 145, 149, 228, 121, 
+231, 200,  55, 109, 141, 213,  78, 169, 108,  86, 244, 234, 101, 122, 174,   8, 
+186, 120,  37,  46,  28, 166, 180, 198, 232, 221, 116,  31,  75, 189, 139, 138, 
+112,  62, 181, 102,  72,   3, 246,  14,  97,  53,  87, 185, 134, 193,  29, 158, 
+225, 248, 152,  17, 105, 217, 142, 148, 155,  30, 135, 233, 206,  85,  40, 223, 
+140, 161, 137,  13, 191, 230,  66, 104,  65, 153,  45,  15, 176,  84, 187,  22
+};
+
+#ifdef INTERMEDIATE_VALUE_KAT
+word8 Si[256] = {
+ 82,   9, 106, 213,  48,  54, 165,  56, 191,  64, 163, 158, 129, 243, 215, 251, 
+124, 227,  57, 130, 155,  47, 255, 135,  52, 142,  67,  68, 196, 222, 233, 203, 
+ 84, 123, 148,  50, 166, 194,  35,  61, 238,  76, 149,  11,  66, 250, 195,  78, 
+  8,  46, 161, 102,  40, 217,  36, 178, 118,  91, 162,  73, 109, 139, 209,  37, 
+114, 248, 246, 100, 134, 104, 152,  22, 212, 164,  92, 204,  93, 101, 182, 146, 
+108, 112,  72,  80, 253, 237, 185, 218,  94,  21,  70,  87, 167, 141, 157, 132, 
+144, 216, 171,   0, 140, 188, 211,  10, 247, 228,  88,   5, 184, 179,  69,   6, 
+208,  44,  30, 143, 202,  63,  15,   2, 193, 175, 189,   3,   1,  19, 138, 107, 
+ 58, 145,  17,  65,  79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 
+150, 172, 116,  34, 231, 173,  53, 133, 226, 249,  55, 232,  28, 117, 223, 110, 
+ 71, 241,  26, 113,  29,  41, 197, 137, 111, 183,  98,  14, 170,  24, 190,  27, 
+252,  86,  62,  75, 198, 210, 121,  32, 154, 219, 192, 254, 120, 205,  90, 244, 
+ 31, 221, 168,  51, 136,   7, 199,  49, 177,  18,  16,  89,  39, 128, 236,  95, 
+ 96,  81, 127, 169,  25, 181,  74,  13,  45, 229, 122, 159, 147, 201, 156, 239, 
+160, 224,  59,  77, 174,  42, 245, 176, 200, 235, 187,  60, 131,  83, 153,  97, 
+ 23,  43,   4, 126, 186, 119, 214,  38, 225, 105,  20,  99,  85,  33,  12, 125
+};
+#endif /* INTERMEDIATE_VALUE_KAT */
+
+word8 T1[256][4] = {
+{ 0xc6,0x63,0x63,0xa5},{  0xf8,0x7c,0x7c,0x84},{  0xee,0x77,0x77,0x99},{  0xf6,0x7b,0x7b,0x8d}, 
+{ 0xff,0xf2,0xf2,0x0d},{  0xd6,0x6b,0x6b,0xbd},{  0xde,0x6f,0x6f,0xb1},{  0x91,0xc5,0xc5,0x54}, 
+{ 0x60,0x30,0x30,0x50},{  0x02,0x01,0x01,0x03},{  0xce,0x67,0x67,0xa9},{  0x56,0x2b,0x2b,0x7d}, 
+{ 0xe7,0xfe,0xfe,0x19},{  0xb5,0xd7,0xd7,0x62},{  0x4d,0xab,0xab,0xe6},{  0xec,0x76,0x76,0x9a}, 
+{ 0x8f,0xca,0xca,0x45},{  0x1f,0x82,0x82,0x9d},{  0x89,0xc9,0xc9,0x40},{  0xfa,0x7d,0x7d,0x87}, 
+{ 0xef,0xfa,0xfa,0x15},{  0xb2,0x59,0x59,0xeb},{  0x8e,0x47,0x47,0xc9},{  0xfb,0xf0,0xf0,0x0b}, 
+{ 0x41,0xad,0xad,0xec},{  0xb3,0xd4,0xd4,0x67},{  0x5f,0xa2,0xa2,0xfd},{  0x45,0xaf,0xaf,0xea}, 
+{ 0x23,0x9c,0x9c,0xbf},{  0x53,0xa4,0xa4,0xf7},{  0xe4,0x72,0x72,0x96},{  0x9b,0xc0,0xc0,0x5b}, 
+{ 0x75,0xb7,0xb7,0xc2},{  0xe1,0xfd,0xfd,0x1c},{  0x3d,0x93,0x93,0xae},{  0x4c,0x26,0x26,0x6a}, 
+{ 0x6c,0x36,0x36,0x5a},{  0x7e,0x3f,0x3f,0x41},{  0xf5,0xf7,0xf7,0x02},{  0x83,0xcc,0xcc,0x4f}, 
+{ 0x68,0x34,0x34,0x5c},{  0x51,0xa5,0xa5,0xf4},{  0xd1,0xe5,0xe5,0x34},{  0xf9,0xf1,0xf1,0x08}, 
+{ 0xe2,0x71,0x71,0x93},{  0xab,0xd8,0xd8,0x73},{  0x62,0x31,0x31,0x53},{  0x2a,0x15,0x15,0x3f}, 
+{ 0x08,0x04,0x04,0x0c},{  0x95,0xc7,0xc7,0x52},{  0x46,0x23,0x23,0x65},{  0x9d,0xc3,0xc3,0x5e}, 
+{ 0x30,0x18,0x18,0x28},{  0x37,0x96,0x96,0xa1},{  0x0a,0x05,0x05,0x0f},{  0x2f,0x9a,0x9a,0xb5}, 
+{ 0x0e,0x07,0x07,0x09},{  0x24,0x12,0x12,0x36},{  0x1b,0x80,0x80,0x9b},{  0xdf,0xe2,0xe2,0x3d}, 
+{ 0xcd,0xeb,0xeb,0x26},{  0x4e,0x27,0x27,0x69},{  0x7f,0xb2,0xb2,0xcd},{  0xea,0x75,0x75,0x9f}, 
+{ 0x12,0x09,0x09,0x1b},{  0x1d,0x83,0x83,0x9e},{  0x58,0x2c,0x2c,0x74},{  0x34,0x1a,0x1a,0x2e}, 
+{ 0x36,0x1b,0x1b,0x2d},{  0xdc,0x6e,0x6e,0xb2},{  0xb4,0x5a,0x5a,0xee},{  0x5b,0xa0,0xa0,0xfb}, 
+{ 0xa4,0x52,0x52,0xf6},{  0x76,0x3b,0x3b,0x4d},{  0xb7,0xd6,0xd6,0x61},{  0x7d,0xb3,0xb3,0xce}, 
+{ 0x52,0x29,0x29,0x7b},{  0xdd,0xe3,0xe3,0x3e},{  0x5e,0x2f,0x2f,0x71},{  0x13,0x84,0x84,0x97}, 
+{ 0xa6,0x53,0x53,0xf5},{  0xb9,0xd1,0xd1,0x68},{  0x00,0x00,0x00,0x00},{  0xc1,0xed,0xed,0x2c}, 
+{ 0x40,0x20,0x20,0x60},{  0xe3,0xfc,0xfc,0x1f},{  0x79,0xb1,0xb1,0xc8},{  0xb6,0x5b,0x5b,0xed}, 
+{ 0xd4,0x6a,0x6a,0xbe},{  0x8d,0xcb,0xcb,0x46},{  0x67,0xbe,0xbe,0xd9},{  0x72,0x39,0x39,0x4b}, 
+{ 0x94,0x4a,0x4a,0xde},{  0x98,0x4c,0x4c,0xd4},{  0xb0,0x58,0x58,0xe8},{  0x85,0xcf,0xcf,0x4a}, 
+{ 0xbb,0xd0,0xd0,0x6b},{  0xc5,0xef,0xef,0x2a},{  0x4f,0xaa,0xaa,0xe5},{  0xed,0xfb,0xfb,0x16}, 
+{ 0x86,0x43,0x43,0xc5},{  0x9a,0x4d,0x4d,0xd7},{  0x66,0x33,0x33,0x55},{  0x11,0x85,0x85,0x94}, 
+{ 0x8a,0x45,0x45,0xcf},{  0xe9,0xf9,0xf9,0x10},{  0x04,0x02,0x02,0x06},{  0xfe,0x7f,0x7f,0x81}, 
+{ 0xa0,0x50,0x50,0xf0},{  0x78,0x3c,0x3c,0x44},{  0x25,0x9f,0x9f,0xba},{  0x4b,0xa8,0xa8,0xe3}, 
+{ 0xa2,0x51,0x51,0xf3},{  0x5d,0xa3,0xa3,0xfe},{  0x80,0x40,0x40,0xc0},{  0x05,0x8f,0x8f,0x8a}, 
+{ 0x3f,0x92,0x92,0xad},{  0x21,0x9d,0x9d,0xbc},{  0x70,0x38,0x38,0x48},{  0xf1,0xf5,0xf5,0x04}, 
+{ 0x63,0xbc,0xbc,0xdf},{  0x77,0xb6,0xb6,0xc1},{  0xaf,0xda,0xda,0x75},{  0x42,0x21,0x21,0x63}, 
+{ 0x20,0x10,0x10,0x30},{  0xe5,0xff,0xff,0x1a},{  0xfd,0xf3,0xf3,0x0e},{  0xbf,0xd2,0xd2,0x6d}, 
+{ 0x81,0xcd,0xcd,0x4c},{  0x18,0x0c,0x0c,0x14},{  0x26,0x13,0x13,0x35},{  0xc3,0xec,0xec,0x2f}, 
+{ 0xbe,0x5f,0x5f,0xe1},{  0x35,0x97,0x97,0xa2},{  0x88,0x44,0x44,0xcc},{  0x2e,0x17,0x17,0x39}, 
+{ 0x93,0xc4,0xc4,0x57},{  0x55,0xa7,0xa7,0xf2},{  0xfc,0x7e,0x7e,0x82},{  0x7a,0x3d,0x3d,0x47}, 
+{ 0xc8,0x64,0x64,0xac},{  0xba,0x5d,0x5d,0xe7},{  0x32,0x19,0x19,0x2b},{  0xe6,0x73,0x73,0x95}, 
+{ 0xc0,0x60,0x60,0xa0},{  0x19,0x81,0x81,0x98},{  0x9e,0x4f,0x4f,0xd1},{  0xa3,0xdc,0xdc,0x7f}, 
+{ 0x44,0x22,0x22,0x66},{  0x54,0x2a,0x2a,0x7e},{  0x3b,0x90,0x90,0xab},{  0x0b,0x88,0x88,0x83}, 
+{ 0x8c,0x46,0x46,0xca},{  0xc7,0xee,0xee,0x29},{  0x6b,0xb8,0xb8,0xd3},{  0x28,0x14,0x14,0x3c}, 
+{ 0xa7,0xde,0xde,0x79},{  0xbc,0x5e,0x5e,0xe2},{  0x16,0x0b,0x0b,0x1d},{  0xad,0xdb,0xdb,0x76}, 
+{ 0xdb,0xe0,0xe0,0x3b},{  0x64,0x32,0x32,0x56},{  0x74,0x3a,0x3a,0x4e},{  0x14,0x0a,0x0a,0x1e}, 
+{ 0x92,0x49,0x49,0xdb},{  0x0c,0x06,0x06,0x0a},{  0x48,0x24,0x24,0x6c},{  0xb8,0x5c,0x5c,0xe4}, 
+{ 0x9f,0xc2,0xc2,0x5d},{  0xbd,0xd3,0xd3,0x6e},{  0x43,0xac,0xac,0xef},{  0xc4,0x62,0x62,0xa6}, 
+{ 0x39,0x91,0x91,0xa8},{  0x31,0x95,0x95,0xa4},{  0xd3,0xe4,0xe4,0x37},{  0xf2,0x79,0x79,0x8b}, 
+{ 0xd5,0xe7,0xe7,0x32},{  0x8b,0xc8,0xc8,0x43},{  0x6e,0x37,0x37,0x59},{  0xda,0x6d,0x6d,0xb7}, 
+{ 0x01,0x8d,0x8d,0x8c},{  0xb1,0xd5,0xd5,0x64},{  0x9c,0x4e,0x4e,0xd2},{  0x49,0xa9,0xa9,0xe0}, 
+{ 0xd8,0x6c,0x6c,0xb4},{  0xac,0x56,0x56,0xfa},{  0xf3,0xf4,0xf4,0x07},{  0xcf,0xea,0xea,0x25}, 
+{ 0xca,0x65,0x65,0xaf},{  0xf4,0x7a,0x7a,0x8e},{  0x47,0xae,0xae,0xe9},{  0x10,0x08,0x08,0x18}, 
+{ 0x6f,0xba,0xba,0xd5},{  0xf0,0x78,0x78,0x88},{  0x4a,0x25,0x25,0x6f},{  0x5c,0x2e,0x2e,0x72}, 
+{ 0x38,0x1c,0x1c,0x24},{  0x57,0xa6,0xa6,0xf1},{  0x73,0xb4,0xb4,0xc7},{  0x97,0xc6,0xc6,0x51}, 
+{ 0xcb,0xe8,0xe8,0x23},{  0xa1,0xdd,0xdd,0x7c},{  0xe8,0x74,0x74,0x9c},{  0x3e,0x1f,0x1f,0x21}, 
+{ 0x96,0x4b,0x4b,0xdd},{  0x61,0xbd,0xbd,0xdc},{  0x0d,0x8b,0x8b,0x86},{  0x0f,0x8a,0x8a,0x85}, 
+{ 0xe0,0x70,0x70,0x90},{  0x7c,0x3e,0x3e,0x42},{  0x71,0xb5,0xb5,0xc4},{  0xcc,0x66,0x66,0xaa}, 
+{ 0x90,0x48,0x48,0xd8},{  0x06,0x03,0x03,0x05},{  0xf7,0xf6,0xf6,0x01},{  0x1c,0x0e,0x0e,0x12}, 
+{ 0xc2,0x61,0x61,0xa3},{  0x6a,0x35,0x35,0x5f},{  0xae,0x57,0x57,0xf9},{  0x69,0xb9,0xb9,0xd0}, 
+{ 0x17,0x86,0x86,0x91},{  0x99,0xc1,0xc1,0x58},{  0x3a,0x1d,0x1d,0x27},{  0x27,0x9e,0x9e,0xb9}, 
+{ 0xd9,0xe1,0xe1,0x38},{  0xeb,0xf8,0xf8,0x13},{  0x2b,0x98,0x98,0xb3},{  0x22,0x11,0x11,0x33}, 
+{ 0xd2,0x69,0x69,0xbb},{  0xa9,0xd9,0xd9,0x70},{  0x07,0x8e,0x8e,0x89},{  0x33,0x94,0x94,0xa7}, 
+{ 0x2d,0x9b,0x9b,0xb6},{  0x3c,0x1e,0x1e,0x22},{  0x15,0x87,0x87,0x92},{  0xc9,0xe9,0xe9,0x20}, 
+{ 0x87,0xce,0xce,0x49},{  0xaa,0x55,0x55,0xff},{  0x50,0x28,0x28,0x78},{  0xa5,0xdf,0xdf,0x7a}, 
+{ 0x03,0x8c,0x8c,0x8f},{  0x59,0xa1,0xa1,0xf8},{  0x09,0x89,0x89,0x80},{  0x1a,0x0d,0x0d,0x17}, 
+{ 0x65,0xbf,0xbf,0xda},{  0xd7,0xe6,0xe6,0x31},{  0x84,0x42,0x42,0xc6},{  0xd0,0x68,0x68,0xb8}, 
+{ 0x82,0x41,0x41,0xc3},{  0x29,0x99,0x99,0xb0},{  0x5a,0x2d,0x2d,0x77},{  0x1e,0x0f,0x0f,0x11}, 
+{ 0x7b,0xb0,0xb0,0xcb},{  0xa8,0x54,0x54,0xfc},{  0x6d,0xbb,0xbb,0xd6},{  0x2c,0x16,0x16,0x3a } 
+};
+
+word8 T2[256][4] = {
+{ 0xa5,0xc6,0x63,0x63},{  0x84,0xf8,0x7c,0x7c},{  0x99,0xee,0x77,0x77},{  0x8d,0xf6,0x7b,0x7b}, 
+{ 0x0d,0xff,0xf2,0xf2},{  0xbd,0xd6,0x6b,0x6b},{  0xb1,0xde,0x6f,0x6f},{  0x54,0x91,0xc5,0xc5}, 
+{ 0x50,0x60,0x30,0x30},{  0x03,0x02,0x01,0x01},{  0xa9,0xce,0x67,0x67},{  0x7d,0x56,0x2b,0x2b}, 
+{ 0x19,0xe7,0xfe,0xfe},{  0x62,0xb5,0xd7,0xd7},{  0xe6,0x4d,0xab,0xab},{  0x9a,0xec,0x76,0x76}, 
+{ 0x45,0x8f,0xca,0xca},{  0x9d,0x1f,0x82,0x82},{  0x40,0x89,0xc9,0xc9},{  0x87,0xfa,0x7d,0x7d}, 
+{ 0x15,0xef,0xfa,0xfa},{  0xeb,0xb2,0x59,0x59},{  0xc9,0x8e,0x47,0x47},{  0x0b,0xfb,0xf0,0xf0}, 
+{ 0xec,0x41,0xad,0xad},{  0x67,0xb3,0xd4,0xd4},{  0xfd,0x5f,0xa2,0xa2},{  0xea,0x45,0xaf,0xaf}, 
+{ 0xbf,0x23,0x9c,0x9c},{  0xf7,0x53,0xa4,0xa4},{  0x96,0xe4,0x72,0x72},{  0x5b,0x9b,0xc0,0xc0}, 
+{ 0xc2,0x75,0xb7,0xb7},{  0x1c,0xe1,0xfd,0xfd},{  0xae,0x3d,0x93,0x93},{  0x6a,0x4c,0x26,0x26}, 
+{ 0x5a,0x6c,0x36,0x36},{  0x41,0x7e,0x3f,0x3f},{  0x02,0xf5,0xf7,0xf7},{  0x4f,0x83,0xcc,0xcc}, 
+{ 0x5c,0x68,0x34,0x34},{  0xf4,0x51,0xa5,0xa5},{  0x34,0xd1,0xe5,0xe5},{  0x08,0xf9,0xf1,0xf1}, 
+{ 0x93,0xe2,0x71,0x71},{  0x73,0xab,0xd8,0xd8},{  0x53,0x62,0x31,0x31},{  0x3f,0x2a,0x15,0x15}, 
+{ 0x0c,0x08,0x04,0x04},{  0x52,0x95,0xc7,0xc7},{  0x65,0x46,0x23,0x23},{  0x5e,0x9d,0xc3,0xc3}, 
+{ 0x28,0x30,0x18,0x18},{  0xa1,0x37,0x96,0x96},{  0x0f,0x0a,0x05,0x05},{  0xb5,0x2f,0x9a,0x9a}, 
+{ 0x09,0x0e,0x07,0x07},{  0x36,0x24,0x12,0x12},{  0x9b,0x1b,0x80,0x80},{  0x3d,0xdf,0xe2,0xe2}, 
+{ 0x26,0xcd,0xeb,0xeb},{  0x69,0x4e,0x27,0x27},{  0xcd,0x7f,0xb2,0xb2},{  0x9f,0xea,0x75,0x75}, 
+{ 0x1b,0x12,0x09,0x09},{  0x9e,0x1d,0x83,0x83},{  0x74,0x58,0x2c,0x2c},{  0x2e,0x34,0x1a,0x1a}, 
+{ 0x2d,0x36,0x1b,0x1b},{  0xb2,0xdc,0x6e,0x6e},{  0xee,0xb4,0x5a,0x5a},{  0xfb,0x5b,0xa0,0xa0}, 
+{ 0xf6,0xa4,0x52,0x52},{  0x4d,0x76,0x3b,0x3b},{  0x61,0xb7,0xd6,0xd6},{  0xce,0x7d,0xb3,0xb3}, 
+{ 0x7b,0x52,0x29,0x29},{  0x3e,0xdd,0xe3,0xe3},{  0x71,0x5e,0x2f,0x2f},{  0x97,0x13,0x84,0x84}, 
+{ 0xf5,0xa6,0x53,0x53},{  0x68,0xb9,0xd1,0xd1},{  0x00,0x00,0x00,0x00},{  0x2c,0xc1,0xed,0xed}, 
+{ 0x60,0x40,0x20,0x20},{  0x1f,0xe3,0xfc,0xfc},{  0xc8,0x79,0xb1,0xb1},{  0xed,0xb6,0x5b,0x5b}, 
+{ 0xbe,0xd4,0x6a,0x6a},{  0x46,0x8d,0xcb,0xcb},{  0xd9,0x67,0xbe,0xbe},{  0x4b,0x72,0x39,0x39}, 
+{ 0xde,0x94,0x4a,0x4a},{  0xd4,0x98,0x4c,0x4c},{  0xe8,0xb0,0x58,0x58},{  0x4a,0x85,0xcf,0xcf}, 
+{ 0x6b,0xbb,0xd0,0xd0},{  0x2a,0xc5,0xef,0xef},{  0xe5,0x4f,0xaa,0xaa},{  0x16,0xed,0xfb,0xfb}, 
+{ 0xc5,0x86,0x43,0x43},{  0xd7,0x9a,0x4d,0x4d},{  0x55,0x66,0x33,0x33},{  0x94,0x11,0x85,0x85}, 
+{ 0xcf,0x8a,0x45,0x45},{  0x10,0xe9,0xf9,0xf9},{  0x06,0x04,0x02,0x02},{  0x81,0xfe,0x7f,0x7f}, 
+{ 0xf0,0xa0,0x50,0x50},{  0x44,0x78,0x3c,0x3c},{  0xba,0x25,0x9f,0x9f},{  0xe3,0x4b,0xa8,0xa8}, 
+{ 0xf3,0xa2,0x51,0x51},{  0xfe,0x5d,0xa3,0xa3},{  0xc0,0x80,0x40,0x40},{  0x8a,0x05,0x8f,0x8f}, 
+{ 0xad,0x3f,0x92,0x92},{  0xbc,0x21,0x9d,0x9d},{  0x48,0x70,0x38,0x38},{  0x04,0xf1,0xf5,0xf5}, 
+{ 0xdf,0x63,0xbc,0xbc},{  0xc1,0x77,0xb6,0xb6},{  0x75,0xaf,0xda,0xda},{  0x63,0x42,0x21,0x21}, 
+{ 0x30,0x20,0x10,0x10},{  0x1a,0xe5,0xff,0xff},{  0x0e,0xfd,0xf3,0xf3},{  0x6d,0xbf,0xd2,0xd2}, 
+{ 0x4c,0x81,0xcd,0xcd},{  0x14,0x18,0x0c,0x0c},{  0x35,0x26,0x13,0x13},{  0x2f,0xc3,0xec,0xec}, 
+{ 0xe1,0xbe,0x5f,0x5f},{  0xa2,0x35,0x97,0x97},{  0xcc,0x88,0x44,0x44},{  0x39,0x2e,0x17,0x17}, 
+{ 0x57,0x93,0xc4,0xc4},{  0xf2,0x55,0xa7,0xa7},{  0x82,0xfc,0x7e,0x7e},{  0x47,0x7a,0x3d,0x3d}, 
+{ 0xac,0xc8,0x64,0x64},{  0xe7,0xba,0x5d,0x5d},{  0x2b,0x32,0x19,0x19},{  0x95,0xe6,0x73,0x73}, 
+{ 0xa0,0xc0,0x60,0x60},{  0x98,0x19,0x81,0x81},{  0xd1,0x9e,0x4f,0x4f},{  0x7f,0xa3,0xdc,0xdc}, 
+{ 0x66,0x44,0x22,0x22},{  0x7e,0x54,0x2a,0x2a},{  0xab,0x3b,0x90,0x90},{  0x83,0x0b,0x88,0x88}, 
+{ 0xca,0x8c,0x46,0x46},{  0x29,0xc7,0xee,0xee},{  0xd3,0x6b,0xb8,0xb8},{  0x3c,0x28,0x14,0x14}, 
+{ 0x79,0xa7,0xde,0xde},{  0xe2,0xbc,0x5e,0x5e},{  0x1d,0x16,0x0b,0x0b},{  0x76,0xad,0xdb,0xdb}, 
+{ 0x3b,0xdb,0xe0,0xe0},{  0x56,0x64,0x32,0x32},{  0x4e,0x74,0x3a,0x3a},{  0x1e,0x14,0x0a,0x0a}, 
+{ 0xdb,0x92,0x49,0x49},{  0x0a,0x0c,0x06,0x06},{  0x6c,0x48,0x24,0x24},{  0xe4,0xb8,0x5c,0x5c}, 
+{ 0x5d,0x9f,0xc2,0xc2},{  0x6e,0xbd,0xd3,0xd3},{  0xef,0x43,0xac,0xac},{  0xa6,0xc4,0x62,0x62}, 
+{ 0xa8,0x39,0x91,0x91},{  0xa4,0x31,0x95,0x95},{  0x37,0xd3,0xe4,0xe4},{  0x8b,0xf2,0x79,0x79}, 
+{ 0x32,0xd5,0xe7,0xe7},{  0x43,0x8b,0xc8,0xc8},{  0x59,0x6e,0x37,0x37},{  0xb7,0xda,0x6d,0x6d}, 
+{ 0x8c,0x01,0x8d,0x8d},{  0x64,0xb1,0xd5,0xd5},{  0xd2,0x9c,0x4e,0x4e},{  0xe0,0x49,0xa9,0xa9}, 
+{ 0xb4,0xd8,0x6c,0x6c},{  0xfa,0xac,0x56,0x56},{  0x07,0xf3,0xf4,0xf4},{  0x25,0xcf,0xea,0xea}, 
+{ 0xaf,0xca,0x65,0x65},{  0x8e,0xf4,0x7a,0x7a},{  0xe9,0x47,0xae,0xae},{  0x18,0x10,0x08,0x08}, 
+{ 0xd5,0x6f,0xba,0xba},{  0x88,0xf0,0x78,0x78},{  0x6f,0x4a,0x25,0x25},{  0x72,0x5c,0x2e,0x2e}, 
+{ 0x24,0x38,0x1c,0x1c},{  0xf1,0x57,0xa6,0xa6},{  0xc7,0x73,0xb4,0xb4},{  0x51,0x97,0xc6,0xc6}, 
+{ 0x23,0xcb,0xe8,0xe8},{  0x7c,0xa1,0xdd,0xdd},{  0x9c,0xe8,0x74,0x74},{  0x21,0x3e,0x1f,0x1f}, 
+{ 0xdd,0x96,0x4b,0x4b},{  0xdc,0x61,0xbd,0xbd},{  0x86,0x0d,0x8b,0x8b},{  0x85,0x0f,0x8a,0x8a}, 
+{ 0x90,0xe0,0x70,0x70},{  0x42,0x7c,0x3e,0x3e},{  0xc4,0x71,0xb5,0xb5},{  0xaa,0xcc,0x66,0x66}, 
+{ 0xd8,0x90,0x48,0x48},{  0x05,0x06,0x03,0x03},{  0x01,0xf7,0xf6,0xf6},{  0x12,0x1c,0x0e,0x0e}, 
+{ 0xa3,0xc2,0x61,0x61},{  0x5f,0x6a,0x35,0x35},{  0xf9,0xae,0x57,0x57},{  0xd0,0x69,0xb9,0xb9}, 
+{ 0x91,0x17,0x86,0x86},{  0x58,0x99,0xc1,0xc1},{  0x27,0x3a,0x1d,0x1d},{  0xb9,0x27,0x9e,0x9e}, 
+{ 0x38,0xd9,0xe1,0xe1},{  0x13,0xeb,0xf8,0xf8},{  0xb3,0x2b,0x98,0x98},{  0x33,0x22,0x11,0x11}, 
+{ 0xbb,0xd2,0x69,0x69},{  0x70,0xa9,0xd9,0xd9},{  0x89,0x07,0x8e,0x8e},{  0xa7,0x33,0x94,0x94}, 
+{ 0xb6,0x2d,0x9b,0x9b},{  0x22,0x3c,0x1e,0x1e},{  0x92,0x15,0x87,0x87},{  0x20,0xc9,0xe9,0xe9}, 
+{ 0x49,0x87,0xce,0xce},{  0xff,0xaa,0x55,0x55},{  0x78,0x50,0x28,0x28},{  0x7a,0xa5,0xdf,0xdf}, 
+{ 0x8f,0x03,0x8c,0x8c},{  0xf8,0x59,0xa1,0xa1},{  0x80,0x09,0x89,0x89},{  0x17,0x1a,0x0d,0x0d}, 
+{ 0xda,0x65,0xbf,0xbf},{  0x31,0xd7,0xe6,0xe6},{  0xc6,0x84,0x42,0x42},{  0xb8,0xd0,0x68,0x68}, 
+{ 0xc3,0x82,0x41,0x41},{  0xb0,0x29,0x99,0x99},{  0x77,0x5a,0x2d,0x2d},{  0x11,0x1e,0x0f,0x0f}, 
+{ 0xcb,0x7b,0xb0,0xb0},{  0xfc,0xa8,0x54,0x54},{  0xd6,0x6d,0xbb,0xbb},{  0x3a,0x2c,0x16,0x16 } 
+};
+
+word8 T3[256][4] = {
+{ 0x63,0xa5,0xc6,0x63},{  0x7c,0x84,0xf8,0x7c},{  0x77,0x99,0xee,0x77},{  0x7b,0x8d,0xf6,0x7b}, 
+{ 0xf2,0x0d,0xff,0xf2},{  0x6b,0xbd,0xd6,0x6b},{  0x6f,0xb1,0xde,0x6f},{  0xc5,0x54,0x91,0xc5}, 
+{ 0x30,0x50,0x60,0x30},{  0x01,0x03,0x02,0x01},{  0x67,0xa9,0xce,0x67},{  0x2b,0x7d,0x56,0x2b}, 
+{ 0xfe,0x19,0xe7,0xfe},{  0xd7,0x62,0xb5,0xd7},{  0xab,0xe6,0x4d,0xab},{  0x76,0x9a,0xec,0x76}, 
+{ 0xca,0x45,0x8f,0xca},{  0x82,0x9d,0x1f,0x82},{  0xc9,0x40,0x89,0xc9},{  0x7d,0x87,0xfa,0x7d}, 
+{ 0xfa,0x15,0xef,0xfa},{  0x59,0xeb,0xb2,0x59},{  0x47,0xc9,0x8e,0x47},{  0xf0,0x0b,0xfb,0xf0}, 
+{ 0xad,0xec,0x41,0xad},{  0xd4,0x67,0xb3,0xd4},{  0xa2,0xfd,0x5f,0xa2},{  0xaf,0xea,0x45,0xaf}, 
+{ 0x9c,0xbf,0x23,0x9c},{  0xa4,0xf7,0x53,0xa4},{  0x72,0x96,0xe4,0x72},{  0xc0,0x5b,0x9b,0xc0}, 
+{ 0xb7,0xc2,0x75,0xb7},{  0xfd,0x1c,0xe1,0xfd},{  0x93,0xae,0x3d,0x93},{  0x26,0x6a,0x4c,0x26}, 
+{ 0x36,0x5a,0x6c,0x36},{  0x3f,0x41,0x7e,0x3f},{  0xf7,0x02,0xf5,0xf7},{  0xcc,0x4f,0x83,0xcc}, 
+{ 0x34,0x5c,0x68,0x34},{  0xa5,0xf4,0x51,0xa5},{  0xe5,0x34,0xd1,0xe5},{  0xf1,0x08,0xf9,0xf1}, 
+{ 0x71,0x93,0xe2,0x71},{  0xd8,0x73,0xab,0xd8},{  0x31,0x53,0x62,0x31},{  0x15,0x3f,0x2a,0x15}, 
+{ 0x04,0x0c,0x08,0x04},{  0xc7,0x52,0x95,0xc7},{  0x23,0x65,0x46,0x23},{  0xc3,0x5e,0x9d,0xc3}, 
+{ 0x18,0x28,0x30,0x18},{  0x96,0xa1,0x37,0x96},{  0x05,0x0f,0x0a,0x05},{  0x9a,0xb5,0x2f,0x9a}, 
+{ 0x07,0x09,0x0e,0x07},{  0x12,0x36,0x24,0x12},{  0x80,0x9b,0x1b,0x80},{  0xe2,0x3d,0xdf,0xe2}, 
+{ 0xeb,0x26,0xcd,0xeb},{  0x27,0x69,0x4e,0x27},{  0xb2,0xcd,0x7f,0xb2},{  0x75,0x9f,0xea,0x75}, 
+{ 0x09,0x1b,0x12,0x09},{  0x83,0x9e,0x1d,0x83},{  0x2c,0x74,0x58,0x2c},{  0x1a,0x2e,0x34,0x1a}, 
+{ 0x1b,0x2d,0x36,0x1b},{  0x6e,0xb2,0xdc,0x6e},{  0x5a,0xee,0xb4,0x5a},{  0xa0,0xfb,0x5b,0xa0}, 
+{ 0x52,0xf6,0xa4,0x52},{  0x3b,0x4d,0x76,0x3b},{  0xd6,0x61,0xb7,0xd6},{  0xb3,0xce,0x7d,0xb3}, 
+{ 0x29,0x7b,0x52,0x29},{  0xe3,0x3e,0xdd,0xe3},{  0x2f,0x71,0x5e,0x2f},{  0x84,0x97,0x13,0x84}, 
+{ 0x53,0xf5,0xa6,0x53},{  0xd1,0x68,0xb9,0xd1},{  0x00,0x00,0x00,0x00},{  0xed,0x2c,0xc1,0xed}, 
+{ 0x20,0x60,0x40,0x20},{  0xfc,0x1f,0xe3,0xfc},{  0xb1,0xc8,0x79,0xb1},{  0x5b,0xed,0xb6,0x5b}, 
+{ 0x6a,0xbe,0xd4,0x6a},{  0xcb,0x46,0x8d,0xcb},{  0xbe,0xd9,0x67,0xbe},{  0x39,0x4b,0x72,0x39}, 
+{ 0x4a,0xde,0x94,0x4a},{  0x4c,0xd4,0x98,0x4c},{  0x58,0xe8,0xb0,0x58},{  0xcf,0x4a,0x85,0xcf}, 
+{ 0xd0,0x6b,0xbb,0xd0},{  0xef,0x2a,0xc5,0xef},{  0xaa,0xe5,0x4f,0xaa},{  0xfb,0x16,0xed,0xfb}, 
+{ 0x43,0xc5,0x86,0x43},{  0x4d,0xd7,0x9a,0x4d},{  0x33,0x55,0x66,0x33},{  0x85,0x94,0x11,0x85}, 
+{ 0x45,0xcf,0x8a,0x45},{  0xf9,0x10,0xe9,0xf9},{  0x02,0x06,0x04,0x02},{  0x7f,0x81,0xfe,0x7f}, 
+{ 0x50,0xf0,0xa0,0x50},{  0x3c,0x44,0x78,0x3c},{  0x9f,0xba,0x25,0x9f},{  0xa8,0xe3,0x4b,0xa8}, 
+{ 0x51,0xf3,0xa2,0x51},{  0xa3,0xfe,0x5d,0xa3},{  0x40,0xc0,0x80,0x40},{  0x8f,0x8a,0x05,0x8f}, 
+{ 0x92,0xad,0x3f,0x92},{  0x9d,0xbc,0x21,0x9d},{  0x38,0x48,0x70,0x38},{  0xf5,0x04,0xf1,0xf5}, 
+{ 0xbc,0xdf,0x63,0xbc},{  0xb6,0xc1,0x77,0xb6},{  0xda,0x75,0xaf,0xda},{  0x21,0x63,0x42,0x21}, 
+{ 0x10,0x30,0x20,0x10},{  0xff,0x1a,0xe5,0xff},{  0xf3,0x0e,0xfd,0xf3},{  0xd2,0x6d,0xbf,0xd2}, 
+{ 0xcd,0x4c,0x81,0xcd},{  0x0c,0x14,0x18,0x0c},{  0x13,0x35,0x26,0x13},{  0xec,0x2f,0xc3,0xec}, 
+{ 0x5f,0xe1,0xbe,0x5f},{  0x97,0xa2,0x35,0x97},{  0x44,0xcc,0x88,0x44},{  0x17,0x39,0x2e,0x17}, 
+{ 0xc4,0x57,0x93,0xc4},{  0xa7,0xf2,0x55,0xa7},{  0x7e,0x82,0xfc,0x7e},{  0x3d,0x47,0x7a,0x3d}, 
+{ 0x64,0xac,0xc8,0x64},{  0x5d,0xe7,0xba,0x5d},{  0x19,0x2b,0x32,0x19},{  0x73,0x95,0xe6,0x73}, 
+{ 0x60,0xa0,0xc0,0x60},{  0x81,0x98,0x19,0x81},{  0x4f,0xd1,0x9e,0x4f},{  0xdc,0x7f,0xa3,0xdc}, 
+{ 0x22,0x66,0x44,0x22},{  0x2a,0x7e,0x54,0x2a},{  0x90,0xab,0x3b,0x90},{  0x88,0x83,0x0b,0x88}, 
+{ 0x46,0xca,0x8c,0x46},{  0xee,0x29,0xc7,0xee},{  0xb8,0xd3,0x6b,0xb8},{  0x14,0x3c,0x28,0x14}, 
+{ 0xde,0x79,0xa7,0xde},{  0x5e,0xe2,0xbc,0x5e},{  0x0b,0x1d,0x16,0x0b},{  0xdb,0x76,0xad,0xdb}, 
+{ 0xe0,0x3b,0xdb,0xe0},{  0x32,0x56,0x64,0x32},{  0x3a,0x4e,0x74,0x3a},{  0x0a,0x1e,0x14,0x0a}, 
+{ 0x49,0xdb,0x92,0x49},{  0x06,0x0a,0x0c,0x06},{  0x24,0x6c,0x48,0x24},{  0x5c,0xe4,0xb8,0x5c}, 
+{ 0xc2,0x5d,0x9f,0xc2},{  0xd3,0x6e,0xbd,0xd3},{  0xac,0xef,0x43,0xac},{  0x62,0xa6,0xc4,0x62}, 
+{ 0x91,0xa8,0x39,0x91},{  0x95,0xa4,0x31,0x95},{  0xe4,0x37,0xd3,0xe4},{  0x79,0x8b,0xf2,0x79}, 
+{ 0xe7,0x32,0xd5,0xe7},{  0xc8,0x43,0x8b,0xc8},{  0x37,0x59,0x6e,0x37},{  0x6d,0xb7,0xda,0x6d}, 
+{ 0x8d,0x8c,0x01,0x8d},{  0xd5,0x64,0xb1,0xd5},{  0x4e,0xd2,0x9c,0x4e},{  0xa9,0xe0,0x49,0xa9}, 
+{ 0x6c,0xb4,0xd8,0x6c},{  0x56,0xfa,0xac,0x56},{  0xf4,0x07,0xf3,0xf4},{  0xea,0x25,0xcf,0xea}, 
+{ 0x65,0xaf,0xca,0x65},{  0x7a,0x8e,0xf4,0x7a},{  0xae,0xe9,0x47,0xae},{  0x08,0x18,0x10,0x08}, 
+{ 0xba,0xd5,0x6f,0xba},{  0x78,0x88,0xf0,0x78},{  0x25,0x6f,0x4a,0x25},{  0x2e,0x72,0x5c,0x2e}, 
+{ 0x1c,0x24,0x38,0x1c},{  0xa6,0xf1,0x57,0xa6},{  0xb4,0xc7,0x73,0xb4},{  0xc6,0x51,0x97,0xc6}, 
+{ 0xe8,0x23,0xcb,0xe8},{  0xdd,0x7c,0xa1,0xdd},{  0x74,0x9c,0xe8,0x74},{  0x1f,0x21,0x3e,0x1f}, 
+{ 0x4b,0xdd,0x96,0x4b},{  0xbd,0xdc,0x61,0xbd},{  0x8b,0x86,0x0d,0x8b},{  0x8a,0x85,0x0f,0x8a}, 
+{ 0x70,0x90,0xe0,0x70},{  0x3e,0x42,0x7c,0x3e},{  0xb5,0xc4,0x71,0xb5},{  0x66,0xaa,0xcc,0x66}, 
+{ 0x48,0xd8,0x90,0x48},{  0x03,0x05,0x06,0x03},{  0xf6,0x01,0xf7,0xf6},{  0x0e,0x12,0x1c,0x0e}, 
+{ 0x61,0xa3,0xc2,0x61},{  0x35,0x5f,0x6a,0x35},{  0x57,0xf9,0xae,0x57},{  0xb9,0xd0,0x69,0xb9}, 
+{ 0x86,0x91,0x17,0x86},{  0xc1,0x58,0x99,0xc1},{  0x1d,0x27,0x3a,0x1d},{  0x9e,0xb9,0x27,0x9e}, 
+{ 0xe1,0x38,0xd9,0xe1},{  0xf8,0x13,0xeb,0xf8},{  0x98,0xb3,0x2b,0x98},{  0x11,0x33,0x22,0x11}, 
+{ 0x69,0xbb,0xd2,0x69},{  0xd9,0x70,0xa9,0xd9},{  0x8e,0x89,0x07,0x8e},{  0x94,0xa7,0x33,0x94}, 
+{ 0x9b,0xb6,0x2d,0x9b},{  0x1e,0x22,0x3c,0x1e},{  0x87,0x92,0x15,0x87},{  0xe9,0x20,0xc9,0xe9}, 
+{ 0xce,0x49,0x87,0xce},{  0x55,0xff,0xaa,0x55},{  0x28,0x78,0x50,0x28},{  0xdf,0x7a,0xa5,0xdf}, 
+{ 0x8c,0x8f,0x03,0x8c},{  0xa1,0xf8,0x59,0xa1},{  0x89,0x80,0x09,0x89},{  0x0d,0x17,0x1a,0x0d}, 
+{ 0xbf,0xda,0x65,0xbf},{  0xe6,0x31,0xd7,0xe6},{  0x42,0xc6,0x84,0x42},{  0x68,0xb8,0xd0,0x68}, 
+{ 0x41,0xc3,0x82,0x41},{  0x99,0xb0,0x29,0x99},{  0x2d,0x77,0x5a,0x2d},{  0x0f,0x11,0x1e,0x0f}, 
+{ 0xb0,0xcb,0x7b,0xb0},{  0x54,0xfc,0xa8,0x54},{  0xbb,0xd6,0x6d,0xbb},{  0x16,0x3a,0x2c,0x16 } 
+};
+
+word8 T4[256][4] = {
+{ 0x63,0x63,0xa5,0xc6},{  0x7c,0x7c,0x84,0xf8},{  0x77,0x77,0x99,0xee},{  0x7b,0x7b,0x8d,0xf6}, 
+{ 0xf2,0xf2,0x0d,0xff},{  0x6b,0x6b,0xbd,0xd6},{  0x6f,0x6f,0xb1,0xde},{  0xc5,0xc5,0x54,0x91}, 
+{ 0x30,0x30,0x50,0x60},{  0x01,0x01,0x03,0x02},{  0x67,0x67,0xa9,0xce},{  0x2b,0x2b,0x7d,0x56}, 
+{ 0xfe,0xfe,0x19,0xe7},{  0xd7,0xd7,0x62,0xb5},{  0xab,0xab,0xe6,0x4d},{  0x76,0x76,0x9a,0xec}, 
+{ 0xca,0xca,0x45,0x8f},{  0x82,0x82,0x9d,0x1f},{  0xc9,0xc9,0x40,0x89},{  0x7d,0x7d,0x87,0xfa}, 
+{ 0xfa,0xfa,0x15,0xef},{  0x59,0x59,0xeb,0xb2},{  0x47,0x47,0xc9,0x8e},{  0xf0,0xf0,0x0b,0xfb}, 
+{ 0xad,0xad,0xec,0x41},{  0xd4,0xd4,0x67,0xb3},{  0xa2,0xa2,0xfd,0x5f},{  0xaf,0xaf,0xea,0x45}, 
+{ 0x9c,0x9c,0xbf,0x23},{  0xa4,0xa4,0xf7,0x53},{  0x72,0x72,0x96,0xe4},{  0xc0,0xc0,0x5b,0x9b}, 
+{ 0xb7,0xb7,0xc2,0x75},{  0xfd,0xfd,0x1c,0xe1},{  0x93,0x93,0xae,0x3d},{  0x26,0x26,0x6a,0x4c}, 
+{ 0x36,0x36,0x5a,0x6c},{  0x3f,0x3f,0x41,0x7e},{  0xf7,0xf7,0x02,0xf5},{  0xcc,0xcc,0x4f,0x83}, 
+{ 0x34,0x34,0x5c,0x68},{  0xa5,0xa5,0xf4,0x51},{  0xe5,0xe5,0x34,0xd1},{  0xf1,0xf1,0x08,0xf9}, 
+{ 0x71,0x71,0x93,0xe2},{  0xd8,0xd8,0x73,0xab},{  0x31,0x31,0x53,0x62},{  0x15,0x15,0x3f,0x2a}, 
+{ 0x04,0x04,0x0c,0x08},{  0xc7,0xc7,0x52,0x95},{  0x23,0x23,0x65,0x46},{  0xc3,0xc3,0x5e,0x9d}, 
+{ 0x18,0x18,0x28,0x30},{  0x96,0x96,0xa1,0x37},{  0x05,0x05,0x0f,0x0a},{  0x9a,0x9a,0xb5,0x2f}, 
+{ 0x07,0x07,0x09,0x0e},{  0x12,0x12,0x36,0x24},{  0x80,0x80,0x9b,0x1b},{  0xe2,0xe2,0x3d,0xdf}, 
+{ 0xeb,0xeb,0x26,0xcd},{  0x27,0x27,0x69,0x4e},{  0xb2,0xb2,0xcd,0x7f},{  0x75,0x75,0x9f,0xea}, 
+{ 0x09,0x09,0x1b,0x12},{  0x83,0x83,0x9e,0x1d},{  0x2c,0x2c,0x74,0x58},{  0x1a,0x1a,0x2e,0x34}, 
+{ 0x1b,0x1b,0x2d,0x36},{  0x6e,0x6e,0xb2,0xdc},{  0x5a,0x5a,0xee,0xb4},{  0xa0,0xa0,0xfb,0x5b}, 
+{ 0x52,0x52,0xf6,0xa4},{  0x3b,0x3b,0x4d,0x76},{  0xd6,0xd6,0x61,0xb7},{  0xb3,0xb3,0xce,0x7d}, 
+{ 0x29,0x29,0x7b,0x52},{  0xe3,0xe3,0x3e,0xdd},{  0x2f,0x2f,0x71,0x5e},{  0x84,0x84,0x97,0x13}, 
+{ 0x53,0x53,0xf5,0xa6},{  0xd1,0xd1,0x68,0xb9},{  0x00,0x00,0x00,0x00},{  0xed,0xed,0x2c,0xc1}, 
+{ 0x20,0x20,0x60,0x40},{  0xfc,0xfc,0x1f,0xe3},{  0xb1,0xb1,0xc8,0x79},{  0x5b,0x5b,0xed,0xb6}, 
+{ 0x6a,0x6a,0xbe,0xd4},{  0xcb,0xcb,0x46,0x8d},{  0xbe,0xbe,0xd9,0x67},{  0x39,0x39,0x4b,0x72}, 
+{ 0x4a,0x4a,0xde,0x94},{  0x4c,0x4c,0xd4,0x98},{  0x58,0x58,0xe8,0xb0},{  0xcf,0xcf,0x4a,0x85}, 
+{ 0xd0,0xd0,0x6b,0xbb},{  0xef,0xef,0x2a,0xc5},{  0xaa,0xaa,0xe5,0x4f},{  0xfb,0xfb,0x16,0xed}, 
+{ 0x43,0x43,0xc5,0x86},{  0x4d,0x4d,0xd7,0x9a},{  0x33,0x33,0x55,0x66},{  0x85,0x85,0x94,0x11}, 
+{ 0x45,0x45,0xcf,0x8a},{  0xf9,0xf9,0x10,0xe9},{  0x02,0x02,0x06,0x04},{  0x7f,0x7f,0x81,0xfe}, 
+{ 0x50,0x50,0xf0,0xa0},{  0x3c,0x3c,0x44,0x78},{  0x9f,0x9f,0xba,0x25},{  0xa8,0xa8,0xe3,0x4b}, 
+{ 0x51,0x51,0xf3,0xa2},{  0xa3,0xa3,0xfe,0x5d},{  0x40,0x40,0xc0,0x80},{  0x8f,0x8f,0x8a,0x05}, 
+{ 0x92,0x92,0xad,0x3f},{  0x9d,0x9d,0xbc,0x21},{  0x38,0x38,0x48,0x70},{  0xf5,0xf5,0x04,0xf1}, 
+{ 0xbc,0xbc,0xdf,0x63},{  0xb6,0xb6,0xc1,0x77},{  0xda,0xda,0x75,0xaf},{  0x21,0x21,0x63,0x42}, 
+{ 0x10,0x10,0x30,0x20},{  0xff,0xff,0x1a,0xe5},{  0xf3,0xf3,0x0e,0xfd},{  0xd2,0xd2,0x6d,0xbf}, 
+{ 0xcd,0xcd,0x4c,0x81},{  0x0c,0x0c,0x14,0x18},{  0x13,0x13,0x35,0x26},{  0xec,0xec,0x2f,0xc3}, 
+{ 0x5f,0x5f,0xe1,0xbe},{  0x97,0x97,0xa2,0x35},{  0x44,0x44,0xcc,0x88},{  0x17,0x17,0x39,0x2e}, 
+{ 0xc4,0xc4,0x57,0x93},{  0xa7,0xa7,0xf2,0x55},{  0x7e,0x7e,0x82,0xfc},{  0x3d,0x3d,0x47,0x7a}, 
+{ 0x64,0x64,0xac,0xc8},{  0x5d,0x5d,0xe7,0xba},{  0x19,0x19,0x2b,0x32},{  0x73,0x73,0x95,0xe6}, 
+{ 0x60,0x60,0xa0,0xc0},{  0x81,0x81,0x98,0x19},{  0x4f,0x4f,0xd1,0x9e},{  0xdc,0xdc,0x7f,0xa3}, 
+{ 0x22,0x22,0x66,0x44},{  0x2a,0x2a,0x7e,0x54},{  0x90,0x90,0xab,0x3b},{  0x88,0x88,0x83,0x0b}, 
+{ 0x46,0x46,0xca,0x8c},{  0xee,0xee,0x29,0xc7},{  0xb8,0xb8,0xd3,0x6b},{  0x14,0x14,0x3c,0x28}, 
+{ 0xde,0xde,0x79,0xa7},{  0x5e,0x5e,0xe2,0xbc},{  0x0b,0x0b,0x1d,0x16},{  0xdb,0xdb,0x76,0xad}, 
+{ 0xe0,0xe0,0x3b,0xdb},{  0x32,0x32,0x56,0x64},{  0x3a,0x3a,0x4e,0x74},{  0x0a,0x0a,0x1e,0x14}, 
+{ 0x49,0x49,0xdb,0x92},{  0x06,0x06,0x0a,0x0c},{  0x24,0x24,0x6c,0x48},{  0x5c,0x5c,0xe4,0xb8}, 
+{ 0xc2,0xc2,0x5d,0x9f},{  0xd3,0xd3,0x6e,0xbd},{  0xac,0xac,0xef,0x43},{  0x62,0x62,0xa6,0xc4}, 
+{ 0x91,0x91,0xa8,0x39},{  0x95,0x95,0xa4,0x31},{  0xe4,0xe4,0x37,0xd3},{  0x79,0x79,0x8b,0xf2}, 
+{ 0xe7,0xe7,0x32,0xd5},{  0xc8,0xc8,0x43,0x8b},{  0x37,0x37,0x59,0x6e},{  0x6d,0x6d,0xb7,0xda}, 
+{ 0x8d,0x8d,0x8c,0x01},{  0xd5,0xd5,0x64,0xb1},{  0x4e,0x4e,0xd2,0x9c},{  0xa9,0xa9,0xe0,0x49}, 
+{ 0x6c,0x6c,0xb4,0xd8},{  0x56,0x56,0xfa,0xac},{  0xf4,0xf4,0x07,0xf3},{  0xea,0xea,0x25,0xcf}, 
+{ 0x65,0x65,0xaf,0xca},{  0x7a,0x7a,0x8e,0xf4},{  0xae,0xae,0xe9,0x47},{  0x08,0x08,0x18,0x10}, 
+{ 0xba,0xba,0xd5,0x6f},{  0x78,0x78,0x88,0xf0},{  0x25,0x25,0x6f,0x4a},{  0x2e,0x2e,0x72,0x5c}, 
+{ 0x1c,0x1c,0x24,0x38},{  0xa6,0xa6,0xf1,0x57},{  0xb4,0xb4,0xc7,0x73},{  0xc6,0xc6,0x51,0x97}, 
+{ 0xe8,0xe8,0x23,0xcb},{  0xdd,0xdd,0x7c,0xa1},{  0x74,0x74,0x9c,0xe8},{  0x1f,0x1f,0x21,0x3e}, 
+{ 0x4b,0x4b,0xdd,0x96},{  0xbd,0xbd,0xdc,0x61},{  0x8b,0x8b,0x86,0x0d},{  0x8a,0x8a,0x85,0x0f}, 
+{ 0x70,0x70,0x90,0xe0},{  0x3e,0x3e,0x42,0x7c},{  0xb5,0xb5,0xc4,0x71},{  0x66,0x66,0xaa,0xcc}, 
+{ 0x48,0x48,0xd8,0x90},{  0x03,0x03,0x05,0x06},{  0xf6,0xf6,0x01,0xf7},{  0x0e,0x0e,0x12,0x1c}, 
+{ 0x61,0x61,0xa3,0xc2},{  0x35,0x35,0x5f,0x6a},{  0x57,0x57,0xf9,0xae},{  0xb9,0xb9,0xd0,0x69}, 
+{ 0x86,0x86,0x91,0x17},{  0xc1,0xc1,0x58,0x99},{  0x1d,0x1d,0x27,0x3a},{  0x9e,0x9e,0xb9,0x27}, 
+{ 0xe1,0xe1,0x38,0xd9},{  0xf8,0xf8,0x13,0xeb},{  0x98,0x98,0xb3,0x2b},{  0x11,0x11,0x33,0x22}, 
+{ 0x69,0x69,0xbb,0xd2},{  0xd9,0xd9,0x70,0xa9},{  0x8e,0x8e,0x89,0x07},{  0x94,0x94,0xa7,0x33}, 
+{ 0x9b,0x9b,0xb6,0x2d},{  0x1e,0x1e,0x22,0x3c},{  0x87,0x87,0x92,0x15},{  0xe9,0xe9,0x20,0xc9}, 
+{ 0xce,0xce,0x49,0x87},{  0x55,0x55,0xff,0xaa},{  0x28,0x28,0x78,0x50},{  0xdf,0xdf,0x7a,0xa5}, 
+{ 0x8c,0x8c,0x8f,0x03},{  0xa1,0xa1,0xf8,0x59},{  0x89,0x89,0x80,0x09},{  0x0d,0x0d,0x17,0x1a}, 
+{ 0xbf,0xbf,0xda,0x65},{  0xe6,0xe6,0x31,0xd7},{  0x42,0x42,0xc6,0x84},{  0x68,0x68,0xb8,0xd0}, 
+{ 0x41,0x41,0xc3,0x82},{  0x99,0x99,0xb0,0x29},{  0x2d,0x2d,0x77,0x5a},{  0x0f,0x0f,0x11,0x1e}, 
+{ 0xb0,0xb0,0xcb,0x7b},{  0x54,0x54,0xfc,0xa8},{  0xbb,0xbb,0xd6,0x6d},{  0x16,0x16,0x3a,0x2c } 
+};
+
+word8 T5[256][4] = {
+{ 0x51,0xf4,0xa7,0x50},{  0x7e,0x41,0x65,0x53},{  0x1a,0x17,0xa4,0xc3},{  0x3a,0x27,0x5e,0x96}, 
+{ 0x3b,0xab,0x6b,0xcb},{  0x1f,0x9d,0x45,0xf1},{  0xac,0xfa,0x58,0xab},{  0x4b,0xe3,0x03,0x93}, 
+{ 0x20,0x30,0xfa,0x55},{  0xad,0x76,0x6d,0xf6},{  0x88,0xcc,0x76,0x91},{  0xf5,0x02,0x4c,0x25}, 
+{ 0x4f,0xe5,0xd7,0xfc},{  0xc5,0x2a,0xcb,0xd7},{  0x26,0x35,0x44,0x80},{  0xb5,0x62,0xa3,0x8f}, 
+{ 0xde,0xb1,0x5a,0x49},{  0x25,0xba,0x1b,0x67},{  0x45,0xea,0x0e,0x98},{  0x5d,0xfe,0xc0,0xe1}, 
+{ 0xc3,0x2f,0x75,0x02},{  0x81,0x4c,0xf0,0x12},{  0x8d,0x46,0x97,0xa3},{  0x6b,0xd3,0xf9,0xc6}, 
+{ 0x03,0x8f,0x5f,0xe7},{  0x15,0x92,0x9c,0x95},{  0xbf,0x6d,0x7a,0xeb},{  0x95,0x52,0x59,0xda}, 
+{ 0xd4,0xbe,0x83,0x2d},{  0x58,0x74,0x21,0xd3},{  0x49,0xe0,0x69,0x29},{  0x8e,0xc9,0xc8,0x44}, 
+{ 0x75,0xc2,0x89,0x6a},{  0xf4,0x8e,0x79,0x78},{  0x99,0x58,0x3e,0x6b},{  0x27,0xb9,0x71,0xdd}, 
+{ 0xbe,0xe1,0x4f,0xb6},{  0xf0,0x88,0xad,0x17},{  0xc9,0x20,0xac,0x66},{  0x7d,0xce,0x3a,0xb4}, 
+{ 0x63,0xdf,0x4a,0x18},{  0xe5,0x1a,0x31,0x82},{  0x97,0x51,0x33,0x60},{  0x62,0x53,0x7f,0x45}, 
+{ 0xb1,0x64,0x77,0xe0},{  0xbb,0x6b,0xae,0x84},{  0xfe,0x81,0xa0,0x1c},{  0xf9,0x08,0x2b,0x94}, 
+{ 0x70,0x48,0x68,0x58},{  0x8f,0x45,0xfd,0x19},{  0x94,0xde,0x6c,0x87},{  0x52,0x7b,0xf8,0xb7}, 
+{ 0xab,0x73,0xd3,0x23},{  0x72,0x4b,0x02,0xe2},{  0xe3,0x1f,0x8f,0x57},{  0x66,0x55,0xab,0x2a}, 
+{ 0xb2,0xeb,0x28,0x07},{  0x2f,0xb5,0xc2,0x03},{  0x86,0xc5,0x7b,0x9a},{  0xd3,0x37,0x08,0xa5}, 
+{ 0x30,0x28,0x87,0xf2},{  0x23,0xbf,0xa5,0xb2},{  0x02,0x03,0x6a,0xba},{  0xed,0x16,0x82,0x5c}, 
+{ 0x8a,0xcf,0x1c,0x2b},{  0xa7,0x79,0xb4,0x92},{  0xf3,0x07,0xf2,0xf0},{  0x4e,0x69,0xe2,0xa1}, 
+{ 0x65,0xda,0xf4,0xcd},{  0x06,0x05,0xbe,0xd5},{  0xd1,0x34,0x62,0x1f},{  0xc4,0xa6,0xfe,0x8a}, 
+{ 0x34,0x2e,0x53,0x9d},{  0xa2,0xf3,0x55,0xa0},{  0x05,0x8a,0xe1,0x32},{  0xa4,0xf6,0xeb,0x75}, 
+{ 0x0b,0x83,0xec,0x39},{  0x40,0x60,0xef,0xaa},{  0x5e,0x71,0x9f,0x06},{  0xbd,0x6e,0x10,0x51}, 
+{ 0x3e,0x21,0x8a,0xf9},{  0x96,0xdd,0x06,0x3d},{  0xdd,0x3e,0x05,0xae},{  0x4d,0xe6,0xbd,0x46}, 
+{ 0x91,0x54,0x8d,0xb5},{  0x71,0xc4,0x5d,0x05},{  0x04,0x06,0xd4,0x6f},{  0x60,0x50,0x15,0xff}, 
+{ 0x19,0x98,0xfb,0x24},{  0xd6,0xbd,0xe9,0x97},{  0x89,0x40,0x43,0xcc},{  0x67,0xd9,0x9e,0x77}, 
+{ 0xb0,0xe8,0x42,0xbd},{  0x07,0x89,0x8b,0x88},{  0xe7,0x19,0x5b,0x38},{  0x79,0xc8,0xee,0xdb}, 
+{ 0xa1,0x7c,0x0a,0x47},{  0x7c,0x42,0x0f,0xe9},{  0xf8,0x84,0x1e,0xc9},{  0x00,0x00,0x00,0x00}, 
+{ 0x09,0x80,0x86,0x83},{  0x32,0x2b,0xed,0x48},{  0x1e,0x11,0x70,0xac},{  0x6c,0x5a,0x72,0x4e}, 
+{ 0xfd,0x0e,0xff,0xfb},{  0x0f,0x85,0x38,0x56},{  0x3d,0xae,0xd5,0x1e},{  0x36,0x2d,0x39,0x27}, 
+{ 0x0a,0x0f,0xd9,0x64},{  0x68,0x5c,0xa6,0x21},{  0x9b,0x5b,0x54,0xd1},{  0x24,0x36,0x2e,0x3a}, 
+{ 0x0c,0x0a,0x67,0xb1},{  0x93,0x57,0xe7,0x0f},{  0xb4,0xee,0x96,0xd2},{  0x1b,0x9b,0x91,0x9e}, 
+{ 0x80,0xc0,0xc5,0x4f},{  0x61,0xdc,0x20,0xa2},{  0x5a,0x77,0x4b,0x69},{  0x1c,0x12,0x1a,0x16}, 
+{ 0xe2,0x93,0xba,0x0a},{  0xc0,0xa0,0x2a,0xe5},{  0x3c,0x22,0xe0,0x43},{  0x12,0x1b,0x17,0x1d}, 
+{ 0x0e,0x09,0x0d,0x0b},{  0xf2,0x8b,0xc7,0xad},{  0x2d,0xb6,0xa8,0xb9},{  0x14,0x1e,0xa9,0xc8}, 
+{ 0x57,0xf1,0x19,0x85},{  0xaf,0x75,0x07,0x4c},{  0xee,0x99,0xdd,0xbb},{  0xa3,0x7f,0x60,0xfd}, 
+{ 0xf7,0x01,0x26,0x9f},{  0x5c,0x72,0xf5,0xbc},{  0x44,0x66,0x3b,0xc5},{  0x5b,0xfb,0x7e,0x34}, 
+{ 0x8b,0x43,0x29,0x76},{  0xcb,0x23,0xc6,0xdc},{  0xb6,0xed,0xfc,0x68},{  0xb8,0xe4,0xf1,0x63}, 
+{ 0xd7,0x31,0xdc,0xca},{  0x42,0x63,0x85,0x10},{  0x13,0x97,0x22,0x40},{  0x84,0xc6,0x11,0x20}, 
+{ 0x85,0x4a,0x24,0x7d},{  0xd2,0xbb,0x3d,0xf8},{  0xae,0xf9,0x32,0x11},{  0xc7,0x29,0xa1,0x6d}, 
+{ 0x1d,0x9e,0x2f,0x4b},{  0xdc,0xb2,0x30,0xf3},{  0x0d,0x86,0x52,0xec},{  0x77,0xc1,0xe3,0xd0}, 
+{ 0x2b,0xb3,0x16,0x6c},{  0xa9,0x70,0xb9,0x99},{  0x11,0x94,0x48,0xfa},{  0x47,0xe9,0x64,0x22}, 
+{ 0xa8,0xfc,0x8c,0xc4},{  0xa0,0xf0,0x3f,0x1a},{  0x56,0x7d,0x2c,0xd8},{  0x22,0x33,0x90,0xef}, 
+{ 0x87,0x49,0x4e,0xc7},{  0xd9,0x38,0xd1,0xc1},{  0x8c,0xca,0xa2,0xfe},{  0x98,0xd4,0x0b,0x36}, 
+{ 0xa6,0xf5,0x81,0xcf},{  0xa5,0x7a,0xde,0x28},{  0xda,0xb7,0x8e,0x26},{  0x3f,0xad,0xbf,0xa4}, 
+{ 0x2c,0x3a,0x9d,0xe4},{  0x50,0x78,0x92,0x0d},{  0x6a,0x5f,0xcc,0x9b},{  0x54,0x7e,0x46,0x62}, 
+{ 0xf6,0x8d,0x13,0xc2},{  0x90,0xd8,0xb8,0xe8},{  0x2e,0x39,0xf7,0x5e},{  0x82,0xc3,0xaf,0xf5}, 
+{ 0x9f,0x5d,0x80,0xbe},{  0x69,0xd0,0x93,0x7c},{  0x6f,0xd5,0x2d,0xa9},{  0xcf,0x25,0x12,0xb3}, 
+{ 0xc8,0xac,0x99,0x3b},{  0x10,0x18,0x7d,0xa7},{  0xe8,0x9c,0x63,0x6e},{  0xdb,0x3b,0xbb,0x7b}, 
+{ 0xcd,0x26,0x78,0x09},{  0x6e,0x59,0x18,0xf4},{  0xec,0x9a,0xb7,0x01},{  0x83,0x4f,0x9a,0xa8}, 
+{ 0xe6,0x95,0x6e,0x65},{  0xaa,0xff,0xe6,0x7e},{  0x21,0xbc,0xcf,0x08},{  0xef,0x15,0xe8,0xe6}, 
+{ 0xba,0xe7,0x9b,0xd9},{  0x4a,0x6f,0x36,0xce},{  0xea,0x9f,0x09,0xd4},{  0x29,0xb0,0x7c,0xd6}, 
+{ 0x31,0xa4,0xb2,0xaf},{  0x2a,0x3f,0x23,0x31},{  0xc6,0xa5,0x94,0x30},{  0x35,0xa2,0x66,0xc0}, 
+{ 0x74,0x4e,0xbc,0x37},{  0xfc,0x82,0xca,0xa6},{  0xe0,0x90,0xd0,0xb0},{  0x33,0xa7,0xd8,0x15}, 
+{ 0xf1,0x04,0x98,0x4a},{  0x41,0xec,0xda,0xf7},{  0x7f,0xcd,0x50,0x0e},{  0x17,0x91,0xf6,0x2f}, 
+{ 0x76,0x4d,0xd6,0x8d},{  0x43,0xef,0xb0,0x4d},{  0xcc,0xaa,0x4d,0x54},{  0xe4,0x96,0x04,0xdf}, 
+{ 0x9e,0xd1,0xb5,0xe3},{  0x4c,0x6a,0x88,0x1b},{  0xc1,0x2c,0x1f,0xb8},{  0x46,0x65,0x51,0x7f}, 
+{ 0x9d,0x5e,0xea,0x04},{  0x01,0x8c,0x35,0x5d},{  0xfa,0x87,0x74,0x73},{  0xfb,0x0b,0x41,0x2e}, 
+{ 0xb3,0x67,0x1d,0x5a},{  0x92,0xdb,0xd2,0x52},{  0xe9,0x10,0x56,0x33},{  0x6d,0xd6,0x47,0x13}, 
+{ 0x9a,0xd7,0x61,0x8c},{  0x37,0xa1,0x0c,0x7a},{  0x59,0xf8,0x14,0x8e},{  0xeb,0x13,0x3c,0x89}, 
+{ 0xce,0xa9,0x27,0xee},{  0xb7,0x61,0xc9,0x35},{  0xe1,0x1c,0xe5,0xed},{  0x7a,0x47,0xb1,0x3c}, 
+{ 0x9c,0xd2,0xdf,0x59},{  0x55,0xf2,0x73,0x3f},{  0x18,0x14,0xce,0x79},{  0x73,0xc7,0x37,0xbf}, 
+{ 0x53,0xf7,0xcd,0xea},{  0x5f,0xfd,0xaa,0x5b},{  0xdf,0x3d,0x6f,0x14},{  0x78,0x44,0xdb,0x86}, 
+{ 0xca,0xaf,0xf3,0x81},{  0xb9,0x68,0xc4,0x3e},{  0x38,0x24,0x34,0x2c},{  0xc2,0xa3,0x40,0x5f}, 
+{ 0x16,0x1d,0xc3,0x72},{  0xbc,0xe2,0x25,0x0c},{  0x28,0x3c,0x49,0x8b},{  0xff,0x0d,0x95,0x41}, 
+{ 0x39,0xa8,0x01,0x71},{  0x08,0x0c,0xb3,0xde},{  0xd8,0xb4,0xe4,0x9c},{  0x64,0x56,0xc1,0x90}, 
+{ 0x7b,0xcb,0x84,0x61},{  0xd5,0x32,0xb6,0x70},{  0x48,0x6c,0x5c,0x74},{  0xd0,0xb8,0x57,0x42 } 
+};
+
+word8 T6[256][4] = {
+{ 0x50,0x51,0xf4,0xa7},{  0x53,0x7e,0x41,0x65},{  0xc3,0x1a,0x17,0xa4},{  0x96,0x3a,0x27,0x5e}, 
+{ 0xcb,0x3b,0xab,0x6b},{  0xf1,0x1f,0x9d,0x45},{  0xab,0xac,0xfa,0x58},{  0x93,0x4b,0xe3,0x03}, 
+{ 0x55,0x20,0x30,0xfa},{  0xf6,0xad,0x76,0x6d},{  0x91,0x88,0xcc,0x76},{  0x25,0xf5,0x02,0x4c}, 
+{ 0xfc,0x4f,0xe5,0xd7},{  0xd7,0xc5,0x2a,0xcb},{  0x80,0x26,0x35,0x44},{  0x8f,0xb5,0x62,0xa3}, 
+{ 0x49,0xde,0xb1,0x5a},{  0x67,0x25,0xba,0x1b},{  0x98,0x45,0xea,0x0e},{  0xe1,0x5d,0xfe,0xc0}, 
+{ 0x02,0xc3,0x2f,0x75},{  0x12,0x81,0x4c,0xf0},{  0xa3,0x8d,0x46,0x97},{  0xc6,0x6b,0xd3,0xf9}, 
+{ 0xe7,0x03,0x8f,0x5f},{  0x95,0x15,0x92,0x9c},{  0xeb,0xbf,0x6d,0x7a},{  0xda,0x95,0x52,0x59}, 
+{ 0x2d,0xd4,0xbe,0x83},{  0xd3,0x58,0x74,0x21},{  0x29,0x49,0xe0,0x69},{  0x44,0x8e,0xc9,0xc8}, 
+{ 0x6a,0x75,0xc2,0x89},{  0x78,0xf4,0x8e,0x79},{  0x6b,0x99,0x58,0x3e},{  0xdd,0x27,0xb9,0x71}, 
+{ 0xb6,0xbe,0xe1,0x4f},{  0x17,0xf0,0x88,0xad},{  0x66,0xc9,0x20,0xac},{  0xb4,0x7d,0xce,0x3a}, 
+{ 0x18,0x63,0xdf,0x4a},{  0x82,0xe5,0x1a,0x31},{  0x60,0x97,0x51,0x33},{  0x45,0x62,0x53,0x7f}, 
+{ 0xe0,0xb1,0x64,0x77},{  0x84,0xbb,0x6b,0xae},{  0x1c,0xfe,0x81,0xa0},{  0x94,0xf9,0x08,0x2b}, 
+{ 0x58,0x70,0x48,0x68},{  0x19,0x8f,0x45,0xfd},{  0x87,0x94,0xde,0x6c},{  0xb7,0x52,0x7b,0xf8}, 
+{ 0x23,0xab,0x73,0xd3},{  0xe2,0x72,0x4b,0x02},{  0x57,0xe3,0x1f,0x8f},{  0x2a,0x66,0x55,0xab}, 
+{ 0x07,0xb2,0xeb,0x28},{  0x03,0x2f,0xb5,0xc2},{  0x9a,0x86,0xc5,0x7b},{  0xa5,0xd3,0x37,0x08}, 
+{ 0xf2,0x30,0x28,0x87},{  0xb2,0x23,0xbf,0xa5},{  0xba,0x02,0x03,0x6a},{  0x5c,0xed,0x16,0x82}, 
+{ 0x2b,0x8a,0xcf,0x1c},{  0x92,0xa7,0x79,0xb4},{  0xf0,0xf3,0x07,0xf2},{  0xa1,0x4e,0x69,0xe2}, 
+{ 0xcd,0x65,0xda,0xf4},{  0xd5,0x06,0x05,0xbe},{  0x1f,0xd1,0x34,0x62},{  0x8a,0xc4,0xa6,0xfe}, 
+{ 0x9d,0x34,0x2e,0x53},{  0xa0,0xa2,0xf3,0x55},{  0x32,0x05,0x8a,0xe1},{  0x75,0xa4,0xf6,0xeb}, 
+{ 0x39,0x0b,0x83,0xec},{  0xaa,0x40,0x60,0xef},{  0x06,0x5e,0x71,0x9f},{  0x51,0xbd,0x6e,0x10}, 
+{ 0xf9,0x3e,0x21,0x8a},{  0x3d,0x96,0xdd,0x06},{  0xae,0xdd,0x3e,0x05},{  0x46,0x4d,0xe6,0xbd}, 
+{ 0xb5,0x91,0x54,0x8d},{  0x05,0x71,0xc4,0x5d},{  0x6f,0x04,0x06,0xd4},{  0xff,0x60,0x50,0x15}, 
+{ 0x24,0x19,0x98,0xfb},{  0x97,0xd6,0xbd,0xe9},{  0xcc,0x89,0x40,0x43},{  0x77,0x67,0xd9,0x9e}, 
+{ 0xbd,0xb0,0xe8,0x42},{  0x88,0x07,0x89,0x8b},{  0x38,0xe7,0x19,0x5b},{  0xdb,0x79,0xc8,0xee}, 
+{ 0x47,0xa1,0x7c,0x0a},{  0xe9,0x7c,0x42,0x0f},{  0xc9,0xf8,0x84,0x1e},{  0x00,0x00,0x00,0x00}, 
+{ 0x83,0x09,0x80,0x86},{  0x48,0x32,0x2b,0xed},{  0xac,0x1e,0x11,0x70},{  0x4e,0x6c,0x5a,0x72}, 
+{ 0xfb,0xfd,0x0e,0xff},{  0x56,0x0f,0x85,0x38},{  0x1e,0x3d,0xae,0xd5},{  0x27,0x36,0x2d,0x39}, 
+{ 0x64,0x0a,0x0f,0xd9},{  0x21,0x68,0x5c,0xa6},{  0xd1,0x9b,0x5b,0x54},{  0x3a,0x24,0x36,0x2e}, 
+{ 0xb1,0x0c,0x0a,0x67},{  0x0f,0x93,0x57,0xe7},{  0xd2,0xb4,0xee,0x96},{  0x9e,0x1b,0x9b,0x91}, 
+{ 0x4f,0x80,0xc0,0xc5},{  0xa2,0x61,0xdc,0x20},{  0x69,0x5a,0x77,0x4b},{  0x16,0x1c,0x12,0x1a}, 
+{ 0x0a,0xe2,0x93,0xba},{  0xe5,0xc0,0xa0,0x2a},{  0x43,0x3c,0x22,0xe0},{  0x1d,0x12,0x1b,0x17}, 
+{ 0x0b,0x0e,0x09,0x0d},{  0xad,0xf2,0x8b,0xc7},{  0xb9,0x2d,0xb6,0xa8},{  0xc8,0x14,0x1e,0xa9}, 
+{ 0x85,0x57,0xf1,0x19},{  0x4c,0xaf,0x75,0x07},{  0xbb,0xee,0x99,0xdd},{  0xfd,0xa3,0x7f,0x60}, 
+{ 0x9f,0xf7,0x01,0x26},{  0xbc,0x5c,0x72,0xf5},{  0xc5,0x44,0x66,0x3b},{  0x34,0x5b,0xfb,0x7e}, 
+{ 0x76,0x8b,0x43,0x29},{  0xdc,0xcb,0x23,0xc6},{  0x68,0xb6,0xed,0xfc},{  0x63,0xb8,0xe4,0xf1}, 
+{ 0xca,0xd7,0x31,0xdc},{  0x10,0x42,0x63,0x85},{  0x40,0x13,0x97,0x22},{  0x20,0x84,0xc6,0x11}, 
+{ 0x7d,0x85,0x4a,0x24},{  0xf8,0xd2,0xbb,0x3d},{  0x11,0xae,0xf9,0x32},{  0x6d,0xc7,0x29,0xa1}, 
+{ 0x4b,0x1d,0x9e,0x2f},{  0xf3,0xdc,0xb2,0x30},{  0xec,0x0d,0x86,0x52},{  0xd0,0x77,0xc1,0xe3}, 
+{ 0x6c,0x2b,0xb3,0x16},{  0x99,0xa9,0x70,0xb9},{  0xfa,0x11,0x94,0x48},{  0x22,0x47,0xe9,0x64}, 
+{ 0xc4,0xa8,0xfc,0x8c},{  0x1a,0xa0,0xf0,0x3f},{  0xd8,0x56,0x7d,0x2c},{  0xef,0x22,0x33,0x90}, 
+{ 0xc7,0x87,0x49,0x4e},{  0xc1,0xd9,0x38,0xd1},{  0xfe,0x8c,0xca,0xa2},{  0x36,0x98,0xd4,0x0b}, 
+{ 0xcf,0xa6,0xf5,0x81},{  0x28,0xa5,0x7a,0xde},{  0x26,0xda,0xb7,0x8e},{  0xa4,0x3f,0xad,0xbf}, 
+{ 0xe4,0x2c,0x3a,0x9d},{  0x0d,0x50,0x78,0x92},{  0x9b,0x6a,0x5f,0xcc},{  0x62,0x54,0x7e,0x46}, 
+{ 0xc2,0xf6,0x8d,0x13},{  0xe8,0x90,0xd8,0xb8},{  0x5e,0x2e,0x39,0xf7},{  0xf5,0x82,0xc3,0xaf}, 
+{ 0xbe,0x9f,0x5d,0x80},{  0x7c,0x69,0xd0,0x93},{  0xa9,0x6f,0xd5,0x2d},{  0xb3,0xcf,0x25,0x12}, 
+{ 0x3b,0xc8,0xac,0x99},{  0xa7,0x10,0x18,0x7d},{  0x6e,0xe8,0x9c,0x63},{  0x7b,0xdb,0x3b,0xbb}, 
+{ 0x09,0xcd,0x26,0x78},{  0xf4,0x6e,0x59,0x18},{  0x01,0xec,0x9a,0xb7},{  0xa8,0x83,0x4f,0x9a}, 
+{ 0x65,0xe6,0x95,0x6e},{  0x7e,0xaa,0xff,0xe6},{  0x08,0x21,0xbc,0xcf},{  0xe6,0xef,0x15,0xe8}, 
+{ 0xd9,0xba,0xe7,0x9b},{  0xce,0x4a,0x6f,0x36},{  0xd4,0xea,0x9f,0x09},{  0xd6,0x29,0xb0,0x7c}, 
+{ 0xaf,0x31,0xa4,0xb2},{  0x31,0x2a,0x3f,0x23},{  0x30,0xc6,0xa5,0x94},{  0xc0,0x35,0xa2,0x66}, 
+{ 0x37,0x74,0x4e,0xbc},{  0xa6,0xfc,0x82,0xca},{  0xb0,0xe0,0x90,0xd0},{  0x15,0x33,0xa7,0xd8}, 
+{ 0x4a,0xf1,0x04,0x98},{  0xf7,0x41,0xec,0xda},{  0x0e,0x7f,0xcd,0x50},{  0x2f,0x17,0x91,0xf6}, 
+{ 0x8d,0x76,0x4d,0xd6},{  0x4d,0x43,0xef,0xb0},{  0x54,0xcc,0xaa,0x4d},{  0xdf,0xe4,0x96,0x04}, 
+{ 0xe3,0x9e,0xd1,0xb5},{  0x1b,0x4c,0x6a,0x88},{  0xb8,0xc1,0x2c,0x1f},{  0x7f,0x46,0x65,0x51}, 
+{ 0x04,0x9d,0x5e,0xea},{  0x5d,0x01,0x8c,0x35},{  0x73,0xfa,0x87,0x74},{  0x2e,0xfb,0x0b,0x41}, 
+{ 0x5a,0xb3,0x67,0x1d},{  0x52,0x92,0xdb,0xd2},{  0x33,0xe9,0x10,0x56},{  0x13,0x6d,0xd6,0x47}, 
+{ 0x8c,0x9a,0xd7,0x61},{  0x7a,0x37,0xa1,0x0c},{  0x8e,0x59,0xf8,0x14},{  0x89,0xeb,0x13,0x3c}, 
+{ 0xee,0xce,0xa9,0x27},{  0x35,0xb7,0x61,0xc9},{  0xed,0xe1,0x1c,0xe5},{  0x3c,0x7a,0x47,0xb1}, 
+{ 0x59,0x9c,0xd2,0xdf},{  0x3f,0x55,0xf2,0x73},{  0x79,0x18,0x14,0xce},{  0xbf,0x73,0xc7,0x37}, 
+{ 0xea,0x53,0xf7,0xcd},{  0x5b,0x5f,0xfd,0xaa},{  0x14,0xdf,0x3d,0x6f},{  0x86,0x78,0x44,0xdb}, 
+{ 0x81,0xca,0xaf,0xf3},{  0x3e,0xb9,0x68,0xc4},{  0x2c,0x38,0x24,0x34},{  0x5f,0xc2,0xa3,0x40}, 
+{ 0x72,0x16,0x1d,0xc3},{  0x0c,0xbc,0xe2,0x25},{  0x8b,0x28,0x3c,0x49},{  0x41,0xff,0x0d,0x95}, 
+{ 0x71,0x39,0xa8,0x01},{  0xde,0x08,0x0c,0xb3},{  0x9c,0xd8,0xb4,0xe4},{  0x90,0x64,0x56,0xc1}, 
+{ 0x61,0x7b,0xcb,0x84},{  0x70,0xd5,0x32,0xb6},{  0x74,0x48,0x6c,0x5c},{  0x42,0xd0,0xb8,0x57 } 
+};
+
+word8 T7[256][4] = {
+{ 0xa7,0x50,0x51,0xf4},{  0x65,0x53,0x7e,0x41},{  0xa4,0xc3,0x1a,0x17},{  0x5e,0x96,0x3a,0x27}, 
+{ 0x6b,0xcb,0x3b,0xab},{  0x45,0xf1,0x1f,0x9d},{  0x58,0xab,0xac,0xfa},{  0x03,0x93,0x4b,0xe3}, 
+{ 0xfa,0x55,0x20,0x30},{  0x6d,0xf6,0xad,0x76},{  0x76,0x91,0x88,0xcc},{  0x4c,0x25,0xf5,0x02}, 
+{ 0xd7,0xfc,0x4f,0xe5},{  0xcb,0xd7,0xc5,0x2a},{  0x44,0x80,0x26,0x35},{  0xa3,0x8f,0xb5,0x62}, 
+{ 0x5a,0x49,0xde,0xb1},{  0x1b,0x67,0x25,0xba},{  0x0e,0x98,0x45,0xea},{  0xc0,0xe1,0x5d,0xfe}, 
+{ 0x75,0x02,0xc3,0x2f},{  0xf0,0x12,0x81,0x4c},{  0x97,0xa3,0x8d,0x46},{  0xf9,0xc6,0x6b,0xd3}, 
+{ 0x5f,0xe7,0x03,0x8f},{  0x9c,0x95,0x15,0x92},{  0x7a,0xeb,0xbf,0x6d},{  0x59,0xda,0x95,0x52}, 
+{ 0x83,0x2d,0xd4,0xbe},{  0x21,0xd3,0x58,0x74},{  0x69,0x29,0x49,0xe0},{  0xc8,0x44,0x8e,0xc9}, 
+{ 0x89,0x6a,0x75,0xc2},{  0x79,0x78,0xf4,0x8e},{  0x3e,0x6b,0x99,0x58},{  0x71,0xdd,0x27,0xb9}, 
+{ 0x4f,0xb6,0xbe,0xe1},{  0xad,0x17,0xf0,0x88},{  0xac,0x66,0xc9,0x20},{  0x3a,0xb4,0x7d,0xce}, 
+{ 0x4a,0x18,0x63,0xdf},{  0x31,0x82,0xe5,0x1a},{  0x33,0x60,0x97,0x51},{  0x7f,0x45,0x62,0x53}, 
+{ 0x77,0xe0,0xb1,0x64},{  0xae,0x84,0xbb,0x6b},{  0xa0,0x1c,0xfe,0x81},{  0x2b,0x94,0xf9,0x08}, 
+{ 0x68,0x58,0x70,0x48},{  0xfd,0x19,0x8f,0x45},{  0x6c,0x87,0x94,0xde},{  0xf8,0xb7,0x52,0x7b}, 
+{ 0xd3,0x23,0xab,0x73},{  0x02,0xe2,0x72,0x4b},{  0x8f,0x57,0xe3,0x1f},{  0xab,0x2a,0x66,0x55}, 
+{ 0x28,0x07,0xb2,0xeb},{  0xc2,0x03,0x2f,0xb5},{  0x7b,0x9a,0x86,0xc5},{  0x08,0xa5,0xd3,0x37}, 
+{ 0x87,0xf2,0x30,0x28},{  0xa5,0xb2,0x23,0xbf},{  0x6a,0xba,0x02,0x03},{  0x82,0x5c,0xed,0x16}, 
+{ 0x1c,0x2b,0x8a,0xcf},{  0xb4,0x92,0xa7,0x79},{  0xf2,0xf0,0xf3,0x07},{  0xe2,0xa1,0x4e,0x69}, 
+{ 0xf4,0xcd,0x65,0xda},{  0xbe,0xd5,0x06,0x05},{  0x62,0x1f,0xd1,0x34},{  0xfe,0x8a,0xc4,0xa6}, 
+{ 0x53,0x9d,0x34,0x2e},{  0x55,0xa0,0xa2,0xf3},{  0xe1,0x32,0x05,0x8a},{  0xeb,0x75,0xa4,0xf6}, 
+{ 0xec,0x39,0x0b,0x83},{  0xef,0xaa,0x40,0x60},{  0x9f,0x06,0x5e,0x71},{  0x10,0x51,0xbd,0x6e}, 
+{ 0x8a,0xf9,0x3e,0x21},{  0x06,0x3d,0x96,0xdd},{  0x05,0xae,0xdd,0x3e},{  0xbd,0x46,0x4d,0xe6}, 
+{ 0x8d,0xb5,0x91,0x54},{  0x5d,0x05,0x71,0xc4},{  0xd4,0x6f,0x04,0x06},{  0x15,0xff,0x60,0x50}, 
+{ 0xfb,0x24,0x19,0x98},{  0xe9,0x97,0xd6,0xbd},{  0x43,0xcc,0x89,0x40},{  0x9e,0x77,0x67,0xd9}, 
+{ 0x42,0xbd,0xb0,0xe8},{  0x8b,0x88,0x07,0x89},{  0x5b,0x38,0xe7,0x19},{  0xee,0xdb,0x79,0xc8}, 
+{ 0x0a,0x47,0xa1,0x7c},{  0x0f,0xe9,0x7c,0x42},{  0x1e,0xc9,0xf8,0x84},{  0x00,0x00,0x00,0x00}, 
+{ 0x86,0x83,0x09,0x80},{  0xed,0x48,0x32,0x2b},{  0x70,0xac,0x1e,0x11},{  0x72,0x4e,0x6c,0x5a}, 
+{ 0xff,0xfb,0xfd,0x0e},{  0x38,0x56,0x0f,0x85},{  0xd5,0x1e,0x3d,0xae},{  0x39,0x27,0x36,0x2d}, 
+{ 0xd9,0x64,0x0a,0x0f},{  0xa6,0x21,0x68,0x5c},{  0x54,0xd1,0x9b,0x5b},{  0x2e,0x3a,0x24,0x36}, 
+{ 0x67,0xb1,0x0c,0x0a},{  0xe7,0x0f,0x93,0x57},{  0x96,0xd2,0xb4,0xee},{  0x91,0x9e,0x1b,0x9b}, 
+{ 0xc5,0x4f,0x80,0xc0},{  0x20,0xa2,0x61,0xdc},{  0x4b,0x69,0x5a,0x77},{  0x1a,0x16,0x1c,0x12}, 
+{ 0xba,0x0a,0xe2,0x93},{  0x2a,0xe5,0xc0,0xa0},{  0xe0,0x43,0x3c,0x22},{  0x17,0x1d,0x12,0x1b}, 
+{ 0x0d,0x0b,0x0e,0x09},{  0xc7,0xad,0xf2,0x8b},{  0xa8,0xb9,0x2d,0xb6},{  0xa9,0xc8,0x14,0x1e}, 
+{ 0x19,0x85,0x57,0xf1},{  0x07,0x4c,0xaf,0x75},{  0xdd,0xbb,0xee,0x99},{  0x60,0xfd,0xa3,0x7f}, 
+{ 0x26,0x9f,0xf7,0x01},{  0xf5,0xbc,0x5c,0x72},{  0x3b,0xc5,0x44,0x66},{  0x7e,0x34,0x5b,0xfb}, 
+{ 0x29,0x76,0x8b,0x43},{  0xc6,0xdc,0xcb,0x23},{  0xfc,0x68,0xb6,0xed},{  0xf1,0x63,0xb8,0xe4}, 
+{ 0xdc,0xca,0xd7,0x31},{  0x85,0x10,0x42,0x63},{  0x22,0x40,0x13,0x97},{  0x11,0x20,0x84,0xc6}, 
+{ 0x24,0x7d,0x85,0x4a},{  0x3d,0xf8,0xd2,0xbb},{  0x32,0x11,0xae,0xf9},{  0xa1,0x6d,0xc7,0x29}, 
+{ 0x2f,0x4b,0x1d,0x9e},{  0x30,0xf3,0xdc,0xb2},{  0x52,0xec,0x0d,0x86},{  0xe3,0xd0,0x77,0xc1}, 
+{ 0x16,0x6c,0x2b,0xb3},{  0xb9,0x99,0xa9,0x70},{  0x48,0xfa,0x11,0x94},{  0x64,0x22,0x47,0xe9}, 
+{ 0x8c,0xc4,0xa8,0xfc},{  0x3f,0x1a,0xa0,0xf0},{  0x2c,0xd8,0x56,0x7d},{  0x90,0xef,0x22,0x33}, 
+{ 0x4e,0xc7,0x87,0x49},{  0xd1,0xc1,0xd9,0x38},{  0xa2,0xfe,0x8c,0xca},{  0x0b,0x36,0x98,0xd4}, 
+{ 0x81,0xcf,0xa6,0xf5},{  0xde,0x28,0xa5,0x7a},{  0x8e,0x26,0xda,0xb7},{  0xbf,0xa4,0x3f,0xad}, 
+{ 0x9d,0xe4,0x2c,0x3a},{  0x92,0x0d,0x50,0x78},{  0xcc,0x9b,0x6a,0x5f},{  0x46,0x62,0x54,0x7e}, 
+{ 0x13,0xc2,0xf6,0x8d},{  0xb8,0xe8,0x90,0xd8},{  0xf7,0x5e,0x2e,0x39},{  0xaf,0xf5,0x82,0xc3}, 
+{ 0x80,0xbe,0x9f,0x5d},{  0x93,0x7c,0x69,0xd0},{  0x2d,0xa9,0x6f,0xd5},{  0x12,0xb3,0xcf,0x25}, 
+{ 0x99,0x3b,0xc8,0xac},{  0x7d,0xa7,0x10,0x18},{  0x63,0x6e,0xe8,0x9c},{  0xbb,0x7b,0xdb,0x3b}, 
+{ 0x78,0x09,0xcd,0x26},{  0x18,0xf4,0x6e,0x59},{  0xb7,0x01,0xec,0x9a},{  0x9a,0xa8,0x83,0x4f}, 
+{ 0x6e,0x65,0xe6,0x95},{  0xe6,0x7e,0xaa,0xff},{  0xcf,0x08,0x21,0xbc},{  0xe8,0xe6,0xef,0x15}, 
+{ 0x9b,0xd9,0xba,0xe7},{  0x36,0xce,0x4a,0x6f},{  0x09,0xd4,0xea,0x9f},{  0x7c,0xd6,0x29,0xb0}, 
+{ 0xb2,0xaf,0x31,0xa4},{  0x23,0x31,0x2a,0x3f},{  0x94,0x30,0xc6,0xa5},{  0x66,0xc0,0x35,0xa2}, 
+{ 0xbc,0x37,0x74,0x4e},{  0xca,0xa6,0xfc,0x82},{  0xd0,0xb0,0xe0,0x90},{  0xd8,0x15,0x33,0xa7}, 
+{ 0x98,0x4a,0xf1,0x04},{  0xda,0xf7,0x41,0xec},{  0x50,0x0e,0x7f,0xcd},{  0xf6,0x2f,0x17,0x91}, 
+{ 0xd6,0x8d,0x76,0x4d},{  0xb0,0x4d,0x43,0xef},{  0x4d,0x54,0xcc,0xaa},{  0x04,0xdf,0xe4,0x96}, 
+{ 0xb5,0xe3,0x9e,0xd1},{  0x88,0x1b,0x4c,0x6a},{  0x1f,0xb8,0xc1,0x2c},{  0x51,0x7f,0x46,0x65}, 
+{ 0xea,0x04,0x9d,0x5e},{  0x35,0x5d,0x01,0x8c},{  0x74,0x73,0xfa,0x87},{  0x41,0x2e,0xfb,0x0b}, 
+{ 0x1d,0x5a,0xb3,0x67},{  0xd2,0x52,0x92,0xdb},{  0x56,0x33,0xe9,0x10},{  0x47,0x13,0x6d,0xd6}, 
+{ 0x61,0x8c,0x9a,0xd7},{  0x0c,0x7a,0x37,0xa1},{  0x14,0x8e,0x59,0xf8},{  0x3c,0x89,0xeb,0x13}, 
+{ 0x27,0xee,0xce,0xa9},{  0xc9,0x35,0xb7,0x61},{  0xe5,0xed,0xe1,0x1c},{  0xb1,0x3c,0x7a,0x47}, 
+{ 0xdf,0x59,0x9c,0xd2},{  0x73,0x3f,0x55,0xf2},{  0xce,0x79,0x18,0x14},{  0x37,0xbf,0x73,0xc7}, 
+{ 0xcd,0xea,0x53,0xf7},{  0xaa,0x5b,0x5f,0xfd},{  0x6f,0x14,0xdf,0x3d},{  0xdb,0x86,0x78,0x44}, 
+{ 0xf3,0x81,0xca,0xaf},{  0xc4,0x3e,0xb9,0x68},{  0x34,0x2c,0x38,0x24},{  0x40,0x5f,0xc2,0xa3}, 
+{ 0xc3,0x72,0x16,0x1d},{  0x25,0x0c,0xbc,0xe2},{  0x49,0x8b,0x28,0x3c},{  0x95,0x41,0xff,0x0d}, 
+{ 0x01,0x71,0x39,0xa8},{  0xb3,0xde,0x08,0x0c},{  0xe4,0x9c,0xd8,0xb4},{  0xc1,0x90,0x64,0x56}, 
+{ 0x84,0x61,0x7b,0xcb},{  0xb6,0x70,0xd5,0x32},{  0x5c,0x74,0x48,0x6c},{  0x57,0x42,0xd0,0xb8 } 
+};
+
+word8 T8[256][4] = {
+{ 0xf4,0xa7,0x50,0x51},{  0x41,0x65,0x53,0x7e},{  0x17,0xa4,0xc3,0x1a},{  0x27,0x5e,0x96,0x3a}, 
+{ 0xab,0x6b,0xcb,0x3b},{  0x9d,0x45,0xf1,0x1f},{  0xfa,0x58,0xab,0xac},{  0xe3,0x03,0x93,0x4b}, 
+{ 0x30,0xfa,0x55,0x20},{  0x76,0x6d,0xf6,0xad},{  0xcc,0x76,0x91,0x88},{  0x02,0x4c,0x25,0xf5}, 
+{ 0xe5,0xd7,0xfc,0x4f},{  0x2a,0xcb,0xd7,0xc5},{  0x35,0x44,0x80,0x26},{  0x62,0xa3,0x8f,0xb5}, 
+{ 0xb1,0x5a,0x49,0xde},{  0xba,0x1b,0x67,0x25},{  0xea,0x0e,0x98,0x45},{  0xfe,0xc0,0xe1,0x5d}, 
+{ 0x2f,0x75,0x02,0xc3},{  0x4c,0xf0,0x12,0x81},{  0x46,0x97,0xa3,0x8d},{  0xd3,0xf9,0xc6,0x6b}, 
+{ 0x8f,0x5f,0xe7,0x03},{  0x92,0x9c,0x95,0x15},{  0x6d,0x7a,0xeb,0xbf},{  0x52,0x59,0xda,0x95}, 
+{ 0xbe,0x83,0x2d,0xd4},{  0x74,0x21,0xd3,0x58},{  0xe0,0x69,0x29,0x49},{  0xc9,0xc8,0x44,0x8e}, 
+{ 0xc2,0x89,0x6a,0x75},{  0x8e,0x79,0x78,0xf4},{  0x58,0x3e,0x6b,0x99},{  0xb9,0x71,0xdd,0x27}, 
+{ 0xe1,0x4f,0xb6,0xbe},{  0x88,0xad,0x17,0xf0},{  0x20,0xac,0x66,0xc9},{  0xce,0x3a,0xb4,0x7d}, 
+{ 0xdf,0x4a,0x18,0x63},{  0x1a,0x31,0x82,0xe5},{  0x51,0x33,0x60,0x97},{  0x53,0x7f,0x45,0x62}, 
+{ 0x64,0x77,0xe0,0xb1},{  0x6b,0xae,0x84,0xbb},{  0x81,0xa0,0x1c,0xfe},{  0x08,0x2b,0x94,0xf9}, 
+{ 0x48,0x68,0x58,0x70},{  0x45,0xfd,0x19,0x8f},{  0xde,0x6c,0x87,0x94},{  0x7b,0xf8,0xb7,0x52}, 
+{ 0x73,0xd3,0x23,0xab},{  0x4b,0x02,0xe2,0x72},{  0x1f,0x8f,0x57,0xe3},{  0x55,0xab,0x2a,0x66}, 
+{ 0xeb,0x28,0x07,0xb2},{  0xb5,0xc2,0x03,0x2f},{  0xc5,0x7b,0x9a,0x86},{  0x37,0x08,0xa5,0xd3}, 
+{ 0x28,0x87,0xf2,0x30},{  0xbf,0xa5,0xb2,0x23},{  0x03,0x6a,0xba,0x02},{  0x16,0x82,0x5c,0xed}, 
+{ 0xcf,0x1c,0x2b,0x8a},{  0x79,0xb4,0x92,0xa7},{  0x07,0xf2,0xf0,0xf3},{  0x69,0xe2,0xa1,0x4e}, 
+{ 0xda,0xf4,0xcd,0x65},{  0x05,0xbe,0xd5,0x06},{  0x34,0x62,0x1f,0xd1},{  0xa6,0xfe,0x8a,0xc4}, 
+{ 0x2e,0x53,0x9d,0x34},{  0xf3,0x55,0xa0,0xa2},{  0x8a,0xe1,0x32,0x05},{  0xf6,0xeb,0x75,0xa4}, 
+{ 0x83,0xec,0x39,0x0b},{  0x60,0xef,0xaa,0x40},{  0x71,0x9f,0x06,0x5e},{  0x6e,0x10,0x51,0xbd}, 
+{ 0x21,0x8a,0xf9,0x3e},{  0xdd,0x06,0x3d,0x96},{  0x3e,0x05,0xae,0xdd},{  0xe6,0xbd,0x46,0x4d}, 
+{ 0x54,0x8d,0xb5,0x91},{  0xc4,0x5d,0x05,0x71},{  0x06,0xd4,0x6f,0x04},{  0x50,0x15,0xff,0x60}, 
+{ 0x98,0xfb,0x24,0x19},{  0xbd,0xe9,0x97,0xd6},{  0x40,0x43,0xcc,0x89},{  0xd9,0x9e,0x77,0x67}, 
+{ 0xe8,0x42,0xbd,0xb0},{  0x89,0x8b,0x88,0x07},{  0x19,0x5b,0x38,0xe7},{  0xc8,0xee,0xdb,0x79}, 
+{ 0x7c,0x0a,0x47,0xa1},{  0x42,0x0f,0xe9,0x7c},{  0x84,0x1e,0xc9,0xf8},{  0x00,0x00,0x00,0x00}, 
+{ 0x80,0x86,0x83,0x09},{  0x2b,0xed,0x48,0x32},{  0x11,0x70,0xac,0x1e},{  0x5a,0x72,0x4e,0x6c}, 
+{ 0x0e,0xff,0xfb,0xfd},{  0x85,0x38,0x56,0x0f},{  0xae,0xd5,0x1e,0x3d},{  0x2d,0x39,0x27,0x36}, 
+{ 0x0f,0xd9,0x64,0x0a},{  0x5c,0xa6,0x21,0x68},{  0x5b,0x54,0xd1,0x9b},{  0x36,0x2e,0x3a,0x24}, 
+{ 0x0a,0x67,0xb1,0x0c},{  0x57,0xe7,0x0f,0x93},{  0xee,0x96,0xd2,0xb4},{  0x9b,0x91,0x9e,0x1b}, 
+{ 0xc0,0xc5,0x4f,0x80},{  0xdc,0x20,0xa2,0x61},{  0x77,0x4b,0x69,0x5a},{  0x12,0x1a,0x16,0x1c}, 
+{ 0x93,0xba,0x0a,0xe2},{  0xa0,0x2a,0xe5,0xc0},{  0x22,0xe0,0x43,0x3c},{  0x1b,0x17,0x1d,0x12}, 
+{ 0x09,0x0d,0x0b,0x0e},{  0x8b,0xc7,0xad,0xf2},{  0xb6,0xa8,0xb9,0x2d},{  0x1e,0xa9,0xc8,0x14}, 
+{ 0xf1,0x19,0x85,0x57},{  0x75,0x07,0x4c,0xaf},{  0x99,0xdd,0xbb,0xee},{  0x7f,0x60,0xfd,0xa3}, 
+{ 0x01,0x26,0x9f,0xf7},{  0x72,0xf5,0xbc,0x5c},{  0x66,0x3b,0xc5,0x44},{  0xfb,0x7e,0x34,0x5b}, 
+{ 0x43,0x29,0x76,0x8b},{  0x23,0xc6,0xdc,0xcb},{  0xed,0xfc,0x68,0xb6},{  0xe4,0xf1,0x63,0xb8}, 
+{ 0x31,0xdc,0xca,0xd7},{  0x63,0x85,0x10,0x42},{  0x97,0x22,0x40,0x13},{  0xc6,0x11,0x20,0x84}, 
+{ 0x4a,0x24,0x7d,0x85},{  0xbb,0x3d,0xf8,0xd2},{  0xf9,0x32,0x11,0xae},{  0x29,0xa1,0x6d,0xc7}, 
+{ 0x9e,0x2f,0x4b,0x1d},{  0xb2,0x30,0xf3,0xdc},{  0x86,0x52,0xec,0x0d},{  0xc1,0xe3,0xd0,0x77}, 
+{ 0xb3,0x16,0x6c,0x2b},{  0x70,0xb9,0x99,0xa9},{  0x94,0x48,0xfa,0x11},{  0xe9,0x64,0x22,0x47}, 
+{ 0xfc,0x8c,0xc4,0xa8},{  0xf0,0x3f,0x1a,0xa0},{  0x7d,0x2c,0xd8,0x56},{  0x33,0x90,0xef,0x22}, 
+{ 0x49,0x4e,0xc7,0x87},{  0x38,0xd1,0xc1,0xd9},{  0xca,0xa2,0xfe,0x8c},{  0xd4,0x0b,0x36,0x98}, 
+{ 0xf5,0x81,0xcf,0xa6},{  0x7a,0xde,0x28,0xa5},{  0xb7,0x8e,0x26,0xda},{  0xad,0xbf,0xa4,0x3f}, 
+{ 0x3a,0x9d,0xe4,0x2c},{  0x78,0x92,0x0d,0x50},{  0x5f,0xcc,0x9b,0x6a},{  0x7e,0x46,0x62,0x54}, 
+{ 0x8d,0x13,0xc2,0xf6},{  0xd8,0xb8,0xe8,0x90},{  0x39,0xf7,0x5e,0x2e},{  0xc3,0xaf,0xf5,0x82}, 
+{ 0x5d,0x80,0xbe,0x9f},{  0xd0,0x93,0x7c,0x69},{  0xd5,0x2d,0xa9,0x6f},{  0x25,0x12,0xb3,0xcf}, 
+{ 0xac,0x99,0x3b,0xc8},{  0x18,0x7d,0xa7,0x10},{  0x9c,0x63,0x6e,0xe8},{  0x3b,0xbb,0x7b,0xdb}, 
+{ 0x26,0x78,0x09,0xcd},{  0x59,0x18,0xf4,0x6e},{  0x9a,0xb7,0x01,0xec},{  0x4f,0x9a,0xa8,0x83}, 
+{ 0x95,0x6e,0x65,0xe6},{  0xff,0xe6,0x7e,0xaa},{  0xbc,0xcf,0x08,0x21},{  0x15,0xe8,0xe6,0xef}, 
+{ 0xe7,0x9b,0xd9,0xba},{  0x6f,0x36,0xce,0x4a},{  0x9f,0x09,0xd4,0xea},{  0xb0,0x7c,0xd6,0x29}, 
+{ 0xa4,0xb2,0xaf,0x31},{  0x3f,0x23,0x31,0x2a},{  0xa5,0x94,0x30,0xc6},{  0xa2,0x66,0xc0,0x35}, 
+{ 0x4e,0xbc,0x37,0x74},{  0x82,0xca,0xa6,0xfc},{  0x90,0xd0,0xb0,0xe0},{  0xa7,0xd8,0x15,0x33}, 
+{ 0x04,0x98,0x4a,0xf1},{  0xec,0xda,0xf7,0x41},{  0xcd,0x50,0x0e,0x7f},{  0x91,0xf6,0x2f,0x17}, 
+{ 0x4d,0xd6,0x8d,0x76},{  0xef,0xb0,0x4d,0x43},{  0xaa,0x4d,0x54,0xcc},{  0x96,0x04,0xdf,0xe4}, 
+{ 0xd1,0xb5,0xe3,0x9e},{  0x6a,0x88,0x1b,0x4c},{  0x2c,0x1f,0xb8,0xc1},{  0x65,0x51,0x7f,0x46}, 
+{ 0x5e,0xea,0x04,0x9d},{  0x8c,0x35,0x5d,0x01},{  0x87,0x74,0x73,0xfa},{  0x0b,0x41,0x2e,0xfb}, 
+{ 0x67,0x1d,0x5a,0xb3},{  0xdb,0xd2,0x52,0x92},{  0x10,0x56,0x33,0xe9},{  0xd6,0x47,0x13,0x6d}, 
+{ 0xd7,0x61,0x8c,0x9a},{  0xa1,0x0c,0x7a,0x37},{  0xf8,0x14,0x8e,0x59},{  0x13,0x3c,0x89,0xeb}, 
+{ 0xa9,0x27,0xee,0xce},{  0x61,0xc9,0x35,0xb7},{  0x1c,0xe5,0xed,0xe1},{  0x47,0xb1,0x3c,0x7a}, 
+{ 0xd2,0xdf,0x59,0x9c},{  0xf2,0x73,0x3f,0x55},{  0x14,0xce,0x79,0x18},{  0xc7,0x37,0xbf,0x73}, 
+{ 0xf7,0xcd,0xea,0x53},{  0xfd,0xaa,0x5b,0x5f},{  0x3d,0x6f,0x14,0xdf},{  0x44,0xdb,0x86,0x78}, 
+{ 0xaf,0xf3,0x81,0xca},{  0x68,0xc4,0x3e,0xb9},{  0x24,0x34,0x2c,0x38},{  0xa3,0x40,0x5f,0xc2}, 
+{ 0x1d,0xc3,0x72,0x16},{  0xe2,0x25,0x0c,0xbc},{  0x3c,0x49,0x8b,0x28},{  0x0d,0x95,0x41,0xff}, 
+{ 0xa8,0x01,0x71,0x39},{  0x0c,0xb3,0xde,0x08},{  0xb4,0xe4,0x9c,0xd8},{  0x56,0xc1,0x90,0x64}, 
+{ 0xcb,0x84,0x61,0x7b},{  0x32,0xb6,0x70,0xd5},{  0x6c,0x5c,0x74,0x48},{  0xb8,0x57,0x42,0xd0 } 
+};
+
+word8 S5[256] = {
+0x52,0x09,0x6a,0xd5,
+0x30,0x36,0xa5,0x38,
+0xbf,0x40,0xa3,0x9e,
+0x81,0xf3,0xd7,0xfb,
+0x7c,0xe3,0x39,0x82,
+0x9b,0x2f,0xff,0x87,
+0x34,0x8e,0x43,0x44,
+0xc4,0xde,0xe9,0xcb,
+0x54,0x7b,0x94,0x32,
+0xa6,0xc2,0x23,0x3d,
+0xee,0x4c,0x95,0x0b,
+0x42,0xfa,0xc3,0x4e,
+0x08,0x2e,0xa1,0x66,
+0x28,0xd9,0x24,0xb2,
+0x76,0x5b,0xa2,0x49,
+0x6d,0x8b,0xd1,0x25,
+0x72,0xf8,0xf6,0x64,
+0x86,0x68,0x98,0x16,
+0xd4,0xa4,0x5c,0xcc,
+0x5d,0x65,0xb6,0x92,
+0x6c,0x70,0x48,0x50,
+0xfd,0xed,0xb9,0xda,
+0x5e,0x15,0x46,0x57,
+0xa7,0x8d,0x9d,0x84,
+0x90,0xd8,0xab,0x00,
+0x8c,0xbc,0xd3,0x0a,
+0xf7,0xe4,0x58,0x05,
+0xb8,0xb3,0x45,0x06,
+0xd0,0x2c,0x1e,0x8f,
+0xca,0x3f,0x0f,0x02,
+0xc1,0xaf,0xbd,0x03,
+0x01,0x13,0x8a,0x6b,
+0x3a,0x91,0x11,0x41,
+0x4f,0x67,0xdc,0xea,
+0x97,0xf2,0xcf,0xce,
+0xf0,0xb4,0xe6,0x73,
+0x96,0xac,0x74,0x22,
+0xe7,0xad,0x35,0x85,
+0xe2,0xf9,0x37,0xe8,
+0x1c,0x75,0xdf,0x6e,
+0x47,0xf1,0x1a,0x71,
+0x1d,0x29,0xc5,0x89,
+0x6f,0xb7,0x62,0x0e,
+0xaa,0x18,0xbe,0x1b,
+0xfc,0x56,0x3e,0x4b,
+0xc6,0xd2,0x79,0x20,
+0x9a,0xdb,0xc0,0xfe,
+0x78,0xcd,0x5a,0xf4,
+0x1f,0xdd,0xa8,0x33,
+0x88,0x07,0xc7,0x31,
+0xb1,0x12,0x10,0x59,
+0x27,0x80,0xec,0x5f,
+0x60,0x51,0x7f,0xa9,
+0x19,0xb5,0x4a,0x0d,
+0x2d,0xe5,0x7a,0x9f,
+0x93,0xc9,0x9c,0xef,
+0xa0,0xe0,0x3b,0x4d,
+0xae,0x2a,0xf5,0xb0,
+0xc8,0xeb,0xbb,0x3c,
+0x83,0x53,0x99,0x61,
+0x17,0x2b,0x04,0x7e,
+0xba,0x77,0xd6,0x26,
+0xe1,0x69,0x14,0x63,
+0x55,0x21,0x0c,0x7d
+};
+
+word8 U1[256][4] = {
+{ 0x00,0x00,0x00,0x00},{  0x0e,0x09,0x0d,0x0b},{  0x1c,0x12,0x1a,0x16},{  0x12,0x1b,0x17,0x1d}, 
+{ 0x38,0x24,0x34,0x2c},{  0x36,0x2d,0x39,0x27},{  0x24,0x36,0x2e,0x3a},{  0x2a,0x3f,0x23,0x31}, 
+{ 0x70,0x48,0x68,0x58},{  0x7e,0x41,0x65,0x53},{  0x6c,0x5a,0x72,0x4e},{  0x62,0x53,0x7f,0x45}, 
+{ 0x48,0x6c,0x5c,0x74},{  0x46,0x65,0x51,0x7f},{  0x54,0x7e,0x46,0x62},{  0x5a,0x77,0x4b,0x69}, 
+{ 0xe0,0x90,0xd0,0xb0},{  0xee,0x99,0xdd,0xbb},{  0xfc,0x82,0xca,0xa6},{  0xf2,0x8b,0xc7,0xad}, 
+{ 0xd8,0xb4,0xe4,0x9c},{  0xd6,0xbd,0xe9,0x97},{  0xc4,0xa6,0xfe,0x8a},{  0xca,0xaf,0xf3,0x81}, 
+{ 0x90,0xd8,0xb8,0xe8},{  0x9e,0xd1,0xb5,0xe3},{  0x8c,0xca,0xa2,0xfe},{  0x82,0xc3,0xaf,0xf5}, 
+{ 0xa8,0xfc,0x8c,0xc4},{  0xa6,0xf5,0x81,0xcf},{  0xb4,0xee,0x96,0xd2},{  0xba,0xe7,0x9b,0xd9}, 
+{ 0xdb,0x3b,0xbb,0x7b},{  0xd5,0x32,0xb6,0x70},{  0xc7,0x29,0xa1,0x6d},{  0xc9,0x20,0xac,0x66}, 
+{ 0xe3,0x1f,0x8f,0x57},{  0xed,0x16,0x82,0x5c},{  0xff,0x0d,0x95,0x41},{  0xf1,0x04,0x98,0x4a}, 
+{ 0xab,0x73,0xd3,0x23},{  0xa5,0x7a,0xde,0x28},{  0xb7,0x61,0xc9,0x35},{  0xb9,0x68,0xc4,0x3e}, 
+{ 0x93,0x57,0xe7,0x0f},{  0x9d,0x5e,0xea,0x04},{  0x8f,0x45,0xfd,0x19},{  0x81,0x4c,0xf0,0x12}, 
+{ 0x3b,0xab,0x6b,0xcb},{  0x35,0xa2,0x66,0xc0},{  0x27,0xb9,0x71,0xdd},{  0x29,0xb0,0x7c,0xd6}, 
+{ 0x03,0x8f,0x5f,0xe7},{  0x0d,0x86,0x52,0xec},{  0x1f,0x9d,0x45,0xf1},{  0x11,0x94,0x48,0xfa}, 
+{ 0x4b,0xe3,0x03,0x93},{  0x45,0xea,0x0e,0x98},{  0x57,0xf1,0x19,0x85},{  0x59,0xf8,0x14,0x8e}, 
+{ 0x73,0xc7,0x37,0xbf},{  0x7d,0xce,0x3a,0xb4},{  0x6f,0xd5,0x2d,0xa9},{  0x61,0xdc,0x20,0xa2}, 
+{ 0xad,0x76,0x6d,0xf6},{  0xa3,0x7f,0x60,0xfd},{  0xb1,0x64,0x77,0xe0},{  0xbf,0x6d,0x7a,0xeb}, 
+{ 0x95,0x52,0x59,0xda},{  0x9b,0x5b,0x54,0xd1},{  0x89,0x40,0x43,0xcc},{  0x87,0x49,0x4e,0xc7}, 
+{ 0xdd,0x3e,0x05,0xae},{  0xd3,0x37,0x08,0xa5},{  0xc1,0x2c,0x1f,0xb8},{  0xcf,0x25,0x12,0xb3}, 
+{ 0xe5,0x1a,0x31,0x82},{  0xeb,0x13,0x3c,0x89},{  0xf9,0x08,0x2b,0x94},{  0xf7,0x01,0x26,0x9f}, 
+{ 0x4d,0xe6,0xbd,0x46},{  0x43,0xef,0xb0,0x4d},{  0x51,0xf4,0xa7,0x50},{  0x5f,0xfd,0xaa,0x5b}, 
+{ 0x75,0xc2,0x89,0x6a},{  0x7b,0xcb,0x84,0x61},{  0x69,0xd0,0x93,0x7c},{  0x67,0xd9,0x9e,0x77}, 
+{ 0x3d,0xae,0xd5,0x1e},{  0x33,0xa7,0xd8,0x15},{  0x21,0xbc,0xcf,0x08},{  0x2f,0xb5,0xc2,0x03}, 
+{ 0x05,0x8a,0xe1,0x32},{  0x0b,0x83,0xec,0x39},{  0x19,0x98,0xfb,0x24},{  0x17,0x91,0xf6,0x2f}, 
+{ 0x76,0x4d,0xd6,0x8d},{  0x78,0x44,0xdb,0x86},{  0x6a,0x5f,0xcc,0x9b},{  0x64,0x56,0xc1,0x90}, 
+{ 0x4e,0x69,0xe2,0xa1},{  0x40,0x60,0xef,0xaa},{  0x52,0x7b,0xf8,0xb7},{  0x5c,0x72,0xf5,0xbc}, 
+{ 0x06,0x05,0xbe,0xd5},{  0x08,0x0c,0xb3,0xde},{  0x1a,0x17,0xa4,0xc3},{  0x14,0x1e,0xa9,0xc8}, 
+{ 0x3e,0x21,0x8a,0xf9},{  0x30,0x28,0x87,0xf2},{  0x22,0x33,0x90,0xef},{  0x2c,0x3a,0x9d,0xe4}, 
+{ 0x96,0xdd,0x06,0x3d},{  0x98,0xd4,0x0b,0x36},{  0x8a,0xcf,0x1c,0x2b},{  0x84,0xc6,0x11,0x20}, 
+{ 0xae,0xf9,0x32,0x11},{  0xa0,0xf0,0x3f,0x1a},{  0xb2,0xeb,0x28,0x07},{  0xbc,0xe2,0x25,0x0c}, 
+{ 0xe6,0x95,0x6e,0x65},{  0xe8,0x9c,0x63,0x6e},{  0xfa,0x87,0x74,0x73},{  0xf4,0x8e,0x79,0x78}, 
+{ 0xde,0xb1,0x5a,0x49},{  0xd0,0xb8,0x57,0x42},{  0xc2,0xa3,0x40,0x5f},{  0xcc,0xaa,0x4d,0x54}, 
+{ 0x41,0xec,0xda,0xf7},{  0x4f,0xe5,0xd7,0xfc},{  0x5d,0xfe,0xc0,0xe1},{  0x53,0xf7,0xcd,0xea}, 
+{ 0x79,0xc8,0xee,0xdb},{  0x77,0xc1,0xe3,0xd0},{  0x65,0xda,0xf4,0xcd},{  0x6b,0xd3,0xf9,0xc6}, 
+{ 0x31,0xa4,0xb2,0xaf},{  0x3f,0xad,0xbf,0xa4},{  0x2d,0xb6,0xa8,0xb9},{  0x23,0xbf,0xa5,0xb2}, 
+{ 0x09,0x80,0x86,0x83},{  0x07,0x89,0x8b,0x88},{  0x15,0x92,0x9c,0x95},{  0x1b,0x9b,0x91,0x9e}, 
+{ 0xa1,0x7c,0x0a,0x47},{  0xaf,0x75,0x07,0x4c},{  0xbd,0x6e,0x10,0x51},{  0xb3,0x67,0x1d,0x5a}, 
+{ 0x99,0x58,0x3e,0x6b},{  0x97,0x51,0x33,0x60},{  0x85,0x4a,0x24,0x7d},{  0x8b,0x43,0x29,0x76}, 
+{ 0xd1,0x34,0x62,0x1f},{  0xdf,0x3d,0x6f,0x14},{  0xcd,0x26,0x78,0x09},{  0xc3,0x2f,0x75,0x02}, 
+{ 0xe9,0x10,0x56,0x33},{  0xe7,0x19,0x5b,0x38},{  0xf5,0x02,0x4c,0x25},{  0xfb,0x0b,0x41,0x2e}, 
+{ 0x9a,0xd7,0x61,0x8c},{  0x94,0xde,0x6c,0x87},{  0x86,0xc5,0x7b,0x9a},{  0x88,0xcc,0x76,0x91}, 
+{ 0xa2,0xf3,0x55,0xa0},{  0xac,0xfa,0x58,0xab},{  0xbe,0xe1,0x4f,0xb6},{  0xb0,0xe8,0x42,0xbd}, 
+{ 0xea,0x9f,0x09,0xd4},{  0xe4,0x96,0x04,0xdf},{  0xf6,0x8d,0x13,0xc2},{  0xf8,0x84,0x1e,0xc9}, 
+{ 0xd2,0xbb,0x3d,0xf8},{  0xdc,0xb2,0x30,0xf3},{  0xce,0xa9,0x27,0xee},{  0xc0,0xa0,0x2a,0xe5}, 
+{ 0x7a,0x47,0xb1,0x3c},{  0x74,0x4e,0xbc,0x37},{  0x66,0x55,0xab,0x2a},{  0x68,0x5c,0xa6,0x21}, 
+{ 0x42,0x63,0x85,0x10},{  0x4c,0x6a,0x88,0x1b},{  0x5e,0x71,0x9f,0x06},{  0x50,0x78,0x92,0x0d}, 
+{ 0x0a,0x0f,0xd9,0x64},{  0x04,0x06,0xd4,0x6f},{  0x16,0x1d,0xc3,0x72},{  0x18,0x14,0xce,0x79}, 
+{ 0x32,0x2b,0xed,0x48},{  0x3c,0x22,0xe0,0x43},{  0x2e,0x39,0xf7,0x5e},{  0x20,0x30,0xfa,0x55}, 
+{ 0xec,0x9a,0xb7,0x01},{  0xe2,0x93,0xba,0x0a},{  0xf0,0x88,0xad,0x17},{  0xfe,0x81,0xa0,0x1c}, 
+{ 0xd4,0xbe,0x83,0x2d},{  0xda,0xb7,0x8e,0x26},{  0xc8,0xac,0x99,0x3b},{  0xc6,0xa5,0x94,0x30}, 
+{ 0x9c,0xd2,0xdf,0x59},{  0x92,0xdb,0xd2,0x52},{  0x80,0xc0,0xc5,0x4f},{  0x8e,0xc9,0xc8,0x44}, 
+{ 0xa4,0xf6,0xeb,0x75},{  0xaa,0xff,0xe6,0x7e},{  0xb8,0xe4,0xf1,0x63},{  0xb6,0xed,0xfc,0x68}, 
+{ 0x0c,0x0a,0x67,0xb1},{  0x02,0x03,0x6a,0xba},{  0x10,0x18,0x7d,0xa7},{  0x1e,0x11,0x70,0xac}, 
+{ 0x34,0x2e,0x53,0x9d},{  0x3a,0x27,0x5e,0x96},{  0x28,0x3c,0x49,0x8b},{  0x26,0x35,0x44,0x80}, 
+{ 0x7c,0x42,0x0f,0xe9},{  0x72,0x4b,0x02,0xe2},{  0x60,0x50,0x15,0xff},{  0x6e,0x59,0x18,0xf4}, 
+{ 0x44,0x66,0x3b,0xc5},{  0x4a,0x6f,0x36,0xce},{  0x58,0x74,0x21,0xd3},{  0x56,0x7d,0x2c,0xd8}, 
+{ 0x37,0xa1,0x0c,0x7a},{  0x39,0xa8,0x01,0x71},{  0x2b,0xb3,0x16,0x6c},{  0x25,0xba,0x1b,0x67}, 
+{ 0x0f,0x85,0x38,0x56},{  0x01,0x8c,0x35,0x5d},{  0x13,0x97,0x22,0x40},{  0x1d,0x9e,0x2f,0x4b}, 
+{ 0x47,0xe9,0x64,0x22},{  0x49,0xe0,0x69,0x29},{  0x5b,0xfb,0x7e,0x34},{  0x55,0xf2,0x73,0x3f}, 
+{ 0x7f,0xcd,0x50,0x0e},{  0x71,0xc4,0x5d,0x05},{  0x63,0xdf,0x4a,0x18},{  0x6d,0xd6,0x47,0x13}, 
+{ 0xd7,0x31,0xdc,0xca},{  0xd9,0x38,0xd1,0xc1},{  0xcb,0x23,0xc6,0xdc},{  0xc5,0x2a,0xcb,0xd7}, 
+{ 0xef,0x15,0xe8,0xe6},{  0xe1,0x1c,0xe5,0xed},{  0xf3,0x07,0xf2,0xf0},{  0xfd,0x0e,0xff,0xfb}, 
+{ 0xa7,0x79,0xb4,0x92},{  0xa9,0x70,0xb9,0x99},{  0xbb,0x6b,0xae,0x84},{  0xb5,0x62,0xa3,0x8f}, 
+{ 0x9f,0x5d,0x80,0xbe},{  0x91,0x54,0x8d,0xb5},{  0x83,0x4f,0x9a,0xa8},{  0x8d,0x46,0x97,0xa3 } 
+};
+
+word8 U2[256][4] = {
+{ 0x00,0x00,0x00,0x00},{  0x0b,0x0e,0x09,0x0d},{  0x16,0x1c,0x12,0x1a},{  0x1d,0x12,0x1b,0x17}, 
+{ 0x2c,0x38,0x24,0x34},{  0x27,0x36,0x2d,0x39},{  0x3a,0x24,0x36,0x2e},{  0x31,0x2a,0x3f,0x23}, 
+{ 0x58,0x70,0x48,0x68},{  0x53,0x7e,0x41,0x65},{  0x4e,0x6c,0x5a,0x72},{  0x45,0x62,0x53,0x7f}, 
+{ 0x74,0x48,0x6c,0x5c},{  0x7f,0x46,0x65,0x51},{  0x62,0x54,0x7e,0x46},{  0x69,0x5a,0x77,0x4b}, 
+{ 0xb0,0xe0,0x90,0xd0},{  0xbb,0xee,0x99,0xdd},{  0xa6,0xfc,0x82,0xca},{  0xad,0xf2,0x8b,0xc7}, 
+{ 0x9c,0xd8,0xb4,0xe4},{  0x97,0xd6,0xbd,0xe9},{  0x8a,0xc4,0xa6,0xfe},{  0x81,0xca,0xaf,0xf3}, 
+{ 0xe8,0x90,0xd8,0xb8},{  0xe3,0x9e,0xd1,0xb5},{  0xfe,0x8c,0xca,0xa2},{  0xf5,0x82,0xc3,0xaf}, 
+{ 0xc4,0xa8,0xfc,0x8c},{  0xcf,0xa6,0xf5,0x81},{  0xd2,0xb4,0xee,0x96},{  0xd9,0xba,0xe7,0x9b}, 
+{ 0x7b,0xdb,0x3b,0xbb},{  0x70,0xd5,0x32,0xb6},{  0x6d,0xc7,0x29,0xa1},{  0x66,0xc9,0x20,0xac}, 
+{ 0x57,0xe3,0x1f,0x8f},{  0x5c,0xed,0x16,0x82},{  0x41,0xff,0x0d,0x95},{  0x4a,0xf1,0x04,0x98}, 
+{ 0x23,0xab,0x73,0xd3},{  0x28,0xa5,0x7a,0xde},{  0x35,0xb7,0x61,0xc9},{  0x3e,0xb9,0x68,0xc4}, 
+{ 0x0f,0x93,0x57,0xe7},{  0x04,0x9d,0x5e,0xea},{  0x19,0x8f,0x45,0xfd},{  0x12,0x81,0x4c,0xf0}, 
+{ 0xcb,0x3b,0xab,0x6b},{  0xc0,0x35,0xa2,0x66},{  0xdd,0x27,0xb9,0x71},{  0xd6,0x29,0xb0,0x7c}, 
+{ 0xe7,0x03,0x8f,0x5f},{  0xec,0x0d,0x86,0x52},{  0xf1,0x1f,0x9d,0x45},{  0xfa,0x11,0x94,0x48}, 
+{ 0x93,0x4b,0xe3,0x03},{  0x98,0x45,0xea,0x0e},{  0x85,0x57,0xf1,0x19},{  0x8e,0x59,0xf8,0x14}, 
+{ 0xbf,0x73,0xc7,0x37},{  0xb4,0x7d,0xce,0x3a},{  0xa9,0x6f,0xd5,0x2d},{  0xa2,0x61,0xdc,0x20}, 
+{ 0xf6,0xad,0x76,0x6d},{  0xfd,0xa3,0x7f,0x60},{  0xe0,0xb1,0x64,0x77},{  0xeb,0xbf,0x6d,0x7a}, 
+{ 0xda,0x95,0x52,0x59},{  0xd1,0x9b,0x5b,0x54},{  0xcc,0x89,0x40,0x43},{  0xc7,0x87,0x49,0x4e}, 
+{ 0xae,0xdd,0x3e,0x05},{  0xa5,0xd3,0x37,0x08},{  0xb8,0xc1,0x2c,0x1f},{  0xb3,0xcf,0x25,0x12}, 
+{ 0x82,0xe5,0x1a,0x31},{  0x89,0xeb,0x13,0x3c},{  0x94,0xf9,0x08,0x2b},{  0x9f,0xf7,0x01,0x26}, 
+{ 0x46,0x4d,0xe6,0xbd},{  0x4d,0x43,0xef,0xb0},{  0x50,0x51,0xf4,0xa7},{  0x5b,0x5f,0xfd,0xaa}, 
+{ 0x6a,0x75,0xc2,0x89},{  0x61,0x7b,0xcb,0x84},{  0x7c,0x69,0xd0,0x93},{  0x77,0x67,0xd9,0x9e}, 
+{ 0x1e,0x3d,0xae,0xd5},{  0x15,0x33,0xa7,0xd8},{  0x08,0x21,0xbc,0xcf},{  0x03,0x2f,0xb5,0xc2}, 
+{ 0x32,0x05,0x8a,0xe1},{  0x39,0x0b,0x83,0xec},{  0x24,0x19,0x98,0xfb},{  0x2f,0x17,0x91,0xf6}, 
+{ 0x8d,0x76,0x4d,0xd6},{  0x86,0x78,0x44,0xdb},{  0x9b,0x6a,0x5f,0xcc},{  0x90,0x64,0x56,0xc1}, 
+{ 0xa1,0x4e,0x69,0xe2},{  0xaa,0x40,0x60,0xef},{  0xb7,0x52,0x7b,0xf8},{  0xbc,0x5c,0x72,0xf5}, 
+{ 0xd5,0x06,0x05,0xbe},{  0xde,0x08,0x0c,0xb3},{  0xc3,0x1a,0x17,0xa4},{  0xc8,0x14,0x1e,0xa9}, 
+{ 0xf9,0x3e,0x21,0x8a},{  0xf2,0x30,0x28,0x87},{  0xef,0x22,0x33,0x90},{  0xe4,0x2c,0x3a,0x9d}, 
+{ 0x3d,0x96,0xdd,0x06},{  0x36,0x98,0xd4,0x0b},{  0x2b,0x8a,0xcf,0x1c},{  0x20,0x84,0xc6,0x11}, 
+{ 0x11,0xae,0xf9,0x32},{  0x1a,0xa0,0xf0,0x3f},{  0x07,0xb2,0xeb,0x28},{  0x0c,0xbc,0xe2,0x25}, 
+{ 0x65,0xe6,0x95,0x6e},{  0x6e,0xe8,0x9c,0x63},{  0x73,0xfa,0x87,0x74},{  0x78,0xf4,0x8e,0x79}, 
+{ 0x49,0xde,0xb1,0x5a},{  0x42,0xd0,0xb8,0x57},{  0x5f,0xc2,0xa3,0x40},{  0x54,0xcc,0xaa,0x4d}, 
+{ 0xf7,0x41,0xec,0xda},{  0xfc,0x4f,0xe5,0xd7},{  0xe1,0x5d,0xfe,0xc0},{  0xea,0x53,0xf7,0xcd}, 
+{ 0xdb,0x79,0xc8,0xee},{  0xd0,0x77,0xc1,0xe3},{  0xcd,0x65,0xda,0xf4},{  0xc6,0x6b,0xd3,0xf9}, 
+{ 0xaf,0x31,0xa4,0xb2},{  0xa4,0x3f,0xad,0xbf},{  0xb9,0x2d,0xb6,0xa8},{  0xb2,0x23,0xbf,0xa5}, 
+{ 0x83,0x09,0x80,0x86},{  0x88,0x07,0x89,0x8b},{  0x95,0x15,0x92,0x9c},{  0x9e,0x1b,0x9b,0x91}, 
+{ 0x47,0xa1,0x7c,0x0a},{  0x4c,0xaf,0x75,0x07},{  0x51,0xbd,0x6e,0x10},{  0x5a,0xb3,0x67,0x1d}, 
+{ 0x6b,0x99,0x58,0x3e},{  0x60,0x97,0x51,0x33},{  0x7d,0x85,0x4a,0x24},{  0x76,0x8b,0x43,0x29}, 
+{ 0x1f,0xd1,0x34,0x62},{  0x14,0xdf,0x3d,0x6f},{  0x09,0xcd,0x26,0x78},{  0x02,0xc3,0x2f,0x75}, 
+{ 0x33,0xe9,0x10,0x56},{  0x38,0xe7,0x19,0x5b},{  0x25,0xf5,0x02,0x4c},{  0x2e,0xfb,0x0b,0x41}, 
+{ 0x8c,0x9a,0xd7,0x61},{  0x87,0x94,0xde,0x6c},{  0x9a,0x86,0xc5,0x7b},{  0x91,0x88,0xcc,0x76}, 
+{ 0xa0,0xa2,0xf3,0x55},{  0xab,0xac,0xfa,0x58},{  0xb6,0xbe,0xe1,0x4f},{  0xbd,0xb0,0xe8,0x42}, 
+{ 0xd4,0xea,0x9f,0x09},{  0xdf,0xe4,0x96,0x04},{  0xc2,0xf6,0x8d,0x13},{  0xc9,0xf8,0x84,0x1e}, 
+{ 0xf8,0xd2,0xbb,0x3d},{  0xf3,0xdc,0xb2,0x30},{  0xee,0xce,0xa9,0x27},{  0xe5,0xc0,0xa0,0x2a}, 
+{ 0x3c,0x7a,0x47,0xb1},{  0x37,0x74,0x4e,0xbc},{  0x2a,0x66,0x55,0xab},{  0x21,0x68,0x5c,0xa6}, 
+{ 0x10,0x42,0x63,0x85},{  0x1b,0x4c,0x6a,0x88},{  0x06,0x5e,0x71,0x9f},{  0x0d,0x50,0x78,0x92}, 
+{ 0x64,0x0a,0x0f,0xd9},{  0x6f,0x04,0x06,0xd4},{  0x72,0x16,0x1d,0xc3},{  0x79,0x18,0x14,0xce}, 
+{ 0x48,0x32,0x2b,0xed},{  0x43,0x3c,0x22,0xe0},{  0x5e,0x2e,0x39,0xf7},{  0x55,0x20,0x30,0xfa}, 
+{ 0x01,0xec,0x9a,0xb7},{  0x0a,0xe2,0x93,0xba},{  0x17,0xf0,0x88,0xad},{  0x1c,0xfe,0x81,0xa0}, 
+{ 0x2d,0xd4,0xbe,0x83},{  0x26,0xda,0xb7,0x8e},{  0x3b,0xc8,0xac,0x99},{  0x30,0xc6,0xa5,0x94}, 
+{ 0x59,0x9c,0xd2,0xdf},{  0x52,0x92,0xdb,0xd2},{  0x4f,0x80,0xc0,0xc5},{  0x44,0x8e,0xc9,0xc8}, 
+{ 0x75,0xa4,0xf6,0xeb},{  0x7e,0xaa,0xff,0xe6},{  0x63,0xb8,0xe4,0xf1},{  0x68,0xb6,0xed,0xfc}, 
+{ 0xb1,0x0c,0x0a,0x67},{  0xba,0x02,0x03,0x6a},{  0xa7,0x10,0x18,0x7d},{  0xac,0x1e,0x11,0x70}, 
+{ 0x9d,0x34,0x2e,0x53},{  0x96,0x3a,0x27,0x5e},{  0x8b,0x28,0x3c,0x49},{  0x80,0x26,0x35,0x44}, 
+{ 0xe9,0x7c,0x42,0x0f},{  0xe2,0x72,0x4b,0x02},{  0xff,0x60,0x50,0x15},{  0xf4,0x6e,0x59,0x18}, 
+{ 0xc5,0x44,0x66,0x3b},{  0xce,0x4a,0x6f,0x36},{  0xd3,0x58,0x74,0x21},{  0xd8,0x56,0x7d,0x2c}, 
+{ 0x7a,0x37,0xa1,0x0c},{  0x71,0x39,0xa8,0x01},{  0x6c,0x2b,0xb3,0x16},{  0x67,0x25,0xba,0x1b}, 
+{ 0x56,0x0f,0x85,0x38},{  0x5d,0x01,0x8c,0x35},{  0x40,0x13,0x97,0x22},{  0x4b,0x1d,0x9e,0x2f}, 
+{ 0x22,0x47,0xe9,0x64},{  0x29,0x49,0xe0,0x69},{  0x34,0x5b,0xfb,0x7e},{  0x3f,0x55,0xf2,0x73}, 
+{ 0x0e,0x7f,0xcd,0x50},{  0x05,0x71,0xc4,0x5d},{  0x18,0x63,0xdf,0x4a},{  0x13,0x6d,0xd6,0x47}, 
+{ 0xca,0xd7,0x31,0xdc},{  0xc1,0xd9,0x38,0xd1},{  0xdc,0xcb,0x23,0xc6},{  0xd7,0xc5,0x2a,0xcb}, 
+{ 0xe6,0xef,0x15,0xe8},{  0xed,0xe1,0x1c,0xe5},{  0xf0,0xf3,0x07,0xf2},{  0xfb,0xfd,0x0e,0xff}, 
+{ 0x92,0xa7,0x79,0xb4},{  0x99,0xa9,0x70,0xb9},{  0x84,0xbb,0x6b,0xae},{  0x8f,0xb5,0x62,0xa3}, 
+{ 0xbe,0x9f,0x5d,0x80},{  0xb5,0x91,0x54,0x8d},{  0xa8,0x83,0x4f,0x9a},{  0xa3,0x8d,0x46,0x97 } 
+};
+
+word8 U3[256][4] = {
+{ 0x00,0x00,0x00,0x00},{  0x0d,0x0b,0x0e,0x09},{  0x1a,0x16,0x1c,0x12},{  0x17,0x1d,0x12,0x1b}, 
+{ 0x34,0x2c,0x38,0x24},{  0x39,0x27,0x36,0x2d},{  0x2e,0x3a,0x24,0x36},{  0x23,0x31,0x2a,0x3f}, 
+{ 0x68,0x58,0x70,0x48},{  0x65,0x53,0x7e,0x41},{  0x72,0x4e,0x6c,0x5a},{  0x7f,0x45,0x62,0x53}, 
+{ 0x5c,0x74,0x48,0x6c},{  0x51,0x7f,0x46,0x65},{  0x46,0x62,0x54,0x7e},{  0x4b,0x69,0x5a,0x77}, 
+{ 0xd0,0xb0,0xe0,0x90},{  0xdd,0xbb,0xee,0x99},{  0xca,0xa6,0xfc,0x82},{  0xc7,0xad,0xf2,0x8b}, 
+{ 0xe4,0x9c,0xd8,0xb4},{  0xe9,0x97,0xd6,0xbd},{  0xfe,0x8a,0xc4,0xa6},{  0xf3,0x81,0xca,0xaf}, 
+{ 0xb8,0xe8,0x90,0xd8},{  0xb5,0xe3,0x9e,0xd1},{  0xa2,0xfe,0x8c,0xca},{  0xaf,0xf5,0x82,0xc3}, 
+{ 0x8c,0xc4,0xa8,0xfc},{  0x81,0xcf,0xa6,0xf5},{  0x96,0xd2,0xb4,0xee},{  0x9b,0xd9,0xba,0xe7}, 
+{ 0xbb,0x7b,0xdb,0x3b},{  0xb6,0x70,0xd5,0x32},{  0xa1,0x6d,0xc7,0x29},{  0xac,0x66,0xc9,0x20}, 
+{ 0x8f,0x57,0xe3,0x1f},{  0x82,0x5c,0xed,0x16},{  0x95,0x41,0xff,0x0d},{  0x98,0x4a,0xf1,0x04}, 
+{ 0xd3,0x23,0xab,0x73},{  0xde,0x28,0xa5,0x7a},{  0xc9,0x35,0xb7,0x61},{  0xc4,0x3e,0xb9,0x68}, 
+{ 0xe7,0x0f,0x93,0x57},{  0xea,0x04,0x9d,0x5e},{  0xfd,0x19,0x8f,0x45},{  0xf0,0x12,0x81,0x4c}, 
+{ 0x6b,0xcb,0x3b,0xab},{  0x66,0xc0,0x35,0xa2},{  0x71,0xdd,0x27,0xb9},{  0x7c,0xd6,0x29,0xb0}, 
+{ 0x5f,0xe7,0x03,0x8f},{  0x52,0xec,0x0d,0x86},{  0x45,0xf1,0x1f,0x9d},{  0x48,0xfa,0x11,0x94}, 
+{ 0x03,0x93,0x4b,0xe3},{  0x0e,0x98,0x45,0xea},{  0x19,0x85,0x57,0xf1},{  0x14,0x8e,0x59,0xf8}, 
+{ 0x37,0xbf,0x73,0xc7},{  0x3a,0xb4,0x7d,0xce},{  0x2d,0xa9,0x6f,0xd5},{  0x20,0xa2,0x61,0xdc}, 
+{ 0x6d,0xf6,0xad,0x76},{  0x60,0xfd,0xa3,0x7f},{  0x77,0xe0,0xb1,0x64},{  0x7a,0xeb,0xbf,0x6d}, 
+{ 0x59,0xda,0x95,0x52},{  0x54,0xd1,0x9b,0x5b},{  0x43,0xcc,0x89,0x40},{  0x4e,0xc7,0x87,0x49}, 
+{ 0x05,0xae,0xdd,0x3e},{  0x08,0xa5,0xd3,0x37},{  0x1f,0xb8,0xc1,0x2c},{  0x12,0xb3,0xcf,0x25}, 
+{ 0x31,0x82,0xe5,0x1a},{  0x3c,0x89,0xeb,0x13},{  0x2b,0x94,0xf9,0x08},{  0x26,0x9f,0xf7,0x01}, 
+{ 0xbd,0x46,0x4d,0xe6},{  0xb0,0x4d,0x43,0xef},{  0xa7,0x50,0x51,0xf4},{  0xaa,0x5b,0x5f,0xfd}, 
+{ 0x89,0x6a,0x75,0xc2},{  0x84,0x61,0x7b,0xcb},{  0x93,0x7c,0x69,0xd0},{  0x9e,0x77,0x67,0xd9}, 
+{ 0xd5,0x1e,0x3d,0xae},{  0xd8,0x15,0x33,0xa7},{  0xcf,0x08,0x21,0xbc},{  0xc2,0x03,0x2f,0xb5}, 
+{ 0xe1,0x32,0x05,0x8a},{  0xec,0x39,0x0b,0x83},{  0xfb,0x24,0x19,0x98},{  0xf6,0x2f,0x17,0x91}, 
+{ 0xd6,0x8d,0x76,0x4d},{  0xdb,0x86,0x78,0x44},{  0xcc,0x9b,0x6a,0x5f},{  0xc1,0x90,0x64,0x56}, 
+{ 0xe2,0xa1,0x4e,0x69},{  0xef,0xaa,0x40,0x60},{  0xf8,0xb7,0x52,0x7b},{  0xf5,0xbc,0x5c,0x72}, 
+{ 0xbe,0xd5,0x06,0x05},{  0xb3,0xde,0x08,0x0c},{  0xa4,0xc3,0x1a,0x17},{  0xa9,0xc8,0x14,0x1e}, 
+{ 0x8a,0xf9,0x3e,0x21},{  0x87,0xf2,0x30,0x28},{  0x90,0xef,0x22,0x33},{  0x9d,0xe4,0x2c,0x3a}, 
+{ 0x06,0x3d,0x96,0xdd},{  0x0b,0x36,0x98,0xd4},{  0x1c,0x2b,0x8a,0xcf},{  0x11,0x20,0x84,0xc6}, 
+{ 0x32,0x11,0xae,0xf9},{  0x3f,0x1a,0xa0,0xf0},{  0x28,0x07,0xb2,0xeb},{  0x25,0x0c,0xbc,0xe2}, 
+{ 0x6e,0x65,0xe6,0x95},{  0x63,0x6e,0xe8,0x9c},{  0x74,0x73,0xfa,0x87},{  0x79,0x78,0xf4,0x8e}, 
+{ 0x5a,0x49,0xde,0xb1},{  0x57,0x42,0xd0,0xb8},{  0x40,0x5f,0xc2,0xa3},{  0x4d,0x54,0xcc,0xaa}, 
+{ 0xda,0xf7,0x41,0xec},{  0xd7,0xfc,0x4f,0xe5},{  0xc0,0xe1,0x5d,0xfe},{  0xcd,0xea,0x53,0xf7}, 
+{ 0xee,0xdb,0x79,0xc8},{  0xe3,0xd0,0x77,0xc1},{  0xf4,0xcd,0x65,0xda},{  0xf9,0xc6,0x6b,0xd3}, 
+{ 0xb2,0xaf,0x31,0xa4},{  0xbf,0xa4,0x3f,0xad},{  0xa8,0xb9,0x2d,0xb6},{  0xa5,0xb2,0x23,0xbf}, 
+{ 0x86,0x83,0x09,0x80},{  0x8b,0x88,0x07,0x89},{  0x9c,0x95,0x15,0x92},{  0x91,0x9e,0x1b,0x9b}, 
+{ 0x0a,0x47,0xa1,0x7c},{  0x07,0x4c,0xaf,0x75},{  0x10,0x51,0xbd,0x6e},{  0x1d,0x5a,0xb3,0x67}, 
+{ 0x3e,0x6b,0x99,0x58},{  0x33,0x60,0x97,0x51},{  0x24,0x7d,0x85,0x4a},{  0x29,0x76,0x8b,0x43}, 
+{ 0x62,0x1f,0xd1,0x34},{  0x6f,0x14,0xdf,0x3d},{  0x78,0x09,0xcd,0x26},{  0x75,0x02,0xc3,0x2f}, 
+{ 0x56,0x33,0xe9,0x10},{  0x5b,0x38,0xe7,0x19},{  0x4c,0x25,0xf5,0x02},{  0x41,0x2e,0xfb,0x0b}, 
+{ 0x61,0x8c,0x9a,0xd7},{  0x6c,0x87,0x94,0xde},{  0x7b,0x9a,0x86,0xc5},{  0x76,0x91,0x88,0xcc}, 
+{ 0x55,0xa0,0xa2,0xf3},{  0x58,0xab,0xac,0xfa},{  0x4f,0xb6,0xbe,0xe1},{  0x42,0xbd,0xb0,0xe8}, 
+{ 0x09,0xd4,0xea,0x9f},{  0x04,0xdf,0xe4,0x96},{  0x13,0xc2,0xf6,0x8d},{  0x1e,0xc9,0xf8,0x84}, 
+{ 0x3d,0xf8,0xd2,0xbb},{  0x30,0xf3,0xdc,0xb2},{  0x27,0xee,0xce,0xa9},{  0x2a,0xe5,0xc0,0xa0}, 
+{ 0xb1,0x3c,0x7a,0x47},{  0xbc,0x37,0x74,0x4e},{  0xab,0x2a,0x66,0x55},{  0xa6,0x21,0x68,0x5c}, 
+{ 0x85,0x10,0x42,0x63},{  0x88,0x1b,0x4c,0x6a},{  0x9f,0x06,0x5e,0x71},{  0x92,0x0d,0x50,0x78}, 
+{ 0xd9,0x64,0x0a,0x0f},{  0xd4,0x6f,0x04,0x06},{  0xc3,0x72,0x16,0x1d},{  0xce,0x79,0x18,0x14}, 
+{ 0xed,0x48,0x32,0x2b},{  0xe0,0x43,0x3c,0x22},{  0xf7,0x5e,0x2e,0x39},{  0xfa,0x55,0x20,0x30}, 
+{ 0xb7,0x01,0xec,0x9a},{  0xba,0x0a,0xe2,0x93},{  0xad,0x17,0xf0,0x88},{  0xa0,0x1c,0xfe,0x81}, 
+{ 0x83,0x2d,0xd4,0xbe},{  0x8e,0x26,0xda,0xb7},{  0x99,0x3b,0xc8,0xac},{  0x94,0x30,0xc6,0xa5}, 
+{ 0xdf,0x59,0x9c,0xd2},{  0xd2,0x52,0x92,0xdb},{  0xc5,0x4f,0x80,0xc0},{  0xc8,0x44,0x8e,0xc9}, 
+{ 0xeb,0x75,0xa4,0xf6},{  0xe6,0x7e,0xaa,0xff},{  0xf1,0x63,0xb8,0xe4},{  0xfc,0x68,0xb6,0xed}, 
+{ 0x67,0xb1,0x0c,0x0a},{  0x6a,0xba,0x02,0x03},{  0x7d,0xa7,0x10,0x18},{  0x70,0xac,0x1e,0x11}, 
+{ 0x53,0x9d,0x34,0x2e},{  0x5e,0x96,0x3a,0x27},{  0x49,0x8b,0x28,0x3c},{  0x44,0x80,0x26,0x35}, 
+{ 0x0f,0xe9,0x7c,0x42},{  0x02,0xe2,0x72,0x4b},{  0x15,0xff,0x60,0x50},{  0x18,0xf4,0x6e,0x59}, 
+{ 0x3b,0xc5,0x44,0x66},{  0x36,0xce,0x4a,0x6f},{  0x21,0xd3,0x58,0x74},{  0x2c,0xd8,0x56,0x7d}, 
+{ 0x0c,0x7a,0x37,0xa1},{  0x01,0x71,0x39,0xa8},{  0x16,0x6c,0x2b,0xb3},{  0x1b,0x67,0x25,0xba}, 
+{ 0x38,0x56,0x0f,0x85},{  0x35,0x5d,0x01,0x8c},{  0x22,0x40,0x13,0x97},{  0x2f,0x4b,0x1d,0x9e}, 
+{ 0x64,0x22,0x47,0xe9},{  0x69,0x29,0x49,0xe0},{  0x7e,0x34,0x5b,0xfb},{  0x73,0x3f,0x55,0xf2}, 
+{ 0x50,0x0e,0x7f,0xcd},{  0x5d,0x05,0x71,0xc4},{  0x4a,0x18,0x63,0xdf},{  0x47,0x13,0x6d,0xd6}, 
+{ 0xdc,0xca,0xd7,0x31},{  0xd1,0xc1,0xd9,0x38},{  0xc6,0xdc,0xcb,0x23},{  0xcb,0xd7,0xc5,0x2a}, 
+{ 0xe8,0xe6,0xef,0x15},{  0xe5,0xed,0xe1,0x1c},{  0xf2,0xf0,0xf3,0x07},{  0xff,0xfb,0xfd,0x0e}, 
+{ 0xb4,0x92,0xa7,0x79},{  0xb9,0x99,0xa9,0x70},{  0xae,0x84,0xbb,0x6b},{  0xa3,0x8f,0xb5,0x62}, 
+{ 0x80,0xbe,0x9f,0x5d},{  0x8d,0xb5,0x91,0x54},{  0x9a,0xa8,0x83,0x4f},{  0x97,0xa3,0x8d,0x46 } 
+};
+
+word8 U4[256][4] = {
+{ 0x00,0x00,0x00,0x00},{  0x09,0x0d,0x0b,0x0e},{  0x12,0x1a,0x16,0x1c},{  0x1b,0x17,0x1d,0x12}, 
+{ 0x24,0x34,0x2c,0x38},{  0x2d,0x39,0x27,0x36},{  0x36,0x2e,0x3a,0x24},{  0x3f,0x23,0x31,0x2a}, 
+{ 0x48,0x68,0x58,0x70},{  0x41,0x65,0x53,0x7e},{  0x5a,0x72,0x4e,0x6c},{  0x53,0x7f,0x45,0x62}, 
+{ 0x6c,0x5c,0x74,0x48},{  0x65,0x51,0x7f,0x46},{  0x7e,0x46,0x62,0x54},{  0x77,0x4b,0x69,0x5a}, 
+{ 0x90,0xd0,0xb0,0xe0},{  0x99,0xdd,0xbb,0xee},{  0x82,0xca,0xa6,0xfc},{  0x8b,0xc7,0xad,0xf2}, 
+{ 0xb4,0xe4,0x9c,0xd8},{  0xbd,0xe9,0x97,0xd6},{  0xa6,0xfe,0x8a,0xc4},{  0xaf,0xf3,0x81,0xca}, 
+{ 0xd8,0xb8,0xe8,0x90},{  0xd1,0xb5,0xe3,0x9e},{  0xca,0xa2,0xfe,0x8c},{  0xc3,0xaf,0xf5,0x82}, 
+{ 0xfc,0x8c,0xc4,0xa8},{  0xf5,0x81,0xcf,0xa6},{  0xee,0x96,0xd2,0xb4},{  0xe7,0x9b,0xd9,0xba}, 
+{ 0x3b,0xbb,0x7b,0xdb},{  0x32,0xb6,0x70,0xd5},{  0x29,0xa1,0x6d,0xc7},{  0x20,0xac,0x66,0xc9}, 
+{ 0x1f,0x8f,0x57,0xe3},{  0x16,0x82,0x5c,0xed},{  0x0d,0x95,0x41,0xff},{  0x04,0x98,0x4a,0xf1}, 
+{ 0x73,0xd3,0x23,0xab},{  0x7a,0xde,0x28,0xa5},{  0x61,0xc9,0x35,0xb7},{  0x68,0xc4,0x3e,0xb9}, 
+{ 0x57,0xe7,0x0f,0x93},{  0x5e,0xea,0x04,0x9d},{  0x45,0xfd,0x19,0x8f},{  0x4c,0xf0,0x12,0x81}, 
+{ 0xab,0x6b,0xcb,0x3b},{  0xa2,0x66,0xc0,0x35},{  0xb9,0x71,0xdd,0x27},{  0xb0,0x7c,0xd6,0x29}, 
+{ 0x8f,0x5f,0xe7,0x03},{  0x86,0x52,0xec,0x0d},{  0x9d,0x45,0xf1,0x1f},{  0x94,0x48,0xfa,0x11}, 
+{ 0xe3,0x03,0x93,0x4b},{  0xea,0x0e,0x98,0x45},{  0xf1,0x19,0x85,0x57},{  0xf8,0x14,0x8e,0x59}, 
+{ 0xc7,0x37,0xbf,0x73},{  0xce,0x3a,0xb4,0x7d},{  0xd5,0x2d,0xa9,0x6f},{  0xdc,0x20,0xa2,0x61}, 
+{ 0x76,0x6d,0xf6,0xad},{  0x7f,0x60,0xfd,0xa3},{  0x64,0x77,0xe0,0xb1},{  0x6d,0x7a,0xeb,0xbf}, 
+{ 0x52,0x59,0xda,0x95},{  0x5b,0x54,0xd1,0x9b},{  0x40,0x43,0xcc,0x89},{  0x49,0x4e,0xc7,0x87}, 
+{ 0x3e,0x05,0xae,0xdd},{  0x37,0x08,0xa5,0xd3},{  0x2c,0x1f,0xb8,0xc1},{  0x25,0x12,0xb3,0xcf}, 
+{ 0x1a,0x31,0x82,0xe5},{  0x13,0x3c,0x89,0xeb},{  0x08,0x2b,0x94,0xf9},{  0x01,0x26,0x9f,0xf7}, 
+{ 0xe6,0xbd,0x46,0x4d},{  0xef,0xb0,0x4d,0x43},{  0xf4,0xa7,0x50,0x51},{  0xfd,0xaa,0x5b,0x5f}, 
+{ 0xc2,0x89,0x6a,0x75},{  0xcb,0x84,0x61,0x7b},{  0xd0,0x93,0x7c,0x69},{  0xd9,0x9e,0x77,0x67}, 
+{ 0xae,0xd5,0x1e,0x3d},{  0xa7,0xd8,0x15,0x33},{  0xbc,0xcf,0x08,0x21},{  0xb5,0xc2,0x03,0x2f}, 
+{ 0x8a,0xe1,0x32,0x05},{  0x83,0xec,0x39,0x0b},{  0x98,0xfb,0x24,0x19},{  0x91,0xf6,0x2f,0x17}, 
+{ 0x4d,0xd6,0x8d,0x76},{  0x44,0xdb,0x86,0x78},{  0x5f,0xcc,0x9b,0x6a},{  0x56,0xc1,0x90,0x64}, 
+{ 0x69,0xe2,0xa1,0x4e},{  0x60,0xef,0xaa,0x40},{  0x7b,0xf8,0xb7,0x52},{  0x72,0xf5,0xbc,0x5c}, 
+{ 0x05,0xbe,0xd5,0x06},{  0x0c,0xb3,0xde,0x08},{  0x17,0xa4,0xc3,0x1a},{  0x1e,0xa9,0xc8,0x14}, 
+{ 0x21,0x8a,0xf9,0x3e},{  0x28,0x87,0xf2,0x30},{  0x33,0x90,0xef,0x22},{  0x3a,0x9d,0xe4,0x2c}, 
+{ 0xdd,0x06,0x3d,0x96},{  0xd4,0x0b,0x36,0x98},{  0xcf,0x1c,0x2b,0x8a},{  0xc6,0x11,0x20,0x84}, 
+{ 0xf9,0x32,0x11,0xae},{  0xf0,0x3f,0x1a,0xa0},{  0xeb,0x28,0x07,0xb2},{  0xe2,0x25,0x0c,0xbc}, 
+{ 0x95,0x6e,0x65,0xe6},{  0x9c,0x63,0x6e,0xe8},{  0x87,0x74,0x73,0xfa},{  0x8e,0x79,0x78,0xf4}, 
+{ 0xb1,0x5a,0x49,0xde},{  0xb8,0x57,0x42,0xd0},{  0xa3,0x40,0x5f,0xc2},{  0xaa,0x4d,0x54,0xcc}, 
+{ 0xec,0xda,0xf7,0x41},{  0xe5,0xd7,0xfc,0x4f},{  0xfe,0xc0,0xe1,0x5d},{  0xf7,0xcd,0xea,0x53}, 
+{ 0xc8,0xee,0xdb,0x79},{  0xc1,0xe3,0xd0,0x77},{  0xda,0xf4,0xcd,0x65},{  0xd3,0xf9,0xc6,0x6b}, 
+{ 0xa4,0xb2,0xaf,0x31},{  0xad,0xbf,0xa4,0x3f},{  0xb6,0xa8,0xb9,0x2d},{  0xbf,0xa5,0xb2,0x23}, 
+{ 0x80,0x86,0x83,0x09},{  0x89,0x8b,0x88,0x07},{  0x92,0x9c,0x95,0x15},{  0x9b,0x91,0x9e,0x1b}, 
+{ 0x7c,0x0a,0x47,0xa1},{  0x75,0x07,0x4c,0xaf},{  0x6e,0x10,0x51,0xbd},{  0x67,0x1d,0x5a,0xb3}, 
+{ 0x58,0x3e,0x6b,0x99},{  0x51,0x33,0x60,0x97},{  0x4a,0x24,0x7d,0x85},{  0x43,0x29,0x76,0x8b}, 
+{ 0x34,0x62,0x1f,0xd1},{  0x3d,0x6f,0x14,0xdf},{  0x26,0x78,0x09,0xcd},{  0x2f,0x75,0x02,0xc3}, 
+{ 0x10,0x56,0x33,0xe9},{  0x19,0x5b,0x38,0xe7},{  0x02,0x4c,0x25,0xf5},{  0x0b,0x41,0x2e,0xfb}, 
+{ 0xd7,0x61,0x8c,0x9a},{  0xde,0x6c,0x87,0x94},{  0xc5,0x7b,0x9a,0x86},{  0xcc,0x76,0x91,0x88}, 
+{ 0xf3,0x55,0xa0,0xa2},{  0xfa,0x58,0xab,0xac},{  0xe1,0x4f,0xb6,0xbe},{  0xe8,0x42,0xbd,0xb0}, 
+{ 0x9f,0x09,0xd4,0xea},{  0x96,0x04,0xdf,0xe4},{  0x8d,0x13,0xc2,0xf6},{  0x84,0x1e,0xc9,0xf8}, 
+{ 0xbb,0x3d,0xf8,0xd2},{  0xb2,0x30,0xf3,0xdc},{  0xa9,0x27,0xee,0xce},{  0xa0,0x2a,0xe5,0xc0}, 
+{ 0x47,0xb1,0x3c,0x7a},{  0x4e,0xbc,0x37,0x74},{  0x55,0xab,0x2a,0x66},{  0x5c,0xa6,0x21,0x68}, 
+{ 0x63,0x85,0x10,0x42},{  0x6a,0x88,0x1b,0x4c},{  0x71,0x9f,0x06,0x5e},{  0x78,0x92,0x0d,0x50}, 
+{ 0x0f,0xd9,0x64,0x0a},{  0x06,0xd4,0x6f,0x04},{  0x1d,0xc3,0x72,0x16},{  0x14,0xce,0x79,0x18}, 
+{ 0x2b,0xed,0x48,0x32},{  0x22,0xe0,0x43,0x3c},{  0x39,0xf7,0x5e,0x2e},{  0x30,0xfa,0x55,0x20}, 
+{ 0x9a,0xb7,0x01,0xec},{  0x93,0xba,0x0a,0xe2},{  0x88,0xad,0x17,0xf0},{  0x81,0xa0,0x1c,0xfe}, 
+{ 0xbe,0x83,0x2d,0xd4},{  0xb7,0x8e,0x26,0xda},{  0xac,0x99,0x3b,0xc8},{  0xa5,0x94,0x30,0xc6}, 
+{ 0xd2,0xdf,0x59,0x9c},{  0xdb,0xd2,0x52,0x92},{  0xc0,0xc5,0x4f,0x80},{  0xc9,0xc8,0x44,0x8e}, 
+{ 0xf6,0xeb,0x75,0xa4},{  0xff,0xe6,0x7e,0xaa},{  0xe4,0xf1,0x63,0xb8},{  0xed,0xfc,0x68,0xb6}, 
+{ 0x0a,0x67,0xb1,0x0c},{  0x03,0x6a,0xba,0x02},{  0x18,0x7d,0xa7,0x10},{  0x11,0x70,0xac,0x1e}, 
+{ 0x2e,0x53,0x9d,0x34},{  0x27,0x5e,0x96,0x3a},{  0x3c,0x49,0x8b,0x28},{  0x35,0x44,0x80,0x26}, 
+{ 0x42,0x0f,0xe9,0x7c},{  0x4b,0x02,0xe2,0x72},{  0x50,0x15,0xff,0x60},{  0x59,0x18,0xf4,0x6e}, 
+{ 0x66,0x3b,0xc5,0x44},{  0x6f,0x36,0xce,0x4a},{  0x74,0x21,0xd3,0x58},{  0x7d,0x2c,0xd8,0x56}, 
+{ 0xa1,0x0c,0x7a,0x37},{  0xa8,0x01,0x71,0x39},{  0xb3,0x16,0x6c,0x2b},{  0xba,0x1b,0x67,0x25}, 
+{ 0x85,0x38,0x56,0x0f},{  0x8c,0x35,0x5d,0x01},{  0x97,0x22,0x40,0x13},{  0x9e,0x2f,0x4b,0x1d}, 
+{ 0xe9,0x64,0x22,0x47},{  0xe0,0x69,0x29,0x49},{  0xfb,0x7e,0x34,0x5b},{  0xf2,0x73,0x3f,0x55}, 
+{ 0xcd,0x50,0x0e,0x7f},{  0xc4,0x5d,0x05,0x71},{  0xdf,0x4a,0x18,0x63},{  0xd6,0x47,0x13,0x6d}, 
+{ 0x31,0xdc,0xca,0xd7},{  0x38,0xd1,0xc1,0xd9},{  0x23,0xc6,0xdc,0xcb},{  0x2a,0xcb,0xd7,0xc5}, 
+{ 0x15,0xe8,0xe6,0xef},{  0x1c,0xe5,0xed,0xe1},{  0x07,0xf2,0xf0,0xf3},{  0x0e,0xff,0xfb,0xfd}, 
+{ 0x79,0xb4,0x92,0xa7},{  0x70,0xb9,0x99,0xa9},{  0x6b,0xae,0x84,0xbb},{  0x62,0xa3,0x8f,0xb5},  
+{ 0x5d,0x80,0xbe,0x9f},{  0x54,0x8d,0xb5,0x91},{  0x4f,0x9a,0xa8,0x83},{  0x46,0x97,0xa3,0x8d }
+};
+
+word32 rcon[30] = { 
+  0x01,0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91
+};
Index: trunk/include/samhain.h
===================================================================
--- trunk/include/samhain.h	(revision 591)
+++ trunk/include/samhain.h	(revision 1)
@@ -28,30 +28,4 @@
 #endif
 
-#if defined(__GNUC__) && (__GNUC__ >= 4)
-#define SH_GNUC_SENTINEL __attribute__((__sentinel__))
-#else
-#define SH_GNUC_SENTINEL
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#undef  SH_GNUC_PURE
-#define SH_GNUC_PURE     __attribute__((pure))
-#undef  SH_GNUC_CONST
-#define SH_GNUC_CONST	 __attribute__((const))
-#undef  SH_GNUC_NORETURN
-#define SH_GNUC_NORETURN __attribute__((noreturn))
-#undef  SH_GNUC_MALLOC
-#define SH_GNUC_MALLOC   __attribute__((malloc))
-#else
-#undef  SH_GNUC_PURE
-#define SH_GNUC_PURE
-#undef  SH_GNUC_CONST
-#define SH_GNUC_CONST
-#undef  SH_GNUC_NORETURN
-#define SH_GNUC_NORETURN
-#undef  SH_GNUC_MALLOC
-#define SH_GNUC_MALLOC
-#endif
-
 /**************************************************
  *
@@ -60,55 +34,18 @@
  **************************************************/
 
-/* IPv6 */
-#if defined(HAVE_GETNAMEINFO) && defined(HAVE_GETADDRINFO)
-
-#if defined(SH_COMPILE_STATIC) && defined(__linux__)
-#undef USE_IPVX
-#define SH_SOCKMAX 1
-#else
-
-#if defined(USE_IPV4)
-#undef USE_IPVX
-#else
-#define USE_IPVX 1
-#endif
-
-#define SH_SOCKMAX 8
-#endif
-
-#else
-#undef USE_IPVX
-#define SH_SOCKMAX 1
-#endif
-
-/* end IPv6 */
-
-/* Standard buffer sizes. 
- * IPv6 is 8 groups of 4 hex digits seperated by colons.
- */
-#define SH_IP_BUF        48
+#define REPLACE_OLD
+
+/* Standard buffer sizes.
+ */
 #define SH_MINIBUF       64
 #define SH_BUFSIZE     1024
 #define SH_MAXBUF      4096
 #define SH_PATHBUF      256
-#define SH_MSG_BUF    64512
-
-#define SH_ERRBUF_SIZE   64
-
-/* MAX_PATH_STORE must be >= KEY_LEN
- */
-#define MAX_PATH_STORE 12287
 
 /* Sizes for arrays (user, group, timestamp).
  */
-#define SOCKPASS_MAX 14
-#define USER_MAX     20
-#define GROUP_MAX    20
-#define TIM_MAX      32
-
-#define CMODE_SIZE   11
-
-#define ATTRBUF_SIZE 16
-#define ATTRBUF_USED 12
+#define USER_MAX  20
+#define GROUP_MAX 20
+#define TIM_MAX   32
 
 /* The number of bytes in a key,  
@@ -119,5 +56,4 @@
 #define KEY_LEN   48
 #define KEY_BLOCK 24
-#define KEYBUF_SIZE (KEY_LEN+1)
 
 /* The length of the compiled-in password.
@@ -125,32 +61,20 @@
 #define PW_LEN     8
 
+/* Buffer for privileged content.
+ */
+#define PRIV_MAX  4096   
+
+#undef  GOOD
+#define GOOD  1
+#undef  BAD
+#define BAD   0
+#undef  ON
+#define ON    1
+#undef  OFF
+#define OFF   0
 #undef  S_TRUE
 #define S_TRUE    1
 #undef  S_FALSE
 #define S_FALSE   0
-
-#undef  GOOD
-#define GOOD  S_TRUE
-#undef  BAD
-#define BAD   S_FALSE
-
-#define SH_SILENT_FULL 2
-#define SH_SILENT_STD  1
-
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if !defined(HAVE_UINT16_T)
-#define UINT16 unsigned short
-#else
-#define UINT16 uint16_t
-#endif
-
-#if !defined(HAVE_UINT32_T)
 
 /* An unsigned integer guaranteed to be 32 bit.
@@ -165,15 +89,15 @@
 #define UINT32 unsigned short
 #define SINT32 short
-#else
-#error "No 32 bit integer type found"
-#endif
-
-#else
-#define UINT32 uint32_t
-#define SINT32 int32_t
-
-#endif
-
-#if !defined(HAVE_UINT64_T)
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#else
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#endif
+
+#if !defined(HAVE_INTTYPES_H) && !defined(HAVE_STDINT_H)
 
 #ifdef HAVE_LONG_LONG_64
@@ -183,5 +107,6 @@
 #define  UINT64 unsigned long
 #else
-#error "no 64bit type found"
+#define UINT64_IS_32
+#define  UINT64 unsigned long
 #endif
 #endif
@@ -194,11 +119,4 @@
 
 #define UBYTE unsigned char
-
-enum {
-  SH_TIGER192    = 0, 
-  SH_SHA1        = 1,
-  SH_MD5         = 2,
-  SH_SHA256      = 3
-};
 
 
@@ -208,51 +126,4 @@
   SH_CHECK_CHECK   = 2
 };
-
-#define SH_MOD_THREAD  1
-#define SH_MOD_ACTIVE  0
-#define SH_MOD_FAILED -1
-#define SH_MOD_OFFSET 10
-
-/* Flags for file status
- */
-#define SH_FFLAG_ALLIGNORE (1<<0)
-#define SH_FFLAG_VISITED   (1<<1)
-#define SH_FFLAG_CHECKED   (1<<3)
-#define SH_FFLAG_REPORTED  (1<<3)
-#define SH_FFLAG_SUIDCHK   (1<<4)
-#define SH_FFLAG_ENOENT    (1<<5)
-
-#define SH_FFLAG_ALLIGNORE_SET(a)   (((a) & SH_FFLAG_ALLIGNORE) != 0)
-#define SET_SH_FFLAG_ALLIGNORE(a)   ((a) |= SH_FFLAG_ALLIGNORE)
-#define CLEAR_SH_FFLAG_ALLIGNORE(a) ((a) &= ~SH_FFLAG_ALLIGNORE)
-
-#define SH_FFLAG_VISITED_SET(a)     (((a) & SH_FFLAG_VISITED) != 0)
-#define SET_SH_FFLAG_VISITED(a)     ((a) |= SH_FFLAG_VISITED)
-#define CLEAR_SH_FFLAG_VISITED(a)   ((a) &= ~SH_FFLAG_VISITED)
-
-#define SH_FFLAG_CHECKED_SET(a)     (((a) & SH_FFLAG_VISITED) != 0)
-#define SET_SH_FFLAG_CHECKED(a)     ((a) |= SH_FFLAG_VISITED)
-#define CLEAR_SH_FFLAG_CHECKED(a)   ((a) &= ~SH_FFLAG_VISITED)
-
-#define SH_FFLAG_REPORTED_SET(a)    (((a) & SH_FFLAG_REPORTED) != 0)
-#define SET_SH_FFLAG_REPORTED(a)    ((a) |= SH_FFLAG_REPORTED)
-#define CLEAR_SH_FFLAG_REPORTED(a)  ((a) &= ~SH_FFLAG_REPORTED)
-
-#define SH_FFLAG_SUIDCHK_SET(a)     (((a) & SH_FFLAG_SUIDCHK) != 0)
-#define SET_SH_FFLAG_SUIDCHK(a)     ((a) |= SH_FFLAG_SUIDCHK)
-#define CLEAR_SH_FFLAG_SUIDCHK(a)   ((a) &= ~SH_FFLAG_SUIDCHK)
-
-#define SH_FFLAG_ENOENT_SET(a)      (((a) & SH_FFLAG_ENOENT) != 0)
-#define SET_SH_FFLAG_ENOENT(a)      ((a) |= SH_FFLAG_ENOENT)
-#define CLEAR_SH_FFLAG_ENOENT(a)    ((a) &= ~SH_FFLAG_ENOENT)
-
-/* Flags for inotify
- */
-#define SH_INOTIFY_USE      (1<<0)
-#define SH_INOTIFY_DOSCAN   (1<<1)
-#define SH_INOTIFY_NEEDINIT (1<<2)
-#define SH_INOTIFY_INSCAN   (1<<3)
-#define SH_INOTIFY_IFUSED(a)   if ((sh.flag.inotify & SH_INOTIFY_USE) != 0) { a }
-
 
 /**************************************************
@@ -271,8 +142,5 @@
   SH_LEVEL_USER0       = 7,
   SH_LEVEL_USER1       = 8,
-  SH_LEVEL_USER2       = 9,
-  SH_LEVEL_USER3       = 10,
-  SH_LEVEL_USER4       = 11,
-  SH_LEVEL_PRELINK     = 12
+  SH_LEVEL_PRELINK     = 9
 };
 
@@ -316,7 +184,4 @@
   unsigned long   dirs_checked;  /* #dirs     last check */
   unsigned long   files_checked; /* #files    last check */
-  unsigned long   files_report;  /* #file reports        */
-  unsigned long   files_error;   /* #file access error   */
-  unsigned long   files_nodir;   /* #file not a directory*/
 } sh_sh_stat;
 
@@ -326,5 +191,4 @@
   int    update;                   /* update db                       */
   int    opts;                     /* reading cl options              */
-  int    started;                  /* finished with startup stuff     */
   int    isdaemon;                 /* daemon or not                   */
   int    loop;                     /* go in loop even if not daemon   */
@@ -338,8 +202,7 @@
   int    client_severity;          /* TRUE if client severity used    */
   int    client_class;             /* TRUE if client class used       */
-  int    hidefile;                 /* TRUE if file not shown in log   */
-  int    inotify;                  /* Flags for inotify               */
   int    audit;
   unsigned long aud_mask;
+  int    hidefile;                 /* TRUE if file not reveled in log */
 } sh_sh_flag;
 
@@ -347,6 +210,4 @@
 
   char   prg_name[8];
-
-  UINT64 pid;  
  
   sh_sh_df     exec;
@@ -379,12 +240,4 @@
   int    looptime;                 /* timing for main loop            */
   /*@null@*//*@out@*/ char   * timezone;
-
-  int delayload;
-
-#ifdef SCREW_IT_UP
-  int sigtrap_max_duration;
-#endif
-
-  char * outpath;
 } sh_struct;
 
@@ -394,25 +247,18 @@
 extern volatile  int      sig_debug_switch;       /* SIGUSR1 */
 extern volatile  int      sig_suspend_switch;     /* SIGUSR2 */
-extern volatile  int      sh_global_suspend_flag;
+extern volatile  int      sh_global_suspend_flag; /* SIGUSR2 */
 extern volatile  int      sig_fresh_trail;        /* SIGIOT  */
-extern volatile  int      sh_thread_pause_flag;
 extern volatile  int      sig_config_read_again;  /* SIGHUP  */
 extern volatile  int      sig_terminate;          /* SIGQUIT */
 extern volatile  int      sig_termfast;           /* SIGTERM */
 extern volatile  int      sig_force_check;        /* SIGTTOU */
-extern volatile  int      sig_force_silent;       /* SIGTSTP */
-extern volatile  int      sh_global_check_silent;
-extern volatile  int      sh_load_delta_flag;
 
 extern long int eintr__result;
 
-extern int     sh_argc_store;
-extern char ** sh_argv_store;
-
 #include "sh_calls.h"
 
 
 typedef struct {
-  char   sh_sockpass[2*SOCKPASS_MAX+2];
+  char   sh_sockpass[32];
   char   sigkey_old[KEY_LEN+1];
   char   sigkey_new[KEY_LEN+1];
@@ -434,6 +280,4 @@
   UINT32 rng2[3];
 
-  UINT32 res_vec[6];
-
   UINT32 ErrFlag[2];
 
@@ -447,61 +291,11 @@
 /*@null@*/ extern sh_key_t  *skey; 
 
-/**************************************************
- *
- * macros
- *
- **************************************************/
-
-#if defined(SH_ABORT_ON_ERROR)
-#define SH_ABORT abort()
-#else
-#define SH_ABORT 
-#endif
-
-
-
-/* The semantics of the built-in are that it is expected that expr == const
- * for __builtin_expect ((expr), const)
- */
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-#define SH_LIKELY(expr)   (__builtin_expect((expr), 1))
-#define SH_UNLIKELY(expr) (__builtin_expect((expr), 0))
-#else
-#define SH_LIKELY(expr) (expr)
-#define SH_UNLIKELY(expr) (expr)
-#endif
-
-/* signal-safe log function
- */
-int  safe_logger (int thesignal, int method, char * details);
-void safe_fatal  (const char * details, const char *f, int l);
-
-#define SH_VALIDATE_EQ(a,b) \
-     do { \
-         if ((a) != (b)) safe_fatal(#a " != " #b, FIL__, __LINE__);\
-     } while (0)
-
-#define SH_VALIDATE_NE(a,b) \
-     do { \
-         if ((a) == (b)) safe_fatal(#a " == " #b, FIL__, __LINE__);\
-     } while (0)
-
-#define SH_VALIDATE_GE(a,b) \
-     do { \
-         if ((a) < (b)) safe_fatal(#a " < " #b, FIL__, __LINE__);\
-     } while (0)
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-#ifdef USE_SUID
 #define MLOCK(a, b) \
-      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
+      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
         (void) sl_set_suid(); \
-	if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; \
-        (void) sl_unset_suid(); }
-#else
-#define MLOCK(a, b) \
-      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
-        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; }
-#endif 
+	if (sh_unix_mlock( a, b) < 0) skey->mlock_failed = SL_TRUE; \
+        (void) sl_unset_suid(); } 
 #else
 #define MLOCK(a, b) \
@@ -510,15 +304,9 @@
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-#ifdef USE_SUID
 #define MUNLOCK(a, b) \
-      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
+      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
         (void) sl_set_suid(); \
 	(void) sh_unix_munlock( a, b );\
-        (void) sl_unset_suid(); }
-#else
-#define MUNLOCK(a, b) \
-      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
-        (void) sh_unix_munlock( a, b ); }
-#endif 
+        (void) sl_unset_suid(); } 
 #else
 #define MUNLOCK(a, b) \
Index: trunk/include/sh_calls.h
===================================================================
--- trunk/include/sh_calls.h	(revision 591)
+++ trunk/include/sh_calls.h	(revision 1)
@@ -31,74 +31,57 @@
 /*@-fixedformalarray@*/
 
-#include "config_xor.h"
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#undef  SH_GNUC_NORETURN
-#define SH_GNUC_NORETURN __attribute__((noreturn))
-#else
-#undef  SH_GNUC_NORETURN
-#define SH_GNUC_NORETURN
-#endif
+/* Set aud functions
+ */
+int sh_aud_set_functions(char * str_s);
 
 
-/* Set aud functions
- */
-int sh_aud_set_functions(const char * str_s);
-
-#ifdef SH_IPVX_H
-long int retry_accept(const char * file, int line, 
-		      int fd, struct sh_sockaddr *serv_addr, int * addrlen);
-#endif
-
-void sh_calls_enable_sub();
-int  sh_calls_set_sub (const char * str);
-
-long int retry_stat (const char * file, int line, 
+long int retry_accept(char * file, int line, 
+		      int fd, struct sockaddr *serv_addr, int * addrlen);
+long int retry_stat (char * file, int line, 
 		     const char *file_name, struct stat *buf);
-long int retry_fstat(const char * file, int line, 
+long int retry_fstat(char * file, int line, 
 		     int filed,             struct stat *buf);
-long int retry_lstat_ns(const char * file, int line, 
-			const char *file_name, struct stat *buf);
-long int retry_lstat(const char * file, int line, 
+long int retry_lstat(char * file, int line, 
 		     const char *file_name, struct stat *buf);
-long int retry_fcntl(const char * file, int line, 
+long int retry_fcntl(char * file, int line, 
 		     int fd, int cmd, long arg);
 
 long int retry_msleep (int sec, int millisec);
 
-long int retry_sigaction(const char * file, int line, 
+long int retry_sigaction(char * file, int line, 
 			 int signum,  const  struct  sigaction  *act,
 			 struct sigaction *oldact);
 
-int      sh_calls_set_bind_addr (const char *);
-long int retry_connect(const char * file, int line,
+int      sh_calls_set_bind_addr (char *);
+long int retry_connect(char * file, int line,
 		       int fd, struct sockaddr *serv_addr, int addrlen);
 
-long int retry_aud_dup2    (const char * file, int line, int fd, int fd2);
-long int retry_aud_execve  (const char * file, int line, 
-			    const  char *dateiname, char *const argv[],
-			    char *const envp[]);
-long int retry_aud_dup     (const char * file, int line, 
+long int retry_aud_dup2    (char * file, int line, int fd, int fd2);
+long int retry_aud_execve  (char * file, int line, 
+			    const  char *dateiname, char * argv[],
+			    char *envp[]);
+long int retry_aud_dup     (char * file, int line, 
 			    int fd);
-long int retry_aud_chdir   (const char * file, int line, 
+long int retry_aud_chdir   (char * file, int line, 
 			    const char *path);
-long int retry_aud_unlink  (const char * file, int line, 
+long int retry_aud_unlink  (char * file, int line, 
 			    char * path);
-long int retry_aud_utime   (const char * file, int line, 
+long int retry_aud_utime   (char * file, int line, 
 			    char * path, struct utimbuf *buf);
 
-long int aud_open           (const char * file, int line, int privs,
+long int aud_open           (char * file, int line, int privs,
 			     const char *pathname, int flags, mode_t mode);
-long int aud_open_noatime   (const char * file, int line, int privs,
+long int aud_open_noatime   (char * file, int line, int privs,
 			     const char *pathname, int flags, mode_t mode,
 			     int * o_noatime);
 /*@noreturn@*/
-void     aud_exit   (const char * file, int line, int fd) SH_GNUC_NORETURN;
+void     aud_exit   (char * file, int line, int fd);
 /*@noreturn@*/
-void     aud__exit  (const char * file, int line, int fd) SH_GNUC_NORETURN;
-pid_t    aud_fork   (const char * file, int line);
-int      aud_pipe   (const char * file, int line, int modus[2]);
-int      aud_setuid (const char * file, int line, uid_t uid);
-int      aud_setgid (const char * file, int line, gid_t gid);
-long int aud_kill   (const char * file, int line, pid_t pid, int sig);
+void     aud__exit  (char * file, int line, int fd);
+pid_t    aud_fork   (char * file, int line);
+int      aud_pipe   (char * file, int line, int modus[2]);
+int      aud_setuid (char * file, int line, uid_t uid);
+int      aud_setgid (char * file, int line, gid_t gid);
+long int aud_kill   (char * file, int line, pid_t pid, int sig);
 
 #endif 
Index: trunk/include/sh_cat.h
===================================================================
--- trunk/include/sh_cat.h	(revision 591)
+++ trunk/include/sh_cat.h	(revision 1)
@@ -7,10 +7,10 @@
   unsigned long priority;
   unsigned long class;
-  const char *        format;
+  char *        format;
 } cat_entry;
 
 extern cat_entry msg_cat[];
 
-extern const char * class_cat[];
+extern char * class_cat[];
 
 #define  AUD      0
@@ -75,13 +75,10 @@
  MSG_CHECK_0,     
  MSG_CHECK_1,     
- MSG_CHECK_2,     
- MSG_STAMP,
- MSG_DCLOSE,
+ MSG_STAMP,       
  		  
  MSG_D_START,     
  MSG_D_DSTART,    
  MSG_D_FAIL,      
- MSG_D_DELTAOK,
- MSG_D_DELTAFAIL,
+
 
 #ifndef HAVE_URANDOM 
@@ -103,4 +100,16 @@
 #endif
 
+#ifdef SH_USE_KERN
+ /* FreeBSD */
+ MSG_KERN_POLICY,    
+ MSG_KERN_POL_CO,
+
+ /* Linux */
+ MSG_KERN_SYSCALL,
+ MSG_KERN_PROC,
+ MSG_KERN_IDT,
+ MSG_KERN_GATE,
+#endif
+
 #ifdef SH_USE_UTMP
  MSG_UT_CHECK,
@@ -121,23 +130,4 @@
  MSG_UT_ROT,      
 
- MSG_UT_BAD,
- MSG_UT_FIRST,
- MSG_UT_OUTLIER,
-#endif
-
-#ifdef SH_USE_PROCESSCHECK
- MSG_PCK_CHECK,  
- MSG_PCK_OK,     
- MSG_PCK_P_HIDDEN, 
- MSG_PCK_HIDDEN, 
- MSG_PCK_FAKE,   
- MSG_PCK_MISS,   
-#endif
-
-#ifdef SH_USE_PORTCHECK
- MSG_PORT_MISS,
- MSG_PORT_NEW,
- MSG_PORT_RESTART,
- MSG_PORT_NEWPORT,
 #endif
 
@@ -151,23 +141,4 @@
 #ifdef SH_USE_USERFILES
  MSG_USERFILES_SUMMARY,
-#endif
-
-#ifdef USE_LOGFILE_MONITOR
- MSG_LOGMON_CHKS,
- MSG_LOGMON_CHKE,
- MSG_LOGMON_MISS,
- MSG_LOGMON_EOPEN,
- MSG_LOGMON_EREAD,
- MSG_LOGMON_REP,
- MSG_LOGMON_SUM,
- MSG_LOGMON_COR,
- MSG_LOGMON_MARK,
- MSG_LOGMON_BURST,
-#endif
-
-#ifdef USE_REGISTRY_CHECK
- MSG_REG_MISS,
- MSG_REG_NEW,
- MSG_REG_CHANGE,
 #endif
 
@@ -190,5 +161,5 @@
  MSG_FI_NOGRP,    
  MSG_FI_NOUSR,    
- MSG_FI_STAT,    
+ MSG_FI_LSTAT,    
  MSG_FI_OBSC,     
  MSG_FI_OBSC2,    
@@ -229,6 +200,5 @@
  MSG_TCP_EBGN,    
  		  
- MSG_TCP_CREG,
- MSG_TCP_AREG,
+ MSG_TCP_CREG,    
  MSG_TCP_FAUTH,   
  MSG_TCP_TIMOUT,  
@@ -281,6 +251,5 @@
  MSG_E_HASH,      
  MSG_E_ACCESS,    
- MSG_E_READ,
- MSG_E_NOTREG,
+ MSG_E_READ,      
  MSG_E_TIMEOUT,
  MSG_NODEV,       
Index: trunk/include/sh_checksum.h
===================================================================
--- trunk/include/sh_checksum.h	(revision 591)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#ifndef SH_CHECKSUM_H
-#define SH_CHECKSUM_H
-
-typedef unsigned char sha2_byte  ;
-typedef UINT32        sha2_word32;
-typedef UINT64        sha2_word64;
-
-
-#define SHA256_BLOCK_LENGTH             64
-#define SHA256_SHORT_BLOCK_LENGTH       (SHA256_BLOCK_LENGTH - 8)
-#define SHA256_DIGEST_LENGTH            32
-#define SHA256_DIGEST_STRING_LENGTH     (SHA256_DIGEST_LENGTH * 2 + 1)
-
-typedef struct _SHA256_CTX {
-        sha2_word32     state[8];
-        sha2_word64     bitcount;
-        sha2_byte       buffer[SHA256_BLOCK_LENGTH];
-} SHA256_CTX;
-
-void SHA256_Init(SHA256_CTX *);
-void SHA256_Update(SHA256_CTX*, const sha2_byte*, size_t);
-void SHA256_Final(sha2_byte[SHA256_DIGEST_LENGTH], SHA256_CTX*);
-char* SHA256_End(SHA256_CTX*, char[KEYBUF_SIZE]);
-char* SHA256_Data(const sha2_byte*, size_t, char[KEYBUF_SIZE]);
-char* SHA256_Base2Hex(char * b64digest, char * hexdigest); 
-char * SHA256_ReplaceBaseByHex(const char * str, char * before, char after);
-#endif
Index: trunk/include/sh_database.h
===================================================================
--- trunk/include/sh_database.h	(revision 591)
+++ trunk/include/sh_database.h	(revision 1)
@@ -2,15 +2,15 @@
 #define SH_DATABASE_H
 
-void sh_database_reset(void);
+void sh_database_reset();
 int sh_database_insert (char * message);
 
-int sh_database_use_persistent (const char * str);
+int sh_database_use_persistent (char * str);
 
-int sh_database_set_database (const char * str);
-int sh_database_set_table (const char * str);
-int sh_database_set_host (const char * str);
-int sh_database_set_user (const char * str);
-int sh_database_set_password (const char * str);
-int sh_database_add_to_hash  (const char * str);
-int set_enter_wrapper (const char * str);
+int sh_database_set_database (char * str);
+int sh_database_set_table (char * str);
+int sh_database_set_host (char * str);
+int sh_database_set_user (char * str);
+int sh_database_set_password (char * str);
+int sh_database_add_to_hash  (char * str);
+int set_enter_wrapper (char * str);
 #endif
Index: trunk/include/sh_dbCheck.h
===================================================================
--- trunk/include/sh_dbCheck.h	(revision 591)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#ifndef SH_DBCHECK_H
-#define SH_DBCHECK_H
-
-int sh_dbCheck_verify (const char * db_file);
-
-#endif
Index: trunk/include/sh_dbCreate.h
===================================================================
--- trunk/include/sh_dbCreate.h	(revision 591)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#ifndef SH_DBCREATE_H
-#define SH_DBCREATE_H
-
-int sh_dbCreate (const char * path);
-
-#endif
Index: trunk/include/sh_dbIO.h
===================================================================
--- trunk/include/sh_dbIO.h	(revision 591)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#ifndef SH_DBIO_H
-#define SH_DBIO_H
-
-
-
-/* Read one line, trim newline. Return char count, or -1 on error or eof.
- */
-int sh_dbIO_getline (FILE * fd, char * line, const size_t sizeofline);
-
-/* Read given database file for listing
- */
-int sh_dbIO_list_db (const char * db_file);
-
-/* Write single record to database
- */
-void sh_dbIO_data_write (file_type * buf, char * fileHash);
-
-/* Write whole default database
- */
-int sh_dbIO_writeout_update ();
-
-/* write database to given path
- */
-int sh_dbIO_writeout_to_path(const char * path);
-
-/* write database to stdout
- */
-int sh_dbIO_writeout_stdout (const char * str);
-
-/* version string for database
- */
-int sh_dbIO_version_string(const char * str);
-
-/* Load a delta database
- */
-int sh_dbIO_load_delta();
-
-int sh_dbIO_list_binary (const char * c);
-int sh_dbIO_list_filter (const char * c);
-
-/* alternative rootfs */
-
-int sh_dbIO_init_rootfs (const char * rootfs);
-size_t sh_dbIO_get_rootfs_len();
-char * sh_dbIO_rootfs_prepend(char * path);
-char * sh_dbIO_rootfs_strip(char * path);
-char * sh_dbIO_rootfs_strip_link(char * path);
-
-#endif
Index: trunk/include/sh_dbIO_int.h
===================================================================
--- trunk/include/sh_dbIO_int.h	(revision 591)
+++ 	(revision )
@@ -1,157 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#ifndef SH_DBIO_INT_H
-#define SH_DBIO_INT_H
-
-#define SH_DEADFILE 65535
-
-typedef struct store_info_old {
-
-  UINT32           mode;
-  UINT32           linkmode;
-
-  UINT64           dev;
-  UINT64           rdev;
-
-  UINT32           hardlinks;
-  UINT32           ino;
-
-  UINT64           size;
-  UINT64           atime;
-  UINT64           mtime;
-  UINT64           ctime;
-
-  UINT32           owner;
-  UINT32           group;
-
-  UINT32           attributes;
-
-  char             c_attributes[ATTRBUF_SIZE]; /* 16 = 2*UINT64 */
-
-  unsigned short   mark;
-  char             c_owner[USER_MAX+2];
-  char             c_group[GROUP_MAX+2];
-  char             c_mode[CMODE_SIZE];
-  char             checksum[KEY_LEN+1];
-  
-} sh_filestore_old_t;
-
-typedef struct store_info {
-
-  UINT32           mode;
-  UINT32           linkmode;
-
-  UINT64           dev;
-  UINT64           rdev;
-
-  UINT32           hardlinks;
-  UINT32           ino;
-
-  UINT64           size;
-  UINT64           atime;
-  UINT64           mtime;
-  UINT64           ctime;
-
-  UINT32           owner;
-  UINT32           group;
-
-  UINT32           attributes;
-
-  char             c_attributes[ATTRBUF_SIZE]; /* 16 = 2*UINT64 */
-
-  unsigned short   mark;
-  char             c_owner[USER_MAX+2];
-  char             c_group[GROUP_MAX+2];
-  char             c_mode[CMODE_SIZE];
-  char             checksum[KEY_LEN+1];
-  
-  /* If 'checkflags' is elsewhere, the compiler would still use
-   * a 6-byte padding to align the whole struct to an 8-byte boundary.
-   * ipad, opad: make explicit what the compiler does on a 64-byte system.
-   */
-  char             ipad[2];
-  UINT32           checkflags;
-  char             opad[4];
-
-} sh_filestore_t;
-  
-typedef struct file_info {
-  sh_filestore_t   theFile;
-  char           * fullpath;
-  char           * linkpath;
-  char           * attr_string;
-  int              fflags;
-  unsigned long    modi_mask;
-  struct           file_info * next;
-} sh_file_t;
-
-//* must fit an int              */
-#define TABSIZE 65536
-
-/* must fit an unsigned short   */
-/* changed for V0.8, as the     */
-/* database format has changed  */
-/* changed again for V0.9       */
-/* #define REC_MAGIC 19         */
-/* changed again for V1.3       */
-/* #define REC_MAGIC 20         */
-/* changed again for V1.4       */
-/* #define REC_MAGIC 21         */
-#define OLD_REC_MAGIC 21 
-/* changed again for V3.2       */
-#define REC_MAGIC 22
-
-#define REC_FLAGS_ATTR (1<<8)
-#define REC_FLAGS_MASK 0xFF00
-
-/* Insert into database table
- */
-void hashinsert (sh_file_t * tab[TABSIZE], sh_file_t * s); 
-
-/* Internal conversion function
- */
-file_type * sh_hash_create_ft (const sh_file_t * p, char * fileHash);
-
-/* Print what's in the link path
- */
-int sh_hash_printcontent(char * linkpath);
-
-/* List database entry
- */
-void sh_hash_list_db_entry (sh_file_t * p);
-
-/* get the location of the default/main database table
- */
-sh_file_t ** get_default_data_table();
-
-/* Write whole database
- */
-int sh_dbIO_writeout(sh_file_t * mtab[TABSIZE], const char * outpath, int truncate);
-
-/* Load from the default source into hash table 'tab'
- */
-int sh_dbIO_load_db(sh_file_t * tab[TABSIZE]);
-
-/* Load from the file 'filepath' into hash table 'tab'
- */
-int sh_dbIO_load_db_file(sh_file_t * tab[TABSIZE], const char * filepath);
-
-#endif
Index: trunk/include/sh_error.h
===================================================================
--- trunk/include/sh_error.h	(revision 591)
+++ trunk/include/sh_error.h	(revision 1)
@@ -30,5 +30,5 @@
   SH_ERR_T_START  = 0,
 
-  /* 1-13 = SH_LEVEL_XXX */
+  /* 1-9 = SH_LEVEL_XXX */
 
   SH_ERR_T_RO      = SH_LEVEL_READONLY,
@@ -40,14 +40,11 @@
   SH_ERR_T_USER0   = SH_LEVEL_USER0,  
   SH_ERR_T_USER1   = SH_LEVEL_USER1,  
-  SH_ERR_T_USER2   = SH_LEVEL_USER2,  
-  SH_ERR_T_USER3   = SH_LEVEL_USER3,  
-  SH_ERR_T_USER4   = SH_LEVEL_USER4,  
   SH_ERR_T_PRELINK = SH_LEVEL_PRELINK,  
 
-  SH_ERR_T_DIR    = 13,
-  SH_ERR_T_FILE   = 14,
-  SH_ERR_T_NAME   = 15,
+  SH_ERR_T_DIR    = 10,
+  SH_ERR_T_FILE   = 11,
+  SH_ERR_T_NAME   = 12,
 
-  SH_ERR_T_END    = 16
+  SH_ERR_T_END    = 13
 };
 
@@ -84,32 +81,32 @@
 /* set mask for message class
  */
-int sh_error_log_mask (const char * c);
-int sh_error_print_mask (const char * c);
-int sh_error_mail_mask (const char * c);
-int sh_error_export_mask (const char * c);
-int sh_error_syslog_mask (const char * c);
-int sh_error_external_mask (const char * c);
-int sh_error_database_mask (const char * c);
-int sh_error_prelude_mask (const char * c);
+int sh_error_log_mask (char * c);
+int sh_error_print_mask (char * c);
+int sh_error_mail_mask (char * c);
+int sh_error_export_mask (char * c);
+int sh_error_syslog_mask (char * c);
+int sh_error_external_mask (char * c);
+int sh_error_database_mask (char * c);
+int sh_error_prelude_mask (char * c);
 
 
-int sh_error_verify (const char * s);
-int sh_error_logverify_mod (const char * s); /* just list, don't verify */
-int sh_error_logverify (const char * s);
+int sh_error_verify (char * s);
+int sh_error_logverify_mod (char * s); /* just list, don't verify */
+int sh_error_logverify (char * s);
 
 void sh_error_dbg_switch(void);
 
 #ifdef SH_WITH_SERVER
-
 void sh_error_set_peer(const char * str);
-#ifdef HAVE_LIBPRELUDE
-void sh_error_set_peer_ip(const char * str);
-#endif
-int  set_flag_sep_log (const char * str);
+int  set_flag_sep_log (char * str);
 #endif
 
 /* init or re-init log facilities that need it
  */
-void sh_error_fixup(void);
+void sh_error_fixup();
+
+/* convert a string to a numeric priority
+ */ 
+int sh_error_convert_level (char * str_s);
 
 /* only to stderr (GOOD/BAD)
@@ -117,64 +114,60 @@
 void sh_error_only_stderr (int flag);
 
-/* facilities unsafe for closeall()
- */
-void sh_error_enable_unsafe (int flag);
-
 /* set syslog facility 
  */
-int  sh_log_set_facility (const char * c);
-
-/* map heartbeat messages 
- */
-int sh_log_set_stamp_priority (const char * c);
+int  sh_log_set_facility (char * c);
 
 /* define message header
  */
-int sh_error_ehead (/*@null@*/const char * s);
+int sh_error_ehead (/*@null@*/char * s);
 
 /* set level for error logging 
  */
-int sh_error_setlog(const char * str_s);
+int sh_error_setlog(char * str_s);
 
 /* set severity levels
  */
-int sh_error_set_iv (int iv, const char *  severity_s);
+int sh_error_set_iv (int iv, char *  severity_s);
 
 /* set priorities
  */
-int sh_error_set_level(const char * str_s, int *facility);
+int sh_error_set_level(char * str_s, int *facility);
 
 /* set level for TCP export
  */
-int sh_error_setexport(const char *  str_s);
+int sh_error_setexport(char *  str_s);
 
 /* set level for syslog
  */
-int sh_error_set_syslog (const char * flag_s);
+int sh_error_set_syslog (char * flag_s);
 
 /* set level for printing
  */
-int sh_error_setprint(const char *  flag_s);
+int sh_error_setprint(char *  flag_s);
 
 /* set severity for external
  */
-int sh_error_set_external (const char * str_s);
+int sh_error_set_external (char * str_s);
 
 /* set severity for external
  */
-int sh_error_set_database (const char * str_s);
+int sh_error_set_database (char * str_s);
 
 /* set severity for external
  */
-int sh_error_set_prelude (const char * str_s);
+int sh_error_set_prelude (char * str_s);
 
 
 /* set level for mailing
  */
-int sh_error_setseverity (const char * flag);
+int sh_error_setseverity (char * flag);
 
 /* set debug level
  */
 int sh_error_setdebug (char * debug_s);
+
+/* error messages
+ */
+/*@owned@*/char * sh_error_message (int tellme);
 
 /* switch on/off log to file temporarily
@@ -183,23 +176,17 @@
 void sh_error_logrestore(void);
 
-/* short errfile
- */
-void sh_efile_report();
-int sh_efile_path(const char * str);
-int sh_efile_group(const char * str);
-
 /* (re)set the console device(s)
  */
-int sh_log_set_console (const char * address);
+int sh_log_set_console (char * address);
 void reset_count_dev_console(void);
 
-/* close the message queue [no-op if !defined(WITH_MESSAGE_QUEUE)]
+#ifdef WITH_MESSAGE_QUEUE
+/* close the message queue
  */
 void close_ipc (void);
 
-#ifdef WITH_MESSAGE_QUEUE
 /* enable message queue
  */
-int enable_msgq(const char * foo);
+int enable_msgq(char * foo);
 #endif
  
Index: trunk/include/sh_error_min.h
===================================================================
--- trunk/include/sh_error_min.h	(revision 591)
+++ trunk/include/sh_error_min.h	(revision 1)
@@ -22,20 +22,6 @@
 /* this function should be called to report an error
  */
-void sh_error_handle (int flag, const char * file, long line, 
+void sh_error_handle (int flag, char * file, long line, 
 		      long errnum, unsigned long  msg_index, ...);
 
-/* this function should be called to (only) send mail
- */
-void sh_error_mail (const char * alias, int sev, 
-		    const char * file, long line, 
-		    long status, unsigned long msg_id, ...);
-
-/* convert a string to a numeric priority
- */ 
-int sh_error_convert_level (const char * str_s);
-
-/* error messages
- */
-char * sh_error_message (int tellme, char * str, size_t len);
-
 #endif
Index: trunk/include/sh_extern.h
===================================================================
--- trunk/include/sh_extern.h	(revision 591)
+++ trunk/include/sh_extern.h	(revision 1)
@@ -1,6 +1,4 @@
 #ifndef SH_EXTERN_H
 #define SH_EXTERN_H
-
-#include <stdarg.h>
 
 typedef struct 
@@ -12,7 +10,6 @@
   char   *  envv[32];
   char      checksum[KEY_LEN + 1];
-#if 0
+
   uid_t     trusted_users[32];
-#endif
   uid_t     run_user_uid;
   gid_t     run_user_gid;
@@ -39,20 +36,4 @@
 
 /*
- * -- generic simple safe popen; returns 0 on success, -1 otherwise,
- *    executes shell command
- */
-int sh_ext_popen_init (sh_tas_t * task, const char * command, char * argv0, ...) SH_GNUC_SENTINEL;
-
-/*
- * -- Execute command, return first line of output
- */
-int sh_ext_system (char * command, char * argv0, ...) SH_GNUC_SENTINEL;
-
-/*
- * -- Execute command, return first line of output
- */
-char * sh_ext_popen_str (const char * command);
-
-/*
  * -- close the pipe, clear and return task->exit_status
  */
@@ -62,5 +43,5 @@
  * -- add CL argument, return # of arguments
  */
-int sh_ext_tas_add_argv(sh_tas_t * tas, const char * val);
+int sh_ext_tas_add_argv(sh_tas_t * tas, char * val);
 /*
  * -- remove last CL argument
@@ -70,9 +51,9 @@
  * -- add environment variable, return # of variables
  */
-int sh_ext_tas_add_envv(sh_tas_t * tas, const char * key, const char * val);
+int sh_ext_tas_add_envv(sh_tas_t * tas, char * key, char * val);
 /*
  * -- set command
  */
-void sh_ext_tas_command(sh_tas_t * tas, const char * command);
+void sh_ext_tas_command(sh_tas_t * tas, char * command);
 /*
  * -- initialize task structure
@@ -90,10 +71,5 @@
  * -- start a new external command, and add it to the list
  */ 
-int sh_ext_setcommand(const char * cmd);
-
-/*
- * -- explicitely close a command
- */
-int sh_ext_close_command (const char * str);
+int sh_ext_setcommand(char * cmd);
 
 /* 
@@ -105,50 +81,50 @@
  * -- set deadtime
  */
-int sh_ext_deadtime (const char * str);
+int sh_ext_deadtime (char * str);
 
 /*
  * -- add keywords to the OR filter
  */
-int sh_ext_add_or (const char * str);
+int sh_ext_add_or (char * str);
 
 /*
  * -- add keywords to the AND filter
  */
-int sh_ext_add_and (const char * str);
+int sh_ext_add_and (char * str);
 
 /*
  * -- add keywords to the NOT filter
  */
-int sh_ext_add_not (const char * str);
+int sh_ext_add_not (char * str);
 
 /*
  * -- add keywords to the CL argument list
  */
-int sh_ext_add_argv (const char * str);
+int sh_ext_add_argv (char * str);
 
 /*
  * -- add a path to the environment
  */
-int sh_ext_add_default (const char * str);
+int sh_ext_add_default (char * str);
 
 /*
  * -- add an environment variable
  */
-int sh_ext_add_environ (const char * str);
+int sh_ext_add_environ (char * str);
 
 /*
  * -- define type
  */
-int sh_ext_type (const char * str);
+int sh_ext_type (char * str);
 
 /*
  * -- define checksum
  */
-int sh_ext_checksum (const char * str);
+int sh_ext_checksum (char * str);
 
 /*
  * -- choose privileges
  */
-int sh_ext_priv (const char * c);
+int sh_ext_priv (char * c);
 
 /*
Index: trunk/include/sh_fInotify.h
===================================================================
--- trunk/include/sh_fInotify.h	(revision 591)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-#ifndef SH_F_INOTIFY_H
-#define SH_F_INOTIFY_H
-
-int sh_fInotify_init(struct mod_type * arg);
-int sh_fInotify_timer(time_t tcurrent);
-int sh_fInotify_run(void);
-int sh_fInotify_reconf(void);
-int sh_fInotify_cleanup(void);
-
-extern sh_rconf sh_fInotify_table[];
-
-#endif
Index: trunk/include/sh_fifo.h
===================================================================
--- trunk/include/sh_fifo.h	(revision 591)
+++ trunk/include/sh_fifo.h	(revision 1)
@@ -10,5 +10,5 @@
  *****************************************************/
 
-#define SH_FIFO_MAX 16384
+#define SH_FIFO_MAX 128
 
 /*****************************************************
@@ -21,7 +21,4 @@
   struct dlist * next;
   char         * data;
-  char         * s_xtra;
-  int            i_xtra;
-  int            transact;
   struct dlist * prev;
 };
@@ -32,6 +29,4 @@
   int            fifo_cts;
 } SH_FIFO;
-
-#define SH_FIFO_INITIALIZER { NULL, NULL, 0 }
 
 /*****************************************************
@@ -44,6 +39,6 @@
  *
  */
-#define fifo_init(fifo_p) { (fifo_p)->fifo_cts = 0; (fifo_p)->head_ptr = NULL; \
-    (fifo_p)->tail_ptr = NULL; }
+#define fifo_init(fifo_p) { fifo_p->fifo_cts = 0; fifo_p->head_ptr = NULL; \
+ fifo_p->tail_ptr = NULL; }
 
 
@@ -52,6 +47,5 @@
  * Returns: -1 if the list is full, 0 on success 
  */
-int push_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str);
-#define sh_fifo_push(a, b) push_list((a), (b), 0, NULL)
+int push_list (SH_FIFO * fifo, char * indat);
 
 /* Push an item on the tail of the list.
@@ -59,6 +53,5 @@
  * Returns: -1 if the list is full, 0 on success 
  */
-int push_tail_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str);
-#define sh_fifo_push_tail(a, b) push_tail_list((a), (b), 0, NULL)
+int push_tail_list (SH_FIFO * fifo, char * indat);
 
 /* pop an item from the tail of the list
@@ -68,28 +61,4 @@
  */
 char * pop_list (SH_FIFO * fifo);
-#define sh_fifo_pop(a) pop_list((a))
-
-/* ----  Special functions -------------------------------------------------*/
-
-/* This is for eMail where different recipients may be eligible for         *
- * different subsets of messages. We need to delete all that were sent      *
- * to all intended recipients, and keep all with at least one failure.      */
-
-/* Iterate over list and check for each if it is valid for 'tag';
- * i.e. (item->s_extra == tag). If yes, add to the returned string.
- * If (okNull == False) then item->s_xtra must be defined
- */
-sh_string * tag_list (SH_FIFO * fifo, char * tag,
-		      int(*check)(int, const char*, const char*, const void*),
-		      const void * info, int okNull);
-
-/* Flag all tagged as candidate to keep */
-void rollback_list (SH_FIFO * fifo);
-/* Flag all tagged as candidate to delete */
-void mark_list (SH_FIFO * fifo);
-/* Remove all flags */
-void reset_list (SH_FIFO * fifo);
-/* Delete all marked for delete that are not flagged for keep */
-int commit_list (SH_FIFO * fifo);
 
 #endif
Index: trunk/include/sh_files.h
===================================================================
--- trunk/include/sh_files.h	(revision 591)
+++ trunk/include/sh_files.h	(revision 1)
@@ -21,53 +21,7 @@
 #define SH_FILES_H
 
-void sh_audit_mark (const char * file);
-void sh_audit_commit ();
-void sh_audit_delete_all ();
-int  sh_audit_set_flags(const char * str);
-char * sh_audit_fetch (char * file, time_t mtime, time_t ctime, time_t atime, char * result, size_t rsize);
-
-struct sh_dirent {
-  char             * sh_d_name;
-  struct sh_dirent * next;
-};
-
-/* Fix the check flags
- */
-void sh_files_fixup_mask (int class, unsigned long * check_flags);
-
-/* Dequote a filename in the config file
- */
-char * sh_files_parse_input(const char * str_s, size_t * len);
-
-/* Check whether a file is in the config 
- */
-char * sh_files_findfile(const char * path);
-
-/* Find the most specific directory in the config
- */
-char * sh_files_find_mostspecific_dir(const char * path);
-
-/* free a directory listing
- */
-void kill_sh_dirlist (struct sh_dirent * dirlist);
-
-#ifdef NEED_ADD_DIRENT
-/* add an entry to a directory listing
- */
-struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry, 
-				     struct sh_dirent * dirlist);
-#endif
-
 /* register exceptions to hardlink check
  */
-int sh_files_hle_reg (const char * str);
-
-/* Check for new files/dirs matching configured glob patterns.
- */
-void sh_files_check_globPatterns();
-
-/* Check for new files (only) matching configured glob patterns.
- */
-void sh_files_check_globFilePatterns();
+int sh_files_hle_reg (char * str);
 
 /* check the setup
@@ -81,9 +35,5 @@
 /* activate hardlink check
  */
-int sh_files_check_hardlinks (const char * opt);
-
-/* check  rsrc fork (Mac OS X)
- */
-int sh_files_use_rsrc(const char * str);
+int sh_files_check_hardlinks (char * opt);
 
 /* set recursion depth
@@ -93,9 +43,9 @@
 /* report only once
  */
-int sh_files_reportonce(const char * c);
+int sh_files_reportonce(char * c);
 
 /* report full details
  */
-int sh_files_fulldetail(const char * c);
+int sh_files_fulldetail(char * c);
 
 /* reset the 'checked' flag
@@ -109,5 +59,5 @@
 /* set maximum recursion level
  */
-int sh_files_setrecursion (const char * flag_s);
+int sh_files_setrecursion (char * flag_s);
 
 /* select a directory stack 2=Two, else One (standard)
@@ -117,98 +67,74 @@
 /* push a directory on the stack USER0
  */
-int  sh_files_pushdir_user0 (const char * dirName);
+int  sh_files_pushdir_user0 (char * dirName);
 
 /* push a directory on the stack USER1
  */
-int  sh_files_pushdir_user1 (const char * dirName);
-
-/* push a directory on the stack USER2
- */
-int  sh_files_pushdir_user2 (const char * dirName);
-
-/* push a directory on the stack USER3
- */
-int  sh_files_pushdir_user3 (const char * dirName);
-
-/* push a directory on the stack USER4
- */
-int  sh_files_pushdir_user4 (const char * dirName);
+int  sh_files_pushdir_user1 (char * dirName);
 
 /* push a directory on the stack PRELINK
  */
-int  sh_files_pushdir_prelink (const char * dirName);
+int  sh_files_pushdir_prelink (char * dirName);
 
 /* push a directory on the stack ATTR
  */
-int  sh_files_pushdir_attr (const char * dirName);
+int  sh_files_pushdir_attr (char * dirName);
 
 /* push a directory on the stack READONLY
  */
-int  sh_files_pushdir_ro (const char * dirName);
+int  sh_files_pushdir_ro (char * dirName);
 
 /* push a directory on the stack LOGFILE
  */
-int  sh_files_pushdir_log (const char * dirName);
+int  sh_files_pushdir_log (char * dirName);
 
 /* push a directory on the stack GROWING LOGFILE
  */
-int  sh_files_pushdir_glog (const char * dirName);
+int  sh_files_pushdir_glog (char * dirName);
 
 /* push a directory on the stack IGNORE NONE
  */
-int  sh_files_pushdir_noig (const char * dirName);
+int  sh_files_pushdir_noig (char * dirName);
 
 /* push a directory on the stack IGNORE ALL 
  */
-int  sh_files_pushdir_allig (const char * dirName);
+int  sh_files_pushdir_allig (char * dirName);
 
 
 /* push a file on the stack USER0
  */
-int  sh_files_pushfile_user0 (const char * dirName);
+int  sh_files_pushfile_user0 (char * dirName);
 
 /* push a file on the stack USER1
  */
-int  sh_files_pushfile_user1 (const char * dirName);
-
-/* push a file on the stack USER2
- */
-int  sh_files_pushfile_user2 (const char * dirName);
-
-/* push a file on the stack USER3
- */
-int  sh_files_pushfile_user3 (const char * dirName);
-
-/* push a file on the stack USER4
- */
-int  sh_files_pushfile_user4 (const char * dirName);
+int  sh_files_pushfile_user1 (char * dirName);
 
 /* push a file on the stack PRELINK
  */
-int  sh_files_pushfile_prelink (const char * dirName);
+int  sh_files_pushfile_prelink (char * dirName);
 
 /* push a file on the stack ATTR
  */
-int  sh_files_pushfile_attr (const char * dirName);
+int  sh_files_pushfile_attr (char * dirName);
 
 /* push a file on the stack READONLY
  */
-int  sh_files_pushfile_ro (const char * dirName);
+int  sh_files_pushfile_ro (char * dirName);
 
 /* push a file on the stack LOGFILE
  */
-int  sh_files_pushfile_log (const char * dirName);
+int  sh_files_pushfile_log (char * dirName);
 
 /* push a file on the stack GROWING LOGFILE
  */
-int  sh_files_pushfile_glog (const char * dirName);
+int  sh_files_pushfile_glog (char * dirName);
 
 /* push a file on the stack IGNORE NONE
  */
-int  sh_files_pushfile_noig (const char * dirName);
+int  sh_files_pushfile_noig (char * dirName);
 
 /* push a file on the stack IGNORE ALL
  */
-int  sh_files_pushfile_allig (const char * dirName);
+int  sh_files_pushfile_allig (char * dirName);
 
 
@@ -221,6 +147,4 @@
 unsigned long sh_files_chk       (void);
 
-int sh_files_delglobstack (void);
-
 int sh_files_deldirstack (void);
 
@@ -229,34 +153,14 @@
 /* redefine policies
  */
-int sh_files_redef_user0(const char * str);
-int sh_files_redef_user1(const char * str);
-int sh_files_redef_user2(const char * str);
-int sh_files_redef_user3(const char * str);
-int sh_files_redef_user4(const char * str);
-int sh_files_redef_prelink(const char * str);
-int sh_files_redef_readonly(const char * str);
-int sh_files_redef_loggrow(const char * str);
-int sh_files_redef_logfiles(const char * str);
-int sh_files_redef_attributes(const char * str);
-int sh_files_redef_noignore(const char * str);
-int sh_files_redef_allignore(const char * str);
+int sh_files_redef_user0(char * str);
+int sh_files_redef_user1(char * str);
+int sh_files_redef_prelink(char * str);
+int sh_files_redef_readonly(char * str);
+int sh_files_redef_loggrow(char * str);
+int sh_files_redef_logfiles(char * str);
+int sh_files_redef_attributes(char * str);
+int sh_files_redef_noignore(char * str);
+int sh_files_redef_allignore(char * str);
 
-ShFileType sh_files_filecheck (int class, unsigned long check_flags,
-			       const char * dirName, 
-			       const char * infileName,
-			       int * reported, 
-			       int rsrcflag);
-
-int sh_files_checkdir (int iclass, unsigned long check_flags, 
-		       int idepth, char * iname, 
-		       char * relativeName);
-
-int sh_files_search_file(char * name, int * class, 
-			 unsigned long *check_flags, int * reported);
-int sh_files_search_dir(char * name, int * class, 
-			unsigned long *check_flags, int *reported,
-			int * rdepth);
-void sh_files_set_file_reported(const char * name);
-void sh_files_clear_file_reported(const char * name);
 
 #endif
Index: trunk/include/sh_filter.h
===================================================================
--- trunk/include/sh_filter.h	(revision 591)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#ifndef SH_FILTER_H
-#define SH_FILTER_H
-
-/* Filtering
- */
-
-#define SH_FILT_NUM 32
-#define SH_FILT_OR  0
-#define SH_FILT_AND 1
-#define SH_FILT_NOT 2
-#define SH_FILT_INIT { 0, { NULL }, 0, { NULL }, 0, { NULL }}
-
-/* Pattern storage is of type void since it may be a char*
- * or a regex_t*
- */
-typedef struct _sh_filter_type
-{
-  int      for_c;
-  void   * for_v[SH_FILT_NUM];
-  int      fand_c;
-  void   * fand_v[SH_FILT_NUM];
-  int      fnot_c;
-  void   * fnot_v[SH_FILT_NUM];
-
-} sh_filter_type;
-
-int  sh_filter_add (const char * str, sh_filter_type * filter, int type);
-
-void sh_filter_free (sh_filter_type * filter);
-
-int  sh_filter_filter (const char * message, sh_filter_type * filter);
-
-sh_filter_type * sh_filter_alloc(void);
-
-#endif
Index: trunk/include/sh_forward.h
===================================================================
--- trunk/include/sh_forward.h	(revision 1)
+++ trunk/include/sh_forward.h	(revision 1)
@@ -0,0 +1,111 @@
+/* SAMHAIN file system integrity testing                                   */
+/* Copyright (C) 1999 Rainer Wichmann                                      */
+/*                                                                         */
+/*  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.              */
+
+#ifndef SH_FORWARD_H
+#define SH_FORWARD_H
+
+#ifndef SH_STANDALONE
+int sh_forward_set_strip (char * str);
+
+#endif
+
+/* generate a random password
+ */
+int sh_forward_create_password (char * dummy);
+
+/* set time limit
+ */
+int sh_forward_set_time_limit(char * str);
+
+/* error level for lookup failure
+ */
+int sh_forward_lookup_level (char * c);
+
+/* create client entry for given password
+ */
+int sh_forward_make_client (char * str);
+
+#ifdef SH_WITH_SERVER
+
+#ifdef INET_SYSLOG
+int set_syslog_active(char * c);
+#endif
+
+/* create socket and start listening
+ */
+void create_server_tcp_socket ();
+
+/* whether to use client address as known to the communication layer
+ * and set by accept()
+ */
+int set_socket_peer (char * c);
+
+/* whether to use client severity
+ */
+int sh_forward_use_clt_sev (char * c);
+
+/* whether to use client class
+ */
+int sh_forward_use_clt_class (char * c);
+
+/* server port
+ */
+int sh_forward_set_port(char * c);
+
+/* server interface
+ */
+int sh_forward_set_interface(char * c);
+
+/* a wrapper function
+ */
+void sh_forward_html_write(void);
+
+/* register a client
+ */
+int sh_forward_register_client (char * str);
+
+/* start server
+ */
+void sh_receive(void);
+
+/* free() everything
+ */
+void sh_forward_free_all (void);
+
+#endif
+
+#ifdef SH_WITH_CLIENT
+/* talk to server
+ */
+long  sh_forward (char * errmsg);
+
+
+/* request file from server. file may be "CONF" or "DATA".
+ */
+long sh_forward_req_file (char * file);
+
+/* set log server
+ */
+int sh_forward_setlogserver (char * address);
+void reset_count_dev_server(void);
+
+#endif
+
+#endif
+
Index: trunk/include/sh_gpg.h
===================================================================
--- trunk/include/sh_gpg.h	(revision 1)
+++ trunk/include/sh_gpg.h	(revision 1)
@@ -0,0 +1,46 @@
+/* SAMHAIN file system integrity testing                                   */
+/* Copyright (C) 1999 Rainer Wichmann                                      */
+/*                                                                         */
+/*  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.              */
+
+#if (defined(WITH_GPG) || defined(WITH_PGP))
+
+#ifndef SH_GPG_H
+#define SH_GPG_H
+/* this function exits if configuration file
+ * and/or database cannot be verified; otherwise returns 0
+ */
+int sh_gpg_check_sign (long file_1, long file_2, int what);
+
+#endif
+
+/* #ifdef WITH_GPG */
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/include/sh_gpg_chksum.h
===================================================================
--- trunk/include/sh_gpg_chksum.h	(revision 1)
+++ trunk/include/sh_gpg_chksum.h	(revision 1)
@@ -0,0 +1,53 @@
+#ifndef CHKSUM_H
+#define CHKSUM_H
+char gpgchk[50];
+gpgchk[0] = '4';
+gpgchk[1] = '0';
+gpgchk[2] = '7';
+gpgchk[3] = '8';
+gpgchk[4] = '4';
+gpgchk[5] = '6';
+gpgchk[6] = '0';
+gpgchk[7] = '1';
+gpgchk[8] = '7';
+gpgchk[9] = '5';
+gpgchk[10] = 'D';
+gpgchk[11] = '0';
+gpgchk[12] = '1';
+gpgchk[13] = 'B';
+gpgchk[14] = '4';
+gpgchk[15] = '4';
+gpgchk[16] = 'B';
+gpgchk[17] = '5';
+gpgchk[18] = 'E';
+gpgchk[19] = '3';
+gpgchk[20] = 'A';
+gpgchk[21] = '4';
+gpgchk[22] = '0';
+gpgchk[23] = 'E';
+gpgchk[24] = '4';
+gpgchk[25] = '4';
+gpgchk[26] = '0';
+gpgchk[27] = '1';
+gpgchk[28] = '6';
+gpgchk[29] = '3';
+gpgchk[30] = '3';
+gpgchk[31] = '3';
+gpgchk[32] = 'C';
+gpgchk[33] = 'F';
+gpgchk[34] = '3';
+gpgchk[35] = 'C';
+gpgchk[36] = '5';
+gpgchk[37] = '6';
+gpgchk[38] = 'A';
+gpgchk[39] = '7';
+gpgchk[40] = 'A';
+gpgchk[41] = 'B';
+gpgchk[42] = 'D';
+gpgchk[43] = '9';
+gpgchk[44] = '1';
+gpgchk[45] = '9';
+gpgchk[46] = '6';
+gpgchk[47] = '6';
+gpgchk[48] = '\0';
+#endif
Index: trunk/include/sh_guid.h
===================================================================
--- trunk/include/sh_guid.h	(revision 591)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#ifndef SH_GUID_H
-#define SH_GUID_H
-
-
-#define SH_UUID_BUF 37
-
-char * sh_uuid_generate_random(char * out, size_t len);
-
-/* return 0 if it looks like a uuid
- */
-int sh_uuid_check(const char * in);
-
-#endif
-
Index: trunk/include/sh_hash.h
===================================================================
--- trunk/include/sh_hash.h	(revision 591)
+++ trunk/include/sh_hash.h	(revision 1)
@@ -28,19 +28,7 @@
 #include "sh_error.h"
 
-/* the report_checkflags flag
- */
-int get_report_checkflags();
-
-/* whether to report checkflags
- */
-int set_report_checkflags(const char * c);
-
-/* convert to policy string
- */
-const char * sh_hash_getpolicy(int class);
-
 /* format a uint64
  */
-char * sh_hash_size_format(void);
+char * sh_hash_size_format();
 
 /* report on a missing file
@@ -48,41 +36,23 @@
 int hashreport_missing( char *fullpath, int level);
 
-/* remove internal db record for a file (checks for some flags).
+/* write database to stdout
  */
-void sh_hash_remove (const char * path);
+int sh_hash_pushdata_stdout (char * str);
 
-/* remove internal db record for a file
+/* version string for database
  */
-void sh_hash_remove_unconditional (const char * path);
+int sh_hash_version_string(char * str);
 
-/* Insert a "null" record in-memory (representing a missing file).
+/* List database content
  */
-void sh_hash_insert_null(char * str);
-
-#ifdef SH_DBIO_INT_H
-/* Check for "null" record
- */
-int sh_hash_is_null_record(sh_filestore_t * theFile);
-#endif
-
-/* Dont report on ctm/mtm change for directories
- */
-int sh_hash_loosedircheck(const char * str);
-
-/* List database content for a single file
- */
-int set_list_file (const char * c);
-
-/* Set the path of that file
- */
-char * get_list_file();
+int sh_hash_list_db (char * db_file);
 
 /* List database content with full detail
  */
-int set_full_detail (const char * c);
+int set_full_detail (char * c);
 
 /* List database content with full detail, comma delimited
  */
-int set_list_delimited (const char * c);
+int set_list_delimited (char * c);
 
 /* Read the database from disk.
@@ -90,24 +60,11 @@
 void sh_hash_init (void);
 
-/* Check init status
- */
-int sh_hash_get_initialized();
-
-/* Read the database from disk and fill sh.data.hash with checksum.
- */
-void sh_hash_init_and_checksum();
-
-/* Set status to 'database is read in'.
- */
-void sh_hash_set_initialized();
-
 /* Check whether a file is present in the database.
  */
-int sh_hash_have_it (const char * newname);
+int sh_hash_have_it (char * newname);
 
 /* Get a file if it is present in the database.
- * If fileHash != NULL also return checksum.
  */
-int sh_hash_get_it (const char * newname, file_type * tmpFile, char * fileHash);
+int sh_hash_get_it (char * newname, file_type * tmpFile);
 
 /* Delete the database from memory.
@@ -121,25 +78,9 @@
 /* reset sh_hash_pushdata to use 'update' in daemon mode
  */
-void sh_hash_pushdata_reset (void);
+void sh_hash_pushdata_reset ();
 
 /* Insert a file into the in-memory database.
  */ 
 void sh_hash_pushdata_memory (file_type * theFile, char * fileHash);
-
-/* Get file flags from in-memory database
- */
-int sh_hash_getflags (char * filename);
-
-/* Set file flags in in-memory database
- */
-int sh_hash_setflags (char * filename, int flags);
-
-/* Set a file flag in in-memory database
- */
-void sh_hash_set_flag  (char * filename, int flag);
-
-/* Unset a file flag in in-memory database
- */
-void sh_hash_clear_flag (char * filename, int flag_to_set);
 
 /* Compare a file with its status in the database.
@@ -151,8 +92,4 @@
  */
 void sh_hash_unvisited (ShErrLevel level);
-
-/* Search for unvisited entries in the database, custom error handler.
- */
-void sh_hash_unvisited_custom (char prefix, void(*handler)(const char * key));
 
 /* Set a file's status to 'visited'. This is required for
@@ -178,28 +115,18 @@
 int hash_full_tree (void); 
 
-/* Insert data.
- * 'key' -> path
- * 'str' -> binary with size 'size'
+/* Insert data
  */
-struct store2db {
-  UINT64 val0;
-  UINT64 val1;
-  UINT64 val2;
-  UINT64 val3;
-  char   checksum[KEY_LEN+1];
-  unsigned char * str;
-  int size;
-};
-
-void sh_hash_push2db (const char * key, struct store2db * save);
-
+void sh_hash_push2db (char * key, unsigned long val1, 
+		      unsigned long val2, unsigned long val3,
+		      unsigned char * str, int size);
 
 /* Retrieve data
  */
-char * sh_hash_db2pop (const char * key,  struct store2db * get);
-
+char * sh_hash_db2pop (char * key, unsigned long * val1, 
+		       unsigned long * val2, unsigned long * val3,
+		       int * size);
 
 /* Write out database
  */
-int sh_hash_writeout(void);
+int sh_hash_writeout();
 #endif
Index: trunk/include/sh_html.h
===================================================================
--- trunk/include/sh_html.h	(revision 591)
+++ trunk/include/sh_html.h	(revision 1)
@@ -53,5 +53,4 @@
   int                     encf_flag;
   int                     ency_flag;
-  int                     ivst_flag;
   int                     status_now;
   int                     status_arr[CLT_MAX];
Index: trunk/include/sh_ignore.h
===================================================================
--- trunk/include/sh_ignore.h	(revision 591)
+++ trunk/include/sh_ignore.h	(revision 1)
@@ -2,13 +2,11 @@
 #define SH_IGNORE_H
 
-int sh_ignore_add_del (const char * addpath);
-int sh_ignore_add_new (const char * addpath);
-int sh_ignore_add_mod (const char * addpath);
+int sh_ignore_add_del (char * addpath);
+int sh_ignore_add_new (char * addpath);
 
 int sh_ignore_chk_del (const char * chkpath);
 int sh_ignore_chk_new (const char * chkpath);
-int sh_ignore_chk_mod (const char * chkpath);
 
-int sh_ignore_clean (void);
+int sh_ignore_clean ();
 
 #endif
Index: trunk/include/sh_inotify.h
===================================================================
--- trunk/include/sh_inotify.h	(revision 591)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#ifndef SH_INOTIFY_H
-#define SH_INOTIFY_H
-
-#define SH_INOTIFY_MAX 128
-
-typedef struct 
-{
-  void * list_of_watches;
-  void * dormant_watches;
-
-  /*
-  int    watch[SH_INOTIFY_MAX];
-  int    flag[SH_INOTIFY_MAX];
-  char * file[SH_INOTIFY_MAX];
-  */
-
-  int     count;
-  int  max_count;
-} sh_watches;
-
-/* #define SH_INOTIFY_INITIALIZER { { 0 }, { 0 }, { NULL}, 0, 0 } */
-
-#define SH_INOTIFY_INITIALIZER { NULL, NULL, 0, 0 }
-
-#define SH_INOTIFY_FILE 0
-#define SH_INOTIFY_DIR  1
-
-int sh_inotify_wait_for_change(char * filename, sh_watches * watches, 
-			       int  * errnum,   int waitsec);
-
-int sh_inotify_rm_watch (sh_watches * watches, sh_watches * save, int wd);
-
-int sh_inotify_add_watch(char * filename, sh_watches * watches, int  * errnum,
-			 int class, unsigned long check_flags, int type, int rdepth);
-
-int sh_inotify_add_watch_later(const char * filename, sh_watches * watches, 
-			       int  * errnum,
-			       int class, unsigned long check_flags, 
-			       int type, int rdepth);
-
-char * sh_inotify_pop_dormant(sh_watches * watches, int * class, 
-			      unsigned long * check_flags, int * type, int * rdepth);
-
-void sh_inotify_purge_dormant(sh_watches * watches);
-void sh_inotify_remove(sh_watches * watches);
-void sh_inotify_init(sh_watches * watches);
-void sh_inotify_close();
-
-char * sh_inotify_search_item(sh_watches * watches, int watch, 
-			      int * class, unsigned long * check_flags, 
-			      int * type, int * rdepth);
-ssize_t sh_inotify_read(char * buffer, size_t count);
-ssize_t sh_inotify_read_timeout(char * buffer, size_t count, int timeout);
-int sh_inotify_recheck_watches (sh_watches * watches, sh_watches * save);
-
-#define SH_INOTIFY_ERROR(a) (a != 0)
-
-#endif
Index: trunk/include/sh_ipvx.h
===================================================================
--- trunk/include/sh_ipvx.h	(revision 591)
+++ 	(revision )
@@ -1,83 +1,0 @@
-#ifndef SH_IPVX_H
-#define SH_IPVX_H
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#if defined(USE_IPVX)
-#define SH_SSP_LEN(a) ((a)->ss_family == AF_INET) ? \
-	sizeof(struct sockaddr_in) : \
-	sizeof(struct sockaddr_in6)
-
-#define SH_SS_LEN(a) ((a).ss_family == AF_INET) ? \
-	sizeof(struct sockaddr_in) : \
-	sizeof(struct sockaddr_in6)
-#else
-#define SH_SSP_LEN(a) sizeof(struct sockaddr_in)
-#define SH_SS_LEN(a)  sizeof(struct sockaddr_in)
-#endif
-
-struct sh_sockaddr {
-  int ss_family;
-
-  struct sockaddr_in  sin;
-#if defined(USE_IPVX)
-  struct sockaddr_in6 sin6;
-#endif
-};
-
-/* Cast a sockaddress
- */
-struct sockaddr * sh_ipvx_sockaddr_cast (struct sh_sockaddr * ss);
-
-/* Compare with any_address
- */
-int sh_ipvx_isany (struct sh_sockaddr * a);
-
-/* Compare two addresses
- */
-int sh_ipvx_cmp(struct sh_sockaddr * a, struct sh_sockaddr * b);
-
-/* Set the port
- */
-int sh_ipvx_set_port(struct sh_sockaddr * ss, int port);
-
-/* Get the port
- */
-int sh_ipvx_get_port(struct sh_sockaddr * ss);
-
-/* Save a sockaddress
- */
-void sh_ipvx_save(struct sh_sockaddr * ss, int sa_family, struct sockaddr * sa);
-
-/* Ascii numerical sockaddress
- */
-char * sh_ipvx_print_sockaddr (struct sockaddr * sa, int sa_family);
-
-/* Determine whether the given address is numeric
- */
-int sh_ipvx_is_numeric (const char * addr);
-
-/* Convert a network address to an ascii numeric address
- */
-int sh_ipvx_ntoa (char * name, size_t name_size, struct sh_sockaddr * ss);
-
-/* Convert an ascii numeric address to a network address
- */
-int sh_ipvx_aton (const char * name, struct sh_sockaddr * ss);
-
-/* Try to find canonical hostname
- */
-char * sh_ipvx_canonical(const char * hostname, char * numeric, size_t nlen);
-
-/* Convert address to hostname
- */
-char * sh_ipvx_addrtoname(struct sh_sockaddr * ss);
-
-/* Try a reverse lookup
- */
-int sh_ipvx_reverse_check_ok (char * peer, int port, struct sh_sockaddr * ss);
-#endif
Index: trunk/include/sh_kern.h
===================================================================
--- trunk/include/sh_kern.h	(revision 1)
+++ trunk/include/sh_kern.h	(revision 1)
@@ -0,0 +1,30 @@
+
+#ifndef SH_KERN_H
+#define SH_KERN_H
+
+#include "sh_modules.h"
+
+#ifdef SH_USE_KERN
+int sh_kern_init  (void);
+int sh_kern_timer (time_t tcurrent);
+int sh_kern_check (void);
+int sh_kern_end   (void);
+int sh_kern_null  (void);
+
+int sh_kern_set_activate (char * c);
+int sh_kern_set_severity (char * c);
+int sh_kern_set_timer    (char * c);
+int sh_kern_set_idt      (char * c);
+
+/* FIXME: document these */
+int sh_kern_set_sct_addr (char * c);
+int sh_kern_set_sc_addr  (char * c);
+int sh_kern_set_proc_root (char * c);
+int sh_kern_set_proc_root_lookup (char * c);
+int sh_kern_set_proc_root_iops (char * c);
+
+extern sh_rconf sh_kern_table[];
+#endif
+
+/* #ifndef SH_UTMP_H */
+#endif
Index: trunk/include/sh_log_check.h
===================================================================
--- trunk/include/sh_log_check.h	(revision 591)
+++ 	(revision )
@@ -1,138 +1,0 @@
-#ifndef SH_LOGCHECK_H
-#define SH_LOGCHECK_H
-
-#include <sys/types.h>
-#include <time.h>
-
-/* Convert a struct tm to unix timestamp with caching 
- */
-time_t conv_timestamp (struct tm * btime, 
-		       struct tm * old_tm, time_t * old_time);
-
-/* Definition of a log record entry, to be returned from parsing function.
- */
-#define PID_INVALID 0
-struct sh_logrecord 
-{
-  char      * filename;
-  sh_string * host;
-  sh_string * timestr;
-  pid_t       pid;
-  time_t      timestamp;
-  sh_string * message;
-};
-
-#define SH_LOGFILE_MOVED  (1<<0)
-#define SH_LOGFILE_REWIND (1<<1)
-#define SH_LOGFILE_PIPE   (1<<2)
-#define SH_LOGFILE_NOFILE (1<<3)
-
-struct sh_logfile 
-{
-  FILE * fp;
-  int    flags;
-  char * filename;
-  dev_t  device_id;
-  ino_t  inode;
-  fpos_t offset;
-
-  /* Info for the parser, e.g. a regular expression
-   */
-  void * fileinfo;
-
-  /* Callback function to read the next record
-   */
-  sh_string *           (*get_record)  (sh_string * record, 
-					struct sh_logfile * logfile);
-
-  /* Callback function to parse the record into standard format
-   */
-  struct sh_logrecord * (*parse_record)(sh_string * logline, void * fileinfo);
-
-  struct sh_logfile * next;
-};
-
-/* Generic callback function to parse fileinfo. 
- */
-void * sh_eval_fileinfo_generic(char * str);
-
-/* Generic parser info. 
- */
-struct sh_logrecord * sh_parse_generic (sh_string * logline, void * fileinfo);
-
-
-/****************************************************************
- **
- ** Parsing and reading functions
- **/
-
-/* Open file, position at stored offset. */
-int sh_open_for_reader (struct sh_logfile * logfile);
-
-/* Simple line reader for executed shell command   */ 
-sh_string * sh_command_reader (sh_string * record, 
-			       struct sh_logfile * logfile);
-
-/* Wrapper for sh_command_reader */
-sh_string * sh_read_shell (sh_string * record, struct sh_logfile * logfile);
-
-/* Parses a shell command reply. */
-struct sh_logrecord * sh_parse_shell (sh_string * logline, void * fileinfo);
-
-/* Simple line reader.   */ 
-sh_string * sh_default_reader (sh_string * record, 
-			       struct sh_logfile * logfile);
-
-/* Continued line reader.   */ 
-sh_string * sh_cont_reader (sh_string * record, 
-			    struct sh_logfile * logfile, char * cont);
-
-/* Binary reader */
-sh_string * sh_binary_reader (void * s, size_t size, struct sh_logfile * logfile);
-
-/* Parses a syslog-style line. */
-struct sh_logrecord * sh_parse_syslog (sh_string * logline, void * fileinfo);
-
-/* Format info for apache log. */
-void * sh_eval_fileinfo_apache(char * str);
-
-/* Parses a apache-style line. */
-struct sh_logrecord * sh_parse_apache (sh_string * logline, void * fileinfo);
-
-/* Get a pacct record */
-sh_string * sh_read_pacct (sh_string * record, struct sh_logfile * logfile);
-
-/* Parses a pacct record. */
-struct sh_logrecord * sh_parse_pacct (sh_string * logline, void * fileinfo);
-
-/* Get a samba record */
-sh_string * sh_read_samba (sh_string * record, struct sh_logfile * logfile);
-
-/* Parses a samba record. */
-struct sh_logrecord * sh_parse_samba (sh_string * logline, void * fileinfo);
-
-
-/**
-*****************************************************************/
-
-int sh_get_hidepid();
-int sh_set_hidepid(const char *s);
-
-#define SH_MAX_LCODE_SIZE 16
-
-struct sh_logfile_type 
-{
-  char code[SH_MAX_LCODE_SIZE];
-
-  /* read callback */
-  /*@null@*/sh_string * (*get_record)  (sh_string * record,
-					struct sh_logfile * logfile);
-  /* parsing callback */
-  struct sh_logrecord * (*parse_record)(sh_string * logline, void * fileinfo);
-
-  /* evaluate fileinfo */
-  void * (*eval_fileinfo)(char * str); 
-};
-
-
-#endif
Index: trunk/include/sh_log_correlate.h
===================================================================
--- trunk/include/sh_log_correlate.h	(revision 591)
+++ 	(revision )
@@ -1,28 +1,0 @@
-#ifndef SH_LOG_CORRELATE_H
-#define SH_LOG_CORRELATE_H
-
-/* Clean up everything.
- */
-void sh_keep_destroy();
-
-/* Add an event 
- */
-int sh_keep_add(sh_string * label, unsigned long delay, time_t last);
-
-/* Add an event sequence matching rule 
- */
-int sh_keep_match_add(const char * str, const char * queue, const char * pattern);
-
-/* Delete the list of event sequence matching rules
- */
-void sh_keep_match_del();
-
-/* Try to find correlated events
- */
-void sh_keep_match();
-
-/* Deadtime for a correlation rule
- */
-int sh_keep_deadtime (const char * str);
-
-#endif
Index: trunk/include/sh_log_evalrule.h
===================================================================
--- trunk/include/sh_log_evalrule.h	(revision 591)
+++ 	(revision )
@@ -1,61 +1,0 @@
-#ifndef SH_EVALRULE_H
-#define SH_EVALRULE_H
-
-/* Clean up everything.
- */
-void sh_eval_cleanup();
-
-/* Define a new reporting queue, str := label:interval:(report|sum):severity
- */
-int sh_eval_qadd (const char * str);
-
-/* Add a new rule, str := queue:regex
- * If there is an open group, add it to its rules.
- * ..else, add it to the currently open host (open the
- * default host, if there is no open one)
- */
-int sh_eval_radd (const char * str);
-
-/* Open a new host group definition.
- */
-int sh_eval_hadd (const char * str);
-/*
- * End the host definition
- */
-int sh_eval_hend (const char * str);
-
-
-/* Open a new group definition. If a host is currently open, 
- * the new group will automatically be added to that host.
- */
-int sh_eval_gadd (const char * str);
-/*
- * End the group definition
- */
-int sh_eval_gend (const char * str);
-
-/* Process a single log record
- */
-int sh_eval_process_msg(struct sh_logrecord * record);
-
-enum policies {
-  EVAL_REPORT,
-  EVAL_SUM
-};
-
-struct sh_qeval  /* Queue with definitions */
-{
-  sh_string       * label;
-  enum policies     policy;
-  int               severity;
-  sh_string       * alias;
-  time_t            interval;        /* if EVAL_SUM, interval   */ 
-  struct sh_qeval * next;
-};
-
-struct sh_qeval * sh_log_find_queue(const char * str);
-
-int sh_log_lookup_severity(const char * str);
-sh_string * sh_log_lookup_alias(const char * str);
-
-#endif
Index: trunk/include/sh_log_mark.h
===================================================================
--- trunk/include/sh_log_mark.h	(revision 591)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef SH_LOG_MARK_H
-#define SH_LOG_MARK_H
-
-void sh_log_mark_destroy();
-
-int sh_log_mark_add (const char * label, time_t interval, const char * qlabel);
-
-void sh_log_mark_update (sh_string * label, time_t timestamp);
-
-void sh_log_mark_check();
-
-int sh_log_set_mark_severity (const char * str);
-
-#endif
Index: trunk/include/sh_log_repeat.h
===================================================================
--- trunk/include/sh_log_repeat.h	(revision 591)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef SH_LOG_REPEAT_H
-#define SH_LOG_REPEAT_H
-
-int sh_repeat_set_trigger (const char * str);
-
-int sh_repeat_set_queue (const char * str);
-
-int sh_repeat_set_cron (const char * str);
-
-int sh_repeat_message_check (const sh_string * host, 
-			     const sh_string * msg, 
-			     time_t ltime);
-
-#endif
Index: trunk/include/sh_logmon.h
===================================================================
--- trunk/include/sh_logmon.h	(revision 591)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#ifndef SH_LOGMON_H
-#define SH_LOGMON_H
-
-extern sh_rconf sh_log_check_table[];
-
-int sh_log_check_init (struct mod_type * arg);
-int sh_log_check_timer(time_t tcurrent);
-int sh_log_check_check(void);
-int sh_log_check_reconf(void); 
-int sh_log_check_cleanup(void);
-
-#endif
Index: trunk/include/sh_mail.h
===================================================================
--- trunk/include/sh_mail.h	(revision 591)
+++ trunk/include/sh_mail.h	(revision 1)
@@ -26,17 +26,17 @@
 /* set a relay server
  */
-int sh_mail_set_relay (const char * str_s);
+int sh_mail_set_relay (char * str_s);
 
 /* send to all recpts. in one mail
  */
-int sh_mail_setFlag (const char * str);
+int sh_mail_setFlag (char * str);
 
 /* set the subject string 
  */
-int set_mail_subject (const char * str);
+int set_mail_subject (char * str);
 
 /* test mailbox
  */
-int sh_mail_sigverify (const char * s);
+int sh_mail_sigverify (char * s);
 
 /* maximum number of mail attempts
@@ -44,21 +44,25 @@
 #define SH_MAX_FAIL    48
 
-int sh_mail_setNum (const char * str);
+int sh_mail_setNum (char * str);
 
-int sh_mail_setaddress (const char * address);
+int sh_mail_setaddress (char * address);
 void reset_count_dev_mail(void);
-int sh_mail_setaddress_int (const char * address);
+int sh_mail_setaddress_int (char * address);
 
 /* call if not urgent
  */
-int sh_mail_pushstack (int severity, const char * msg, const char * alias);
+int sh_mail_pushstack (/*@null@*/char * msg);
 
-/* Set the port to use (default 25)
+/* call if mail immediate
  */
-int sh_mail_set_port (const char * str);
+int sh_mail_msg (/*@null@*/char * message);
 
 /* set sender of mail
  */
-int sh_mail_set_sender (const char *str);
+int sh_mail_set_sender (char *str);
+
+int sh_mail_add_or  (char * str);
+int sh_mail_add_and (char * str);
+int sh_mail_add_not (char * str);
 
 #endif
Index: trunk/include/sh_mail_int.h
===================================================================
--- trunk/include/sh_mail_int.h	(revision 591)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#ifndef SH_MAIL_INT_H
-#define SH_MAIL_INT_H
-
-extern int sh_mail_all_in_one;
-
-/* MX Resolver Struct
- */
-typedef struct mx_ {
-  int    pref;
-  char * address;
-} mx;
-
-typedef struct dnsrep_ {
-  int    count;
-  mx   * reply;
-} dnsrep;
-
-int free_mx (dnsrep * answers);
-
-/* adress struct
- */
-struct alias {
-  sh_string        * recipient;
-  struct alias     * recipient_list;
-  dnsrep           * mx_list;
-  int                severity;
-  short              send_mail;
-  short              isAlias;
-  sh_filter_type   * mail_filter;
-  struct alias     * next;
-  struct alias     * all_next;
-};
-
-extern struct alias * all_recipients;
-
-int sh_mail_msg (const char * message);
-
-/* Per recipient mail key
- */
-
-int sh_nmail_get_mailkey (const char * alias, char * buf, size_t bufsiz,
-			  time_t * id_audit);
-
-SH_MUTEX_EXTERN(mutex_listall);
-SH_MUTEX_EXTERN(mutex_fifo_mail);
-extern SH_FIFO * fifo_mail;
-
-#endif
Index: trunk/include/sh_mem.h
===================================================================
--- trunk/include/sh_mem.h	(revision 591)
+++ trunk/include/sh_mem.h	(revision 1)
@@ -35,24 +35,13 @@
 #define SH_FREE(a)   sh_mem_free((a), FIL__, __LINE__)
 #define SH_ALLOC(a)  sh_mem_malloc((a), FIL__, __LINE__) 
-#define SH_OALLOC(a,b,c)  sh_mem_malloc((a), (b), (c)) 
 
 #else
 
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#undef  SH_GNUC_MALLOC
-#define SH_GNUC_MALLOC   __attribute__((malloc))
-#else
-#undef  SH_GNUC_MALLOC
-#define SH_GNUC_MALLOC
-#endif
 
 void   sh_mem_free (/*@only@*//*@out@*//*@null@*/ void * a);
-/*@only@*//*@notnull@*/void * sh_mem_malloc (size_t size) SH_GNUC_MALLOC;
+/*@only@*//*@notnull@*/void * sh_mem_malloc (size_t size);
 
 #define SH_FREE(a)   sh_mem_free(a)
 #define SH_ALLOC(a)  sh_mem_malloc(a)
-#define SH_OALLOC(a,b,c)  ((void) (b),		 \
-			   (void) (c),		 \
-			   sh_mem_malloc(a))	 \
 
 #endif
Index: trunk/include/sh_modules.h
===================================================================
--- trunk/include/sh_modules.h	(revision 591)
+++ trunk/include/sh_modules.h	(revision 1)
@@ -2,13 +2,4 @@
 #ifndef SH_MODULE_H
 #define SH_MODULE_H
-
-#include "sh_pthread.h"
-
-enum
-  {
-    SH_MODFL_NOTIMER    = (1 << 0),
-    SH_MODFL_NEEDPAUSED = (1 << 1),
-    SH_MODFL_ISPAUSED   = (1 << 2)
-  };
 
 
@@ -16,5 +7,5 @@
 {
   char * the_opt;
-  int (*func)(const char * opt);
+  int (*func)(char * opt);
 } sh_rconf;
 
@@ -27,9 +18,6 @@
   int    initval; 
 
-  /* Flags: SH_MOD_NOTIMER                                     */
-  int    flags; 
-
   /* The initialization function. Return 0 on success.         */
-  int (* mod_init)    (struct mod_type * arg);  
+  int (* mod_init)    (void);  
                              
   /* The timer function. Return 0 if NOT time to check.        */
@@ -37,5 +25,4 @@
 
   /* The check function. Return 0 on success.                  */
-  /* Return nonzero on fatal error or if module is disabled.   */
   int (* mod_check)   (void); 
 
@@ -52,6 +39,4 @@
   sh_rconf * conf_table; 
 
-  SH_MUTEX(mod_mutex);
-
 } sh_mtype;
 
Index: trunk/include/sh_mounts.h
===================================================================
--- trunk/include/sh_mounts.h	(revision 591)
+++ trunk/include/sh_mounts.h	(revision 1)
@@ -11,5 +11,5 @@
 
 #ifdef SH_USE_MOUNTS
-int sh_mounts_init  (struct mod_type * arg);
+int sh_mounts_init  (void);
 int sh_mounts_timer (time_t tcurrent);
 int sh_mounts_check (void);
Index: trunk/include/sh_nmail.h
===================================================================
--- trunk/include/sh_nmail.h	(revision 591)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#ifndef SH_NMAIL_H
-#define SH_NMAIL_H
-
-int sh_nmail_pushstack (int level, const char * message, 
-			const char * alias);
-int sh_nmail_msg (int level, const char * message, 
-		  const char * alias);
-int sh_nmail_flush ();
-void sh_nmail_free();
-
-int sh_nmail_set_severity (const char * str);
-int sh_nmail_add_not (const char * str);
-int sh_nmail_add_and (const char * str);
-int sh_nmail_add_or  (const char * str);
-
-int sh_nmail_close_recipient(const char * str);
-int sh_nmail_add_compiled_recipient(const char * str);
-int sh_nmail_add_recipient(const char * str);
-int sh_nmail_add_alias(const char * str);
-#endif
Index: trunk/include/sh_portcheck.h
===================================================================
--- trunk/include/sh_portcheck.h	(revision 591)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-#ifndef SH_PORTCHECK_H
-#define SH_PORTCHECK_H
-
-int sh_portchk_init(struct mod_type * arg);
-int sh_portchk_timer(time_t tcurrent);
-int sh_portchk_check(void);
-int sh_portchk_reconf(void);
-int sh_portchk_cleanup(void);
-
-extern sh_rconf sh_portchk_table[];
-
-#endif
Index: trunk/include/sh_prelink.h
===================================================================
--- trunk/include/sh_prelink.h	(revision 591)
+++ trunk/include/sh_prelink.h	(revision 1)
@@ -6,13 +6,13 @@
  * alert_timeout: timeout for read
  */
-int sh_prelink_run (char * path, char * file_hash, int alert_timeout, unsigned long mask);
+int sh_prelink_run (char * path, char * file_hash, int alert_timeout);
 
 /* return S_TRUE if ELF file, S_FALSE otherwise
  */
-int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout, char * path);
+int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout);
 
 /* configuration
  */
-int sh_prelink_set_path (const char * str);
-int sh_prelink_set_hash (const char * str);
+int sh_prelink_set_path (char * str);
+int sh_prelink_set_hash (char * str);
 #endif
Index: trunk/include/sh_prelude.h
===================================================================
--- trunk/include/sh_prelude.h	(revision 591)
+++ trunk/include/sh_prelude.h	(revision 1)
@@ -2,19 +2,19 @@
 #define SH_PRELUDE_H
 
-void sh_prelude_reset(void);
-void sh_prelude_stop(void);
-int  sh_prelude_init(void);
+void sh_prelude_reset();
+void sh_prelude_stop();
+int  sh_prelude_init();
 
-int sh_prelude_set_profile(const char *arg);
+int sh_prelude_set_profile(char *arg);
 
 int sh_prelude_alert (int priority, int class, char * message,
-		      long msgflags, unsigned long msgid, char * inet_peer_ip);
+		      long msgflags, unsigned long msgid);
 
 /* map severity levels
  */
-int sh_prelude_map_info (const char * str);
-int sh_prelude_map_low (const char * str);
-int sh_prelude_map_medium (const char * str);
-int sh_prelude_map_high (const char * str);
+int sh_prelude_map_info (char * str);
+int sh_prelude_map_low (char * str);
+int sh_prelude_map_medium (char * str);
+int sh_prelude_map_high (char * str);
 
 #endif
Index: trunk/include/sh_processcheck.h
===================================================================
--- trunk/include/sh_processcheck.h	(revision 591)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-#ifndef SH_PROCESSCHECK_H
-#define SH_PROCESSCHECK_H
-
-int sh_prochk_init(struct mod_type * arg);
-int sh_prochk_timer(time_t tcurrent);
-int sh_prochk_check(void);
-int sh_prochk_reconf(void);
-int sh_prochk_cleanup(void);
-
-extern sh_rconf sh_prochk_table[];
-
-#endif
Index: trunk/include/sh_pthread.h
===================================================================
--- trunk/include/sh_pthread.h	(revision 591)
+++ 	(revision )
@@ -1,180 +1,0 @@
-#ifndef SH_PTHREAD_H
-#define SH_PTHREAD_H
-
-#ifdef HAVE_PTHREAD
-
-#include <pthread.h>
-
-#define SH_MUTEX(M)				pthread_mutex_t M
-#define SH_MUTEX_INIT(M,I)			pthread_mutex_t M = I
-#define SH_MUTEX_STATIC(M,I)			static pthread_mutex_t M = I
-#define SH_MUTEX_EXTERN(M)			extern pthread_mutex_t M
-
-#define SH_SETSIGMASK(A, B, C)                  sh_pthread_setsigmask(A,B,C)
-
-int sh_pthread_setsigmask(int how, const void *set, void *oldset);
-
-/* pthread_mutex_unlock() has the wrong type (returns int), so
- * we need to wrap it in this function.
- */
-extern void sh_pthread_mutex_unlock (void *arg);
-
-#define SH_MUTEX_LOCK(M)						   \
-	do {                                                               \
-                int oldtype;                                               \
-		int executeStack = 1;                                      \
-		pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);  \
-                pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\
-                pthread_mutex_lock(&(M))
-
-#define SH_MUTEX_TRYLOCK(M)						   \
-	do {                                                               \
-                int oldtype;                                               \
-		volatile int executeStack = 0;                             \
-		pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);  \
-                pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\
-                if (0 == pthread_mutex_trylock(&(M))) {		           \
-		  executeStack = 1
-
-#define SH_MUTEX_TRYLOCK_UNLOCK(M)					   \
-                }                                                          \
-		pthread_cleanup_pop(executeStack);                         \
-                pthread_setcanceltype(oldtype, NULL);                      \
-	} while (0)
-
-#define SH_MUTEX_UNLOCK(M)						   \
-		pthread_cleanup_pop(executeStack);                         \
-                pthread_setcanceltype(oldtype, NULL);                      \
-	} while (0)
-
-#define SH_MUTEX_LOCK_UNSAFE(M) pthread_mutex_lock(&(M))
-#define SH_MUTEX_TRYLOCK_UNSAFE(M) pthread_mutex_trylock(&(M))
-#define SH_MUTEX_UNLOCK_UNSAFE(M) pthread_mutex_unlock(&(M))
-
-
-/*
- * ----   Recursive mutex  ----
- */
-#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
-
-#define SH_MUTEX_RECURSIVE(M)                                          \
-static pthread_mutex_t M;                                              \
-static void M ## _init (void)                                          \
-{                                                                      \
-  pthread_mutexattr_t   mta;                                           \
-  pthread_mutexattr_init(&mta);                                        \
-  pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);            \
-  pthread_mutex_init(&(M), &mta);                                      \
-  pthread_mutexattr_destroy(&mta);                                     \
-  return;                                                              \
-}                                                                      \
-static pthread_once_t  M ## _initialized = PTHREAD_ONCE_INIT
-
-#define SH_MUTEX_RECURSIVE_INIT(M)                                     \
-(void) pthread_once(&(M ## _initialized), (M ## _init))
-
-#define SH_MUTEX_RECURSIVE_LOCK(M)					   \
-	do {                                                               \
-                int oldtype;                                               \
-		pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);  \
-                pthread_cleanup_push(sh_pthread_mutex_unlock, (void*)&(M));\
-                pthread_mutex_lock(&(M))
-
-#define SH_MUTEX_RECURSIVE_UNLOCK(M)					   \
-		pthread_cleanup_pop(1);                                    \
-                pthread_setcanceltype(oldtype, NULL);                      \
-	} while (0)
-
-#else
-/* !defined(PTHREAD_MUTEX_RECURSIVE) */
- struct sh_RMutex {
-
-  pthread_mutex_t lock;
-  unsigned int    held;
-  unsigned int    waiters;
-  pthread_t       tid;
-  pthread_cond_t  cv;
-};
-
-void sh_RMutexLock(struct sh_RMutex * tok);
-void sh_RMutexUnlock(void * arg);
-void sh_InitRMutex(struct sh_RMutex * tok);
-
-#define SH_MUTEX_RECURSIVE(M)                                          \
-static struct sh_RMutex M;                                             \
-static void M ## _init (void)                                          \
-{                                                                      \
-  sh_InitRMutex(&(M));                                                 \
-  return;                                                              \
-}                                                                      \
-static pthread_once_t  M ## _initialized = PTHREAD_ONCE_INIT
-
-#define SH_MUTEX_RECURSIVE_INIT(M)                                     \
-(void) pthread_once(&(M ## _initialized), (M ## _init))
-
-#define SH_MUTEX_RECURSIVE_LOCK(M)					   \
-	do {                                                               \
-                int oldtype;                                               \
-		pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);  \
-                pthread_cleanup_push(sh_RMutexUnlock, (void*)&(M));        \
-                sh_RMutexLock(&(M))
-
-#define SH_MUTEX_RECURSIVE_UNLOCK(M)					   \
-		pthread_cleanup_pop(1);                                    \
-                pthread_setcanceltype(oldtype, NULL);                      \
-	} while (0)
-
-#endif
-/* 
- * ----   Global mutexes   ----
- */
-SH_MUTEX_EXTERN(mutex_skey);
-SH_MUTEX_EXTERN(mutex_resolv);
-SH_MUTEX_EXTERN(mutex_pwent);
-SH_MUTEX_EXTERN(mutex_readdir);
-/* Prevent threads from logging while we are in suspend */
-SH_MUTEX_EXTERN(mutex_thread_nolog);
-
-/*
- * ----   Initialize thread-specific conversion area   ----
- */
-extern int sh_g_thread(void);
-
-
-/*
- * ----   Functions for threaded modules   ----
- */
-int sh_pthread_create(void *(*start_routine)(void*), void *arg);
-int sh_pthread_cancel_all(void);
-void sh_threaded_module_reconf(void *arg);
-void * sh_threaded_module_run(void *arg);
-
-#else
-
-#define SH_SETSIGMASK(A, B, C)                  sh_pthread_setsigmask(A,B,C)
-
-int sh_pthread_setsigmask(int how, const void *set, void *oldset);
-
-#define PTHREAD_MUTEX_INITIALIZER               NULL
-#define SH_MUTEX(M)				void *SH_MUTEX_DUMMY_ ## M
-#define SH_MUTEX_INIT(M,I)			extern void *SH_MUTEX_DUMMY_ ## M
-#define SH_MUTEX_STATIC(M,I)			extern void *SH_MUTEX_DUMMY_ ## M
-#define SH_MUTEX_EXTERN(M)			extern void *SH_MUTEX_DUMMY_ ## M
-#define SH_MUTEX_LOCK(M)			((void)0)
-#define SH_MUTEX_TRYLOCK(M)			((void)0)
-#define SH_MUTEX_UNLOCK(M)			((void)0)
-#define SH_MUTEX_TRYLOCK_UNLOCK(M)		((void)0)
-#define SH_MUTEX_LOCK_UNSAFE(M)			((void)0)
-#define SH_MUTEX_TRYLOCK_UNSAFE(M)		(0)
-#define SH_MUTEX_UNLOCK_UNSAFE(M)		((void)0)
-
-#define SH_MUTEX_RECURSIVE(M)                   extern void *SH_MUTEX_DUMMY_ ## M
-#define SH_MUTEX_RECURSIVE_INIT(M)              ((void)0)
-#define SH_MUTEX_RECURSIVE_LOCK(M)		((void)0)
-#define SH_MUTEX_RECURSIVE_UNLOCK(M)		((void)0)
-
-/* #ifdef HAVE_PTHREAD */
-#endif
-
-/* #ifndef SH_PTHREAD_H */
-#endif
Index: trunk/include/sh_registry.h
===================================================================
--- trunk/include/sh_registry.h	(revision 591)
+++ 	(revision )
@@ -1,13 +1,0 @@
-
-#ifndef SH_REGISTRY_H
-#define SH_REGISTRY_H
-
-int sh_reg_check_init(struct mod_type * arg);
-int sh_reg_check_timer(time_t tcurrent);
-int sh_reg_check_run(void);
-int sh_reg_check_reconf(void);
-int sh_reg_check_cleanup(void);
-
-extern sh_rconf sh_reg_check_table[];
-
-#endif
Index: trunk/include/sh_restrict.h
===================================================================
--- trunk/include/sh_restrict.h	(revision 591)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#ifndef SH_RESTRICT_H
-#define SH_RESTRICT_H
-
-int  sh_restrict_define(const char * str);
-void sh_restrict_purge ();
-int  sh_restrict_this(const char * path, UINT64 size, UINT64 perm, SL_TICKET fh);
-int  sh_restrict_add_ftype(const char * str);
-
-#endif
Index: trunk/include/sh_sem.h
===================================================================
--- trunk/include/sh_sem.h	(revision 591)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef SH_SEM_H
-#define SH_SEM_H
-
-#define SH_SEM_LOCK       -1
-#define SH_SEM_UNLOCK      1
-
-void sh_sem_open();
-void sh_sem_trylock();
-void sh_sem_lock();
-void sh_sem_unlock(long val);
-void sh_sem_close();
-
-int  sh_sem_wait(const char * wait);
-#endif
Index: trunk/include/sh_sig.h
===================================================================
--- trunk/include/sh_sig.h	(revision 591)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#if defined(WITH_SIG) 
-
-#ifndef SH_SIG_H
-#define SH_SIG_H
-
-typedef enum {
-  SIG_CONF,
-  SIG_DATA
-} ShSigFile;
-
-/* Top level function to verify file.
- */
-SL_TICKET sh_sig_extract_signed(SL_TICKET fd);
-SL_TICKET sh_sig_extract_signed_data(SL_TICKET fd);
-
-/* this function exits if configuration file
- * and/or database cannot be verified; otherwise returns 0
- */
-int sh_sig_check_signature (SL_TICKET file, ShSigFile what);
-
-int sh_sig_msg_start(const char * line);
-int sh_sig_msg_startdata(const char * line);
-int sh_sig_msg_end(const char * line);
-int sh_sig_data_end(const char * line);
-
-/* log successful startup
- */
-void sh_sig_log_startup (void);
-
-#endif
-
-/* #ifdef WITH_SIG */
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: trunk/include/sh_socket.h
===================================================================
--- trunk/include/sh_socket.h	(revision 591)
+++ trunk/include/sh_socket.h	(revision 1)
@@ -8,10 +8,5 @@
 
 #if defined (SH_WITH_CLIENT)
-char * sh_socket_get_uuid(int * errflag, unsigned int * count, time_t * last);
-int    sh_socket_store_uuid(const char * cmd);
-int    sh_socket_return_uuid(const char * uuid, unsigned int count, time_t last);
-void   sh_socket_server_cmd(const char * srvcmd);
-int    set_delta_retry_interval(const char * str);
-int    set_delta_retry_count(const char * str);
+void sh_socket_server_cmd(const char * srvcmd);
 #endif
 
@@ -19,9 +14,10 @@
 
 
-int    sh_socket_open_int (void);
-int    sh_socket_remove (void);
+int    sh_socket_open_int ();
+int    sh_socket_remove ();
 char * sh_socket_check(const char * client_name);
-int    sh_socket_poll(void);
+int    sh_socket_poll();
 void   sh_socket_add2reload (const char * clt);
+
 
 #endif
Index: trunk/include/sh_srp.h
===================================================================
--- trunk/include/sh_srp.h	(revision 591)
+++ trunk/include/sh_srp.h	(revision 1)
@@ -21,5 +21,5 @@
 void sh_srp_x (char * salt, char * password);
 int  sh_srp_make_a (void);
-char * sh_srp_M (char * x1, char * x2, char * x3, char * buf, size_t size);
+char * sh_srp_M (char * x1, char * x2, char * x3);
 
 char * sh_srp_verifier (void);
Index: trunk/include/sh_static.h
===================================================================
--- trunk/include/sh_static.h	(revision 591)
+++ trunk/include/sh_static.h	(revision 1)
@@ -15,19 +15,7 @@
 void  sh_setpwent(void);
 struct group * sh_getgrnam(const char *name);
-int sh_getgrnam_r(const char *name, struct group *gbuf,
-               char *buf, size_t buflen, struct group **gbufp);
-
 struct passwd * sh_getpwnam(const char *name);
-int sh_getpwnam_r(const char *name, struct passwd *pwbuf,
-               char *buf, size_t buflen, struct passwd **pwbufp);
-
 struct group * sh_getgrgid(gid_t gid);
-int sh_getgrgid_r(gid_t gid, struct group *gbuf,
-	       char *buf, size_t buflen, struct group **gbufp);
-
 struct passwd * sh_getpwuid(uid_t uid);
-int sh_getpwuid_r(uid_t uid, struct passwd *pwbuf,
-               char *buf, size_t buflen, struct passwd **pwbufp);
-
 #endif
 
@@ -40,15 +28,9 @@
 
 #define sh_initgroups initgroups
-#define sh_getgrnam   getgrnam
-#define sh_getgrnam_r getgrnam_r
 #define sh_getgrgid   getgrgid
-#define sh_getgrgid_r getgrgid_r
+#define sh_getpwent   getpwent
 #define sh_getpwnam   getpwnam
-#define sh_getpwnam_r getpwnam_r
 #define sh_getpwuid   getpwuid
-#define sh_getpwuid_r getpwuid_r
-#define sh_getpwent   getpwent
 #define sh_endpwent   endpwent
-#define sh_setpwent   setpwent
 
 #define sh_gethostbyaddr gethostbyaddr
Index: trunk/include/sh_string.h
===================================================================
--- trunk/include/sh_string.h	(revision 591)
+++ 	(revision )
@@ -1,112 +1,0 @@
-#ifndef SH_STRING_H
-#define SH_STRING_H
-
-#include <stdio.h>
-
-/* String definition and utility functions.
- */
-typedef struct sh_str_struct
-{
-  char * str; /* always NULL terminated               */
-  size_t len; /* without terminating \0               */
-  size_t siz; /* size of allocated buffer             */
-} sh_string;
-
-sh_string * sh_string_new(size_t size);
-void sh_string_destroy(sh_string ** s);
-#define sh_string_str(a) ((a)->str)
-#define sh_string_len(a) ((a)->len)
-
-/* concat string to sh_string
- */
-sh_string * sh_string_cat_lchar(sh_string * s, const char * str, size_t len);
-
-/* add char array to end of string */
-sh_string * sh_string_add_from_char(sh_string * s, const char * str);
-
-/* set sh_string from string
- */
-sh_string * sh_string_set_from_char(sh_string * s, const char * str);
-
-/* create new sh_string from array of given length
- */
-sh_string * sh_string_new_from_lchar(const char * str, size_t len);
-
-#define sh_string_copy(a)  ((a) ? sh_string_new_from_lchar(((a)->str), ((a)->len)) : NULL)
-#define sh_string_add(a,b) ((a && b) ? sh_string_cat_lchar((a), ((b)->str), ((b)->len)) : NULL)
-
-/* create new sh_string from three arrays of given length
- */
-sh_string * sh_string_new_from_lchar3(const char * str1, size_t len1,
-                                      const char * str2, size_t len2,
-                                      const char * str3, size_t len3);
-
-/* Truncate to desired length.
- */
-sh_string * sh_string_truncate(sh_string * s, size_t len);
-
-/* If requested increase is zero, increase by default amount. 
- */
-sh_string * sh_string_grow(sh_string * s, size_t increase);
-
-/* Read a string from a file, with maxlen. Return 0 on EOF,
- * -1 on error, and -2 if a line exceeds maxlen.
- */
-size_t sh_string_read(sh_string * s, FILE * fp, size_t maxlen);
-
-/* Read a string from a file, with maxlen. Return 0 on EOF,
- * -1 on error, and -2 if a line exceeds maxlen.
- * If 'cont' != NULL, continuation lines starting with a char
- * in 'cont' are concatenated.
- */
-size_t sh_string_read_cont(sh_string * s, FILE * fp, size_t maxlen, char *cont);
-
-/* Split array at delim in at most nfields fields. 
- * Empty fields are returned as empty (zero-length) strings. 
- * Leading and trailing WS are removed from token. 
- * The number of fields is returned in 'nfields', their
- * lengths in 'lengths'.
- * A single delimiter will return two empty fields.
- * The returned array is allocated memory, and its fields
- * are modified parts of the 'line' parameter.
- */
-char ** split_array(char *line, unsigned int * nfields, 
-                    char delim, size_t * lengths);
-
-/* Split array at whitespace in at most nfields fields.
- * Multiple whitespaces are collapsed. 
- * Empty fields are returned as empty (zero-length) strings.
- * The number of fields is returned in nfields.
- * An empty string will return zero fields.
- * If nfields < actual fields, last string will be remainder.
- * The returned array is allocated memory, and its fields
- * are modified parts of the 'line' parameter.
- */
-char ** split_array_ws(char *line, unsigned int * nfields, size_t * lengths);
-
-/* Same as above, but split on [space, tab, comma]
- */ 
-char ** split_array_list(char *line, unsigned int * nfields, size_t * lengths);
-
-/* Same as above, but split on delimiter list (token)
- */ 
-char ** split_array_token (char *line, 
-			   unsigned int * nfields, size_t * lengths,
-			   const char * token);
-
-/* Return a split_array_list() of a list contained in 'PREFIX\s*( list ).*'
- */
-char ** split_array_braced (char *line, const char * prefix,
-			    unsigned int * nfields, size_t * lengths);
-
-/* Replaces fields in s with 'replacement'. Fields are given
- * in the ordered array ovector, comprising ovecnum pairs 
- * ovector[i], ovector[i+1] which list offset of first char
- * of field, offset of first char after field (this is how
- * the pcre library does it).
- */  
-sh_string * sh_string_replace(const sh_string * s, 
-                              const size_t * ovector, int ovecnum, 
-                              const char * replacement, size_t rlen);
-
-#endif
Index: trunk/include/sh_sub.h
===================================================================
--- trunk/include/sh_sub.h	(revision 591)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#ifndef SH_SUB_H
-#define SH_SUB_H
-
-void sh_kill_sub ();
-int sh_sub_stat  (const char *path, struct stat *buf);
-int sh_sub_lstat (const char *path, struct stat *buf);
-
-#endif
Index: trunk/include/sh_subuid.h
===================================================================
--- trunk/include/sh_subuid.h	(revision 591)
+++ 	(revision )
@@ -1,24 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2018 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-/* These functions return NULL if the subuid/subgid is not found;
- * else the user/group name is returned (needs to be copied).
- */
-char * sh_get_subuid (unsigned long subuid);
-char * sh_get_subgid (unsigned long subgid);
Index: trunk/include/sh_suidchk.h
===================================================================
--- trunk/include/sh_suidchk.h	(revision 591)
+++ trunk/include/sh_suidchk.h	(revision 1)
@@ -6,21 +6,20 @@
 
 #ifdef SH_USE_SUIDCHK
-int sh_suidchk_init   (struct mod_type * arg);
-int sh_suidchk_timer  (time_t tcurrent);
-int sh_suidchk_check  (void);
-int sh_suidchk_end    (void);
-int sh_suidchk_reconf (void);
+int sh_suidchk_init  (void);
+int sh_suidchk_timer (time_t tcurrent);
+int sh_suidchk_check (void);
+int sh_suidchk_end   (void);
+int sh_suidchk_free_schedule (void);
 
-int sh_suidchk_set_activate   (const char * c);
-int sh_suidchk_set_severity   (const char * c);
-int sh_suidchk_set_timer      (const char * c);
-int sh_suidchk_set_schedule   (const char * c);
-int sh_suidchk_set_exclude    (const char * c);
-int sh_suidchk_set_fps        (const char * c);
-int sh_suidchk_set_yield      (const char * c);
-int sh_suidchk_set_nosuid     (const char * c);
-int sh_suidchk_set_quarantine (const char * c);
-int sh_suidchk_set_qmethod    (const char * c);
-int sh_suidchk_set_qdelete    (const char * c);
+int sh_suidchk_set_activate   (char * c);
+int sh_suidchk_set_severity   (char * c);
+int sh_suidchk_set_timer      (char * c);
+int sh_suidchk_set_schedule   (char * c);
+int sh_suidchk_set_exclude    (char * c);
+int sh_suidchk_set_fps        (char * c);
+int sh_suidchk_set_yield      (char * c);
+int sh_suidchk_set_quarantine (char * c);
+int sh_suidchk_set_qmethod    (char * c);
+int sh_suidchk_set_qdelete    (char * c);
 
 
Index: trunk/include/sh_tiger.h
===================================================================
--- trunk/include/sh_tiger.h	(revision 591)
+++ trunk/include/sh_tiger.h	(revision 1)
@@ -7,11 +7,4 @@
 #include "samhain.h"
 
-typedef long int TigerType;
-
-#define TIGER_FILE -1
-#define TIGER_DATA -2
-
-/****************
-typedef long int TigerType;
 typedef enum {
   TIGER_FILE,
@@ -19,41 +12,30 @@
   TIGER_DATA
 } TigerType;
-*****************/
 
-#define TIGER_NOLIM ((UINT64)-1)
+extern SL_TICKET tiger_fd;
 
 /* the checksum function
  */
-char * sh_tiger_hash (const char * filename, TigerType what, 
-		      UINT64 Length, char * out, size_t len);
+/*@owned@*/ char * sh_tiger_hash (char * filename, TigerType what, 
+				  unsigned long Length);
 
 /* NEW Thu Oct 18 19:59:08 CEST 2001
  */
-int sh_tiger_hashtype (const char * c);
+int sh_tiger_hashtype (char * c);
 char * sh_tiger_generic_hash (char * filename, TigerType what, 
-			      UINT64 * Length, int timeout, 
-			      char * out, size_t len);
+			      unsigned long Length, int timeout);
 
 UINT32 * sh_tiger_hash_uint32 (char * filename, 
 			       TigerType what, 
-			       UINT64 Length, UINT32 * out, size_t len);
+			       unsigned long Length);
 
 /* get the type of hash function used
  * 0 = tiger192, 1 = sha1, 2 = md5
  */
-int sh_tiger_get_hashtype (void);
+int sh_tiger_get_hashtype ();
 
-/* set the hash fuction in use in the mask
+/* GnuPG-like format
  */
-void sh_tiger_get_mask_hashtype(unsigned long * mask);
-
-
-/* reset the hash function to the one in the mask
- */
-void sh_tiger_set_hashtype_mask(unsigned long mask);
-
-/* GnuPG-like format, returns allocated memory
- */
-/*@owned@*/ char * sh_tiger_hash_gpg (const char * filename, TigerType what, 
-				      UINT64 Length);
+/*@owned@*/ char * sh_tiger_hash_gpg (char * filename, TigerType what, 
+			  unsigned long Length);
 #endif
Index: trunk/include/sh_tools.h
===================================================================
--- trunk/include/sh_tools.h	(revision 591)
+++ trunk/include/sh_tools.h	(revision 1)
@@ -8,27 +8,17 @@
  */
 #define SH_PROTO_SRP (1 << 0)
-#define SH_PROTO_IVA (1 << 1)
 #define SH_PROTO_MSG (1 << 2)
 #define SH_PROTO_BIG (1 << 3)
 #define SH_PROTO_END (1 << 4)
-#define SH_PROTO_EN1 (1 << 5)
+#define SH_PROTO_ENC (1 << 5)
 #define SH_PROTO_EN2 (1 << 6)
-#define SH_PROTO_ENC (SH_PROTO_EN1|SH_PROTO_EN2)
 #define SH_MASK_ENC (SH_PROTO_ENC|SH_PROTO_EN2)
 
 #ifdef SH_ENCRYPT
-/* returns pointer to errbuf
- */
-char * errorExplain (int err_num, char * errbuf, size_t len);
+char * errorExplain (int err_num);
 #endif
 
-/* Returns non-zero if interface exists
- */
-int sh_tools_iface_is_present(char *str);
-
-/* returns allocated buffer
- */
 char * sh_tools_safe_name(const char * str, int flag);
-
+int is_numeric (const char * address);
 int connect_port (char * address, int port, 
 		  char * ecall, int * errnum, char * errmsg, int errsiz);
@@ -36,8 +26,5 @@
 		    char * ecall, int * errnum, char * errmsg, int errsiz);
 void delete_cache(void);
-
-/* returns pointer to errbuf
- */
-char * sh_tools_errmessage (int tellme, char * errbuf, size_t len);
+char * sh_tools_errmessage (int tellme);
 
 
@@ -46,9 +33,7 @@
 #if defined (SH_WITH_SERVER)
 
-unsigned char sh_tools_probe_store(unsigned char protocol, int * probe_flag);
-
 int get_open_max (void);
 
-void put_header (/*@out@*/unsigned char * head, const int protocol, 
+void put_header (/*@out@*/unsigned char * head, int protocol, 
 		 unsigned long * length, char * u);
 
@@ -56,22 +41,11 @@
 int check_request_nerr (char * have, char * need);
 
-/* returns allocated buffer
- */
 char * hash_me (char * key, char * buf,   int buflen);
 int sh_tools_hash_vfy(char * key, char * buf, int buflen);
 
-/* returns allocated buffer
- */
-char * get_client_conf_file (const char * peer, unsigned long * length);
+char * get_client_conf_file (char * peer, unsigned long * length);
+char * get_client_data_file (char * peer, unsigned long * length);
 
-/* returns allocated buffer
- */
-char * get_client_data_file (const char * peer, unsigned long * length);
-
-/* returns allocated buffer
- */
-char * get_client_uuid_file (const char * peer, unsigned long * length, const char * uuid);
 #endif
-
 
 unsigned long read_port (int sockfd, char *buf, unsigned long nbytes, 
@@ -79,7 +53,5 @@
 
 
-#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
-
-void sh_tools_probe_reset();
+#if defined (SH_WITH_CLIENT)
 
 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 
@@ -93,9 +65,8 @@
 		 unsigned long * length, char * u);
 
-/*
-  SL_TICKET open_tmp (void);
-  int close_tmp (SL_TICKET fd);
-  int rewind_tmp (SL_TICKET fd);
-*/
+
+SL_TICKET open_tmp (void);
+int close_tmp (SL_TICKET fd);
+int rewind_tmp (SL_TICKET fd);
 
 void sh_tools_server_cmd(const char * srvcmd);
@@ -107,9 +78,4 @@
 #endif
 
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)
-SL_TICKET open_tmp (void);
-int close_tmp (SL_TICKET fd);
-int rewind_tmp (SL_TICKET fd);
-#endif
 
 #endif
Index: trunk/include/sh_trace.h
===================================================================
--- trunk/include/sh_trace.h	(revision 591)
+++ trunk/include/sh_trace.h	(revision 1)
@@ -5,23 +5,11 @@
 /* This file should be included via samhain.h only.
  */
-#ifdef SL_DEBUG
-#define SDG_0RETU _("return.\n")
-#define SDG_TERRO _("ERROR: file=<%s>, line=<%d>, reason=<%s>\n")
-#define SDG_AERRO _("ERROR: file=<%s>, line=<%d>, failed_assertion=<%s>\n")
-#define SDG_AFAIL _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n")
-#define SDG_ENTER _("enter=<%s>\n")
-#define SDG_RETUR _("return=<%s>.\n")
-#define SDG_ERROR _("error=<%ld>.\n")
-#endif
 
 #ifdef SL_DEBUG
 #define ASSERT(expr, expr1) \
       if (!(expr)) \
-	{ \
-         fprintf(stderr,	    \
+         fprintf(stderr, \
 		 SDG_AERRO, \
-		 FIL__, __LINE__, expr1 ); \
-          abort(); \
-	}
+		 FIL__, __LINE__, expr1 );
 
 
Index: trunk/include/sh_unix.h
===================================================================
--- trunk/include/sh_unix.h	(revision 591)
+++ trunk/include/sh_unix.h	(revision 1)
@@ -23,10 +23,5 @@
 #define SH_UNIX_H
 
-/* For PATH_MAX */
 #include <limits.h>
-#if !defined(PATH_MAX)
-#define PATH_MAX 1024
-#endif
-
 #include <unistd.h>
 #include "samhain.h"
@@ -54,6 +49,4 @@
   SH_FILE_FIFO,
   SH_FILE_SOCKET,
-  SH_FILE_DOOR,
-  SH_FILE_PORT,
   SH_FILE_UNKNOWN
 } ShFileType;
@@ -68,5 +61,4 @@
 /* inode        */
 #define MODI_INO (1 << 2)
-
 /* user         */
 #define MODI_USR (1 << 3)
@@ -75,5 +67,4 @@
 /* mtime        */
 #define MODI_MTM (1 << 5)
-
 /* ctime        */
 #define MODI_CTM (1 << 6)
@@ -82,42 +73,10 @@
 /* size         */
 #define MODI_SIZ (1 << 8)
-
 /* file mode    */
 #define MODI_MOD (1 << 9)
 /* hardlinks    */
 #define MODI_HLN (1 << 10)
-/* device type   */
+/* device num   */
 #define MODI_RDEV (1 << 11)
-
-/* size may grow   */
-#define MODI_SGROW (1 << 12)
-/* use prelink     */
-#define MODI_PREL (1 << 13)
-/* get content     */
-#define MODI_TXT ((1 << 14)|MODI_CHK)
-#define MODI_TXT_ENABLED(a) (((a)&(1 << 14))!=0)
-
-/* get audit record  */
-#define MODI_AUDIT (1 << 15)
-#define MODI_AUDIT_ENABLED(a) (((a)&(1 << 15))!=0)
-/* do not check  */
-#define MODI_NOCHECK (1 << 16)
-/* do not check  */
-#define MODI_ALLIGNORE (1 << 17)
-
-#define MODI_TIGER192  0x01000000UL
-#define MODI_SHA1      0x02000000UL
-#define MODI_MD5       0x03000000UL
-#define MODI_SHA256    0x04000000UL
-#define MODI_HASHTYPE  0x0F000000UL
-
-#define MODI_INIT 0xD0000000UL
-#define MODI_INITIALIZED(a) (((a) & 0xF0000000UL) == MODI_INIT)
-
-#define MODI_SET(a, b) ((a) |= (b))
-#define MODI_CLEAR(a, b) ((a) &= ~(b))
-#define MODI_ISSET(a, b) (((a) & (b)) != 0)
-
-#define SH_TXT_MAX 9200
 
 #define MASK_ALLIGNORE_  0
@@ -127,5 +86,5 @@
 #define MASK_LOGFILES_   (MASK_ATTRIBUTES_|MODI_HLN|MODI_LNK|MODI_INO)
 extern  unsigned long mask_LOGFILES;
-#define MASK_LOGGROW_    (MASK_LOGFILES_|MODI_SIZ|MODI_SGROW|MODI_CHK) 
+#define MASK_LOGGROW_    (MASK_LOGFILES_|MODI_SIZ) 
 extern  unsigned long mask_LOGGROW;
 #define MASK_READONLY_   (MASK_LOGFILES_|MODI_CHK|MODI_SIZ|MODI_MTM|MODI_CTM)
@@ -136,15 +95,12 @@
 extern  unsigned long mask_USER0;
 extern  unsigned long mask_USER1;
-extern  unsigned long mask_USER2;
-extern  unsigned long mask_USER3;
-extern  unsigned long mask_USER4;
-/* like READONLY, but without MTM,CTM,SIZ,INO, and with PREL)
- */
-#define MASK_PRELINK_   (MASK_ATTRIBUTES_|MODI_HLN|MODI_LNK|MODI_CHK|MODI_PREL)
+/* like READONLY, but without MTM,CTM,SIZ,INO)
+ */
+#define MASK_PRELINK_   (MASK_ATTRIBUTES_|MODI_HLN|MODI_LNK|MODI_CHK)
 extern  unsigned long mask_PRELINK;
 
 typedef struct file_struct {
-  unsigned long    check_flags;
-  int              file_reported;
+  unsigned long    check_mask;
+  int              reported;
   char             fullpath[PATH_MAX];
   ShFileType       type;
@@ -153,9 +109,9 @@
   mode_t           mode;
   nlink_t          hardlinks;
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
   unsigned long    attributes;
-  char             c_attributes[ATTRBUF_SIZE];
-#endif
-  char             c_mode[CMODE_SIZE];
+  char             c_attributes[16];
+#endif
+  char             c_mode[11];
   uid_t            owner;
   char             c_owner[USER_MAX+2];
@@ -170,59 +126,28 @@
   time_t           ctime;
 
-  char           * link_path;
+  char             linkpath[PATH_MAX];
   mode_t           linkmode;
   char             link_c_mode[11];
   int              linkisok;
-  char           * attr_string;
 } file_type;
 
-extern int sh_unix_check_selinux;
-extern int sh_unix_check_acl;
-
-/* destroy userid cache 
- */
-void sh_userid_destroy ();
-
-/* --- run a command, securely --- 
- */
-int sh_unix_run_command (const char * str);
-
-/* Ignore SIGPIPE
- */
-void sh_unix_ign_sigpipe();
-
 /* mlock utilities
  */
-int sh_unix_mlock(const char * file, int line, void * addr, size_t len);
+int sh_unix_mlock(void * addr, size_t len);
 int sh_unix_munlock(void * addr, size_t len);
-int sh_unix_count_mlock(void);
-/* public for unit tests */
-int sh_unix_pagesize(void);
-unsigned long sh_unix_lookup_page(void * in_addr, size_t len, int * num_pages);
+int sh_unix_count_mlock();
 
 /* chroot directory
  */
-int sh_unix_set_chroot(const char * str);
+int sh_unix_set_chroot(char * str);
 
 /* whether to use localtime for file timesatams in logs
  */
-int sh_unix_uselocaltime (const char * c);
-
-/* whether to perform selinux/acl checks
- */ 
-#ifdef USE_XATTR
-int sh_unix_setcheckselinux (const char * c);
-#endif
-#ifdef USE_ACL
-int sh_unix_setcheckacl (const char * c);
-#endif
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-int sh_unix_setcheckattributes (const char * c);
-#endif
+int sh_unix_uselocaltime (char * c);
 
 /* set I/O limit
  */
-int  sh_unix_set_io_limit (const char * c);
-void sh_unix_io_pause (void);
+int  sh_unix_set_io_limit (char * c);
+void sh_unix_io_pause ();
 
 /* get file type
@@ -232,9 +157,9 @@
 /* reset masks for policies
  */
-int sh_unix_maskreset(void);
+int sh_unix_maskreset();
 
 /* return true if database is remote
  */
-int file_is_remote (void);
+int file_is_remote ();
 
 /* return the path to the configuration/database file
@@ -248,9 +173,6 @@
 /* close all files >= fd, except possibly one
  */
-void sh_unix_closeall (int fd, int except, int inchild);
-
-/* Check whether directory for pid file exists
- */
-int sh_unix_check_piddir (char * pidpath);
+void sh_unix_closeall (int fd, int except);
+
 
 /* write lock for filename
@@ -264,14 +186,14 @@
 /* write the PID file
  */
-int sh_unix_write_pid_file(void);
+int sh_unix_write_pid_file();
 
 /* rm the PID file
  */
-int sh_unix_rm_pid_file(void);
+int sh_unix_rm_pid_file();
 
 
 /* checksum of own binary
  */
-int sh_unix_self_hash (const char * c);
+int sh_unix_self_hash (char * c);
 
 /* return BAD on failure
@@ -281,9 +203,9 @@
 /* add a trusted user to the list 
  */
-int tf_add_trusted_user(const char *);
+int tf_add_trusted_user(char *);
 
 /* check a file 
  */
-int tf_trust_check (const char * file, int mode);
+int tf_trust_check (char * file, int mode);
 
 /* initialize group vector
@@ -298,5 +220,5 @@
 /* set the timeserver address
  */
-int sh_unix_settimeserver (const char * address);
+int sh_unix_settimeserver (char * address);
 void reset_count_dev_time(void);
 
@@ -307,14 +229,14 @@
 /* deamon mode 
  */
-int sh_unix_setdeamon  (const char * dummy);
-int sh_unix_setnodeamon(const char * dummy);
+int sh_unix_setdeamon  (char * dummy);
+int sh_unix_setnodeamon(char * dummy);
 
 /* Test whether file exists
  */
-int sh_unix_file_exists(char * path);
+int sh_unix_file_stat(char * path);
 
 /* test whether file exists with proper attributes
  */
-int sh_unix_device_readable(int fd);
+int sh_unix_file_exists(int fd);
 
 /* local host
@@ -331,12 +253,7 @@
 /* int sh_unix_is_secure_dir (ShErrLevel level, char * tmp); */
 
-/* check whether there's a rotated log with the correct inode and checksum 
- */
-int sh_check_rotated_log (const char * path,  
-			  UINT64 old_size, UINT64 old_inode, const char * old_hash, unsigned long mask);
-
 /* obtain file info
  */
-int sh_unix_getinfo (int level, const char * filename, file_type * theFile, 
+int sh_unix_getinfo (int level, char * filename, file_type * theFile, 
 		     char * fileHash, int flagrel);
 
@@ -349,11 +266,11 @@
 int  sh_unix_init(int goDaemon);
 
-/* for local time use thetime = 0, returns pointer to buffer 
- */
-char * sh_unix_time (time_t thetime, char * buffer, size_t len);
-
-/* convert to GMT time, returns pointer to buffer
- */
-char * sh_unix_gmttime (time_t thetime, char * buffer, size_t len);
+/* for local time use thetime = 0 
+ */
+/*@owned@*/ char * sh_unix_time (time_t thetime);
+
+/* convert to GMT time
+ */
+char * sh_unix_gmttime (time_t thetime);
 
 /* effective user info
@@ -361,11 +278,8 @@
 int  sh_unix_getUser (void);
 
-/* get home directory, , returns pointer to out
- */
-char *  sh_unix_getUIDdir (int level, uid_t uid, char * out, size_t len);
-
-/* get a group GID 
- */
-long sh_group_to_gid (const char * g, int * fail);
+/* get home directory
+ */
+char *  sh_unix_getUIDdir (int level, uid_t uid);
+
 
 #ifdef HAVE_GETTIMEOFDAY
@@ -389,22 +303,19 @@
 
 void   sh_sigtrap_handler (int signum);
+extern volatile int sh_not_traced;
 
 #ifdef HAVE_GETTIMEOFDAY
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
 #endif
-
-struct sh_sigtrap_variables {
-  int not_traced;
-#ifdef HAVE_GETTIMEOFDAY
-  struct timeval save_tv;
-#endif
-};
-
-struct sh_sigtrap_variables * sh_sigtrap_variables_get();
-
-int sh_sigtrap_max_duration_set (const char * str);
+#endif
+extern struct timeval  save_tv;
+#endif
 
 static inline
@@ -425,26 +336,19 @@
 int sh_derr(void)
 {
-  struct sh_sigtrap_variables * sigtrap_variables;
-  sigtrap_variables = sh_sigtrap_variables_get();
-  if (sigtrap_variables == NULL) {
-    /* Perhaps, its better to not die, and to continue using Samhain,
-       even if this part does not work. */
-    return (0);
-  }
-
-  sigtrap_variables->not_traced = 0;
+  sh_not_traced = 0;
 
 #ifdef HAVE_GETTIMEOFDAY
-  gettimeofday(&sigtrap_variables->save_tv, NULL);
-#endif
-
-  /* raise() sends to same thread, like pthread_kill(pthread_self(), sig); 
-   */
+  gettimeofday(&save_tv, NULL);
+#endif
+
+#if defined(__linux__) && defined(__GNUC__) && defined(__i386__)
+  __asm__ __volatile__ ("int $0x03");
+#else
   raise(SIGTRAP);
+#endif
   
-  if (sigtrap_variables->not_traced == 0)
+  if (sh_not_traced == 0)
     _exit(5);
-
-  sigtrap_variables->not_traced = 0;
+  sh_not_traced = 0;
   return (0);
 }
Index: trunk/include/sh_userfiles.h
===================================================================
--- trunk/include/sh_userfiles.h	(revision 591)
+++ trunk/include/sh_userfiles.h	(revision 1)
@@ -9,5 +9,5 @@
 
 #ifdef SH_USE_USERFILES
-int sh_userfiles_init  (struct mod_type * arg);
+int sh_userfiles_init  (void);
 int sh_userfiles_timer (time_t tcurrent);
 int sh_userfiles_check (void);
@@ -16,9 +16,9 @@
 int sh_userfiles_reconf (void);
 
-int sh_userfiles_set_uid (const char * str);
-int sh_userfiles_add_file(const char *c);
-int sh_userfiles_set_interval(const char *c);
-int sh_userfiles_set_active(const char *c);
-int sh_userfiles_check_internal(void);
+int sh_userfiles_set_uid (char * str);
+int sh_userfiles_add_file(char *c);
+int sh_userfiles_set_interval(char *c);
+int sh_userfiles_set_active(char *c);
+int sh_userfiles_check_internal();
 
 extern sh_rconf sh_userfiles_table[];
Index: trunk/include/sh_utils.h
===================================================================
--- trunk/include/sh_utils.h	(revision 591)
+++ trunk/include/sh_utils.h	(revision 1)
@@ -40,9 +40,7 @@
   unsigned long   data_ulong;
   long            data_long;
-  char           *data_str;
+  /*@null@*/char *data_str;
 } st_format;
 
-/* returns allocated string
- */
 char * sh_util_formatted (const char * fmt, st_format * ftab);
 
@@ -58,81 +56,52 @@
  *  generator. 
  */
-UINT32 taus_get            (void);  
+UINT32 taus_get            (void *state1, void *state2, void *state3);  
 double taus_get_double     (void *vstate);  /* fast */
 int    taus_seed           (void);
 
-/* returns allocated memory
- */
-char * sh_util_strdup (const char * str) SH_GNUC_MALLOC;
-char * sh_util_strdup_track (const char * str, 
-			     char * file, int line) SH_GNUC_MALLOC;
-
-/* returns allocated memory
- */
-char * sh_util_strdup_l (const char * str, size_t len) SH_GNUC_MALLOC;
-
-/* returns pointer within str
- */
+char * sh_util_strdup (const char * str);
 char * sh_util_strsep (char **str, const char *delim);
-
-/* compactify verbose acl text, returns allocated memory
- */
-char * sh_util_acl_compact (char * buf, ssize_t len);
 
 /* set signature type HASH-TIGER/HMAC-TIGER
  */
-int sh_util_sigtype (const char * c);
+int sh_util_sigtype (char * c);
 
 /* compute a signature
  */
 char * sh_util_siggen (char * hexkey,  
-		       char * text, size_t textlen, 
-		       char * sigbuf, size_t sigbuflen);
+		       char * text, size_t textlen);
 
 /* eval boolean input
  */
-int sh_util_flagval(const char * c, int * fval);
+int sh_util_flagval(char * c, int * fval);
 
 /* ask if a file should be updated (returns S_TRUE/S_FALSE)
  */
-int sh_util_ask_update(const char * path);
-int sh_util_set_interactive(const char * str);
-int sh_util_update_file (const char * str);
+int sh_util_ask_update(char * path);
+int sh_util_set_interactive(char * str);
 
 /* don't log output files
  */
-int sh_util_hidesetup(const char * c);
-
-/* valif utf-8 string
- */
-int sh_util_valid_utf8 (const unsigned char * str);
-
-/* filenames are utf8
- */
-int sh_util_obscure_utf8 (const char * c);
+int sh_util_hidesetup(char * c);
 
 /* exceptions to obscure name check
  */
-int sh_util_obscure_ok (const char * str);
+int sh_util_obscure_ok (char * str);
 
-/* output a hexchar[2]; i2h must be char[2]
+/* read a hexchar
  */
-char * sh_util_charhex( unsigned char c, char * i2h );
-
-/* read a hexchar, return int value (0-15)
- */
-int sh_util_hexchar( char c ) SH_GNUC_CONST;
+int sh_util_hexchar( char c );
 
 /* change verifier 
  */
-int sh_util_set_newkey (const char * str);
+int sh_util_set_newkey (char * str);
 
 /* server mode 
  */
-int sh_util_setserver (const char * dummy);
+int sh_util_setserver (char * dummy);
 
 /* a simple compressor
  */
-size_t sh_util_compress (char * dest, char * src, size_t dest_size);
+long sh_util_compress (char * dest, char * src, size_t dest_size);
 
 /* an even simpler en-/decoder 
@@ -147,9 +116,9 @@
 /* set timer for main loop
  */
-int sh_util_setlooptime (const char * str);
+int sh_util_setlooptime (char * str);
 
 /* whether init or check the database
  */
-int  sh_util_setchecksum (const char * str);
+int  sh_util_setchecksum (char * str);
 
 /* compare an in_string against a regular expression regex_str
@@ -160,11 +129,11 @@
 
 /* returns freshly allocated memory, return value should be free'd.
- * Argument list must be NULL terminated.
+ * Arhument list must be NULL terminated.
  */
-char * sh_util_strconcat (const char * arg1, ...) SH_GNUC_MALLOC SH_GNUC_SENTINEL;
+char * sh_util_strconcat (const char * arg1, ...);
 
 /* check if string is numeric only
  */
-int sh_util_isnum (const char *str) SH_GNUC_PURE;
+int sh_util_isnum (char *str);
 
 /* init a key w/random string
@@ -175,11 +144,9 @@
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_dirname(const char * fullpath);
+char * sh_util_filename(char * fullpath);
 
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_safe_name (const char * name) SH_GNUC_MALLOC;
-
-char * sh_util_safe_name_keepspace (const char * name) SH_GNUC_MALLOC;
+char * sh_util_safe_name (const char * name);
 
 /* check max size of printf result string
@@ -189,30 +156,9 @@
 /* check for obscure filenames
  */
-int sh_util_obscurename (ShErrLevel level, const char * name, int flag);
+int sh_util_obscurename (ShErrLevel level, char * name, int flag);
 
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_basename(const char * fullpath);
-
-/* required size (including terminating NULL) for string of strlen l
- */
-#define SH_B64_SIZ(l)  (1 + ((((l) + 2) / 3) * 4))
-
-/* return len of encoded string
- */
-size_t sh_util_base64_enc (unsigned char * out, const unsigned char * instr, 
-			   size_t lin);
-
-/* return allocated encoded string in out, return its len
- */
-size_t sh_util_base64_enc_alloc (char **out, const char *in, size_t inlen);
-
-/* return len of decoded string
- */  
-size_t sh_util_base64_dec (unsigned char *out, const unsigned char *in, size_t lin);
-
-/* return allocated decoded string in out, return its len
- */  
-size_t sh_util_base64_dec_alloc (unsigned char **out, const unsigned char *in, size_t lin);
+char * sh_util_basename(char * fullpath);
 
 #endif
Index: trunk/include/sh_utmp.h
===================================================================
--- trunk/include/sh_utmp.h	(revision 591)
+++ trunk/include/sh_utmp.h	(revision 1)
@@ -6,35 +6,17 @@
 
 #ifdef SH_USE_UTMP
-int sh_utmp_init   (struct mod_type * arg);
-int sh_utmp_timer  (time_t tcurrent);
-int sh_utmp_check  (void);
-int sh_utmp_end    (void);
-int sh_utmp_reconf (void);
+int sh_utmp_init  (void);
+int sh_utmp_timer (time_t tcurrent);
+int sh_utmp_check (void);
+int sh_utmp_end (void);
+int sh_utmp_null (void);
 
-int sh_utmp_set_login_activate (const char * c);
-int sh_utmp_set_login_solo     (const char * c);
-int sh_utmp_set_login_multi    (const char * c);
-int sh_utmp_set_logout_good    (const char * c);
-int sh_utmp_set_login_timer    (const char * c);
+int sh_utmp_set_login_activate (char * c);
+int sh_utmp_set_login_solo     (char * c);
+int sh_utmp_set_login_multi    (char * c);
+int sh_utmp_set_logout_good    (char * c);
+int sh_utmp_set_login_timer    (char * c);
 
 extern sh_rconf sh_utmp_table[];
-
-/* >>           Login tracking             << */
-
-/* 'yes', 'no', 'paranoid'                    */
-int sh_login_set_siglevel      (const char * c);
-
-/* 'yes', 'no', 'domain'                      */
-int sh_login_set_checklevel    (const char * c);
-
-/* 'always' 'never' workdays(..) sunday(..)   */
-int sh_login_set_def_allow     (const char * c);
-
-/* user:'always' 'never' workdays(..)         */
-int sh_login_set_user_allow    (const char * c);
-
-/* Reset everything to defaults.              */
-void sh_login_reset (void);
-
 #endif
 
Index: trunk/include/sh_xfer.h
===================================================================
--- trunk/include/sh_xfer.h	(revision 591)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2015 Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-#ifndef SH_XFER_H
-#define SH_XFER_H
-
-#ifndef SH_STANDALONE
-int sh_xfer_set_strip (const char * str);
-#endif
-
-/* generate a random password
- */
-int sh_xfer_create_password (const char * dummy);
-
-/* set timeout for active client connections
- */
-int sh_xfer_set_timeout (const char * c);
-
-/* set time limit after which client is reported dead 
- */
-int sh_xfer_set_time_limit(const char * str);
-
-/* error level for lookup failure
- */
-int sh_xfer_lookup_level (const char * c);
-
-/* create client entry for given password
- */
-int sh_xfer_make_client (const char * str);
-
-/* set port to which we connect
- */
-int sh_xfer_server_port (const char * str);
-
-#ifdef SH_WITH_SERVER
-
-#ifdef INET_SYSLOG
-int set_syslog_active(const char * c);
-#endif
-
-/* create socket and start listening
- */
-void create_server_tcp_socket (void);
-
-/* whether to use client address as known to the communication layer
- * and set by accept()
- */
-int set_socket_peer (const char * c);
-
-/* whether to use client severity
- */
-int sh_xfer_use_clt_sev (const char * c);
-
-/* whether to use client class
- */
-int sh_xfer_use_clt_class (const char * c);
-
-/* server port
- */
-int sh_xfer_set_port(const char * c);
-
-/* server interface
- */
-int sh_xfer_set_interface(const char * c);
-
-/* a wrapper function
- */
-void sh_xfer_html_write(void);
-
-/* register an alias
- */
-int sh_xfer_register_alias (const char * str);
-
-/* register a client
- */
-int sh_xfer_register_client (const char * str);
-
-/* start server
- */
-void sh_xfer_start_server(void);
-
-/* free() everything
- */
-void sh_xfer_free_all (void);
-
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
-/* talk to server
- */
-long  sh_xfer_report (char * errmsg);
-
-/* set log server
- */
-int sh_xfer_set_logserver (const char * address);
-void reset_count_dev_server(void);
-#endif
-
-#ifdef SH_WITH_CLIENT
-
-/* Throttle file download
- */
-int sh_xfer_set_throttle_delay (const char * c);
-
-/* request file from server. file may be "CONF" or "DATA" or a UUID.
- */
-long sh_xfer_request_file (const char * file);
-
-#endif
-
-#endif
-
Index: trunk/include/slib.h
===================================================================
--- trunk/include/slib.h	(revision 591)
+++ trunk/include/slib.h	(revision 1)
@@ -24,6 +24,4 @@
 #endif
 
-#include "sh_string.h"
-
 /****************
 
@@ -40,5 +38,4 @@
 *****************/
 
-
 /* --------------------------------------------------------------
  * 
@@ -60,20 +57,8 @@
  * TRUE, FALSE
  */
-#if !defined(S_TRUE)
-#define S_TRUE  1
-#define S_FALSE 0
-#endif
-
-#define SH_GRBUF_SIZE   4096
-#define SH_PWBUF_SIZE  32768
-
-
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#undef  SL_GNUC_CONST
-#define SL_GNUC_CONST   __attribute__((const))
-#else
-#undef  SL_GNUC_CONST
-#define SL_GNUC_CONST
-#endif
+#define SL_TRUE  1
+#define SL_FALSE 0
+
+
 
 /*
@@ -108,9 +93,7 @@
 #define SL_EWRITE    -1037     /* Write error. Check errno.            */
 #define SL_ESYNC     -1038     /* Write error. Check errno.            */
-#define SL_ECLOSE    -1039     /* Close error. Check errno.            */
 
 #define SL_EBADNAME  -1040     /* Invalid name.                        */
 #define SL_ESTAT     -1041     /* stat of file failed. Check errno.    */
-#define SL_EFSTAT    -1042     /* fstat of file failed. Check errno.   */
 
 #define SL_EBADUID   -1050	/* Owner not trustworthy.              */
@@ -120,20 +103,4 @@
 #define SL_TOOMANY   -1053      /* Too many open files                 */
 #define SL_TIMEOUT   -1054      /* Timeout in read                     */
-
-#define SL_EISDIR    -1055      /* Is a directory                      */
-
-#define SL_EINTERNAL01 -1061    /* Internal error.                      */
-#define SL_EINTERNAL02 -1062    /* Internal error.                      */
-#define SL_EINTERNAL03 -1063    /* Internal error.                      */
-#define SL_EINTERNAL04 -1064    /* Internal error.                      */
-#define SL_EINTERNAL05 -1065    /* Internal error.                      */
-#define SL_EINTERNAL06 -1066    /* Internal error.                      */
-#define SL_EINTERNAL07 -1067    /* Internal error.                      */
-#define SL_EINTERNAL08 -1068    /* Internal error.                      */
-#define SL_EINTERNAL09 -1069    /* Internal error.                      */
-#define SL_EINTERNAL10 -1070    /* Internal error.                      */
-#define SL_EINTERNAL11 -1071    /* Internal error.                      */
-#define SL_EINTERNAL12 -1072    /* Internal error.                      */
-
 /*
  * All int functions return SL_NONE on success.
@@ -144,7 +111,7 @@
 #endif
 
-  int dlog (int flag, const char * file, int line, const char *fmt, ...);
-
-  char * sl_get_errmsg(void);
+  int dlog (int flag, char * file, int line, const char *fmt, ...);
+
+  char * sl_get_errmsg();
 
   /* ---------------------------------------------------------------- 
@@ -154,5 +121,5 @@
    * ---------------------------------------------------------------- */
 
-  int sl_test_heap(void);
+  int sl_test_heap();
 
   /* ---------------------------------------------------------------- 
@@ -164,9 +131,9 @@
   extern int sl_useCaps;
 
-  int sl_drop_cap (void);
-  int sl_drop_cap_sub(void);
-  int sl_get_cap_sub(void);
-  int sl_drop_cap_qdel(void);
-  int sl_get_cap_qdel(void);
+  int sl_drop_cap ();
+  int sl_drop_cap_sub();
+  int sl_get_cap_sub();
+  int sl_drop_cap_qdel();
+  int sl_get_cap_qdel();
 
   /* ---------------------------------------------------------------- 
@@ -180,8 +147,6 @@
    */
   void *sl_memset(void *s, int c, size_t n);
-#if !defined(SH_REAL_SET)
 #undef  memset
 #define memset sl_memset
-#endif
 
   /* 
@@ -224,10 +189,7 @@
 
   /*
-   * robust strn[case]cmp replacement
+   * robust strncmp replacement
    */
   int sl_strncmp(const char * a, const char * b, size_t n);
-  int sl_ts_strncmp(const char * a, const char * b, size_t n);
-
-  int sl_strncasecmp(const char * a, const char * b, size_t n);
 
   /*
@@ -235,9 +197,4 @@
    */
   int sl_strcmp(const char * a, const char * b);
-
-  /*
-   * robust strcasecmp replacement
-   */
-  int sl_strcasecmp(const char * one, const char * two);
 
   /*
@@ -257,5 +214,5 @@
    * UID HANDLING FUNCTIONS.
    */
-  int sl_policy_get_user(const char *username);  /* drop SUID to <username>  */ 
+  int sl_policy_get_user(char *username);  /* drop SUID to <username>  */ 
   int sl_policy_get_real(char *username);  /* drop privs to <username> */
   int sl_policy_get_root(void);            /* drop SUID to root        */
@@ -274,5 +231,5 @@
    */
   int sl_get_euid(/*@out@*/uid_t * ret);
-  uid_t sl_ret_euid(void);
+  uid_t sl_ret_euid();
 
   /*
@@ -334,80 +291,37 @@
    * ---------------------------------------------------------------- */
 
-#define SL_OFILE_SIZE 32
-
-  char * sl_check_badfd();
-  char * sl_check_stale();
-
-  /* Create a file record for an open file
-   */
-  SL_TICKET sl_make_ticket (const char * ofile, int oline,
-			    int fd, const char * filename, FILE * stream);
- 
-  /* Get the pointer to a stream. If none exists yet, open it
-   */
-  FILE * sl_stream (SL_TICKET ticket, char * mode);
+  SL_TICKET sl_make_ticket (int fd, char * path);
 
   /* Open for writing.
    */
-  SL_TICKET  sl_open_write       (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
+  SL_TICKET  sl_open_write       (char * fname, int priviledge_mode);
 
   /* Open for reading.
    */
-  SL_TICKET  sl_open_read        (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
-
-  /* Drop from cach when closing
-   */
-  int sl_set_drop_cache(const char * str);
+  SL_TICKET  sl_open_read        (char * fname, int priviledge_mode);
 
   /* Open for reading w/minimum checking.
    */
-  SL_TICKET  sl_open_fastread    (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
+  SL_TICKET  sl_open_fastread    (char * fname, int priviledge_mode);
 
   /* Open for read and write.
    */
-  SL_TICKET  sl_open_rdwr        (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
+  SL_TICKET  sl_open_rdwr        (char * fname, int priviledge_mode);
 
   /* Open for read and write, fail if file exists.
    */
-  SL_TICKET sl_open_safe_rdwr    (const char * ofile, int oline,
-				  const char * fname, int priv);
+  SL_TICKET sl_open_safe_rdwr    (char * fname, int priv);
 
   /* Open for write, truncate.
    */
-  SL_TICKET  sl_open_write_trunc (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
+  SL_TICKET  sl_open_write_trunc (char * fname, int priviledge_mode);
 
   /* Open for read and write, truncate.
    */
-  SL_TICKET  sl_open_rdwr_trunc  (const char * ofile, int oline,
-				  const char * fname, int priviledge_mode);
-
-  /* Initialize the content sh_string.
-   */
-  int sl_init_content (SL_TICKET ticket, size_t size);
-
-  /* Get the (pointer to) the content sh_string.
-   */
-  sh_string * sl_get_content (SL_TICKET ticket);
-
-  /* Lock file (uses fcntl F_SETLK).
-   */
-  int sl_lock (SL_TICKET ticket);
+  SL_TICKET  sl_open_rdwr_trunc  (char * fname, int priviledge_mode);
 
   /* Close file.
    */
   int sl_close (SL_TICKET ticket);
-
-  /* Close file descriptor.
-   */
-  int sl_close_fd (const char * file, int line, int fd);
-
-  /* Close stream.
-   */
-  int sl_fclose (const char * file, int line, FILE * fp);
 
   /* Unlink file.
@@ -435,14 +349,6 @@
   int sl_read (SL_TICKET ticket, void * buf, size_t count);
 
-  int sl_read_timeout_prep (SL_TICKET ticket);
-
-  int sl_read_timeout_fd (int fd, void * buf, 
-			  size_t count, int timeout, int is_nonblocking);
-
-  int sl_read_timeout_fd_once (int fd, void * buf, 
-			       size_t count, int timeout, int is_nonblocking);
-
   int sl_read_timeout (SL_TICKET ticket, void * buf, 
-		       size_t count, int timeout, int is_nonblocking);
+		       size_t count, int timeout);
 
   int sl_read_fast (SL_TICKET ticket, void * buf_in, size_t count);
@@ -450,30 +356,25 @@
   /* Write file.
    */
-  int sl_write (SL_TICKET ticket, const void * msg, long nbytes);
+  int sl_write (SL_TICKET ticket, void * msg, long nbytes);
 
   /* Write file, terminate with newline.
    */
-  int sl_write_line (SL_TICKET ticket, const void * msg, long nbytes);
-
-  /* As above, but only for non-constant strings.
-   */
-  int sl_write_line_fast (SL_TICKET ticket, void * msg, long nbytes);
+  int sl_write_line (SL_TICKET ticket, void * msg, long nbytes);
 
   /* Drop all metadata for file descriptors >= fd.
    */
   int sl_dropall(int fd, int except);
-  int sl_dropall_dirty(int fd, int except); /* don't deallocate */
 
   /* Check whether file is trustworthy.
    */
-  int sl_trustfile(const char * path, uid_t * ok, uid_t * bad);
+  int sl_trustfile(char * path, uid_t * ok, uid_t * bad);
 
   /* Check whether file is trustworthy.
    */
-  int sl_trustfile_euid(const char * filename, uid_t euid);
+  int sl_trustfile_euid(char * filename, uid_t euid);
 
   /* purge list of trusted users
    */
-  int  sl_trust_purge_user (void);
+  int  sl_trust_purge_user ();
 
   /* Add a trusted user.
@@ -488,14 +389,4 @@
    */
   char * sl_trust_errfile(void);
-
-  /* Overflow tests
-   */
-  int sl_ok_muli (int a, int b) SL_GNUC_CONST;
-  int sl_ok_divi (int a, int b) SL_GNUC_CONST;
-  int sl_ok_addi (int a, int b) SL_GNUC_CONST;
-  int sl_ok_subi (int a, int b) SL_GNUC_CONST;
-
-  int sl_ok_muls (size_t a, size_t b) SL_GNUC_CONST;
-  int sl_ok_adds (size_t a, size_t b) SL_GNUC_CONST;
 
 
@@ -509,7 +400,5 @@
 #define SL_NOPRIV  0x34
 
-/* Suitable for Linux
- */
-#define MAXFILENAME	4096
+#define MAXFILENAME	2048
 
 
@@ -533,5 +422,5 @@
     /*@i@*/ if (assertion) ;                           \
     else {                                             \
-        dlog(0, FIL__, __LINE__, _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n"),            \
+        dlog(0, FIL__, __LINE__, SDG_AFAIL,            \
                  FIL__, __LINE__, astext);             \
         _exit(EXIT_FAILURE);                           \
@@ -603,10 +492,10 @@
 void sl_stack_push(char * c, char * file, int line);
 void sl_stack_pop(char * c, char * file, int line);
-void sl_stack_print(void);
+void sl_stack_print();
 #endif
-void sl_trace_in   (const char * str, const char * file, int line);
-void sl_trace_out  (const char * str, const char * file, int line);
-int  sl_trace_file (const char * str);
-int  sl_trace_use  (const char * str);
+void sl_trace_in   (char * str, char * file, int line);
+void sl_trace_out  (char * str, char * file, int line);
+int  sl_trace_file (char * str);
+int  sl_trace_use  (char * str);
 
 
@@ -621,5 +510,5 @@
 do {                                                                \
    if((long)(x) < 0) {                                              \
-      TPT((0,    FIL__, __LINE__, _("error=<%ld>.\n"), (long)(x)))            \
+      TPT((0,    FIL__, __LINE__, SDG_ERROR, (long)(x)))            \
       sl_errno=(x);                                                 \
     }                                                               \
Index: trunk/include/zAVLTree.h
===================================================================
--- trunk/include/zAVLTree.h	(revision 591)
+++ trunk/include/zAVLTree.h	(revision 1)
@@ -33,11 +33,8 @@
 
 /* typedef the keytype */
-typedef const void * zAVLKey;
+typedef const char * zAVLKey;
 
 /* Comparison function for strings is strcmp(). */
-/* #define zAVLKey_cmp(tree, a, b) (strcmp((a), (b))) */
-
-#define zAVL_KEY_STRING 0
-#define zAVL_KEY_INT    1
+#define zAVLKey_cmp(tree, a, b) (strcmp((a), (b)))
 
 
@@ -56,5 +53,4 @@
   long count;
   zAVLKey (*getkey)(const void *item);
-  int keytype;
 } zAVLTree;
 
@@ -66,5 +62,5 @@
 
 
-extern zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item), int keytype);
+extern zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item));
 extern void zAVLFreeTree (zAVLTree *avltree, void (freeitem)(void *item));
 extern int zAVLInsert (zAVLTree *avltree, void *item);
@@ -74,9 +70,3 @@
 extern void *zAVLNext (zAVLCursor *avlcursor);
 
-extern char * zAVL_string_get (zAVLTree * tree, const char * key);
-/* uses strdup to insert a copy */
-extern int zAVL_string_set (zAVLTree ** tree, const char * key); 
-extern void zAVL_string_reset (zAVLTree * tree);
-extern void zAVL_string_del (zAVLTree * tree, const char * key);
-
 #endif
Index: trunk/init/samhain.startFreeBSD.in
===================================================================
--- trunk/init/samhain.startFreeBSD.in	(revision 591)
+++ trunk/init/samhain.startFreeBSD.in	(revision 1)
@@ -1,44 +1,95 @@
-#!/bin/sh
+#! /bin/sh -
+#
+#    initialization/shutdown script for @install_name@ package
 
-# PROVIDE: @install_name@
-# REQUIRE: LOGIN
-# KEYWORD: shutdown
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
 
-. /etc/rc.subr
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=@sbindir@/@install_name@
+NAME=@install_name@
+pidfile=@mylockfile@
 
-name="@install_name@"
-rcvar=`set_rcvar`
+test -f $DAEMON || exit 0
 
-pidfile="@mylockfile@"
-
-# there are no required_files in general,
-# as they might be downloaded from the server
-#
-# required_files="@myconffile@ @mydatafile@"
-
-extra_commands="reload"
-stop_postcmd="remove_stale_files"
-
-command="@sbindir@/@install_name@"
-
-is_set()
-{
-    eval "[ -n \"\${$1+X}\" ]"
+safe_pidof () {
+    pidval=0
+    if [ -f $pidfile ] ; then
+       pidval=`cat $pidfile | awk '{ print $1 }'`
+       echo "${pidval}" | grep ['[^0123456789]'] >/dev/null 2>&1 && pidval=0
+    fi
+    echo $pidval
+    if [ x"$pidval" = x0 ] ; then
+	return 1
+    else
+	return 0
+    fi
 }
 
-remove_stale_files()
-{
-    if test -f @mylockfile@; then
-	/bin/rm -f @mylockfile@
-    fi
-    /bin/rm -f @mylockdir@/${name}.sock
+log_stat_msg () {
+case "$1" in
+	0)
+	echo "Service $NAME: Running";
+	break;
+	;;
+	1)
+	echo "Service $NAME: Stopped and @mylockfile@ pid file exists";
+	break;
+	;;
+	3)
+	echo "Service $NAME: Stopped";
+	break;
+	;;
+	*)
+	echo "Service $NAME: Status unknown";
+	break;
+	;;
+esac
 }
 
-load_rc_config "$name"
+case "$1" in
+  start)
+	#
+	# Remove a stale lockfile, if found
+	#
+	if test -f @mylockfile@; then
+	    rm -f @mylockfile@
+	fi
+        /bin/rm -f @mylockdir@/${NAME}.sock
+        $DAEMON -D && echo -n " $NAME"
+        ;;
+  stop)
+        PID=`safe_pidof`
+	if test "x$PID" != x0
+	then
+		kill $PID && echo -n " $NAME"
+        fi
+        ;;
+  reload|force-reload)
+        PID=`safe_pidof`
+        if test "x$PID" != x0
+        then
+		echo " Reloading $NAME configuration file."
+                kill -s HUP $PID && echo -n " $NAME"
+	else
+		echo " Cannot determine PID of process $NAME."
+		exit 1
+        fi
+        ;;
+  restart)
+	$0 stop
+        sleep 3
+        $0 start
+        ;;
+    status)
+        $DAEMON  status
+	ERRNUM=$?
+	log_stat_msg ${ERRNUM}
+	exit ${ERRNUM}
+        ;;
+  *)
+        echo " Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+        exit 1
+        ;;
+esac
 
-if ! is_set ${rcvar}; then 
-    eval "${rcvar}=YES"
-fi
-
-run_rc_command "$1"
-
Index: trunk/init/samhain.startGentoo.in
===================================================================
--- trunk/init/samhain.startGentoo.in	(revision 591)
+++ trunk/init/samhain.startGentoo.in	(revision 1)
@@ -11,4 +11,5 @@
 	/sbin/start-stop-daemon --start --quiet  --exec @sbindir@/@install_name@
 	eend $?
+	@sh_insmod_cmd@
 }
 
Index: trunk/init/samhain.startLSB.in
===================================================================
--- trunk/init/samhain.startLSB.in	(revision 591)
+++ trunk/init/samhain.startLSB.in	(revision 1)
@@ -3,6 +3,6 @@
 ### BEGIN INIT INFO
 # Provides: @install_name@
-# Required-Start: $syslog $network $remote_fs
-# Required-Stop: $syslog $network $remote_fs
+# Required-Start: $syslog $network
+# Required-Stop: $syslog $network
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
Index: trunk/init/samhain.startLinux.in
===================================================================
--- trunk/init/samhain.startLinux.in	(revision 591)
+++ trunk/init/samhain.startLinux.in	(revision 1)
@@ -1,4 +1,3 @@
 #!/bin/bash
-
 # chkconfig: 2345 99 10
 # description: File Integrity Checking Daemon
@@ -10,14 +9,4 @@
 #
 
-### BEGIN INIT INFO
-# Provides: @install_name@
-# Required-Start: $syslog $network $remote_fs
-# Required-Stop: $syslog $network $remote_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Keep an eye on stuff
-# Description: Keep an eye on stuff
-### END INIT INFO
-
 # For Debian
 #
@@ -40,13 +29,6 @@
 # and the command to run them.
 if [ -f /etc/redhat-release ]; then
-    if [ -f /etc/init.d/functions ]; then
 	. /etc/init.d/functions
 	DISTRO=redhat
-    elif [ -f /etc/rc.d/init.d/functions ]; then
-	. /etc/rc.d/init.d/functions
-	DISTRO=redhat
-    else
-	DISTRO=generic
-    fi
 elif [ -f /etc/mandrake-release ]; then
 	. /etc/init.d/functions
@@ -81,5 +63,5 @@
 fi
 
-debian_end()
+function debian_end ()
 {
 	if [ $RETVAL -eq 0 ];
@@ -121,5 +103,5 @@
 
 # echo OK in green if is success, FAILED in red is failed
-generic_end()
+function generic_end ()
 {
 	if [ $RETVAL -eq 0 ];
@@ -161,18 +143,11 @@
 	debian)
 		echo -n "Starting ${NAME}"
-		( /sbin/start-stop-daemon --start --oknodo --quiet --exec $DAEMON )
+		( /sbin/start-stop-daemon --start --quiet --exec $DAEMON )
 		RETVAL=$?
 		debian_end
 		;;
 	redhat)
-		if [ -f /etc/sysconfig/${NAME} ]; then
-                       . /etc/sysconfig/${NAME}
-                fi
 		echo -n $"Starting ${NAME}: "
-                if [ -n "$OPTIONS" ]; then
-                        daemon $DAEMON $OPTIONS
-                else
-                        daemon $DAEMON
-                fi
+		daemon $DAEMON
 		RETVAL=$?
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${NAME}
@@ -197,4 +172,10 @@
 		;;
 	esac
+	#
+	# The hiding kernel module
+	#
+	if [ $RETVAL -eq 0 ]; then
+		@sh_insmod_cmd@
+	fi
 	exit $RETVAL
 	;;
@@ -204,5 +185,5 @@
 	debian)
 		echo -n "Stopping $NAME"
-        	( /sbin/start-stop-daemon --stop --oknodo --quiet --exec $DAEMON )
+        	( /sbin/start-stop-daemon --stop --quiet --exec $DAEMON )
 		RETVAL=$? 
 		debian_end
Index: trunk/init/samhain.startMACOSX.in
===================================================================
--- trunk/init/samhain.startMACOSX.in	(revision 591)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#!/bin/sh
-
-. /etc/rc.common
-
-StartService() {
-
-	ConsoleMessage "Starting service @install_name@."
-	@sbindir@/@install_name@ start
-
-}
-
-StopService() {
-
-	ConsoleMessage "Stopping service @install_name@."
-	@sbindir@/@install_name@ stop
-
-}
-
-RestartService() {
-
-	ConsoleMessage "Restarting service @install_name@."
-	@sbindir@/@install_name@ restart
-
-}
-
-
-RunService "$1"
Index: trunk/init/samhain.startSolaris.in
===================================================================
--- trunk/init/samhain.startSolaris.in	(revision 591)
+++ trunk/init/samhain.startSolaris.in	(revision 1)
@@ -9,5 +9,5 @@
 
 
-log_stat_msg() {
+log_stat_msg () {
 case "$1" in
 	0)
Index: trunk/init/samhain.startSystemd.in
===================================================================
--- trunk/init/samhain.startSystemd.in	(revision 591)
+++ 	(revision )
@@ -1,16 +1,0 @@
-
-[Unit]
-Description=The @install_name@ Service
-After=network.target remote-fs.target nss-user-lookup.target
-
-[Service]
-Type=forking
-PIDFile=@mylockfile@
-ExecStart=@sbindir@/@install_name@ start
-ExecStop=@sbindir@/@install_name@ stop
-ExecReload=@sbindir@/@install_name@ reload
-Restart=on-abort
-TimeoutStartSec=infinity
-
-[Install]
-WantedBy=multi-user.target
Index: trunk/man/samhain.8
===================================================================
--- trunk/man/samhain.8	(revision 591)
+++ trunk/man/samhain.8	(revision 1)
@@ -1,3 +1,3 @@
-.TH SAMHAIN 8 "26 June 2015" "" "Samhain manual"
+.TH SAMHAIN 8 "07 August 2004" "" "Samhain manual"
 .SH NAME
 samhain \- check file integrity
@@ -14,5 +14,5 @@
 {
 .I \-t update|\-\-set\-checksum\-test=update
-} [\-D | \-\-daemon | \-\-foreground] [\-\-forever] [\-r DEPTH|\-\-recursion=DEPTH] [log-options]
+} [\-r DEPTH|\-\-recursion=DEPTH] [log-options]
 
 .B samhain 
@@ -21,16 +21,4 @@
 } [\-D | \-\-daemon | \-\-foreground] [\-\-forever] [\-r DEPTH,\-\-recursion=DEPTH] [log-options]
 
-.B samhain 
-[ \-p threshold ] {
-.I \-\-verify\-database=database
-} 
-
-.B samhain 
-[ \-p threshold ] {
-.I \-\-create\-database=file\-list
-} 
-
-
-
 .SS "LISTING THE DATABASE"
 .PP
@@ -39,6 +27,4 @@
 [\-a | \-\-full\-detail]
 [\-\-delimited]
-[\-\-binary]
-[\-\-list\-filter=file]
 \-d 
 .IR file | 
@@ -64,7 +50,4 @@
 
 .B samhain
-.RI \-\-server\-port= portnumber
-
-.B samhain
 \-H 
 .I string 
@@ -74,7 +57,4 @@
 .B samhain
 \-c | \-\-copyright
-
-.B samhain
-\-v | \-\-version
 
 .B samhain
@@ -215,27 +195,4 @@
 [\-r DEPTH|\-\-recursion=DEPTH]
 Set the (global) recursion depth.
-.TP
-[\-D|\-\-daemon]
-Run as daemon. File checks are performed as specified by the timing
-options in the configuration file. Updates are saved after each file check.
-.TP
-[\-\-foreground]
-Run in the foreground. This will cause samhain to exit after the update,
-unless the option
-.I "\-\-forever"
-is used.
-.TP
-[\-\-forever]
-If not running as daemon, do not exit after finishing the update, but
-loop forever, and perform checks with corresponding database updates
-according to the timing options in the
-configuration file.
-.TP
-[\-i|\-\-interactive]
-Run update in interactive mode.
-.TP
-[\-\-listfile=PATH]
-Run the update with a list of 'good' filepaths given in file (one path per line).
-
 
 .PP
@@ -266,31 +223,4 @@
 configuration file.
 
-.PP
-.B samhain
-[ \-p\ threshold ]
-.I "\-\-verify\-database=database"
-
-Check the filesystem against the database given as argument,
-and exit with an appropriate exit status. The configuration file
-will 
-.B not
-be read.
-
-.PP
-.B samhain
-[ \-p\ threshold ]
-.I "\-\-create\-database=file\-list"
-
-Initialize a database from the given file list. 
-The configuration file
-will 
-.B not
-be read. The policy used will be
-.I ReadOnly.
-File content will be stored for a file
-if its path in the list is preceded with a 
-.B +
-sign.
-
 .SS "OPTIONS FOR LISTING THE DATABASE"
 .PP
@@ -310,24 +240,8 @@
 [\-a | \-\-full\-detail]
 List all informations for each file, not only those you would get
-with ls \-l. Must precede the \-d option.
+with ls \-l.
 .TP
 [\-\-delimited]
 List all informations for each file, in a comma-separated format.
-Must precede the \-d option.
-.TP
-[\-\-binary]
-List data in the binary format of the database, thus writing another
-database.
-Must precede the \-d option.
-.TP
-.RI [\-\-list\-filter= file ]
-Filter the output of the database listing by a list of files given
-in a text file. Together with \-\-binary this allows to write a
-partial database. Must precede the \-d option.
-.TP
-.RI [\-\-list\-file= file ]
-List the literal content of the given file as stored in the database.
-Content is not stored by default, must be enabled in the runtime
-configuration file. Must precede the \-d option.
 
 .SS "OPTIONS TO VERIFY AN AUDIT TRAIL"
@@ -372,9 +286,4 @@
 
 .B samhain
-.RI \-\-server\-port= portnumber
-
-Choose the port on the server host to which the client will connect.
-
-.B samhain
 \-H 
 .I string 
@@ -392,12 +301,7 @@
 
 .B samhain
-\-v | \-\-version 
-
-Show version and compiled-in options.
-
-.B samhain
 \-h | \-\-help 
 
-Print supported command line options (depending on compilation options).
+Print supported options (depending on compilation options).
 
 .B samhain
Index: trunk/man/samhainrc.5
===================================================================
--- trunk/man/samhainrc.5	(revision 591)
+++ trunk/man/samhainrc.5	(revision 1)
@@ -96,10 +96,4 @@
 .TP
 .I "[User1]"
-.TP
-.I "[User2]"
-.TP
-.I "[User3]"
-.TP
-.I "[User4]"
 These are reserved for user-defined policies.
 .TP
@@ -178,13 +172,7 @@
 .br
 .BI  SeverityUser0= val,
-.br
-.BI  SeverityUser1= val,
-.br
-.BI  SeverityUser2= val,
-.br
-.BI  SeverityUser3= val,
 and
 .br
-.BI  SeverityUser4= val
+.BI  SeverityUser1= val
 define the error levels for failures to verify the integrity of
 files/directories of the respective types. I.e. if such a file shows
@@ -253,4 +241,36 @@
 by same user, and logouts.
 .TP
+.I "[Kernel]"
+Configuration for detecting kernel rootkits.
+.br
+.BI KernelCheckActive= 0|1
+Switch off/on checking of kernel syscalls to detect kernel module rootkits.
+.br
+.BI KernelCheckInterval= val
+Interval (seconds) between checks.
+.br
+.BI SeverityKernel= val
+Severity level for clobbered kernel syscalls.
+.br
+.BI KernelCheckIDT= 0|1
+Whether to check the interrrupt descriptor table.
+.br
+.BI KernelSystemCall= address
+The address of system_call (grep system_call System.map). 
+Required after a kernel update.
+.br
+.BI KernelProcRoot= address
+The address of proc_root (grep ' proc_root$' System.map).
+Required after a kernel update.
+.br
+.BI KernelProcRootIops= address 
+The address of proc_root_inode_operations 
+(grep proc_root_inode_operations System.map).
+Required after a kernel update.
+.br
+.BI KernelProcRootLookup= address 
+The address of proc_root_lookup (grep proc_root_lookup System.map).
+Required after a kernel update.
+.TP
 .I "[SuidCheck]"
 Settings for finding SUID/SGID files on disk.
@@ -271,112 +291,4 @@
 .BI SuidCheckFps= fps 
 Limit files per seconds for SUID check. 
-.br
-.BI SuidCheckNosuid= 0|1 
-Check filesystems mounted as nosuid. Defaults to not.
-.br
-.BI SuidCheckQuarantineFiles= 0|1 
-Whether to quarantine files. Defaults to not.
-.br
-.BI SuidCheckQuarantineMethod= 0|1|2
-Quarantine method. Delete = 1, remove suid/sgid flags = 1, move to quarantine directory = 2. Defaults to 1 (remove suid/sgid flags).
-.br
-.BI 
-.TP
-.I "[Mounts]"
-Configuration for checking mounts.
-.br
-.BI MountCheckActive= 0|1
-Switch off/on this module.
-.br
-.BI MountCheckInterval= seconds
-  The interval between checks (default 300).
-.br
-.BI SeverityMountMissing= severity 
-Severity for reports on missing mounts. 
-.br
-.BI SeverityOptionMissing= severity 
-Severity for reports on missing mount options. 
-.br
-.BI CheckMount= path
-[mount_options]
-.br
-Mount point to check. Mount options must be given as 
-comma-separated list, separated by a blank from the preceding mount point.
-.TP
-.I "[UserFiles]"
-Configuration for checking paths relative to user home directories.
-.br
-.BI UserFilesActive= 0|1
-Switch off/on this module.
-.br
-.BI UserFilesName= filename 
-policy
-.br
-Files to check for under each $HOME. Allowed values for 'policy'
-are: allignore, attributes, logfiles, loggrow, noignore (default), 
-readonly, user0, user1, user2, user3, and user4.
-.br
-.BI UserFilesCheckUids= uid_list
-A list of UIDs where we want to check. The default
-is all. Ranges (e.g. 100-500) are allowed. If there is an open range (e.g.
-1000-), it must be last in the list.
-.TP
-.I "[ProcessCheck]"
-Settings for finding hidden/fake,required processes on the local host.
-.br
-.BI ProcessCheckActive= 0|1 
-Switch off/on the check.
-.br
-.BI ProcessCheckInterval= seconds
-  The interval between checks (default 300).
-.br
-.BI SeverityProcessCheck= severity 
-Severity for events (default crit). 
-.br
-.BI ProcessCheckMinPID= pid
-The minimum PID to check (default 0).
-.br
-.BI ProcessCheckMaxPID= pid
-The maximum PID to check (default 32767).
-.br
-.BI ProcessCheckPSPath= path 
-The path to ps (autodetected at compile time).
-.br
-.BI ProcessCheckPSArg= argument 
-The argument to ps (autodetected at compile time).
-Must yield PID in first column.
-.br
-.BI ProcessCheckExists= regular_expression
-Check for existence of a process matching the given regular expression.
-.TP
-.I "[PortCheck]"
-Settings for checking open ports on the local host.
-.br
-.BI PortCheckActive= 0|1 
-Switch off/on the check.
-.br
-.BI PortCheckInterval= seconds
-  The interval between checks (default 300).
-.br
-.BI PortCheckUDP= yes|no
-Whether to check UPD ports as well (default yes). 
-.br
-.BI SeverityPortCheck= severity 
-Severity for events (default crit). 
-.br
-.BI PortCheckInterface= ip_address 
-Additional interface to check.
-.br
-.BI PortCheckOptional= ip_address:list 
-Ports that may, but need not be open. The ip_address is the one
-of the interface, the list must be
-comma or whitespace separated, each item must be (port|service)/protocol,
-e.g. 22/tcp,nfs/tcp/nfs/udp.
-.br
-.BI PortCheckRequired= ip_address:list 
-Ports that are required to be open. The ip_address is the one
-of the interface, the list must be
-comma or whitespace separated, each item must be (port|service)/protocol,
-e.g. 22/tcp,nfs/tcp/nfs/udp.
 .TP
 .I "[Database]"
@@ -442,8 +354,4 @@
 Must be identical on client and server. 
 .br
-.BI StartupLoadDelay= val
-Defines the interval (in seconds) to wait after startup before
-loading the databse from the server. Default is no wait.
-.br
 .BI SetLoopTime= val
 Defines the interval (in seconds) for timestamps.
@@ -576,7 +484,4 @@
 for all.
 .br
-.BI FilenamesAreUTF8= yes|no
-Whether filenames are UTF-8 encoded (defaults to no). If yes, filenames
-are checked for invalid UTF-8 encoding and for ending in invisible characters.
 .br
 .BI IgnoreAdded= path_regex
@@ -609,7 +514,4 @@
 sets the hostname for the log server. 
 .br
-.BI SetServerPort= portnumber
-sets the port on the server to connect to. 
-.br
 .BI SetDatabasePath= AUTO|/path 
 Path to database (AUTO to tack hostname on compiled-in path). 
@@ -620,5 +522,5 @@
 .BI RedefReadOnly= +/-XXX,+/-YYY,...
 Add or subtract tests XXX from the ReadOnly policy.
-Tests are: CHK (checksum), TXT (store literal content), LNK (link), 
+Tests are: CHK (checksum), LNK (link), 
 HLN (hardlink), INO (inode), USR (user), GRP (group), MTM (mtime),
 ATM (atime), CTM (ctime), SIZ (size), RDEV (device numbers) 
@@ -645,13 +547,4 @@
 .BI RedefUser1= +/-XXX,+/-YYY,...
 Add or subtract tests XXX from the User1 policy.
-.br
-.BI RedefUser2= +/-XXX,+/-YYY,...
-Add or subtract tests XXX from the User2 policy.
-.br
-.BI RedefUser3= +/-XXX,+/-YYY,...
-Add or subtract tests XXX from the User3 policy.
-.br
-.BI RedefUser4= +/-XXX,+/-YYY,...
-Add or subtract tests XXX from the User4 policy.
 .TP
 .B Server Only
Index: trunk/rules.deb-light.in
===================================================================
--- trunk/rules.deb-light.in	(revision 591)
+++ trunk/rules.deb-light.in	(revision 1)
@@ -8,65 +8,88 @@
 #
 
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-%:
-	dh $@ --with-autoreconf
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
+package=@install_name@
+
+# CAVEAT: including the --enable-base= option is for packages to be
+#         distributed INTERNALLY on your network, NOT for packages
+#         to be distributed to THIRD PARTIES
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	@top_srcdir@/configure @mydefargs@
+	$(MAKE) 
+	echo '#!/bin/sh' > ./sstrip
+	echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	-[ -f Makefile ] && $(MAKE) distclean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) install-light install-boot DESTDIR=`pwd`/debian/tmp
+
+	# However, remove the rc.d links
+	-rm -rf `pwd`/debian/tmp/etc/rc?.d
+
+	# Remove samhain_stealth for light install
+	-rm -f `pwd`/debian/tmp/@sbindir@/@install_name@_stealth
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
 
 
-override_dh_clean:
-	[ ! -f Makefile ] || $(MAKE) distclean
-	-rm -f samhainrc.install
-	-rm -f build-stamp build-server-stamp build-client-stamp
-	dh_clean
-
-override_dh_auto_configure:
-	@top_srcdir@/configure @mydefargs@
-
-override_dh_auto_build:
-	dh_auto_build
-	if ! test x$(PASSWORD) = x; then \
-		if test -f samhain_setpwd; then \
-			./samhain_setpwd samhain new $(PASSWORD); \
-			rm samhain; \
-			mv samhain.new samhain; \
-		fi; \
-	fi
-
-override_dh_auto_install:
-	$(MAKE) install-light install-boot DESTDIR=`pwd`/debian/@install_name@
+# Build architecture-dependent files here.
+binary-arch: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_installdebconf	
+	# dh_installdocs
+	dh_installmenu
+	dh_installinit -- defaults 19
+	[ -f debian/postinst.debhelper ] && \
+	        cd debian && \
+		cat postinst.debhelper | \
+		    sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
+		    mv postinst.tmp postinst.debhelper
+	[ -f debian/prerm.debhelper ] && \
+		cd debian && \
+		cat prerm.debhelper | \
+		    sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
+		    mv prerm.tmp prerm.debhelper
+	# dh_installmanpages
+	# dh_installchangelogs @top_srcdir@/docs/Changelog
+	dh_link
+	# dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
 
-override_dh_install:
-	# However, remove the rc.d links
-	-rm -rf `pwd`/debian/@install_name@/etc/rc?.d
-	# Remove samhain_stealth for light install
-	-rm -f `pwd`/debian/@install_name@/@sbindir@/@install_name@_stealth
-	# remove samhain_setpwd if not needed
-	if ! test x$(PASSWORD) = x; then \
-		rm -f `pwd`/debian/@install_name@/@sbindir@/@install_name@_setpwd; \
-	fi
+define checkdir
+	test -f debian/rules
+endef
 
-override_dh_installdocs:
-	# do nothing
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
 
-override_dh_installchangelogs:
-	# do nothing
-
-override_dh_installman:
-	# do nothing
-
-override_dh_installinit:
-	dh_installinit --no-start -- defaults 19
-
-override_dh_usrlocal:
-	# do nothing
-
-override_dh_fixperms:
-	dh_fixperms
-	# Fix the permissions
-	chmod o-rX `pwd`/debian/@install_name@/@mydataroot@ \
-		`pwd`/debian/@install_name@/@myrpmconffile@
-	if ! test "x@mylogdir@" = "x/var/log"; then \
-		chmod o-rX `pwd`/debian/@install_name@/@mylogdir@; \
-	fi
-
-
Index: trunk/rules.deb.in
===================================================================
--- trunk/rules.deb.in	(revision 591)
+++ trunk/rules.deb.in	(revision 1)
@@ -8,59 +8,109 @@
 #
 
-%:
-	dh $@ --with-autoreconf
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-override_dh_clean:
-	[ ! -f Makefile ] || $(MAKE) distclean
-	-rm -f samhainrc.install
-	-rm -f build-stamp build-server-stamp build-client-stamp
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
+package=@install_name@
+
+# CAVEAT: including the --enable-base= option is for packages to be
+#         distributed INTERNALLY on your network, NOT for packages
+#         to be distributed to THIRD PARTIES
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	@top_srcdir@/configure @mydefargs@
+	$(MAKE) 
+	# echo '#!/bin/sh' > ./sstrip
+	# echo 'echo "*** SSTRIP DISABLED ***"' >> ./sstrip
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	-[ -f Makefile ] && $(MAKE) distclean
 	dh_clean
 
-override_dh_auto_configure:
-	@top_srcdir@/configure @mydefargs@
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
 
-override_dh_auto_build:
-	dh_auto_build
-	if ! test x$(PASSWORD) = x; then \
-		if test -f samhain_setpwd; then \
-			./samhain_setpwd samhain new $(PASSWORD); \
-			rm samhain; \
-			mv samhain.new samhain; \
-		fi; \
-	fi
+	# Fix the permissions
+	#chmod o-rX `pwd`/debian/tmp/var/log/samhain \
+	#	`pwd`/debian/tmp/var/run/samhain \
+	#	`pwd`/debian/tmp/var/state/samhain \
+	#	`pwd`/debian/tmp/etc/samhain
 
-override_dh_auto_install:
-	$(MAKE) install install-boot DESTDIR=`pwd`/debian/@install_name@
+	$(MAKE) install install-boot DESTDIR=`pwd`/debian/tmp
 
-override_dh_install:
 	# However, remove the rc.d links
-	-rm -rf `pwd`/debian/@install_name@/etc/rc?.d
+	-rm -rf `pwd`/debian/tmp/etc/rc?.d
 
-override_dh_installdocs:
-	dh_installdocs
-	[ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.html.tar ] && \
-		cd debian/@install_name@/usr/share/doc/@install_name@ && \
-		tar xf MANUAL-2_4.html.tar && mv MANUAL-2_4 manual.html && \
-		rm -f MANUAL-2_4.html.tar
-	[ -f debian/@install_name@/usr/share/doc/@install_name@/MANUAL-2_4.pdf ] && \
-		cd debian/@install_name@/usr/share/doc/@install_name@ && \
-		mv MANUAL-2_4.pdf manual.pdf
+	# install -m 755 encode `pwd`/debian/tmp/usr/bin/samhain_encode
 
-override_dh_installchangelogs:
-	dh_installchangelogs docs/Changelog
+	# install -m 644 profiles/debianlinux_i386/samhainrc `pwd`/debian/tmp@myconffile@
+	# install -m 644 debian/samhain.logrotate `pwd`/debian/tmp/etc/logrotate.d/samhain
 
-override_dh_installinit:
-	dh_installinit --no-start -- defaults 19
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
 
-override_dh_usrlocal:
-	# do nothing
 
-override_dh_fixperms:
+# Build architecture-dependent files here.
+binary-arch: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_installdebconf	
+	dh_installdocs 
+	[ -f debian/tmp/usr/share/doc/@install_name@/MANUAL-2_0.html.tar ] && \
+		cd debian/tmp/usr/share/doc/@install_name@ && \
+		tar xf MANUAL-2_0.html.tar && mv MANUAL-2_0 manual.html && \
+		rm -f MANUAL-2_0.html.tar
+	dh_installexamples @top_srcdir@/scripts/example_pager.pl \
+		@top_srcdir@/scripts/example_sms.pl \
+		@top_srcdir@/scripts/report.pl \
+		@top_srcdir@/scripts/concat.pl \
+		@top_srcdir@/scripts/samhain.logrotator \
+		@top_srcdir@/scripts/samhainadmin.pl \
+		@top_srcdir@/scripts/check_samhain.pl \
+		@top_srcdir@/yulerc.template \
+		@top_srcdir@/samhainrc.linux
+	dh_installmenu
+	dh_installinit -- defaults 19
+	[ -f debian/postinst.debhelper ] && \
+	        cd debian && \
+		cat postinst.debhelper | \
+		    sed 's%/etc/init.d/@install_name@ start%:%' > postinst.tmp && \
+		    mv postinst.tmp postinst.debhelper
+	[ -f debian/prerm.debhelper ] && \
+		cd debian && \
+		cat prerm.debhelper | \
+		    sed 's%/etc/init.d/@install_name@ stop%/etc/init.d/@install_name@ stop || echo service @install_name@ already stopped%' > prerm.tmp && \
+		    mv prerm.tmp prerm.debhelper
+	# dh_installmanpages
+	dh_installchangelogs @top_srcdir@/docs/Changelog
+	dh_link
+	# dh_strip
+	dh_compress
 	dh_fixperms
-	# Fix the permissions
-	chmod o-rX `pwd`/debian/@install_name@/@mydataroot@ \
-		`pwd`/debian/@install_name@/@myrpmconffile@
-	if ! test "x@mylogdir@" = "x/var/log"; then \
-		chmod o-rX `pwd`/debian/@install_name@/@mylogdir@; \
-	fi
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
+
+define checkdir
+	test -f debian/rules
+endef
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
+
Index: trunk/samhain-install.sh.in
===================================================================
--- trunk/samhain-install.sh.in	(revision 591)
+++ trunk/samhain-install.sh.in	(revision 1)
@@ -27,12 +27,6 @@
 myhtmlfile=@myhtmlfile@
 
-datarootdir=@datarootdir@
-
 INSTALL_SHELL="$0 --install-sh -m 700"
 INSTALL_DATA="$0 --install-sh  -m 600"
-
-# systemd exposes service files via API and generates an annoying warning message
-#
-INSTALL_SYSTEMD="$0 --install-sh  -m 644"
 
 mkinstalldirs="$0 --mkinstalldirs"
@@ -69,5 +63,5 @@
     echo 'action = install-boot|install-data|install-user'
     echo '         uninstall|purge|uninstall-boot'
-    echo '         uninstall-data|uninstall-man|uninstall-program'
+    echo '         uninstall-data|uninstall-man|uninstall-program|uninstall-lkm'
     echo 'samhain-install.sh --print-config <item>'
     echo 'item = name | basekey | prefix | exec_prefix | sbin_dir | man_dir'
@@ -518,4 +512,8 @@
 	    break;;
 
+	uninstall-lkm)
+	    act=ulkm
+	    break;;
+
 	uninstall | remove | purge)
 	    opts=
@@ -525,4 +523,6 @@
 	    test x"$DESTDIR" = "x" || opts="$opts --destdir=$DESTDIR"
 	    test x"$1" = "xpurge" && purge=yes
+	    echo "$0 $opts uninstall-lkm"
+	    eval $0 $opts uninstall-lkm
 	    echo "$0 $opts uninstall-program"
 	    eval $0 $opts uninstall-program
@@ -672,5 +672,5 @@
        realname="$user"
        case "$platform" in
-           FreeBSD/* | NetBSD/* | OpenBSD/* )
+           FreeBSD/* | NetBSD/* )
               file=/etc/master.passwd
               entry="${user}:*:${uid}:${gid}::0:0:${realname}:${home}:${shell}"
@@ -678,5 +678,5 @@
               break
 	      ;;
-           Linux/* | GNU/kFreeBSD/* | GNU/* )
+           Linux/* )
                file=/etc/passwd
                entry="${user}:*:${uid}:${gid}:${realname}:${home}:${shell}"
@@ -757,14 +757,4 @@
 
     case "$platform" in
-    Darwin/*)
-	DVER="MACOSX"
-	test -z "$verbose" || echo "MacOS X system detected"
-	rc_main="/Library/StartupItems/${samhain}"
-	${mkinstalldirs} ${rc_main}
-	rc_dirz=
-	rc_inst="(cd /Library/StartupItems/${samhain} && echo '{' >StartupParameters.plist && echo '  Description        = \"@install_name@\";'  >>StartupParameters.plist && echo '  Provides           = (\"@install_name@\");' >>StartupParameters.plist && echo '  Requires           = (\"Network\");'      >>StartupParameters.plist && echo '  OrderPreference     = \"Last\";' >>StartupParameters.plist && echo '}' >>StartupParameters.plist && chmod 644 StartupParameters.plist; )"
-	rc_uinst="rm -rf /Library/StartupItems/@install_name@"
-	;;
-
     IRIX*/*)
         DVER="IRIX"
@@ -782,5 +772,5 @@
 	rc_main=@sbindir@
 	rc_dirz=
-	rc_inst="/usr/sbin/mkitab '@install_name@:2:wait:@sbindir@/@install_name@ start >/dev/console 2>&1'"
+	rc_inst="/usr/sbin/mkitab -i '@install_name@:2:wait:@sbindir@/@install_name@ start >/dev/console 2>&1'"
 	rc_uinst="/usr/sbin/rmitab @install_name@"
 	;;
@@ -795,56 +785,11 @@
 	;;
 
-    OpenBSD/*)
-	test -z "$verbose" || echo "  OpenBSD system detected"
-	grep '^## begin @install_name@' /etc/rc.local >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    RCLOCALTMP=`mktemp /etc/rc.local.XXXXXXXXXX` || exit 1
-	    sed "/^## begin @install_name@/,/^## end @install_name@/d" /etc/rc.local >$RCLOCALTMP || exit 1
-	    cat $RCLOCALTMP >/etc/rc.local || exit 1
-	    rm -f $RCLOCALTMP || exit 1
-	    if test x"$act" = xuboot; then
-		echo "  uninstalling from /etc/rc.local completed"
-	    fi
-	fi
-	if test x"$act" = xboot; then
-	    echo "## begin @install_name@"          >>/etc/rc.local || exit 1
-	    echo "if [ -x @sbindir@/@install_name@ ]; then" >>/etc/rc.local || exit 1
-	    echo "  @sbindir@/@install_name@ start" >>/etc/rc.local || exit 1
-	    echo "fi"                               >>/etc/rc.local || exit 1
-	    echo "## end @install_name@"            >>/etc/rc.local || exit 1
-	    echo "  installing to /etc/rc.local completed"
-	fi
-	exit 0
-	;;
-
-    NetBSD/*)
-	test -z "$verbose" || echo "  NetBSD system detected"
-	if test -f /etc/rc.subr; then
-	    DVER="FreeBSD"
-	    rc_main=${DESTDIR}/etc/rc.d
-	    rc_dirz=
-	    rc_inst="chmod 755 /etc/rc.d/@install_name@"
-	    rc_uinst="rm -f /etc/rc.d/@install_name@"
-	else
-	    echo "${0}: unsupported platform ${platform} (too old)"
-	    exit 1
-	fi
-	;;
-
     FreeBSD/* )
+	DVER="FreeBSD"
 	test -z "$verbose" || echo "  FreeBSD system detected"
-	if test -f /etc/rc.subr; then
-	    DVER="FreeBSD"
-	    rc_main=${DESTDIR}/etc/rc.d
-	    rc_dirz=
-	    rc_inst="chmod 755 /etc/rc.d/@install_name@"
-	    rc_uinst="rm -f /etc/rc.d/@install_name@"
-	else
-	    DVER="Solaris"
-	    rc_main=${DESTDIR}/usr/local/etc/rc.d
-	    rc_dirz=
-	    rc_inst="mv /usr/local/etc/rc.d/@install_name@ /usr/local/etc/rc.d/@install_name@.sh && chmod 755 /usr/local/etc/rc.d/@install_name@.sh"
-	    rc_uinst="rm -f /usr/local/etc/rc.d/@install_name@.sh"
-	fi
+	rc_main=${DESTDIR}/usr/local/etc/rc.d
+	rc_dirz=
+	rc_inst="mv /usr/local/etc/rc.d/@install_name@ /usr/local/etc/rc.d/@install_name@.sh &&  chmod 755 /usr/local/etc/rc.d/@install_name@.sh"
+	rc_uinst="rm -f /usr/local/etc/rc.d/@install_name@.sh; echo You may want to remove ${rc_main} from local_startup in /etc/rc.conf; echo if it is empty"
 	if test x"$act" = xboot
 	then
@@ -852,5 +797,4 @@
 		test x"$act" = xboot && mkdir ${rc_main}
 	    fi
-	    if test "x$DVER" = "xSolaris"; then
 	    (   . /etc/defaults/rc.conf
                 . /etc/rc.conf
@@ -870,11 +814,8 @@
                 fi
             )
-	    fi
-	fi
+       fi
 	;;
-
     SunOS/5.* )
 	DVER="Solaris"
-	DVER_REAL="Solaris"
 	test -z "$verbose" || echo "  Solaris system detected"
 	rc_dirz=
@@ -883,6 +824,5 @@
 	rc_uinst="rm -f ${DESTDIR}/etc/init.d/@install_name@; rm -f ${DESTDIR}/etc/rc0.d/K10@install_name@; rm -f ${DESTDIR}/etc/rc1.d/K10@install_name@; rm -f ${DESTDIR}/etc/rc3.d/S99@install_name@"
 	;;
-
-    Linux/* | GNU/kFreeBSD* | GNU/* )
+    Linux/*)
 	rlv="2 3 4 5"
 	linkopt="-f -s"
@@ -897,5 +837,5 @@
 		rc_dirz=
 		rc_inst="/usr/lib/lsb/install_initd /etc/init.d/@install_name@"
-		rc_uinst="test -f /etc/init.d/@install_name@ && /usr/lib/lsb/remove_initd /etc/init.d/@install_name@"
+		rc_uinst="/usr/lib/lsb/remove_initd /etc/init.d/@install_name@"
 	    else
 		rc_inst=
@@ -1036,13 +976,4 @@
     fi
 
-    rc_systemd=
-    if command -v pkg-config >/dev/null 2>&1
-    then
-	if pkg-config --exists systemd >/dev/null 2>&1
-	then
-	   rc_systemd=`pkg-config --variable=systemdsystemunitdir systemd`
-	fi
-    fi
-	   
     if test x"${act}" = xboot 
     then
@@ -1074,5 +1005,5 @@
 		    ${mkinstalldirs} ${rc_main}
 		    #
-		    if test x"${DVER_REAL}" = xSolaris; then
+		    if test x"$DVER" = xSolaris; then
 			${mkinstalldirs} ${DESTDIR}/etc/rc0.d
 			${mkinstalldirs} ${DESTDIR}/etc/rc1.d
@@ -1119,31 +1050,4 @@
 	   fi
  	fi
-
-	if test x"${rc_systemd}" != x
-	then
-	    if test x"$DESTDIR" = x
-	    then
-		:
-	    else
-		${mkinstalldirs} ${DESTDIR}/${rc_systemd}
-	    fi
-            if test -f init/samhain.startSystemd
-	    then
-		servicescript=init/samhain.startSystemd
-	    elif test -f samhain.startSystemd
-	    then
-		servicescript=samhain.startSystemd
-	    else
-		echo "${0}: cannot find samhain.startSystemd in ./ or ./init"
-            fi
-	    if test -f ${DESTDIR}/${rc_systemd}/${samhain}.service && test x"$force" != xyes
-	    then
-		echo "  ${DESTDIR}/${rc_systemd}/${samhain}.service exists ... not overwritten (or use --force)"
-	    else
-		test -z "$verbose" || echo "  installing ${servicescript} as ${DESTDIR}/${rc_systemd}/${samhain}.service"
-		${INSTALL_SYSTEMD} ${servicescript} "${DESTDIR}/${rc_systemd}/${samhain}.service"
-	    fi
-	fi
-
 	echo "installing init scripts completed"
     fi
@@ -1163,18 +1067,12 @@
 	    do
 	      test -z "$verbose" || echo "  rm -f  ${rc_dirz}${ff}.d/S99${samhain}"
-	      rm -f  "${rc_dirz}${ff}.d/S99${samhain}"
+	      rm -f  ${rc_dirz}${ff}.d/S99${samhain}
 	      test -z "$verbose" || echo "  rm -f  ${rc_dirz}${ff}.d/S99${samhain}"
-	      rm -f  "${rc_dirz}${ff}.d/K10${samhain}"
+	      rm -f  ${rc_dirz}${ff}.d/K10${samhain}
 	    done
         fi
 
 	test -z "$verbose" || echo "  rm -f ${rc_main}/${samhain}"
-	rm -f "${rc_main}/${samhain}"
-
-	if test x"${rc_systemd}" != x
-	then
-	    test -z "$verbose" || echo "  rm -f  ${rc_systemd}/${samhain}.service"
-	    rm -f "${rc_systemd}/${samhain}.service"
-	fi
+	rm -f ${rc_main}/${samhain}
 
 	echo "  uninstalling init scripts completed"
@@ -1185,10 +1083,31 @@
 fi
 
+if test x"${act}" = xulkm
+then
+    RVER=`uname -r`
+    if test "x@sh_lkm@" != "x"; then
+        if test -d /lib/modules/$RVER; then 
+	    MODDIR="/lib/modules/$RVER"
+	elif test -d /lib/modules/misc; then 
+	    MODDIR="/lib/modules/misc"
+	elif test -d /lib/modules; then 
+	    MODDIR="/lib/modules/misc"
+	fi
+        # -- NEW --
+	ALLMODS="@sh_lkm@"
+        for p in $ALLMODS; do
+            test -z "$verbose" || echo "  rm -f ${DESTDIR}${MODDIR}/`echo $p|sed '
+s%samhain%@install_name@%'`"
+            rm -f ${DESTDIR}${MODDIR}/`echo $p|sed 's%samhain%@install_name@%'`
+        done
+    fi
+fi
+
 if test x"${act}" = xuprogram
 then
-    PROGRAMS="@setpwd_prg@ @stegin_prg@ @yulectl_prg@ @sh_main_prg@ @samhainadmin_prg@"
+    PROGRAMS="@setpwd_prg@ @stegin_prg@ @yulectl_prg@ @sh_main_prg@"
     for p in $PROGRAMS; do
-	test -z "$verbose" || echo "  rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`"
-	rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'|sed 's%.*/%%'`
+	test -z "$verbose" || echo "  rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"
+	rm -f ${DESTDIR}${sbindir}/`echo $p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`
     done
     test -z "$verbose" || echo $ECHO_N "  ${SH_RMDIR} ${DESTDIR}${sbindir} ... $ECHO_C"
@@ -1281,17 +1200,4 @@
 	else
 	    test -z "$verbose" || echo "${ECHO_T}failed (not empty ?)"
-	fi
-
-	
-	if test -d /etc/logrotate.d; then
-	    if test -f /etc/logrotate.d/@install_name@; then
-		test -z "$verbose" || echo $ECHO_N "  rm -f /etc/logrotate.d/@install_name@ ... $ECHO_C"
-		rm -f /etc/logrotate.d/@install_name@;
-		if test x$? = x0; then
-		     test -z "$verbose" || echo "${ECHO_T}done"
-		else
-		    test -z "$verbose" || echo "${ECHO_T}failed"
-		fi
-	    fi
 	fi
 
@@ -1344,7 +1250,4 @@
 
     GPGPATH=@mygpg@
-    SIGNIFY_PATH=@mysignify@
-    TARGETKEYID=@mykeyid@
-    KEYTAG=@mykeytag@
 
     NTEST=@mytclient@
@@ -1391,5 +1294,5 @@
 	echo "You need to sign the config file now"
 	echo
-	test -z "$verbose" || echo "  ${GPGPATH} -a ${KEYTAG} ${TARGETKEYID} --clearsign $RCFILE"
+	test -z "$verbose" || echo "  ${GPGPATH} -a --clearsign $RCFILE"
 	if test x"${NTEST}" = "x-DSH_WITH_SERVER"
 	then
@@ -1400,10 +1303,10 @@
 		DOT_GNUPG=`eval echo ~${samhain}/.gnupg`
 	        test -z "$verbose" || echo "  using --homedir ${DOT_GNUPG}"
-		${GPGPATH} --homedir ${DOT_GNUPG} -a ${KEYTAG} ${TARGETKEYID} --clearsign $RCFILE
+		${GPGPATH} --homedir ${DOT_GNUPG} -a --clearsign $RCFILE
 	    else
-		${GPGPATH} -a ${KEYTAG} ${TARGETKEYID} --clearsign $RCFILE
-	    fi
-	else
-	    ${GPGPATH} -a ${KEYTAG} ${TARGETKEYID} --clearsign $RCFILE
+		${GPGPATH} -a --clearsign $RCFILE
+	    fi
+	else
+	    ${GPGPATH} -a --clearsign $RCFILE
 	fi
 
@@ -1422,40 +1325,4 @@
 	    cp ${RCFILE} samhainrc.pre
         fi
-    elif test x"${SIGNIFY_PATH}" != x
-    then
-	echo
-	echo "You need to sign the config file now"
-	echo
-	test -z "$verbose" || echo "  ${SIGNIFY_PATH} -Se -s ~/.signify/samhain.sec -m $RCFILE"
-	if test x"${NTEST}" = "x-DSH_WITH_SERVER"
-	then
-	    myident_uid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
-		  grep "^${samhain}:" | awk -F: '{ print $3; }'`
-	    if test x"${myident_uid}" != x
-	    then
-		DOT_SIGNIFY=`eval echo ~${samhain}/.signify`
-	        test -z "$verbose" || echo "  using home directory ${DOT_SIGNIFY}"
-		${SIGNIFY_PATH} -Se -s ${DOT_GNUPG}/samhain.sec $RCFILE
-	    else
-		${SIGNIFY_PATH} -Se -s  ~/.signify/samhain.sec -m $RCFILE
-	    fi
-	else
-	    ${SIGNIFY_PATH} -Se -s  ~/.signify/samhain.sec -m $RCFILE
-	fi
-
-	if test -f ${RCFILE}.sig
-	then
-	    test -z "$verbose" || echo "  mv -f ${RCFILE}.sig samhainrc.pre"
-	    mv -f ${RCFILE}.sig samhainrc.pre
-	else
-	    echo "**********************************************************"
-	    echo
-	    echo "${0}: ERROR: cannot find signed file ${RCFILE}.sig"
-	    echo
-	    echo "   --- You need to sign the configuration file ---"
-	    echo
-	    echo "**********************************************************"
-	    cp ${RCFILE} samhainrc.pre
-        fi
     else
 	test -z "$verbose" || echo "  cp $RCFILE samhainrc.pre"
@@ -1484,25 +1351,20 @@
 	IFS=${OIFS}
 
-	if test -f stealth_template.ps
-	then
-	    PATH=${OPATH}
-	else
-	    if test x"${CONVERT}" = x
-	    then
-		echo "${0}: cannot find ImageMagick convert utility in PATH=${PATH}"
-		exit 1
-            fi
-
-	    PATH=${OPATH}
-
- 	    if test -f stealth_template.jpg
-	    then
-		test -z "$verbose" || echo "  ${CONVERT} +compress stealth_template.jpg stealth_template.ps"
-		"${CONVERT}" +compress stealth_template.jpg stealth_template.ps
-	    else
-		echo "${0}: cannot find file stealth_template.jpg"
-		exit 1
-            fi
-	fi
+	if test x"${CONVERT}" = x
+	then
+	    echo "${0}: cannot find ImageMagick convert utility in PATH=${PATH}"
+	    exit 1
+        fi
+
+	PATH=${OPATH}
+
+ 	if test -f stealth_template.jpg
+	then
+	    test -z "$verbose" || echo "  ${CONVERT} +compress stealth_template.jpg stealth_template.ps"
+	    "${CONVERT}" +compress stealth_template.jpg stealth_template.ps
+	else
+	    echo "${0}: cannot find file stealth_template.jpg"
+	    exit 1
+        fi
 
 
Index: trunk/samhain.spec.in
===================================================================
--- trunk/samhain.spec.in	(revision 591)
+++ trunk/samhain.spec.in	(revision 1)
@@ -14,16 +14,6 @@
 Packager: Andre Oliveira da Costa <brblueser@uol.com.br>
 Provides: %{name}
-%if 0%{?suse_version}
-Requires(pre): shadow
-%else
-Requires(pre): shadow-utils
-%endif
-
-# dummy (fix configure warning)
-# datarootdir = @datarootdir@
 
 # no quotes here - aparently will be expanded literally
-
-%define password %(echo $PASSWORD)
 
 %define withpwd_prg x@clmytclient@
@@ -72,14 +62,7 @@
 ./configure @mydefargs@ 
 make
-%if "%{withpwd_prg}" == "xDSH_WITH_CLIENT"
-%if "%{password}" != ""
-        ./samhain_setpwd samhain new %{password}
-	mv samhain samhain.old
-	mv samhain.new samhain
-%endif
-%endif
-
 
 %install
+
 rm -rf ${RPM_BUILD_ROOT}
 # sstrip shouldn't be used since binaries will be stripped later
@@ -92,5 +75,5 @@
 # after the package is installed
 #
-install -m 700 samhain-install.sh init/samhain.startLinux init/samhain.startLSB init/samhain.startSystemd ${RPM_BUILD_ROOT}@mydataroot@
+install -m 700 samhain-install.sh init/samhain.startLinux init/samhain.startLSB ${RPM_BUILD_ROOT}@mydataroot@
 #
 # file list (helpful advice from Lars Kellogg-Stedman)
@@ -103,23 +86,18 @@
 rm -rf ${RPM_BUILD_ROOT}
 
-%pre
-if test "x@install_name@" = "xyule"
-then
-    getent group samhain >/dev/null || groupadd -r samhain
-    getent passwd yule >/dev/null || \
-	useradd -r -g samhain -d  @mydataroot@ -s /sbin/nologin \
-	-c "samhain server daemon" yule
-
-fi
-exit 0
-
 %post
+if test "x@sh_lkm@" = x; then
+   :
+else
+   if test -f /sbin/depmod; then
+     /sbin/depmod -a
+   fi
+fi
 if [ "$1" -ge 1 ]; then
         # Activate boot-time start up
         cd @mydataroot@
-        /bin/sh ./samhain-install.sh --verbose install-boot
+        ./samhain-install.sh --verbose install-boot
 	rm -f ./samhain.startLSB
 	rm -f ./samhain.startLinux
-	rm -f ./samhain.startSystemd
 	if [ -f @sbindir@/@install_name@_stealth ]; then
 		rm -f samhain-install.sh
@@ -174,5 +152,5 @@
         cd @mydataroot@
         if [ -f ./samhain-install.sh ]; then
-	    /bin/sh ./samhain-install.sh --verbose uninstall-boot
+	    ./samhain-install.sh --verbose uninstall-boot
 	else
 	    if test -f /usr/lib/lsb/remove_initd; then
@@ -183,16 +161,23 @@
 fi
 
+%postun
+if [ "$1" = 0 ]; then
+        # remove any kernel modules that might have been installed
+        RVER=`uname -r`
+	MODFILES=`ls /lib/modules/$RVER/@install_name@* 2>/dev/null`
+	if test "x$MODFILES" = x; then
+		:
+	else
+        	rm -f /lib/modules/$RVER/@install_name@*
+	fi
+fi
 
 
 %files -f sh_file_list
 %defattr(-,root,root)
-%if "@mylockdir@" != "/run" || "@mylockdir@" != "/var/run"
-	%dir @mylockdir@
-%endif
-%if "@mylogdir@" != "/var/log"
-	%dir @mylogdir@
-%endif
-%doc docs/BUGS COPYING docs/Changelog 
-%doc LICENSE docs/FAQ.html docs/HOWTO* docs/MANUAL-2_4.* docs/README*
+%dir @mylockdir@
+%dir @mylogdir@
+%doc docs/BUGS COPYING docs/Changelog docs/TODO
+%doc LICENSE docs/FAQ.html docs/HOWTO* docs/MANUAL-2_0.* docs/README*
 @mydataroot@
 %if "%{withstg_prg}" == "xsamhain_stealth"
@@ -204,36 +189,11 @@
 %if "%{withpwd_prg}" == "xDSH_WITH_SERVER"
         @sbindir@/@install_name@ctl
-	@sbindir@/@install_name@admin-sig.pl
-	@sbindir@/@install_name@admin-gpg.pl
         %exclude @sbindir@/@install_name@_setpwd
 %endif
 %attr(644,root,root) @mandir@/man5/@install_name@*
 %attr(644,root,root) @mandir@/man8/@install_name@*
-%attr(644,root,root) /etc/logrotate.d/@install_name@
-%if "%{name}" == "yule"
-%attr(750,root,samhain) @mydataroot@ 
-%attr(750,yule,samhain) @mylogdir@ 
-%endif
 %config(noreplace) @myrpmconffile@
 
 %changelog
-* Tue Jul 28 2020 Rainer Wichmann
-- fix bogus date
-- fix for recent split into samhainadmin-gpg.pl, samhainadmin-sig.pl
-
-* Wed May 01 2019 Rainer Wichmann
-- remove obsolete part fpr sh_lkm
-- add fixes by Franky Van L. (password, directory ownership)
-
-* Mon Dec 18 2017 Rainer Wichmann
-- patch for SLES12 by Pirmin
-- fix missing yuleadmin.pl file
-
-* Tue Oct 23 2012 Rainer Wichmann
-- fixes for yule installation
-
-* Tue May 16 2006 Rainer Wichmann
-- fix manual version, noticed by Imre Gergely
-
 * Tue Apr 05 2005 Rainer Wichmann
 - disable automatic stripping, use sstrip
@@ -268,5 +228,5 @@
 - Compiled on RedHat Enterprise Linux ES 3
 
-* Wed Mar 26 2003 Rainer Wichmann
+* Thu Mar 26 2003 Rainer Wichmann
 - strip REQ_FROM_SERVER in config file path (%config(noreplace) ...)
 
Index: trunk/samhainrc.freebsd
===================================================================
--- trunk/samhainrc.freebsd	(revision 591)
+++ trunk/samhainrc.freebsd	(revision 1)
@@ -61,160 +61,50 @@
 # RedefUser1=(no default)
 
-#
-# --------- / --------------
-#
-
-[ReadOnly]
-dir = 0/
-
 [Attributes]
-file = /
-file = /proc
-file = /entropy
-file = /tmp
-file = /var
-
-#
-# --------- /dev -----------
-#
-
-[Attributes]
-dir = 99/dev
+##
+## for these files, only changes in permissions and ownership are checked
+##
+
+file=/usr/compat/linux/etc
+file=/usr/compat/linux/etc/ld.so.cache
+
+dir=/var/mail
+dir=/var/spool/lp/tmp
+dir=/var/tmp
+# dir=/var/dt/tmp
+dir=/tmp
+
+
+[LogFiles]
+##
+## for these files, changes in signature, timestamps, and size are ignored 
+##
+
+file=/var/run/utmp
+
+
+[GrowingLogFiles]
+##
+## for these files, changes in signature, timestamps, and increase in size
+##                  are ignored 
+##
+
+file=/var/log/wtmp
+file=/var/log/messages
+file=/var/log/maillog
+file=/var/log/lastlog
+file=/var/log/cron
+file=/var/log/auth.log
+
 
 [IgnoreAll]
-file = /dev/ttyp?
-
-[Misc]
-##
-## pseudo terminals are created/removed as needed
-##
-IgnoreAdded = /dev/(p|t)typ.*
-IgnoreMissing = /dev/(p|t)typ.*
-
-
-#
-# --------- /etc -----------
-#
-
-[ReadOnly]
-##
-## for these files, only access time is ignored
-##
-dir = 99/etc
-
-
-#
-# --------- /boot -----------
-#
-
-[ReadOnly]
-dir = 99/boot
-
-#
-# --------- /bin, /sbin -----------
-#
-
-[ReadOnly]
-dir = 99/bin
-dir = 99/sbin
-
-#
-# --------- /lib -----------
-#
-
-[ReadOnly]
-dir = 99/lib
-
-#
-# --------- /libexec -----------
-#
-
-[ReadOnly]
-dir = 99/libexec
-
-#
-# --------- /rescue -----------
-#
-
-[ReadOnly]
-dir = 99/rescue
-
-#
-# --------- /root -----------
-#
-
-[Attributes]
-##
-## for these files, only changes in permissions and ownership are checked
-##
-dir = 99/root
-
-#
-# --------- /stand -----------
-#
-
-[ReadOnly]
-dir = 99/stand
-
-#
-# --------- /usr -----------
-#
-
-[ReadOnly]
-dir = 99/usr
-
-[Attributes]
-dir = /usr/.snap
-dir = /usr/share/man/cat?
-file = /usr/compat/linux/etc
-file = /usr/compat/linux/etc/ld.so.cache
-
-[IgnoreAll]
-dir = -1/usr/home
-
-#
-# --------- /var -----------
-#
-
-[Attributes]
-
-dir = 0/var
-
-[LogFiles]
-##
-## for these files, changes in signature, timestamps, and size are ignored 
-##
-
-file=/var/run/utmp
-
-[GrowingLogFiles]
-##
-## For these files, changes in signature, timestamps, and increase in size
-## are ignored. Logfile rotation will cause a report because of shrinking
-## size and different inode. 
-##
-dir = 99/var/log
-
-[Attributes]
-#
-# rotated logs will change inode
-#
-file = /var/log/*.[0-9].bz2
-file = /var/log/*.[0-9].log
-file = /var/log/*.[0-9]
-file = /var/log/*.[0-9][0-9]
-file = /var/log/*.old
-
-file = /var/log/sendmail.st
-
-
-[Misc]
-#
-# Various naming schemes for rotated logs
-#
-IgnoreAdded = /var/log/.*\.[0-9]+$
-IgnoreAdded = /var/log/.*\.[0-9]+\.gz$
-IgnoreAdded = /var/log/.*\.[0-9]+\.bz2$
-IgnoreAdded = /var/log/.*\.[0-9]+\.log$
+##
+## for these files, no modifications are reported
+##
+
+dir=/usr/share/man
+dir=/usr/share/games
+dir=/usr/share/misc
+dir=/usr/X11R6/man
 
 
@@ -227,4 +117,21 @@
 
 
+[ReadOnly]
+##
+## for these files, only access time is ignored
+##
+
+dir=/bin
+dir=/boot
+dir=3/etc
+dir=/sbin
+dir=1/stand
+dir=/stand/etc
+dir=/stand/modules
+dir=/usr
+dir=2/var/cron
+
+file=/kernel
+dir=/modules
 
 [User0]
@@ -370,4 +277,21 @@
 # SuidCheckQuarantineDelete = yes
 
+# [Kernel]
+##
+## --- Check for loadable kernel module rootkits (Linux/FreeBSD only) 
+##
+
+## Switch on/off
+#
+# KernelCheckActive = True
+
+## Check interval (seconds); btw., the check is VERY fast
+#
+# KernelCheckInterval = 300
+
+## Severity
+#
+# SeverityKernel = crit
+
 
 # [Utmp]
@@ -529,5 +453,5 @@
 # FileCheckScheduleTwo = NULL
 
-## Report only once on modified files 
+## Report only once on modified fles 
 ## Setting this to 'FALSE' will generate a report for any policy 
 ## violation (old and new ones) each time the daemon checks the file system.
@@ -621,5 +545,5 @@
 ## Path to the PID file
 #
-# SetLockfilePath = (default: compiled-in)
+# SetLockPath = (default: compiled-in)
 
 
Index: trunk/samhainrc.linux
===================================================================
--- trunk/samhainrc.linux	(revision 591)
+++ trunk/samhainrc.linux	(revision 1)
@@ -61,197 +61,82 @@
 # RedefIgnoreAll=(no default)
 # RedefIgnoreNone=(no default)
-
 # RedefUser0=(no default)
 # RedefUser1=(no default)
 
-#
-# --------- / --------------
-#
-
-[ReadOnly]
-dir = 0/
-
 [Attributes]
-file = /tmp
-file = /dev
-file = /media
-file = /proc
-file = /sys
-
-#
-# --------- /etc -----------
-#
-
-[ReadOnly]
-##
-## for these files, only access time is ignored
-##
-dir = 99/etc
-
-[Attributes]
-##
-## check permission and ownership
-##
-file = /etc/mtab
-file = /etc/adjtime
-file = /etc/motd
-file = /etc/lvm/.cache
-
-# On Ubuntu, these are in /var/lib rather than /etc
-file = /etc/cups/certs
-file = /etc/cups/certs/0
-
-# managed by fstab-sync on Fedora Core
-file = /etc/fstab
-
-# modified when booting 
-file = /etc/sysconfig/hwconf
-
+##
+## for these files, only changes in permissions and ownership are checked
+##
+file=/etc/mtab
+file=/etc/ssh_random_seed
+file=/etc/asound.conf
+file=/etc/resolv.conf
+file=/etc/localtime
+file=/etc/ioctl.save
+file=/etc/passwd.backup
+file=/etc/shadow.backup
+
+#
 # There are files in /etc that might change, thus changing the directory
 # timestamps. Put it here as 'file', and in the ReadOnly section as 'dir'.
-
-file = /etc
-
-#
-# --------- /boot -----------
-#
-
-[ReadOnly]
-dir = 99/boot
-
-#
-# --------- /bin, /sbin -----------
-#
-
-[ReadOnly]
-dir = 99/bin
-dir = 99/sbin
-
-#
-# --------- /lib -----------
-#
-
-[ReadOnly]
-dir = 99/lib
-
-#
-# --------- /dev -----------
-#
-
-[Attributes]
-dir = 99/dev
+#
+file=/etc
+
+[LogFiles]
+##
+## for these files, changes in signature, timestamps, and size are ignored 
+##
+file=/var/run/utmp
+file=/etc/motd
+
+
+
+#####################################################################
+#
+# This would be the proper syntax for parts that should only be
+#    included for certain hosts.
+# You may enclose anything in a @HOSTNAME/@end bracket, as long as the
+#    result still has the proper syntax for the config file.
+# You may have any number of @HOSTNAME/@end brackets.
+# HOSTNAME should be the fully qualified 'official' name 
+#    (e.g. 'nixon.watergate.com', not 'nixon'), no aliases. 
+#    No IP number - except if samhain cannot determine the 
+#    fully qualified hostname.
+#
+# @HOSTNAME
+# file=/foo/bar
+# @end
+#
+# These are two examples for conditional inclusion/exclusion
+# of a machine based on the output from 'uname -srm'
+#
+# $Linux:2.*.7:i666
+# file=/foo/bar3
+# $end
+#
+# !$Linux:2.*.7:i686
+# file=/foo/bar2
+# $end
+#
+#####################################################################
+
+[GrowingLogFiles]
+##
+## for these files, changes in signature, timestamps, and increase in size
+##                  are ignored 
+##
+file=/var/log/warn
+file=/var/log/messages
+file=/var/log/wtmp
+file=/var/log/faillog
 
 [IgnoreAll]
 ##
-## pseudo terminals are created/removed as needed
-##
-dir = -1/dev/pts
-
-# dir = -1/dev/.udevdb
-
-file = /dev/ppp
-
-#
-# --------- /usr -----------
-#
-
-[ReadOnly]
-dir = 99/usr
-
-#
-# --------- /var -----------
-#
-
-[ReadOnly]
-dir = 99/var
-
-[IgnoreAll]
-dir = -1/var/cache
-dir = -1/var/backups
-dir = -1/var/games
-dir = -1/var/gdm
-dir = -1/var/lock
-dir = -1/var/mail
-dir = -1/var/run
-dir = -1/var/spool
-dir = -1/var/tmp
-dir = -1/var/lib/texmf
-dir = -1/var/lib/scrollkeeper
-
-
-[Attributes]
-
-dir = /var/lib/nfs
-dir = /var/lib/pcmcia
-
-# /var/lib/rpm changes if packets are installed;
-# /var/lib/rpm/__db.00[123] even more frequently
-file = /var/lib/rpm/__db.00?
-
-file = /var/lib/acpi-support/vbestate
-file = /var/lib/alsa/asound.state
-file = /var/lib/apt/lists/lock
-file = /var/lib/apt/lists/partial
-file = /var/lib/cups/certs
-file = /var/lib/cups/certs/0
-file = /var/lib/dpkg/lock
-file = /var/lib/gdm
-file = /var/lib/gdm/.cookie
-file = /var/lib/gdm/.gdmfifo
-file = /var/lib/gdm/:0.Xauth
-file = /var/lib/gdm/:0.Xservers
-file = /var/lib/logrotate/status
-file = /var/lib/mysql
-file = /var/lib/mysql/ib_logfile0
-file = /var/lib/mysql/ibdata1
-file = /var/lib/slocate
-file = /var/lib/slocate/slocate.db
-file = /var/lib/slocate/slocate.db.tmp
-file = /var/lib/urandom
-file = /var/lib/urandom/random-seed
-file = /var/lib/random-seed
-file = /var/lib/xkb
-
-
-[GrowingLogFiles]
-##
-## For these files, changes in signature, timestamps, and increase in size
-## are ignored. Logfile rotation will cause a report because of shrinking
-## size and different inode. 
-##
-dir = 99/var/log
-
-[Attributes]
-#
-# rotated logs will change inode
-#
-file = /var/log/*.[0-9].gz
-file = /var/log/*.[0-9].log
-file = /var/log/*.[0-9]
-file = /var/log/*.old
-file = /var/log/*/*.[0-9].gz
-file = /var/log/*/*.[0-9][0-9].gz
-file = /var/log/*/*.log.[0-9]
-
-[Misc]
-#
-# Various naming schemes for rotated logs
-#
-IgnoreAdded = /var/log/.*\.[0-9]+$
-IgnoreAdded = /var/log/.*\.[0-9]+\.gz$
-IgnoreAdded = /var/log/.*\.[0-9]+\.log$
-#
-# Subdirectories
-#
-IgnoreAdded = /var/log/[[:alnum:]]+/.*\.[0-9]+$
-IgnoreAdded = /var/log/[[:alnum:]]+/.*\.[0-9]+\.gz$
-IgnoreAdded = /var/log/[[:alnum:]]+/.*\.[0-9]+\.log$
-#
-IgnoreAdded = /var/lib/slocate/slocate.db.tmp
-IgnoreMissing = /var/lib/slocate/slocate.db.tmp
-
-#
-# --------- other policies -----------
-#
+## for these files, no modifications are reported
+##
+## This file might be created or removed by the system sometimes.
+##
+file=/etc/resolv.conf.pcmcia.save
+
 
 [IgnoreNone]
@@ -267,4 +152,33 @@
 ##
 
+
+[ReadOnly]
+##
+## for these files, only access time is ignored
+##
+dir=/usr/bin
+dir=/bin
+dir=/boot
+#
+# SuSE (old) has the boot init scripts in /sbin/init.d/*, 
+# so we go 3 levels deep
+#
+dir=3/sbin
+dir=/usr/sbin
+dir=/lib
+#
+# RedHat and Debian have the bootinit scripts in /etc/init.d/* or /etc/rc.d/*, 
+#        so we go 3 levels deep there too
+#
+dir=3/etc
+
+# Various directories / files that may include / be SUID/SGID binaries
+#
+#
+dir=/usr/X11R6/bin
+dir=/usr/X11R6/lib/X11/xmcd/bin
+file=/usr/lib/pt_chown
+dir=/opt/gnome/bin
+dir=/opt/kde/bin
 
 [User0]
@@ -272,5 +186,4 @@
 ## User0 and User1 are sections for files/dirs with user-definable checking
 ## (see the manual) 
-
 
 
@@ -290,6 +203,11 @@
 # SeverityUser0=crit
 # SeverityUser1=crit
+
+##
+## We have a file in IgnoreAll that might or might not be present.
+## Setting the severity to 'info' prevents messages about deleted/new file.
+##
 # SeverityIgnoreAll=crit
-
+SeverityIgnoreAll=info
 
 ## Files : file access problems
@@ -408,4 +326,21 @@
 # SuidCheckQuarantineDelete = yes
 
+#[Kernel]
+##
+## --- Check for loadable kernel module rootkits (Linux/FreeBSD only) 
+##
+
+## Switch on/off
+#
+# KernelCheckActive = True
+
+## Check interval (seconds); btw., the check is VERY fast
+#
+# KernelCheckInterval = 300
+
+## Severity
+#
+# SeverityKernel = crit
+
 
 # [Utmp]
@@ -536,4 +471,9 @@
 ChecksumTest=check
 
+## whether to drop linux capabilities that are not required
+## - will make a root process a 'mere mortal' in many respects
+#
+# UseCaps = yes
+
 ## Set nice level (-19 to 19, see 'man nice'),
 ## and I/O limit (kilobytes per second; 0 == off)
@@ -565,5 +505,5 @@
 # FileCheckScheduleTwo = NULL
 
-## Report only once on modified files 
+## Report only once on modified fles 
 ## Setting this to 'FALSE' will generate a report for any policy 
 ## violation (old and new ones) each time the daemon checks the file system.
@@ -664,5 +604,5 @@
 ## Path to the PID file
 #
-# SetLockfilePath = (default: compiled-in)
+# SetLockPath = (default: compiled-in)
 
 
Index: trunk/samhainrc.netbsd
===================================================================
--- trunk/samhainrc.netbsd	(revision 591)
+++ 	(revision )
@@ -1,843 +1,0 @@
-#
-# From pkgsrc-wip, Author: Brian Seklecki
-#
-
-[Misc]
-RedefUser0=+INO, +SIZ, +RDEV, +CHK, -MOD, -MTM, -ATM, -CTM, -GRP, -USR
-
-# The new Samhain behavior is to check the checksum up the last-known size of
-# the file, but *yes*, the inode will change when it becomes rotated and the size
-# will get reset to a lesser value (in which case the check should know to passively 
-# fail)
-RedefGrowingLogFiles=-INO, -SIZ, +CHK, -MTM, -ATM, -CTM
-
-#
-# --------- / --------------
-#
-
-[ReadOnly]
-dir = 99/
-
-# This covers the contents of / including: /boot, /bin, /sbin, /lib, /libexec,
-# /rescue, /root, /altroot, /usr, /var, /stand, /mnt, /tmp, /proc, /kern (Even 
-# though /usr and /var will recieve overrides)
-
-[Attributes]
-file = /proc
-file = /kern
-
-[IgnoreAll]
-dir=-1/proc
-dir=-1/kern
-
-#
-# --------- /tmp -----------
-#
-[Attributes]
-file=/tmp
-[IgnoreAll]
-dir=-1/tmp
-
-
-
-#
-# --------- /root --------------
-#
-
-# Per section 5.4.2.1 of the manual, Rule #5, there are lock file written here
-# that changes the mtime/ctime of the dir, so we want to watch perms/ownership,
-# ignore ctime/mtime/size, etc., but still watch the critical files inside.
-# Note: in theory, /root should never change if you use sudo(8) w/o "-H"
-[ReadOnly]
-dir=/root/.gnupg
-[Attributes]
-file=/root/.gnupg
-file=/root/.gnupg/random_seed
-
-#
-# --------- /dev -----------
-#
-
-[Attributes]
-dir = 99/dev
-
-# User0 will be for /dev/tty* and other devices where Owner/Group/Mode can 
-# change but the Inode/Size/Device/Checksum should not change.
-
-[User0]
-file=/dev/tty*
-file=/dev/pty*
-
-#
-# --------- /etc -----------
-#
-
-[ReadOnly]
-##
-## for these files, only access time is ignored
-##
-dir = 99/etc
-
-
-# If you're running dhclient(8), resolv.conf will get re-written at renewal
-# time so pray that he dhcpd(8) on your network doesn't get owned.
-# Crytpo-signed DHCP traffic would be too much to ask from ISC, but maybe
-# not from the OpenBSD hack
-
-[Attributes]
-file=/etc/dhclient.conf
-
-# If you run CUPS, /etc/printcap gets re-written if you have
-# "Browsing On" and "Printcap /etc/printcap" in cupsd.conf(5) 
-[Attributes]
-file=/etc/printcap
-
-
-#
-# --------- /usr -----------
-#
-
-# note about the following two: this reduced the size
-# of the database greatly
-
-#
-# --------- /usr/pkgsrc -----------
-#
-
-# Leave this uncommented if you CVS update your pkgsrc
-# periodically/automatically.  If you do not, comment it
-# out and you should be informed about any unauthorized
-# modifications to pkgsrc (which is an attack vector)
-
-[IgnoreAll]
-dir=-1/usr/pkgsrc
-
-#
-# --------- /usr/src -----------
-#
-
-# Leave this uncommented if you CVS update your src
-# periodically/automatically.  If you do not, comment it
-# out and you should be informed about any unauthorized
-# modifications to src (which is an attack vector)
-
-
-[IgnoreAll]
-dir=-1/usr/src
-
-
-#
-# --------- /usr/home (/home) -----------
-#
-
-
-# /home may be a symlink to /usr/home on a stock system, but most admins cane
-# that shit. [Attributes] could be replaced here by [ReadOnly] if we wanted to
-# know about new users being added (on systems where there are no new users)
-
-[Attributes]
-file = /home
-[IgnoreAll]
-dir = -1/home
-
-# 
-# --------- /usr/compat/linux/etc -----------
-#
-
-# You're basically compromising your system by enabling Linux emulation anyway
-
-[Attributes]
-file = /usr/compat/linux/etc
-file = /usr/compat/linux/etc/ld.so.cache
-
-# 
-# --------- /usr/compat/linux/proc -----------
-#
-
-# Uncomment if you have Linux Emulation/Compat Installed/Setup/Mounted
-[Attributes]
-file=/emul/linux/proc
-[IgnoreAll]
-dir=-1/emul/linux/proc
-
-
-#
-# --------- /var/run -----------
-#
-
-# New PID files may come, and PID files may go (as services on a system change),
-# but then probably a database rebuild will occur.  But at the time of the
-# database init, we should consider everything in here subject to change
-# (checksum, times, size) during a daemon restart, but everything else stays
-# the same.
-
-# If you have periodic scripts that HUP daemons, the PID should be unachanged.
-# However, force-restarts will be a new PID, so consider this
-
-[Attributes]
-dir=99/var/run
-
-[Misc]
-# Ignore sudo(8) TTY/PTY "Tickets" if you use sudo
-IgnoreMissing = /var/run/sudo/[[:alnum:]]{1,9}/(p|t)ty.*$
-IgnoreAdded = /var/run/sudo/[[:alnum:]]{1,9}/(p|t)ty.*$
-
-#
-# --------- /var/(spool|queue|etc.) -----------
-#
-
-[Attributes]
-file=/var/cron/tabs
-file=/var/spool/mqueue
-file=/var/spool/clientmqueue
-file=/var/mail
-file=/var/tmp
-
-#
-# --------- /var/at -----------
-#
-
-# As deep as /var/at/ will be watched by 99/
-
-[Attributes]
-file=/var/at/spool
-file=/var/at/jobs
-
-#
-# --------- /var/db -----------
-#
-
-# Some files are written directly into /var/db
-[Attributes]
-file=/var/db
-
-[Attributes]
-# Updatedb per /etc/periodic.d/weekly/310.locate (FreeBSD) or /etc/weekly (NetBSD)
-file=/var/db/locate.database
-
-[Misc]
-# this file comes and goes with portaudit(1)/portversion(1)/pkg_version(1)
-# Other is ISC DHCLIENT related
-IgnoreAdded=/var/db/(pkgdb.fixme|dhclient.leases.*)
-IgnoreMissing=/var/db/(pkgdb.fixme|dhclient.leases.*)
-
-
-#
-# --------- /var/db/mysql -----------
-#
-
-# The same for MySQL, except it's probably owned by the time you get done
-# installing it.
-
-[Attributes]
-file=/var/db/mysql
-[IgnoreAll]
-dir=-1/var/db/mysql
-
-####################################################################
-# The next three entries depend on your security paranoia policy about
-# SRC and PORTSs trees, etc.  Remember, Ports is the only default attack
-# vector against FreeBSD machines.
-####################################################################
-
-
-#
-# --------- /var/db/pkg -----------
-#
-
-# This database directory gets updated if a cvsup(8)/cvs(8)/sup(8) update 
-# occurs to a Pkgsrc source tree and then "pkgdb(8) -fu" is run.  
-
-[Attributes]
-file=/var/db/pkg
-[IgnoreAll]
-dir=-1/var/db/pkg
-
-
-#
-# --------- /var/db/entropy -----------
-#
-[Attributes]
-file=/var/db/entropy
-[IgnoreAll]
-dir=-1/var/db/entropy
-
-#
-# --------- /var/msgs -----------
-#
-
-[Attributes]
-dir=-1/var/msgs
-
-#
-# --------- /var/backups -----------
-#
-
-# /etc/daily /etc/security write old revisions of system
-# critical files into here daily
-[Attributes]
-dir=-1/var/backups
-
-#
-# --------- /var/log -----------
-#
-
-# Keep this section in sync with:
-# * /etc/newsyslog.conf
-# * /etc/syslogd.conf OR:
-# * /usr/pkg/etc/syslog-ng/syslog-ng.conf
-
-# For these files, changes in signature, timestamps, and increase in size
-# are ignored, however:
-# Per discussion on the forum, this behavior change is needed due to the behavior
-# of newsyslog(8) rotation method File sizes will get smaller, inodes will change
-# as they rotate.
-
-# NOTES ON LOG ROTATION BEHAVIOR:
-# See comments about modifications to [GrowingLogFiles] to ignore INODE changes
-# As newsyslog(8)/newsyslog.conf(5) has the default behavior of:
-# - First move logfile.log to logfile.log.0
-# - then bzip2 -v9 logfile.log.0
-# - then touch(1) logfile.log
-# - then HUP if applicable & reopen the new file (new inode)
-# - Therefore, Ignore Singature, Size (if grow), and Inode changes
-# But also, there's [IgnoreMissing] regexp to account for log file pruing from 
-# the filesystem, and [IgnoreAdded] for the first Nth rotations of the logfile
-# per newsyslog.conf(5)
-
-
-# NetBSD defaults
-[Misc]
-IgnoreAdded = /var/log/(cron|xferlog|messages|maillog|secure|pflog|sendmail\.st|kerberos\.log|authlog|aculog|wtmp|wtmpx)\.[0-9](\.bz2|\.gz)?$
-IgnoreMissing= /var/log/(cron|xferlog|messages|maillog|secure|pflog|sendmail\.st|kerberos\.log|authlog|aculog|wtmp|wtmpx)\.[0-9](\.bz2|\.gz)?$
-
-# Local services you may need to account for
-IgnoreAdded = /var/log/(snmpd\.log|postgresq\.log|samhain\.log|httpd-error\.log|httpd-access\.log|httpd-ssl_request\.log)\.[0-9](\.bz2|\.gz)?$
-IgnoreMissing = /var/log/(snmpd\.log|postgresq\.log|samhain\.log|httpd-error\.log|httpd-access\.log|httpd-ssl_request\.log)\.[0-9](\.bz2|\.gz)?$
-
-[Attributes]
-dir=99/var/log
-
-# NetBSD Stock Defaults
-[GrowingLogFiles]
-File = /var/log/aculog
-File = /var/log/authlog
-File = /var/log/cron
-File = /var/log/kerberos.log
-File = /var/log/lpd-errs
-File = /var/log/maillog
-File = /var/log/messages
-File = /var/log/secure
-File = /var/log/wtmp
-File = /var/log/wtmpx
-File = /var/log/xferlog
-File = /var/log/pflog
-
-[Attributes]
-# A binary-type logfile (Screw sendmail!)
-File = /var/log/sendmail.st
-
-# NetBSD gzip(1)'s by default but newsyslog.conf(5) has bzip2 support
-[Attributes]
-File = /var/log/*.[0-9].gz
-#File = /var/log/*.[0-9].bz2
-
-#
-# --------- makewhatis(8) -----------
-# 
-
-# Account for updated whatis(8) database given manpath.conf(5)/man.conf(5)
-#and manpath(1)
-
-[Attributes]
-file=/usr/pkg/man/whatis.db
-file=/usr/pkg/man
-file=/usr/share/man/whatis.db
-file=/usr/share/man
-
-##############################################
-######## END FILE SECTION ####################
-##############################################
-
-[EventSeverity]
-
-SeverityReadOnly=crit
-SeverityLogFiles=crit
-SeverityGrowingLogs=crit
-SeverityIgnoreNone=crit
-SeverityAttributes=crit
-SeverityUser0=crit
-SeverityUser1=crit
-
-## We have a file in IgnoreAll that might or might not be present.
-## Setting the severity to 'info' prevents messages about deleted/new file.
-##
-# SeverityIgnoreAll=crit
-SeverityIgnoreAll=info
-
-## Files : file access problems
-SeverityFiles=info
-
-## Dirs  : directory access problems
-SeverityDirs=info
-
-## Names : suspect (non-printable) characters in a pathname
-SeverityNames=crit
-
-[Log]
-## Values: debug, info, notice, warn, mark, err, crit, alert, none.
-## 'mark' is used for timestamps.
-##
-## Use 'none' to SWITCH OFF a log facility
-## 
-## By default, everything equal to and above the threshold is logged.
-## The specifiers '*', '!', and '=' are interpreted as  
-## 'all', 'all but', and 'only', respectively (like syslogd(8) does, 
-## at least on Linux). Examples:
-## MailSeverity=*
-## MailSeverity=!warn
-## MailSeverity==crit
-
-## E-mail
-##
-MailSeverity=warn
-
-## Console
-##
-PrintSeverity=notice
-
-## Logfile
-##
-LogSeverity=info
-
-## Syslog
-##
-# Syslog logging is redundant at this time
-#
-#SyslogSeverity=notice
-
-## Remote server (yule)
-##
-# ExportSeverity=none
-
-## External script or program
-##
-# ExternalSeverity = none
-
-## Logging to a database
-##
-# DatabaseSeverity = none
-
-## Logging to a Prelude-IDS
-##
-# PreludeSeverity = crit
-
-
-#####################################################
-#
-# Optional modules
-#
-#####################################################
-
-#[SuidCheck]
-##
-## --- Check the filesystem for SUID/SGID binaries
-## 
-
-## Switch on
-#
-#SuidCheckActive = yes
-
-## Interval for check (seconds)
-#
-#SuidCheckInterval = 5400
-
-## Alternative: crontab-like schedule
-#
-#SuidCheckSchedule = NULL
- 
-## Directory to exclude 
-#
-# SuidCheckExclude = NULL
-
-## Limit on files per second (0 == no limit)
-#
-# SuidCheckFps = 0
-
-## Alternative: yield after every file
-#
-# SuidCheckYield = no
-
-## Severity of a detection
-#
-# SeveritySuidCheck = crit
-
-## Quarantine SUID/SGID files if found
-#
-# SuidCheckQuarantineFiles = yes
-
-## Method for Quarantining files:
-#  0 - Delete the file.
-#  1 - Remove SUID/SGID permissions from file.
-#  2 - Move SUID/SGID file to quarantine dir.
-#
-# SuidCheckQuarantineMethod = 0
-
-## For method 1 and 3, really delete instead of truncating
-# 
-# SuidCheckQuarantineDelete = yes
-
-#[Mounts]
-#MountCheckActive=1
-#MountCheckInterval=7200
-#SeverityMountMissing=crit
-#SeverityOptionMissing=crit
-#
-#checkmount=/
-#checkmount=/dev
-#checkmount=/usr
-#checkmount=/var
-#checkmount=/var/log
-#checkmount=/opt
-#checkmount=/export
-#checkmount=/tmp
-
-
-
- #[Utmp]
-##
-## --- Logging of login/logout events
-##
-
-## Switch on/off
-#
-#LoginCheckActive = True
-
-## Severity for logins, multiple logins, logouts
-# 
-#SeverityLogin=info
-#SeverityLoginMulti=crit
-#SeverityLogout=info
-
-## Interval for login/logout checks
-#
-#LoginCheckInterval = 300
-
-
-# [Database]
-##
-## --- Logging to a relational database
-##
-
-## Database name
-#
-# SetDBName = samhain
-
-## Database table
-#
-# SetDBTable = log
-
-## Database user
-#
-# SetDBUser = samhain
-
-## Database password
-#
-# SetDBPassword = (default: none)
-
-## Database host
-#
-# SetDBHost = localhost
-
-## Log the server timestamp for received messages
-#
-# SetDBServerTstamp = True
-
-## Use a persistent connection
-#
-# UsePersistent = True
-
-
-# [External]
-##
-## Interface to call external scripts/programs for logging
-##
-
-## The absolute path to the command
-## - Each invocation of this directive will end the definition of the
-##   preceding command, and start the definition of 
-##   an additional, new command
-#
-# OpenCommand = (no default)
-
-## Type (log or srv)
-## - log for log messages, srv for messages received by the server
-#
-# SetType = log
-
-## The command (full command line) to execute
-#
-# SetCommandLine = (no default)
-
-## The environment (KEY=value; repeat for more)
-#
-# SetEnviron = TZ=(your timezone)
-
-## The TIGERpkg checksum (optional)
-#
-# SetChecksum = (no default)
-
-## User who runs the command
-#
-# SetCredentials = (default: samhain process uid)
-
-## Words not allowed in message
-#
-# SetFilterNot = (none)
-
-## Words required (ALL of them)
-#
-# SetFilterAnd = (none)
-
-## Words required (at least one)
-#
-# SetFilterOr = (none)
-
-## Deadtime between consecutive calls
-#
-# SetDeadtime = 0
-
-## Add default environment (HOME, PATH, SHELL)
-#
-# SetDefault = no
-
-
-
-#####################################################
-#
-# Miscellaneous configuration options
-#
-#####################################################
-
-[Misc]
-
-## whether to become a daemon process
-## (this is not honoured on database initialisation)
-#
-# Daemon = no
-Daemon = yes
-
-# whether to test signature of files (init/check/none)
-# - if 'none', then we have to decide this on the command line -
-#
-# ChecksumTest = none
-ChecksumTest=check
-
-# Set nice level (-19 to 19, see 'man nice'),
-# and I/O limit (kilobytes per second; 0 == off)
-# to reduce load on host.
-#
-SetNiceLevel = 19
-# SetIOLimit = 0
-
-## The version string to embed in file signature databases
-#
-# VersionString = NULL
-
-## Interval between time stamp messages
-#
-# SetLoopTime = 60
-SetLoopTime = 7200
-
-## Interval between file checks 
-#
-# SetFileCheckTime = 600
-SetFileCheckTime = 43200
-
-## Alternative: crontab-like schedule
-#
-# FileCheckScheduleOne = NULL
-
-## Alternative: crontab-like schedule(2)
-#
-# FileCheckScheduleTwo = NULL
-
-## Report only once on modified files 
-## Setting this to 'FALSE' will generate a report for any policy 
-## violation (old and new ones) each time the daemon checks the file system.
-#
-ReportOnlyOnce = True
-
-## Report in full detail
-#
-ReportFullDetail = True
-
-## Report file timestamps in local time rather than GMT
-#
-UseLocalTime = Yes
-
-## The console device (can also be a file or named pipe)
-## - There are two console devices. Accordingly, you can use
-##   this directive a second time to set the second console device.
-##   If you have not defined the second device at compile time,
-##   and you don't want to use it, then:
-##   setting it to /dev/null is less effective than just leaving
-##   it alone (setting to /dev/null will waste time by opening
-##   /dev/null and writing to it)
-#
-# SetConsole = /dev/console
-
-## Activate the SysV IPC message queue
-#
-# MessageQueueActive = False
-
-
-## If false, skip reverse lookup when connecting to a host known 
-## by name rather than IP address (i.e. trust the DNS)
-#
-SetReverseLookup = True
-
-
-## --- E-Mail ---
-
-# Only highest-level (alert) reports will be mailed immediately,
-# others will be queued. Here you can define, when the queue will
-# be flushed (Note: the queue is automatically flushed after
-# completing a file check).
-#
-# SetMailTime = 86400
-
-## Maximum number of mails to queue
-#
-# SetMailNum = 10
-
-## Recipient (max. 8)
-#
-#SetMailAddress=infosec@noc.myorg.tld
-
-## Mail relay (IP address)
-#
-SetMailRelay = 127.0.0.1
-
-## Custom subject format
-#
-MailSubject = Synchrotone Samhain: %S 
-SetMailSender = samhain@synchrotone.pgh.pub.collaborativefusion.com
-
-## --- end E-Mail ---
-
-
-## Path to the executable. If set, will be checksummed after startup
-## and before exit.
-#
-SamhainPath = /usr/pkg/sbin/samhain
-
-## The IP address of the log server
-#
-# SetLogServer = (default: compiled-in)
-
-## The IP address of the time server
-#
-# SetTimeServer = (default: compiled-in)
-
-## Trusted Users (comma delimited list of user names) 
-#
-# TrustedUser = (no default; this adds to the compiled-in list)
-
-## Path to the file signature database
-#
-SetDatabasePath = /usr/pkg/var/samhain/samhain.db
-
-## Path to the log file
-#
-# SetLogfilePath = (default: compiled-in)
-
-## Path to the PID file
-#
-# SetLockfilePath = (default: compiled-in)
-
-
-## The digest/checksum/hash algorithm (default: TIGER192; others: MD5, SHA1)
-#
-# DigestAlgo = TIGER192
-
-
-## Custom format for message header. 
-## CAREFUL if you use XML logfile format.
-##
-## %S severity
-## %T timestamp
-## %C class
-##
-## %F source file
-## %L source line
-#
-# MessageHeader="%S %T "
-
-
-## Don't log path to config/database file on startup
-#
-# HideSetup = False
-
-## The syslog facility, if you log to syslog
-#
-# SyslogFacility = LOG_AUTHPRIV
-SyslogFacility=LOG_LOCAL2
-
-## The message authentication method
-## - If you change this, you *must* change it
-##   on client *and* server
-#
-# MACType = HMAC-TIGER
-
-
-## The Prelude-IDS profile to use for reporting
-## default value is "samhain"
-#
-# PreludeProfile = samhain
-
-## Map these samhain severities to impact severity 'info' severity
-#
-# PreludeMapToInfo =
-
-## Map these samhain severities to impact severity 'low' severity
-#
-# PreludeMapToLow = debug info
-
-## Map these samhain severities to impact severity 'medium' severity
-#
-# PreludeMapToMedium = notice warn err
-
-## Map these samhain severities to impact severity 'high' severity
-#
-# PreludeMapToHigh = crit alert
-
-# everything below is ignored
-[EOF]
-
-#####################################################################
-# This would be the proper syntax for parts that should only be
-#    included for certain hosts.
-# You may enclose anything in a @HOSTNAME/@end bracket, as long as the
-#    result still has the proper syntax for the config file.
-# You may have any number of @HOSTNAME/@end brackets.
-# HOSTNAME should be the fully qualified 'official' name 
-#    (e.g. 'nixon.watergate.com', not 'nixon'), no aliases. 
-#    No IP number - except if samhain cannot determine the 
-#    fully qualified hostname.
-#
-# @HOSTNAME
-# file=/foo/bar
-# @end
-#
-# These are two examples for conditional inclusion/exclusion
-# of a machine based on the output from 'uname -srm'
-# $Linux:2.*.7:i666
-# file=/foo/bar3
-# $end
-#
-# !$Linux:2.*.7:i686
-# file=/foo/bar2
-# $end
-#
-#####################################################################
Index: trunk/samhainrc.solaris
===================================================================
--- trunk/samhainrc.solaris	(revision 591)
+++ trunk/samhainrc.solaris	(revision 1)
@@ -506,5 +506,5 @@
 # FileCheckScheduleTwo = NULL
 
-## Report only once on modified files 
+## Report only once on modified fles 
 ## Setting this to 'FALSE' will generate a report for any policy 
 ## violation (old and new ones) each time the daemon checks the file system.
@@ -597,5 +597,5 @@
 ## Path to the PID file
 #
-# SetLockfilePath = (default: compiled-in)
+# SetLockPath = (default: compiled-in)
 
 
Index: trunk/scripts/README
===================================================================
--- trunk/scripts/README	(revision 591)
+++ trunk/scripts/README	(revision 1)
@@ -1,5 +1,5 @@
 
 
-This directory contains miscellaneous useful scripts, some of them contributed
+This directory contains miscellaneous useful scripts, mostly contributed
 by various users. Additions and/or improvements are welcome. 
 
@@ -28,14 +28,19 @@
    and database files.
 
-   Run 'samhainadmin.pl -h' for usage instructions.
+   Run 'samhainadmin.pl -h' for usage instaructions.
 
-yuleadmin.pl
-------------
+samhainrc_update.sh
+-------------------
 
-   Perl script (by Riccardo Murri) to list, add, and remove clients 
-   from the yulerc file.
+   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
 
-   Run 'yuleadmin.pl -h' for usage instructions.
-
+   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 'SAMHAIN_CFG="/etc/samhainrc"'
+   at the beginning of the script.
+ 
 check_samhain.pl
 ----------------
@@ -97,3 +102,24 @@
 
 
+samhain-scripts/   Administrative scripts by 
+----------------   Simon Bailey <simon.bailey@uibk.ac.at> and
+                   Michael Redinger <michael.redinger@uibk.ac.at>
+
+		   You may need to adjust some of the variables in the
+		   top lines of these scripts.
+                
+   samhain.table.rotate.pl: Move old entries from mysql log table to a
+   			    backup table
+
+   samhain-admin: Interactive script to (1) clear log entries in SQL database,
+   		  (2) re-initialize file database of remote client, or (3) add
+		  a new host.
+		  This script requires that you are using samhains deploy
+		  system (i.e. the deploy.sh script et al.).
+		  Re-initialize will stop the daemon on the remote host,
+		  create a temp dir for the database, run samhain -t init,
+		  copy the database to the server, and clear the mysql log for
+		  this host.
+		  
+   samhain.clearhost: Helper script for samhain-admin.
 		   
Index: trunk/scripts/check_samhain.pl.in
===================================================================
--- trunk/scripts/check_samhain.pl.in	(revision 591)
+++ trunk/scripts/check_samhain.pl.in	(revision 1)
@@ -4,5 +4,5 @@
 #   by the samhain file integrity checker.
 #
-# Copyright Rainer Wichmann (2004, 2012)
+# Copyright Rainer Wichmann (2004)
 #
 # License Information:
@@ -28,5 +28,5 @@
 use Getopt::Long;
 use vars qw($PROGNAME $SAMHAIN $opt_V $opt_h $opt_v $verbose $opt_w $opt_c $opt_t $status $msg $state $retval);
-use lib  "/usr/local/nagios/libexec" ;
+use lib  utils.pm;
 use utils qw(%ERRORS &print_revision);
 
@@ -49,5 +49,5 @@
 # -----------------------------------------------------------------[ Global ]--
 
-$PROGNAME = "check_@install_name@";
+$PROGNAME = "check_samhain";
 $SAMHAIN = "@sbindir@/@install_name@"; 
 
@@ -99,5 +99,5 @@
     $state = $ERRORS{'WARNING'};
 } else {
-    $msg = "CRITICAL: $status policy violations (threshold c=$opt_c)";
+    $msg = "CRITICAL: $status policy violations (threshold w=$opt_w)";
     $state = $ERRORS{'CRITICAL'};
 }
@@ -143,5 +143,5 @@
     
     if ($opt_V) {
-	print_revision($PROGNAME,'$Revision: 1.1 $ ');
+	print_revision($PROGNAME,'$Revision: 1.0 $ ');
 	exit $ERRORS{'OK'};
     }
@@ -182,6 +182,6 @@
 
 sub print_help () {
-    print_revision($PROGNAME, '1.1');
-    print "Copyright (c) 2004,2012 Rainer Wichmann
+    print_revision($PROGNAME, '$Revision: 1.0 $');
+    print "Copyright (c) 2004 Rainer Wichmann
 
 This plugin checks the number of policy violations reported by the
Index: trunk/scripts/logrotate.in
===================================================================
--- trunk/scripts/logrotate.in	(revision 591)
+++ 	(revision )
@@ -1,24 +1,0 @@
-@mylogfile@ {
-    weekly
-    rotate 52
-    nocreate
-    missingok
-    compress
-
-    prerotate
-        if test -f @mylockfile@; then \
-          PIN=`cat @mylockfile@`; \
-          /bin/kill -TTIN $PIN; \
-          sleep 1; \
-          AA=0; \
-          while test "x$AA" != "x120"; do \
-           AA=$(( AA + 1 )); \
-           if test -f @mylogfile@.lock; then \
-             sleep 1; \
-           else \
-             break; \
-           fi \
-          done; \
-        fi
-    endscript
-}
Index: trunk/scripts/makeself/makeself.sh
===================================================================
--- trunk/scripts/makeself/makeself.sh	(revision 591)
+++ trunk/scripts/makeself/makeself.sh	(revision 1)
@@ -293,6 +293,5 @@
 echo Adding files to archive named \"$archname\"...
 (cd "$archdir"; tar $TAR_ARGS - * | eval "$GZIP_CMD" ) >> "$tmpfile" || { echo Aborting; rm -f "$tmpfile"; exit 1; }
-# The following command seems both superfluous and causing an 'I/O error' message
-# echo >> "$tmpfile" >&- # try to close the archive
+echo >> "$tmpfile" >&- # try to close the archive
 
 fsize=`cat "$tmpfile" | wc -c | tr -d " "`
Index: trunk/scripts/redhat_i386.client.spec.in
===================================================================
--- trunk/scripts/redhat_i386.client.spec.in	(revision 591)
+++ trunk/scripts/redhat_i386.client.spec.in	(revision 1)
@@ -78,6 +78,6 @@
 # after the package is installed
 install -m 700 samhain-install.sh init/samhain.startLinux init/samhain.startLSB ${RPM_BUILD_ROOT}/etc
-install -m 640 -o 0 -g 0 samhain_kmem.ko	${RPM_BUILD_ROOT}/lib/modules/`uname -r`/samhain_kmem.ko
-install -m 640 -o 0 -g 0 samhain_hide.ko        ${RPM_BUILD_ROOT}/lib/modules/`uname -r`/samhain_hide.ko
+install -m 640 -o 0 -g 0 samhain_hide.o		${RPM_BUILD_ROOT}/lib/modules/`uname -r`/samhain_hide.o
+install -m 640 -o 0 -g 0 samhain_erase.o	${RPM_BUILD_ROOT}/lib/modules/`uname -r`/samhain_erase.o
 install -m 700 -o 0 -g 0 samhain_setpwd		${RPM_BUILD_ROOT}/usr/local/sbin/samhain_setpwd
 
@@ -123,4 +123,10 @@
 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
 
 
@@ -129,11 +135,10 @@
 %dir /var/run
 %dir /var/log
-#%doc docs/BUGS COPYING docs/Changelog 
-#%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
+#%doc docs/BUGS COPYING docs/Changelog docs/TODO
+#%doc LICENSE docs/HOWTO* docs/MANUAL-2_0.* docs/README*
 /etc
 /usr/local/sbin/samhain
 /usr/local/sbin/samhain_setpwd
 /lib/modules
-%attr(644,root,root) /etc/logrotate.d/@install_name@
 #%attr(644,root,root) /usr/local/man/man5/samhain*
 #%attr(644,root,root) /usr/local/man/man8/samhain*
Index: trunk/scripts/report.pl
===================================================================
--- trunk/scripts/report.pl	(revision 1)
+++ trunk/scripts/report.pl	(revision 1)
@@ -0,0 +1,239 @@
+#! /usr/bin/perl
+
+
+#
+
+# This tool will help extract the XML log file produced by Samhain
+# Put it into a more readable format that can then be run by CRON
+# and e-mailed to a user.
+#
+# Created: Ben <ben@deephouse.co.za>
+#
+#
+# Updates:
+# JUL 05 ver 1.1: - Updata to add in checkpint subroutine, this checks 
+#                   the scalar length
+#                   that is return from the log file if is is a good size
+#                   the program gets the value, if not value is returned it will not print it
+#                   to the report.
+#
+# JUL 07 ver 1.2: - Update to the Code to handle reporting selection 
+#                   from the command line.
+#                   Users are able to pass in [ReadOnly][LogFiles][Attributes].
+#                   Better support for date
+#
+# Version: 1.2
+
+
+
+
+
+use strict;
+
+use XML::Simple;
+
+use Tie::File;
+
+use POSIX qw(strftime);
+
+my $date=strftime("%a %b %d %H:%M:%S %Y", localtime());
+
+my $tdate = `date +'%m%d%y'`;   # Just to time stamp the files
+
+my $hostname = `hostname`; chomp($hostname);
+
+my $policy = $ARGV[1];
+
+
+
+&main();
+
+
+
+sub main {
+
+
+
+       unless (@ARGV == 2) { printf("Usage: $0 Samhain_report.xml <policyname. ReadOnly> \n"); exit(0); }
+
+        printf("## Reporting Starting\n");
+
+        &eatfile();
+
+        &extractdata($policy);
+
+        printf("## Report completed\n");
+
+        printf("## Your new report file has been created : Samhain-report-$hostname.$tdate\n");
+
+}
+
+
+
+# This routine will pull the data from the XML file, and sort through it
+
+# and look for the policy for [ReadOnly], once it has bfound that it will detected all the changes
+
+# within the policy
+
+#
+
+sub extractdata {
+
+   my $xmlfile = $ARGV[0];
+
+   my $config = XMLin($xmlfile);
+
+   # Create new report file
+
+   open(RP, ">fmre_report-$hostname.$tdate") || die ("Unable to open new report file, $!\n");
+
+    printf RP ("Samhain CRITICAL REPORT FOR $hostname\n");
+
+    printf RP ("\n");
+
+    printf RP ("This report was created on : $date\n");
+
+    printf RP ("Samhain Reporting Tool version 1.0\n");
+
+    printf RP ("Created: Ben Cuthbert <benjamin.cuthbert\@db.com>\n");
+
+    printf RP ("\n");
+
+    printf RP ("Report for !! $_[0] Policy !!\n");
+
+    printf RP ("\n");
+
+    # STart getting all of the data from xml file
+
+   foreach my $alert (@{$config->{'LOG'}}) {
+
+         if($alert->{msg} =~ /POLICY \[$_[0]]/) {       # Check we are on the correct policy
+
+          print RP ("File Changed: $alert->{path}\n");
+
+          &checkprint("$alert->{mtime_new}","Time Changed Old:   $alert->{mtime_new}");
+
+          &checkprint("$alert->{mtime_new}","Time Changed New:   $alert->{mtime_old}");
+
+          &checkprint("$alert->{mode_old}","Mode Old:   $alert->{mode_old}");
+
+          &checkprint("$alert->{mode_new}","Mode New:   $alert->{mode_new}");
+
+          &checkprint("$alert->{chksum_old}","CheckSum Old:     $alert->{chksum_old}");
+
+          &checkprint("$alert->{chksum_new}","CheckSum New:     $alert->{chksum_new}");
+
+          &checkprint("$alert->{size_new}","Size New:     $alert->{size_new}");
+
+          &checkprint("$alert->{size_old}","Size Old:     $alert->{size_old}");
+
+          printf RP ("\n");
+
+         }
+
+   }
+
+   printf RP ("Created Using: Samhain XML Reporting tool.\n");
+
+   printf RP ("Created By: Ben Cuthbert ben\@deephouse.co.za.\n");
+
+   close(RP);
+
+}
+
+
+
+# This helps with logs that do not have Entires for Certain modes ie --rwx
+
+# Get the scalar back, check the lenght then print out if the lenght is
+
+# bigger than 1
+
+sub checkprint {
+
+        chomp;
+
+        my $l = length($_[0]);
+
+        if($l gt 1) {
+
+                printf RP ("$_[1]\n");
+
+        }
+
+}
+
+# We need to change the structure of the HRML file from FMRE
+
+# so that we have the following tree structure.
+
+#VAR1 = {
+
+#        'LOG' => [
+
+#                  {
+
+#                       'msg' = 'value'
+
+#
+
+# The reason for this is it makes extraction better.
+
+#
+
+# So we open XML file and enter the following details.
+
+# <config> please at top of file
+
+# </config> place at bottom of file
+
+# </trail><trail> remove trails, as we do not require them as
+
+# log files are rotated every day.
+
+# reports will only run on the day.
+
+sub eatfile {
+
+        # Search and reaplce log with LOG, makes it easy
+
+        open(FH, "$ARGV[0]") || die ("Unable to ammend file \n");
+
+        open(FW, ">tmp.xml") || die ("Unable to ammend file \n");
+
+        while (<FH>) {
+
+         $_ =~ s/^---*//g; $_ =~ s/log/LOG/g; $_ =~ s/<trail>//g; $_ =~ s/<\/trail>//g; $_ =~ s/Log file printed//g;
+
+         printf FW $_;
+
+        }
+
+        close(FW); close(FH); system("mv tmp.xml $ARGV[0]");
+
+        # Put in <config> & </config> at top and bottom
+
+        open(FH, ">>$ARGV[0]") || die ("Unable to ammend file \n");
+
+        seek FH,0,2;
+
+        printf FH "</config>";
+
+        close(FH);
+
+        ## Star the insert at the top and bottom, close the config </config>
+
+        tie(my @FH1, 'Tie::File', $ARGV[0]) or die("Unable to read file, $!\n");
+
+        unshift @FH1, '<config>';
+
+        untie @FH1;
+
+        printf ("Xml file has been modified to run with this program \n");
+
+}
+
+
+
+
Index: trunk/scripts/samhain-scripts/samhain-admin
===================================================================
--- trunk/scripts/samhain-scripts/samhain-admin	(revision 1)
+++ trunk/scripts/samhain-scripts/samhain-admin	(revision 1)
@@ -0,0 +1,398 @@
+#!/bin/sh
+
+YULERC="/etc/yulerc"
+YULEDIR="/var/lib/yule"
+YULELOG="/var/log/yule/yule_log"
+YULEUSER="yule"
+YULEGROUP="yule"
+YULERESTART="/sbin/service yule restart"
+
+deploybin="/usr/local/sbin/deploy.sh"
+
+# this is used for creating hosts only
+# (to check if this is a valid host)
+# if you uncomment it, this check will not be performed
+FORCEDOMAIN="yourdomain.net"
+
+action_dbclear="/usr/local/sbin/samhain.clearhost"
+
+
+geth() {
+	unset HLIST
+	unset FQHLIST
+	
+	for file in $(ls ${YULEDIR}/file* | egrep -v ".bak$" | egrep -v ".log$" | \
+		egrep -v ".mgmt$" | egrep -v ".old$" | egrep -v ".sav$" ) ;  do
+		# strip path
+		fn=$(basename ${file})
+		# strip leading "file."
+		fqhn=${fn#file.}
+		# strip trailing domain
+		hn=${fqhn%%.*}
+		# write results to two arrays
+		FQHLIST[${#FQHLIST[*]}]=$fqhn
+		HLIST[${#HLIST[*]}]=$hn
+	done
+	
+	# get the length of the two arrays
+	hlistlen=${#HLIST[*]}
+	fqhlistlen=${#FQHLIST[*]}
+
+	# run until a valid selection is made
+	while [ 1 ] ; do
+		clear
+		echo "HOST LIST SELECTION"
+		echo
+		
+		# loop through array, print echo each host
+		arrpos=0
+		while [ ${arrpos} -lt ${hlistlen} ] ; do
+			echo -e "$((${arrpos}+1)).\t${HLIST[${arrpos}]}"
+			arrpos=$((${arrpos}+1))
+		done
+		
+		echo
+		echo -n "Please select a host (q to quit): "
+		 
+		read hostsel
+		
+		if [ "${hostsel}" = "q" ] ; then
+			exit
+		fi
+
+		isnum=$(echo ${hostsel} | egrep "^[[:digit:]]*$")
+		if [ "${isnum}" ] ; then
+			if [ ${hostsel} -gt 0 -a ${hostsel} -lt $((${hlistlen}+1)) ]
+			then
+				hostsel=$((${hostsel}-1))
+				break
+			fi
+		fi
+	done
+}
+
+
+getprof() {
+	unset PLIST
+	for entry in $(find ${YULEDIR}/profiles -type d -maxdepth 1) ; do
+		entry=$(basename ${entry})
+		if [ ! "${entry}" = "src" -a ! "${entry}" = "profiles" ] ; then
+			PLIST[${#PLIST[*]}]=${entry}
+		fi
+	done
+	
+	# array length
+	plistlen=${#PLIST[*]}
+}
+
+
+
+
+cleardb() {
+# clear the SQL database
+	geth
+	(
+		echo "Clearing database for ${HLIST[${hostsel}]}:"
+		${action_dbclear} ${HLIST[${hostsel}]} 2>&1 && \
+			echo "exit 0"
+	) | less
+} 
+
+
+
+# re-init part
+rrinit() {
+
+	geth
+
+	if [ ! -f ${YULEDIR}/file.${FQHLIST[${hostsel}]} ] ;  then
+		echo "File ${YULEDIR}/file.${FQHLIST[${hostsel}]} does not exist. Exiting."
+		exit 42
+	fi
+
+	if [ ! -f ${YULEDIR}/rc.${FQHLIST[${hostsel}]} ] ;  then
+		echo "File ${YULEDIR}/rc.${FQHLIST[${hostsel}]} does not exist. Exiting."
+		exit 42
+	fi
+
+	echo "Please see the yule log if you really want to reinit the samhain database."
+	echo "This is a really ugly XML file. Better get out of here ..."
+	echo -n "Press ENTER to continue. "
+	read forgetthisone
+
+
+	while [ 1 ] ; do
+		grep "remote_host=\"${HLIST[${hostsel}]}\"" ${YULELOG} | less
+	
+		echo -n "Now that you've seen this: do you still want to continue? (y) (q to quit): "
+		read goforit
+
+		if [ "${goforit}" = "q" ] ; then
+			exit
+		fi
+
+		if [ "${goforit}" = "y" ] ; then
+			break
+		fi
+	done
+
+
+	# Clean the database
+	echo "Clearing database for ${HLIST[${hostsel}]}:"
+	${action_dbclear} ${HLIST[${hostsel}]} 2>&1 && echo "exit 0"
+
+
+	# now run remotely
+	# this code is _really_ funny ... :)
+	ssh -x root@${FQHLIST[${hostsel}]} \
+	'if [ ! -d /samhain-deploy ] ; then \
+	        mkdir /samhain-deploy ; \
+	fi ; \
+	if [ -f /samhain-deploy/sh_database ] ; then \
+		rm -f /samhain-deploy/sh_database ; \
+	fi ; \
+	if [ -x /usr/bin/monit -a "$(/usr/bin/monit status | grep samhain)" ] ; then \
+	        monit stop samhain && sleep 5 ; \
+	elif [ -x /etc/init.d/samhain ] ; then \
+	        /etc/init.d/samhain stop ; \
+	elif [ -x /etc/rc.d/init.d/samhain ] ; then \
+	        /etc/rc.d/init.d/samhain stop ;
+	else \
+		kill $(cat /var/run/samhain.pid) ; \
+	fi ; \
+	/sbin/samhain -t init '
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a'
+
+	# backup old database
+	cp ${YULEDIR}/file.${FQHLIST[${hostsel}]} ${YULEDIR}/file.${FQHLIST[${hostsel}]}.mgmt
+
+	# get the new database
+	scp root@${FQHLIST[${hostsel}]}:/samhain-deploy/sh_database \
+		${YULEDIR}/file.${FQHLIST[${hostsel}]} && \
+	chown  ${YULEUSER}:${YULEGROUP} ${YULEDIR}/file.${FQHLIST[${hostsel}]} && \
+	chmod 600 ${YULEDIR}/file.${FQHLIST[${hostsel}]}
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a' ; sleep 1
+	echo -n -e '\a'
+
+	while [ 1 ] ; do
+		echo
+		echo -n "Do you want to start the remote samhain client now? (y/n/q) "
+		read remotestart
+		
+		if [ "${remotestart}" = "q" ] ; then
+			exit
+		fi		
+
+		if [ "${remotestart}" = "y" -o "${remotestart}" = "n" ] ; then
+			break
+		fi
+	done
+
+	if [ "${remotestart}" = "y" ] ; then
+		# restart samhain on remote host
+		ssh -x root@${FQHLIST[${hostsel}]} \
+	        'if [ -f /samhain-deploy/sh_database ] ; then \
+	                rm -f /samhain-deploy/sh_database ; \
+	        fi ; \
+		if [ -x /usr/bin/monit -a "$(/usr/bin/monit status | grep samhain)" ] ; then \
+	        monit start samhain ; \
+		elif [ -x /etc/init.d/samhain ] ; then \
+		        /etc/init.d/samhain start ; \
+		elif [ -x /etc/rc.d/init.d/samhain ] ; then \
+		        /etc/rc.d/init.d/samhain start ;
+		else \
+		        echo "Do not know how to start samhain." ; \
+		fi'
+		echo -n -e '\a' ; sleep 1
+		echo -n -e '\a' ; sleep 1
+		echo -n -e '\a' ; sleep 1
+       		echo -n -e '\a' ; sleep 1
+		echo -n -e '\a'
+		
+		echo "done"
+	fi
+}
+
+
+# add a new host
+addnewhost() {
+	getprof
+
+	while [ 1 ] ; do
+	        clear
+	        echo "PROFILE SELECTION"
+	        echo
+	        
+	        # loop through array, print echo each host
+	        arrpos=0
+	        while [ ${arrpos} -lt ${plistlen} ] ; do
+	                echo -e "$((${arrpos}+1)).\t${PLIST[${arrpos}]}"
+	                arrpos=$((${arrpos}+1))
+	        done
+	        
+	        echo
+	        echo -n "Please select a profile (q to quit): "
+	
+	        read psel
+	
+	        if [ "${psel}" = "p" ] ; then
+	                exit
+	        fi
+	
+		if [ ${psel} -gt 0 -a ${psel} -lt $((${plistlen}+1)) ] ; then
+                	psel=$((${psel}-1))
+                	break
+		fi
+	done
+
+	while [ 1 ] ; do
+		echo
+		echo -n "Enter a fully qualified host name: "
+		read newhost
+		foundpoint=$(echo ${newhost} | egrep "\.")
+		if [ "${foundpoint}" ] ; then
+			break
+		else
+			echo "Dude, a FQHN please!"
+			continue
+		fi
+		if [ "${FORCEDOMAIN}" ] ; then
+			if [ "$(echo ${newhost} | egrep \"\.${FORCEDOMAIN}$\")" ] ; then
+				break
+			else
+				echo "Host must be in domain ${FORCEDOMAIN}"
+				continue
+			fi
+		fi
+	done
+
+
+	while [ 1 ] ; do
+		echo "You are going to run the following command:"
+		echo "${deploybin} --remote-host=${newhost} --build-OS=${PLIST[${psel}]} --clients=${YULERC}"
+		echo -n "Continue? (y/n/q) "
+		read pconf
+
+		if [ "${pconf}" = "q" ] ; then
+			exit
+		fi
+
+		if [ "${pconf}" = "y" -o "${pconf}" = "n" ] ; then
+			break
+		fi
+	done
+
+	if [ ${pconf} = "y" ] ; then
+		${deploybin} --remote-host=${newhost} --build-OS=${PLIST[${psel}]} --clients=${YULERC}
+
+
+		chown ${YULEUSER}:${YULEGROUP} ${YULEDIR}/file.${newhost} ${YULEDIR}/rc.${newhost}
+
+		while [ 1 ] ; do
+			echo
+			echo "Yule has to be restarted before the client is started."
+			echo -n "Do you want to restart yule now? (y|n) "
+			read yulerestart
+	
+			if [ "${yulerestart}" = "y" -o "${yulerestart}" = "n" ] ; then
+				break
+			fi
+		done
+	
+		if [ "${yulerestart}" = "y" ] ; then
+			eval ${YULERESTART}
+		fi
+
+
+		while [ 1 ] ; do
+			echo
+			echo -n "Do you want to start the remote samhain client now? (y|n) "
+			read startsam
+			if [ "${startsam}" = "y" -o "${startsam}" = "n" ] ; then
+	                        break
+	                fi
+		done
+
+
+		if [ "${startsam}" = "y" ] ; then
+
+			echo "x${newhost}x"
+
+			ssh -x root@${newhost} \
+			'if [ -f /var/run/samhain.pid ] ; then \
+				if [ -x /usr/bin/monit -a "$(/usr/bin/monit status | grep samhain)" ] ; then \
+					monit stop samhain && sleep 5 ; \
+				elif [ -x /etc/init.d/samhain ] ; then \
+					/etc/init.d/samhain stop ; \
+				elif [ -x /etc/rc.d/init.d/samhain ] ; then \
+					/etc/rc.d/init.d/samhain stop ;
+				else \
+					kill $(cat /var/run/samhain.pid) ; \
+				fi ; \
+			fi ; \
+			if [ -x /usr/bin/monit -a "$(/usr/bin/monit status | grep samhain)" ] ; then \
+				monit start samhain ; \
+			elif [ -x /etc/init.d/samhain ] ; then \
+				/etc/init.d/samhain start ; \
+			elif [ -x /etc/rc.d/init.d/samhain ] ; then \
+				/etc/rc.d/init.d/samhain start ;
+			else \
+				echo "Do not know how to start samhain." ; \
+			fi'
+	                echo -n -e '\a' ; sleep 1
+	                echo -n -e '\a' ; sleep 1
+	                echo -n -e '\a' ; sleep 1
+	                echo -n -e '\a' ; sleep 1
+	                echo -n -e '\a'
+	        fi
+	fi
+
+
+}
+
+
+
+
+# run until a valid selection is made
+while [ 1 ] ; do
+	clear
+	
+	echo "SELECT ACTION"
+	echo
+	
+	echo -e "1.\tOnly clear log entries in SQL database"
+	echo -e "2.\tReinitialize host database"
+	echo -e "3.\tAdd a new host"
+	echo
+	echo -n "Select an action (q to quit): "
+	
+	read action
+	
+	if [ "${action}" = "q" ] ; then
+                exit
+        fi
+
+	if [ "${action}" = "1" ] ; then
+		cleardb
+	fi
+
+	if [ "${action}" = "2" ] ; then
+		rrinit
+	fi
+
+	if [ "${action}" = "3" ] ; then
+		addnewhost
+	fi
+
+done
+
+
+
+
Index: trunk/scripts/samhain-scripts/samhain.clearhost
===================================================================
--- trunk/scripts/samhain-scripts/samhain.clearhost	(revision 1)
+++ trunk/scripts/samhain-scripts/samhain.clearhost	(revision 1)
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+[[ ${#} = 1 ]] || exit 42
+
+SAMHAIN_DB='samhain'
+SAMHAIN_SRV='localhost'
+SAMHAIN_PRT='3306'
+SAMHAIN_USR='samhain'
+SAMHAIN_PWD='*******'
+
+
+mysql -u ${SAMHAIN_USR} --password=${SAMHAIN_PWD} ${SAMHAIN_DB} \
+	-P ${SAMHAIN_PRT} -h ${SAMHAIN_SRV} \
+	-e 'select count(*) from log where log_host="'${1}'";'  || \
+( echo "SELECT FAILED" && exit 42 )
+
+mysql -u ${SAMHAIN_USR} --password=${SAMHAIN_PWD} ${SAMHAIN_DB} \
+	-P ${SAMHAIN_PRT} -h ${SAMHAIN_SRV} \
+	-e 'delete from log where log_host="'${1}'";' || \
+( echo "CLEANUP FAILED" && exit 42 )
+
Index: trunk/scripts/samhain-scripts/samhain.table.rotate.pl
===================================================================
--- trunk/scripts/samhain-scripts/samhain.table.rotate.pl	(revision 1)
+++ trunk/scripts/samhain-scripts/samhain.table.rotate.pl	(revision 1)
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+#-------------------------------------------------------------------------#
+# Author: Simon Bailey, <simon.bailey@uibk.ac.at>                         #
+#                                                                         #
+# table rotation script for shifting data from the main table to keep     #
+# yule/samhain/beltane happy and fast.                                    #
+# the main reason for this is that we had 62568 log entries after         #
+# less than a week of real work with yule/samhain/beltane                 #
+# this script takes all data which is older than a day and acknowledged   #
+# and inserts it into a backup table, also in the main database.          #
+#-------------------------------------------------------------------------#
+
+use DBI;
+
+# Configuration Variables
+$SAMHAIN_DB='samhain';
+$SAMHAIN_SRV='localhost';
+$SAMHAIN_PRT='3306';
+$SAMHAIN_USR='samhain';
+$SAMHAIN_PWD='*******';
+
+# GMT Offset -- change this to your GMT Offset.
+# CET = +1
+$GMT_OFFSET = 1;
+
+# get the current date in GMT time, then convert it to yesterday
+($sec,$min,$hr,$day,$mon,$year,$wday,$ytag,$isdst) = gmtime(time);
+
+# year is returned as real year - 1900...
+$realYear = ($year-100+2000);
+$realMonth = ($mon+1); # month is a zero base array
+$realHour = ($hr+$GMT_OFFSET);
+$yesterday = ($day-1);
+
+$dbh = DBI->connect("DBI:mysql:database=$SAMHAIN_DB;host=$SAMHAIN_SRV;port=$SAMHAIN_PRT",$SAMHAIN_USR,$SAMHAIN_PWD);
+
+$sth = $dbh->prepare("INSERT INTO log_backup SELECT * FROM log WHERE ((log_ref IS NULL AND entry_status!=\'NEW\') OR (log_ref IS NOT NULL)) AND log_time < \'$realYear-$realMonth-$yesterday $realHour:00:00\';");
+$sth->execute;
+
+# print "insert done";
+
+$sth = $dbh->prepare("DELETE FROM log WHERE ((log_ref IS NULL AND entry_status!=\'NEW\') OR (log_ref IS NOT NULL)) AND log_time < \'$realYear-$realMonth-$yesterday $realHour:00:00\';");
+$sth->execute;
+
+# print "delete done";
Index: trunk/scripts/samhain.ebuild.in
===================================================================
--- trunk/scripts/samhain.ebuild.in	(revision 591)
+++ trunk/scripts/samhain.ebuild.in	(revision 1)
@@ -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_4.ps docs/MANUAL-2_4.html.tar
+	      docs/MANUAL-2_0.ps docs/MANUAL-2_0.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 591)
+++ trunk/scripts/samhain.spec.in	(revision 1)
@@ -70,5 +70,5 @@
         # Activate boot-time start up
         cd %{_localstatedir}/lib/%{name}
-        /bin/sh ./samhain-install.sh --verbose install-boot
+        ./samhain-install.sh --verbose install-boot
         if test -f /sbin/chkconfig; then
 		/sbin/chkconfig --add samhain
@@ -100,5 +100,5 @@
         cd %{_localstatedir}/lib/samhain
         if [ -f ./samhain-install.sh ]; then
-	    /bin/sh ./samhain-install.sh --verbose uninstall-boot
+	    ./samhain-install.sh --verbose uninstall-boot
 	else
 	    if [ -f /sbin/chkconfig ]; then
@@ -109,4 +109,11 @@
 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
@@ -114,11 +121,10 @@
 %dir %{_localstatedir}/run
 %dir %{_localstatedir}/log
-%doc docs/BUGS COPYING docs/Changelog 
-%doc LICENSE docs/HOWTO* docs/MANUAL-2_4.* docs/README*
+%doc docs/BUGS COPYING docs/Changelog docs/TODO
+%doc LICENSE docs/HOWTO* docs/MANUAL-2_0.* docs/README*
 %{_localstatedir}/lib/%{name}
 %{_sbindir}/%{name}
 %attr(644,root,root) %{_mandir}/man5/samhain*
 %attr(644,root,root) %{_mandir}/man8/samhain*
-%attr(644,root,root) /etc/logrotate.d/@install_name@
 %config(noreplace) %{_sysconfdir}/samhainrc
 
Index: trunk/scripts/samhainadmin-gpg.pl.in
===================================================================
--- trunk/scripts/samhainadmin-gpg.pl.in	(revision 591)
+++ 	(revision )
@@ -1,719 +1,0 @@
-#! /usr/bin/perl
-
-# Copyright Rainer Wichmann (2004)
-#
-# 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.
-#
-
-use warnings;
-use strict;
-use Getopt::Long;
-use File::Basename;
-use File::Copy;
-use File::stat;
-use File::Temp qw/ tempfile tempdir unlink0 /;
-use IO::Handle;
-use Fcntl qw(:DEFAULT :flock);
-use Tie::File;
-
-# Do I/O to the data file in binary mode (so it 
-# wouldn't complain about invalid UTF-8 characters).
-use bytes;
-
-File::Temp->safe_level( File::Temp::HIGH );
-
-my %opts = ();
-my $action;
-my $file1;
-my $file2;
-my $passphrase;
-my $secretkeyring;
-my $return_from_sign = 0;
-my $no_print_examine = 0;
-my $no_remove_lock   = 0;
-my $base = basename($0);
-
-my $cfgfile  = "@myconffile@";
-my $datafile = "@mydatafile@";
-my $daemon   = "@sbindir@/@install_name@";
-my $gpg      = "@mygpg@";
-
-my $TARGETKEYID = "@mykeyid@";
-my $KEYTAG      = "@mykeytag@";
-
-$cfgfile  =~ s/^REQ_FROM_SERVER//;
-$datafile =~ s/^REQ_FROM_SERVER//;
-
-$gpg = "gpg" if ($gpg eq "");
-
-sub check_gpg_agent() {
-    my  $gpgconf = "$ENV{'HOME'}/.gnupg/gpg.conf";
-
-    if (!-f "$gpgconf") {
-	$gpgconf = "$ENV{'HOME'}/.gnupg/options";
-    }
-
-    if (-f $gpgconf) {
-
-	my @array = ();
-	tie @array, 'Tie::File', $gpgconf or die "Cannot tie ${gpgconf}: $!";
-	my @grep = grep(/^\s*use-agent/, @array);
-	
-	# print "matches = $#grep\n";
-	
-	if ($#grep >= 0)
-	{
-	    if (exists $ENV{'GPG_AGENT_INFO'})
-	    {
-		my $socke = $ENV{'GPG_AGENT_INFO'};
-		$socke =~ s/:.*//;
-		
-		# print "socke = $socke\n";
-		
-		if (! -S $socke)
-		{
-		    print "--------------------------------------------------\n";
-		    print "\n";
-		    print " GPG is set to use gpg-agent, but GPG agent is";
-		    print " not running, though GPG_AGENT_INFO is defined.\n\n";
-		    print " Please restart gpg-agent, or remove the use-agent\n";
-		    print " option from ${gpgconf} and unset GPG_AGENT_INFO\n\n";
-		    print "--------------------------------------------------\n";
-		    print "\n";
-		    exit 1;
-		}
-	    }
-	    else
-	    {
-		print "--------------------------------------------------\n";
-		print "\n";
-		print " GPG is set to use gpg-agent, but ";
-		print " GPG_AGENT_INFO is not defined.\n\n";
-		print " Please start gpg-agent, or remove the use-agent\n";
-		print " option from ${gpgconf}\n\n";
-		print "--------------------------------------------------\n";
-		print "\n";
-		exit 1;
-	    }
-	}
-	untie @array;
-    }
-}
-
-
-sub usage() {
-    print "Usage:\n";
-    print "  $base { -m F | --create-cfgfile }    [options] [in.cfgfile]\n";
-    print "    Sign the configuration file. If in.cfgfile is given, sign it\n";
-    print "    and install it as configuration file.\n\n";
-
-    print "  $base { -m f | --print-cfgfile }     [options] \n";
-    print "    Print the configuration file to stdout. Signatures are removed.\n\n";
-
-    print "  $base { -m D | --create-datafile }   [options] [in.datafile]\n";
-    print "    Sign the database file. If in.datafile is given, sign it\n";
-    print "    and install it as database file.\n\n";
-
-    print "  $base { -m d | --print-datafile }    [options] \n";
-    print "    Print the database file to stdout. Signatures are removed. Use\n";
-    print "    option --list to list files in database rather than printing the raw file.\n\n";
-
-    print "  $base { -m R | --remove-signature }  [options] file1 [file2 ...]\n";
-    print "    Remove cleartext signature from input file(s). The file\n";
-    print "    is replaced by the non-signed file.\n\n";
-
-    print "  $base { -m E | --sign }              [options] file1 [file2 ...]\n";
-    print "    Sign file(s) with a cleartext signature. The file\n";
-    print "    is replaced by the signed file.\n\n";
-
-    print "  $base { -m e | --examine }           [options] file1 [file2 ...]\n";
-    print "    Report signature status of file(s).\n\n";
-
-    print "  $base { -m G | --generate-keys }     [options] \n";
-    print "    Generate a PGP keypair to use for signing.\n\n";
-
-    print "Options:\n";
-    print "  -c cfgfile    --cfgfile cfgfile\n";
-    print "    Select an alternate configuration file.\n\n";
-
-    print "  -d datafile   --datafile datafile\n";
-    print "    Select an alternate database file.\n\n";
-
-    print "  -p passphrase --passphrase passphrase\n";
-    print "    Set the passphrase for gpg. By default, gpg will ask.\n\n";
-
-    print "  -k keyid      --keyid keyid\n";
-    print "   Select the keyid to use for signing.\n\n";
-
-    print "  -l            --list\n";
-    print "    List the files in database rather than printing the raw file.\n\n";
-
-    print "  -v            --verbose\n";
-    print "    Verbose output.\n\n";
-    return;
-}
-
-sub check_gpg_uid () {
-    if (0 != $>) {
-	print "--------------------------------------------------\n";
-	print "\n";
-	print " You are not root. Please remember that samhain/yule\n";
-	print " will use the public keyring of root to verify a signature.\n";
-	print "\n";
-	print "--------------------------------------------------\n";
-    } else {
-	if (!("@yulectl_prg@" =~ //)) {
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    print " Please remember that yule will drop root after startup. Signature\n";
-	    print " verification on SIGHUP will fail if you do not import the public key\n";
-	    print " into the keyring of the non-root yule user.\n";
-	    print "\n";
-	    print "--------------------------------------------------\n";
-	}
-    }
-}
-    
-sub check_gpg_sign () {
-    if ( defined($secretkeyring)) {
-        if ( (!-d "$secretkeyring")){
-            print "--------------------------------------------------\n";
-            print "\n";
-            print " Secret keyring $secretkeyring not found!\n";
-            print "\n";
-            print " Please check the path/name of the alternate secret keyring.\n";
-            print "\n";
-            print "--------------------------------------------------\n";
-            print "\n";
-            exit;
-        }
-    } else {
-        if ( (!-d "$ENV{'HOME'}/.gnupg") || (!-e "$ENV{'HOME'}/.gnupg/secring.gpg")) {
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    if (!-d "$ENV{'HOME'}/.gnupg") {
-	        print " Directory \$HOME/.gnupg not found!\n";
-	    } else {
-	        print " Secret keyring \$HOME/.gnupg/secring.gpg not found!\n";
-	    }
-	    print "\n";
-	    print " This indicates that you have never created a \n";
-	    print " public/private keypair, and thus cannot sign.\n";
-	    print " \n";
-	    print " Please use $0 --generate-keys or gpg --gen-key\n";
-	    print " to generate a public/private keypair first.\n";
-	    print "\n";
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    exit;
-        }
-    }
-}
-
-sub check_gpg_verify () {
-    if ( (!-d "$ENV{'HOME'}/.gnupg") || (!-e "$ENV{'HOME'}/.gnupg/pubring.gpg")) {
-	print "--------------------------------------------------\n";
-	print "\n";
-	if (!-d "$ENV{'HOME'}/.gnupg") {
-	    print " Directory \$HOME/.gnupg not found!\n";
-	} else {
-	    print " Public keyring \$HOME/.gnupg/pubring.gpg not found!\n";
-	}
-	print "\n";
-	print " This indicates that you have never used gpg before \n";
-	print " and/or have no public keys to verify signatures.\n";
-	print " \n";
-	print " Please use 'gpg --export key_id' to export the public\n";
-	print " signing key of the user who is signing the\n";
-	print " configuration/database files.\n\n";
-	print " Then you can use 'gpg --import keyfile' to import the key\n";
-	print " into this user's public keyring.\n";
-	print "\n";
-	print "--------------------------------------------------\n";
-	print "\n";
-	exit;
-    }
-}
-
-
-sub generate () {
-    my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --gen-key";
-    check_gpg_uid();
-    system ($command) == 0 
-	or die "system $command failed: $?";
-    exit;
-}
-
-sub examine () {
-    my $iscfg = 0;
-    my $have_fp  = 0;
-    my $have_sig = 0;
-    my $message = '';
-    my $retval  = 9;
-    my $fh;
-    my $filename;
-
-    if (!($file1 =~ /^\-$/)) {
-	die ("Cannot open $file1 for read: $!") unless ((-e $file1) && (-r _));
-    }
-    open FIN,  "<$file1" or die "Cannot open $file1 for read: $!";
-
-    my $dir = tempdir( CLEANUP => 1 );
-    $filename = $dir . "/exa_jhfdbilw." . $$;
-    open $fh, ">$filename" or die "Cannot open $filename";
-    autoflush $fh 1;
-
-    while (<FIN>) {
-	print $fh $_;
-	if ($_ =~ /^\s*\[Misc\]/) {
-	    $iscfg = 1;
-	}
-    }
-    if ($iscfg == 1) {
-	$message .=  "File $file1 is a configuration file\n\n";
-    } else {
-	$message .=  "File $file1 is a database file\n\n";
-    }
-
-
-    my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --status-fd 1 ";
-    $command .= "--verbose " if (defined($opts{'v'}));
-    $command .= "--verify $filename ";
-    if (defined($opts{'v'})) {
-	$command .= "2>&1";
-    } else {
-	$command .= "2>/dev/null";
-    }
-
-    print STDOUT "Using: $command\n\n" if (defined($opts{'v'}));
-    open  GPGIN, "$command |" or die "Cannot fork: $!";
-
-    while (<GPGIN>) {
-	if ($_ =~ /^\[GNUPG:\] GOODSIG ([0-9A-F]+) (.*)$/) {
-	    $message .= "GOOD signature with key: $1\n";
-	    $message .= "Key owner:               $2\n";
-	    $have_sig = 1;
-	    $retval   = 0;
-	}
-	if ($_ =~ /^\[GNUPG:\] VALIDSIG ([0-9A-F]+) ([0-9\-]+)\s/) {
-	    $message .= "Key fingerprint:         $1\n";
-	    $message .= "Signature generated on:  $2\n\n";
-	    $have_fp = 1;
-	    $message .=  "This file is signed with a valid signature.\n" 
-		if ($have_sig == 1);
-	    $have_sig = 1;
-	    $have_fp = 1;
-	}
-	if ($_ =~ /^\[GNUPG:\] NODATA 1/) {
-	    $message .=  "NO signature found.\n\n";
-	    $message .=  "This file is not signed !!!\n";
-	    $have_sig = 1;
-	    $have_fp = 1;
-	    $retval  = 2;
-	}
-	if ($_ =~ /^\[GNUPG:\] BADSIG ([0-9A-F]+) (.*)$/) {
-	    $message .=  "BAD signature with key: $1\n";
-	    $message .=  "Key owner:              $2\n\n";
-	    $message .=  "This file is signed with an invalid signature !!!\n";
-	    $have_sig = 1;
-	    $have_fp = 1;
-	    $retval = 1;
-	}
-	if ($_ =~ /^\[GNUPG:\] NO_PUBKEY ([0-9A-F]+)/) {
-	    $message .=  "NOT CHECKED signature with key: $1\n\n";
-	    $message .=  "The signature of this file cannot be checked: no public key available !!!\n";
-	    $have_sig = 1;
-	    $have_fp = 1;
-	    $retval  = 1;
-	}
-	print STDOUT $_ if (defined($opts{'v'}));
-    }
-    close (GPGIN);
-    print STDOUT "\n" if (defined($opts{'v'}));
-    if ($have_sig == 0) {
-	$message .=  "NO valid signature found\n";
-    } 
-    elsif ($have_fp == 0) {
-	$message .=  "NO fingerprint found\n";
-    }
-    close (FIN);
-    if ($no_print_examine == 0) {
-	print STDOUT $message;
-    }
-    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
-    return $retval;
-}
-
-sub remove () {
-    my $bodystart = 1;
-    my $sigstart  = 0;
-    my $sigend    = 0;
-    my $filename  = "";
-    my $fh;
-    my $stats;
-
-    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
-    if (!($file1 =~ /^\-$/)) {
-	flock(FH, LOCK_EX) unless ($no_remove_lock == 1);
-	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
-	$filename = $dir . "/rem_iqegBCQb." . $$;
-	open $fh, ">$filename" or die "Cannot open $filename";
-	$stats = stat($file1);
-	# ($fh, $filename) = tempfile(UNLINK => 1);
-    } else {
-	open $fh, ">$file1" or die "Cannot open file $file1 for write: $!";
-    }
-    autoflush $fh 1;
-    while (<FH>) {
-	if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
-	    $sigstart = 1;
-	    $bodystart = 0;
-	    next;
-	} elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
-	    $sigstart = 0;
-	    $bodystart = 1;
-	    next;
-	} elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
-	    $bodystart = 0;
-	    $sigend = 1;
-	    next;
-	} elsif (($sigend == 1) && ($_ =~ /^-----END PGP SIGNATURE-----/)) {
-	    $sigend = 0;
-	    $bodystart = 1;
-	    next;
-	}
-	if ($bodystart == 1) {
-	    print $fh $_;
-	}
-    }
-    if (!($file1 =~ /^\-$/)) {
-	copy("$filename", "$file1") 
-	    or die "Copy $filename to $file1 failed: $!";
-	chmod $stats->mode, $file1;
-	chown $stats->uid, $stats->gid, $file1;
-	flock(FH, LOCK_UN) unless ($no_remove_lock == 1);
-	close FH;
-    }
-    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
-    return;
-}
-
-sub print_cfgfile () {
-    my $bodystart = 0;
-    my $sigstart  = 0;
-
-    if (!defined($file2)) {
-	$file2 = '-';
-    }
-
-    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
-    open FO, ">$file2" or die "Cannot open file $file2 for write: $!";
-    while (<FH>) {
-	if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
-	    $sigstart = 1;
-	    next;
-	} elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
-	    $sigstart = 0;
-	    $bodystart = 1;
-	    next;
-	} elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
-	    $bodystart = 0;
-	    exit;
-	}
-	if ($bodystart == 1) {
-	    print FO $_;
-	}
-    }
-    exit;
-}
-sub print_datafile () {
-    die ("Cannot find program $daemon") 
-	unless (-e $daemon);
-    if (defined($opts{'v'})) {
-	open FH, "$daemon --full-detail -d $datafile |" 
-	    or die "Cannot open datafile $datafile for read: $!";
-    } else {
-	open FH, "$daemon -d $datafile |" 
-	    or die "Cannot open datafile $datafile for read: $!";
-    }
-    while (<FH>) {
-	print $_;
-    }
-    exit;
-}
-
-sub sign_file () {
-
-    my $fileout = '';
-    my $bodystart = 1;
-    my $sigstart  = 0;
-    my $sigend    = 0;
-    my $stats;
-    my $fh1;
-    my $filename1;
-    my $flag1     = 0;
-
-    check_gpg_uid();
-    check_gpg_agent();
-
-    if (!defined($file2)) {
-	$file2 = $file1;
-    }
-
-    if ($file1 =~ /^\-$/) {
-	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
-	$filename1 = $dir . "/sig_vs8827sd." . $$;
-	open $fh1, ">$filename1" or die "Cannot open $filename1";
-	$flag1 = 1;
-	# my ($fh1, $filename1) = tempfile(UNLINK => 1);
-
-	while (<STDIN>) {
-	  if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
-	    $sigstart = 1;
-	    $bodystart = 0;
-	    next;
-	  } elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
-	    $sigstart = 0;
-	    $bodystart = 1;
-	    next;
-	  } elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
-	    $bodystart = 0;
-	    $sigend = 1;
-	    next;
-	  } elsif (($sigend == 1) && ($_ =~ /^-----END PGP SIGNATURE-----/)) {
-	    $sigend = 0;
-	    $bodystart = 1;
-	    next;
-	  }
-	  if ($bodystart == 1) {
-	    print $fh1 $_;
-	  }
-	  #
-	  # print $fh1 $_;
-	  #
-	}
-	$file1 = $filename1;
-	$fileout = '-';
-    } else {
-	open (LOCKFILE, "<$file1") or die "Cannot open $file1: $!";
-	flock(LOCKFILE, LOCK_EX);
-	$no_print_examine = 1;
-	$no_remove_lock   = 1;
-	if (examine() < 2) {
-	    remove();
-	}
-	$fileout = $file1 . ".asc";
-	$stats   = stat($file1)
-	    or die "No file $file1: $!";
-    }
-
-    if (defined($passphrase)) {
-	local $SIG{PIPE} = 'IGNORE';
-	my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --passphrase-fd 0 -a ${KEYTAG} ${TARGETKEYID} --clearsign -o $fileout --not-dash-escaped ";
-	$command .= "$file1";
-	open (FH, "|$command")  or die "can't fork: $!";
-	print FH "$passphrase"  or die "can't write: $!";
-	close FH                or die "can't close: status=$?";
-    } else {
-	my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg                   -a ${KEYTAG} ${TARGETKEYID} --clearsign -o $fileout --not-dash-escaped ";
-	$command .= "$file1";
-	system("$command") == 0 
-	    or die "system $command failed: $?";
-    }
-
-    if (!($fileout =~ /^\-$/)) {
-	my $st_old = stat($file1) 
-	    or die "No file $file1: $!";
-	my $st_new = stat($fileout) 
-	    or die "No file $fileout: $!";
-	die ("Signed file is smaller than unsigned file") 
-	    unless ($st_new->size > $st_old->size);
-	move("$fileout", "$file2") 
-	    or die "Move $fileout to $file2 failed: $!";
-	chmod $stats->mode, $file2;
-	chown $stats->uid, $stats->gid, $file2;
-	flock(LOCKFILE, LOCK_UN);
-    }
-
-    if ($flag1 == 1) {
-	unlink0( $fh1, $filename1 ) or die "Cannot unlink $filename1 safely";
-    }
-    if ($return_from_sign == 1) {
-	return;
-    }
-    exit;
-}
-
-Getopt::Long::Configure ("posix_default");
-Getopt::Long::Configure ("bundling");
-# Getopt::Long::Configure ("debug");
-
-GetOptions (\%opts, 'm=s', 'h|help', 'v|verbose', 'l|list',
-	    'c|cfgfile=s',
-	    'd|datafile=s',
-	    'p|passphrase=s',
-            'k|keyid=s',
-	    'create-cfgfile',  # -m F
-	    'print-cfgfile',   # -m f
-	    'create-datafile', # -m D
-	    'print-datafile',  # -m d
-	    'remove-signature',# -m R
-	    'sign',            # -m E
-	    'examine',         # -m e
-	    'generate-keys');  # -m G
-
-if (defined ($opts{'h'})) {
-    usage();
-    exit;
-}
-
-if (defined($opts{'k'})) {
-    $TARGETKEYID = $opts{'k'};
-    $KEYTAG = "--default-key";
-}
-if (defined($opts{'c'})) {
-    $cfgfile = $opts{'c'};
-}
-if (defined($opts{'d'})) {
-    $datafile = $opts{'d'};
-}
-if (defined($opts{'p'})) {
-    $passphrase = $opts{'p'};
-}
-if (defined($opts{'s'})) {
-    $secretkeyring = $opts{'s'};
-}
-
-if (defined ($opts{'m'}) && ($opts{'m'} =~ /[FfDdREeG]{1}/) ) {
-    $action = $opts{'m'};
-}
-elsif (defined ($opts{'create-cfgfile'})) {
-    $action = 'F';
-}
-elsif (defined ($opts{'print-cfgfile'})) {
-    $action = 'f';
-}
-elsif (defined ($opts{'create-datafile'})) {
-    $action = 'D';
-}
-elsif (defined ($opts{'print-datafile'})) {
-    $action = 'd';
-}
-elsif (defined ($opts{'remove-signature'})) {
-    $action = 'R';
-}
-elsif (defined ($opts{'sign'})) {
-    $action = 'E';
-}
-elsif (defined ($opts{'examine'})) {
-    $action = 'e';
-}
-elsif (defined ($opts{'generate-keys'})) {
-    $action = 'G';
-}
-else {
-    usage();
-    die ("No valid action specified !");
-}
-
-if (defined($ARGV[0])) {
-    $file1 = $ARGV[0];
-} 
-if (defined($ARGV[1])) {
-    $file2 = $ARGV[1];
-} 
-
-
-if (($action =~ /[REe]{1}/) && !defined($file1)) {
-    usage();
-    die("Option -m $action requires a filename (or '-' for stdio)\n");
-}
-
-if ($action =~ /^F$/) {
-    if (!defined($file1)) {
-	$file1 = $cfgfile;
-    }
-    $file2 = $cfgfile;
-    sign_file ();
-}
-
-if ($action =~ /^D$/) {
-    if (!defined($file1)) {
-	$file1 = $datafile;
-    }
-    $file2 = $datafile;
-    sign_file ();
-}
-
-if ($action =~ /^R$/) {
-    # $file1 defined
-    my $i = 0;
-    while (defined($ARGV[$i])) {
-	$file1 = $ARGV[$i];
-	remove ();
-	++$i;
-    }
-}
-
-if ($action =~ /^E$/) {
-    # $file1 defined
-    # default: $file2 = $file1
-    check_gpg_sign();
-    my $i = 0;
-    while (defined($ARGV[$i])) {
-	$file1 = $ARGV[$i];
-	$file2 = $file1;
-	$return_from_sign = 1;
-	sign_file ();
-	++$i;
-    }
-}
-
-if ($action =~ /^e$/) {
-    # $file1 defined
-    # default: $file2 = stdout
-    check_gpg_verify();
-    my $i = 0;
-    my $ret = 0;
-    while (defined($ARGV[$i])) {
-	print "\n";
-	$file1 = $ARGV[$i];
-	$ret += examine ();
-	++$i;
-	print "\n--------------------------------\n" if (defined($ARGV[$i]));
-    }
-    exit($ret);
-}
-
-if ($action =~ /^f$/) {
-    $file1 = $cfgfile;
-    $file2 = "-";
-    print_cfgfile ();
-}
-
-if ($action =~ /^d$/) {
-    # $file1 irrelevant
-    if (defined($opts{'l'})) {
-	print_datafile ();
-    } else {
-	$file1 = $datafile;
-	$file2 = "-";
-	print_cfgfile ();
-    }
-}
-
-
-
Index: trunk/scripts/samhainadmin-sig.pl.in
===================================================================
--- trunk/scripts/samhainadmin-sig.pl.in	(revision 591)
+++ 	(revision )
@@ -1,636 +1,0 @@
-#! /usr/bin/perl
-
-# Copyright Rainer Wichmann (2004)
-#
-# 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.
-#
-
-use warnings;
-use strict;
-use Getopt::Long;
-use File::Basename;
-use File::Copy;
-use File::stat;
-use File::Temp qw/ tempfile tempdir unlink0 /;
-use IO::Handle;
-use Fcntl qw(:DEFAULT :flock);
-use Tie::File;
-
-# Do I/O to the data file in binary mode (so it 
-# wouldn't complain about invalid UTF-8 characters).
-use bytes;
-
-File::Temp->safe_level( File::Temp::HIGH );
-
-my %opts = ();
-my $action;
-my $file1;
-my $file2;
-my $passphrase;
-my $secretkey;
-my $return_from_sign = 0;
-my $no_print_examine = 0;
-my $no_remove_lock   = 0;
-my $base = basename($0);
-
-my $cfgfile  = "@myconffile@";
-my $datafile = "@mydatafile@";
-my $daemon   = "@sbindir@/@install_name@";
-my $signify  = "@mysignify@";
-
-my $SIGDIR   = "$ENV{'HOME'}/.signify";
-my $KEYID    = "@install_name@";
-
-$cfgfile  =~ s/^REQ_FROM_SERVER//;
-$datafile =~ s/^REQ_FROM_SERVER//;
-
-$signify = "signify-openbsd" if ($signify eq "");
-
-sub usage() {
-    print "Usage:\n";
-    print "  $base { -m F | --create-cfgfile }    [options] [in.cfgfile]\n";
-    print "    Sign the configuration file. If in.cfgfile is given, sign it\n";
-    print "    and install it as configuration file.\n\n";
-
-    print "  $base { -m f | --print-cfgfile }     [options] \n";
-    print "    Print the configuration file to stdout. Signatures are removed.\n\n";
-
-    print "  $base { -m D | --create-datafile }   [options] [in.datafile]\n";
-    print "    Sign the database file. If in.datafile is given, sign it\n";
-    print "    and install it as database file.\n\n";
-
-    print "  $base { -m d | --print-datafile }    [options] \n";
-    print "    Print the database file to stdout. Signatures are removed. Use\n";
-    print "    option --list to list files in database rather than printing the raw file.\n\n";
-
-    print "  $base { -m R | --remove-signature }  [options] file1 [file2 ...]\n";
-    print "    Remove cleartext signature from input file(s). The file\n";
-    print "    is replaced by the non-signed file.\n\n";
-
-    print "  $base { -m E | --sign }              [options] file1 [file2 ...]\n";
-    print "    Sign file(s) with a cleartext signature. The file\n";
-    print "    is replaced by the signed file.\n\n";
-
-    print "  $base { -m e | --examine }           [options] file1 [file2 ...]\n";
-    print "    Report signature status of file(s).\n\n";
-
-    print "  $base { -m G | --generate-keys }     [options] \n";
-    print "    Generate a signify keypair to use for signing.\n\n";
-
-    print "Options:\n";
-    print "  -c cfgfile    --cfgfile cfgfile\n";
-    print "    Select an alternate configuration file.\n\n";
-
-    print "  -d datafile   --datafile datafile\n";
-    print "    Select an alternate database file.\n\n";
-
-    print "  -p passphrase --passphrase passphrase\n";
-    print "    Set the passphrase for signify. By default, signify will ask.\n\n";
-
-    print "  -s signify_dir --signify-dir signify_dir\n";
-    print "    Select an alternate directory to locate the secret keyring.\n";
-    print "    Will use '$ENV{'HOME'}/.signify/' by default.\n\n";
-
-    print "  -k keyid      --keyid keyid\n";
-    print "   Select the keyid to use for signing.\n\n";
-
-    print "  -l            --list\n";
-    print "    List the files in database rather than printing the raw file.\n\n";
-
-    print "  -v            --verbose\n";
-    print "    Verbose output.\n\n";
-    return;
-}
-
-sub check_signify_uid () {
-    if (0 != $>) {
-	print "--------------------------------------------------\n";
-	print "\n";
-	print " You are not root. Please remember that samhain/yule\n";
-	print " will use the public key of root to verify a signature.\n";
-	print "\n";
-	print "--------------------------------------------------\n";
-    } else {
-	if (!("@yulectl_prg@" =~ //)) {
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    print " Please remember that yule will drop root after startup. Signature\n";
-	    print " verification on SIGHUP will fail if you do not import the public key\n";
-	    print " into the ~/.signify/ directory of the non-root yule user.\n";
-	    print "\n";
-	    print "--------------------------------------------------\n";
-	}
-    }
-}
-    
-sub check_signify_sign () {
-    if ( defined($secretkey)) {
-        if ( (!-d "$secretkey")){
-            print "--------------------------------------------------\n";
-            print "\n";
-            print " Secret key $secretkey not found!\n";
-            print "\n";
-            print " Please check the path/name of the alternate secret key.\n";
-            print "\n";
-            print "--------------------------------------------------\n";
-            print "\n";
-            exit;
-        }
-    } else {
-        if ( (!-d "$SIGDIR") || (!-e "${SIGDIR}/${KEYID}.sec")) {
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    if (!-d "$SIGDIR") {
-	        print " Directory $SIGDIR not found!\n";
-	    } else {
-	        print " Secret key ${SIGDIR}/${KEYID}.sec not found!\n";
-	    }
-	    print "\n";
-	    print " This indicates that you have never created a \n";
-	    print " public/private keypair, and thus cannot sign.\n";
-	    print " \n";
-	    print " Please use $0 --generate-keys or\n";
-	    print " $signify -G -s ${SIGDIR}/${KEYID}.sec -p ${SIGDIR}/${KEYID}.pub\n";
-	    print " to generate a public/private keypair first.\n";
-	    print "\n";
-	    print "--------------------------------------------------\n";
-	    print "\n";
-	    exit;
-        }
-    }
-}
-
-sub check_signify_verify () {
-    if ( (!-d "${SIGDIR}") || (!-e "${SIGDIR}/${KEYID}.pub")) {
-	print "--------------------------------------------------\n";
-	print "\n";
-	if (!-d "$SIGDIR") {
-	    print " Directory $SIGDIR not found!\n";
-	} else {
-	    print " Public key ${SIGDIR}/${KEYID}.pub not found!\n";
-	}
-	print "\n";
-	print " This indicates that you have no public key\n";
-	print " to verify signatures.\n";
-	print " \n";
-	print " Please copy the public key ${KEYID}.pub of\n";
-	print " the user who is signing the configuration/database files\n";
-	print " into the directory $SIGDIR.\n";
-	print "\n";
-	print "--------------------------------------------------\n";
-	print "\n";
-	exit;
-    }
-}
-
-
-sub generate () {
-    my $command = "$signify -G -s ${SIGDIR}/${KEYID}.sec -p ${SIGDIR}/${KEYID}.pub";
-    if (!-d "${SIGDIR}") {
-	unless(mkdir "$SIGDIR", 0750) {
-	    die "Creating directory $SIGDIR failed: $?";
-	}
-    }
-    check_signify_uid();
-    system ($command) == 0 
-	or die "system $command failed: $?";
-    exit;
-}
-
-sub examine () {
-    my $iscfg = 0;
-    my $have_fp  = 0;
-    my $have_sig = 0;
-    my $message = '';
-    my $retval  = 9;
-    my $fh;
-    my $filename;
-
-    if (!($file1 =~ /^\-$/)) {
-	die ("Cannot open $file1 for read: $!") unless ((-e $file1) && (-r _));
-    }
-    open FIN,  "<$file1" or die "Cannot open $file1 for read: $!";
-
-    my $dir = tempdir( CLEANUP => 1 );
-    $filename = $dir . "/exa_jhfdbilw." . $$;
-    open $fh, ">$filename" or die "Cannot open $filename";
-    autoflush $fh 1;
-
-    while (<FIN>) {
-	print $fh $_;
-	if ($_ =~ /^\s*\[Misc\]/) {
-	    $iscfg = 1;
-	}
-    }
-    if ($iscfg == 1) {
-	$message .=  "File $file1 is a configuration file\n\n";
-    } else {
-	$message .=  "File $file1 is a database file\n\n";
-    }
-
-
-    my $command = "$signify -Vem /dev/null -p ${SIGDIR}/${KEYID}.pub ";
-    $command .= "-x $filename ";
-    if (defined($opts{'v'})) {
-	$command .= "2>&1";
-    } else {
-	$command .= "2>/dev/null";
-    }
-
-    print STDOUT "Using: $command\n\n" if (defined($opts{'v'}));
-    open  SIGIN, "$command |" or die "Cannot fork: $!";
-
-    while (<SIGIN>) {
-	chomp ($_);
-	if ($_ =~ /^Signature Verified$/) {
-	    $message .= "GOOD signature with key: ${SIGDIR}/${KEYID}.pub\n";
-	    $have_sig = 1;
-	    $retval   = 0;
-	}
-	print STDOUT $_ if (defined($opts{'v'}));
-    }
-    close (SIGIN);
-    print STDOUT "\n" if (defined($opts{'v'}));
-    if ($have_sig == 0) {
-	$message .=  "NO valid signature found\n";
-    }
-    close (FIN);
-    if ($no_print_examine == 0) {
-	print STDOUT $message;
-    }
-    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
-    return $retval;
-}
-
-sub wstrip ($) {
-    $_ = shift;
-    $_ =~ s/\s+//g;
-    return $_;
-}
-
-sub remove () {
-    my $bodystart = 1;
-    my $sigstart  = 0;
-    my $sigend    = 0;
-    my $filename  = "";
-    my $fh;
-    my $stats;
-
-    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
-    if (!($file1 =~ /^\-$/)) {
-	flock(FH, LOCK_EX) unless ($no_remove_lock == 1);
-	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
-	$filename = $dir . "/rem_iqegBCQb." . $$;
-	open $fh, ">$filename" or die "Cannot open $filename";
-	$stats = stat($file1);
-    } else {
-	open $fh, ">$file1" or die "Cannot open file $file1 for write: $!";
-    }
-    autoflush $fh 1;
-    while (<FH>) {
-	if ($_ =~ /^untrusted comment: /) {
-	    $sigstart = 1;
-	    $bodystart = 0;
-	    next;
-	} elsif (($sigstart == 1) && (wstrip($_) =~ m{^(?: [A-Za-z0-9+/]{4} )*(?:[A-Za-z0-9+/]{2} [AEIMQUYcgkosw048]=|[A-Za-z0-9+/][AQgw]==)?$}xm )) {
-	    $sigstart = 0;
-	    $bodystart = 1;
-	    next;
-	} elsif (($sigstart == 1) && ($bodystart == 0)) {
-	    # comment NOT followed by signature
-	    $sigstart = 0;
-	    next;
-	}
-
-	if ($bodystart == 1) {
-	    print $fh $_;
-	}
-    }
-    if (!($file1 =~ /^\-$/)) {
-	copy("$filename", "$file1") 
-	    or die "Copy $filename to $file1 failed: $!";
-	chmod $stats->mode, $file1;
-	chown $stats->uid, $stats->gid, $file1;
-	flock(FH, LOCK_UN) unless ($no_remove_lock == 1);
-	close FH;
-    }
-    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
-    return;
-}
-
-sub print_cfgfile () {
-    my $bodystart = 0;
-    my $sigstart  = 0;
-
-    if (!defined($file2)) {
-	$file2 = '-';
-    }
-
-    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
-    open FO, ">$file2" or die "Cannot open file $file2 for write: $!";
-    while (<FH>) {
-	if ($_ =~ /^untrusted comment: /) {
-	    $sigstart = 1;
-	    $bodystart = 0;
-	    next;
-	} elsif (($sigstart == 1) && (wstrip($_) =~ m{^(?: [A-Za-z0-9+/]{4} )*(?:[A-Za-z0-9+/]{2} [AEIMQUYcgkosw048]=|[A-Za-z0-9+/][AQgw]==)?$}xm )) {
-	    $sigstart = 0;
-	    $bodystart = 1;
-	    next;
-	} elsif (($sigstart == 1) && ($bodystart == 0)) {
-	    # comment NOT followed by signature 
-	    $sigstart = 0;
-	    next;
-	}
-	if ($bodystart == 1) {
-	    print FO $_;
-	}
-    }
-    exit;
-}
-
-sub print_datafile () {
-    die ("Cannot find program $daemon") 
-	unless (-e $daemon);
-    if (defined($opts{'v'})) {
-	open FH, "$daemon --full-detail -d $datafile |" 
-	    or die "Cannot open datafile $datafile for read: $!";
-    } else {
-	open FH, "$daemon -d $datafile |" 
-	    or die "Cannot open datafile $datafile for read: $!";
-    }
-    while (<FH>) {
-	print $_;
-    }
-    exit;
-}
-
-sub sign_file () {
-
-    my $fileout = '';
-    my $bodystart = 1;
-    my $sigstart  = 0;
-    my $sigend    = 0;
-    my $stats;
-    my $fh1;
-    my $filename1;
-    my $flag1     = 0;
-
-    check_signify_uid();
-
-    if (!defined($file2)) {
-	$file2 = $file1;
-    }
-
-    if ($file1 =~ /^\-$/) {
-	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
-	$filename1 = $dir . "/sig_vs8827sd." . $$;
-	open $fh1, ">$filename1" or die "Cannot open $filename1";
-	$flag1 = 1;
-	# my ($fh1, $filename1) = tempfile(UNLINK => 1);
-
-	while (<STDIN>) {
-	    if ($_ =~ /^untrusted comment: /) {
-		$sigstart = 1;
-		$bodystart = 0;
-		next;
-	    } elsif (($sigstart == 1) && (wstrip($_) =~ m{^(?: [A-Za-z0-9+/]{4} )*(?:[A-Za-z0-9+/]{2} [AEIMQUYcgkosw048]=|[A-Za-z0-9+/][AQgw]==)?$}xm )) {
-		$sigstart = 0;
-		$bodystart = 1;
-		next;
-	    } elsif (($sigstart == 1) && ($bodystart == 0)) {
-		#comment NOT followed by signature 
-		$sigstart = 0;
-		next;
-	    }
-
-	    if ($bodystart == 1) {
-		print $fh1 $_;
-	    }
-	}
-	$file1 = $filename1;
-	$fileout = '-';
-    } else {
-	open (LOCKFILE, "<$file1") or die "Cannot open $file1: $!";
-	flock(LOCKFILE, LOCK_EX);
-	$no_print_examine = 1;
-	$no_remove_lock   = 1;
-	if (examine() < 2) {
-	    remove();
-	}
-	$fileout = $file1 . ".sig";
-	$stats   = stat($file1)
-	    or die "No file $file1: $!";
-    }
-
-    my $command = "$signify -Se ";
-    $command .= "-s ${SIGDIR}/${KEYID}.sec ";
-    $command .= "-x ${fileout} ";
-    $command .= "-m $file1";
-
-    if (defined($passphrase)) {
-	local $SIG{PIPE} = 'IGNORE';
-	open (FH, "|$command")  or die "can't fork: $!";
-	print FH "$passphrase"  or die "can't write: $!";
-	close FH                or die "can't close: status=$?";
-    } else {
-	system("$command") == 0 
-	    or die "system $command failed: $?";
-    }
-
-    if (!($fileout =~ /^\-$/)) {
-	my $st_old = stat($file1) 
-	    or die "No file $file1: $!";
-	my $st_new = stat($fileout) 
-	    or die "No file $fileout: $!";
-	die ("Signed file is smaller than unsigned file") 
-	    unless ($st_new->size > $st_old->size);
-	move("$fileout", "$file2") 
-	    or die "Move $fileout to $file2 failed: $!";
-	chmod $stats->mode, $file2;
-	chown $stats->uid, $stats->gid, $file2;
-	flock(LOCKFILE, LOCK_UN);
-    }
-
-    if ($flag1 == 1) {
-	unlink0( $fh1, $filename1 ) or die "Cannot unlink $filename1 safely";
-    }
-    if ($return_from_sign == 1) {
-	return;
-    }
-    exit;
-}
-
-Getopt::Long::Configure ("posix_default");
-Getopt::Long::Configure ("bundling");
-# Getopt::Long::Configure ("debug");
-
-GetOptions (\%opts, 'm=s', 'h|help', 'v|verbose', 'l|list',
-	    'c|cfgfile=s',
-	    'd|datafile=s',
-	    'p|passphrase=s',
-	    's|secretkey=s',
-            'k|keyid=s',
-	    'create-cfgfile',  # -m F
-	    'print-cfgfile',   # -m f
-	    'create-datafile', # -m D
-	    'print-datafile',  # -m d
-	    'remove-signature',# -m R
-	    'sign',            # -m E
-	    'examine',         # -m e
-	    'generate-keys');  # -m G
-
-if (defined ($opts{'h'})) {
-    usage();
-    exit;
-}
-
-if (defined($opts{'k'})) {
-    $KEYID = $opts{'k'};
-}
-if (defined($opts{'c'})) {
-    $cfgfile = $opts{'c'};
-}
-if (defined($opts{'d'})) {
-    $datafile = $opts{'d'};
-}
-if (defined($opts{'p'})) {
-    $passphrase = $opts{'p'};
-}
-if (defined($opts{'s'})) {
-    $SIGDIR = $opts{'s'};
-}
-
-if (defined ($opts{'m'}) && ($opts{'m'} =~ /[FfDdREeG]{1}/) ) {
-    $action = $opts{'m'};
-}
-elsif (defined ($opts{'create-cfgfile'})) {
-    $action = 'F';
-}
-elsif (defined ($opts{'print-cfgfile'})) {
-    $action = 'f';
-}
-elsif (defined ($opts{'create-datafile'})) {
-    $action = 'D';
-}
-elsif (defined ($opts{'print-datafile'})) {
-    $action = 'd';
-}
-elsif (defined ($opts{'remove-signature'})) {
-    $action = 'R';
-}
-elsif (defined ($opts{'sign'})) {
-    $action = 'E';
-}
-elsif (defined ($opts{'examine'})) {
-    $action = 'e';
-}
-elsif (defined ($opts{'generate-keys'})) {
-    $action = 'G';
-}
-else {
-    usage();
-    die ("No valid action specified !");
-}
-
-if (defined($ARGV[0])) {
-    $file1 = $ARGV[0];
-} 
-if (defined($ARGV[1])) {
-    $file2 = $ARGV[1];
-} 
-
-
-if (($action =~ /[REe]{1}/) && !defined($file1)) {
-    usage();
-    die("Option -m $action requires a filename (or '-' for stdio)\n");
-}
-
-if ($action =~ /^F$/) {
-    if (!defined($file1)) {
-	$file1 = $cfgfile;
-    }
-    $file2 = $cfgfile;
-    sign_file ();
-}
-
-if ($action =~ /^D$/) {
-    if (!defined($file1)) {
-	$file1 = $datafile;
-    }
-    $file2 = $datafile;
-    sign_file ();
-}
-
-if ($action =~ /^R$/) {
-    # $file1 defined
-    my $i = 0;
-    while (defined($ARGV[$i])) {
-	$file1 = $ARGV[$i];
-	remove ();
-	++$i;
-    }
-}
-
-if ($action =~ /^E$/) {
-    # $file1 defined
-    # default: $file2 = $file1
-    check_signify_sign();
-    my $i = 0;
-    while (defined($ARGV[$i])) {
-	$file1 = $ARGV[$i];
-	$file2 = $file1;
-	$return_from_sign = 1;
-	sign_file ();
-	++$i;
-    }
-}
-
-if ($action =~ /^e$/) {
-    # $file1 defined
-    # default: $file2 = stdout
-    check_signify_verify();
-    my $i = 0;
-    my $ret = 0;
-    while (defined($ARGV[$i])) {
-	print "\n";
-	$file1 = $ARGV[$i];
-	$ret += examine ();
-	++$i;
-	print "\n--------------------------------\n" if (defined($ARGV[$i]));
-    }
-    exit($ret);
-}
-
-if ($action =~ /^f$/) {
-    $file1 = $cfgfile;
-    $file2 = "-";
-    print_cfgfile ();
-}
-
-if ($action =~ /^d$/) {
-    # $file1 irrelevant
-    if (defined($opts{'l'})) {
-	print_datafile ();
-    } else {
-	$file1 = $datafile;
-	$file2 = "-";
-	print_cfgfile ();
-    }
-}
-
-
-
Index: trunk/scripts/samhainadmin.pl.in
===================================================================
--- trunk/scripts/samhainadmin.pl.in	(revision 1)
+++ trunk/scripts/samhainadmin.pl.in	(revision 1)
@@ -0,0 +1,612 @@
+#! /usr/bin/perl
+
+# Copyright Rainer Wichmann (2004)
+#
+# 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.
+#
+
+use warnings;
+use strict;
+use Getopt::Long;
+use File::Basename;
+use File::stat;
+use File::Temp qw/ tempfile tempdir unlink0 /;
+use IO::Handle;
+
+File::Temp->safe_level( File::Temp::HIGH );
+
+my %opts = ();
+my $action;
+my $file1;
+my $file2;
+my $passphrase;
+my $return_from_sign = 0;
+my $no_print_examine = 0;
+my $base = basename($0);
+
+my $cfgfile  = "@myconffile@";
+my $datafile = "@mydatafile@";
+my $daemon   = "@sbindir@/@install_name@";
+my $gpg      = "@mygpg@";
+
+$gpg = "gpg" if ($gpg eq "");
+
+sub usage() {
+    print "Usage:\n";
+    print "  $base { -m F | --create-cfgfile }    [options] [in.cfgfile]\n";
+    print "    Sign the configuration file. If in.cfgfile is given, sign it\n";
+    print "    and install it as configuration file.\n\n";
+
+    print "  $base { -m f | --print-cfgfile }     [options] \n";
+    print "    Print the configuration file to stdout. Signatures are removed.\n\n";
+
+    print "  $base { -m D | --create-datafile }   [options] [in.datafile]\n";
+    print "    Sign the database file. If in.datafile is given, sign it\n";
+    print "    and install it as database file.\n\n";
+
+    print "  $base { -m d | --print-datafile }    [options] \n";
+    print "    Print the database file to stdout. Signatures are removed. Use\n";
+    print "    option --list to list files in database rather than printing the raw file.\n\n";
+
+    print "  $base { -m R | --remove-signature }  [options] file1 [file2 ...]\n";
+    print "    Remove cleartext signature from input file(s). The file\n";
+    print "    is replaced by the non-signed file.\n\n";
+
+    print "  $base { -m E | --sign }              [options] file1 [file2 ...]\n";
+    print "    Sign file(s) with a cleartext signature. The file\n";
+    print "    is replaced by the signed file.\n\n";
+
+    print "  $base { -m e | --examine }           [options] file1 [file2 ...]\n";
+    print "    Report signature status of file(s).\n\n";
+
+    print "  $base { -m G | --generate-keys }     [options] \n";
+    print "    Generate a PGP keypair to use for signing.\n\n";
+
+    print "Options:\n";
+    print "  -c cfgfile    --cfgfile cfgfile\n";
+    print "    Select an alternate configuration file.\n\n";
+
+    print "  -d datafile   --datafile datafile\n";
+    print "    Select an alternate database file.\n\n";
+
+    print "  -p passphrase --passphrase passphrase\n";
+    print "    Set the passphrase for gpg. By default, gpg will ask.\n\n";
+
+    print "  -l            --list\n";
+    print "    List the files in database rather than printing the raw file.\n\n";
+
+    print "  -v            --verbose\n";
+    print "    Verbose output.\n\n";
+    return;
+}
+
+sub check_gpg_uid () {
+    if (0 != $>) {
+	print "--------------------------------------------------\n";
+	print "\n";
+	print " You are not root. Please remember that samhain/yule\n";
+	print " will use the public keyring of root to verify a signature.\n";
+	print "\n";
+	print "--------------------------------------------------\n";
+    } else {
+	if (!("@yulectl_prg@" =~ //)) {
+	    print "--------------------------------------------------\n";
+	    print "\n";
+	    print " Please remember that yule will drop root after startup. Signature\n";
+	    print " verification on SIGHUP will fail if you do not import the public key\n";
+	    print " into the keyring of the non-root yule user.\n";
+	    print "\n";
+	    print "--------------------------------------------------\n";
+	}
+    }
+}
+    
+sub check_gpg_sign () {
+    if ( (!-d "$ENV{'HOME'}/.gnupg") || (!-e "$ENV{'HOME'}/.gnupg/secring.gpg")) {
+	print "--------------------------------------------------\n";
+	print "\n";
+	if (!-d "$ENV{'HOME'}/.gnupg") {
+	    print " Directory \$HOME/.gnupg not found!\n";
+	} else {
+	    print " Secret keyring \$HOME/.gnupg/secring.gpg not found!\n";
+	}
+	print "\n";
+	print " This indicates that you have never created a \n";
+	print " public/private keypair, and thus cannot sign.\n";
+	print " \n";
+	print " Please use $0 --generate-keys or gpg --gen-key\n";
+	print " to generate a public/private keypair first.\n";
+	print "\n";
+	print "--------------------------------------------------\n";
+	print "\n";
+	exit;
+    }
+}
+
+sub check_gpg_verify () {
+    if ( (!-d "$ENV{'HOME'}/.gnupg") || (!-e "$ENV{'HOME'}/.gnupg/pubring.gpg")) {
+	print "--------------------------------------------------\n";
+	print "\n";
+	if (!-d "$ENV{'HOME'}/.gnupg") {
+	    print " Directory \$HOME/.gnupg not found!\n";
+	} else {
+	    print " Public keyring \$HOME/.gnupg/pubring.gpg not found!\n";
+	}
+	print "\n";
+	print " This indicates that you have never used gpg before \n";
+	print " and/or have no public keys to verify signatures.\n";
+	print " \n";
+	print " Please use 'gpg --export key_id' to export the public\n";
+	print " signing key of the user who is signing the\n";
+	print " configuration/database files.\n\n";
+	print " Then you can use 'gpg --import keyfile' to import the key\n";
+	print " into this user's public keyring.\n";
+	print "\n";
+	print "--------------------------------------------------\n";
+	print "\n";
+	exit;
+    }
+}
+
+
+sub generate () {
+    my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --gen-key";
+    check_gpg_uid();
+    system ($command) == 0 
+	or die "system $command failed: $?";
+    exit;
+}
+
+sub examine () {
+    my $iscfg = 0;
+    my $have_fp  = 0;
+    my $have_sig = 0;
+    my $message = '';
+    my $retval  = 9;
+    my $fh;
+    my $filename;
+
+    if (!($file1 =~ /^\-$/)) {
+	die ("Cannot open $file1 for read: $!") unless ((-e $file1) && (-r _));
+    }
+    open FIN,  "<$file1" or die "Cannot open $file1 for read: $!";
+
+    my $dir = tempdir( CLEANUP => 1 );
+    $filename = $dir . "/exa_jhfdbilw";
+    open $fh, ">$filename" or die "Cannot open $filename";
+    autoflush $fh 1;
+
+    while (<FIN>) {
+	print $fh $_;
+	if ($_ =~ /^\s*\[Misc\]/) {
+	    $iscfg = 1;
+	}
+    }
+    if ($iscfg == 1) {
+	$message .=  "File $file1 is a configuration file\n\n";
+    } else {
+	$message .=  "File $file1 is a database file\n\n";
+    }
+
+
+    my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --status-fd 1 ";
+    $command .= "--verbose " if (defined($opts{'v'}));
+    $command .= "--verify $filename ";
+    if (defined($opts{'v'})) {
+	$command .= "2>&1";
+    } else {
+	$command .= "2>/dev/null";
+    }
+
+    print STDOUT "Using: $command\n\n" if (defined($opts{'v'}));
+    open  GPGIN, "$command |" or die "Cannot fork: $!";
+
+    while (<GPGIN>) {
+	if ($_ =~ /^\[GNUPG:\] GOODSIG ([0-9A-F]+) (.*)$/) {
+	    $message .= "GOOD signature with key: $1\n";
+	    $message .= "Key owner:               $2\n";
+	    $have_sig = 1;
+	    $retval   = 0;
+	}
+	if ($_ =~ /^\[GNUPG:\] VALIDSIG ([0-9A-F]+) ([0-9\-]+)\s/) {
+	    $message .= "Key fingerprint:         $1\n";
+	    $message .= "Signature generated on:  $2\n\n";
+	    $have_fp = 1;
+	    $message .=  "This file is signed with a valid signature.\n" 
+		if ($have_sig == 1);
+	    $have_sig = 1;
+	    $have_fp = 1;
+	}
+	if ($_ =~ /^\[GNUPG:\] NODATA 1/) {
+	    $message .=  "NO signature found.\n\n";
+	    $message .=  "This file is not signed !!!\n";
+	    $have_sig = 1;
+	    $have_fp = 1;
+	    $retval  = 2;
+	}
+	if ($_ =~ /^\[GNUPG:\] BADSIG ([0-9A-F]+) (.*)$/) {
+	    $message .=  "BAD signature with key: $1\n";
+	    $message .=  "Key owner:              $2\n\n";
+	    $message .=  "This file is signed with an invalid signature !!!\n";
+	    $have_sig = 1;
+	    $have_fp = 1;
+	    $retval = 1;
+	}
+	if ($_ =~ /^\[GNUPG:\] NO_PUBKEY ([0-9A-F]+)/) {
+	    $message .=  "NOT CHECKED signature with key: $1\n\n";
+	    $message .=  "The signature of this file cannot be checked: no public key available !!!\n";
+	    $have_sig = 1;
+	    $have_fp = 1;
+	    $retval  = 1;
+	}
+	print STDOUT $_ if (defined($opts{'v'}));
+    }
+    close (GPGIN);
+    print STDOUT "\n" if (defined($opts{'v'}));
+    if ($have_sig == 0) {
+	$message .=  "NO valid signature found\n";
+    } 
+    elsif ($have_fp == 0) {
+	$message .=  "NO fingerprint found\n";
+    }
+    close (FIN);
+    if ($no_print_examine == 0) {
+	print STDOUT $message;
+    }
+    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
+    return $retval;
+}
+
+sub remove () {
+    my $bodystart = 1;
+    my $sigstart  = 0;
+    my $sigend    = 0;
+    my $filename  = "";
+    my $fh;
+    my $stats;
+
+    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
+    if (!($file1 =~ /^\-$/)) {
+	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
+	$filename = $dir . "/rem_iqegBCQb";
+	open $fh, ">$filename" or die "Cannot open $filename";
+	$stats = stat($file1);
+	# ($fh, $filename) = tempfile(UNLINK => 1);
+    } else {
+	open $fh, ">$file1" or die "Cannot open file $file1 for write: $!";
+    }
+    autoflush $fh 1;
+    while (<FH>) {
+	if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
+	    $sigstart = 1;
+	    $bodystart = 0;
+	    next;
+	} elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
+	    $sigstart = 0;
+	    $bodystart = 1;
+	    next;
+	} elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
+	    $bodystart = 0;
+	    $sigend = 1;
+	    next;
+	} elsif (($sigend == 1) && ($_ =~ /^-----END PGP SIGNATURE-----/)) {
+	    $sigend = 0;
+	    $bodystart = 1;
+	    next;
+	}
+	if ($bodystart == 1) {
+	    print $fh $_;
+	}
+    }
+    if (!($file1 =~ /^\-$/)) {
+	my $command = "cp $filename $file1";
+	system ($command) == 0
+	    or die "system $command failed: $?";
+	chmod $stats->mode, $file1;
+	chown $stats->uid, $stats->gid, $file1;
+    }
+    unlink0( $fh, $filename ) or die "Cannot unlink $filename safely";
+    return;
+}
+
+sub print_cfgfile () {
+    my $bodystart = 0;
+    my $sigstart  = 0;
+
+    if (!defined($file2)) {
+	$file2 = '-';
+    }
+
+    open FH, "<$file1" or die "Cannot open file $file1 for read: $!";
+    open FO, ">$file2" or die "Cannot open file $file2 for write: $!";
+    while (<FH>) {
+	if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
+	    $sigstart = 1;
+	    next;
+	} elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
+	    $sigstart = 0;
+	    $bodystart = 1;
+	    next;
+	} elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
+	    $bodystart = 0;
+	    exit;
+	}
+	if ($bodystart == 1) {
+	    print FO $_;
+	}
+    }
+    exit;
+}
+sub print_datafile () {
+    die ("Cannot find program $daemon") 
+	unless (-e $daemon);
+    if (defined($opts{'v'})) {
+	open FH, "$daemon --full-detail -d $datafile |" 
+	    or die "Cannot open datafile $datafile for read: $!";
+    } else {
+	open FH, "$daemon -d $datafile |" 
+	    or die "Cannot open datafile $datafile for read: $!";
+    }
+    while (<FH>) {
+	print $_;
+    }
+    exit;
+}
+
+sub sign_file () {
+
+    my $fileout = '';
+    my $bodystart = 1;
+    my $sigstart  = 0;
+    my $sigend    = 0;
+    my $stats;
+    my $fh1;
+    my $filename1;
+    my $flag1     = 0;
+
+    check_gpg_uid();
+
+    if (!defined($file2)) {
+	$file2 = $file1;
+    }
+
+    if ($file1 =~ /^\-$/) {
+	my $dir = tempdir( CLEANUP => 1 ) or die "Tempdir failed";
+	$filename1 = $dir . "/sig_vs8827sd";
+	open $fh1, ">$filename1" or die "Cannot open $filename1";
+	$flag1 = 1;
+	# my ($fh1, $filename1) = tempfile(UNLINK => 1);
+
+	while (<STDIN>) {
+	  if ($_ =~ /^-----BEGIN PGP SIGNED MESSAGE-----/) {
+	    $sigstart = 1;
+	    $bodystart = 0;
+	    next;
+	  } elsif (($sigstart == 1) && ($_ =~ /^\s+$/)) {
+	    $sigstart = 0;
+	    $bodystart = 1;
+	    next;
+	  } elsif ($_ =~ /^-----BEGIN PGP SIGNATURE-----/) {
+	    $bodystart = 0;
+	    $sigend = 1;
+	    next;
+	  } elsif (($sigend == 1) && ($_ =~ /^-----END PGP SIGNATURE-----/)) {
+	    $sigend = 0;
+	    $bodystart = 1;
+	    next;
+	  }
+	  if ($bodystart == 1) {
+	    print $fh1 $_;
+	  }
+	  #
+	  # print $fh1 $_;
+	  #
+	}
+	$file1 = $filename1;
+	$fileout = '-';
+    } else {
+	$no_print_examine = 1;
+	if (examine() < 2) {
+	    remove();
+	}
+	$fileout = $file1 . ".asc";
+	$stats   = stat($file1);
+    }
+
+    if (defined($passphrase)) {
+	local $SIG{PIPE} = 'IGNORE';
+	my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg --passphrase-fd 0 -a --clearsign -o $fileout --not-dash-escaped $file1";
+	open (FH, "|$command")  or die "can't fork: $!";
+	print FH "$passphrase"  or die "can't write: $!";
+	close FH                or die "can't close: status=$?";
+    } else {
+	my $command = "$gpg --homedir $ENV{'HOME'}/.gnupg                   -a --clearsign -o $fileout --not-dash-escaped $file1";
+	system("$command") == 0 
+	    or die "system $command failed: $?";
+    }
+
+    if (!($fileout =~ /^\-$/)) {
+	my $st_old = stat($file1) 
+	    or die "No file $file1: $!";
+	my $st_new = stat($fileout) 
+	    or die "No file $fileout: $!";
+	die ("Signed file is smaller than unsigned file") 
+	    unless ($st_new->size > $st_old->size);
+	system ("mv $fileout $file2") == 0
+	    or die "system mv $fileout $file2 failed: $?";
+	chmod $stats->mode, $file2;
+	chown $stats->uid, $stats->gid, $file2;
+    }
+
+    if ($flag1 == 1) {
+	unlink0( $fh1, $filename1 ) or die "Cannot unlink $filename1 safely";
+    }
+    if ($return_from_sign == 1) {
+	return;
+    }
+    exit;
+}
+
+Getopt::Long::Configure ("posix_default");
+Getopt::Long::Configure ("bundling");
+# Getopt::Long::Configure ("debug");
+
+GetOptions (\%opts, 'm=s', 'h|help', 'v|verbose', 'l|list',
+	    'c|cfgfile=s',
+	    'd|datafile=s',
+	    'p|passphrase=s',
+	    'create-cfgfile',  # -m F
+	    'print-cfgfile',   # -m f
+	    'create-datafile', # -m D
+	    'print-datafile',  # -m d
+	    'remove-signature',# -m R
+	    'sign',            # -m E
+	    'examine',         # -m e
+	    'generate-keys');  # -m G
+
+if (defined ($opts{'h'})) {
+    usage();
+    exit;
+}
+
+if (defined($opts{'c'})) {
+    $cfgfile = $opts{'c'};
+}
+if (defined($opts{'d'})) {
+    $datafile = $opts{'d'};
+}
+if (defined($opts{'p'})) {
+    $passphrase = $opts{'p'};
+}
+
+if (defined ($opts{'m'}) && ($opts{'m'} =~ /[FfDdREeG]{1}/) ) {
+    $action = $opts{'m'};
+}
+elsif (defined ($opts{'create-cfgfile'})) {
+    $action = 'F';
+}
+elsif (defined ($opts{'print-cfgfile'})) {
+    $action = 'f';
+}
+elsif (defined ($opts{'create-cfgfile'})) {
+    $action = 'D';
+}
+elsif (defined ($opts{'print-cfgfile'})) {
+    $action = 'd';
+}
+elsif (defined ($opts{'remove-signature'})) {
+    $action = 'R';
+}
+elsif (defined ($opts{'sign'})) {
+    $action = 'E';
+}
+elsif (defined ($opts{'examine'})) {
+    $action = 'e';
+}
+elsif (defined ($opts{'generate-keys'})) {
+    $action = 'G';
+}
+else {
+    usage();
+    die ("No valid action specified !");
+}
+
+if (defined($ARGV[0])) {
+    $file1 = $ARGV[0];
+} 
+if (defined($ARGV[1])) {
+    $file2 = $ARGV[1];
+} 
+
+
+if (($action =~ /[REe]{1}/) && !defined($file1)) {
+    usage();
+    die("Option -m $action requires a filename (or '-' for stdio)\n");
+}
+
+if ($action =~ /^F$/) {
+    if (!defined($file1)) {
+	$file1 = $cfgfile;
+    }
+    $file2 = $cfgfile;
+    sign_file ();
+}
+
+if ($action =~ /^D$/) {
+    if (!defined($file1)) {
+	$file1 = $datafile;
+    }
+    $file2 = $datafile;
+    sign_file ();
+}
+
+if ($action =~ /^R$/) {
+    # $file1 defined
+    my $i = 0;
+    while (defined($ARGV[$i])) {
+	$file1 = $ARGV[$i];
+	remove ();
+	++$i;
+    }
+}
+
+if ($action =~ /^E$/) {
+    # $file1 defined
+    # default: $file2 = $file1
+    check_gpg_sign();
+    my $i = 0;
+    while (defined($ARGV[$i])) {
+	$file1 = $ARGV[$i];
+	$file2 = $file1;
+	$return_from_sign = 1;
+	sign_file ();
+	++$i;
+    }
+}
+
+if ($action =~ /^e$/) {
+    # $file1 defined
+    # default: $file2 = stdout
+    check_gpg_verify();
+    my $i = 0;
+    while (defined($ARGV[$i])) {
+	print "\n";
+	$file1 = $ARGV[$i];
+	examine ();
+	++$i;
+	print "\n--------------------------------\n" if (defined($ARGV[$i]));
+    }
+}
+
+if ($action =~ /^f$/) {
+    $file1 = $cfgfile;
+    $file2 = "-";
+    print_cfgfile ();
+}
+
+if ($action =~ /^d$/) {
+    # $file1 irrelevant
+    if (defined($opts{'l'})) {
+	print_datafile ();
+    } else {
+	$file1 = $datafile;
+	$file2 = "-";
+	print_cfgfile ();
+    }
+}
+
+
+
Index: trunk/scripts/samhainrc_update.sh
===================================================================
--- trunk/scripts/samhainrc_update.sh	(revision 1)
+++ trunk/scripts/samhainrc_update.sh	(revision 1)
@@ -0,0 +1,227 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------- 
+# @brief: update the kernel options in the samhain configuration
+#         file, after a new kernel has been compiled
+# @author: marc heisterkamp <marzheister@web.de>
+# ----------------------------------------------------------------------------- 
+
+SAMHAIN_CFG="/etc/samhainrc"
+
+BLUE="[34;01m"
+CYAN="[36;01m"
+GREEN="[32;01m"
+DARK_GREEN="[32m"
+RED="[31;01m"
+PURPLE="[35;01m"
+WHITE="[37;01m"
+DARK_GRAY="[30;01m"
+LIGHT_GRAY="[37m"
+YELLOW="[33;01m"
+BROWN="[33m"
+OFF="[0m"
+
+
+SYSTEM_MAP=""
+new_cfg=''
+scriptname="$0"
+
+# global variables for system adresses (extracted from System.map)
+SYS_CALL=''
+SYS_CALL_TABLE=''
+PROC_ROOT=''
+PROC_ROOT_IOPS=''
+PROC_ROOT_LOOKUP=''
+
+# Make sure the user has root permissions
+if [ $UID -ne 0 ] ; then
+  echo "You must be root to run this script. Exiting."
+  exit 1
+fi
+
+
+#------------------------------------------------------------------------------
+# usage 
+#------------------------------------------------------------------------------
+function print_usage() {
+
+  cat >&2 <<EOHELP
+
+  update the samhainrc configuration file with new kernel system addresses
+  (i.e: after kernel compilation) by extracting these from the new System.map 
+  file
+
+  SYNOPSIS
+     $scriptname [ ${GREEN}--help${OFF} ]
+                           [ ${GREEN}--nocolor${OFF} ]
+                           [ ${GREEN}--print-only${OFF} ] <System.map>
+                           [ ${GREEN}--update${OFF} ]     <System.map>
+
+  OPTIONS
+     ${GREEN}-h${OFF} ${GREEN}--help${OFF}
+        Show help. 
+
+     ${GREEN}--nocolor${OFF}
+        Disable color hilighting for non ANSI-compatible terms.
+
+     ${GREEN}-p${OFF} ${GREEN}--print-only${OFF} <System.map>
+        Print the extracted system adresses and do not write them to the 
+        samhain configuration file. 
+
+     ${GREEN}-u${OFF} ${GREEN}--update${OFF} <System.map>
+        Update the samhainrc configuration file with new kernel system
+        addresses from the given System.map file 
+
+EOHELP
+ exit 0
+}
+
+
+#------------------------------------------------------------------------------
+# parses the command line options 
+# param in: all parameters given to the script 
+#------------------------------------------------------------------------------
+function parse_cmd_line() {
+
+  # parse the command-line
+  while [ -n "$1" ]; do
+    case "$1" in
+      --help|-h) 
+        print_usage
+        ;;
+      --nocolor|-n)
+        unset DARK_GREEN GREEN RED BROWN LIGHT_GRAY WHITE OFF 
+        ;;
+      --print-only|-p)
+        shift
+        SYSTEM_MAP="$1"
+        get_system_addresses
+        print_system_addresses
+        break
+        ;;
+      --update|-u)
+        shift
+        SYSTEM_MAP="$1"
+        get_system_addresses
+        print_system_addresses
+        replace_system_addresses
+        ;;
+      -*)
+        echo "$scriptname: unknown option $1. Exiting" >&2
+        exit 1
+        ;;
+    esac
+    shift
+  done
+}
+
+
+#------------------------------------------------------------------------------
+# extract system adresses from given System.map file and save to global
+# variables 
+#------------------------------------------------------------------------------
+function get_system_addresses() { 
+
+  if [ -z "$SYSTEM_MAP" ] ; then
+    echo
+    echo "No System.map specified. Exiting" >&2
+    echo
+    exit 1
+  fi
+
+  if [ ! -f "$SYSTEM_MAP" ] ; then
+    echo
+    echo "Could not find System.map: $SYSTEM_MAP. Exiting" >&2
+    echo
+    exit 1
+  fi
+
+  # 1. this is the address of system_call (grep system_call System.map) 
+  #    KernelSystemCall = 0xc0106cf8
+  SYS_CALL="0x`grep system_call $SYSTEM_MAP | cut -d' ' -f1`"
+
+  # 2. this is the address of sys_call_table (grep ' sys_call_table' System.map) 
+  #    KernelSyscallTable = 0xc01efb98
+  SYS_CALL_TABLE="0x`grep sys_call_table $SYSTEM_MAP | cut -d' ' -f1`"
+
+  # 3. this is the address of proc_root (grep ' proc_root$' System.map) 
+  #    KernelProcRoot = 0xc01efb98
+  PROC_ROOT="0x`grep ' proc_root$' $SYSTEM_MAP | cut -d' ' -f1`"
+
+  # 4. this is the address of proc_root_inode_operations 
+  #    (grep proc_root_inode_operations System.map) 
+  #    KernelProcRootIops = 0xc01efb98
+  PROC_ROOT_IOPS="0x`grep proc_root_inode_operations $SYSTEM_MAP | cut -d' ' -f1`"
+
+  # 5. this is the address of proc_root_lookup
+  #    (grep proc_root_lookup System.map) 
+  #    KernelProcRootLookup = 0xc01efb98
+  PROC_ROOT_LOOKUP="0x`grep proc_root_lookup $SYSTEM_MAP | cut -d' ' -f1`"
+}
+
+
+#------------------------------------------------------------------------------
+# extract system adresses from given System.map file and save to global
+# variables 
+#------------------------------------------------------------------------------
+function replace_system_addresses() { 
+
+  if [ -z "$SAMHAIN_CFG" ] ; then
+    echo "Could not find your samhainrc config file: $SAMHAIN_CFG. Exiting" >&2
+    exit 1
+  fi
+
+  echo
+  echo "Replacing current kernel system addresses in: $SAMHAIN_CFG"
+
+  # 1. replace current 'KernelSystemCall' setting
+  new_cfg=`sed -e "s/^\(KernelSystemCall[[:blank:]]*=\)[[:blank:]]*\(.*\)/\1 ${SYS_CALL}/" $SAMHAIN_CFG` 
+
+  # 2. replace current 'KernelSyscallTable' setting
+  new_cfg=`echo "$new_cfg" | sed -e "s/^\(KernelSyscallTable[[:blank:]]*=\)[[:blank:]]*\(.*\)/\1 ${SYS_CALL_TABLE}/"` 
+
+  # 3. replace current 'KernelProcRoot' setting
+  new_cfg=`echo "$new_cfg" | sed -e "s/^\(KernelProcRoot[[:blank:]]*=\)[[:blank:]]*\(.*\)/\1 ${PROC_ROOT}/"` 
+
+  # 4. replace current 'KernelProcRootIops' setting
+  new_cfg=`echo "$new_cfg" | sed -e "s/^\(KernelProcRootIops[[:blank:]]*=\)[[:blank:]]*\(.*\)/\1 ${PROC_ROOT_IOPS}/"` 
+
+  # 5. replace current 'KernelSystemCall' setting
+  new_cfg=`echo "$new_cfg" | sed -e "s/^\(KernelProcRootLookup[[:blank:]]*=\)[[:blank:]]*\(.*\)/\1 ${PROC_ROOT_LOOKUP}/"` 
+
+  echo "Backup old samhainrc $SAMHAIN_CFG to $SAMHAIN_CFG.bak"
+
+  # backup old samhainrc config file 
+  mv "$SAMHAIN_CFG" "$SAMHAIN_CFG.bak"
+
+  # write new samhainrc config file 
+  echo "$new_cfg" > "$SAMHAIN_CFG"
+
+  echo "Successfully updated kernel system addresses."
+  echo
+}
+
+
+#------------------------------------------------------------------------------
+# print samhain required system adresses 
+#------------------------------------------------------------------------------
+function print_system_addresses() {
+
+  echo 
+  echo "your kernel system addresses from: `basename $SYSTEM_MAP`"
+  echo 
+  echo "  KernelSystemCall     = $SYS_CALL"
+  echo "  KernelSyscallTable   = $SYS_CALL_TABLE"
+  echo "  KernelProcRoot       = $PROC_ROOT"
+  echo "  KernelProcRootIops   = $PROC_ROOT_IOPS"
+  echo "  KernelProcRootLookup = $PROC_ROOT_LOOKUP"
+  echo 
+
+}
+
+if [ $# -eq 0 ] ; then
+  print_usage
+fi
+
+parse_cmd_line $*
+
+exit 0
Index: trunk/scripts/yuleadmin.pl.in
===================================================================
--- trunk/scripts/yuleadmin.pl.in	(revision 591)
+++ 	(revision )
@@ -1,303 +1,0 @@
-#! /usr/bin/perl
-
-# Copyright (c) 2007 Riccardo Murri <riccardo.murri@gmail.com>
-#
-# 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.
-#
-
-use warnings;
-use strict;
-use Getopt::Long;
-use File::Basename;
-use File::Copy;
-use File::Temp qw/ tempfile /;
-use IO::File;
-
-# Do I/O to the data file in binary mode (so it 
-# wouldn't complain about invalid UTF-8 characters).
-use bytes;
-
-File::Temp->safe_level( File::Temp::HIGH );
-
-my %opts = ();
-my $outfile;
-my $verbose;
-my $base = basename($0);
-
-my $cfgfile  = "@myconffile@";
-my $yule     = "@sbindir@/@install_name@";
-
-$cfgfile  =~ s/^REQ_FROM_SERVER//;
-
-sub usage() {
-    print <<__END_OF_TEXT__
-Usage:
-  $base { -a | --add } [options] HOSTNAME [PASSWORD]
-    Add client HOSTNAME to configuration file. If PASSWORD is
-    omitted, it is read from stdin.  If HOSTNAME already exists
-    in the configuration file, an error is given.
-
-  $base { -d | --delete } [options] HOSTNAME
-    Remove client HOSTNAME from configuration file.
-
-  $base { -l | --list } [options]
-    List clients in the yule configuration file.
-
-  $base { -r | --replace } [options] HOSTNAME [PASSWORD]
-    Replace password of existing client HOSTNAME in configuration file. 
-    If PASSWORD is omitted, it is read from stdin.  If HOSTNAME does not 
-    already exist in the configuration file, an error is given.
-
-  $base { -u | --update } [options] HOSTNAME [PASSWORD]
-    Add client HOSTNAME to config file or replace its password with a new one.
-    If PASSWORD is omitted, it is read from stdin.  
-
-Options:
-  -c CFGFILE    --cfgfile CFGFILE
-    Select an alternate configuration file. (default: $cfgfile)
-
-  -o OUTFILE    --output OUTFILE
-    Write modified configuration to OUTFILE.  If this option is
-    omitted, $base will rename the original configuration file
-    to '$cfgfile.BAK' and overwrite it with the modified content.
-
-  -Y YULECMD    --yule YULECMD
-    Use command YULECMD to generate the client key from the password.
-    (default: $yule)
-
-  -v            --verbose
-    Verbose output.
-
-__END_OF_TEXT__
-;
-    return;
-}
-
-
-## subroutines
-
-sub read_clients ($) {
-    my $cfgfile = shift || '-';
-    my %clients;
-
-    open INPUT, "<$cfgfile"
-	or die ("Cannot read configuration file '$cfgfile'. Aborting");
-
-    my $section;
-    while (<INPUT>) {
-	# skip comment and blank lines
-	next if m{^\s*#};
-        next if m{^\s*$};
-
-	# match section headers
-	$section = $1 if m{^\s*\[([a-z0-9 ]+)\]}i;
-
-	# ok, list matching lines
-	if ($section =~ m/Clients/) {
-	    if (m{^\s*Client=}i) {
-		chomp;
-		s{^\s*Client=}{}i;
-		my ($client, $key) = split /@/,$_,2;
-
-		$clients{lc($client)} = $key;
-	    }
-	}
-    }
-    
-    close INPUT;
-    return \%clients;
-}
-
-
-sub write_clients ($$$) {
-    my $cfgfile_in = shift || '-';
-    my $cfgfile_out = shift || $cfgfile_in;
-    my $clients = shift;
-
-    my @lines;
-    my $in_clients_section;
-
-    # copy-pass input file
-    my $section = '';
-    open INPUT, "<$cfgfile_in"
-	or die ("Cannot read configuration file '$cfgfile_in'. Aborting");
-    while (<INPUT>) {
-	# match section headers
-	if (m{^\s*\[([a-z0-9 ]+)\]}i) {
-	    if ($in_clients_section and ($section ne $1)) {
-		# exiting [Clients] section, output remaining ones
-		foreach my $hostname (keys %{$clients}) {
-		    push @lines, 
-		        'Client=' . $hostname . '@' 
-			. $clients->{lc($hostname)} . "\n";
-		    delete $clients->{lc($hostname)};
-		}
-	    }
-	    # update section title
-	    $section = $1;
-	    if ($section =~ m/Clients/i) {
-		$in_clients_section = 1;
-	    } else {
-		$in_clients_section = 0;
-	    }
-	}
-
-	# process entries in [Clients] section
-	if ($in_clients_section) {
-	    if (m{^\s*Client=}i) {
-		my ($hostname, undef) = split /@/,$_,2;
-		$hostname =~ s{^\s*Client=}{}i;
-		if (defined($clients->{lc($hostname)})) {
-		    # output (possibly) modified key
-		    $_ = 'Client=' . $hostname . '@' . $clients->{lc($hostname)} . "\n";
-		    delete $clients->{lc($hostname)};
-		}
-		else {
-		    # client deleted, skip this line from output
-		    $_ = '';
-		}
-	    }
-	}
-
-	# copy input to output
-	push @lines, $_;
-    }
-    close INPUT;
-    
-    # if end-of-file reached within [Clients] section, output remaining ones
-    if ($in_clients_section) {
-	foreach my $hostname (keys %{$clients}) {
-	    push @lines, 'Client=' . $hostname . '@' 
-		. $clients->{lc($hostname)} . "\n";
-	}
-    }
-
-    # if necessary, replace input file with output file
-    if ($cfgfile_in eq $cfgfile_out) {
-	copy($cfgfile_in, $cfgfile_in . '.BAK')
-	    or die("Cannot backup config file '$cfgfile_in'. Aborting");
-    }
-    open OUTPUT, ">$cfgfile_out"
-	or die ("Cannot write to file '$cfgfile_out'. Aborting");
-    # overwrite config file line by line
-    foreach my $line (@lines) { print OUTPUT $line; }
-    close OUTPUT;
-}
-
-
-sub new_client_key ($) {
-    my $password = shift;
-    my $yulecmd = shift || $yule;
-
-    my (undef, $key) = split /@/, `$yulecmd -P $password`, 2;
-    chomp $key;
-    return $key;
-}
-
-
-## main
-
-Getopt::Long::Configure ("posix_default");
-Getopt::Long::Configure ("bundling");
-# Getopt::Long::Configure ("debug");
-
-GetOptions (\%opts, 
-	    'Y|yule=s',
-	    'a|add',
-	    'c|cfgfile=s',
-	    'd|delete',
-	    'h|help', 
-	    'l|list',
-	    'o|output=s',
-	    'r|replace',
-	    'u|update',
-	    'v|verbose', 
-	    );
-
-if (defined ($opts{'h'})) {
-    usage();
-    exit;
-}
-
-if (defined($opts{'c'})) {
-    $cfgfile = $opts{'c'};
-    $outfile = $cfgfile unless defined($outfile);
-}
-if (defined($opts{'Y'})) {
-    $yule = $opts{'Y'};
-}
-if (defined($opts{'v'})) {
-    $verbose = 1;
-}
-if (defined($opts{'o'})) {
-    $outfile = $opts{'o'};
-}
-
-if (defined($opts{'l'})) {
-    # list contents
-    my $clients = read_clients($cfgfile);
-    
-    foreach my $client (keys %{$clients}) {
-	print "$client";
-	print " ${$clients}{$client}" if $verbose;
-	print "\n";
-    }
-}
-elsif (defined($opts{'a'}) 
-       or defined($opts{'u'})
-       or defined($opts{'r'})) {
-    # add HOSTNAME
-    my $hostname = $ARGV[0]
-	or die("Actions --add/--replace/--update require at least argument HOSTNAME. Aborting");
-
-    my $password;
-    if (defined($ARGV[1])) {
-	$password = uc($ARGV[1]);
-    } else {
-	$password = uc(<STDIN>);
-	# remove leading and trailing space
-	$password =~ s{\s*}{}g;
-    }
-    # sanity check
-    die ("Argument PASSWORD must be a 16-digit hexadecimal string. Aborting")
-	unless ($password =~ m/[[:xdigit:]]{16}/);
-
-    my $add = defined($opts{'a'});
-    my $replace = defined($opts{'r'});
-
-    my $clients = read_clients($cfgfile);
-    die ("Client '$hostname' already present in config file - cannot add. Aborting")
-	if ($add and defined(${$clients}{$hostname}));
-    die ("Client '$hostname' not already present in config file - cannot replace. Aborting")
-	if ($replace and not defined(${$clients}{$hostname}));
-
-    $clients->{$hostname} = new_client_key($password)
-      or die ("Cannot get key for the given password. Aborting");
-    write_clients($cfgfile, $outfile, $clients);
-}
-elsif (defined($opts{'d'})) {
-    # remove HOSTNAME
-    my $hostname = $ARGV[0]
-	or die("Action --delete requires one argument HOSTNAME. Aborting");
-
-    my $clients = read_clients($cfgfile);
-    delete ${$clients}{$hostname};
-    write_clients($cfgfile, $outfile, $clients);
-}
-else {
-    usage();
-    die ("You must specify one of --list, --add or --remove options. Aborting");
-}
Index: trunk/sql_init/samhain.mysql.init
===================================================================
--- trunk/sql_init/samhain.mysql.init	(revision 591)
+++ trunk/sql_init/samhain.mysql.init	(revision 1)
@@ -1,3 +1,5 @@
 CREATE DATABASE samhain;
+USE mysql;
+INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('localhost','samhain','','N','Y','N','N','N','N');
 USE samhain;
 CREATE TABLE    samhain.log (
@@ -31,5 +33,5 @@
   	return_code   INTEGER,
   	syscall       VARCHAR(16),
-  	ip            VARCHAR(46),
+  	ip            VARCHAR(16),
   	tty           VARCHAR(16),
         peer          VARCHAR(64),
@@ -68,27 +70,23 @@
         link_new      BLOB,
 	
-        size_old      BIGINT UNSIGNED,
-        size_new      BIGINT UNSIGNED,
-        hardlinks_old BIGINT UNSIGNED,
-        hardlinks_new BIGINT UNSIGNED,
-        inode_old     BIGINT UNSIGNED,
-        inode_new     BIGINT UNSIGNED,
+        size_old      BIGINT,
+        size_new      BIGINT,
+        hardlinks_old BIGINT,
+        hardlinks_new BIGINT,
+        inode_old     BIGINT,
+        inode_new     BIGINT,
 
-	imode_old     BIGINT UNSIGNED,
-	imode_new     BIGINT UNSIGNED,
-	iattr_old     BIGINT UNSIGNED,
-	iattr_new     BIGINT UNSIGNED,
-	idevice_old   BIGINT UNSIGNED,
-	idevice_new   BIGINT UNSIGNED,
-	iowner_old    BIGINT UNSIGNED,
-	iowner_new    BIGINT UNSIGNED,
-	igroup_old    BIGINT UNSIGNED,
-	igroup_new    BIGINT UNSIGNED,
-	checkflags_old    BIGINT UNSIGNED,
-	checkflags_new    BIGINT UNSIGNED,
+	imode_old     BIGINT,
+	imode_new     BIGINT,
+	iattr_old     BIGINT,
+	iattr_new     BIGINT,
+	idevice_old   BIGINT,
+	idevice_new   BIGINT,
+	iowner_old    BIGINT,
+	iowner_new    BIGINT,
+	igroup_old    BIGINT,
+	igroup_new    BIGINT
 	
 
-        acl_old       BLOB,
-        acl_new       BLOB
                  
         );
Index: trunk/sql_init/samhain.oracle.init
===================================================================
--- trunk/sql_init/samhain.oracle.init	(revision 591)
+++ trunk/sql_init/samhain.oracle.init	(revision 1)
@@ -9,5 +9,5 @@
         log_hash  VARCHAR2(32),
         entry_status  VARCHAR2(16) DEFAULT 'NEW' NOT NULL,
-        path          CLOB,         
+        path          VARCHAR2(4000),         
         userid        VARCHAR2(8),
         grp           VARCHAR2(8),
@@ -24,13 +24,13 @@
         return_code   INTEGER,
         syscall       VARCHAR2(16),
-        ip            VARCHAR2(46),
+        ip            VARCHAR2(16),
         tty           VARCHAR2(16),
         peer          VARCHAR2(64),
         fromhost      VARCHAR2(64),
-        obj           VARCHAR2(4000),
+        obj           VARCHAR2(128),
         interface     VARCHAR2(64),
         time          VARCHAR2(64),
-        dir           CLOB,
-        linked_path   CLOB,
+        dir           VARCHAR2(4000),
+        linked_path   VARCHAR2(4000),
         port          INTEGER,
         service       VARCHAR2(64),
@@ -56,6 +56,6 @@
         chksum_old    VARCHAR2(50),
         chksum_new    VARCHAR2(50),
-        link_old      CLOB,
-        link_new      CLOB,
+        link_old      VARCHAR2(4000),
+        link_new      VARCHAR2(4000),
         size_old      NUMBER(20),
         size_new      NUMBER(20),
@@ -73,10 +73,17 @@
         iowner_new    NUMBER(20),
         igroup_old    NUMBER(20),
-        igroup_new    NUMBER(20),
-        checkflags_old    NUMBER(20),
-        checkflags_new    NUMBER(20),
-        acl_old       VARCHAR2(4000),
-        acl_new       VARCHAR2(4000)
+        igroup_new    NUMBER(20)
         );
+
+CREATE OR REPLACE TRIGGER trigger_on_log
+before insert on log
+for each row
+declare
+log_index integer;
+begin
+select log_log_index_seq.NEXTVAL into :new.log_index from dual;
+end trigger_on_log;
+.
+run;
 
 CREATE UNIQUE INDEX log_log_index_key on log (log_index);
Index: trunk/sql_init/samhain.postgres.init
===================================================================
--- trunk/sql_init/samhain.postgres.init	(revision 591)
+++ trunk/sql_init/samhain.postgres.init	(revision 1)
@@ -1,5 +1,5 @@
 CREATE SEQUENCE log_log_index_seq START 1;
 CREATE TABLE    log (
-	log_index INTEGER NOT NULL,
+	log_index INTEGER NOT NULL DEFAULT NEXTVAL('log_log_index_seq'),
 	log_ref   BIGINT NULL,
 	log_host  VARCHAR(64)   NOT NULL DEFAULT 'localhost',
@@ -27,5 +27,5 @@
   	return_code   INTEGER,
   	syscall       VARCHAR(16),
-  	ip            VARCHAR(46),
+  	ip            VARCHAR(16),
   	tty           VARCHAR(16),
         peer          VARCHAR(64),
@@ -64,26 +64,22 @@
         link_new      TEXT,
 	
-        size_old      NUMERIC(20),
-        size_new      NUMERIC(20),
-        hardlinks_old NUMERIC(20),
-        hardlinks_new NUMERIC(20),
-        inode_old     NUMERIC(20),
-        inode_new     NUMERIC(20),
+        size_old      BIGINT,
+        size_new      BIGINT,
+        hardlinks_old BIGINT,
+        hardlinks_new BIGINT,
+        inode_old     BIGINT,
+        inode_new     BIGINT,
 
-	imode_old     NUMERIC(20),
-	imode_new     NUMERIC(20),
-	iattr_old     NUMERIC(20),
-	iattr_new     NUMERIC(20),
-	idevice_old   NUMERIC(20),
-	idevice_new   NUMERIC(20),
-	iowner_old    NUMERIC(20),
-	iowner_new    NUMERIC(20),
-	igroup_old    NUMERIC(20),
-	igroup_new    NUMERIC(20),
-	checkflags_old    NUMERIC(20),
-	checkflags_new    NUMERIC(20),
+	imode_old     BIGINT,
+	imode_new     BIGINT,
+	iattr_old     BIGINT,
+	iattr_new     BIGINT,
+	idevice_old   BIGINT,
+	idevice_new   BIGINT,
+	iowner_old    BIGINT,
+	iowner_new    BIGINT,
+	igroup_old    BIGINT,
+	igroup_new    BIGINT
                  
-        acl_old       TEXT,
-        acl_new       TEXT
         );
 
Index: trunk/src/CuTest.c
===================================================================
--- trunk/src/CuTest.c	(revision 591)
+++ 	(revision )
@@ -1,350 +1,0 @@
-/*******************
-
-LICENSE
-
-Copyright (c) 2003 Asim Jalis
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software in
-a product, an acknowledgment in the product documentation would be
-appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and must not
-be misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source
-distribution.
-
-**********************/
-
-#include <assert.h>
-#include <setjmp.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <unistd.h>
-
-#include "CuTest.h"
-
-/*-------------------------------------------------------------------------*
- * CuStr
- *-------------------------------------------------------------------------*/
-
-char* CuStrAlloc(int size)
-{
-	char* newStr = (char*) malloc( sizeof(char) * (size) );
-	return newStr;
-}
-
-char* CuStrCopy(const char* old)
-{
-	int len = strlen(old);
-	char* newStr = CuStrAlloc(len + 1);
-	strcpy(newStr, old);
-	return newStr;
-}
-
-/*-------------------------------------------------------------------------*
- * CuString
- *-------------------------------------------------------------------------*/
-
-void CuStringInit(CuString* str)
-{
-	str->length = 0;
-	str->size = STRING_MAX;
-	str->buffer = (char*) malloc(sizeof(char) * str->size);
-	if (str->buffer)
-	  str->buffer[0] = '\0';
-	else
-	  {
-	    perror("CuStringInit");
-	    _exit (EXIT_FAILURE);
-	  }
-}
-
-CuString* CuStringNew(void)
-{
-	CuString* str = (CuString*) malloc(sizeof(CuString));
-	str->length = 0;
-	str->size = STRING_MAX;
-	str->buffer = (char*) malloc(sizeof(char) * str->size);
-	if (str->buffer)
-	  str->buffer[0] = '\0';
-	else
-	  {
-	    perror("CuStringNew");
-	    _exit (EXIT_FAILURE);
-	  }
-	return str;
-}
-
-void CuStringResize(CuString* str, int newSize)
-{
-	str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize);
-	str->size = newSize;
-}
-
-void CuStringAppend(CuString* str, const char* text)
-{
-	int length;
-
-	if (text == NULL) {
-		text = "NULL";
-	}
-
-	length = strlen(text);
-	if (str->length + length + 1 >= str->size)
-		CuStringResize(str, str->length + length + 1 + STRING_INC);
-	str->length += length;
-	strcat(str->buffer, text);
-}
-
-void CuStringAppendChar(CuString* str, char ch)
-{
-	char text[2];
-	text[0] = ch;
-	text[1] = '\0';
-	CuStringAppend(str, text);
-}
-
-void CuStringAppendFormat(CuString* str, const char* format, ...)
-{
-	va_list argp;
-	char buf[2048];
-	va_start(argp, format);
-	vsnprintf(buf, sizeof(buf), format, argp);
-	va_end(argp);
-	CuStringAppend(str, buf);
-}
-
-void CuStringInsert(CuString* str, const char* text, int pos)
-{
-	int length = strlen(text);
-	if (pos > str->length)
-		pos = str->length;
-	if (str->length + length + 1 >= str->size)
-		CuStringResize(str, str->length + length + 1 + STRING_INC);
-	memmove(str->buffer + pos + length, str->buffer + pos, (str->length - pos) + 1);
-	str->length += length;
-	memcpy(str->buffer + pos, text, length);
-}
-
-/*-------------------------------------------------------------------------*
- * CuTest
- *-------------------------------------------------------------------------*/
-
-void CuTestInit(CuTest* t, const char* name, TestFunction function)
-{
-	t->name = CuStrCopy(name);
-	t->failed = 0;
-	t->ran = 0;
-	t->message = NULL;
-	t->function = function;
-	t->jumpBuf = NULL;
-}
-
-CuTest* CuTestNew(const char* name, TestFunction function)
-{
-	CuTest* tc = CU_ALLOC(CuTest);
-	CuTestInit(tc, name, function);
-	return tc;
-}
-
-void CuTestRun(CuTest* tc)
-{
-	jmp_buf buf;
-	tc->jumpBuf = &buf;
-	if (setjmp(buf) == 0)
-	{
-		tc->ran = 1;
-		(tc->function)(tc);
-	}
-	tc->jumpBuf = 0;
-}
-
-static void CuFailInternal(CuTest* tc, const char* file, int line, CuString* string)
-{
-	char buf[256];
-
-	snprintf(buf, sizeof(buf), "%s:%d: ", file, line);
-	CuStringInsert(string, buf, 0);
-
-	tc->failed = 1;
-	tc->message = string->buffer;
-	if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0);
-}
-
-void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message)
-{
-	CuString string;
-
-	CuStringInit(&string);
-	if (message2 != NULL) 
-	{
-		CuStringAppend(&string, message2);
-		CuStringAppend(&string, ": ");
-	}
-	CuStringAppend(&string, message);
-	CuFailInternal(tc, file, line, &string);
-}
-
-void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition)
-{
-	if (condition) return;
-	CuFail_Line(tc, file, line, NULL, message);
-}
-
-void CuAssertStrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, 
-	const char* expected, const char* actual)
-{
-	CuString string;
-	if ((expected == NULL && actual == NULL) ||
-	    (expected != NULL && actual != NULL &&
-	     strcmp(expected, actual) == 0))
-	{
-		return;
-	}
-
-	CuStringInit(&string);
-	if (message != NULL) 
-	{
-		CuStringAppend(&string, message);
-		CuStringAppend(&string, ": ");
-	}
-	CuStringAppend(&string, "expected <");
-	CuStringAppend(&string, expected);
-	CuStringAppend(&string, "> but was <");
-	CuStringAppend(&string, actual);
-	CuStringAppend(&string, ">");
-	CuFailInternal(tc, file, line, &string);
-}
-
-void CuAssertIntEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, 
-	int expected, int actual)
-{
-	char buf[STRING_MAX];
-	if (expected == actual) return;
-	sprintf(buf, "expected <%d> but was <%d>", expected, actual);
-	CuFail_Line(tc, file, line, message, buf);
-}
-
-void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, 
-	double expected, double actual, double delta)
-{
-	char buf[STRING_MAX];
-#define SH_FABS(a) (((a) < 0) ? -(a) : (a))
-        if (SH_FABS(expected - actual) <= delta) return;
-	sprintf(buf, "expected <%lf> but was <%lf>", expected, actual);
-	CuFail_Line(tc, file, line, message, buf);
-}
-
-void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, 
-	void* expected, void* actual)
-{
-	char buf[STRING_MAX];
-	if (expected == actual) return;
-	sprintf(buf, "expected pointer <0x%p> but was <0x%p>", expected, actual);
-	CuFail_Line(tc, file, line, message, buf);
-}
-
-
-/*-------------------------------------------------------------------------*
- * CuSuite
- *-------------------------------------------------------------------------*/
-
-void CuSuiteInit(CuSuite* testSuite)
-{
-	testSuite->count = 0;
-	testSuite->failCount = 0;
-}
-
-CuSuite* CuSuiteNew(void)
-{
-	CuSuite* testSuite = CU_ALLOC(CuSuite);
-	CuSuiteInit(testSuite);
-	return testSuite;
-}
-
-void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase)
-{
-	assert(testSuite->count < MAX_TEST_CASES);
-	testSuite->list[testSuite->count] = testCase;
-	testSuite->count++;
-}
-
-void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2)
-{
-	int i;
-	for (i = 0 ; i < testSuite2->count ; ++i)
-	{
-		CuTest* testCase = testSuite2->list[i];
-		CuSuiteAdd(testSuite, testCase);
-	}
-}
-
-void CuSuiteRun(CuSuite* testSuite)
-{
-	int i;
-	for (i = 0 ; i < testSuite->count ; ++i)
-	{
-		CuTest* testCase = testSuite->list[i];
-		CuTestRun(testCase);
-		if (testCase->failed) { testSuite->failCount += 1; }
-	}
-}
-
-void CuSuiteSummary(CuSuite* testSuite, CuString* summary)
-{
-	int i;
-	for (i = 0 ; i < testSuite->count ; ++i)
-	{
-		CuTest* testCase = testSuite->list[i];
-		CuStringAppend(summary, testCase->failed ? "F" : ".");
-	}
-	CuStringAppend(summary, "\n\n");
-}
-
-void CuSuiteDetails(CuSuite* testSuite, CuString* details)
-{
-	int i;
-	int failCount = 0;
-
-	if (testSuite->failCount == 0)
-	{
-		int passCount = testSuite->count - testSuite->failCount;
-		const char* testWord = passCount == 1 ? "test" : "tests";
-		CuStringAppendFormat(details, "OK (%d %s)\n", passCount, testWord);
-	}
-	else
-	{
-		if (testSuite->failCount == 1)
-			CuStringAppend(details, "There was 1 failure:\n");
-		else
-			CuStringAppendFormat(details, "There were %d failures:\n", testSuite->failCount);
-
-		for (i = 0 ; i < testSuite->count ; ++i)
-		{
-			CuTest* testCase = testSuite->list[i];
-			if (testCase->failed)
-			{
-				failCount++;
-				CuStringAppendFormat(details, "%d) %s: %s\n",
-					failCount, testCase->name, testCase->message);
-			}
-		}
-		CuStringAppend(details, "\n!!!FAILURES!!!\n");
-
-		CuStringAppendFormat(details, "Runs: %d ",   testSuite->count);
-		CuStringAppendFormat(details, "Passes: %d ", testSuite->count - testSuite->failCount);
-		CuStringAppendFormat(details, "Fails: %d\n",  testSuite->failCount);
-	}
-}
Index: trunk/src/bignum.c
===================================================================
--- trunk/src/bignum.c	(revision 591)
+++ trunk/src/bignum.c	(revision 1)
@@ -64,4 +64,9 @@
 #define ulong unsigned long
 
+/*
+extern void *malloc(size_t size);
+extern void free();
+*/
+
 char *last_string    = NULL;
 char *big_end_string = NULL;
@@ -175,5 +180,5 @@
     for (base = 2; base <= 36; base++)
     {
-	tmp = ((1U << (DIGIT_BITS - 1)) / base);
+	tmp = ((1 << (DIGIT_BITS - 1)) / base);
 	maxdigit = tmp * 2;
 	curdigit = 1;
@@ -209,7 +214,7 @@
   if (!dp) 
     return;
-  (void) count;
   free((char *)dp);
   dp = NULL;
+  count = 0;
 }
 #endif
@@ -227,5 +232,5 @@
     dgs_alloc += alloclen;
 #endif
-    digit_ptr = calloc(alloclen, sizeof(DIGIT));
+    digit_ptr = (DIGIT *) malloc(alloclen * sizeof(DIGIT));
     if (digit_ptr == NULL)
     {
@@ -425,5 +430,4 @@
 {
     DIGIT *a_ptr, *b_ptr;
-    int retval = 0;
 
     if (a->dgs_used  == b->dgs_used)
@@ -438,12 +442,10 @@
 	if (a_ptr < a->dp)
 	{
-	    return retval;
+	    return 0;
 	}
 	else
 	{
-	    if (retval == 0)
-	        retval = (*a_ptr > *b_ptr) ? 1 : -1;
-	}
-	return retval;
+	    return (*a_ptr > *b_ptr) ? 1 : -1;
+	}
     }
     return (a->dgs_used > b->dgs_used) ? 1 : -1;
@@ -623,5 +625,5 @@
     big_set_long((long)1, &big_one);
     length_last_string = 10;
-    if ((last_string = calloc(1,length_last_string)) == NULL)
+    if ((last_string = malloc(length_last_string)) == NULL)
     {
 	big_errno = BIG_MEMERR;
@@ -924,5 +926,5 @@
     if (a->sign == BIG_SIGN_MINUS)
     {
-      *n = -*n;
+	*n = -*n;;
     }
     return FALSE;
@@ -953,5 +955,5 @@
 	if (last_string != NULL)
 	  free(last_string);
-	if ((last_string = calloc(1,str_length)) == NULL)
+	if ((last_string = malloc(str_length)) == NULL)
 	{
 	    big_errno = BIG_MEMERR;
Index: trunk/src/caps.ac
===================================================================
--- trunk/src/caps.ac	(revision 1)
+++ trunk/src/caps.ac	(revision 1)
@@ -0,0 +1,23 @@
+        case "$host_os" in
+        *linux*)
+        if test x"${sh_use_lcaps}" = xyes
+        then
+            echo
+            echo "Using Linux capabilities to drop unnecessary root capabilities."
+            echo "Please make sure that directories used for writing have write permission"
+            echo "for root, because root will be a mere mortal in that respect:"
+            echo "  Baseline database in: ${mydataroot}"
+            echo "  Logfile in:           ${localstatedir}/log"
+            echo "  PID file in:          ${localstatedir}/run"
+            echo "(directories not existent yet will be created upon installation, root-owned"
+            echo "if make install is executed by root.)"
+            echo
+        fi
+        if test x"${sh_use_lcaps}" = xno
+        then
+            echo
+            echo "Not using Linux capabilities (capability.h or libcap not found)"
+            echo
+        fi
+        ;;
+        esac
Index: trunk/src/cutest_sh_hash.c
===================================================================
--- trunk/src/cutest_sh_hash.c	(revision 591)
+++ 	(revision )
@@ -1,121 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-
-extern char * quote_string   (const char * str, size_t len);
-extern char * unquote_string (const char * str, size_t len);
-
-void Test_quote_string_ok (CuTest *tc) {
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  char * ret = 0;
-
-  char   inp1[] = "foo\nba=r\ntest";
-  char   out1[] = "foo=0Aba=3Dr=0Atest";
-
-  char   inp2[] = "\n=foo\nba=r\ntest=\n";
-  char   out2[] = "=0A=3Dfoo=0Aba=3Dr=0Atest=3D=0A";
-
-  ret = quote_string(inp1, strlen(inp1));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, out1, ret);
-
-  ret = quote_string(inp2,strlen(inp2));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, out2, ret);
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-
-void Test_unquote_string_ok (CuTest *tc) {
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  char * ret = 0;
-
-  char   out1[] = "foo\nba=r\ntes[t";
-  char   inp1[] = "foo=0Aba=3Dr=0Ates=5Bt";
-
-  char   out2[] = "\n=foo\nba=r\ntest=\n";
-  char   inp2[] = "=0A=3Dfoo=0Aba=3Dr=0Atest=3D=0A";
-
-  char   out3[] = ""; /* encoded '\0' at start */
-  char   inp3[] = "=00=3Dfoo=0Aba=3Dr=0Atest=3D=0A";
-
-  ret = unquote_string(inp1, strlen(inp1));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, out1, ret);
-
-  ret = unquote_string(inp2, strlen(inp2));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, out2, ret);
-
-  ret = unquote_string(inp3, strlen(inp3));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, out3, ret);
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-
-
-void Test_csv_escape_ok (CuTest *tc) {
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-
-  extern char * csv_escape(const char * str);
-
-  char   test0[80];
-  char   expec[80];
-  char  *ret;
-
-  strcpy(test0, "foobar");
-  strcpy(expec, "\"foobar\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "\"foobar\"");
-  strcpy(expec, "\"\"\"foobar\"\"\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "foo,bar");
-  strcpy(expec, "\"foo,bar\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "foob,\"a\"r");
-  strcpy(expec, "\"foob,\"\"a\"\"r\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "\",\"foobar\",\"");
-  strcpy(expec, "\"\"\",\"\"foobar\"\",\"\"\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "");
-  strcpy(expec, "");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "a");
-  strcpy(expec, "\"a\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-  strcpy(test0, "foo\"bar");
-  strcpy(expec, "\"foo\"\"bar\"");
-  ret = csv_escape(test0);
-  CuAssertStrEquals(tc, expec, ret);
-
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-
-
-
Index: trunk/src/cutest_sh_tiger0.c
===================================================================
--- trunk/src/cutest_sh_tiger0.c	(revision 591)
+++ 	(revision )
@@ -1,460 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "CuTest.h"
-
-#include "sh_tiger.h"
-#include "sh_checksum.h"
-
-#if defined(HAVE_PTHREAD) && defined(SH_STEALTH)
-extern void sh_g_init(void);
-#endif
-
-
-static void init(void) {
-
-  extern unsigned char TcpFlag[8][PW_LEN+1];
-  extern UINT32  ErrFlag[2];
-  unsigned char * dez = NULL;
-  int i;
-
-#if defined(HAVE_PTHREAD) && defined(SH_STEALTH)
-  sh_g_init();
-#endif
-  skey = (sh_key_t *) malloc (sizeof(sh_key_t));
-  if (skey != NULL) 
-    {
-      skey->mlock_failed = S_FALSE;
-      skey->rngI         = BAD;
-      /* properly initialized later 
-       */
-      skey->rng0[0] = 0x03; skey->rng0[1] = 0x09; skey->rng0[2] = 0x17;
-      skey->rng1[0] = 0x03; skey->rng1[1] = 0x09; skey->rng1[2] = 0x17;
-      skey->rng2[0] = 0x03; skey->rng2[1] = 0x09; skey->rng2[2] = 0x17;
-      
-      for (i = 0; i < KEY_BYT; ++i)
-	skey->poolv[i] = '\0';
-      
-      skey->poolc        = 0;
-      
-      skey->ErrFlag[0]   = ErrFlag[0];
-      ErrFlag[0]         = 0;
-      skey->ErrFlag[1]   = ErrFlag[1];
-      ErrFlag[1]         = 0;
-      
-      dez = &(TcpFlag[POS_TF-1][0]);
-      for (i = 0; i < PW_LEN; ++i)
-	{ 
-	  skey->pw[i] = (char) (*dez); 
-	  (*dez)      = '\0';
-	  ++dez; 
-	}
-      
-      skey->sh_sockpass[0]  = '\0';
-      skey->sigkey_old[0]   = '\0';
-      skey->sigkey_new[0]   = '\0';
-      skey->mailkey_old[0]  = '\0';
-      skey->mailkey_new[0]  = '\0';
-      skey->crypt[0]        = '\0';
-      skey->session[0]      = '\0';
-      skey->vernam[0]       = '\0';
-    }
-  else
-    {
-      perror(_("sh_init"));
-      _exit (EXIT_FAILURE);
-    }
-
-}
-  
-void Test_tiger(CuTest *tc) {
-
-  char * input;
-  char * actual;
-  char * expected;
-  char hashbuf[KEYBUF_SIZE];
-
-#if defined(HAVE_PTHREAD) && defined(SH_STEALTH)
-  sh_g_init();
-#endif
-
-  input  = "";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input  = "abc";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "F258C1E88414AB2A527AB541FFC5B8BF935F7B951C132951";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "Tiger";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "9F00F599072300DD276ABB38C8EB6DEC37790C116F9D2BDF";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "87FB2A9083851CF7470D2CF810E6DF9EB586445034A5A386";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "467DB80863EBCE488DF1CD1261655DE957896565975F9197";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "0C410A042968868A1671DA5A3FD29A725EC1E457D3CDB303";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge.";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "EBF591D5AFA655CE7F22894FF87F54AC89C811B6B0DA3193";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "3D9AEB03D1BD1A6357B2774DFD6D5B24DD68151D503974FC";
-  CuAssertStrEquals(tc, expected, actual);
-  
-  input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";
-  actual = sh_tiger_hash(input, TIGER_DATA, strlen(input), hashbuf, sizeof(hashbuf));
-  expected = "00B83EB4E53440C576AC6AAEE0A7485825FD15E70A59FFE4";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_tiger_file(CuTest *tc) {
-
-  SL_TICKET     rval_open;
-  FILE * fp;
-  int result;
-  char * actual;
-  char * expected;
-  char hashbuf[KEYBUF_SIZE];
-  char hexdigest[SHA256_DIGEST_STRING_LENGTH];
-  UINT64  length;
-
-  init();
-
-  fp = fopen("cutest_foo", "w");
-  CuAssertPtrNotNull(tc, fp);
-
-  result = fprintf(fp, "%s\n", 
-		   "ABCDEFGHIJKLMNOPQRSTUVWXYZ=abcdefghijklmnopqrstuvwxyz+0123456789");
-  CuAssertTrue(tc, result >= 0);
-
-  result = fclose(fp);
-  CuAssertTrue(tc, result == 0);
-  
-  result = sh_tiger_hashtype("TIGER192");
-  CuAssertTrue(tc, result == 0);
-
-  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192) 
-   */
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
-  CuAssertStrEquals(tc, expected, actual);
-
-  rval_open = sl_open_fastread (__FILE__, __LINE__, "cutest_foo", SL_YESPRIV);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = sl_close(rval_open);
-  CuAssertTrue(tc, result == 0);
-
-  result = sh_tiger_hashtype("MD5");
-  CuAssertTrue(tc, result == 0);
-
-  rval_open = sl_open_fastread (__FILE__, __LINE__, "cutest_foo", SL_YESPRIV);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  /* same result as GNU md5sum 
-   */
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "AEEC4DDA496BCFBA691F4E8863BA84C00000000000000000";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = sl_close(rval_open);
-  CuAssertTrue(tc, result == 0);
-
-  result = sh_tiger_hashtype("SHA1");
-  CuAssertTrue(tc, result == 0);
-
-  rval_open = sl_open_fastread (__FILE__, __LINE__, "cutest_foo", SL_YESPRIV);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  /* same result as gpg --print-md SHA1 
-   */
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "2FE65D1D995B8F8BC8B13F798C07E7E935A787ED00000000";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = sl_close(rval_open);
-  CuAssertTrue(tc, result == 0);
-
-  result = sh_tiger_hashtype("SHA256");
-  CuAssertTrue(tc, result == 0);
-
-  rval_open = sl_open_fastread (__FILE__, __LINE__, "cutest_foo", SL_YESPRIV);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  /* same result as gpg --print-md SHA256
-   */
-  length = TIGER_NOLIM;
-  {
-    char * tmp = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-    actual = SHA256_Base2Hex(tmp, hexdigest);
-  }
-  expected = "235790848f95e96b2c627f1bf58a2b8c05c535ada8c0a3326aac34ce1391ad40";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = sl_close(rval_open);
-  CuAssertTrue(tc, result == 0);
-
-  result = remove("cutest_foo");
-  CuAssertTrue(tc, result == 0);
-
-  /* --------------------------------------------------- */
-
-  fp = fopen("cutest_foo", "w");
-  CuAssertPtrNotNull(tc, fp);
-
-  result = fprintf(fp, "\n");
-  CuAssertTrue(tc, result >= 0);
-
-  result = fclose(fp);
-  CuAssertTrue(tc, result == 0);
-  
-  result = sh_tiger_hashtype("TIGER192");
-  CuAssertTrue(tc, result == 0);
-
-  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192) 
-   */
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "F987845A0EA784367BF9E4DB09014995810F27C99C891734";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = remove("cutest_foo");
-  CuAssertTrue(tc, result == 0);
-
-  /* --------------------------------------------------- */
-
-  fp = fopen("cutest_foo", "w");
-  CuAssertPtrNotNull(tc, fp);
-
-  result = fprintf(fp, "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.\n");
-  CuAssertTrue(tc, result >= 0);
-
-  result = fclose(fp);
-  CuAssertTrue(tc, result == 0);
-  
-  result = sh_tiger_hashtype("TIGER192");
-  CuAssertTrue(tc, result == 0);
-
-  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192) 
-   */
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
-  CuAssertStrEquals(tc, expected, actual);
-
-  result = remove("cutest_foo");
-  CuAssertTrue(tc, result == 0);
-
-}  
-
-/* test checksum of file upto some given length
- */
-void Test_tiger_file_with_length(CuTest *tc) {
-
-  SL_TICKET     rval_open;
-  FILE * fp;
-  int result;
-  char * actual;
-  char * expected;
-  char hashbuf[KEYBUF_SIZE];
-  UINT64  length;
-
-  char * teststring = "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.\n";
-  size_t    testlen = strlen(teststring);
-
-  init();
-
-  fp = fopen("cutest_foo", "w");
-  CuAssertPtrNotNull(tc, fp);
-
-  result = fprintf(fp, "%s", teststring);
-  CuAssertTrue(tc, result >= 0);
-  result = fprintf(fp, "%s", teststring);
-  CuAssertTrue(tc, result >= 0);
-
-  result = fclose(fp);
-  CuAssertTrue(tc, result == 0);
-  
-  result = sh_tiger_hashtype("TIGER192");
-  CuAssertTrue(tc, result == 0);
-
-  /* same as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192) 
-   */
-  length = 0;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 0 == length);
-
-  length = testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, testlen == length);
-
-  length = 2*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 2*testlen == length);
-
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 2*testlen == length);
-
-  fp = fopen("cutest_foo", "a");
-  CuAssertPtrNotNull(tc, fp);
-  result = fprintf(fp, "%s", teststring);
-  CuAssertTrue(tc, result >= 0);
-  result = fclose(fp);
-  CuAssertTrue(tc, result == 0);
-
-  length = testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, testlen == length);
-
-  length = 2*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 2*testlen == length);
-
-  length = 3*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "D0EE1A9956CAB22D84B51A5E0C093B724828C6A1F9CBDB7F";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "D0EE1A9956CAB22D84B51A5E0C093B724828C6A1F9CBDB7F";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  length = 5;
-  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "9F00F599072300DD276ABB38C8EB6DEC37790C116F9D2BDF";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 5 == length);
-
-  /* same results as GNU md5sum */
-
-  result = sh_tiger_hashtype("MD5");
-  CuAssertTrue(tc, result == 0);
-
-  rval_open = sl_open_fastread (__FILE__, __LINE__, "cutest_foo", SL_YESPRIV);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "11E7E7EA486136273606BEE57C71F34B0000000000000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = 2*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "D49DAD474095D467E2E5EFCB2DC23A770000000000000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 2*testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = 3*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "00A1F1C5EDDCCFC430D3862FDA94593E0000000000000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "00A1F1C5EDDCCFC430D3862FDA94593E0000000000000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  /* same result as gpg --print-md SHA1 
-   */
-
-  result = sh_tiger_hashtype("SHA1");
-  CuAssertTrue(tc, result == 0);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "F37DB4344CCD140EE315179E9A27512FB4704F0F00000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = 2*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "D2AD5FC366452D81400BAC31F96269DEEF314BC200000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 2*testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = 3*testlen;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "FAA937EF3389C7E786EB0F1006D049D7AEA7B7B600000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  result = sl_rewind(rval_open);
-  CuAssertTrue(tc, rval_open >= 0);
-
-  length = TIGER_NOLIM;
-  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
-  expected = "FAA937EF3389C7E786EB0F1006D049D7AEA7B7B600000000";
-  CuAssertStrEquals(tc, expected, actual);
-  CuAssertTrue(tc, 3*testlen == length);
-
-  result = sl_close(rval_open);
-  CuAssertTrue(tc, result == 0);
-
-  result = remove("cutest_foo");
-  CuAssertTrue(tc, result == 0);
-}
Index: trunk/src/cutest_sh_tools.c
===================================================================
--- trunk/src/cutest_sh_tools.c	(revision 591)
+++ 	(revision )
@@ -1,138 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-#include "samhain.h"
-#include "sh_tools.h"
-#include "sh_ipvx.h"
-
-void Test_sh_tools_safe_name_01(CuTest *tc) {
-  /* xml specific */
-  char* input = strdup("hello<wo>rld\"foo&");
-  char* actual = sh_tools_safe_name(input, 1);
-#ifdef SH_USE_XML
-  char* expected = "hello=3cwo=3erld=22foo=26";
-#else
-  char* expected = "hello<wo>rld\"foo&";
-#endif
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_02(CuTest *tc) {
-  /* html entities */
-  char* input = strdup("hello&amp;&quot;&gt;&lt;");
-  char* actual = sh_tools_safe_name(input, 0);
-  char* expected = "hello=26=22=3e=3c";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_03(CuTest *tc) {
-  char* input = strdup("\\\'hello\\");
-  char* actual = sh_tools_safe_name(input, 0);
-  char* expected = "=27hello";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("hello \"world\\\"");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "hello \"world=22";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("hello\\\\");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "hello=5c";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("hello\\n");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "hello=0a";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_04(CuTest *tc) {
-  /* invalid and valid octal code */
-  char* input = strdup("hello\\\n");
-  char* actual = sh_tools_safe_name(input, 0);
-  char* expected = "hello";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("hello\\100");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "hello=40";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("h\\\"ello\\100a");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "h=22ello=40a";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_05(CuTest *tc) {
-  /* encoding of '=' */
-  char* input = strdup("he=llo=\"foo\"");
-  char* actual = sh_tools_safe_name(input, 0);
-  char* expected = "he=3dllo=\"foo\"";
-  CuAssertStrEquals(tc, expected, actual);
-
-  input = strdup("he=llo=<foo>");
-  actual = sh_tools_safe_name(input, 0);
-  expected = "he=3dllo=<foo>";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_06(CuTest *tc) {
-  /* line break removal */
-  char* input = strdup("hello\nworld");
-  char* actual = sh_tools_safe_name(input, 0);
-  char* expected = "hello world";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_sh_tools_safe_name_07(CuTest *tc) {
-  /* non-printable chars */
-  char* input = strdup("hello world");
-  char* actual;
-  char* expected;
-
-  input[0]  = 0x01;
-  input[5]  = 0xFF;
-  input[10] = 0xF0;
-
-  actual   = sh_tools_safe_name(input, 0);
-  expected = "=01ello=ffworl=f0";
-  CuAssertStrEquals(tc, expected, actual);
-}
-
-void Test_is_numeric_01(CuTest *tc) {
-  char* input  = strdup("hello world");
-
-  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
-
-  input  = strdup("127.0.0.1");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("127.0.0.de");
-  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
-  input  = strdup("127");
-  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
-#if defined(USE_IPVX)
-  input  = strdup("::1");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("2002:c0a8:101::42");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("2003:dead:beef:4dad:23:46:bb:101");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("::192:168:0:1::");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("1:1:192:168:0:1:1:1");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("1:1:192:168:0:1:1:1:0");
-  CuAssertTrue(tc, !sh_ipvx_is_numeric(input));
-  input  = strdup("2001:0db8:85a3:0000:0000:8a2e:0370:7334");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("2001:db8:85a3:0:0:8a2e:370:7334");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-  input  = strdup("2001:db8:85a3::8a2e:370:7334");
-  CuAssertTrue(tc, sh_ipvx_is_numeric(input));
-#endif
-}
-
Index: trunk/src/cutest_sh_unix.c
===================================================================
--- trunk/src/cutest_sh_unix.c	(revision 591)
+++ 	(revision )
@@ -1,201 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-#include "samhain.h"
-#include "sh_unix.h"
-
-int malloc_count = 0;
-
-void Test_dnmalloc (CuTest *tc) {
-
-  const int nalloc = 64 /* original dnmalloc 1.0-beta5 fails for >= 45 */;
-  int j, i;
-  int sum;
-#ifndef USE_SYSTEM_MALLOC
-  int i_malloc =  malloc_count;
-#endif
-
-  char * buf;
-  char * area[256];
-
-#if !defined(USE_SYSTEM_MALLOC) && !defined(__clang__)
-  /* test reuse of last freed chunk */
-  buf = malloc(1024);
-  CuAssertPtrNotNull(tc, buf);
-  free(buf);
-  area[0] = malloc(1024);
-  CuAssertTrue(tc, buf == area[0]);
-  free(area[0]);
-#endif
-  
-  /* test realloc */
-  buf = malloc(16);
-  CuAssertPtrNotNull(tc, buf);
-  strcpy(buf, "testing realloc");
-  buf = realloc(buf, 32);
-  strcat(buf, "testing realloc");
-  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
-
-#ifndef USE_SYSTEM_MALLOC
-  i_malloc = malloc_count;
-#endif
-
-  for (j = 0; j < 64; ++j)
-    {
-      buf = malloc((j+1) * 1024);
-      CuAssertPtrNotNull(tc, buf);
-#ifndef USE_SYSTEM_MALLOC
-#ifndef __clang__
-      CuAssertIntEquals (tc, malloc_count, (i_malloc + 1));
-#endif
-#endif
-      free(buf);
-#ifndef USE_SYSTEM_MALLOC
-      CuAssertIntEquals (tc, malloc_count, i_malloc);
-#endif
-    }
-
-  /* test realloc */
-  buf = malloc(16);
-  CuAssertPtrNotNull(tc, buf);
-  strcpy(buf, "testing realloc");
-  buf = realloc(buf, 32);
-  strcat(buf, "testing realloc");
-  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
-
-#ifndef USE_SYSTEM_MALLOC
-  i_malloc = malloc_count;
-#endif
-
-  for (j = 0; j < 64; ++j)
-    {
-      buf = calloc(1, (j+1) * 1024);
-      CuAssertPtrNotNull(tc, buf);
-#ifndef USE_SYSTEM_MALLOC
-      CuAssertIntEquals (tc, malloc_count, (i_malloc + 1));
-#endif
-      sum = 0;
-      for (i = 0; i < ((j+1) * 1024); ++i)
-	sum += buf[i];
-      CuAssertIntEquals (tc, 0, sum);
-      free(buf);
-#ifndef USE_SYSTEM_MALLOC
-      CuAssertIntEquals (tc, malloc_count, i_malloc);
-#endif
-    }
-
-  /* test realloc */
-  buf = malloc(16);
-  CuAssertPtrNotNull(tc, buf);
-  strcpy(buf, "testing realloc");
-  buf = realloc(buf, 32);
-  strcat(buf, "testing realloc");
-  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
-
-  for (j = 0; j < nalloc; ++j)
-    {
-      area[j] = malloc((j+1) * 1024);
-      CuAssertPtrNotNull(tc, area[j]);
-#ifndef USE_SYSTEM_MALLOC
-      /* CuAssertIntEquals (tc, malloc_count, (i_malloc + (j+1))); */
-#endif
-      memset(area[j], (unsigned char) ('a'+1), (j+1) * 1024);
-    }
-
-#ifndef USE_SYSTEM_MALLOC
-  i_malloc =  malloc_count;
-#endif
-
-  for (j = 0; j < nalloc; ++j)
-    {
-      sum = 0;
-      for (i = 0; i < ((j+1) * 1024); ++i)
-	sum +=  area[j][i];
-      CuAssertIntEquals (tc, sum, ((j+1) * 1024 * ((unsigned char) ('a'+1))));
-      free(area[j]);
-#ifndef USE_SYSTEM_MALLOC
-      CuAssertIntEquals (tc, malloc_count, i_malloc - (j+1));
-#endif
-    }
-
-  /* test realloc */
-  buf = malloc(16);
-  CuAssertPtrNotNull(tc, buf);
-  strcpy(buf, "testing realloc");
-  buf = realloc(buf, 32);
-  strcat(buf, "testing realloc");
-  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
-
-
-  for (j = 0; j < 32; ++j)
-    {
-#ifndef USE_SYSTEM_MALLOC
-      i_malloc =  malloc_count;
-#endif
-      buf = malloc((j+1) * 1024 * 1024);
-      CuAssertPtrNotNull(tc, buf);
-      for (i = 0; i < 32; ++i)
-	{
-	  area[i] = malloc((i+1) * 1024);
-	  CuAssertPtrNotNull(tc, area[i]);
-	}
-      free(buf);
-      for (i = 0; i < 32; ++i)
-	{
-	  free(area[i]);
-	}
-#ifndef USE_SYSTEM_MALLOC
-      CuAssertIntEquals (tc, malloc_count, i_malloc);
-#endif
-    }
-
-  /* test realloc */
-  buf = malloc(16);
-  CuAssertPtrNotNull(tc, buf);
-  strcpy(buf, "testing realloc");
-  buf = realloc(buf, 32);
-  strcat(buf, "testing realloc");
-  CuAssertStrEquals(tc, "testing realloctesting realloc", buf);
-}
-
-  
-void Test_sh_unix_lookup_page (CuTest *tc) {
-
-  long pagesize = sh_unix_pagesize();
-  
-  unsigned long base;
-  int          num_pages;
-
-  CuAssert (tc, "pagesize > 0", (pagesize > 0));
-
-  /* base = sh_unix_lookup_page(in_addr, len, *num_pages); */
-
-  base = sh_unix_lookup_page(0, pagesize, &num_pages);
-  CuAssert (tc, "base == 0", (base == 0));
-  CuAssertIntEquals (tc, num_pages, 1);
-
-  base = sh_unix_lookup_page(0, pagesize+1, &num_pages);
-  CuAssert (tc, "base == 0", (base == 0));
-  CuAssertIntEquals (tc, num_pages, 2);
-
-  base = sh_unix_lookup_page((void*)pagesize, pagesize, &num_pages);
-  CuAssert (tc, "base == 0", (base == (unsigned int)pagesize));
-  CuAssertIntEquals (tc, num_pages, 1);
-
-  base = sh_unix_lookup_page((void*)pagesize, pagesize+1, &num_pages);
-  CuAssert (tc, "base == 0", (base == (unsigned int)pagesize));
-  CuAssertIntEquals (tc, num_pages, 2);
-
-  base = sh_unix_lookup_page((void*)(pagesize-1), pagesize+1, &num_pages);
-  CuAssert (tc, "base == 0", (base == 0));
-  CuAssertIntEquals (tc, num_pages, 2);
-
-  base = sh_unix_lookup_page((void*)(pagesize-1), pagesize+2, &num_pages);
-  CuAssert (tc, "base == 0", (base == 0));
-  CuAssertIntEquals (tc, num_pages, 3);
-
-}
-
-  
Index: trunk/src/cutest_sh_utils.c
===================================================================
--- trunk/src/cutest_sh_utils.c	(revision 591)
+++ 	(revision )
@@ -1,532 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-#include "samhain.h"
-#include "sh_utils.h"
-
-void Test_sl_strlcpy (CuTest *tc) {
-  int ret;
-  char out[] = "aaaaaa";
-  char in[]  = "bbb";
-
-  ret = sl_strlcpy (NULL, NULL, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcpy (NULL, in, 0);
-  CuAssertIntEquals(tc, ret, SL_ENULL);
-
-  ret = sl_strlcpy (out, NULL, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcpy (out, in, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcpy (out, NULL, 7);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-  CuAssertStrEquals(tc, "", out);
-
-  out[0] = 'a';
-  ret = sl_strlcpy (out, in, 4);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-  CuAssertStrEquals(tc, "bbb", out);
-  CuAssertStrEquals(tc, "aa", &out[4]);
-  
-  return;
-}
-
-void Test_sl_strlcat (CuTest *tc) {
-  int ret;
-  char out[16] = "aaaaaa";
-  char in[16]  = "bbb";
-
-  ret = sl_strlcat (NULL, NULL, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcat (NULL, in, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcat (out, NULL, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcat (out, in, 0);
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-
-  ret = sl_strlcat (out, NULL, sizeof(out));
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-  CuAssertStrEquals(tc, "aaaaaa", out);
-
-  ret = sl_strlcat (out, in, 7);
-  CuAssertIntEquals(tc, ret, SL_ETRUNC);
-  CuAssertStrEquals(tc, "aaaaaa", out);
-
-  ret = sl_strlcat (out, in, 8);
-  CuAssertIntEquals(tc, ret, SL_ETRUNC);
-  CuAssertStrEquals(tc, "aaaaaab", out);
-
-  ret = sl_strlcat (out, in, sizeof(out));
-  CuAssertIntEquals(tc, ret, SL_ENONE);
-  CuAssertStrEquals(tc, "aaaaaabbbb", out);
-
-  CuAssertStrEquals(tc, "bbb", in);
-
-  return;
-}
-
-void Test_sh_util_acl_compact (CuTest *tc) {
-  char * ret = 0;
-  char   inp1[] = "user::r--\nuser:lisa:rwx\t\t#effective: r--\ngroup::r--\ngroup:toolies:rw-  #effective: r--\nmask::r--\nother::r--\n";
-  char   inp2[] = "use\n\nuser:lisa:rwx\t\t#effective: r--\ngroup::r--\ngroup:toolies:rw-  #effective: r--\nmask::r--\nother::r--\n";
-  char   inp3[] = "user:\177\145\177\122:r--\nuser:lisa:rwx\t\t#effective: r--\ngroup::r--\ngroup:toolies:rw-  #effective: r--\nmask::r--\nother::r--\n";
-  
-  ret = sh_util_acl_compact (inp1, strlen(inp1));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "u::r--,u:lisa:rwx,g::r--,g:toolies:rw-,m::r--,o::r--",
-		    ret); 
-
-  ret = sh_util_acl_compact (inp2, strlen(inp2));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "use,u:lisa:rwx,g::r--,g:toolies:rw-,m::r--,o::r--",
-		    ret); 
-
-  ret = sh_util_acl_compact (inp3, strlen(inp3));
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "u:eR:r--,u:lisa:rwx,g::r--,g:toolies:rw-,m::r--,o::r--",
-		    ret); 
-
-  return;
-}
-
-void Test_sh_util_strdup_ok (CuTest *tc) {
-  char * ret = 0;
-  char   inp[] = "foobar";
-
-  ret = sh_util_strdup(inp);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssert(tc, "expected inp != ret, but inp == ret", (inp != ret)); 
-  CuAssertStrEquals(tc, "foobar", ret);
-  return;
-}
-
-void Test_sh_util_strconcat_ok (CuTest *tc) {
-  char * ret = 0;
-
-  ret = sh_util_strconcat("foo", NULL);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "foo", ret);
-
-  ret = sh_util_strconcat("foo", "bar", NULL);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "foobar", ret);
-
-  ret = sh_util_strconcat("/", "foo", "/", "bar", NULL);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, "/foo/bar", ret);
-
-  return;
-}
-
-void Test_sh_util_base64_enc_ok (CuTest *tc) {
-  unsigned char   out[64];
-  unsigned char   ou2[64];
-  int    ret;
-  unsigned char   inp0[64] = "";
-  unsigned char   inp1[64] = "A";
-  unsigned char   inp2[64] = "AB";
-  unsigned char   inp3[64] = "ABC";
-  unsigned char   inp4[64] = "ABCD";
-
-  ret = sh_util_base64_enc (out, inp0, strlen((char*)inp0));
-  CuAssertIntEquals(tc, 0, ret);
-  CuAssertStrEquals(tc, "", (char*)out);
-  ret = sh_util_base64_dec (ou2, out, strlen((char*)out));
-  CuAssertIntEquals(tc, ret, 0);
-  CuAssertStrEquals(tc, (char*)inp0, (char*)ou2);
-
-  ret = sh_util_base64_enc (out, inp1, strlen((char*)inp1));
-  CuAssertIntEquals(tc, ret, 4);
-  CuAssertStrEquals(tc, "QQ??", (char*)out);
-  ret = sh_util_base64_dec (ou2, out, strlen((char*)out));
-  CuAssertStrEquals(tc, (char*)inp1, (char*)ou2);
-  CuAssertIntEquals(tc, 1, ret);
-
-  ret = sh_util_base64_enc (out, inp2, strlen((char*)inp2));
-  CuAssertIntEquals(tc, ret, 4);
-  CuAssertStrEquals(tc, "QUI?", (char*)out);
-  ret = sh_util_base64_dec (ou2, out, strlen((char*)out));
-  CuAssertStrEquals(tc, (char*)inp2, (char*)ou2);
-  CuAssertIntEquals(tc, 2, ret);
-
-  ret = sh_util_base64_enc (out, inp3, strlen((char*)inp3));
-  CuAssertIntEquals(tc, ret, 4);
-  CuAssertStrEquals(tc, "QUJD", (char*)out);
-  ret = sh_util_base64_dec (ou2, out, strlen((char*)out));
-  CuAssertStrEquals(tc, (char*)inp3, (char*)ou2);
-  CuAssertIntEquals(tc, 3, ret);
-
-  ret = sh_util_base64_enc (out, inp4, strlen((char*)inp4));
-  CuAssertIntEquals(tc, ret, 8);
-  CuAssertStrEquals(tc, "QUJDRA??", (char*)out);
-  ret = sh_util_base64_dec (ou2, out, strlen((char*)out));
-  CuAssertStrEquals(tc, (char*)inp4, (char*)ou2);
-  CuAssertIntEquals(tc, 4, ret);
-
-
-  return;
-}
-
-void Test_sh_util_dirname_ok (CuTest *tc) {
-  char * ret = 0;
-
-  char input0[] = "/foo/bar";
-  char res0[] = "/foo";
-
-  char input1[] = "/foo/bar/";
-  char res1[] = "/foo";
-
-  char input2[] = "/foo";
-  char res2[] = "/";
-
-  char input3[] = "/";
-  char res3[] = "/";
-
-  char input4[] = "///foo//bar";
-  char res4[] = "///foo";
-
-  char input5[] = "//foo///bar///";
-  char res5[] = "//foo";
-
-  char input6[] = "///";
-  char res6[] = "///";
-
-  char input7[] = "//f///b///";
-  char res7[] = "//f";
-
-  char input8[] = "/f/b/";
-  char res8[] = "/f";
-
-  char input9[] = "/e/b";
-  char res9[] = "/e";
-
-  ret = sh_util_dirname(input0);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res0, ret);
-
-  ret = sh_util_dirname(input1);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res1, ret);
-
-  ret = sh_util_dirname(input2);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res2, ret);
-
-  ret = sh_util_dirname(input3);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res3, ret);
-
-  ret = sh_util_dirname(input4);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res4, ret);
-
-  ret = sh_util_dirname(input5);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res5, ret);
-
-  ret = sh_util_dirname(input6);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res6, ret);
-
-  ret = sh_util_dirname(input7);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res7, ret);
-
-  ret = sh_util_dirname(input8);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res8, ret);
-
-  ret = sh_util_dirname(input9);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res9, ret);
-  return;
-}
-
-void Test_sh_util_basename_ok (CuTest *tc) {
-  char * ret = 0;
-
-  char input0[] = "/foo/bar";
-  char res0[] = "bar";
-
-  char input1[] = "/foo/";
-  char res1[] = "foo";
-
-  char input2[] = "/foo";
-  char res2[] = "foo";
-
-  char input3[] = "/";
-  char res3[] = "/";
-
-  char input4[] = "/foo/bar/";
-  char res4[] = "bar";
-
-  char input5[] = "/foo///bar///";
-  char res5[] = "bar";
-
-  char input6[] = "//foo";
-  char res6[] = "foo";
-
-  ret = sh_util_basename(input0);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res0, ret);
-
-  ret = sh_util_basename(input1);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res1, ret);
-
-  ret = sh_util_basename(input2);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res2, ret);
-
-  ret = sh_util_basename(input3);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res3, ret);
-
-  ret = sh_util_basename(input4);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res4, ret);
-
-  ret = sh_util_basename(input5);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res5, ret);
-
-  ret = sh_util_basename(input6);
-  CuAssertPtrNotNull(tc, ret);
-  CuAssertStrEquals(tc, res6, ret);
-
-  return;
-}
-
-void Test_sh_util_utf8_ok (CuTest *tc) {
-  int ret = 0;
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  unsigned char seq[16];
-  unsigned char input[16] = "foobar";
-
-  seq[0] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xd7; seq[1] = 0x90; seq[2] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xed; seq[1] = 0x9f; seq[2] = 0xbf; seq[3] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xee; seq[1] = 0x80; seq[2] = 0x80; seq[3] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xef; seq[1] = 0xbf; seq[2] = 0xbd; seq[3] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xf4; seq[1] = 0x8f; seq[2] = 0xbf; seq[3] = 0xbf; seq[4] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xf4; seq[1] = 0x90; seq[2] = 0x80; seq[3] = 0x80; seq[4] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  seq[0] = 0xd7; seq[1] = 0x90; seq[2] = 0xd7; seq[3] = 0x90; seq[4] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-
-  /* cont. char */
-
-  seq[0] = 0x80; seq[1] = 0x00; 
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xbf; seq[1] = 0x00; 
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  /* overlong */
-
-  seq[0] = 0xc0; seq[1] = 0xaf; seq[2] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xe0; seq[1] = 0x8f; seq[2] = 0xaf;  seq[3] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xf0; seq[1] = 0x80; seq[2] = 0x80;  seq[3] = 0xaf; seq[4] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  /* overlong */
-
-  seq[0] = 0xc1; seq[1] = 0xbf; seq[2] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xe0; seq[1] = 0x9f; seq[2] = 0xbf;  seq[3] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xf0; seq[1] = 0x8f; seq[2] = 0xbf;  seq[3] = 0xbf; seq[4] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  /* overlong */
-
-  seq[0] = 0xc0; seq[1] = 0x80; seq[2] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xe0; seq[1] = 0x80; seq[2] = 0x80;  seq[3] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xf0; seq[1] = 0x80; seq[2] = 0x80;  seq[3] = 0x80; seq[4] = 0x00;  
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  /* cont missing */
-
-  seq[0] = 0xd7; seq[1] = 0x20; seq[3] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xee; seq[1] = 0x80; seq[2] = 0x20; seq[3] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  seq[0] = 0xf4; seq[1] = 0x8f; seq[2] = 0xbf; seq[3] = 0x20; seq[4] = 0x00;
-  ret = sh_util_valid_utf8(seq);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-
-  /* switch on utf8 checking for sh_util_obscurename() */
-
-  ret = sh_util_obscure_utf8("Y");
-  CuAssertIntEquals(tc, ret, 0);
-
-  ret = sh_util_obscure_ok ("0x01,0x02,0x03");
-  CuAssertIntEquals(tc, ret, 0);
-
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = '\t';
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[0] = 0x01;
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0x02;
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0x03;
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0x04;
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[0] = 'f';
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[5] = ' ';
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_FALSE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[5] = 'r'; input[3] = ' ';
-  ret = sh_util_valid_utf8 (input);
-  CuAssertIntEquals(tc, ret, S_TRUE);
-  ret = sh_util_obscurename (0, (char *)input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-
-#else
-  CuAssertIntEquals(tc, ret, 0);
-#endif
-}
-
-void Test_sh_util_obscure_ok (CuTest *tc) {
-
-  int ret = 0;
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  char input[16] = "foobar";
-
-  /* switch off utf8 checking for sh_util_obscurename() */
-
-  ret = sh_util_obscure_utf8("N");
-  CuAssertIntEquals(tc, ret, 0);
-
-  ret = sh_util_obscure_ok ("0xA1,0xA2,0xA3");
-  CuAssertIntEquals(tc, ret, 0);
-
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = '\t';
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[0] = 0xA1;
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0xA2;
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0xA3;
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[0] = 0xA4;
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[0] = 'f';
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-
-  input[5] = ' ';
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, -1);
-
-  input[5] = 'r'; input[3] = ' ';
-  ret = sh_util_obscurename (0, input, S_FALSE /* no log message */);
-  CuAssertIntEquals(tc, ret, 0);
-#else
-  CuAssertIntEquals(tc, ret, 0);
-#endif
-}
-
Index: trunk/src/cutest_slib.c
===================================================================
--- trunk/src/cutest_slib.c	(revision 591)
+++ 	(revision )
@@ -1,135 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-#include "samhain.h"
-
-void Test_sl_stale (CuTest *tc) {
-
-  extern int get_the_fd (SL_TICKET ticket);
-
-  int       fd1, fd2, ret, line, val;
-  SL_TICKET tfd1, tfd2;
-  char *    err1;
-  char      err2[128];
-
-  line = __LINE__; tfd1 = sl_open_read(__FILE__, __LINE__, "/etc/group", SL_NOPRIV);
-  CuAssertTrue(tc, tfd1 > 0);
-
-  fd1 = get_the_fd(tfd1);
-  CuAssertTrue(tc, fd1 >= 0);
-
-  ret = close(fd1);
-  CuAssertTrue(tc, ret == 0);
-
-  tfd2 = sl_open_read(__FILE__, __LINE__, "/etc/group", SL_NOPRIV);
-  CuAssertTrue(tc, tfd2 > 0);
-  CuAssertTrue(tc, tfd2 != tfd1);
-
-  fd2 = get_the_fd(tfd2);
-  CuAssertIntEquals(tc, fd1, fd2);
-
-  err1 = sl_check_stale();
-  CuAssertTrue(tc, err1 != NULL);
-
-  sl_snprintf(err2, sizeof(err2), 
-	      "stale handle, %s, %d", __FILE__, line);
-  val = strcmp(err1, err2);
-  CuAssertIntEquals(tc, 0, val);
-}
-
-void Test_sl_snprintf (CuTest *tc) {
-
-  int ret = 0;
-  char input[16];
-
-  memset (&input, 'X', 16);
-  ret = sl_snprintf(input, 10, "%s\n", "01234567890123456789");
-  CuAssertIntEquals(tc, ret, 0);
-  CuAssertTrue(tc, input[9]  == '\0');
-  CuAssertTrue(tc, input[10] == 'X');
-
-  memset (&input, 'X', 16);
-  ret = sl_snprintf(input, 4, "%d\n", "012345");
-  CuAssertIntEquals(tc, ret, 0);
-  CuAssertTrue(tc, input[3] == '\0');
-  CuAssertTrue(tc, input[4] == 'X');
-}
-
-void Test_sl_ts_strncmp (CuTest *tc) {
-  char one[64], two[64];
-  int  res;
-
-  strcpy(one, "foo");
-  strcpy(two, "foo");
-  res = sl_ts_strncmp(one, two, 3);
-  CuAssertIntEquals(tc, 0, res);
-
-  strcpy(one, "fox");
-  strcpy(two, "foo");
-  res = sl_ts_strncmp(one, two, 2);
-  CuAssertIntEquals(tc, 0, res);
-  
-  strcpy(one, "f9o");
-  strcpy(two, "foo");
-  res = sl_ts_strncmp(one, two, 3);
-  CuAssertTrue(tc, 0 != res);
-
-}
-
-void Test_sl_strcasecmp (CuTest *tc) {
-  char one[64], two[64];
-  int  res;
-
-  strcpy(one, "foo");
-  strcpy(two, "foo");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, 0, res);
-
-  strcpy(one, "fo");
-  strcpy(two, "foo");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, -1, res);
-
-  strcpy(one, "foo");
-  strcpy(two, "fo");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, 1, res);
-
-  strcpy(one, "1234");
-  strcpy(two, "2345");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, -1, res);
-
-  strcpy(one, "234");
-  strcpy(two, "123");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, 1, res);
-
-  strcpy(one, "");
-  strcpy(two, "123");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, -1, res);
-
-  strcpy(one, "234");
-  strcpy(two, "");
-  res = sl_strcasecmp(one, two);
-  CuAssertIntEquals(tc, 1, res);
-
-  strcpy(one, "");
-  strcpy(two, "");
-  res = sl_strcasecmp(one, two);
-  CuAssertTrue(tc, res == 0);
-
-#ifndef SL_FAIL_ON_ERROR
-  res = sl_strcasecmp(NULL, two);
-  CuAssertIntEquals(tc, -1, res);
-
-  res = sl_strcasecmp(one, NULL);
-  CuAssertIntEquals(tc, 1, res);
-
-  res = sl_strcasecmp(NULL, NULL);
-  CuAssertTrue(tc, res != 0);
-#endif
-}
Index: trunk/src/cutest_zAVLTree.c
===================================================================
--- trunk/src/cutest_zAVLTree.c	(revision 591)
+++ 	(revision )
@@ -1,523 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include "CuTest.h"
-#include "zAVLTree.h"
-
-struct ztest {
-  char name[32];
-  int  iname;
-};
-
-static zAVLTree * ztest_tree   = NULL;
-
-static zAVLKey ztest_key (void const * arg)
-{
-  const struct ztest * sa = (const struct ztest *) arg;
-  return (zAVLKey) sa->name;
-}
-
-static zAVLKey ztest_intkey(void const *item)
-{
-  return (&((const struct ztest *)item)->iname);
-}
-
-
-static void free_node (void * inptr)
-{
-  struct ztest * ptr = (struct ztest *) inptr;
-  ptr->name[0] = '\0';
-  ptr->iname   = 0;
-}
-
-void Test_zAVLTree(CuTest *tc) {
-  zAVLCursor    cursor;
-
-  int result;
-  int counter = 0;
-
-  char * str;
-
-  struct ztest z1 = { "abc"  , 1 };
-  struct ztest z2 = { "aac"  , 2 };
-  struct ztest z3 = { "aaa1" , 3 };
-  struct ztest z4 = { "aaa3" , 4 };
-  struct ztest z5 = { "aaa2" , 5 };
-  struct ztest z6 = { "aaa6" , 6 };
-  struct ztest z7 = { "aaa5" , 7 };
-  struct ztest z8 = { "aaa4" , 8 };
-
-  struct ztest iz1 = { "aaa1" , 8 };
-  struct ztest iz2 = { "aaa2" , 7 };
-  struct ztest iz3 = { "aaa3" , 1 };
-  struct ztest iz4 = { "aaa4" , 3 };
-  struct ztest iz5 = { "aaa5" , 2 };
-  struct ztest iz6 = { "aaa5" , 6 };
-  struct ztest iz7 = { "aaa7" , 5 };
-  struct ztest iz8 = { "aaa8" , 4 };
-
-  struct ztest * ptr;
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertTrue(tc, NULL == ptr);
-
-  ztest_tree = zAVLAllocTree (ztest_key, zAVL_KEY_STRING);
-  CuAssertPtrNotNull(tc, ztest_tree);
-
-  do {
-
-  ++counter;
-
-  result = zAVLInsert(ztest_tree, &z1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z2);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z3);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z4);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z5);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z6);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z7);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z8);
-  CuAssertTrue(tc, 0 == result);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertStrEquals(tc, ptr->name, z3.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z8.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z2.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLInsert(ztest_tree, &z8);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &z7);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &z6);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &z5);
-  CuAssertTrue(tc, 0 != result);
-
-  ptr = zAVLSearch(ztest_tree, z1.name);
-  CuAssertStrEquals(tc, ptr->name, z1.name);
-  ptr = zAVLSearch(ztest_tree, z2.name);
-  CuAssertStrEquals(tc, ptr->name, z2.name);
-  ptr = zAVLSearch(ztest_tree, z3.name);
-  CuAssertStrEquals(tc, ptr->name, z3.name);
-  ptr = zAVLSearch(ztest_tree, z4.name);
-  CuAssertStrEquals(tc, ptr->name, z4.name);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertStrEquals(tc, ptr->name, z3.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z8.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z2.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-
-  ptr = zAVLSearch(ztest_tree, z5.name);
-  CuAssertStrEquals(tc, ptr->name, z5.name);
-  ptr = zAVLSearch(ztest_tree, z6.name);
-  CuAssertStrEquals(tc, ptr->name, z6.name);
-  ptr = zAVLSearch(ztest_tree, z7.name);
-  CuAssertStrEquals(tc, ptr->name, z7.name);
-  ptr = zAVLSearch(ztest_tree, z8.name);
-  CuAssertStrEquals(tc, ptr->name, z8.name);
-  ptr = zAVLSearch(ztest_tree, "foobar");
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z8.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z8.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z3.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z3.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z1.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z1.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLInsert(ztest_tree, &z1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z8);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z3);
-  CuAssertTrue(tc, 0 == result);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertStrEquals(tc, ptr->name, z3.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z8.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z2.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, z1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z1.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z1.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z2.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z2.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z3.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z3.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z4.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z4.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z5.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z5.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z6.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z6.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z7.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z7.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, z8.name);
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, z8.name);
-  CuAssertTrue(tc, NULL == ptr);
-
-} while (counter < 100);
-
-  result = zAVLInsert(ztest_tree, &z1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z2);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z3);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z4);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z5);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z6);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z7);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &z8);
-  CuAssertTrue(tc, 0 == result);
-
-  zAVLFreeTree (ztest_tree, free_node);
-  CuAssertTrue (tc, z1.name[0] == '\0');
-  CuAssertTrue (tc, z2.name[0] == '\0');
-  CuAssertTrue (tc, z3.name[0] == '\0');
-  CuAssertTrue (tc, z4.name[0] == '\0');
-  CuAssertTrue (tc, z5.name[0] == '\0');
-  CuAssertTrue (tc, z6.name[0] == '\0');
-  CuAssertTrue (tc, z7.name[0] == '\0');
-  CuAssertTrue (tc, z8.name[0] == '\0');
-
-
-  /* Numeric key here */
-
-  counter    = 0;
-  ztest_tree = NULL;
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertTrue(tc, NULL == ptr);
-
-  ztest_tree = zAVLAllocTree (ztest_intkey, zAVL_KEY_INT);
-  CuAssertPtrNotNull(tc, ztest_tree);
-
-  do {
-
-  ++counter;
-
-  result = zAVLInsert(ztest_tree, &iz1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz2);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz3);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz4);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz5);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz6);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz7);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz8);
-  CuAssertTrue(tc, 0 == result);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertStrEquals(tc, ptr->name, iz3.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz8.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz2.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLInsert(ztest_tree, &iz8);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &iz7);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &iz6);
-  CuAssertTrue(tc, 0 != result);
-  result = zAVLInsert(ztest_tree, &iz5);
-  CuAssertTrue(tc, 0 != result);
-
-  ptr = zAVLSearch(ztest_tree, &(iz1.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz1.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz2.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz2.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz3.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz3.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz6.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz6.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz4.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz4.iname);
-
-  ptr = zAVLSearch(ztest_tree, &(iz2.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz2.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz3.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz3.iname);
-  ptr = zAVLSearch(ztest_tree, &(iz7.iname));
-  CuAssertIntEquals(tc, ptr->iname, iz7.iname);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertStrEquals(tc, ptr->name, iz3.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz8.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz2.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-
-  ptr = zAVLSearch(ztest_tree, &(iz5.iname));
-  CuAssertStrEquals(tc, ptr->name, iz5.name);
-  ptr = zAVLSearch(ztest_tree, &(iz6.iname));
-  CuAssertStrEquals(tc, ptr->name, iz6.name);
-  ptr = zAVLSearch(ztest_tree, &(iz7.iname));
-  CuAssertStrEquals(tc, ptr->name, iz7.name);
-  ptr = zAVLSearch(ztest_tree, &(iz8.iname));
-  CuAssertStrEquals(tc, ptr->name, iz8.name);
-  ptr = zAVLSearch(ztest_tree, &(z1.iname)); /* been set to 0 */
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz8.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz8.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz3.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz3.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz1.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz1.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLInsert(ztest_tree, &iz1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz8);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz3);
-  CuAssertTrue(tc, 0 == result);
-
-  ptr = zAVLFirst(&cursor, ztest_tree);
-  CuAssertIntEquals(tc, ptr->iname, iz3.iname);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz5.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz4.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertIntEquals(tc, ptr->iname, iz8.iname);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz7.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz6.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertIntEquals(tc, ptr->iname, iz2.iname);
-  ptr = zAVLNext(&cursor);
-  CuAssertStrEquals(tc, ptr->name, iz1.name);
-  ptr = zAVLNext(&cursor);
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz1.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz1.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz2.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz2.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz3.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz3.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz4.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz4.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz5.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz5.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz6.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz6.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz7.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz7.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-  result = zAVLDelete(ztest_tree, &(iz8.iname));
-  CuAssertTrue(tc, 0 == result);
-  ptr = zAVLSearch(ztest_tree, &(iz8.iname));
-  CuAssertTrue(tc, NULL == ptr);
-
-} while (counter < 100);
-
-  result = zAVLInsert(ztest_tree, &iz1);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz2);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz3);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz4);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz5);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz6);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz7);
-  CuAssertTrue(tc, 0 == result);
-  result = zAVLInsert(ztest_tree, &iz8);
-  CuAssertTrue(tc, 0 == result);
-
-  zAVLFreeTree (ztest_tree, free_node);
-  CuAssertTrue (tc, iz1.iname == 0);
-  CuAssertTrue (tc, iz2.iname == 0);
-  CuAssertTrue (tc, iz3.iname == 0);
-  CuAssertTrue (tc, iz4.iname == 0);
-  CuAssertTrue (tc, iz5.iname == 0);
-  CuAssertTrue (tc, iz6.iname == 0);
-  CuAssertTrue (tc, iz7.iname == 0);
-  CuAssertTrue (tc, iz8.iname == 0);
-
-  ztest_tree = NULL;
-  str = strdup("foo");
-  result = zAVL_string_set(&ztest_tree, str);
-  CuAssertTrue(tc, 0 == result);
-  CuAssertPtrNotNull(tc, ztest_tree);
-  CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 
-
-  str = strdup("bar");
-  result = zAVL_string_set(&ztest_tree, str);
-  CuAssertTrue(tc, 0 == result);
-  CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 
-  CuAssertStrEquals(tc, "bar", zAVL_string_get(ztest_tree, "bar")); 
-
-  str = strdup("balloon");
-  result = zAVL_string_set(&ztest_tree, str);
-  CuAssertTrue(tc, 0 == result);
-  CuAssertStrEquals(tc, "foo", zAVL_string_get(ztest_tree, "foo")); 
-  CuAssertStrEquals(tc, "bar", zAVL_string_get(ztest_tree, "bar")); 
-  CuAssertStrEquals(tc, "balloon", zAVL_string_get(ztest_tree, "balloon")); 
-
-  str = zAVL_string_get(ztest_tree, "foobar");
-  CuAssertTrue(tc, str == NULL);
-  str = zAVL_string_get(ztest_tree, "");
-  CuAssertTrue(tc, str == NULL);
-  str = zAVL_string_get(ztest_tree, NULL);
-  CuAssertTrue(tc, str == NULL);
-
-  zAVL_string_reset(ztest_tree);
-  ztest_tree = NULL;
-  str = zAVL_string_get(ztest_tree, "foo");
-  CuAssertTrue(tc, str == NULL);
-  str = zAVL_string_get(ztest_tree, "bar");
-  CuAssertTrue(tc, str == NULL);
-  str = zAVL_string_get(ztest_tree, "balloon");
-  CuAssertTrue(tc, str == NULL);
-
-}
Index: trunk/src/depend-gen.c
===================================================================
--- trunk/src/depend-gen.c	(revision 591)
+++ trunk/src/depend-gen.c	(revision 1)
@@ -197,8 +197,6 @@
   p = strrchr(name, '/');
   if (p)
-    {
-      ++p;
-      len = strlen(p);
-    }
+    ++p;
+  len = strlen(p);
 
   /* skip other dependencies
@@ -208,5 +206,5 @@
       if (NULL == fgets(line, 1023, fout))
 	break;
-      if (p && 0 == strncmp(line, p, len))
+      if (0 == strncmp(line, p, len))
 	break;
       fprintf(ftmp, "%s", line);
@@ -245,5 +243,5 @@
 	   *
 	   **************************************************/
-	  if (0 == strcmp(p, "sh_sig_chksum.h") ||
+	  if (0 == strcmp(p, "sh_gpg_chksum.h") ||
 	      0 == strcmp(p, "sh_gpg_fp.h"))
 	    {
Index: trunk/src/dnmalloc.c
===================================================================
--- trunk/src/dnmalloc.c	(revision 591)
+++ 	(revision )
@@ -1,5622 +1,0 @@
-/* DistriNet malloc (dnmalloc): a more secure memory allocator. 
-   Copyright (C) 2005, Yves Younan, Wouter Joosen, Frank Piessens 
-   and Rainer Wichmann
-
-   The authors can be contacted by:
-      Email: dnmalloc@fort-knox.org
-      Address:
-#if defined(WITH_TPT) 
-      	     Yves Younan
-      	     Celestijnenlaan 200A
-      	     B-3001 Heverlee
-      	     Belgium
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-   
-*/
-
-/* Current version: dnmalloc 1.0 */
-/* Includes arc4random from OpenBSD, which is under the BDS license     */
-
-/* Versions:
-   0.1-0.5:
-   Proof of concept implementation by Hans Van den Eynden and Yves Younan
-   0.6-0.7:
-   Bug fixes by Yves Younan
-   0.8-1.0.beta4:
-   Reimplementation from scratch by Yves Younan
-   1.0.beta4:
-   Public release
-   1.0.beta5:
-   Prev_chunkinfo speeded up, was really slow because of the way we did lookups
-   A freechunkinfo region is now freed when it is completely empty and 
-   not the current one
-
-   1.0 (Rainer Wichmann [support at la dash samhna dot org]):
-   ---------------------
-
-   Compiler warnings fixed
-   Define REALLOC_ZERO_BYTES_FREES because it's what GNU libc does
-       (and what the standard says)
-   Removed unused code
-   Fix       assert(aligned_OK(chunk(newp)));
-         ->  assert(aligned_OK(chunk(oldp)));
-   Fix statistics in sYSMALLOc
-   Fix overwrite of av->top in sYSMALLOc
-   Provide own assert(), glibc assert() doesn't work (calls malloc)
-   Fix bug in mEMALIGn(), put remainder in hashtable before calling fREe
-   Remove cfree, independent_cmalloc, independent_comalloc (untested
-       public functions not covered by any standard)
-   Provide posix_memalign (that one is in the standard)
-   Move the malloc_state struct to mmapped memory protected by guard pages 
-   Add arc4random function to initialize random canary on startup
-   Implement random canary at end of (re|m)alloced/memaligned buffer,
-       check at free/realloc
-   Remove code conditional on !HAVE_MMAP, since mmap is required anyway.
-   Use standard HAVE_foo macros (as generated by autoconf) instead of LACKS_foo
-
-   Profiling: Reorder branches in hashtable_add, next_chunkinfo, 
-                  prev_chunkinfo, hashtable_insert, mALLOc, fREe, request2size,
-	          checked_request2size (gcc predicts if{} branch to be taken).
-	      Use UNLIKELY macro (gcc __builtin_expect()) where branch
-                  reordering would make the code awkward.
-
-   Portability: Hashtable always covers full 32bit address space to
-                avoid assumptions about memory layout.
-   Portability: Try hard to enforce mapping of mmapped memory into
-                32bit address space, even on 64bit systems.
-   Portability: Provide a dnmalloc_pthread_init() function, since
-                pthread locking on HP-UX only works if initialized
-		after the application has entered main().
-   Portability: On *BSD, pthread_mutex_lock is unusable since it
-                calls malloc, use spinlocks instead.
-   Portability: Dynamically detect whether the heap is within
-                32bit address range (e.g. on Linux x86_64, it isn't).
-		Don't use sbrk() if the heap is mapped to an address 
-		outside the 32bit range, since this doesn't work with 
-		the hashtable. New macro morecore32bit.
-                
-   Success on: HP-UX 11.11/pthread, Linux/pthread (32/64 bit),
-               FreeBSD/pthread, and Solaris 10 i386/pthread.
-   Fail    on: OpenBSD/pthread (in  _thread_machdep_save_float_state),
-               might be related to OpenBSD pthread internals (??).
-	       Non-treaded version (#undef USE_MALLOC_LOCK) 
-	       works on OpenBSD.
-   
-   further to 1.0:
-   Valgrind client requests inserted (#define USE_VALGRIND)
-   Fix: malloc_consolidate (nextchunk->fd, nextchunk->bck may be NULL)
-   Portability: minsize = 32 bit on 64bit architecture
-   Minor cleanups
-   Fix: eliminate prototypes for memset, memcpy (they're in string.h)
-   Fix: one more malloc_consolidate segfault
-
-   There may be some bugs left in this version. please use with caution.
-*/
-
-
-
-/* Please read the following papers for documentation: 
-
-   Yves Younan, Wouter Joosen, and Frank Piessens, A Methodology for Designing
-   Countermeasures against Current and Future Code Injection Attacks,
-   Proceedings of the Third IEEE International Information Assurance
-   Workshop 2005 (IWIA2005), College Park, Maryland, U.S.A., March 2005,
-   IEEE, IEEE Press.
-   http://www.fort-knox.org/younany_countermeasures.pdf
-   
-   Yves Younan, Wouter Joosen and Frank Piessens and Hans Van den
-   Eynden. Security of Memory Allocators for C and C++. Technical Report
-   CW419, Departement Computerwetenschappen, Katholieke Universiteit
-   Leuven, July 2005. http://www.fort-knox.org/CW419.pdf
- 
- */
-
-/* Compile:
-   gcc -fPIC -rdynamic -c -Wall dnmalloc-portable.c
-   "Link": 
-   Dynamic:
-   gcc -shared -Wl,-soname,libdnmalloc.so.0 -o libdnmalloc.so.0.0 dnmalloc-portable.o -lc
-   Static:
-   ar -rv libdnmalloc.a dnmalloc-portable.o
-   
-*/
-
-/* 
-   dnmalloc is based on dlmalloc 2.7.2 (by Doug Lea (dl@cs.oswego.edu))
-   dlmalloc was released as public domain and contained the following license:
-   
-   "This is a version (aka dlmalloc) of malloc/free/realloc written by
-   Doug Lea and released to the public domain.  Use, modify, and
-   redistribute this code without permission or acknowledgement in any
-   way you wish.  Send questions, comments, complaints, performance
-   data, etc to dl@cs.oswego.edu
-   
-   * VERSION 2.7.2 Sat Aug 17 09:07:30 2002  Doug Lea  (dl at gee)
-   
-   Note: There may be an updated version of this malloc obtainable at
-   ftp://gee.cs.oswego.edu/pub/misc/malloc.c
-   Check before installing!"
-   
-*/
-
-/* The following preprocessor macros are tested, 
- *   and hence should have #define directives:
- *
- *   HAVE_CONFIG_H    Define to #include "config.h" (autoconf-generated)
- *
- *   HAVE_UNISTD_H    Define to #include <unistd.h>
- *
- *   HAVE_SYS_UIO_H   Define to #include <sys/uio.h> (for writev)
- *   HAVE_WRITEV      Define if the 'writev' function is available
- *
- *   HAVE_SYS_PARAM_H Define to #include <sys/param.h> (for pagesize)
- *
- *   HAVE_MALLOC_H    Define to #include <malloc.h> (for struct mallinfo2)
- *
- *   HAVE_FCNTL_H     Define to #include <fcntl.h>
- *
- *   HAVE_SYS_MMAN_H  Define to #include <sys/mman.h>
- *   HAVE_MMAP        Define if the 'mmap' function is available.
- *
- *   HAVE_SCHED_H     Define to #include <sched.h>
- *   HAVE_SCHED_YIELD Define id the 'sched_yield' function is available
- */
-
-
-/*
-  __STD_C should be nonzero if using ANSI-standard C compiler, a C++
-  compiler, or a C compiler sufficiently close to ANSI to get away
-  with it.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef USE_VALGRIND
-#include <valgrind/memcheck.h>
-#else
-#define VALGRIND_FREELIKE_BLOCK(a,b)       ((void)0)
-#define VALGRIND_MALLOCLIKE_BLOCK(a,b,c,d) ((void)0)
-#define VALGRIND_CREATE_MEMPOOL(a,b,c)     ((void)0)
-#define VALGRIND_MEMPOOL_ALLOC(a,b,c)      ((void)0)
-#define VALGRIND_MEMPOOL_FREE(a,b)         ((void)0)
-#define VALGRIND_DESTROY_MEMPOOL(a)        ((void)0)
-#define VALGRIND_MAKE_MEM_DEFINED(a,b)     ((void)0)
-#define VALGRIND_MAKE_MEM_UNDEFINED(a,b)   ((void)0)
-#define VALGRIND_MAKE_MEM_NOACCESS(a,b)    ((void)0)
-#endif
-
-#if defined (__GNUC__) && __GNUC__ > 2
-# define LIKELY(expression) (__builtin_expect(!!(expression), 1))
-# define UNLIKELY(expression) (__builtin_expect(!!(expression), 0))
-# define __attribute_malloc__ __attribute__ ((__malloc__))
-#else
-# define LIKELY(x)       (x)
-# define UNLIKELY(x)     (x)
-# define __attribute_malloc__ /* Ignore */
-#endif
-
-/*
-  Define HAVE_MREMAP to make realloc() use mremap() to re-allocate
-  large blocks.  This is currently only possible on Linux with
-  kernel versions newer than 1.3.77.
-*/
-
-#ifndef HAVE_MREMAP
-#ifdef linux
-#define HAVE_MREMAP 1
-#define _GNU_SOURCE 1
-#else
-#define HAVE_MREMAP 0
-#endif
-#endif /* HAVE_MREMAP */
-
-
-
-#ifndef __STD_C
-#if defined(__STDC__) || defined(_cplusplus)
-#define __STD_C     1
-#else
-#define __STD_C     0
-#endif 
-#endif /*__STD_C*/
-
-
-/*
-  Void_t* is the pointer type that malloc should say it returns
-*/
-
-#ifndef Void_t
-#if (__STD_C || defined(WIN32))
-#define Void_t      void
-#else
-#define Void_t      char
-#endif
-#endif /*Void_t*/
-
-#if __STD_C
-#include <stddef.h>   /* for size_t */
-#else
-#include <sys/types.h>
-#endif
-
-#if !defined(USE_SYSTEM_MALLOC)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* define HAVE_UNISTD_H if your system has a <unistd.h>. */
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-
-#include <stdio.h>    /* needed for malloc_stats */
-#include <errno.h>    /* needed for optional MALLOC_FAILURE_ACTION */
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <sys/resource.h>
-
-extern int errno;
-
-  /* 0: lazy, 
-   * 1: medium (assertions compiled in), 
-   * 2: high (guard pages at end of hash table and ciregions) 
-   * 3: paranoid (guards at end of each allocated chunk, check at free) 
-   */
-#ifndef PARANOIA
-#define PARANOIA 9
-#endif
-
-  /* Using assert() with multithreading will cause the code 
-   * to deadlock since glibc __assert_fail will call malloc().
-   * We need our very own assert().
-   */
-typedef void assert_handler_tp(const char * error, const char *file, int line);
-
-#if  PARANOIA > 0
-
-#ifdef NDEBUG
-#undef NDEBUG
-#endif
-
-static void default_assert_handler(const char *error, 
-				   const char *file, int line)
-{
-#ifdef HAVE_WRITEV
-  struct iovec iov[5];
-  char * i1 = "assertion failed (";
-  char * i3 = "): ";
-  char * i5 = "\n";
-  int    res = 0;
-  char   ifile[128];
-  char   ierr[128];
-
-  strncpy(ifile, file, sizeof(ifile)); ifile[sizeof(ifile)-1] = '\0';
-  strncpy(ierr, error, sizeof(ierr));  ierr[sizeof(ierr)-1]   = '\0';
-
-  iov[0].iov_base = i1;     iov[0].iov_len = strlen(i1); 
-  iov[1].iov_base = ifile;  iov[1].iov_len = strlen(ifile); 
-  iov[2].iov_base = i3;     iov[2].iov_len = strlen(i3); 
-  iov[3].iov_base = ierr;   iov[3].iov_len = strlen(ierr); 
-  iov[4].iov_base = i5;     iov[4].iov_len = strlen(i5);
-  do {
-    res = writev(STDERR_FILENO, iov, 5);
-  } while (res < 0 && errno == EINTR);  
-#else
-  fputs("assertion failed (", stderr);
-  fputs(file, stderr);
-  fputs("): ", stderr);
-  fputs(error, stderr);
-  fputc('\n', stderr);
-#endif
-  (void) line;
-  abort();
-}
-static assert_handler_tp *assert_handler = default_assert_handler;
-
-
-#define assert(x)                               \
-  do {		                                \
-    if (UNLIKELY(!(x))) {			\
-      assert_handler(#x, __FILE__, __LINE__);	\
-    }                                           \
-  } while (0)
-
-#else
-
-static assert_handler_tp *assert_handler = NULL;
-#ifndef NDEBUG
-#define NDEBUG
-#endif
-#define assert(x) ((void)0)
-
-#endif
-
-assert_handler_tp *dnmalloc_set_handler(assert_handler_tp *new)
-{
-  assert_handler_tp *old = assert_handler;
-  assert_handler = new;
-  return old;
-}
-
-
-#include <stdarg.h>
-
-  /* define for debugging */
-  /* #define DNMALLOC_DEBUG */ 
-
-  /* Do some extra checks? if not, covered by assrt()s */
-  /* #define DNMALLOC_CHECKS */
-
-  /*
-    The unsigned integer type used for comparing any two chunk sizes.
-    This should be at least as wide as size_t, but should not be signed.
-  */
-
-#ifndef CHUNK_SIZE_T
-#define CHUNK_SIZE_T unsigned long
-#endif
-
-/* 
-  The unsigned integer type used to hold addresses when they are are
-  manipulated as integers. Except that it is not defined on all
-  systems, intptr_t would suffice.
-*/
-#ifndef PTR_UINT
-#define PTR_UINT unsigned long
-#endif
-
-
-/*
-  INTERNAL_SIZE_T is the word-size used for internal bookkeeping
-  of chunk sizes.
-
-  The default version is the same as size_t.
-
-  While not strictly necessary, it is best to define this as an
-  unsigned type, even if size_t is a signed type. This may avoid some
-  artificial size limitations on some systems.
-
-  On a 64-bit machine, you may be able to reduce malloc overhead by
-  defining INTERNAL_SIZE_T to be a 32 bit `unsigned int' at the
-  expense of not being able to handle more than 2^32 of malloced
-  space. If this limitation is acceptable, you are encouraged to set
-  this unless you are on a platform requiring 16byte alignments. In
-  this case the alignment requirements turn out to negate any
-  potential advantages of decreasing size_t word size.
-
-  Implementors: Beware of the possible combinations of:
-     - INTERNAL_SIZE_T might be signed or unsigned, might be 32 or 64 bits,
-       and might be the same width as int or as long
-     - size_t might have different width and signedness as INTERNAL_SIZE_T
-     - int and long might be 32 or 64 bits, and might be the same width
-  To deal with this, most comparisons and difference computations
-  among INTERNAL_SIZE_Ts should cast them to CHUNK_SIZE_T, being
-  aware of the fact that casting an unsigned int to a wider long does
-  not sign-extend. (This also makes checking for negative numbers
-  awkward.) Some of these casts result in harmless compiler warnings
-  on some systems.
-*/
-
-#ifndef INTERNAL_SIZE_T
-#define INTERNAL_SIZE_T size_t
-#endif
-
-/* The corresponding word size */
-#define SIZE_SZ                (sizeof(INTERNAL_SIZE_T))
-
-
-
-/*
-  MALLOC_ALIGNMENT is the minimum alignment for malloc'ed chunks.
-  It must be a power of two at least 2 * SIZE_SZ, even on machines
-  for which smaller alignments would suffice. It may be defined as
-  larger than this though. Note however that code and data structures
-  are optimized for the case of 8-byte alignment.
-*/
-
-
-#ifndef MALLOC_ALIGNMENT
-#define MALLOC_ALIGNMENT       (2 * SIZE_SZ)
-#endif
-
-/* The corresponding bit mask value */
-#define MALLOC_ALIGN_MASK      (MALLOC_ALIGNMENT - 1)
-
-
-
-/*
-  REALLOC_ZERO_BYTES_FREES should be set if a call to
-  realloc with zero bytes should be the same as a call to free.
-  Some people think it should. Otherwise, since this malloc
-  returns a unique pointer for malloc(0), so does realloc(p, 0).
-*/
-
-#define REALLOC_ZERO_BYTES_FREES
-
-/*
-  TRIM_FASTBINS controls whether free() of a very small chunk can
-  immediately lead to trimming. Setting to true (1) can reduce memory
-  footprint, but will almost always slow down programs that use a lot
-  of small chunks.
-
-  Define this only if you are willing to give up some speed to more
-  aggressively reduce system-level memory footprint when releasing
-  memory in programs that use many small chunks.  You can get
-  essentially the same effect by setting MXFAST to 0, but this can
-  lead to even greater slowdowns in programs using many small chunks.
-  TRIM_FASTBINS is an in-between compile-time option, that disables
-  only those chunks bordering topmost memory from being placed in
-  fastbins.
-*/
-
-#ifndef TRIM_FASTBINS
-#define TRIM_FASTBINS  0
-#endif
-
-
-/*
-  USE_DL_PREFIX will prefix all public routines with the string 'dl'.
-  This is necessary when you only want to use this malloc in one part 
-  of a program, using your regular system malloc elsewhere.
-*/
-
-/* #define USE_DL_PREFIX */
-
-
-/*
-  USE_MALLOC_LOCK causes wrapper functions to surround each
-  callable routine with pthread mutex lock/unlock.
-
-  USE_MALLOC_LOCK forces USE_PUBLIC_MALLOC_WRAPPERS to be defined
-*/
-
-/* #define USE_MALLOC_LOCK */
-
-
-/*
-  If USE_PUBLIC_MALLOC_WRAPPERS is defined, every public routine is
-  actually a wrapper function that first calls MALLOC_PREACTION, then
-  calls the internal routine, and follows it with
-  MALLOC_POSTACTION. This is needed for locking, but you can also use
-  this, without USE_MALLOC_LOCK, for purposes of interception,
-  instrumentation, etc. It is a sad fact that using wrappers often
-  noticeably degrades performance of malloc-intensive programs.
-*/
-
-
-#ifdef USE_MALLOC_LOCK
-#define USE_PUBLIC_MALLOC_WRAPPERS
-#else
-/* #define USE_PUBLIC_MALLOC_WRAPPERS */
-#endif
-
-
-/* 
-   Two-phase name translation.
-   All of the actual routines are given mangled names.
-   When wrappers are used, they become the public callable versions.
-   When DL_PREFIX is used, the callable names are prefixed.
-*/
-
-#ifndef USE_PUBLIC_MALLOC_WRAPPERS
-#define cALLOc      public_cALLOc
-#define fREe        public_fREe
-#define mALLOc      public_mALLOc
-#define mEMALIGn    public_mEMALIGn
-#define posix_mEMALIGn    public_posix_mEMALIGn
-#define rEALLOc     public_rEALLOc
-#define vALLOc      public_vALLOc
-#define pVALLOc     public_pVALLOc
-#define mALLINFo2   public_mALLINFo2
-#define mALLOPt     public_mALLOPt
-#define mTRIm       public_mTRIm
-#define mSTATs      public_mSTATs
-#define mUSABLe     public_mUSABLe
-#endif
-
-#ifdef USE_DL_PREFIX
-#define public_cALLOc    dlcalloc
-#define public_fREe      dlfree
-#define public_mALLOc    dlmalloc
-#define public_mEMALIGn  dlmemalign
-#define public_posix_mEMALIGn  dlposix_memalign
-#define public_rEALLOc   dlrealloc
-#define public_vALLOc    dlvalloc
-#define public_pVALLOc   dlpvalloc
-#define public_mALLINFo2 dlmallinfo2
-#define public_mALLOPt   dlmallopt
-#define public_mTRIm     dlmalloc_trim
-#define public_mSTATs    dlmalloc_stats
-#define public_mUSABLe   dlmalloc_usable_size
-#else /* USE_DL_PREFIX */
-#define public_cALLOc    calloc
-#define public_fREe      free
-#define public_mALLOc    malloc
-#define public_mEMALIGn  memalign
-#define public_posix_mEMALIGn  posix_memalign
-#define public_rEALLOc   realloc
-#define public_vALLOc    valloc
-#define public_pVALLOc   pvalloc
-#define public_mALLINFo2 mallinfo2
-#define public_mALLOPt   mallopt
-#define public_mTRIm     malloc_trim
-#define public_mSTATs    malloc_stats
-#define public_mUSABLe   malloc_usable_size
-#endif /* USE_DL_PREFIX */
-
-
-/*
-  HAVE_MEMCPY should be defined if you are not otherwise using
-  ANSI STD C, but still have memcpy and memset in your C library
-  and want to use them in calloc and realloc. Otherwise simple
-  macro versions are defined below.
-
-  USE_MEMCPY should be defined as 1 if you actually want to
-  have memset and memcpy called. People report that the macro
-  versions are faster than libc versions on some systems.
-  
-  Even if USE_MEMCPY is set to 1, loops to copy/clear small chunks
-  (of <= 36 bytes) are manually unrolled in realloc and calloc.
-*/
-
-#ifndef HAVE_MEMCPY
-#define HAVE_MEMCPY
-#endif
-
-#ifndef USE_MEMCPY
-#ifdef HAVE_MEMCPY
-#define USE_MEMCPY 1
-#else
-#define USE_MEMCPY 0
-#endif
-#endif
-
-
-#if (__STD_C || defined(HAVE_MEMCPY))
-
-#ifdef WIN32
-  /* On Win32 memset and memcpy are already declared in windows.h */
-#else
-#if __STD_C
-  /* Defined in string.h */
-#else
-Void_t* memset();
-Void_t* memcpy();
-#endif
-#endif
-#endif
-
-/*
-  MALLOC_FAILURE_ACTION is the action to take before "return 0" when
-  malloc fails to be able to return memory, either because memory is
-  exhausted or because of illegal arguments.
-  
-  By default, sets errno if running on STD_C platform, else does nothing.  
-*/
-
-#ifndef MALLOC_FAILURE_ACTION
-#if __STD_C
-#define MALLOC_FAILURE_ACTION \
-   errno = ENOMEM;
-
-#else
-#define MALLOC_FAILURE_ACTION
-#endif
-#endif
-
-/*
-  MORECORE-related declarations. By default, rely on sbrk
-*/
-
-
-#if !defined(HAVE_UNISTD_H)
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-#if __STD_C
-extern Void_t*     sbrk(ptrdiff_t);
-#else
-extern Void_t*     sbrk();
-#endif
-#endif
-#endif
-
-/*
-  MORECORE_FAILURE is the value returned upon failure of MORECORE
-  as well as mmap. Since it cannot be an otherwise valid memory address,
-  and must reflect values of standard sys calls, you probably ought not
-  try to redefine it.
-*/
-
-#ifndef MORECORE_FAILURE
-#define MORECORE_FAILURE ((void*)(-1UL))
-#endif
-
-/*
-  MORECORE is the name of the routine to call to obtain more memory
-  from the system.  See below for general guidance on writing
-  alternative MORECORE functions, as well as a version for WIN32 and a
-  sample version for pre-OSX macos.
-*/
-
-#ifndef MORECORE
-#define MORECORE sbrk
-#endif
-
-
-/*
-  If MORECORE_CONTIGUOUS is true, take advantage of fact that
-  consecutive calls to MORECORE with positive arguments always return
-  contiguous increasing addresses.  This is true of unix sbrk.  Even
-  if not defined, when regions happen to be contiguous, malloc will
-  permit allocations spanning regions obtained from different
-  calls. But defining this when applicable enables some stronger
-  consistency checks and space efficiencies. 
-*/
-
-#ifndef MORECORE_CONTIGUOUS
-#define MORECORE_CONTIGUOUS 1
-#endif
-
-/*
-  Define MORECORE_CANNOT_TRIM if your version of MORECORE
-  cannot release space back to the system when given negative
-  arguments. This is generally necessary only if you are using
-  a hand-crafted MORECORE function that cannot handle negative arguments.
-*/
-
-/* #define MORECORE_CANNOT_TRIM */
-
-
-/*
-  This malloc requires mmap for heap management data. It is an error
-  if mmap is not available.
-
-  Additionally, mmap will be used to satisfy large requests.
-*/
-
-#ifndef HAVE_MMAP
-#  error HAVE_MMAP not defined, has your operating system mmap?
-#endif
-
-/* 
-   Standard unix mmap using /dev/zero clears memory so calloc doesn't
-   need to.
-*/
-
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 1
-#endif
-
-
-/* 
-   MMAP_AS_MORECORE_SIZE is the minimum mmap size argument to use if
-   sbrk fails, and mmap is used as a backup (which is done only if
-   HAVE_MMAP).  The value must be a multiple of page size.  This
-   backup strategy generally applies only when systems have "holes" in
-   address space, so sbrk cannot perform contiguous expansion, but
-   there is still space available on system.  On systems for which
-   this is known to be useful (i.e. most linux kernels), this occurs
-   only when programs allocate huge amounts of memory.  Between this,
-   and the fact that mmap regions tend to be limited, the size should
-   be large, to avoid too many mmap calls and thus avoid running out
-   of kernel resources.
-*/
-
-#ifndef MMAP_AS_MORECORE_SIZE
-#define MMAP_AS_MORECORE_SIZE (1024 * 1024)
-#endif
-
-
-/*
-  The system page size. To the extent possible, this malloc manages
-  memory from the system in page-size units.  Note that this value is
-  cached during initialization into a field of malloc_state. So even
-  if malloc_getpagesize is a function, it is only called once.
-
-  The following mechanics for getpagesize were adapted from bsd/gnu
-  getpagesize.h. If none of the system-probes here apply, a value of
-  4096 is used, which should be OK: If they don't apply, then using
-  the actual value probably doesn't impact performance.
-*/
-
-
-#ifndef malloc_getpagesize
-
-#  ifdef _SC_PAGESIZE         /* some SVR4 systems omit an underscore */
-#    ifndef _SC_PAGE_SIZE
-#      define _SC_PAGE_SIZE _SC_PAGESIZE
-#    endif
-#  endif
-
-#  ifdef _SC_PAGE_SIZE
-#    define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
-#  else
-#    if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
-       extern size_t getpagesize();
-#      define malloc_getpagesize getpagesize()
-#    else
-#      ifdef WIN32 /* use supplied emulation of getpagesize */
-#        define malloc_getpagesize getpagesize() 
-#      else
-#        if defined(HAVE_SYS_PARAM_H)
-#          include <sys/param.h>
-#        endif
-#        ifdef EXEC_PAGESIZE
-#          define malloc_getpagesize EXEC_PAGESIZE
-#        else
-#          ifdef NBPG
-#            ifndef CLSIZE
-#              define malloc_getpagesize NBPG
-#            else
-#              define malloc_getpagesize (NBPG * CLSIZE)
-#            endif
-#          else
-#            ifdef NBPC
-#              define malloc_getpagesize NBPC
-#            else
-#              ifdef PAGESIZE
-#                define malloc_getpagesize PAGESIZE
-#              else /* just guess */
-#                define malloc_getpagesize (4096) 
-#              endif
-#            endif
-#          endif
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-/*
-  This version of malloc supports the standard SVID/XPG mallinfo2
-  routine that returns a struct containing usage properties and
-  statistics. It should work on any SVID/XPG compliant system that has
-  a /usr/include/malloc.h defining struct mallinfo2. (If you'd like to
-  install such a thing yourself, cut out the preliminary declarations
-  as described above and below and save them in a malloc.h file. But
-  there's no compelling reason to bother to do this.)
-
-  The main declaration needed is the mallinfo2 struct that is returned
-  (by-copy) by mallinfo2().  The SVID/XPG malloinfo2 struct contains a
-  bunch of fields that are not even meaningful in this version of
-  malloc.  These fields are are instead filled by mallinfo2() with
-  other numbers that might be of interest.
-
-  HAVE_MALLOC_H should be set if you have a
-  /usr/include/malloc.h file that includes a declaration of struct
-  mallinfo2.  If so, it is included; else an SVID2/XPG2 compliant
-  version is declared below.  These must be precisely the same for
-  mallinfo2() to work.  The original SVID version of this struct,
-  defined on most systems with mallinfo2, declares all fields as
-  size_2. But some others define as unsigned long. If your system
-  defines the fields using a type of different width than listed here,
-  you must #include your system version and #define
-  HAVE_MALLOC_H.
-*/
-
-/* #define HAVE_MALLOC_H */
-
-/* On *BSD, malloc.h is deprecated, and on some *BSD including 
- * it may actually raise an error.
- */
-#if defined(HAVE_MALLOC_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 33)
-#include <malloc.h>
-#else
-
-/* SVID2/XPG mallinfo2 structure */
-
-struct mallinfo2 {
-  size_t arena;    /* non-mmapped space allocated from system */
-  size_t ordblks;  /* number of free chunks */
-  size_t smblks;   /* number of fastbin blocks */
-  size_t hblks;    /* number of mmapped regions */
-  size_t hblkhd;   /* space in mmapped regions */
-  size_t usmblks;  /* maximum total allocated space */
-  size_t fsmblks;  /* space available in freed fastbin blocks */
-  size_t uordblks; /* total allocated space */
-  size_t fordblks; /* total free space */
-  size_t keepcost; /* top-most, releasable (via malloc_trim) space */
-};
-
-/*
-  SVID/XPG defines four standard parameter numbers for mallopt,
-  normally defined in malloc.h.  Only one of these (M_MXFAST) is used
-  in this malloc. The others (M_NLBLKS, M_GRAIN, M_KEEP) don't apply,
-  so setting them has no effect. But this malloc also supports other
-  options in mallopt described below.
-*/
-#endif
-
-
-/* ---------- description of public routines ------------ */
-
-/*
-  malloc(size_t n)
-  Returns a pointer to a newly allocated chunk of at least n bytes, or null
-  if no space is available. Additionally, on failure, errno is
-  set to ENOMEM on ANSI C systems.
-
-  If n is zero, malloc returns a minumum-sized chunk. (The minimum
-  size is 16 bytes on most 32bit systems, and 24 or 32 bytes on 64bit
-  systems.)  On most systems, size_t is an unsigned type, so calls
-  with negative arguments are interpreted as requests for huge amounts
-  of space, which will often fail. The maximum supported value of n
-  differs across systems, but is in all cases less than the maximum
-  representable value of a size_t.
-*/
-#if __STD_C
-Void_t*  public_mALLOc(size_t) __attribute_malloc__;
-#else
-Void_t*  public_mALLOc();
-#endif
-
-/*
-  free(Void_t* p)
-  Releases the chunk of memory pointed to by p, that had been previously
-  allocated using malloc or a related routine such as realloc.
-  It has no effect if p is null. It can have arbitrary (i.e., bad!)
-  effects if p has already been freed.
-
-  Unless disabled (using mallopt), freeing very large spaces will
-  when possible, automatically trigger operations that give
-  back unused memory to the system, thus reducing program footprint.
-*/
-#if __STD_C
-void     public_fREe(Void_t*);
-#else
-void     public_fREe();
-#endif
-
-/*
-  calloc(size_t n_elements, size_t element_size);
-  Returns a pointer to n_elements * element_size bytes, with all locations
-  set to zero.
-*/
-#if __STD_C
-Void_t*  public_cALLOc(size_t, size_t) __attribute_malloc__;
-#else
-Void_t*  public_cALLOc();
-#endif
-
-/*
-  realloc(Void_t* p, size_t n)
-  Returns a pointer to a chunk of size n that contains the same data
-  as does chunk p up to the minimum of (n, p's size) bytes, or null
-  if no space is available. 
-
-  The returned pointer may or may not be the same as p. The algorithm
-  prefers extending p when possible, otherwise it employs the
-  equivalent of a malloc-copy-free sequence.
-
-  If p is null, realloc is equivalent to malloc.  
-
-  If space is not available, realloc returns null, errno is set (if on
-  ANSI) and p is NOT freed.
-
-  if n is for fewer bytes than already held by p, the newly unused
-  space is lopped off and freed if possible.  Unless the #define
-  REALLOC_ZERO_BYTES_FREES is set, realloc with a size argument of
-  zero (re)allocates a minimum-sized chunk.
-
-  Large chunks that were internally obtained via mmap will always
-  be reallocated using malloc-copy-free sequences unless
-  the system supports MREMAP (currently only linux).
-
-  The old unix realloc convention of allowing the last-free'd chunk
-  to be used as an argument to realloc is not supported.
-*/
-#if __STD_C
-Void_t*  public_rEALLOc(Void_t*, size_t) __attribute_malloc__;
-#else
-Void_t*  public_rEALLOc();
-#endif
-
-/*
-  memalign(size_t alignment, size_t n);
-  Returns a pointer to a newly allocated chunk of n bytes, aligned
-  in accord with the alignment argument.
-
-  The alignment argument should be a power of two. If the argument is
-  not a power of two, the nearest greater power is used.
-  8-byte alignment is guaranteed by normal malloc calls, so don't
-  bother calling memalign with an argument of 8 or less.
-
-  Overreliance on memalign is a sure way to fragment space.
-*/
-#if __STD_C
-Void_t*  public_mEMALIGn(size_t, size_t) __attribute_malloc__;
-#else
-Void_t*  public_mEMALIGn();
-#endif
-
-/*
-  posix_memalign(void** memptr, size_t alignment, size_t n);
-  Sets *memptr to the address of a newly allocated chunk of n bytes, aligned
-  in accord with the alignment argument. Returns 0 on success, otherwise
-  an error (EINVAL for incorrect alignment, ENOMEM for out of memory).
-
-  The alignment must be a power of two, and a multiple of sizeof(void *).
-*/
-#if __STD_C
-int public_posix_mEMALIGn(Void_t**, size_t, size_t);
-#else
-int public_posix_mEMALIGn();
-#endif
-
-/*
-  valloc(size_t n);
-  Equivalent to memalign(pagesize, n), where pagesize is the page
-  size of the system. If the pagesize is unknown, 4096 is used.
-*/
-#if __STD_C
-Void_t*  public_vALLOc(size_t) __attribute_malloc__;
-#else
-Void_t*  public_vALLOc();
-#endif
-
-
-
-/*
-  mallopt(int parameter_number, int parameter_value)
-  Sets tunable parameters The format is to provide a
-  (parameter-number, parameter-value) pair.  mallopt then sets the
-  corresponding parameter to the argument value if it can (i.e., so
-  long as the value is meaningful), and returns 1 if successful else
-  0.  SVID/XPG/ANSI defines four standard param numbers for mallopt,
-  normally defined in malloc.h.  Only one of these (M_MXFAST) is used
-  in this malloc. The others (M_NLBLKS, M_GRAIN, M_KEEP) don't apply,
-  so setting them has no effect. But this malloc also supports four
-  other options in mallopt. See below for details.  Briefly, supported
-  parameters are as follows (listed defaults are for "typical"
-  configurations).
-
-  Symbol            param #   default    allowed param values
-  M_MXFAST          1         64         0-80  (0 disables fastbins)
-  M_TRIM_THRESHOLD -1         256*1024   any   (-1U disables trimming)
-  M_TOP_PAD        -2         0          any  
-  M_MMAP_THRESHOLD -3         256*1024   any   (or 0 if no MMAP support)
-  M_MMAP_MAX       -4         65536      any   (0 disables use of mmap)
-*/
-#if __STD_C
-int      public_mALLOPt(int, int);
-#else
-int      public_mALLOPt();
-#endif
-
-
-/*
-  mallinfo2()
-  Returns (by copy) a struct containing various summary statistics:
-
-  arena:     current total non-mmapped bytes allocated from system 
-  ordblks:   the number of free chunks 
-  smblks:    the number of fastbin blocks (i.e., small chunks that
-               have been freed but not use resused or consolidated)
-  hblks:     current number of mmapped regions 
-  hblkhd:    total bytes held in mmapped regions 
-  usmblks:   the maximum total allocated space. This will be greater
-                than current total if trimming has occurred.
-  fsmblks:   total bytes held in fastbin blocks 
-  uordblks:  current total allocated space (normal or mmapped)
-  fordblks:  total free space 
-  keepcost:  the maximum number of bytes that could ideally be released
-               back to system via malloc_trim. ("ideally" means that
-               it ignores page restrictions etc.)
-
-  Because these fields are ints, but internal bookkeeping may
-  be kept as longs, the reported values may wrap around zero and 
-  thus be inaccurate.
-*/
-#if __STD_C
-struct mallinfo2 public_mALLINFo2(void);
-#else
-struct mallinfo2 public_mALLINFo2();
-#endif
-
-/*
-  pvalloc(size_t n);
-  Equivalent to valloc(minimum-page-that-holds(n)), that is,
-  round up n to nearest pagesize.
- */
-#if __STD_C
-Void_t*  public_pVALLOc(size_t) __attribute_malloc__;
-#else
-Void_t*  public_pVALLOc();
-#endif
-
-/*
-  malloc_trim(size_t pad);
-
-  If possible, gives memory back to the system (via negative
-  arguments to sbrk) if there is unused memory at the `high' end of
-  the malloc pool. You can call this after freeing large blocks of
-  memory to potentially reduce the system-level memory requirements
-  of a program. However, it cannot guarantee to reduce memory. Under
-  some allocation patterns, some large free blocks of memory will be
-  locked between two used chunks, so they cannot be given back to
-  the system.
-  
-  The `pad' argument to malloc_trim represents the amount of free
-  trailing space to leave untrimmed. If this argument is zero,
-  only the minimum amount of memory to maintain internal data
-  structures will be left (one page or less). Non-zero arguments
-  can be supplied to maintain enough trailing space to service
-  future expected allocations without having to re-obtain memory
-  from the system.
-  
-  Malloc_trim returns 1 if it actually released any memory, else 0.
-  On systems that do not support "negative sbrks", it will always
-  rreturn 0.
-*/
-#if __STD_C
-int      public_mTRIm(size_t);
-#else
-int      public_mTRIm();
-#endif
-
-/*
-  malloc_usable_size(Void_t* p);
-
-  Returns the number of bytes you can actually use in
-  an allocated chunk, which may be more than you requested (although
-  often not) due to alignment and minimum size constraints.
-  You can use this many bytes without worrying about
-  overwriting other allocated objects. This is not a particularly great
-  programming practice. malloc_usable_size can be more useful in
-  debugging and assertions, for example:
-
-  p = malloc(n);
-  assert(malloc_usable_size(p) >= 256);
-
-*/
-#if __STD_C
-size_t   public_mUSABLe(Void_t*);
-#else
-size_t   public_mUSABLe();
-#endif
-
-/*
-  malloc_stats();
-  Prints on stderr the amount of space obtained from the system (both
-  via sbrk and mmap), the maximum amount (which may be more than
-  current if malloc_trim and/or munmap got called), and the current
-  number of bytes allocated via malloc (or realloc, etc) but not yet
-  freed. Note that this is the number of bytes allocated, not the
-  number requested. It will be larger than the number requested
-  because of alignment and bookkeeping overhead. Because it includes
-  alignment wastage as being in use, this figure may be greater than
-  zero even when no user-level chunks are allocated.
-
-  The reported current and maximum system memory can be inaccurate if
-  a program makes other calls to system memory allocation functions
-  (normally sbrk) outside of malloc.
-
-  malloc_stats prints only the most commonly interesting statistics.
-  More information can be obtained by calling mallinfo2.
-
-*/
-#if __STD_C
-void     public_mSTATs();
-#else
-void     public_mSTATs();
-#endif
-
-/* mallopt tuning options */
-
-/*
-  M_MXFAST is the maximum request size used for "fastbins", special bins
-  that hold returned chunks without consolidating their spaces. This
-  enables future requests for chunks of the same size to be handled
-  very quickly, but can increase fragmentation, and thus increase the
-  overall memory footprint of a program.
-
-  This malloc manages fastbins very conservatively yet still
-  efficiently, so fragmentation is rarely a problem for values less
-  than or equal to the default.  The maximum supported value of MXFAST
-  is 80. You wouldn't want it any higher than this anyway.  Fastbins
-  are designed especially for use with many small structs, objects or
-  strings -- the default handles structs/objects/arrays with sizes up
-  to 16 4byte fields, or small strings representing words, tokens,
-  etc. Using fastbins for larger objects normally worsens
-  fragmentation without improving speed.
-
-  M_MXFAST is set in REQUEST size units. It is internally used in
-  chunksize units, which adds padding and alignment.  You can reduce
-  M_MXFAST to 0 to disable all use of fastbins.  This causes the malloc
-  algorithm to be a closer approximation of fifo-best-fit in all cases,
-  not just for larger requests, but will generally cause it to be
-  slower.
-*/
-
-
-/* M_MXFAST is a standard SVID/XPG tuning option, usually listed in malloc.h */
-#ifndef M_MXFAST
-#define M_MXFAST            1    
-#endif
-
-#ifndef DEFAULT_MXFAST
-#define DEFAULT_MXFAST     64
-#endif
-
-
-/*
-  M_TRIM_THRESHOLD is the maximum amount of unused top-most memory
-  to keep before releasing via malloc_trim in free().
-
-  Automatic trimming is mainly useful in long-lived programs.
-  Because trimming via sbrk can be slow on some systems, and can
-  sometimes be wasteful (in cases where programs immediately
-  afterward allocate more large chunks) the value should be high
-  enough so that your overall system performance would improve by
-  releasing this much memory.
-
-  The trim threshold and the mmap control parameters (see below)
-  can be traded off with one another. Trimming and mmapping are
-  two different ways of releasing unused memory back to the
-  system. Between these two, it is often possible to keep
-  system-level demands of a long-lived program down to a bare
-  minimum. For example, in one test suite of sessions measuring
-  the XF86 X server on Linux, using a trim threshold of 128K and a
-  mmap threshold of 192K led to near-minimal long term resource
-  consumption.
-
-  If you are using this malloc in a long-lived program, it should
-  pay to experiment with these values.  As a rough guide, you
-  might set to a value close to the average size of a process
-  (program) running on your system.  Releasing this much memory
-  would allow such a process to run in memory.  Generally, it's
-  worth it to tune for trimming rather tham memory mapping when a
-  program undergoes phases where several large chunks are
-  allocated and released in ways that can reuse each other's
-  storage, perhaps mixed with phases where there are no such
-  chunks at all.  And in well-behaved long-lived programs,
-  controlling release of large blocks via trimming versus mapping
-  is usually faster.
-
-  However, in most programs, these parameters serve mainly as
-  protection against the system-level effects of carrying around
-  massive amounts of unneeded memory. Since frequent calls to
-  sbrk, mmap, and munmap otherwise degrade performance, the default
-  parameters are set to relatively high values that serve only as
-  safeguards.
-
-  The trim value must be greater than page size to have any useful
-  effect.  To disable trimming completely, you can set to 
-  (unsigned long)(-1)
-
-  Trim settings interact with fastbin (MXFAST) settings: Unless
-  TRIM_FASTBINS is defined, automatic trimming never takes place upon
-  freeing a chunk with size less than or equal to MXFAST. Trimming is
-  instead delayed until subsequent freeing of larger chunks. However,
-  you can still force an attempted trim by calling malloc_trim.
-
-  Also, trimming is not generally possible in cases where
-  the main arena is obtained via mmap.
-
-  Note that the trick some people use of mallocing a huge space and
-  then freeing it at program startup, in an attempt to reserve system
-  memory, doesn't have the intended effect under automatic trimming,
-  since that memory will immediately be returned to the system.
-*/
-
-#define M_TRIM_THRESHOLD       -1
-
-#ifndef DEFAULT_TRIM_THRESHOLD
-#define DEFAULT_TRIM_THRESHOLD (256 * 1024)
-#endif
-
-/*
-  M_TOP_PAD is the amount of extra `padding' space to allocate or
-  retain whenever sbrk is called. It is used in two ways internally:
-
-  * When sbrk is called to extend the top of the arena to satisfy
-  a new malloc request, this much padding is added to the sbrk
-  request.
-
-  * When malloc_trim is called automatically from free(),
-  it is used as the `pad' argument.
-
-  In both cases, the actual amount of padding is rounded
-  so that the end of the arena is always a system page boundary.
-
-  The main reason for using padding is to avoid calling sbrk so
-  often. Having even a small pad greatly reduces the likelihood
-  that nearly every malloc request during program start-up (or
-  after trimming) will invoke sbrk, which needlessly wastes
-  time.
-
-  Automatic rounding-up to page-size units is normally sufficient
-  to avoid measurable overhead, so the default is 0.  However, in
-  systems where sbrk is relatively slow, it can pay to increase
-  this value, at the expense of carrying around more memory than
-  the program needs.
-*/
-
-#define M_TOP_PAD              -2
-
-#ifndef DEFAULT_TOP_PAD
-#define DEFAULT_TOP_PAD        (0)
-#endif
-
-/*
-  M_MMAP_THRESHOLD is the request size threshold for using mmap()
-  to service a request. Requests of at least this size that cannot
-  be allocated using already-existing space will be serviced via mmap.
-  (If enough normal freed space already exists it is used instead.)
-
-  Using mmap segregates relatively large chunks of memory so that
-  they can be individually obtained and released from the host
-  system. A request serviced through mmap is never reused by any
-  other request (at least not directly; the system may just so
-  happen to remap successive requests to the same locations).
-
-  Segregating space in this way has the benefits that:
-
-   1. Mmapped space can ALWAYS be individually released back 
-      to the system, which helps keep the system level memory 
-      demands of a long-lived program low. 
-   2. Mapped memory can never become `locked' between
-      other chunks, as can happen with normally allocated chunks, which
-      means that even trimming via malloc_trim would not release them.
-   3. On some systems with "holes" in address spaces, mmap can obtain
-      memory that sbrk cannot.
-
-  However, it has the disadvantages that:
-
-   1. The space cannot be reclaimed, consolidated, and then
-      used to service later requests, as happens with normal chunks.
-   2. It can lead to more wastage because of mmap page alignment
-      requirements
-   3. It causes malloc performance to be more dependent on host
-      system memory management support routines which may vary in
-      implementation quality and may impose arbitrary
-      limitations. Generally, servicing a request via normal
-      malloc steps is faster than going through a system's mmap.
-
-  The advantages of mmap nearly always outweigh disadvantages for
-  "large" chunks, but the value of "large" varies across systems.  The
-  default is an empirically derived value that works well in most
-  systems.
-*/
-
-#define M_MMAP_THRESHOLD      -3
-
-#ifndef DEFAULT_MMAP_THRESHOLD
-#define DEFAULT_MMAP_THRESHOLD (256 * 1024)
-#endif
-
-/*
-  M_MMAP_MAX is the maximum number of requests to simultaneously
-  service using mmap. This parameter exists because
-. Some systems have a limited number of internal tables for
-  use by mmap, and using more than a few of them may degrade
-  performance.
-
-  The default is set to a value that serves only as a safeguard.
-  Setting to 0 disables use of mmap for servicing large requests.  If
-  HAVE_MMAP is not set, the default value is 0, and attempts to set it
-  to non-zero values in mallopt will fail.
-*/
-
-#define M_MMAP_MAX             -4
-
-#ifndef DEFAULT_MMAP_MAX
-#define DEFAULT_MMAP_MAX       (65536)
-#endif
-
-#ifdef __cplusplus
-};  /* end of extern "C" */
-#endif
-
-/* 
-  ========================================================================
-  To make a fully customizable malloc.h header file, cut everything
-  above this line, put into file malloc.h, edit to suit, and #include it 
-  on the next line, as well as in programs that use this malloc.
-  ========================================================================
-*/
-
-/* #include "malloc.h" */
-
-/* --------------------- public wrappers ---------------------- */
-
-#ifdef USE_PUBLIC_MALLOC_WRAPPERS
-
-/* DL_STATIC used to make functions (deep down) consistent
- * with prototypes (otherwise the prototypes are static
- * with USE_PUBLIC_MALLOC_WRAPPERS, but the functions aren't).
- * The gcc compiler doesn't care, but the HP-UX compiler does.
- */
-#define DL_STATIC static
-
-/* Declare all routines as internal */
-#if __STD_C
-static Void_t*  mALLOc(size_t) __attribute_malloc__;
-static void     fREe(Void_t*);
-static Void_t*  rEALLOc(Void_t*, size_t) __attribute_malloc__;
-static Void_t*  mEMALIGn(size_t, size_t) __attribute_malloc__;
-static int      posix_mEMALIGn(Void_t**, size_t, size_t);
-static Void_t*  vALLOc(size_t) __attribute_malloc__;
-static Void_t*  pVALLOc(size_t) __attribute_malloc__;
-static Void_t*  cALLOc(size_t, size_t) __attribute_malloc__;
-static int      mTRIm(size_t);
-static size_t   mUSABLe(Void_t*);
-static void     mSTATs();
-static int      mALLOPt(int, int);
-static struct mallinfo2 mALLINFo2(void);
-#else
-static Void_t*  mALLOc();
-static void     fREe();
-static Void_t*  rEALLOc();
-static Void_t*  mEMALIGn();
-static int      posix_mEMALIGn();
-static Void_t*  vALLOc();
-static Void_t*  pVALLOc();
-static Void_t*  cALLOc();
-static int      mTRIm();
-static size_t   mUSABLe();
-static void     mSTATs();
-static int      mALLOPt();
-static struct mallinfo2 mALLINFo2();
-#endif
-
-/*
-  MALLOC_PREACTION and MALLOC_POSTACTION should be
-  defined to return 0 on success, and nonzero on failure.
-  The return value of MALLOC_POSTACTION is currently ignored
-  in wrapper functions since there is no reasonable default
-  action to take on failure.
-*/
-
-
-#ifdef USE_MALLOC_LOCK
-
-# ifdef WIN32
-
-static int mALLOC_MUTEx;
-#define MALLOC_PREACTION   slwait(&mALLOC_MUTEx)
-#define MALLOC_POSTACTION  slrelease(&mALLOC_MUTEx)
-int dnmalloc_pthread_init(void) { return 0; }
-
-# elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
-
-#   if defined(__NetBSD__)
-#include <reentrant.h>
-extern int __isthreaded;
-static mutex_t thread_lock = MUTEX_INITIALIZER;
-#define _MALLOC_LOCK()   if (__isthreaded) mutex_lock(&thread_lock)
-#define _MALLOC_UNLOCK() if (__isthreaded) mutex_unlock(&thread_lock)
-void _malloc_prefork(void) {  _MALLOC_LOCK(); }
-void _malloc_postfork(void) { _MALLOC_UNLOCK(); }
-#   endif
-
-#   if defined(__OpenBSD__)
-extern int  __isthreaded;
-void   _thread_malloc_lock(void);
-void   _thread_malloc_unlock(void);
-#define _MALLOC_LOCK()           if (__isthreaded) _thread_malloc_lock()
-#define _MALLOC_UNLOCK()         if (__isthreaded) _thread_malloc_unlock()
-#   endif
-
-#   if defined(__FreeBSD__)
-extern int      __isthreaded;
-struct _spinlock {
-	volatile long	access_lock;
-	volatile long	lock_owner;
-	volatile char	*fname;
-	volatile int	lineno;
-};
-typedef struct _spinlock spinlock_t;
-#define	_SPINLOCK_INITIALIZER	{ 0, 0, 0, 0 }
-void	_spinlock(spinlock_t *);
-void	_spinunlock(spinlock_t *);
-/* # include "/usr/src/lib/libc/include/spinlock.h" */
-static spinlock_t thread_lock   = _SPINLOCK_INITIALIZER;
-spinlock_t *__malloc_lock       = &thread_lock;
-#define _MALLOC_LOCK()           if (__isthreaded) _spinlock(&thread_lock)
-#define _MALLOC_UNLOCK()         if (__isthreaded) _spinunlock(&thread_lock)
-#   endif
-
-/* Common for all three *BSD
- */
-static int malloc_active = 0;
-static int dnmalloc_mutex_lock()
-{
-  _MALLOC_LOCK();
-  if (!malloc_active)
-    {
-      ++malloc_active;
-      return 0;
-    }
-  assert(malloc_active == 0);
-  _MALLOC_UNLOCK();
-  errno = EDEADLK;
-  return 1;
-}
-static int dnmalloc_mutex_unlock()
-{
-  --malloc_active;
-  _MALLOC_UNLOCK();
-  return 0;
-}
-#define MALLOC_PREACTION   dnmalloc_mutex_lock()
-#define MALLOC_POSTACTION  dnmalloc_mutex_unlock()
-int dnmalloc_pthread_init(void) { return 0; }
-
-# else
-
-/* Wrapping malloc with pthread_mutex_lock/pthread_mutex_unlock
- *
- * Works fine on linux (no malloc in pthread_mutex_lock)
- * Works with on HP-UX if initialized after entering main()
- */ 
-#include <pthread.h>
-static int malloc_active      = 0;
-void dnmalloc_fork_prepare(void);
-void dnmalloc_fork_parent(void);
-void dnmalloc_fork_child(void);
-
-#if !defined(__linux__)
-
-static pthread_mutex_t mALLOC_MUTEx;
-pthread_once_t dnmalloc_once_control = PTHREAD_ONCE_INIT;
-static int dnmalloc_use_mutex = 0;
-static void dnmalloc_pthread_init_int(void)
-{
-  pthread_mutexattr_t   mta;
-  pthread_mutexattr_init(&mta);
-  pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
-  pthread_mutex_init(&(mALLOC_MUTEx), &mta);
-  pthread_mutexattr_destroy(&mta);       
-  pthread_atfork(dnmalloc_fork_prepare, 
-		 dnmalloc_fork_parent,
-		 dnmalloc_fork_child);
-  dnmalloc_use_mutex = 1;
-}
-int dnmalloc_pthread_init(void)
-{
-  return pthread_once(&dnmalloc_once_control, dnmalloc_pthread_init_int);
-}
-
-#else
-
-static pthread_mutex_t mALLOC_MUTEx = PTHREAD_MUTEX_INITIALIZER;
-static int dnmalloc_use_mutex = 1;
-int dnmalloc_pthread_init(void) { 
-  return pthread_atfork(dnmalloc_fork_prepare, 
-			dnmalloc_fork_parent,
-			dnmalloc_fork_child); 
-}
-#endif /* !defined(__linux__) */
-
-void dnmalloc_fork_prepare(void) { 
-  if (dnmalloc_use_mutex) 
-    pthread_mutex_lock(&mALLOC_MUTEx);
-}
-void dnmalloc_fork_parent(void) { 
-  if (dnmalloc_use_mutex)
-    pthread_mutex_unlock(&mALLOC_MUTEx); 
-}
-void dnmalloc_fork_child(void) {
-  int rc = 0;
-#ifdef __GLIBC__
-  if (dnmalloc_use_mutex)
-    {
-      pthread_mutex_unlock (&mALLOC_MUTEx);
-      pthread_mutex_destroy(&mALLOC_MUTEx);
-      rc = pthread_mutex_init(&mALLOC_MUTEx, NULL);
-    } 
-#else
-  if (dnmalloc_use_mutex)
-    rc = pthread_mutex_unlock(&mALLOC_MUTEx); 
-#endif
-  if (rc != 0)
-    {
-      fputs("fork_child failed", stderr);
-      _exit(EXIT_FAILURE);
-    }
-}
-static int dnmalloc_mutex_lock(pthread_mutex_t *mutex)
-{
-  if (dnmalloc_use_mutex)
-    {
-      int rc = pthread_mutex_lock(mutex);
-      if (rc == 0)
-	{
-	  if (!malloc_active)
-	    {
-	      ++malloc_active;
-	      return 0;
-	    }
-	  assert(malloc_active == 0);
-	  (void) pthread_mutex_unlock(mutex);
-	  errno = EDEADLK;
-	  return 1;
-	}
-      return rc;
-    }
-  return 0;
-}
-static int dnmalloc_mutex_unlock(pthread_mutex_t *mutex)
-{
-  if (dnmalloc_use_mutex)
-    {
-      --malloc_active;
-      return pthread_mutex_unlock(mutex);
-    }
-  return 0;
-}
-# define MALLOC_PREACTION   dnmalloc_mutex_lock(&mALLOC_MUTEx)
-# define MALLOC_POSTACTION  dnmalloc_mutex_unlock(&mALLOC_MUTEx)
-
-# endif
-
-#else
-
-/* Substitute anything you like for these */
-
-# define MALLOC_PREACTION   (0)
-# define MALLOC_POSTACTION  (0)
-int dnmalloc_pthread_init(void) { return 0; }
-
-#endif /* USE_MALLOC_LOCK */
-
-Void_t* public_mALLOc(size_t bytes) {
-  Void_t* m;
-  if (MALLOC_PREACTION == 0) {
-    m = mALLOc(bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-void public_fREe(Void_t* m) {
-  if (MALLOC_PREACTION == 0) {
-    fREe(m);
-    (void) MALLOC_POSTACTION;
-  }
-}
-
-Void_t* public_rEALLOc(Void_t* m, size_t bytes) {
-  if (MALLOC_PREACTION == 0) {
-    m = rEALLOc(m, bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-Void_t* public_mEMALIGn(size_t alignment, size_t bytes) {
-  Void_t* m;
-  if (MALLOC_PREACTION == 0) {
-    m = mEMALIGn(alignment, bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-int public_posix_mEMALIGn(Void_t**memptr, size_t alignment, size_t bytes) {
-  int m, ret;
-  if ((ret = MALLOC_PREACTION) == 0) {
-    m = posix_mEMALIGn(memptr, alignment, bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return ret;
-}
-
-Void_t* public_vALLOc(size_t bytes) {
-  Void_t* m;
-  if (MALLOC_PREACTION == 0) {
-    m = vALLOc(bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-Void_t* public_pVALLOc(size_t bytes) {
-  Void_t* m;
-  if (MALLOC_PREACTION == 0) {
-    m = pVALLOc(bytes);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-Void_t* public_cALLOc(size_t n, size_t elem_size) {
-  Void_t* m;
-  if (MALLOC_PREACTION == 0) {
-    m = cALLOc(n, elem_size);
-    (void) MALLOC_POSTACTION;
-    return m;
-  }
-  return 0;
-}
-
-int public_mTRIm(size_t s) {
-  int result;
-  if (MALLOC_PREACTION == 0) {
-    result = mTRIm(s);
-    (void) MALLOC_POSTACTION;
-    return result;
-  }
-  return 0;
-}
-
-size_t public_mUSABLe(Void_t* m) {
-  size_t result;
-  if (MALLOC_PREACTION == 0) {
-    result = mUSABLe(m);
-    (void) MALLOC_POSTACTION;
-    return result;
-  }
-  return 0;
-}
-
-void public_mSTATs() {
-  if (MALLOC_PREACTION == 0) {
-    mSTATs();
-    (void) MALLOC_POSTACTION;
-  }
-}
-
-struct mallinfo2 public_mALLINFo2() {
-  struct mallinfo2 m;
-  if (MALLOC_PREACTION == 0) {
-    m = mALLINFo2();
-    (void) MALLOC_POSTACTION;
-    return m;
-  } else {
-    struct mallinfo2 nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-    return nm;
-  }
-}
-
-int public_mALLOPt(int p, int v) {
-  int result;
-  if (MALLOC_PREACTION == 0) {
-    result = mALLOPt(p, v);
-    (void) MALLOC_POSTACTION;
-    return result;
-  }
-  return 0;
-}
-
-#else
-
-int dnmalloc_pthread_init(void) { return 0; }
-#define DL_STATIC
-
-#endif /* USE_PUBLIC_MALLOC_WRAPPERS */
-
-
-
-/* ------------- Optional versions of memcopy ---------------- */
-
-
-#if USE_MEMCPY
-
-/* 
-  Note: memcpy is ONLY invoked with non-overlapping regions,
-  so the (usually slower) memmove is not needed.
-*/
-
-#define MALLOC_COPY(dest, src, nbytes)  memcpy(dest, src, nbytes)
-#define MALLOC_ZERO(dest, nbytes)       memset(dest, 0,   nbytes)
-
-#else /* !USE_MEMCPY */
-
-/* Use Duff's device for good zeroing/copying performance. */
-
-#define MALLOC_ZERO(charp, nbytes)                                            \
-do {                                                                          \
-  INTERNAL_SIZE_T* mzp = (INTERNAL_SIZE_T*)(charp);                           \
-  CHUNK_SIZE_T  mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T);                     \
-  long mcn;                                                                   \
-  if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; }             \
-  switch (mctmp) {                                                            \
-    case 0: for(;;) { *mzp++ = 0;                                             \
-    case 7:           *mzp++ = 0;                                             \
-    case 6:           *mzp++ = 0;                                             \
-    case 5:           *mzp++ = 0;                                             \
-    case 4:           *mzp++ = 0;                                             \
-    case 3:           *mzp++ = 0;                                             \
-    case 2:           *mzp++ = 0;                                             \
-    case 1:           *mzp++ = 0; if(mcn <= 0) break; mcn--; }                \
-  }                                                                           \
-} while(0)
-
-#define MALLOC_COPY(dest,src,nbytes)                                          \
-do {                                                                          \
-  INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) src;                            \
-  INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) dest;                           \
-  CHUNK_SIZE_T  mctmp = (nbytes)/sizeof(INTERNAL_SIZE_T);                     \
-  long mcn;                                                                   \
-  if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp %= 8; }             \
-  switch (mctmp) {                                                            \
-    case 0: for(;;) { *mcdst++ = *mcsrc++;                                    \
-    case 7:           *mcdst++ = *mcsrc++;                                    \
-    case 6:           *mcdst++ = *mcsrc++;                                    \
-    case 5:           *mcdst++ = *mcsrc++;                                    \
-    case 4:           *mcdst++ = *mcsrc++;                                    \
-    case 3:           *mcdst++ = *mcsrc++;                                    \
-    case 2:           *mcdst++ = *mcsrc++;                                    \
-    case 1:           *mcdst++ = *mcsrc++; if(mcn <= 0) break; mcn--; }       \
-  }                                                                           \
-} while(0)
-
-#endif
-
-/* ------------------ MMAP support ------------------  */
-
-
-#if defined(HAVE_FCNTL_H)
-#include <fcntl.h>
-#endif
-
-#if defined(HAVE_SYS_MMAN_H)
-#include <sys/mman.h>
-#endif
-
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-/* 
-   Nearly all versions of mmap support MAP_ANONYMOUS, 
-   so the following is unlikely to be needed, but is
-   supplied just in case.
-*/
-
-#ifndef MAP_ANONYMOUS
-
-/* rw 19.05.2008 changed to avoid cached file descriptor, untested 
- */
-void * anon_mmap (void *addr, size_t length, int prot, int flags)
-{
-  void * retval   = NULL;
-  int dev_zero_fd = -1; /* File descriptor for /dev/zero. */
-
-  dev_zero_fd = open("/dev/zero", O_RDWR);
-  if (dev_zero_fd >= 0)
-    {
-      retval = mmap((addr), (size), (prot), (flags), dev_zero_fd, 0);
-      /* closing the file descriptor does not unmap the region */
-      close(dev_zero_fd); 
-    }
-  return retval;
-}
-  
-#define MMAP(addr, size, prot, flags) \
-  (anon_mmap((addr), (size), (prot), (flags)))
-
-
-#else /* have MAP_ANONYMOUS */
-
-#if !defined(MAP_32BIT) && defined(MAP_ADDR32)
-#define MAP_32BIT MAP_ADDR32
-#endif
-
-#if defined(MAP_32BIT)
-#define MMAP(addr, size, prot, flags) \
- (mmap((addr), (size), (prot), (flags)|MAP_ANONYMOUS|MAP_32BIT, -1, 0))
-#elif defined(__sun)
-/* 
- * Hint an address within 32bit address space
- */
-#define MMAP(addr, size, prot, flags) \
- (mmap((void*)0xC0000000, (size), (prot), (flags)|MAP_ANONYMOUS, -1, 0))
-#else
-/* *BSD */
-#define MMAP(addr, size, prot, flags) \
- (mmap((void*)0x80000000, (size), (prot), (flags)|MAP_ANONYMOUS, -1, 0))
-#endif
-
-#endif /* have MAP_ANONYMOUS */
-
-
-/*
-  -----------------------  Chunk representations -----------------------
-*/
-
-typedef void * mchunkptr;
-
-struct chunkinfo {
-   INTERNAL_SIZE_T      prev_size;  /* Size of previous in bytes          */
-   INTERNAL_SIZE_T      size;       /* Size in bytes, including overhead. */
-   INTERNAL_SIZE_T      req;        /* Original request size, for guard.  */
-   struct chunkinfo* hash_next;     /* contains a pointer to the next chunk 
-                                       in the linked list if the hash
-                                       value is the same as the chunk     */
-   struct chunkinfo* fd;	    /* double links -- used only if free. */
-   struct chunkinfo* bk;
-   mchunkptr chunk;
-};
-
-typedef struct chunkinfo* chunkinfoptr;
-
-struct cireginfo {
-	unsigned long position;
-	unsigned long *freebitmap;
-	struct cireginfo* next;
-	struct chunkinfo *freelist;
-	struct chunkinfo *begin; 
-	unsigned long freecounter; 
-};
-
-/*
-  ---------- Size and alignment checks and conversions ----------
-*/
-
-/* conversion from malloc headers to user pointers, and back */
-#define chunk(p) (p->chunk)
-
-
-#define chunk2mem(p)   (chunk(p))
-#define mem2chunk(mem) (hashtable_lookup(mem))
-
-/* The smallest possible chunk      */
-/* #define MIN_CHUNK_SIZE        16 */
-#if (SIZEOF_UNSIGNED_LONG == 8) || defined(__arch64__) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__64BIT__) || defined(_LP64) || defined(_M_IA64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64))
-#  define MIN_CHUNK_SIZE 32
-#else
-#  define MIN_CHUNK_SIZE 16
-#endif
-
-/* The smallest size we can malloc is an aligned minimal chunk */
-
-#define MINSIZE  \
-  (CHUNK_SIZE_T)(((MIN_CHUNK_SIZE+MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK))
-
-/* Check if m has acceptable alignment */
-
-#define aligned_OK(m)  (((PTR_UINT)((m)) & (MALLOC_ALIGN_MASK)) == 0)
-
-#define GUARD_SIZE 4
-
-/* 
-   Check if a request is so large that it would wrap around zero when
-   padded and aligned. To simplify some other code, the bound is made
-   low enough so that adding MINSIZE will also not wrap around zero.
-
-   Make it 4*MINSIZE.
-*/
-
-#define REQUEST_OUT_OF_RANGE(req)                                 \
-  ((CHUNK_SIZE_T)(req) >=                                         \
-   (CHUNK_SIZE_T)(INTERNAL_SIZE_T)(-4 * MINSIZE))    
-
-/* pad request bytes into a usable size -- internal version */
-
-#define request2size(req)                                         \
-  (((req) + GUARD_SIZE + MALLOC_ALIGN_MASK >= MINSIZE)  ?         \
-   ((req) + GUARD_SIZE + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK :\
-   MINSIZE)
-
-/*  Same, except also perform argument check */
-
-#define checked_request2size(req, sz)                             \
-  if (!REQUEST_OUT_OF_RANGE(req)) {                               \
-    (sz) = request2size(req);                                     \
-    assert((sz-req) >= GUARD_SIZE);                               \
-  } else {                                                        \
-    MALLOC_FAILURE_ACTION;                                        \
-    return 0;                                                     \
-  }
-
-#if PARANOIA > 2
-static char * guard_set_p;
-static char * guard_set_q;
-
-#define guard_set(guard, P, request, sz)			  \
-  assert((sz-request) >= GUARD_SIZE);                             \
-  guard_set_p = (char*)(chunk(P));                                \
-  guard_set_p += request;                                         \
-  VALGRIND_MAKE_MEM_UNDEFINED(guard_set_p,GUARD_SIZE);            \
-  guard_set_q = (char*)(guard);                                   \
-  *guard_set_p = *guard_set_q; ++guard_set_p; ++guard_set_q;      \
-  *guard_set_p = *guard_set_q; ++guard_set_p; ++guard_set_q;      \
-  *guard_set_p = *guard_set_q; ++guard_set_p; ++guard_set_q;      \
-  *guard_set_p = *guard_set_q;                                    \
-  VALGRIND_MAKE_MEM_NOACCESS((((char*)chunk(P))+request),GUARD_SIZE);	\
-  (P)->req = request
- 
-#define guard_check(guard, P)				          \
-  VALGRIND_MAKE_MEM_DEFINED((((char *)chunk(P))+(P)->req), GUARD_SIZE); \
-  assert(0 == memcmp((((char *)chunk(P))+(P)->req),(void*)(guard),GUARD_SIZE));\
-  VALGRIND_MAKE_MEM_NOACCESS((((char *)chunk(P))+(P)->req), GUARD_SIZE);
-
-#else
-#define guard_set(guard, P, request, sz) ((void)0)
-#define guard_check(guard, P) ((void)0)
-#endif /* PARANOIA > 2 */
-
-/* dnmalloc forward declarations */
-static char * dnmalloc_arc4random(void);
-static void dnmalloc_init (void);
-static void malloc_mmap_state(void);
-static void cireg_extend (void);
-static chunkinfoptr cireg_getfree (void);
-static void hashtable_add (chunkinfoptr ci);
-static void hashtable_insert (chunkinfoptr ci_orig, chunkinfoptr ci_insert);
-static void hashtable_remove (mchunkptr p);              
-static void hashtable_skiprm (chunkinfoptr ci_orig, chunkinfoptr ci_todelete);
-static chunkinfoptr hashtable_lookup (mchunkptr p);
-static chunkinfoptr next_chunkinfo (chunkinfoptr ci);          
-static chunkinfoptr prev_chunkinfo (chunkinfoptr ci);
-
-
-
-/*
-  --------------- Physical chunk operations ---------------
-*/
-
-
-/* size field is or'ed with PREV_INUSE when previous adjacent chunk in use */
-#define PREV_INUSE 0x1
-
-/* extract inuse bit of previous chunk */
-#define prev_inuse(p)       ((p)->size & PREV_INUSE)
-
-/* size field is or'ed with IS_MMAPPED if the chunk was obtained with mmap() */
-#define IS_MMAPPED 0x2
-
-/* check for mmap()'ed chunk */
-#define chunk_is_mmapped(p) ((p)->size & IS_MMAPPED)
-
-
-/* size field is or'ed when the chunk is in use */
-#define INUSE 0x4
-
-/* extract inuse bit of chunk */
-#define inuse(p)       ((p)->size & INUSE)
-
-/* 
-  Bits to mask off when extracting size 
-
-  Note: IS_MMAPPED is intentionally not masked off from size field in
-  macros for which mmapped chunks should never be seen. This should
-  cause helpful core dumps to occur if it is tried by accident by
-  people extending or adapting this malloc.
-*/
-#define SIZE_BITS (PREV_INUSE|IS_MMAPPED|INUSE)
-
-/* Bits to mask off when extracting size of chunks for macros which do not use mmap */
-#define SIZE_NOMMAP (PREV_INUSE|INUSE)
-
-/* Get size, ignoring use bits */
-#define chunksize(p)         ((p)->size & ~(SIZE_BITS))
-
-/* Ptr to chunkinfo of next physical malloc_chunk. */
-#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & SIZE_NOMMAP) ))
-
-/* Treat space at ptr + offset as a chunk */
-#define chunk_at_offset(p, s)  ((mchunkptr)(((char*)(p)) + (s)))
-
-/* set/clear chunk as being inuse without otherwise disturbing */
-#define set_inuse(p) ((p)->size |= INUSE)
-
-#define clear_inuse(p) ((p)->size &= ~(INUSE))
-
-#define set_previnuse(p) ((p)->size |= PREV_INUSE)
-
-#define clear_previnuse(p) ((p)->size &= ~(PREV_INUSE))
-
-static void set_previnuse_next (chunkinfoptr p)
-{
-   chunkinfoptr q;
-   q = next_chunkinfo (p);
-   if (q)
-      set_previnuse (q);
-}
-
-#define set_all_inuse(p) \
-set_inuse(p); \
-set_previnuse_next(p);
-
-
-/* Set size at head, without disturbing its use bit */
-#define set_head_size(p, s)  ((p)->size = (((p)->size & SIZE_NOMMAP) | (s)))
-
-/* Set size/use field */
-#define set_head(p, s)       ((p)->size = (s))
-
-/*
-  Bins
-
-    An array of bin headers for free chunks. Each bin is doubly
-    linked.  The bins are approximately proportionally (log) spaced.
-    There are a lot of these bins (128). This may look excessive, but
-    works very well in practice.  Most bins hold sizes that are
-    unusual as malloc request sizes, but are more usual for fragments
-    and consolidated sets of chunks, which is what these bins hold, so
-    they can be found quickly.  All procedures maintain the invariant
-    that no consolidated chunk physically borders another one, so each
-    chunk in a list is known to be preceeded and followed by either
-    inuse chunks or the ends of memory.
-
-    Chunks in bins are kept in size order, with ties going to the
-    approximately least recently used chunk. Ordering isn't needed
-    for the small bins, which all contain the same-sized chunks, but
-    facilitates best-fit allocation for larger chunks. These lists
-    are just sequential. Keeping them in order almost never requires
-    enough traversal to warrant using fancier ordered data
-    structures.  
-
-    Chunks of the same size are linked with the most
-    recently freed at the front, and allocations are taken from the
-    back.  This results in LRU (FIFO) allocation order, which tends
-    to give each chunk an equal opportunity to be consolidated with
-    adjacent freed chunks, resulting in larger free chunks and less
-    fragmentation.
-
-    To simplify use in double-linked lists, each bin header acts
-    as a malloc_chunk. This avoids special-casing for headers.
-    But to conserve space and improve locality, we allocate
-    only the fd/bk pointers of bins, and then use repositioning tricks
-    to treat these as the fields of a malloc_chunk*.  
-*/
-
-typedef struct chunkinfo* mbinptr;
-
-/* addressing -- note that bin_at(0) does not exist */
-#define bin_at(m, i) (&(m)->bins[i])
-
-/* analog of ++bin */
-#define next_bin(b)  (b+1)
-
-/* Reminders about list directionality within bins */
-#define first(b)     ((b)->fd)
-#define last(b)      ((b)->bk)
-
-/* Take a chunk off a bin list */
-#define unlink(P, BK, FD) {                                            \
-  FD = P->fd;                                                          \
-  BK = P->bk;                                                          \
-  FD->bk = BK;                                                         \
-  BK->fd = FD;                                                         \
-}
-
-/*
-  Indexing
-
-    Bins for sizes < 512 bytes contain chunks of all the same size, spaced
-    8 bytes apart. Larger bins are approximately logarithmically spaced:
-
-    64 bins of size       8
-    32 bins of size      64
-    16 bins of size     512
-     8 bins of size    4096
-     4 bins of size   32768
-     2 bins of size  262144
-     1 bin  of size what's left
-
-    The bins top out around 1MB because we expect to service large
-    requests via mmap.
-*/
-
-#define NBINS              96
-#define NSMALLBINS         32
-#define SMALLBIN_WIDTH      8
-#define MIN_LARGE_SIZE    256
-
-#define in_smallbin_range(sz)  \
-  ((CHUNK_SIZE_T)(sz) < (CHUNK_SIZE_T)MIN_LARGE_SIZE)
-
-#define smallbin_index(sz)     (((unsigned)(sz)) >> 3)
-
-/*
-  Compute index for size. We expect this to be inlined when
-  compiled with optimization, else not, which works out well.
-*/
-static int largebin_index(size_t sz) {
-
-  unsigned long  xx = sz >> SMALLBIN_WIDTH; 
-
-  if (xx < 0x10000) 
-    {
-      unsigned int  m;           /* bit position of highest set bit of m */
-      
-      /* On intel, use BSRL instruction to find highest bit */
-#if defined(__GNUC__) && defined(i386) && !defined(USE_UNO)
-
-      unsigned int  x = (unsigned int) xx;
-
-      __asm__("bsrl %1,%0\n\t"
-	      : "=r" (m) 
-	      : "rm"  (x));
-
-#elif defined(__GNUC__) && defined(x86_64) && !defined(USE_UNO)
-
-      __asm__("bsrq %1,%0\n\t"
-              : "=r" (m)
-              : "rm"  (xx));
-
-#else
-
-      /* Taken from Bit Twiddling Hacks
-       * http://graphics.stanford.edu/~seander/bithacks.html
-       * public domain
-       */
-      unsigned int  v  = (unsigned int) xx;
-      register unsigned int shift;
-      
-      m =     (v > 0xFFFF) << 4; v >>= m;
-      shift = (v > 0xFF  ) << 3; v >>= shift; m |= shift;
-      shift = (v > 0xF   ) << 2; v >>= shift; m |= shift;
-      shift = (v > 0x3   ) << 1; v >>= shift; m |= shift;
-      m |= (v >> 1);
-      
-#endif
-      
-      /* Use next 2 bits to create finer-granularity bins */
-      return NSMALLBINS + (m << 2) + ((sz >> (m + 6)) & 3);
-    }
-  else
-    {
-      return NBINS-1;
-    }
-}
-
-#define bin_index(sz) \
- ((in_smallbin_range(sz)) ? smallbin_index(sz) : largebin_index(sz))
-
-/*
-  FIRST_SORTED_BIN_SIZE is the chunk size corresponding to the
-  first bin that is maintained in sorted order. This must
-  be the smallest size corresponding to a given bin.
-
-  Normally, this should be MIN_LARGE_SIZE. But you can weaken
-  best fit guarantees to sometimes speed up malloc by increasing value.
-  Doing this means that malloc may choose a chunk that is 
-  non-best-fitting by up to the width of the bin.
-
-  Some useful cutoff values:
-      512 - all bins sorted
-     2560 - leaves bins <=     64 bytes wide unsorted  
-    12288 - leaves bins <=    512 bytes wide unsorted
-    65536 - leaves bins <=   4096 bytes wide unsorted
-   262144 - leaves bins <=  32768 bytes wide unsorted
-       -1 - no bins sorted (not recommended!)
-*/
-
-/* #define FIRST_SORTED_BIN_SIZE 65536 */
-
-#define FIRST_SORTED_BIN_SIZE MIN_LARGE_SIZE
-
-
-/*
-  Unsorted chunks
-
-    All remainders from chunk splits, as well as all returned chunks,
-    are first placed in the "unsorted" bin. They are then placed
-    in regular bins after malloc gives them ONE chance to be used before
-    binning. So, basically, the unsorted_chunks list acts as a queue,
-    with chunks being placed on it in free (and malloc_consolidate),
-    and taken off (to be either used or placed in bins) in malloc.
-*/
-
-/* The otherwise unindexable 1-bin is used to hold unsorted chunks. */
-#define unsorted_chunks(M)          (bin_at(M, 1))
-
-/*
-  Top
-
-    The top-most available chunk (i.e., the one bordering the end of
-    available memory) is treated specially. It is never included in
-    any bin, is used only if no other chunk is available, and is
-    released back to the system if it is very large (see
-    M_TRIM_THRESHOLD).  Because top initially
-    points to its own bin with initial zero size, thus forcing
-    extension on the first malloc request, we avoid having any special
-    code in malloc to check whether it even exists yet. But we still
-    need to do so when getting memory from system, so we make
-    initial_top treat the bin as a legal but unusable chunk during the
-    interval between initialization and the first call to
-    sYSMALLOc. (This is somewhat delicate, since it relies on
-    the 2 preceding words to be zero during this interval as well.)
-*/
-
-/* Conveniently, the unsorted bin can be used as dummy top on first call */
-#define initial_top(M)              (unsorted_chunks(M))
-
-/*
-  Binmap
-
-    To help compensate for the large number of bins, a one-level index
-    structure is used for bin-by-bin searching.  `binmap' is a
-    bitvector recording whether bins are definitely empty so they can
-    be skipped over during during traversals.  The bits are NOT always
-    cleared as soon as bins are empty, but instead only
-    when they are noticed to be empty during traversal in malloc.
-*/
-
-/* Conservatively use 32 bits per map word, even if on 64bit system */
-#define BINMAPSHIFT      5
-#define BITSPERMAP       (1U << BINMAPSHIFT)
-#define BINMAPSIZE       (NBINS / BITSPERMAP)
-
-#define idx2block(i)     ((i) >> BINMAPSHIFT)
-#define idx2bit(i)       ((1U << ((i) & ((1U << BINMAPSHIFT)-1))))
-
-#define mark_bin(m,i)    ((m)->binmap[idx2block(i)] |=  idx2bit(i))
-#define unmark_bin(m,i)  ((m)->binmap[idx2block(i)] &= ~(idx2bit(i)))
-#define get_binmap(m,i)  ((m)->binmap[idx2block(i)] &   idx2bit(i))
-
-/*
-  Fastbins
-
-    An array of lists holding recently freed small chunks.  Fastbins
-    are not doubly linked.  It is faster to single-link them, and
-    since chunks are never removed from the middles of these lists,
-    double linking is not necessary. Also, unlike regular bins, they
-    are not even processed in FIFO order (they use faster LIFO) since
-    ordering doesn't much matter in the transient contexts in which
-    fastbins are normally used.
-
-    Chunks in fastbins keep their inuse bit set, so they cannot
-    be consolidated with other free chunks. malloc_consolidate
-    releases all chunks in fastbins and consolidates them with
-    other free chunks. 
-*/
-
-typedef struct chunkinfo* mfastbinptr;
-
-/* offset 2 to use otherwise unindexable first 2 bins */
-#define fastbin_index(sz)        ((((unsigned int)(sz)) >> 3) - 2)
-
-/* The maximum fastbin request size we support */
-#define MAX_FAST_SIZE     80
-
-#define NFASTBINS  (fastbin_index(request2size(MAX_FAST_SIZE))+1)
-
-/*
-  FASTBIN_CONSOLIDATION_THRESHOLD is the size of a chunk in free()
-  that triggers automatic consolidation of possibly-surrounding
-  fastbin chunks. This is a heuristic, so the exact value should not
-  matter too much. It is defined at half the default trim threshold as a
-  compromise heuristic to only attempt consolidation if it is likely
-  to lead to trimming. However, it is not dynamically tunable, since
-  consolidation reduces fragmentation surrounding loarge chunks even 
-  if trimming is not used.
-*/
-
-#define FASTBIN_CONSOLIDATION_THRESHOLD  \
-  ((unsigned long)(DEFAULT_TRIM_THRESHOLD) >> 1)
-
-/*
-  Since the lowest 2 bits in max_fast don't matter in size comparisons, 
-  they are used as flags.
-*/
-
-/*
-  ANYCHUNKS_BIT held in max_fast indicates that there may be any
-  freed chunks at all. It is set true when entering a chunk into any
-  bin.
-*/
-
-#define ANYCHUNKS_BIT        (1U)
-
-#define have_anychunks(M)     (((M)->max_fast &  ANYCHUNKS_BIT))
-#define set_anychunks(M)      ((M)->max_fast |=  ANYCHUNKS_BIT)
-#define clear_anychunks(M)    ((M)->max_fast &= ~ANYCHUNKS_BIT)
-
-/*
-  FASTCHUNKS_BIT held in max_fast indicates that there are probably
-  some fastbin chunks. It is set true on entering a chunk into any
-  fastbin, and cleared only in malloc_consolidate.
-*/
-
-#define FASTCHUNKS_BIT        (2U)
-
-#define have_fastchunks(M)   (((M)->max_fast &  FASTCHUNKS_BIT))
-#define set_fastchunks(M)    ((M)->max_fast |=  (FASTCHUNKS_BIT|ANYCHUNKS_BIT))
-#define clear_fastchunks(M)  ((M)->max_fast &= ~(FASTCHUNKS_BIT))
-
-/* 
-   Set value of max_fast. 
-   Use impossibly small value if 0.
-*/
-
-#define set_max_fast(M, s) \
-  (M)->max_fast = (((s) == 0)? SMALLBIN_WIDTH: request2size(s)) | \
-  ((M)->max_fast &  (FASTCHUNKS_BIT|ANYCHUNKS_BIT))
-
-#define get_max_fast(M) \
-  ((M)->max_fast & ~(FASTCHUNKS_BIT | ANYCHUNKS_BIT))
-
-
-/*
-  morecore_properties is a status word holding dynamically discovered
-  or controlled properties of the morecore function
-*/
-
-#define MORECORE_CONTIGUOUS_BIT  (1U)
-
-#define contiguous(M) \
-        (((M)->morecore_properties &  MORECORE_CONTIGUOUS_BIT))
-#define noncontiguous(M) \
-        (((M)->morecore_properties &  MORECORE_CONTIGUOUS_BIT) == 0)
-#define set_contiguous(M) \
-        ((M)->morecore_properties |=  MORECORE_CONTIGUOUS_BIT)
-#define set_noncontiguous(M) \
-        ((M)->morecore_properties &= ~MORECORE_CONTIGUOUS_BIT)
-
-#define MORECORE_32BIT_BIT  (2U)
-
-#define morecore32bit(M) \
-        (((M)->morecore_properties &  MORECORE_32BIT_BIT))
-#define nonmorecore32bit(M) \
-        (((M)->morecore_properties &  MORECORE_32BIT_BIT) == 0)
-#define set_morecore32bit(M) \
-        ((M)->morecore_properties |=  MORECORE_32BIT_BIT)
-#define set_nonmorecore32bit(M) \
-        ((M)->morecore_properties &= ~MORECORE_32BIT_BIT)
-
-
-
-/* ----------------- dnmalloc -------------------- */
-
-/* size of pages */
-#define PGSIZE malloc_getpagesize
-/* pointer size */
-#define PTRSIZE sizeof(long)
-
-
-
-/* TODO: mmapped chunks are always multiples of pagesize -> we're wasting 
-   address space: the hashtable has granularity of 16*8, set it to something 
-   closer to pagesize for mmapped chunks (current waste: 32 positions/mmapped 
-   page) 
-*/
-
-/* The maximum heap size that dnmalloc can operate with
- * represented in hex to avoid annoying gcc warning
- *
- * Avoid integer overflow, cover complete 32bit address 
- * space for portability. With deferred allocation, the
- * hashtable size is a non-issue.
- */
-#define HEAPMAXSIZE_HALF 0x80000000UL
-
-/* How many elements are stored in the linked list */
-#define LINKEDLSTELS 8
-
-/* Minimum size of a chunk */
-
-#if (SIZEOF_UNSIGNED_LONG == 8) || defined(__arch64__) || defined(__ia64__) || defined(__x86_64__) || defined(__LP64__) || defined(__64BIT__) || defined(_LP64) || defined(_M_IA64) || (defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64))
-#  define MINCHUNKSIZE 32
-#else
-#  define MINCHUNKSIZE 16
-#endif
-
-
-/* The amount of hashtable entries for each page:
-Pagesize divded by the numer of elements in the linkedlists
-divided by the minimum chunk size
-*/
-#define CHUNKINFOPAGE (PGSIZE / LINKEDLSTELS / MINCHUNKSIZE)
-
-/* The amount of hashtable entries needed to manage the memory:
-Maximum heap size divided by page size multiplied by the amount
-of chunk info's per page 
-*/
-#define AMOUNTHASH ((HEAPMAXSIZE_HALF / PGSIZE) * CHUNKINFOPAGE * 2)
-
-/* Initial size of the map for the hashtable 
-Amount of entries muliplied by pointer size
-*/
-#define  HASHTABLESIZE (AMOUNTHASH * PTRSIZE)
-
-/* Amount of free chunks that the system should allocate at the start */
-#define NUMBER_FREE_CHUNKS 32768
-
-/* Initial size of the chunk info region, 
-also used when growing the region */
-#define CIREGSIZE (NUMBER_FREE_CHUNKS * sizeof(struct chunkinfo))
-
-/* Start address of the heap */
-char *startheap;
-
-/* pointer to the hashtable: struct chunkinfo **hashtable -> *hashtable[] */
-chunkinfoptr *hashtable;
-
-/* Current chunkinfo region */
-struct cireginfo *currciinfo = 0;
-struct cireginfo *firstciinfo = 0;
-
-unsigned long totalcictr = 0;
-
-
-/* Initialize the area for chunkinfos and the hashtable and protect 
- * it with non-writable pages 
- */
-static void
-dnmalloc_init ()
-{
-   void *hashtb;
-   int mprot;
-   int flags = MAP_PRIVATE;
-
-   /* Allocate the malloc_state struct */
-   malloc_mmap_state();
-
-   /* Use MAP_NORESERVE if available (Solaris, HP-UX; most other
-    * systems use defered allocation anyway.
-    */
-#ifdef MAP_NORESERVE
-   flags |= MAP_NORESERVE;
-#endif
-
-   /* Always start at 0, hashtable covers whole 32bit address space
-    */
-#define STARTHEAP_IS_ZERO
-   startheap = 0;
-
-   /* Map space for the hashtable */
-#if PARANOIA > 1
-   hashtb = MMAP(0, HASHTABLESIZE+(2*PGSIZE), PROT_READ|PROT_WRITE, flags);
-#else
-   hashtb = MMAP(0, HASHTABLESIZE+PGSIZE, PROT_READ|PROT_WRITE, flags);
-#endif
-
-#ifdef NDEBUG
-   if (hashtb == MAP_FAILED) {
-      fprintf (stderr, "Couldn't mmap hashtable: %s\n", strerror (errno));
-      abort ();
-   }
-#else
-   assert(hashtb != MAP_FAILED);
-#endif
-
-   /* Protect the hashtable with non-writable pages */
-   mprot = mprotect(hashtb, (size_t) PGSIZE, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-     fprintf (stderr, "Couldn't mprotect first non-rw page for hashtable: %s\n",
-	      strerror (errno));
-     abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-
-   /* HP-UX: Cannot do arithmetic with pointers to objects of unknown size. */
-   hashtable = (chunkinfoptr *) (((char*)hashtb) + PGSIZE);
-
-   /* Protect the hashtable with non-writable pages */
-#if PARANOIA > 1
-   mprot = mprotect((void*)((char*)hashtb+HASHTABLESIZE+PGSIZE), (size_t) PGSIZE, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-     fprintf (stderr, "Couldn't mprotect last non-rw page for hashtable: %s\n",
-	      strerror (errno));
-     abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-#endif
-}
-
-
-
-/* Extend the region for chunk infos by mapping more memory before the region */
-static void
-cireg_extend ()
-{
-   void *newcireg;
-   int mprot;
-   struct cireginfo *tempciinfo = 0;
-   
-#if PARANOIA > 1
-   newcireg = MMAP(0, CIREGSIZE+(2*PGSIZE), PROT_READ|PROT_WRITE, MAP_PRIVATE);
-#else
-   newcireg = MMAP(0, CIREGSIZE+PGSIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE);
-#endif
-
-#ifdef NDEBUG
-   if (newcireg == MAP_FAILED)
-   {
-	   fprintf (stderr, "Couldn't extend chunkinfo region: %s\n",
-		    strerror (errno));
-	   abort ();
-   }
-#else
-   assert(newcireg != MAP_FAILED);
-#endif
-   mprot = mprotect(newcireg, PGSIZE, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-	   fprintf (stderr, "Couldn't mprotect first non-rw page for extended region: %s\n",
-		    strerror (errno));
-	   abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-   newcireg = ((char*)newcireg)+PGSIZE;
-   
-#if PARANOIA > 1
-   mprot = mprotect((void*)((char*)newcireg+CIREGSIZE), (size_t) PGSIZE, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-     fprintf (stderr, "Couldn't mprotect last non-rw page for extended region: %s\n",
-	      strerror (errno));
-     abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-#endif
-
-   tempciinfo = currciinfo;
-   currciinfo = (struct cireginfo *) newcireg;
-   if (tempciinfo)
-	   tempciinfo->next = currciinfo;
-   currciinfo->position = 1;
-   currciinfo->freecounter = NUMBER_FREE_CHUNKS;
-   if (!firstciinfo)
-	   firstciinfo = currciinfo;
-   totalcictr++;
-   VALGRIND_CREATE_MEMPOOL(newcireg, 0, 0);
-}
-
-
-/* Get a free chunkinfo */
-static chunkinfoptr
-cireg_getfree ()
-{
-   chunkinfoptr freeci;
-   chunkinfoptr freelst = 0;
-   struct cireginfo *newciinfo = firstciinfo;
-   
-   if (newciinfo) {
-   	freelst = newciinfo->freelist;
-    
-	if (!freelst && newciinfo->next) {
-	  do {
-	    newciinfo = newciinfo->next;
-	    freelst = newciinfo->freelist;
-	  } while (!freelst && newciinfo->next);
-	}
-   }
-
-   /* Check if there are any free chunkinfos on the list of free chunkinfos */
-   if (freelst)
-   {
-     freeci = freelst;
-     newciinfo->freecounter--;
-     newciinfo->freelist = freelst->fd;
-     
-     VALGRIND_MEMPOOL_ALLOC((char*)currciinfo, (char*)freeci, 
-			    sizeof(struct chunkinfo));
-     
-     freeci->prev_size = 0;
-     freeci->size      = 0;
-     freeci->req       = 0;
-     freeci->hash_next = NULL;
-     freeci->fd        = NULL;
-     freeci->bk        = NULL;
-     freeci->chunk     = NULL;
-     return (freeci);
-   }
-   else
-   {
-     /* No free chunkinfos, check if chunkinfo region still has place 
-      * for a chunkinfo. If not, extend the region. 
-      */
-     if (UNLIKELY(!currciinfo || currciinfo->position == NUMBER_FREE_CHUNKS))
-       cireg_extend ();
-     /* Get a chunkinfo from the chunkinfo region */
-     freeci = (chunkinfoptr) currciinfo + currciinfo->position; 
-     currciinfo->freecounter--;
-     currciinfo->position++;
-
-     VALGRIND_MEMPOOL_ALLOC((char*)currciinfo, (char*)freeci, 
-			    sizeof(struct chunkinfo));
-
-     return (freeci);
-   }
-}
-
-static void freeciregion(struct cireginfo *freeme) {
-  /* free the chunkinfo region */
-  struct cireginfo *newciinfo = firstciinfo;
-  struct cireginfo *prevciinfo = firstciinfo;
-  void *unmapme;
-
-  while (newciinfo && newciinfo != freeme) {
-    prevciinfo = newciinfo;
-    newciinfo = newciinfo->next;
-  }
-  assert(freeme == newciinfo); /* rw */
-  assert(newciinfo != NULL);   /* rw */
-  if (newciinfo)
-    prevciinfo->next = newciinfo->next;
-  unmapme = (void *) ((char*)freeme - PGSIZE);
-  VALGRIND_DESTROY_MEMPOOL((char*)freeme);
-#if PARANOIA > 1
-  munmap(unmapme, CIREGSIZE+(2*PGSIZE));
-#else
-  munmap(unmapme, CIREGSIZE+PGSIZE);
-#endif
-}
-
-
-static void freecilst_add(chunkinfoptr p) {
-
-  struct cireginfo *newciinfo;
-
-  newciinfo = currciinfo;
-  if (((chunkinfoptr) newciinfo < p) && (p  <  (chunkinfoptr) (newciinfo+NUMBER_FREE_CHUNKS))) {
-    p->fd = newciinfo->freelist;
-    newciinfo->freelist = p;
-    newciinfo->freecounter++;
-    VALGRIND_MEMPOOL_FREE((char*)newciinfo, (char*)p);
-    VALGRIND_MAKE_MEM_DEFINED(p,sizeof(struct chunkinfo));
-    VALGRIND_MAKE_MEM_NOACCESS(p->size,     sizeof(INTERNAL_SIZE_T));
-    VALGRIND_MAKE_MEM_NOACCESS(p->req,      sizeof(INTERNAL_SIZE_T));
-    VALGRIND_MAKE_MEM_NOACCESS(p->bk,       sizeof(struct chunkinfo*));
-    VALGRIND_MAKE_MEM_NOACCESS(p->chunk,    sizeof(mchunkptr));
-  } else {
-    newciinfo = firstciinfo;
-    if (newciinfo) {
-      do {
-	if (((chunkinfoptr) newciinfo < p) && (p  <  (chunkinfoptr) (newciinfo+NUMBER_FREE_CHUNKS))) {
-	  p->fd = newciinfo->freelist;
-	  newciinfo->freelist = p;
-	  newciinfo->freecounter++;
-	  VALGRIND_MEMPOOL_FREE((char*)newciinfo, (char*)p);
-	  VALGRIND_MAKE_MEM_DEFINED(p,sizeof(struct chunkinfo));
-	  VALGRIND_MAKE_MEM_NOACCESS(p->size,     sizeof(INTERNAL_SIZE_T));
-	  VALGRIND_MAKE_MEM_NOACCESS(p->req,      sizeof(INTERNAL_SIZE_T));
-	  VALGRIND_MAKE_MEM_NOACCESS(p->bk,       sizeof(struct chunkinfo*));
-	  VALGRIND_MAKE_MEM_NOACCESS(p->chunk,    sizeof(mchunkptr));
-	  if (UNLIKELY(newciinfo->freecounter == NUMBER_FREE_CHUNKS))
-	    freeciregion(newciinfo);
-	  break;
-	}
-	newciinfo = newciinfo->next;
-      } while (newciinfo);
-    }
-  }
-}
-
-/* Calculate the hash table entry for a chunk */
-#ifdef STARTHEAP_IS_ZERO
-#define hash(p)  (((unsigned long) p) >> 7)
-#else
-#define hash(p)  (((unsigned long) p - (unsigned long) startheap) >> 7)
-#endif
-
-static void
-hashtable_add (chunkinfoptr ci)
-{
-   chunkinfoptr temp, next;
-   unsigned long hashval;
-   mchunkptr cic = chunk (ci);
-   
-   hashval = hash (cic);
-
-   if (hashval < AMOUNTHASH) {
-
-     temp = hashtable[hashval];
-
-#ifdef DNMALLOC_DEBUG
-     fprintf(stderr, "hashtable_add: %p, %lu\n", chunk(ci), hashval);
-#endif
-
-     /* If no pointer to a chunk info list is stored at this location 
-      * in the hashtable or if the chunk's address is smaller than the 
-      * one present, add the chunk to the front of the linked list
-      */
-     if (temp == 0 || chunk (temp) > cic)
-       {
-	 ci->hash_next = temp;
-	 hashtable[hashval] = ci;
-	 if (!temp) /* more likely case */
-	   goto out;
-	 temp->prev_size = chunksize(ci);
-	 return;
-       }
-     else
-       {
-	 /* We must place the chunk in the linked list for this hashentry
-	  * Loop to end of list or to a position where temp's chunk's address 
-	  * is larger than the new chunkinfo's chunk's address
-	  */
-	 if (!temp->hash_next || (chunk (temp->hash_next) > cic))
-	   {
-	     ci->hash_next = temp->hash_next;
-	     temp->hash_next = ci;
-	   }
-	 else
-	   {
-	     while ((temp->hash_next != 0) && (chunk (temp->hash_next) < cic))
-	       {
-		 temp = temp->hash_next;
-	       }
-	     /* Place in linked list if not already there */
-	     if (!temp->hash_next || !(chunk (temp->hash_next) == cic))
-	       {
-		 ci->hash_next = temp->hash_next;
-		 temp->hash_next = ci;
-	       }
-	   }
-       }
-   }
-   else {
-#ifdef DNMALLOC_CHECKS
-     if (hashval >= AMOUNTHASH) {
-       fprintf(stderr, "Dnmalloc error: trying to write outside of the bounds of the hashtable, this is definitely a bug, please email dnmalloc@fort-knox.org (hashval: %lu, AMOUNTHASH: %lu, HEAPMAXSIZE_HALF %lu PGSIZE %ld CHUNKINFOPAGE %ld chunk: %p, chunkinfo: %p, startheap: %p).\n", hashval, AMOUNTHASH, HEAPMAXSIZE_HALF, PGSIZE, CHUNKINFOPAGE, chunk(ci), ci, startheap);
-	   abort();
-     }
-#else
-     assert(hashval < AMOUNTHASH);
-#endif
-   }
-
- out:
-   next = next_chunkinfo(ci);
-   if (!next)
-     return;
-   next->prev_size = chunksize(ci);
-}
-
-static void
-hashtable_insert (chunkinfoptr ci_orig, chunkinfoptr ci_insert)
-{
-   chunkinfoptr next;
-
-#ifdef DNMALLOC_DEBUG
-   fprintf(stderr, "hashtable_ins: %p, %lu\n", chunk(ci_insert), 
-	   (unsigned long)hash(chunk(ci_insert));
-#endif
-
-   if (hash(chunk(ci_orig)) != hash(chunk(ci_insert))) {
-      hashtable_add(ci_insert);  
-   }
-   else {
-
-      ci_insert->hash_next = ci_orig->hash_next;
-      ci_orig->hash_next = ci_insert;
-
-      /* added for prevsize */
-      if (!(ci_insert->hash_next))
-	      next = next_chunkinfo(ci_insert);
-      else
-	      next = ci_insert->hash_next;
-
-      if (!next)
-	{
-	  ci_insert->prev_size = chunksize(ci_orig);
-	}
-      else
-	{
-	  next->prev_size = chunksize(ci_insert);
-	  ci_insert->prev_size = chunksize(ci_orig);
-	}
-   }
-}
-
-static void
-hashtable_remove (mchunkptr p) 
-{
-  chunkinfoptr prevtemp, temp;
-  unsigned long hashval;
-  
-  hashval = hash (p);
-#ifdef DNMALLOC_DEBUG
-  fprintf(stderr, "hashtable_rem: %p, %lu\n", p, hashval);
-#endif
-  assert(hashval < AMOUNTHASH); /* rw */
-  prevtemp = temp = hashtable[hashval];
-  if (chunk (temp) == p) {
-    hashtable[hashval] = temp->hash_next;
-  } 
-  else
-    {
-      if (temp && chunk (temp) != p) {
-	do
-	  {
-	    prevtemp = temp;
-	    temp = temp->hash_next;
-	  } while (temp && chunk (temp) != p);
-      }
-#ifdef DNMALLOC_CHECKS
-      if (!temp) {
-	fprintf (stderr,
-		 "Dnmalloc error (hash_rm): could not find a chunkinfo for the chunk %p in the hashtable at entry %lu\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n",
-		 p, hashval);
-	abort();
-      }
-#else
-      assert(temp != NULL);
-#endif
-      if (temp) prevtemp->hash_next = temp->hash_next;
-    }
-}
-
-/* mmapped chunks are multiples of pagesize, no hash_nexts, 
- * just remove from the hashtable 
- */
-#define hashtable_remove_mmapped(p) hashtable[hash(p)] = 0;
-
-static void
-hashtable_skiprm (chunkinfoptr ci_orig, chunkinfoptr ci_todelete)
-{
-   unsigned long hashval;
-   chunkinfoptr next;
-   
-#ifdef DNMALLOC_DEBUG
-   fprintf(stderr, "hashtable_skiprm: %p, %lu\n", chunk(ci_todelete), hash(chunk(ci_todelete)));
-#endif
-
-   if (ci_orig->hash_next != ci_todelete) {
-     hashval = hash(chunk(ci_todelete));
-     assert(hashval < AMOUNTHASH); /* rw */
-#ifdef DNMALLOC_CHECKS
-     if (hashtable[hashval] != ci_todelete ) {
-	   fprintf(stderr, "Dnmalloc error: trying to delete wrong value (hash: %lu): ci_todelete: %p (%p), hashtable[hashval]: %p (%p)\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n", hashval, ci_todelete, chunk(ci_todelete), hashtable[hashval], chunk(hashtable[hashval]));
-     }
-#else
-     assert(hashtable[hashval] == ci_todelete);
-#endif
-     hashtable[hashval] = ci_todelete->hash_next;
-   }
-
-   else {
-     ci_orig->hash_next = ci_todelete->hash_next;
-     if (!ci_orig->hash_next) {
-       next = next_chunkinfo(ci_orig);
-     } else {
-       next = ci_orig->hash_next;
-     }
-     if (next)
-       next->prev_size = chunksize(ci_orig);
-
-   } 
-}
-
-
-static chunkinfoptr
-hashtable_lookup (mchunkptr p)
-{
-   chunkinfoptr ci;
-   unsigned long hashval;
-   
-   /* if we were called wrongly
-    * if ((char *) p < startheap) return 0;
-    */
-   if ((char *) p >= startheap)
-     {
-       hashval = hash (p);
-       assert(hashval < AMOUNTHASH); /* rw */
-       ci = hashtable[hashval];
-       if (ci && chunk (ci) == p)
-	 return ci;
-
-       if (ci) {
-	 do {
-	   ci = ci->hash_next;
-	 } while (ci && chunk (ci) != p);
-       }
-#ifdef DNMALLOC_CHECKS
-       /* This should never occur but if it does, we'd like to know */
-       if (!ci) {
-	 fprintf (stderr,
-		  "Dnmalloc error: could not find a chunkinfo for the chunk %p in the hashtable at entry %lu\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n",
-		  p, hashval);
-	 abort();
-       }
-#else
-       assert(ci != NULL);
-#endif
-       return ci;
-     }
-   return 0;
-}
-
-
-
-/*
-   ----------- Internal state representation and initialization -----------
-*/
-
-struct malloc_state {
-
-  /* The maximum chunk size to be eligible for fastbin */
-  INTERNAL_SIZE_T  max_fast;   /* low 2 bits used as flags */
-
-  /* Fastbins */
-  mfastbinptr      fastbins[NFASTBINS];
-
-  /* Base of the topmost chunk -- not otherwise kept in a bin */
-  chunkinfoptr        top;
-
-  /* The remainder from the most recent split of a small request */
-  chunkinfoptr        last_remainder;
-
-  /* Normal bins */
-  struct chunkinfo bins[NBINS];
-
-  /* Bitmap of bins. Trailing zero map handles cases of largest binned size */
-  unsigned int     binmap[BINMAPSIZE+1];
-
-  /* Tunable parameters */
-  CHUNK_SIZE_T     trim_threshold;
-  INTERNAL_SIZE_T  top_pad;
-  INTERNAL_SIZE_T  mmap_threshold;
-
-  /* Memory map support */
-  int              n_mmaps;
-  int              n_mmaps_max;
-  int              max_n_mmaps;
-
-  /* Cache malloc_getpagesize */
-  unsigned int     pagesize;  
-
-  /* Canary */
-  char             guard_stored[GUARD_SIZE];
-
-  /* Track properties of MORECORE */
-  unsigned int     morecore_properties;
-
-  /* Statistics */
-  INTERNAL_SIZE_T  mmapped_mem;
-  INTERNAL_SIZE_T  sbrked_mem;
-  INTERNAL_SIZE_T  max_sbrked_mem;
-  INTERNAL_SIZE_T  max_mmapped_mem;
-  INTERNAL_SIZE_T  max_total_mem;
-};
-
-typedef struct malloc_state *mstate;
-
-/* 
-   There is exactly one instance of this struct in this malloc.
-   If you are adapting this malloc in a way that does NOT use a static
-   malloc_state, you MUST explicitly zero-fill it before using. This
-   malloc relies on the property that malloc_state is initialized to
-   all zeroes (as is true of C statics).
-*/
-
-static struct malloc_state * av_ = NULL;  /* never directly referenced */
-
-/*
-   All uses of av_ are via get_malloc_state().
-   At most one "call" to get_malloc_state is made per invocation of
-   the public versions of malloc and free, but other routines
-   that in turn invoke malloc and/or free may call more then once. 
-   Also, it is called in check* routines if DEBUG is set.
-*/
-
-#define get_malloc_state() (av_)
-
-/*
-  Initialize a malloc_state struct.
-
-  This is called only from within malloc_consolidate, which needs
-  be called in the same contexts anyway.  It is never called directly
-  outside of malloc_consolidate because some optimizing compilers try
-  to inline it at all call points, which turns out not to be an
-  optimization at all. (Inlining it in malloc_consolidate is fine though.)
-*/
-
-#if __STD_C
-static void malloc_mmap_state(void)
-#else
-static void malloc_mmap_state()
-#endif
-{
-  int mprot;
-  unsigned long pagesize = malloc_getpagesize;
-  size_t size = (sizeof(struct malloc_state) + pagesize - 1) & ~(pagesize - 1);
-
-  void * foo = MMAP(0, size+(2*pagesize), PROT_READ|PROT_WRITE, MAP_PRIVATE);
-
-
-#ifdef NDEBUG
-   if (foo == MAP_FAILED) {
-      fprintf (stderr, "Couldn't mmap struct malloc_state: %s\n", strerror (errno));
-      abort ();
-   }
-#else
-   assert(foo != MAP_FAILED);
-#endif
-
-   mprot = mprotect(foo, pagesize, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-     fprintf (stderr, "Couldn't mprotect first non-rw page for struct malloc_state: %s\n",
-	      strerror (errno));
-     abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-
-   av_ = (struct malloc_state *) ((char*)foo + pagesize);
-
-   MALLOC_ZERO(av_, sizeof(struct malloc_state));
-
-   mprot = mprotect((void*)((char*)foo + size + pagesize), (size_t) pagesize, PROT_NONE);
-#ifdef NDEBUG
-   if (mprot == -1) {
-     fprintf (stderr, 
-	      "Couldn't mprotect last non-rw page for struct malloc_state: %s\n",
-	      strerror (errno));
-     abort ();
-   }
-#else
-   assert(mprot != -1);
-#endif
-}
-
-#if __STD_C
-static void malloc_init_state(mstate av)
-#else
-static void malloc_init_state(av) mstate av;
-#endif
-{
-  int     i;
-  mbinptr bin;
-
-  void *  morecore_test = MORECORE(0);
-  unsigned long hashval;
-
-  /* Test morecore function 
-   */
-  set_morecore32bit(av);
-
-  if (morecore_test == MORECORE_FAILURE)
-    {
-      set_nonmorecore32bit(av);
-    }
-  else
-    {
-      /* On 64bit systems, the heap may be located above the
-       * 32bit address space. Since mmap() probably still can be
-       * convinced to map within 32bit, we don't use sbrk().
-       */
-      hashval = hash (morecore_test);
-      if (hashval >= AMOUNTHASH) 
-	{
-	  set_nonmorecore32bit(av);
-	}
-    }
-
-  
-  /* Establish circular links for normal bins */
-  for (i = 1; i < NBINS; ++i) { 
-    bin = bin_at(av,i);
-    bin->fd = bin->bk = bin;
-  }
-
-  av->top_pad        = DEFAULT_TOP_PAD;
-  av->n_mmaps_max    = DEFAULT_MMAP_MAX;
-  av->mmap_threshold = DEFAULT_MMAP_THRESHOLD;
-  av->trim_threshold = DEFAULT_TRIM_THRESHOLD;
-
-#if MORECORE_CONTIGUOUS
-  set_contiguous(av);
-#else
-  set_noncontiguous(av);
-#endif
-
-  set_max_fast(av, DEFAULT_MXFAST);
-
-  av->top = cireg_getfree ();
-  av->top->chunk     = (mchunkptr) startheap;
-  av->top->size      = 0;
-  set_previnuse(av->top);
-  clear_inuse(av->top);
-  hashtable[0]       = av->top;
-  av->pagesize       = malloc_getpagesize;
-
-  memcpy(av->guard_stored, dnmalloc_arc4random(), GUARD_SIZE);
-
-}
-
-/* 
-   Other internal utilities operating on mstates
-*/
-
-#if __STD_C
-static Void_t*  sYSMALLOc(INTERNAL_SIZE_T, mstate);
-static int      sYSTRIm(size_t, mstate);
-static void     malloc_consolidate(mstate);
-#else
-static Void_t*  sYSMALLOc();
-static int      sYSTRIm();
-static void     malloc_consolidate();
-#endif
-
-/* dnmalloc functions */
-/* needs mstate so moved here */
-
-static chunkinfoptr
-next_chunkinfo (chunkinfoptr ci)
-{
-   mchunkptr nextp;
-   unsigned long hashval;
-   chunkinfoptr cinfonextp;
-   mstate av = get_malloc_state();
-   
-   /* ci is not the last element in the linked list, just 
-      return the next chunkinfo from the list 
-   */
-   if (!ci->hash_next)
-     {
-       /* ci is the last element, find the next chunkinfo by 
-	* looking up the chunkinfo for the chunk that is after p's chunk 
-	*/
-       nextp = (mchunkptr) (((char *) (ci->chunk)) + chunksize (ci));
-
-       if (!(nextp == av->top->chunk)) 
-	 {
-	   hashval = hash (nextp);
-	   /* assert(hashval < AMOUNTHASH); *//* major bottleneck */
-	   cinfonextp = hashtable[hashval];
-	   if (cinfonextp && chunk (cinfonextp) == nextp)
-	     return cinfonextp; 
-	   
-#ifdef DNMALLOC_CHECKS_EXTRA
-	   /* This seems bogus; a chunkinfo may legally have no nextp if
-	    * it's the last one allocated (?)
-	    */
-	   else {
-	     if (cinfonextp)
-	       fprintf (stderr,
-			"Dnmalloc error: could not find a next chunkinfo for the chunk %p in the hashtable at entry %lu, cinfonextp: %p, chunk(cinfonextp): %p, nextp: %p\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n",
-			chunk(ci), hashval, cinfonextp, chunk(cinfonextp), nextp);
-	     else
-	       fprintf (stderr,
-			"Dnmalloc error: could not find a next chunkinfo for the chunk %p in the hashtable at entry %lu, cinfonextp: %s, chunk(cinfonextp): %s, nextp: %p\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n",
-			chunk(ci), hashval, "null", "null", nextp);
-	   }
-#endif
-	  
-	   return NULL;
-	 }
-       else
-	 {
-	   return av->top;
-	 }
-
-     }
-   else
-     {
-       return (ci->hash_next);
-     }
-}
-
-static int is_next_chunk(chunkinfoptr oldp, chunkinfoptr newp) {
-	mchunkptr nextp;
-	if (oldp->hash_next == newp)
-		return 1;
-	nextp = (mchunkptr) (((char *) (oldp->chunk)) + chunksize (oldp));
-	if (nextp == chunk(newp))
-		return 1;
-	return 0;
-}
-
-
-
-/* Get the chunkinfo of the physically previous chunk */
-/* Since we disposed of prev_size, we need this function to find the previous */
-
-static chunkinfoptr
-prev_chunkinfo (chunkinfoptr ci)
-{
-   unsigned int i;
-   chunkinfoptr prev;
-   mchunkptr prevchunk = 0;
-   /* chunkinfoptr temp; */
-   
-   /* Get the hashtable location of the chunkinfo */
-   i = hash (chunk (ci));
-   assert(i < AMOUNTHASH); /* rw */
-      
-   /* Get the first element of the linked list of chunkinfo's that contains p */
-   prev = hashtable[i];
-   
-   if (ci == prev) {
-     prevchunk = (mchunkptr) (((char *) (ci->chunk)) - (ci->prev_size));
-     i = hash(prevchunk);
-     assert(i < AMOUNTHASH); /* rw */
-     /* Loop over the linked list until we reach the last element */
-     for (prev = hashtable[i]; prev->hash_next != 0; prev = prev->hash_next) ;
-   } else {
-     /* p is not the first element in the linked list, we can just 
-	loop over the list and return the previous 
-     */
-     for (prev = hashtable[i]; prev->hash_next != ci; prev = prev->hash_next);
-   }
-
-   return prev;  
-}
-
-
-/*
-  Debugging support
-  Dnmalloc broke dlmallocs debugging functions, should fix them some 
-  time in the future, for now leave them undefined.
-*/
-
-#define check_chunk(P)
-#define check_free_chunk(P)
-#define check_inuse_chunk(P)
-#define check_remalloced_chunk(P,N)
-#define check_malloced_chunk(P,N)
-#define check_malloc_state()
-
-
-/* ----------- Routines dealing with system allocation -------------- */
-
-/*
-  sysmalloc handles malloc cases requiring more memory from the system.
-  On entry, it is assumed that av->top does not have enough
-  space to service request for nb bytes, thus requiring that av->top
-  be extended or replaced.
-*/
-
-#if __STD_C
-static Void_t* sYSMALLOc(INTERNAL_SIZE_T nb, mstate av)
-#else
-static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av;
-#endif
-{
-  chunkinfoptr    old_top;        /* incoming value of av->top */
-  INTERNAL_SIZE_T old_size;       /* its size */
-  char*           old_end;        /* its end address */
-
-  long            size;           /* arg to first MORECORE or mmap call */
-  char*           brk;            /* return value from MORECORE */
-
-  long            correction;     /* arg to 2nd MORECORE call */
-  char*           snd_brk;        /* 2nd return val */
-
-  INTERNAL_SIZE_T front_misalign; /* unusable bytes at front of new space */
-  INTERNAL_SIZE_T end_misalign;   /* partial page left at end of new space */
-  char*           aligned_brk;    /* aligned offset into brk */
-
-  chunkinfoptr    p;              /* the allocated/returned chunk */
-  chunkinfoptr    remainder;      /* remainder from allocation */
-  chunkinfoptr    fencepost;      /* fencepost */
-  CHUNK_SIZE_T    remainder_size; /* its size */
-
-  CHUNK_SIZE_T    sum;            /* for updating stats */
-
-  size_t          pagemask  = av->pagesize - 1;
-
-#ifdef DNMALLOC_DEBUG
-  fprintf(stderr, "Enter sysmalloc\n");
-#endif
-  /*
-    If there is space available in fastbins, consolidate and retry
-    malloc from scratch rather than getting memory from system.  This
-    can occur only if nb is in smallbin range so we didn't consolidate
-    upon entry to malloc. It is much easier to handle this case here
-    than in malloc proper.
-  */
-
-
-  if (have_fastchunks(av)) {
-    Void_t * retval;
-    assert(in_smallbin_range(nb));
-    malloc_consolidate(av);
-#ifdef DNMALLOC_DEBUG
-    fprintf(stderr, "Return sysmalloc have_fastchunks\n");
-#endif
-    retval = mALLOc(nb - MALLOC_ALIGN_MASK);
-    VALGRIND_FREELIKE_BLOCK(retval, 0);
-    return retval;
-  }
-
-
-  /*
-    If have mmap, and the request size meets the mmap threshold, and
-    the system supports mmap, and there are few enough currently
-    allocated mmapped regions, try to directly map this request
-    rather than expanding top.
-  */
-
-  if (UNLIKELY((CHUNK_SIZE_T)(nb) >= (CHUNK_SIZE_T)(av->mmap_threshold) &&
-	       (av->n_mmaps < av->n_mmaps_max))) {
-
-    char* mm;             /* return value from mmap call*/
-
-    /*
-      Round up size to nearest page.  For mmapped chunks, the overhead
-      is one SIZE_SZ unit larger than for normal chunks, because there
-      is no following chunk whose prev_size field could be used.
-    */
-    size = (nb + MALLOC_ALIGN_MASK + pagemask) & ~pagemask;
-
-    /* Don't try if size wraps around 0 */
-    if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb)) {
-	    
-
-      mm = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE));
-      
-      if (mm != (char*)(MORECORE_FAILURE)) {
-        
-	VALGRIND_MAKE_MEM_NOACCESS(mm,size);
-
-        /*
-          The offset to the start of the mmapped region is stored
-          in the prev_size field of the chunk. This allows us to adjust
-          returned start address to meet alignment requirements here 
-          and in memalign(), and still be able to compute proper
-          address argument for later munmap in free() and realloc().
-        */
-        
-        front_misalign = (INTERNAL_SIZE_T) mm & MALLOC_ALIGN_MASK;
-	p = cireg_getfree();
-        
-        if (front_misalign > 0) {
-          correction = MALLOC_ALIGNMENT - front_misalign;
-          p->chunk = (mchunkptr)(mm + correction);
-          p->hash_next = (chunkinfoptr) correction;
-          set_head(p, (size - correction) |INUSE|IS_MMAPPED);
-        }
-        else {
-          p->chunk = (mchunkptr)mm;
-          p->hash_next = 0;
-          set_head(p, size|INUSE|IS_MMAPPED);
-        }
-        hashtable_add(p);
-        /* update statistics */
-        
-        if (++av->n_mmaps > av->max_n_mmaps) 
-          av->max_n_mmaps = av->n_mmaps;
-        
-        sum = av->mmapped_mem += size;
-        if (sum > (CHUNK_SIZE_T)(av->max_mmapped_mem)) 
-          av->max_mmapped_mem = sum;
-        sum += av->sbrked_mem;
-        if (sum > (CHUNK_SIZE_T)(av->max_total_mem)) 
-          av->max_total_mem = sum;
-
-        check_chunk(p);
-        
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Return mmapped (%lu, total %lu)\n", 
-		size, (unsigned long)/* size_t */av->max_total_mem );
-#endif
-        return chunk(p);
-      }
-    }
-  }
-
-  /* Record incoming configuration of top */
-
-  old_top  = av->top;
-  old_size = chunksize(old_top);
-  old_end  = (char*)(chunk_at_offset(chunk(old_top), old_size));
-
-  brk = snd_brk = (char*)(MORECORE_FAILURE); 
-
-  /* 
-     If not the first time through, we require old_size to be
-     at least MINSIZE and to have prev_inuse set.
-  */
-
-  /* assert((old_top == initial_top(av) && old_size == 0) || 
-	 ((CHUNK_SIZE_T) (old_size) >= MINSIZE &&
-	 prev_inuse(old_top))); */
-
-  /* Precondition: not enough current space to satisfy nb request */
-  assert((CHUNK_SIZE_T)(old_size) < (CHUNK_SIZE_T)(nb + MINSIZE));
-
-  /* Precondition: all fastbins are consolidated */
-  assert(!have_fastchunks(av));
-
-  /* Request enough space for nb + pad + overhead */
-  size = nb + av->top_pad + MINSIZE;
-
-  /*
-    If contiguous, we can subtract out existing space that we hope to
-    combine with new space. We add it back later only if
-    we don't actually get contiguous space.
-  */
-  if (contiguous(av))
-    size -= old_size;
-
-  /*
-    Round to a multiple of page size.
-    If MORECORE is not contiguous, this ensures that we only call it
-    with whole-page arguments.  And if MORECORE is contiguous and
-    this is not first time through, this preserves page-alignment of
-    previous calls. Otherwise, we correct to page-align below.
-  */
-
-  size = (size + pagemask) & ~pagemask;
-
-  /*
-    Don't try to call MORECORE if argument is so big as to appear
-    negative. Note that since mmap takes size_t arg, it may succeed
-    below even if we cannot call MORECORE.
-  */
-  if (size > 0 && morecore32bit(av)) 
-    brk = (char*)(MORECORE(size));
-
-  /*
-    If have mmap, try using it as a backup when MORECORE fails or
-    cannot be used. This is worth doing on systems that have "holes" in
-    address space, so sbrk cannot extend to give contiguous space, but
-    space is available elsewhere.  Note that we ignore mmap max count
-    and threshold limits, since the space will not be used as a
-    segregated mmap region.
-  */
-  if (brk != (char*)(MORECORE_FAILURE)) {
-    av->sbrked_mem += size;
-    VALGRIND_MAKE_MEM_NOACCESS(brk,size);
-  }
-
-  else {
-
-#ifdef DNMALLOC_DEBUG
-    fprintf(stderr, "Morecore failure in sysmalloc\n");
-#endif
-
-    /* Cannot merge with old top, so add its size back in */
-    if (contiguous(av))
-      size = (size + old_size + pagemask) & ~pagemask;
-
-    /* If we are relying on mmap as backup, then use larger units */
-    if ((CHUNK_SIZE_T)(size) < (CHUNK_SIZE_T)(MMAP_AS_MORECORE_SIZE))
-      size = MMAP_AS_MORECORE_SIZE;
-
-    /* Don't try if size wraps around 0 */
-    if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb)) {
-
-#ifdef DNMALLOC_DEBUG
-      fprintf(stderr, "Try mmap in sysmalloc\n");
-#endif
-      brk = (char*)(MMAP(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE));
-      
-      if (brk != (char*)(MORECORE_FAILURE)) {
-        
-	VALGRIND_MAKE_MEM_NOACCESS(brk,size);
-
-	av->mmapped_mem += size;
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Mmapped successfully in sysmalloc %p\n", brk);
-#endif
-
-        /* We do not need, and cannot use, another sbrk call to find end */
-        snd_brk = brk + size;
-        
-        /* 
-           Record that we no longer have a contiguous sbrk region. 
-           After the first time mmap is used as backup, we do not
-           ever rely on contiguous space since this could incorrectly
-           bridge regions.
-        */
-        set_noncontiguous(av);
-      }
-    }
-  }
-
-  if (brk != (char*)(MORECORE_FAILURE)) {
-#ifdef DNMALLOC_DEBUG
-    fprintf(stderr, "Success path %lu allocated, sbrked %lu\n", 
-	    size, (unsigned long)av->sbrked_mem);
-#endif
-    /* av->sbrked_mem += size; moved up */
-
-    /*
-      If MORECORE extends previous space, we can likewise extend top size.
-    */
-    
-    if (brk == old_end && snd_brk == (char*)(MORECORE_FAILURE)) {
-      set_head(old_top, (size + old_size) | PREV_INUSE);
-#ifdef DNMALLOC_DEBUG
-      fprintf(stderr, "Previous space extended\n");
-#endif
-    }
-
-    /*
-      Otherwise, make adjustments:
-      
-      * If the first time through or noncontiguous, we need to call sbrk
-        just to find out where the end of memory lies.
-
-      * We need to ensure that all returned chunks from malloc will meet
-        MALLOC_ALIGNMENT
-
-      * If there was an intervening foreign sbrk, we need to adjust sbrk
-        request size to account for fact that we will not be able to
-        combine new space with existing space in old_top.
-
-      * Almost all systems internally allocate whole pages at a time, in
-        which case we might as well use the whole last page of request.
-        So we allocate enough more memory to hit a page boundary now,
-        which in turn causes future contiguous calls to page-align.
-    */
-    
-    else {
-      /* front_misalign = 0; *//*superfluous */
-      /* end_misalign = 0; *//*superfluous */
-      correction = 0;
-      aligned_brk = brk;
-
-      /*
-        If MORECORE returns an address lower than we have seen before,
-        we know it isn't really contiguous.  This and some subsequent
-        checks help cope with non-conforming MORECORE functions and
-        the presence of "foreign" calls to MORECORE from outside of
-        malloc or by other threads.  We cannot guarantee to detect
-        these in all cases, but cope with the ones we do detect.
-      */
-      if (contiguous(av) && old_size != 0 && brk < old_end) {
-        set_noncontiguous(av);
-      }
-      
-      /* handle contiguous cases */
-      if (contiguous(av)) { 
-
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Handle contiguous cases\n");
-#endif
-        /* 
-           We can tolerate forward non-contiguities here (usually due
-           to foreign calls) but treat them as part of our space for
-           stats reporting.
-        */
-        if (old_size != 0) 
-          av->sbrked_mem += brk - old_end;
-        
-        /* Guarantee alignment of first new chunk made from this space */
-
-        front_misalign = (INTERNAL_SIZE_T) brk & MALLOC_ALIGN_MASK;
-        if (front_misalign > 0) {
-
-          /*
-            Skip over some bytes to arrive at an aligned position.
-            We don't need to specially mark these wasted front bytes.
-            They will never be accessed anyway because
-            prev_inuse of av->top (and any chunk created from its start)
-            is always true after initialization.
-          */
-
-          correction = MALLOC_ALIGNMENT - front_misalign;
-          aligned_brk += correction;
-        }
-        
-        /*
-          If this isn't adjacent to existing space, then we will not
-          be able to merge with old_top space, so must add to 2nd request.
-        */
-        
-        correction += old_size;
-        
-        /* Extend the end address to hit a page boundary */
-        end_misalign = (INTERNAL_SIZE_T)(brk + size + correction);
-        correction += ((end_misalign + pagemask) & ~pagemask) - end_misalign;
-        
-        assert(correction >= 0);
-        snd_brk = (char*)(MORECORE(correction));
-        
-        if (snd_brk == (char*)(MORECORE_FAILURE)) {
-          /*
-            If can't allocate correction, try to at least find out current
-            brk.  It might be enough to proceed without failing.
-          */
-          correction = 0;
-          snd_brk = (char*)(MORECORE(0));
-        }
-        else if (snd_brk < brk) {
-          /*
-            If the second call gives noncontiguous space even though
-            it says it won't, the only course of action is to ignore
-            results of second call, and conservatively estimate where
-            the first call left us. Also set noncontiguous, so this
-            won't happen again, leaving at most one hole.
-            
-            Note that this check is intrinsically incomplete.  Because
-            MORECORE is allowed to give more space than we ask for,
-            there is no reliable way to detect a noncontiguity
-            producing a forward gap for the second call.
-          */
-          snd_brk = brk + size;
-          correction = 0;
-          set_noncontiguous(av);
-        }
-	else {
-	  VALGRIND_MAKE_MEM_NOACCESS(snd_brk,correction);
-	}
-
-      }
-      
-      /* handle non-contiguous cases */
-      else { 
-
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Handle non-contiguous cases\n");
-#endif
-
-        /* MORECORE/mmap must correctly align */
-        assert(aligned_OK(brk));
-        
-        /* Find out current end of memory */
-        if (snd_brk == (char*)(MORECORE_FAILURE)) {
-          snd_brk = (char*)(MORECORE(0));
-          av->sbrked_mem += snd_brk - brk - size;
-        }
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Sbrked now %lu\n", (unsigned long)av->sbrked_mem);
-#endif
-      }
-      
-      /* Adjust top based on results of second sbrk.
-       *
-       * If mmap() has been used as backup for failed morecore(),
-       * we end up in this branch as well.
-       */
-      if (snd_brk != (char*)(MORECORE_FAILURE)) {
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Adjust top, correction %lu\n", correction);
-#endif
-        /* hashtable_remove(chunk(av->top)); *//* rw 19.05.2008 removed */
-	av->top =  cireg_getfree();
-        av->top->chunk = (mchunkptr)aligned_brk;
-        set_head(av->top, (snd_brk - aligned_brk + correction) | PREV_INUSE);
-#ifdef DNMALLOC_DEBUG
-	fprintf(stderr, "Adjust top, top %p size %lu\n", 
-		av->top, (unsigned long)chunksize(av->top));
-#endif
-        hashtable_add(av->top);
-        av->sbrked_mem += correction;
-     
-        /*
-          If not the first time through, we either have a
-          gap due to foreign sbrk or a non-contiguous region.  Insert a
-          double fencepost at old_top to prevent consolidation with space
-          we don't own. These fenceposts are artificial chunks that are
-          marked as inuse. Original dlmalloc had two of these but too 
-          small to use. To ensure that the linked lists contain a maximum 
-          of 8 elements we only use 1. Inuse is determined by the 
-          current rather than the next chunk anyway.
-        */
-   
-        if (old_size != 0) {
-#ifdef DNMALLOC_DEBUG
-	  fprintf(stderr, "Shrink old_top to insert fenceposts\n");
-#endif
-          /* 
-             Shrink old_top to insert fenceposts, keeping size a
-             multiple of MALLOC_ALIGNMENT. We know there is at least
-             enough space in old_top to do this.
-          */
-#ifdef DNMALLOC_DEBUG
-	  fprintf(stderr, "Adjust top, old_top %p old_size before %lu\n", 
-		  old_top, (unsigned long)old_size);
-#endif
-          old_size = (old_size - 4*SIZE_SZ) & ~MALLOC_ALIGN_MASK;
-          set_head(old_top, old_size | PREV_INUSE);
-#ifdef DNMALLOC_DEBUG
-	  fprintf(stderr, "Adjust top, old_size after %lu\n", 
-		  (unsigned long)old_size);
-#endif
-          
-          /*
-            Note that the following assignments completely overwrite
-            old_top when old_size was previously MINSIZE.  This is
-            intentional. We need the fencepost, even if old_top otherwise gets
-            lost.
-          */
-          /* dnmalloc, we need the fencepost to be 16 bytes, however since 
-	     it's marked inuse it will never be coalesced 
-	  */
-          fencepost = cireg_getfree();
-          fencepost->chunk = (mchunkptr) chunk_at_offset(chunk(old_top), 
-							 old_size);
-          fencepost->size = 16|INUSE|PREV_INUSE;
-          hashtable_add(fencepost);
-          /* 
-             If possible, release the rest, suppressing trimming.
-          */
-          if (old_size >= MINSIZE) {
-            INTERNAL_SIZE_T tt = av->trim_threshold;
-#ifdef DNMALLOC_DEBUG
-	    fprintf(stderr, "Release\n");
-#endif
-            av->trim_threshold = (INTERNAL_SIZE_T)(-1);
-	    set_head(old_top, old_size | PREV_INUSE | INUSE);
-	    guard_set(av->guard_stored, old_top, 0, old_size);
-	    VALGRIND_MALLOCLIKE_BLOCK(chunk(old_top), old_size, 0, 0);
-            fREe(chunk(old_top));
-            av->trim_threshold = tt;
-#ifdef DNMALLOC_DEBUG
-	    fprintf(stderr, "Release done\n");
-#endif
-          }
-
-#ifdef DNMALLOC_DEBUG
-	  fprintf(stderr, "Adjust top, size %lu\n", 
-		  (unsigned long)chunksize(av->top));
-#endif
-
-        } /* fenceposts */
-      } /* adjust top */
-    } /* not extended previous region */
-    
-    /* Update statistics */
-    sum = av->sbrked_mem;
-    if (sum > (CHUNK_SIZE_T)(av->max_sbrked_mem))
-      av->max_sbrked_mem = sum;
-    
-    sum += av->mmapped_mem;
-    if (sum > (CHUNK_SIZE_T)(av->max_total_mem))
-      av->max_total_mem = sum;
-
-    check_malloc_state();
-    
-    /* finally, do the allocation */
-
-    p = av->top;
-    size = chunksize(p);
-    
-#ifdef DNMALLOC_DEBUG
-    fprintf(stderr, "Size: %lu  nb+MINSIZE: %lu\n", 
-	    (CHUNK_SIZE_T)(size), (CHUNK_SIZE_T)(nb + MINSIZE));
-#endif
-
-    /* check that one of the above allocation paths succeeded */
-    if ((CHUNK_SIZE_T)(size) >= (CHUNK_SIZE_T)(nb + MINSIZE)) {
-      remainder_size = size - nb;
-      remainder = cireg_getfree();
-      remainder->chunk = chunk_at_offset(chunk(p), nb);
-      av->top = remainder;
-      set_head(p, nb | PREV_INUSE | INUSE);
-      set_head(remainder, remainder_size | PREV_INUSE);
-      hashtable_insert (p, av->top);
-      check_malloced_chunk(p, nb);
-#ifdef DNMALLOC_DEBUG
-      fprintf(stderr, "Return any (total %lu)\n", 
-	      (unsigned long)/* size_t */av->max_total_mem );
-#endif
-      return chunk(p);
-    }
-
-  }
-
-#ifdef DNMALLOC_DEBUG
-  fprintf(stderr, "Return failed (total %lu)\n", 
-	  (unsigned long)/* size_t */av->max_total_mem );
-#endif
-
-  /* catch all failure paths */
-  MALLOC_FAILURE_ACTION;
-  return 0;
-}
-
-
-
-
-/*
-  sYSTRIm is an inverse of sorts to sYSMALLOc.  It gives memory back
-  to the system (via negative arguments to sbrk) if there is unused
-  memory at the `high' end of the malloc pool. It is called
-  automatically by free() when top space exceeds the trim
-  threshold. It is also called by the public malloc_trim routine.  It
-  returns 1 if it actually released any memory, else 0.
-*/
-
-#if __STD_C
-static int sYSTRIm(size_t pad, mstate av)
-#else
-static int sYSTRIm(pad, av) size_t pad; mstate av;
-#endif
-{
-  long  top_size;        /* Amount of top-most memory */
-  long  extra;           /* Amount to release */
-  long  released;        /* Amount actually released */
-  char* current_brk;     /* address returned by pre-check sbrk call */
-  char* new_brk;         /* address returned by post-check sbrk call */
-  size_t pagesz;
-
-  pagesz = av->pagesize;
-  top_size = chunksize(av->top);
-  
-  /* Release in pagesize units, keeping at least one page */
-  extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz;
-  
-  if (extra > 0) {
-    
-    /*
-      Only proceed if end of memory is where we last set it.
-      This avoids problems if there were foreign sbrk calls.
-    */
-    current_brk = (char*)(MORECORE(0));
-    if (current_brk == (char*)(av->top) + top_size) {
-      
-      /*
-        Attempt to release memory. We ignore MORECORE return value,
-        and instead call again to find out where new end of memory is.
-        This avoids problems if first call releases less than we asked,
-        of if failure somehow altered brk value. (We could still
-        encounter problems if it altered brk in some very bad way,
-        but the only thing we can do is adjust anyway, which will cause
-        some downstream failure.)
-      */
-      
-      MORECORE(-extra);
-      new_brk = (char*)(MORECORE(0));
-      
-      if (new_brk != (char*)MORECORE_FAILURE) {
-        released = (long)(current_brk - new_brk);
-        
-        if (released != 0) {
-          /* Success. Adjust top. */
-          av->sbrked_mem -= released;
-          set_head(av->top, (top_size - released) | PREV_INUSE);
-          check_malloc_state();
-          return 1;
-        }
-      }
-    }
-  }
-  return 0;
-}
-
-/*
-  ------------------------------ malloc ------------------------------
-*/
-
-
-#if __STD_C
-DL_STATIC Void_t* mALLOc(size_t bytes)
-#else
-DL_STATIC   Void_t* mALLOc(bytes) size_t bytes;
-#endif
-{
-  mstate av = get_malloc_state();
-
-  INTERNAL_SIZE_T nb;               /* normalized request size */
-  unsigned int    idx;              /* associated bin index */
-  mbinptr         bin;              /* associated bin */
-  mfastbinptr*    fb;               /* associated fastbin */
-
-  chunkinfoptr       victim;           /* inspected/selected chunk */
-  INTERNAL_SIZE_T size;             /* its size */
-  int             victim_index;     /* its bin index */
-
-  chunkinfoptr       remainder;        /* remainder from a split */
-  CHUNK_SIZE_T    remainder_size;   /* its size */
-
-  unsigned int    block;            /* bit map traverser */
-  unsigned int    bit;              /* bit map traverser */
-  unsigned int    map;              /* current word of binmap */
-
-  chunkinfoptr       fwd;              /* misc temp for linking */
-  chunkinfoptr       bck;              /* misc temp for linking */
-  
-  Void_t*         retval;
-
-  /* chunkinfoptr	  next; */
- 
-
-  /*
-    Convert request size to internal form by adding SIZE_SZ bytes
-    overhead plus possibly more to obtain necessary alignment and/or
-    to obtain a size of at least MINSIZE, the smallest allocatable
-    size. Also, checked_request2size traps (returning 0) request sizes
-    that are so large that they wrap around zero when padded and
-    aligned.
-  */
-#if defined(SH_CUTEST)
-  extern int malloc_count;
-  ++malloc_count;
-#endif
-
-  checked_request2size(bytes, nb);
-
-  /*
-    Bypass search if no frees yet
-   */
-  if (av && have_anychunks(av)) {
-    goto av_initialized;
-  }
-  else {
-    if (!av || av->max_fast == 0) { /* initialization check */
-      malloc_consolidate(av);
-      av = get_malloc_state();
-    }
-    goto use_top;
-  }
-
- av_initialized:
-
-  /*
-    If the size qualifies as a fastbin, first check corresponding bin.
-  */
-  if ((CHUNK_SIZE_T)(nb) <= (CHUNK_SIZE_T)(av->max_fast)) {
-    fb = &(av->fastbins[(fastbin_index(nb))]);
-    if ( (victim = *fb) != 0) {
-      *fb = victim->fd;
-      check_remalloced_chunk(victim, nb);
-      guard_set(av->guard_stored, victim, bytes, nb);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-      return chunk(victim);
-    }
-  }
-
-  /*
-    If a small request, check regular bin.  Since these "smallbins"
-    hold one size each, no searching within bins is necessary.
-    (For a large request, we need to wait until unsorted chunks are
-    processed to find best fit. But for small ones, fits are exact
-    anyway, so we can check now, which is faster.)
-  */
-
-  if (in_smallbin_range(nb)) {
-    idx = smallbin_index(nb);
-    bin = bin_at(av,idx);
-
-    if ((victim = last(bin)) != bin) {
-      bck = victim->bk;
-      bin->bk = bck;
-      bck->fd = bin;
-
-      set_all_inuse(victim);
-            
-      check_malloced_chunk(victim, nb);
-      guard_set(av->guard_stored, victim, bytes, nb);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-      return chunk(victim);
-    }
-  }
-
-  /* 
-     If this is a large request, consolidate fastbins before continuing.
-     While it might look excessive to kill all fastbins before
-     even seeing if there is space available, this avoids
-     fragmentation problems normally associated with fastbins.
-     Also, in practice, programs tend to have runs of either small or
-     large requests, but less often mixtures, so consolidation is not 
-     invoked all that often in most programs. And the programs that
-     it is called frequently in otherwise tend to fragment.
-  */
-
-  else {
-    idx = largebin_index(nb);
-    if (have_fastchunks(av)) 
-      malloc_consolidate(av);
-  }
-
-  /*
-    Process recently freed or remaindered chunks, taking one only if
-    it is exact fit, or, if this a small request, the chunk is remainder from
-    the most recent non-exact fit.  Place other traversed chunks in
-    bins.  Note that this step is the only place in any routine where
-    chunks are placed in bins.
-  */
-    
-  while ( (victim = unsorted_chunks(av)->bk) != unsorted_chunks(av)) {
-    bck = victim->bk;
-    size = chunksize(victim);
-    
-    /* 
-       If a small request, try to use last remainder if it is the
-       only chunk in unsorted bin.  This helps promote locality for
-       runs of consecutive small requests. This is the only
-       exception to best-fit, and applies only when there is
-       no exact fit for a small chunk.
-    */
-    
-    if (UNLIKELY(in_smallbin_range(nb) && 
-		 bck == unsorted_chunks(av) &&
-		 victim == av->last_remainder &&
-		 (CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb + MINSIZE))) {
-      
-      /* split and reattach remainder */
-      remainder_size = size - nb;
-      remainder = cireg_getfree();
-      remainder->chunk = chunk_at_offset(chunk(victim), nb);
-      unsorted_chunks(av)->bk = unsorted_chunks(av)->fd = remainder;
-      av->last_remainder = remainder; 
-      remainder->bk = remainder->fd = unsorted_chunks(av);
-      
-      set_head(victim, nb | PREV_INUSE|INUSE);
-      set_head(remainder, remainder_size | PREV_INUSE);      
-      hashtable_insert(victim, remainder);
-
-      check_malloced_chunk(victim, nb);
-      guard_set(av->guard_stored, victim, bytes, nb);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-      return chunk(victim);
-    }
-    
-    /* remove from unsorted list */
-    unsorted_chunks(av)->bk = bck;
-    bck->fd = unsorted_chunks(av);
-    
-    /* Take now instead of binning if exact fit */
-    
-    if (UNLIKELY(size == nb)) {
-      set_all_inuse(victim)
-      check_malloced_chunk(victim, nb);
-      guard_set(av->guard_stored, victim, bytes, nb);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-      return chunk(victim);
-    }
-    
-    /* place chunk in bin */
-    
-    if (in_smallbin_range(size)) {
-
-      victim_index = smallbin_index(size);
-      bck = bin_at(av, victim_index);
-      fwd = bck->fd;
-    }
-    else {
-      victim_index = largebin_index(size);
-      bck = bin_at(av, victim_index);
-      fwd = bck->fd;
-      
-      if (UNLIKELY(fwd != bck)) {
-        /* if smaller than smallest, place first */
-        if ((CHUNK_SIZE_T)(size) < (CHUNK_SIZE_T)(bck->bk->size)) {
-          fwd = bck;
-          bck = bck->bk;
-        }
-        else if ((CHUNK_SIZE_T)(size) >= 
-                 (CHUNK_SIZE_T)(FIRST_SORTED_BIN_SIZE)) {
-          
-          /* maintain large bins in sorted order */
-          size |= PREV_INUSE|INUSE; /* Or with inuse bits to speed comparisons */
-          while ((CHUNK_SIZE_T)(size) < (CHUNK_SIZE_T)(fwd->size)) 
-            fwd = fwd->fd;
-          bck = fwd->bk;
-        }
-      }
-    }
-
-    mark_bin(av, victim_index);
-    victim->bk = bck;
-    victim->fd = fwd;
-    fwd->bk = victim;
-    bck->fd = victim;
-  }
-  
-  /*
-    If a large request, scan through the chunks of current bin to
-    find one that fits.  (This will be the smallest that fits unless
-    FIRST_SORTED_BIN_SIZE has been changed from default.)  This is
-    the only step where an unbounded number of chunks might be
-    scanned without doing anything useful with them. However the
-    lists tend to be short.
-  */
-
-  if (!in_smallbin_range(nb)) {
-    bin = bin_at(av, idx);
-    
-    victim = last(bin);
-
-    if (UNLIKELY(victim != bin)) {
-
-      do {
-	size = chunksize(victim);
-      
-	if ((CHUNK_SIZE_T)(size) >= (CHUNK_SIZE_T)(nb)) {
-	  remainder_size = size - nb;
-	  unlink(victim, bck, fwd);
-        
-	  /* Split */
-	  if (remainder_size >= MINSIZE) {
-	    remainder = cireg_getfree();
-	    remainder->chunk = chunk_at_offset(chunk(victim), nb);
-	    unsorted_chunks(av)->bk = unsorted_chunks(av)->fd = remainder;
-	    remainder->bk = remainder->fd = unsorted_chunks(av);
-	    set_head(victim, nb | PREV_INUSE | INUSE);
-	    set_head(remainder, remainder_size | PREV_INUSE);
-	    hashtable_insert(victim, remainder);
-	    check_malloced_chunk(victim, nb);
-	    guard_set(av->guard_stored, victim, bytes, nb);
-	    VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-	    return chunk(victim);
-	  } 
-	  /* Exhaust */
-	  else  {
-	    set_all_inuse(victim);
-	    check_malloced_chunk(victim, nb);
-	    guard_set(av->guard_stored, victim, bytes, nb);
-	    VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-	    return chunk(victim);
-	  }
-	}
-	victim = victim->bk;
-      } while(victim != bin);
-    }
-  }
-
-  /*
-    Search for a chunk by scanning bins, starting with next largest
-    bin. This search is strictly by best-fit; i.e., the smallest
-    (with ties going to approximately the least recently used) chunk
-    that fits is selected.
-    
-    The bitmap avoids needing to check that most blocks are nonempty.
-  */
-    
-
-  ++idx;
-  bin = bin_at(av,idx);
-  block = idx2block(idx);
-  map = av->binmap[block];
-  bit = idx2bit(idx);
-  
-  for (;;) {
-    
-    /* Skip rest of block if there are no more set bits in this block.  */
-    if (bit > map || bit == 0) {
-      do {
-        if (++block >= BINMAPSIZE)  /* out of bins */
-          goto use_top;
-      } while ( (map = av->binmap[block]) == 0);
-      
-      bin = bin_at(av, (block << BINMAPSHIFT));
-      bit = 1;
-    }
-    
-    /* Advance to bin with set bit. There must be one. */
-    while ((bit & map) == 0) {
-      bin = next_bin(bin);
-      bit <<= 1;
-      assert(bit != 0);
-    }
-    
-    /* Inspect the bin. It is likely to be non-empty */
-    victim = last(bin);
-    
-    /*  If a false alarm (empty bin), clear the bit. */
-    if (victim == bin) {
-      av->binmap[block] = map &= ~bit; /* Write through */
-      bin = next_bin(bin);
-      bit <<= 1;
-    }
-    
-    else {
-      size = chunksize(victim);
-      
-      /*  We know the first chunk in this bin is big enough to use. */
-      assert((CHUNK_SIZE_T)(size) >= (CHUNK_SIZE_T)(nb));
-      
-      remainder_size = size - nb;
-      
-      /* unlink */
-      bck = victim->bk;
-      bin->bk = bck;
-      bck->fd = bin;
-      
-      /* Split */
-      if (remainder_size >= MINSIZE) {
-        remainder = cireg_getfree();
-        remainder->chunk = chunk_at_offset(chunk(victim), nb);
-        
-        unsorted_chunks(av)->bk = unsorted_chunks(av)->fd = remainder;
-        remainder->bk = remainder->fd = unsorted_chunks(av);
-        /* advertise as last remainder */
-        if (in_smallbin_range(nb))
-	  av->last_remainder = remainder;
-        
-        set_head(victim, nb | PREV_INUSE | INUSE);
-        set_head(remainder, remainder_size | PREV_INUSE);
-        hashtable_insert(victim, remainder);
-        check_malloced_chunk(victim, nb);
-	guard_set(av->guard_stored, victim, bytes, nb);
-	VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-        return chunk(victim);
-      }
-      /* Exhaust */
-      else {
-        set_all_inuse(victim);
-        check_malloced_chunk(victim, nb);
-	guard_set(av->guard_stored, victim, bytes, nb);
-	VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-        return chunk(victim);
-      }
-      
-    }
-  }
-
-  use_top:
-   
-
-  /*
-    If large enough, split off the chunk bordering the end of memory
-    (held in av->top). Note that this is in accord with the best-fit
-    search rule.  In effect, av->top is treated as larger (and thus
-    less well fitting) than any other available chunk since it can
-    be extended to be as large as necessary (up to system
-    limitations).
-    
-    We require that av->top always exists (i.e., has size >=
-    MINSIZE) after initialization, so if it would otherwise be
-    exhuasted by current request, it is replenished. (The main
-    reason for ensuring it exists is that we may need MINSIZE space
-    to put in fenceposts in sysmalloc.)
-  */
-  
-  victim = av->top;
-  size = chunksize(victim);
-  
-  if ((CHUNK_SIZE_T)(size) >= (CHUNK_SIZE_T)(nb + MINSIZE)) {
-    remainder = cireg_getfree();
-    remainder_size = size - nb;
-    remainder->chunk = chunk_at_offset(chunk(victim), nb);
-    av->top = remainder;
-    set_head(victim, nb | PREV_INUSE | INUSE);
-    set_head(remainder, remainder_size | PREV_INUSE);
-    hashtable_insert(victim, remainder);
-    check_malloced_chunk(victim, nb);
-    guard_set(av->guard_stored, victim, bytes, nb);
-    VALGRIND_MALLOCLIKE_BLOCK(chunk(victim), bytes, 0, 0);
-    return chunk(victim);
-  }
-  
-  /* 
-     If no space in top, relay to handle system-dependent cases 
-  */
-  retval = sYSMALLOc(nb, av);
-  if (retval) {
-#if PARANOIA > 2
-    victim = mem2chunk(retval); /* is used in guard_set macro */
-#endif
-    guard_set(av->guard_stored, victim, bytes, nb);
-  }
-  VALGRIND_MALLOCLIKE_BLOCK(retval, bytes, 0, 0);
-  return retval;
-}
-
-/*
-  ------------------------------ free ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC void fREe(Void_t* mem)
-#else
-DL_STATIC void fREe(mem) Void_t* mem;
-#endif
-{
-  mstate av = get_malloc_state();
-
-  chunkinfoptr       p;           /* chunk corresponding to mem */
-  INTERNAL_SIZE_T size;        /* its size */
-  mfastbinptr*    fb;          /* associated fastbin */
-  chunkinfoptr       prevchunk;   /* previous physical chunk */
-  chunkinfoptr       nextchunk;   /* next contiguous chunk */
-  INTERNAL_SIZE_T nextsize;    /* its size */
-  INTERNAL_SIZE_T prevsize;    /* size of previous contiguous chunk */
-  chunkinfoptr       bck;         /* misc temp for linking */
-  chunkinfoptr       fwd;         /* misc temp for linking */
-  chunkinfoptr	     next;
-#if defined(SH_CUTEST)
-  extern int malloc_count;
-  --malloc_count;
-#endif
-
-  /* free(0) has no effect */
-  if (mem != 0) {
-    p = hashtable_lookup(mem);
-    /* check that memory is managed by us 
-     * and is inuse 
-     */
-    if (UNLIKELY(!p || !inuse(p))) 
-      {
-#ifdef DNMALLOC_CHECKS
-	if (p) {
-	  fprintf(stderr, "Attempt to free memory not in use\n");
-	  abort();
-	} else {
-	  fprintf(stderr, "Attempt to free memory not allocated\n");
-	  abort();
-	}
-#endif
-	assert(p && inuse(p));
-	return;
-      }
-
-    VALGRIND_FREELIKE_BLOCK(mem, 0);
- 
-    guard_check(av->guard_stored, p);
-    
-    size = chunksize(p);
-
-    check_inuse_chunk(p);
-
-    /*
-      If eligible, place chunk on a fastbin so it can be found
-      and used quickly in malloc.
-    */
-
-    if ((CHUNK_SIZE_T)(size) <= (CHUNK_SIZE_T)(av->max_fast)
-
-#if TRIM_FASTBINS
-        /* 
-           If TRIM_FASTBINS set, don't place chunks
-           bordering top into fastbins
-        */
-        && (chunk_at_offset(chunk(p), size) != av->top)
-#endif
-        ) {
-
-      set_fastchunks(av);
-      fb = &(av->fastbins[fastbin_index(size)]);
-      p->fd = *fb;
-      *fb = p;
-    }
-
-    /*
-       Consolidate other non-mmapped chunks as they arrive.
-    */
-
-    else if (!chunk_is_mmapped(p)) {
-      set_anychunks(av);
-
-      nextchunk = next_chunkinfo(p);
-      if (nextchunk)
-	nextsize = chunksize(nextchunk);
-      else
-	nextsize = 0;/* gcc doesn't notice that it's only used if (nextchunk)*/
-
-      /* consolidate backward */
-      if (UNLIKELY(!prev_inuse(p))) {
-        prevchunk = prev_chunkinfo(p);
-        prevsize = chunksize(prevchunk);
-#ifdef DNMALLOC_CHECKS
-	if (inuse(prevchunk)) {
-		fprintf(stderr, "Dnmalloc error: trying to unlink an inuse chunk: %p (chunk: %p)\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n", prevchunk, chunk(prevchunk));
-		abort();
-	}
-#else
-	assert(!inuse(prevchunk));
-#endif
-        size += prevsize;
-        unlink(prevchunk, bck, fwd);
-	set_head(p, size | PREV_INUSE);
-        hashtable_skiprm(prevchunk,p);
-        /* This chunk no longer exists in any form: release the chunkinfoptr 
-	 */
-        freecilst_add(p);
-        p = prevchunk;
-      }
-
-      if (nextchunk) {
-	if (nextchunk != av->top) {
-	  /* get and clear inuse bit */
-	  clear_previnuse(nextchunk);
-	  
-	  /* consolidate forward */
-	  if (!inuse(nextchunk)) {
-	    /* if mmap is used instead of sbrk, we may have a
-	     * chunk with !nextchunk->fd && !nextchunk->bk
-	     */
-	    if (nextchunk->fd && nextchunk->fd)
-	      {
-		unlink(nextchunk, bck, fwd);
-		size += nextsize;
-		set_head(p, size | PREV_INUSE);
-		hashtable_skiprm(p, nextchunk);
-		freecilst_add (nextchunk);
-	      }
-	  }
-	  
-	  set_head(p, size | PREV_INUSE);
-	  next = next_chunkinfo(p);
-	  if (next)
-	    next->prev_size = size;
-	  
-	  /*
-	    Place the chunk in unsorted chunk list. Chunks are
-	    not placed into regular bins until after they have
-	    been given one chance to be used in malloc.
-	  */
-	  
-	  bck = unsorted_chunks(av);
-	  fwd = bck->fd;
-	  p->bk = bck;
-	  p->fd = fwd;
-	  bck->fd = p;
-	  fwd->bk = p;
-	  
-	  nextchunk = next_chunkinfo(p);
-	  if (nextchunk)
-	    nextchunk->prev_size = chunksize(p);	
-	  
-	  check_free_chunk(p);
-	}
-	
-	/*
-	  If the chunk borders the current high end of memory,
-	  consolidate into top
-	*/
-	
-	else {
-	  size += nextsize;
-	  set_head(p, size | PREV_INUSE);
-	  hashtable_remove(chunk(av->top));
-	  freecilst_add(av->top);
-	  av->top = p;
-	  check_chunk(p);
-	}
-      } /* if (nextchunk) */
-
-      /*
-        If freeing a large space, consolidate possibly-surrounding
-        chunks. Then, if the total unused topmost memory exceeds trim
-        threshold, ask malloc_trim to reduce top.
-
-        Unless max_fast is 0, we don't know if there are fastbins
-        bordering top, so we cannot tell for sure whether threshold
-        has been reached unless fastbins are consolidated.  But we
-        don't want to consolidate on each free.  As a compromise,
-        consolidation is performed if FASTBIN_CONSOLIDATION_THRESHOLD
-        is reached.
-      */
-
-      if (UNLIKELY((CHUNK_SIZE_T)(size) >= FASTBIN_CONSOLIDATION_THRESHOLD)) { 
-        if (have_fastchunks(av)) 
-          malloc_consolidate(av);
-
-#ifndef MORECORE_CANNOT_TRIM        
-        if ((CHUNK_SIZE_T)(chunksize(av->top)) >= 
-            (CHUNK_SIZE_T)(av->trim_threshold))
-	  {
-	    if (morecore32bit(av))
-	      {
-#ifdef DNMALLOC_DEBUG
-		fprintf(stderr, "Calling systrim from free()\n");
-#endif
-		sYSTRIm(av->top_pad, av);
-#ifdef DNMALLOC_DEBUG
-		fprintf(stderr, "Systrim done\n");
-#endif
-	      }
-	  }
-#endif
-      }
-
-    }
-    /*
-      If the chunk was allocated via mmap, release via munmap()
-      Note that if HAVE_MMAP is false but chunk_is_mmapped is
-      true, then user must have overwritten memory. There's nothing
-      we can do to catch this error unless DEBUG is set, in which case
-      check_inuse_chunk (above) will have triggered error.
-    */
-
-    else {
-#if  PARANOIA > 0
-      int ret;
-#endif
-      INTERNAL_SIZE_T offset = (INTERNAL_SIZE_T) p->hash_next;
-      av->n_mmaps--;
-      av->mmapped_mem -= (size + offset);
-#if  PARANOIA > 0
-      ret = munmap((char*) chunk(p) - offset, size + offset);
-#else
-      munmap((char*) chunk(p) - offset, size + offset);
-#endif
-      hashtable_remove_mmapped(chunk(p));
-      freecilst_add(p);
-      /* munmap returns non-zero on failure */
-      assert(ret == 0);
-    }
-  }
-}
-
-/*
-  ------------------------- malloc_consolidate -------------------------
-
-  malloc_consolidate is a specialized version of free() that tears
-  down chunks held in fastbins.  Free itself cannot be used for this
-  purpose since, among other things, it might place chunks back onto
-  fastbins.  So, instead, we need to use a minor variant of the same
-  code.
-  
-  Also, because this routine needs to be called the first time through
-  malloc anyway, it turns out to be the perfect place to trigger
-  initialization code.
-*/
-
-#if __STD_C
-static void malloc_consolidate(mstate av)
-#else
-static void malloc_consolidate(av) mstate av;
-#endif
-{
-  mfastbinptr*    fb;                 /* current fastbin being consolidated */
-  mfastbinptr*    maxfb;              /* last fastbin (for loop control) */
-  chunkinfoptr       p;                  /* current chunk being consolidated */
-  chunkinfoptr       nextp;              /* next chunk to consolidate */
-  chunkinfoptr       prevp;
-  chunkinfoptr       unsorted_bin;       /* bin header */
-  chunkinfoptr       first_unsorted;     /* chunk to link to */
-
-  /* These have same use as in free() */
-  chunkinfoptr       nextchunk;
-  INTERNAL_SIZE_T size;
-  INTERNAL_SIZE_T nextsize;
-  INTERNAL_SIZE_T prevsize;
-  chunkinfoptr       bck;
-  chunkinfoptr       fwd;
-  chunkinfoptr	     next;
- 
-  /*
-    If max_fast is 0, we know that av hasn't
-    yet been initialized, in which case do so below
-  */
-  if (av && av->max_fast != 0) {
-
-    clear_fastchunks(av);
-
-    unsorted_bin = unsorted_chunks(av);
-
-    /*
-      Remove each chunk from fast bin and consolidate it, placing it
-      then in unsorted bin. Among other reasons for doing this,
-      placing in unsorted bin avoids needing to calculate actual bins
-      until malloc is sure that chunks aren't immediately going to be
-      reused anyway.
-    */
-    
-    maxfb = &(av->fastbins[fastbin_index(av->max_fast)]);
-    fb = &(av->fastbins[0]);
-    do {
-      if ( UNLIKELY((p = *fb) != 0)) {
-        *fb = 0;
-	do {
-          check_inuse_chunk(p);
-          nextp = p->fd;
-          
-          /*
-	   * Slightly streamlined version of consolidation code in free() 
-	   */
-
-          size = chunksize(p);
-          nextchunk = next_chunkinfo(p);
-
-	  /* gcc doesn't notice that it's only used if (nextchunk) */
-	  if (nextchunk)
-	    nextsize = chunksize(nextchunk);
-	  else
-	    nextsize = 0; 
-          
-	  if (!prev_inuse(p)) {
-             prevp = prev_chunkinfo(p);
-             prevsize = chunksize(prevp);
-             size += prevsize;
-#ifdef DNMALLOC_CHECKS
-	     if (inuse(prevp)) {
-		fprintf(stderr, "Dnmalloc error: trying to unlink an inuse chunk (2): %p (chunk: %p)\n This is definitely a bug, please report it to dnmalloc@fort-knox.org.\n", prevp, chunk(prevp));
-		     abort();
-	     }
-#else
-	     assert(!inuse(prevp));
-#endif
-             unlink(prevp, bck, fwd);
-             set_head(p, size | PREV_INUSE);	     
-             hashtable_skiprm(prevp,p);
-             freecilst_add(p);
-             p=prevp;
-          }
-          
-	  if (nextchunk) {
-	    if (nextchunk != av->top) {
-
-	      clear_previnuse(nextchunk);
-            
-	      /* if mmap is used instead of sbrk, we may have a
-	       * chunk with !nextchunk->fd && !nextchunk->bk
-	       */
-	      if (!inuse(nextchunk)) {
-		if( nextchunk->fd && nextchunk->bk) {
-		  size += nextsize;
-		  unlink(nextchunk, bck, fwd);
-		  set_head(p, size | PREV_INUSE);
-		  hashtable_skiprm(p,nextchunk);
-		  freecilst_add(nextchunk);
-		}
-	      }
-	      
-	      first_unsorted = unsorted_bin->fd;
-	      unsorted_bin->fd = p;
-	      first_unsorted->bk = p;
-	      
-	      set_head(p, size | PREV_INUSE);
-	      p->bk = unsorted_bin;
-	      p->fd = first_unsorted;
-	      next = next_chunkinfo(p);
-	      if (next)
-	    	next->prev_size = size;
-
-            
-	    }
-          
-	    else if (nextchunk == av->top) {
-	      size += nextsize;
-	      set_head(p, size | PREV_INUSE);
-	      hashtable_remove(chunk(av->top));
-	      freecilst_add(av->top);
-	      av->top = p;
-	    }
-	  } /* if (nextchunk) */
-          
-        } while ( (p = nextp) != 0);
-        
-      }
-    } while (fb++ != maxfb);
-  }
-  else {
-    /* Initialize dnmalloc */
-    dnmalloc_init();
-    malloc_init_state(get_malloc_state());
-    check_malloc_state();
-  }
-}
-
-/*
-  ------------------------------ realloc ------------------------------
-*/
-
-
-#if __STD_C
-DL_STATIC Void_t* rEALLOc(Void_t* oldmem, size_t bytes)
-#else
-DL_STATIC Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
-#endif
-{
-  mstate av = get_malloc_state();
-
-  INTERNAL_SIZE_T  nb;              /* padded request size */
-
-  chunkinfoptr        oldp;            /* chunk corresponding to oldmem */
-  INTERNAL_SIZE_T  oldsize;         /* its size */
-
-  chunkinfoptr        newp;            /* chunk to return */
-  INTERNAL_SIZE_T  newsize;         /* its size */
-  Void_t*          newmem;          /* corresponding user mem */
-
-  chunkinfoptr        next;            /* next contiguous chunk after oldp */
-
-  chunkinfoptr        remainder;       /* extra space at end of newp */
-  CHUNK_SIZE_T     remainder_size;  /* its size */
-
-  chunkinfoptr        bck;             /* misc temp for linking */
-  chunkinfoptr        fwd;             /* misc temp for linking */
-
-  CHUNK_SIZE_T     copysize;        /* bytes to copy */
-  unsigned int     ncopies;         /* INTERNAL_SIZE_T words to copy */
-  INTERNAL_SIZE_T* s;               /* copy source */ 
-  INTERNAL_SIZE_T* d;               /* copy destination */
-
-  
-#ifdef REALLOC_ZERO_BYTES_FREES
-  if (UNLIKELY(bytes == 0)) {
-    fREe(oldmem);
-    return 0;
-  }
-#endif
-
-  if (UNLIKELY(!av || av->max_fast == 0)) {
-    malloc_consolidate(av);
-    av = get_malloc_state();
-  }
-
-  /* realloc of null is supposed to be same as malloc */
-  if (UNLIKELY(oldmem == 0)) 
-    return mALLOc(bytes);
-
-  checked_request2size(bytes, nb);
-
-  oldp    = hashtable_lookup(oldmem);
-  
-  if (UNLIKELY(!oldp || !inuse(oldp))){ 
-     /* attempt to either realloc memory not managed by us 
-      * or memory that is not in use 
-      */
-#ifdef DNMALLOC_CHECKS
-    if (oldp) {
-      fprintf(stderr, "Attempt to free memory not in use\n");
-      abort();
-    } else {
-      fprintf(stderr, "Attempt to free memory not allocated\n");
-      abort();
-    }
-#endif
-    assert(oldp && inuse(oldp));
-    return 0;     
-  }
-
-  VALGRIND_FREELIKE_BLOCK(oldmem, 0);
-  guard_check(av->guard_stored, oldp);
-
-  oldsize = chunksize(oldp);
-
-  check_inuse_chunk(oldp);
-
-  if (!chunk_is_mmapped(oldp)) {
-
-    if (UNLIKELY((CHUNK_SIZE_T)(oldsize) >= (CHUNK_SIZE_T)(nb))) {
-      /* already big enough; split below */
-      newp    = oldp;
-      newsize = oldsize;
-    }
-
-    else {
-      next = next_chunkinfo(oldp);
-      if (next)
-      	next->prev_size = oldsize;
-      /* Try to expand forward into top */
-      if (next && next == av->top &&
-          (CHUNK_SIZE_T)(newsize = oldsize + chunksize(next)) >=
-          (CHUNK_SIZE_T)(nb + MINSIZE)) {
-         set_head_size(oldp, nb);
-         hashtable_remove(chunk(av->top));
-         av->top->chunk = chunk_at_offset(chunk(oldp), nb);
-         set_head(av->top, (newsize - nb) | PREV_INUSE);
-         /* av->top->chunk has been moved move in hashtable */
-         hashtable_insert(oldp, av->top);
-	 guard_set(av->guard_stored, oldp, bytes, nb);
-	 VALGRIND_MALLOCLIKE_BLOCK(chunk(oldp), bytes, 0, 0); 
-         return chunk(oldp);
-      }
-      
-      /* Try to expand forward into next chunk;  split off remainder below */
-      else if (next && next != av->top && 
-               !inuse(next) &&
-               (CHUNK_SIZE_T)(newsize = oldsize + chunksize(next)) >=
-               (CHUNK_SIZE_T)(nb)) {
-        newp = oldp;
-        unlink(next, bck, fwd);
-        hashtable_remove(chunk(next));
-        freecilst_add(next);
-	next = next_chunkinfo(oldp);
-	if (next)
-	  next->prev_size = newsize;
-      }
-
-      /* allocate, copy, free */
-      else {
-
-        newmem = mALLOc(nb - MALLOC_ALIGN_MASK);
-         if (newmem == 0)
-          return 0; /* propagate failure */
-
-        newp = hashtable_lookup(newmem);
-        newsize = chunksize(newp);
-	
- 
-        /* next = next_chunkinfo(oldp); *//* 'next' never used rw 19.05.2008 */
-        /*
-          Avoid copy if newp is next chunk after oldp.
-        */
-	if (UNLIKELY(is_next_chunk(oldp, newp))) {
-	  newsize += oldsize;
-	  set_head_size(oldp, newsize);
-	  hashtable_skiprm(oldp, newp);
-	  freecilst_add(newp);	  
-          newp = oldp;
-        }
-        else {
-          /*
-            Unroll copy of <= 40 bytes (80 if 8byte sizes)
-            We know that contents have an even number of
-            INTERNAL_SIZE_T-sized words; minimally 4 (2 on amd64).
-          */
-          
-	  VALGRIND_MALLOCLIKE_BLOCK(chunk(oldp), chunksize(oldp), 0, 0);
-
-          copysize = oldsize;
-          s = (INTERNAL_SIZE_T*)(oldmem);
-          d = (INTERNAL_SIZE_T*)(newmem);
-          ncopies = copysize / sizeof(INTERNAL_SIZE_T);
-          assert(ncopies >= 2);
-          
-          if (ncopies > 10)
-            MALLOC_COPY(d, s, copysize);
-          
-          else {
-            *(d+0) = *(s+0);
-            *(d+1) = *(s+1);
-	    if (ncopies > 2) {
-	      *(d+2) = *(s+2);
-	      *(d+3) = *(s+3);
-	      if (ncopies > 4) {
-		*(d+4) = *(s+4);
-		*(d+5) = *(s+5);
-		if (ncopies > 6) {
-		  *(d+6) = *(s+6);
-		  *(d+7) = *(s+7);
-		  if (ncopies > 8) {
-		    *(d+8) = *(s+8);
-		    *(d+9) = *(s+9);
-		  }
-                }
-              }
-            }
-          }
-          
-          fREe(oldmem);
-          check_inuse_chunk(newp);
-	  guard_set(av->guard_stored, newp, bytes, nb);
-          return chunk(newp);
-        }
-      }
-    }
-
-    /* If possible, free extra space in old or extended chunk */
-
-    assert((CHUNK_SIZE_T)(newsize) >= (CHUNK_SIZE_T)(nb));
-
-    remainder_size = newsize - nb;
-
-    if (remainder_size >= MINSIZE) { /* split remainder */
-      remainder = cireg_getfree();
-      remainder->chunk = chunk_at_offset(chunk(newp), nb);
-      set_head_size(newp, nb);
-      set_head(remainder, remainder_size | PREV_INUSE | INUSE);
-      remainder->prev_size = nb;
-      hashtable_insert(newp, remainder);
-      /* Mark remainder as inuse so free() won't complain */
-      set_all_inuse(remainder);
-      guard_set(av->guard_stored, remainder, 0, remainder_size);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(remainder), remainder_size, 0, 0);
-      fREe(chunk(remainder)); 
-    }
-    else { /* not enough extra to split off */
-      set_head_size(newp, newsize);
-      set_all_inuse(newp);
-    }
-
-    check_inuse_chunk(newp);
-    guard_set(av->guard_stored, newp, bytes, nb);
-    VALGRIND_MALLOCLIKE_BLOCK(chunk(newp), bytes, 0, 0);
-    return chunk(newp);
-  }
-
-  /*
-    Handle mmap cases
-  */
-
-  else {
-
-#if HAVE_MREMAP
-    INTERNAL_SIZE_T offset = (INTERNAL_SIZE_T) oldp->hash_next;
-    size_t pagemask = av->pagesize - 1;
-    char *cp;
-    CHUNK_SIZE_T  sum;
-    
-
-    /* Note the extra SIZE_SZ overhead */
-    /* newsize = (nb + offset + SIZE_SZ + pagemask) & ~pagemask; */
-    newsize = (nb + offset + pagemask) & ~pagemask;
-
-    /* don't need to remap if still within same page */
-    if (oldsize == newsize - offset)
-      {
-	guard_set(av->guard_stored, oldp, bytes, nb);
-	VALGRIND_FREELIKE_BLOCK(oldmem, 0);
-	VALGRIND_MALLOCLIKE_BLOCK(oldmem, bytes, 0, 0);
-	return oldmem;
-      }
-
-    cp = (char*)mremap((char*)chunk(oldp) - offset, oldsize + offset, newsize, 1);
-    
-    if (cp != (char*)MORECORE_FAILURE) {
-       
-      hashtable_remove_mmapped(chunk(oldp));
-       
-      oldp->chunk = (mchunkptr)(cp + offset);
-      set_head(oldp, (newsize - offset)|IS_MMAPPED|INUSE);
-      
-      hashtable_add(oldp);
-      
-      assert(aligned_OK(chunk(oldp))); /* rw fix: newp -> oldp */
-      assert(( ((INTERNAL_SIZE_T) oldp->hash_next) == offset));
-      
-      /* update statistics */
-      sum = av->mmapped_mem += newsize - oldsize;
-      if (sum > (CHUNK_SIZE_T)(av->max_mmapped_mem)) 
-        av->max_mmapped_mem = sum;
-      sum += av->sbrked_mem;
-      if (sum > (CHUNK_SIZE_T)(av->max_total_mem)) 
-        av->max_total_mem = sum;
-      
-      guard_set(av->guard_stored, oldp, bytes, nb);
-      VALGRIND_FREELIKE_BLOCK(oldmem, 0);
-      VALGRIND_MALLOCLIKE_BLOCK(chunk(oldp), bytes, 0, 0);
-      return chunk(oldp);
-    }
-#endif /* have MREMAP */
-
-    /* Note the extra SIZE_SZ overhead. */
-    if ((CHUNK_SIZE_T)(oldsize) >= (CHUNK_SIZE_T)(nb + SIZE_SZ)) 
-      newmem = oldmem; /* do nothing */
-    else {
-      /* Must alloc, copy, free. */
-      newmem = mALLOc(nb - MALLOC_ALIGN_MASK);
-      if (newmem != 0) {
-        MALLOC_COPY(newmem, oldmem, oldsize);
-        fREe(oldmem);
-      }
-    }
-    VALGRIND_MALLOCLIKE_BLOCK(newmem, bytes, 0, 0);
-    guard_set(av->guard_stored, mem2chunk(newmem), bytes, nb);
-    return newmem;
-  }
-}
-
-/*
-  ---------------------------posix_memalign ----------------------------
-*/
-
-#if __STD_C
-DL_STATIC int posix_mEMALIGn(Void_t** memptr, size_t alignment, size_t bytes)
-#else
-DL_STATIC int posix_mEMALIGn(memptr, alignment, bytes) Void_t** memptr; size_t alignment; size_t bytes;
-#endif
-{
-  mstate av;
-
-  if (alignment % sizeof(void *) != 0)
-    return EINVAL;
-  if ((alignment & (alignment - 1)) != 0)
-    return EINVAL;
-
-  av = get_malloc_state();
-  if (!av || av->max_fast == 0) malloc_consolidate(av);
-  *memptr =  mEMALIGn(alignment, bytes);
-
-  return (*memptr != NULL ? 0 : ENOMEM);
-}
-
-/*
-  ------------------------------ memalign ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC Void_t* mEMALIGn(size_t alignment, size_t bytes)
-#else
-DL_STATIC Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
-#endif
-{
-  INTERNAL_SIZE_T nb;             /* padded  request size */
-  char*           m;              /* memory returned by malloc call */
-  chunkinfoptr       p;              /* corresponding chunk */
-  char*           brk;            /* alignment point within p */
-  chunkinfoptr       newp;           /* chunk to return */
-  INTERNAL_SIZE_T newsize;        /* its size */
-  INTERNAL_SIZE_T leadsize;       /* leading space before alignment point */
-  chunkinfoptr       remainder;      /* spare room at end to split off */
-  CHUNK_SIZE_T    remainder_size; /* its size */
-  INTERNAL_SIZE_T size;
-#if PARANOIA > 2
-  mstate          av;
-#endif
-
-  /* If need less alignment than we give anyway, just relay to malloc */
-
-  if (UNLIKELY(alignment <= MALLOC_ALIGNMENT)) return mALLOc(bytes);
-
-  /* Otherwise, ensure that it is at least a minimum chunk size */
-
-  if (alignment <  MINSIZE) alignment = MINSIZE;
-
-  /* Make sure alignment is power of 2 (in case MINSIZE is not).  */
-  if (UNLIKELY((alignment & (alignment - 1)) != 0)) {
-    size_t a = MALLOC_ALIGNMENT * 2;
-    while ((CHUNK_SIZE_T)a < (CHUNK_SIZE_T)alignment) a <<= 1;
-    alignment = a;
-  }
-
-  checked_request2size(bytes, nb);
-
-  /*
-    Strategy: find a spot within that chunk that meets the alignment
-    request, and then possibly free the leading and trailing space.
-  */
-
-
-  /* Call malloc with worst case padding to hit alignment. */
-
-  m  = (char*)(mALLOc(nb + alignment + MINSIZE));
-
-  if (m == 0) return 0; /* propagate failure */
-
-#if PARANOIA > 2
-  av = get_malloc_state();
-#endif
-
-  p = hashtable_lookup((mchunkptr) m);
-
-  if ((((PTR_UINT)(m)) % alignment) != 0) { /* misaligned */
-
-    /*
-      Find an aligned spot inside chunk.  Since we need to give back
-      leading space in a chunk of at least MINSIZE, if the first
-      calculation places us at a spot with less than MINSIZE leader,
-      we can move to the next aligned spot -- we've allocated enough
-      total room so that this is always possible.
-    */
-
-    brk = (char*) ((PTR_UINT)(((PTR_UINT)(m + alignment - 1)) &
-                           -((signed long) alignment)));
-    if ((CHUNK_SIZE_T)(brk - (char*)(chunk(p))) < MINSIZE)
-      brk += alignment;
-
-    newp = cireg_getfree();
-    newp->chunk = (mchunkptr)brk;
-    leadsize = brk - (char*)(chunk(p));
-    newsize = chunksize(p) - leadsize;
-
-    /* For mmapped chunks, just adjust offset */
-    if (UNLIKELY(chunk_is_mmapped(p))) {
-      newp->hash_next = (chunkinfoptr) (((INTERNAL_SIZE_T) p->hash_next) + leadsize);
-      set_head(newp, newsize|IS_MMAPPED|INUSE);
-      hashtable_remove_mmapped(chunk(p));
-      freecilst_add(p);
-      hashtable_add(newp);
-      guard_set(av->guard_stored, newp, bytes, nb);
-      return chunk(newp);
-    }
-
-    /* Otherwise, give back leader, use the rest */
-    set_head(newp, newsize | PREV_INUSE | INUSE);
-    set_head_size(p, leadsize);
-    set_all_inuse(newp);
-    hashtable_add(newp); /* 20.05.2008 rw */
-    guard_set(av->guard_stored, p, 0, leadsize);
-    fREe(chunk(p));
-    p = newp;
-
-    assert (newsize >= nb &&
-            (((PTR_UINT)(chunk(p))) % alignment) == 0);
-  }
-
-  /* Also give back spare room at the end */
-  if (!chunk_is_mmapped(p)) {
-    size = chunksize(p);
-    if ((CHUNK_SIZE_T)(size) > (CHUNK_SIZE_T)(nb + MINSIZE)) {
-       remainder = cireg_getfree();
-       remainder_size = size - nb;
-       remainder->chunk = chunk_at_offset(chunk(p), nb);
-       set_head(remainder, remainder_size | PREV_INUSE | INUSE);
-       set_head_size(p, nb);
-       hashtable_add(remainder); /* 20.05.2008 rw */
-       guard_set(av->guard_stored, remainder, 0, remainder_size);
-       fREe(chunk(remainder));
-    }
-  }
-
-  check_inuse_chunk(p);
-  guard_set(av->guard_stored, p, bytes, nb);
-  return chunk(p);
-}
-
-/*
-  ------------------------------ calloc ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC Void_t* cALLOc(size_t n_elements, size_t elem_size)
-#else
-DL_STATIC Void_t* cALLOc(n_elements, elem_size) size_t n_elements; size_t elem_size;
-#endif
-{
-  chunkinfoptr p;
-  CHUNK_SIZE_T  clearsize;
-  CHUNK_SIZE_T  nclears;
-  INTERNAL_SIZE_T* d;
-  Void_t* mem;
- 
-  
-  mem = mALLOc(n_elements * elem_size);
-
-  if (mem != 0) {
-    p = hashtable_lookup(mem);
-
-    if (!chunk_is_mmapped(p))
-    {  
-      /*
-        Unroll clear of <= 40 bytes (80 if 8byte sizes)
-        We know that contents have an even number of
-        INTERNAL_SIZE_T-sized words; minimally 4 (2 on amd64).
-      */
-
-      d = (INTERNAL_SIZE_T*)mem;
-      clearsize = chunksize(p);
-      nclears = clearsize / sizeof(INTERNAL_SIZE_T);
-      assert(nclears >= 2);
-
-      if (nclears > 10) {
-        MALLOC_ZERO(d, clearsize);
-      }
-
-      else {
-        *(d+0) = 0;
-        *(d+1) = 0;
-	if (nclears > 2) {
-	  *(d+2) = 0;
-	  *(d+3) = 0;
-	  if (nclears > 4) {
-	    *(d+4) = 0;
-	    *(d+5) = 0;
-	    if (nclears > 6) {
-	      *(d+6) = 0;
-	      *(d+7) = 0;
-	      if (nclears > 8) {
-		*(d+8) = 0;
-		*(d+9) = 0;
-	      }
-            }
-          }
-        }
-      }
-    }
-#if ! MMAP_CLEARS
-    else
-    {
-      d = (INTERNAL_SIZE_T*)mem;
-      clearsize = chunksize(p);
-      MALLOC_ZERO(d, clearsize);
-    }
-#endif
-    /* Set guard again, since we just cleared it
-     */
-    guard_set(get_malloc_state()->guard_stored, p, (n_elements * elem_size), p->size);
-  }
-
-  return mem;
-}
-
-/*
-  ------------------------------ valloc ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC Void_t* vALLOc(size_t bytes)
-#else
-DL_STATIC Void_t* vALLOc(bytes) size_t bytes;
-#endif
-{
-  /* Ensure initialization */
-  mstate av = get_malloc_state();
-  if (!av || av->max_fast == 0) {
-    malloc_consolidate(av);
-    av = get_malloc_state();
-  }
-  return mEMALIGn(av->pagesize, bytes);
-}
-
-/*
-  ------------------------------ pvalloc ------------------------------
-*/
-
-
-#if __STD_C
-DL_STATIC Void_t* pVALLOc(size_t bytes)
-#else
-DL_STATIC Void_t* pVALLOc(bytes) size_t bytes;
-#endif
-{
-  mstate av = get_malloc_state();
-  size_t pagesz;
-
-  /* Ensure initialization */
-  if (!av || av->max_fast == 0) {
-    malloc_consolidate(av);
-    av = get_malloc_state();
-  }
-  pagesz = av->pagesize;
-  return mEMALIGn(pagesz, (bytes + pagesz - 1) & ~(pagesz - 1));
-}
-   
-
-/*
-  ------------------------------ malloc_trim ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC int mTRIm(size_t pad)
-#else
-DL_STATIC int mTRIm(pad) size_t pad;
-#endif
-{
-  mstate av = get_malloc_state();
-  /* Ensure initialization/consolidation */
-  malloc_consolidate(av);
-  av = get_malloc_state();
-#ifndef MORECORE_CANNOT_TRIM
-  if (morecore32bit(av))
-    return sYSTRIm(pad, av);
-  else
-    return 0;
-#else
-  return 0;
-#endif
-}
-
-
-
-/*
-  ------------------------- malloc_usable_size -------------------------
-*/
-
-#if __STD_C
-DL_STATIC size_t mUSABLe(Void_t* mem)
-#else
-DL_STATIC size_t mUSABLe(mem) Void_t* mem;
-#endif
-{
-  chunkinfoptr p;
-  if (mem != 0) {
-    p = hashtable_lookup(mem);
-    if (p && inuse(p)) return chunksize(p);
-  }
-  return 0;
-}
-
-/*
-  ------------------------------ mallinfo ------------------------------
-*/
-
-DL_STATIC struct mallinfo2 mALLINFo2()
-{
-  mstate av = get_malloc_state();
-  static struct mallinfo2 mi;
-  unsigned int i;
-  mbinptr b;
-  chunkinfoptr p;
-  INTERNAL_SIZE_T avail;
-  INTERNAL_SIZE_T fastavail;
-  int nblocks;
-  int nfastblocks;
-
-  /* Ensure initialization */
-  if (!av || av->top == 0) {
-    malloc_consolidate(av);
-    av = get_malloc_state();
-  }
-  check_malloc_state();
-
-  if (!av || av->top == 0) {
-    return mi;
-  }
-  
-  /* Account for top */
-  avail = chunksize(av->top);
-  nblocks = 1;  /* top always exists */
-
-  /* traverse fastbins */
-  nfastblocks = 0;
-  fastavail = 0;
-
-  for (i = 0; i < NFASTBINS; ++i) {
-    for (p = av->fastbins[i]; p != 0; p = p->fd) {
-      ++nfastblocks;
-      fastavail += chunksize(p);
-    }
-  }
-
-  avail += fastavail;
-
-  /* traverse regular bins */
-  for (i = 1; i < NBINS; ++i) {
-    b = bin_at(av, i);
-    for (p = last(b); p != b; p = p->bk) {
-      ++nblocks;
-      avail += chunksize(p);
-    }
-  }
-
-  mi.smblks = nfastblocks;
-  mi.ordblks = nblocks;
-  mi.fordblks = avail;
-  mi.uordblks = av->sbrked_mem - avail;
-  mi.arena = av->sbrked_mem;
-  mi.hblks = av->n_mmaps;
-  mi.hblkhd = av->mmapped_mem;
-  mi.fsmblks = fastavail;
-  mi.keepcost = chunksize(av->top);
-  mi.usmblks = av->max_total_mem;
-  return mi;
-}
-
-/*
-  ------------------------------ malloc_stats ------------------------------
-*/
-
-DL_STATIC void mSTATs()
-{
-  struct mallinfo2 mi = mALLINFo2();
-
-  fprintf(stderr, "hashtable = %10lu MB\n", 
-	  (CHUNK_SIZE_T)(HASHTABLESIZE / (1024*1024)));
-  fprintf(stderr, "max system bytes = %10lu\n",
-	  (CHUNK_SIZE_T)(mi.usmblks));
-  fprintf(stderr, "system bytes     = %10lu  (%10lu sbrked, %10lu mmaped)\n",
-	  (CHUNK_SIZE_T)(mi.arena + mi.hblkhd),
-	  (CHUNK_SIZE_T)(mi.arena),
-	  (CHUNK_SIZE_T)(mi.hblkhd));
-  fprintf(stderr, "in use bytes     = %10lu\n",
-	  (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd));
-}
-
-
-/*
-  ------------------------------ mallopt ------------------------------
-*/
-
-#if __STD_C
-DL_STATIC int mALLOPt(int param_number, int value)
-#else
-DL_STATIC int mALLOPt(param_number, value) int param_number; int value;
-#endif
-{
-  mstate av = get_malloc_state();
-  /* Ensure initialization/consolidation */
-  malloc_consolidate(av);
-  av = get_malloc_state();
-
-  switch(param_number) {
-  case M_MXFAST:
-    if (value >= 0 && value <= MAX_FAST_SIZE) {
-      set_max_fast(av, value);
-      return 1;
-    }
-    else
-      return 0;
-
-  case M_TRIM_THRESHOLD:
-    av->trim_threshold = value;
-    return 1;
-
-  case M_TOP_PAD:
-    av->top_pad = value;
-    return 1;
-
-  case M_MMAP_THRESHOLD:
-    av->mmap_threshold = value;
-    return 1;
-
-  case M_MMAP_MAX:
-    if (value != 0)
-      return 0;
-    av->n_mmaps_max = value;
-    return 1;
-
-  default:
-    return 0;
-  }
-}
-
-
-/*	$OpenBSD: arc4random.c,v 1.19 2008/06/04 00:50:23 djm Exp $	*/
-
-/*
- * Copyright (c) 1996, David Mazieres <dm@uun.org>
- * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Arc4 random number generator for OpenBSD.
- *
- * This code is derived from section 17.1 of Applied Cryptography,
- * second edition, which describes a stream cipher allegedly
- * compatible with RSA Labs "RC4" cipher (the actual description of
- * which is a trade secret).  The same algorithm is used as a stream
- * cipher called "arcfour" in Tatu Ylonen's ssh package.
- *
- * Here the stream cipher has been modified always to include the time
- * when initializing the state.  That makes it impossible to
- * regenerate the same random sequence twice, so this can't be used
- * for encryption, but will generate good random numbers.
- *
- * RC4 is a registered trademark of RSA Laboratories.
- */
-
-/* Moved u_int8_t -> unsigned char (portability)
- * Eliminated unneeded functions, added read from /dev/urandom taken from:
- $MirOS: contrib/code/Snippets/arc4random.c,v 1.3 2008-03-04 22:53:14 tg Exp $
- * Modified by Robert Connolly from OpenBSD lib/libc/crypt/arc4random.c v1.11.
- * This is arc4random(3) using urandom.
- */
-
-#include <fcntl.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <sys/param.h>
-#include <sys/time.h>
-
-struct arc4_stream {
-	unsigned char i;
-	unsigned char j;
-	unsigned char s[256];
-};
-
-static int rs_initialized;
-static struct arc4_stream rs;
-static pid_t arc4_stir_pid;
-static int arc4_count;
-
-static unsigned char arc4_getbyte(void);
-
-static void
-arc4_init(void)
-{
-	int     n;
-
-	for (n = 0; n < 256; n++)
-		rs.s[n] = n;
-	rs.i = 0;
-	rs.j = 0;
-}
-
-static inline void
-arc4_addrandom(unsigned char *dat, int datlen)
-{
-	int     n;
-	unsigned char si;
-
-	rs.i--;
-	for (n = 0; n < 256; n++) {
-		rs.i = (rs.i + 1);
-		si = rs.s[rs.i];
-		rs.j = (rs.j + si + dat[n % datlen]);
-		rs.s[rs.i] = rs.s[rs.j];
-		rs.s[rs.j] = si;
-	}
-	rs.j = rs.i;
-}
-
-#ifdef HAVE_SCHED_H
-#include <sched.h>
-#endif
-
-static void
-arc4_stir(void)
-{
-	int     i;
-        struct {
-                struct timeval tv1;
-                struct timeval tv2;
-                unsigned char rnd[(128 - 2*sizeof(struct timeval)) / sizeof(unsigned char)];
-        } rdat;
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-        ssize_t sz = 0;
-	int    fd;
-#endif
- 
-        gettimeofday(&rdat.tv1, NULL);
-
-
-	if (!rs_initialized) {
-		arc4_init();
-		rs_initialized = 1;
-	}
-
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-
-#ifdef HAVE_SCHED_YIELD
-	/* Yield the processor to introduce some random delay. */
-	(void) sched_yield();
-#endif
-
-	/*
-	 * Pthread problem in multithreaded code on *BSD.
-	 */
-        fd = open("/dev/urandom", O_RDONLY);
-        if (fd != -1) {
-	        sz = (size_t)read(fd, rdat.rnd, sizeof (rdat.rnd));
-		/* 
-		 * gcc complains if we ignore the return value of read(), and
-		 * the llvm/clang analyzer complains if we don't use it...
-		 */
-		if (sz > (-256)) /* always true */
-		  close(fd);
-        }
-	/*
-        if (sz > sizeof (rdat.rnd))
-                sz = 0;
-	*/
- #endif
-
-	arc4_stir_pid = getpid();
-        gettimeofday(&rdat.tv2, NULL);
-
-        arc4_addrandom((void *)&rdat, sizeof(rdat));
-
-	/*
-	 * Discard early keystream, as per recommendations in:
-	 * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
-	 */
-	for (i = 0; i < 256; i++)
-		(void)arc4_getbyte();
-	arc4_count = 1600000;
-}
-
-static unsigned char
-arc4_getbyte(void)
-{
-	unsigned char si, sj;
-
-	rs.i = (rs.i + 1);
-	si = rs.s[rs.i];
-	rs.j = (rs.j + si);
-	sj = rs.s[rs.j];
-	rs.s[rs.i] = sj;
-	rs.s[rs.j] = si;
-	return (rs.s[(si + sj) & 0xff]);
-}
-
-
- /* Changed to return char* */
-static char *
-dnmalloc_arc4random(void)
-{
-	static char val[4];
-	
-	/* We only call this once, hence no need for locking. */
-
-	/* _ARC4_LOCK(); */
-	arc4_count -= 4;
-	if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != getpid())
-		arc4_stir();
-
-	val[0] = (char) arc4_getbyte();
-	val[1] = (char) arc4_getbyte();
-	val[2] = (char) arc4_getbyte();
-	val[3] = (char) arc4_getbyte();
-
-	arc4_stir();
-	/* _ARC4_UNLOCK(); */
-	return val;
-}
-
-#else
-int dnmalloc_pthread_init() { return 0; }
-#endif /* ! USE_SYSTEM_MALLOC */
Index: trunk/src/exepack.c
===================================================================
--- trunk/src/exepack.c	(revision 591)
+++ trunk/src/exepack.c	(revision 1)
@@ -84,5 +84,4 @@
 {
   int file;
-  long result;
 
   unsigned long i    = argc; /* dummy use of argc to fix compiler warning */
@@ -130,5 +129,4 @@
   out_len = (unsigned long) programlen_compressed_0;
   len     = (unsigned long) programlen_0;
-  in_len  = len;
 
   outbuf  = program_0;
@@ -262,15 +260,11 @@
     } 
 
-  result = (long) write(file, inbuf, in_len);
-  if (result < 0 || in_len != (lzo_uint) result)
+  write(file, inbuf, in_len);
+
+#if defined(__linux__)
+
+  if ( 0 != fstat(file, &sbuf))
     {
       return (5);
-    }
-
-#if defined(__linux__)
-
-  if ( 0 != fstat(file, &sbuf))
-    {
-      return (6);
     } 
   
@@ -282,5 +276,5 @@
   if ( 0 != fstat(file, &fbuf))
     {
-      return (7);
+      return (6);
     } 
 
@@ -294,5 +288,5 @@
     {
       close  ( file );
-      return ( 8 );
+      return ( 6 );
     }
   
@@ -318,5 +312,5 @@
       fcntl  (file, F_SETFD, FD_CLOEXEC);
       execve (pname, argv, environ); 
-      return (9);
+      return (8);
     }
 #endif
@@ -331,5 +325,5 @@
       execve (fname, argv, environ);
       unlink (fname);
-      return (10);
+      return (9);
     } 
   else if (i == 0)
Index: trunk/src/exepack_fill.c
===================================================================
--- trunk/src/exepack_fill.c	(revision 591)
+++ trunk/src/exepack_fill.c	(revision 1)
@@ -169,5 +169,5 @@
 {
   FILE * fd;
-  unsigned long   clen;
+  long   clen;
   char * data;
   struct stat sbuf;
@@ -222,6 +222,5 @@
     return (-1);
 
-  if (clen != fread  (data, 1, clen, fd))
-    return (-1);
+  fread  (data, 1, clen, fd);
   fclose (fd);
 
@@ -338,5 +337,5 @@
       return (8);
     }
-  status = replaceData (data, clen, "CONTAINER", (char *) outbuf, out_len);
+  status = replaceData (data, clen, "CONTAINER", outbuf, out_len);
   if (status < 0)
     {
Index: trunk/src/kern_head.c
===================================================================
--- trunk/src/kern_head.c	(revision 1)
+++ trunk/src/kern_head.c	(revision 1)
@@ -0,0 +1,907 @@
+/* 
+ * need to #define SH_USE_KERN
+ *
+ */
+#define SH_SYSCALL_CODE
+
+#include "config.h"
+
+#ifdef HOST_IS_I86LINUX
+#define SH_IDT_TABLE
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined(SH_USE_KERN) 
+
+#undef _
+#define _(string)  string
+#undef N_
+#define N_(string) string
+
+void usage(int flag)
+{
+  printf("\n");
+  printf("Usage: kern_head [-v | --verbose]\n");
+  printf("       kern_head [-h | --help]\n");
+  printf("\n");
+  /*
+   * printf("       You need superuser privileges to use this program,\n");
+   * printf("       because only the superuser can read from /dev/kmem.\n");
+   * printf("\n");
+   */
+  exit(flag);
+}
+
+#if defined(HOST_IS_LINUX)
+
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/utsname.h>
+
+/* number of system calls */
+#define SH_MAXCALLS 512
+
+#include "kern_head.h"
+
+static int verbose = 0;
+
+typedef struct _smap_entry {
+#ifdef SH_SYSCALL_CODE
+  unsigned int  code[2];  /* 8 bytes */
+#endif
+  unsigned long addr;
+  char          name[64];
+} smap_entry;
+
+union {
+  unsigned long addr_sys_call_table;
+  unsigned char str_sys_call_table[sizeof(unsigned long)];
+} sh_sys_call;
+
+#define SYS_CODE_SIZE 1024
+
+static unsigned long addr_system_call;
+static unsigned char system_call_code[SYS_CODE_SIZE];
+
+int read_kcode (unsigned long addr, unsigned char * buf, int len)
+{
+  int fd;
+
+  if (addr == 0UL)
+    {
+      perror("read_kcode: invalid input");
+      return -1;
+    }
+
+  fd = open ("/dev/kmem", O_RDONLY);
+  if (fd < 0)
+    {
+      perror("read_kcode: open");
+      return -1;
+    }
+  if (lseek(fd, addr, SEEK_SET) == (off_t) (-1))
+    {
+      perror("read_kcode: lseek");
+      return -1;
+    }
+  if (read(fd, buf, len) < 0)
+    {
+      perror("read_kcode: read");
+      return -1;
+    }
+  return 0;
+}
+
+int get_dispatch (int * qq)
+{
+  int i;
+
+  if (addr_system_call == 0L || sh_sys_call.addr_sys_call_table == 0L)
+    {
+      fprintf(stderr, "get_dispatch: invalid data\n");
+      return -1;
+    }
+
+  if (0 != read_kcode (addr_system_call, system_call_code, SYS_CODE_SIZE))
+    {
+      fprintf(stderr, "get_dispatch: could not read system_call code\n");
+      return -1;
+    }
+
+  for (i = 0; i < (SYS_CODE_SIZE - 4); ++i)
+    {
+      if (system_call_code[i]   == sh_sys_call.str_sys_call_table[0] &&
+	  system_call_code[i+1] == sh_sys_call.str_sys_call_table[1] &&
+	  system_call_code[i+2] == sh_sys_call.str_sys_call_table[2] &&
+	  system_call_code[i+3] == sh_sys_call.str_sys_call_table[3])
+	{
+	  /*
+	    fprintf(stderr, "INFO: get_dispatch: found sys_call_table in "\
+		    "system_call code at %d\n", i);
+	  */
+	  *qq = i;
+	  return 0;
+	}
+    }
+  fprintf(stderr, 
+	  "get_dispatch: did not find sys_call_table in system_call code\n");
+  fprintf(stderr, 
+	  "** This indicates that either your System.map does not match\n");
+  fprintf(stderr,
+	  "** the currently running kernel, or that your System.map does\n");
+  fprintf(stderr,
+	  "** not provide the required information, and thus use of\n");
+  fprintf(stderr,
+	  "** the --with-kcheck option is not possible\n");
+  return -1;
+}
+
+unsigned long get_symbol_from_systemmap (char * systemmap, 
+                                         char * symbol, char flag)
+{
+  FILE * fp;
+  char buf[512], addr[16], * p;
+  unsigned long retval = 0;
+
+  fp = fopen (systemmap, "r");
+
+  if (!fp)
+    {
+      fprintf(stderr, "error opening <%s>\n", systemmap);
+      perror("get_symbol_from_systemmap: fopen");
+      return -1;
+    }
+  while (fgets(buf, 512, fp) != NULL)
+    {
+      if (buf[9] != flag)
+        continue;
+
+      p = strchr(buf, '\n');
+      if (p != NULL)
+        *p = '\0';
+
+      if (0 != strcmp(&buf[11], symbol))
+        continue;
+
+      addr[0] = '0'; addr[1] = 'x'; addr[2] = '\0';
+      strncat(&addr[2], buf, 8);
+
+      retval = strtoul(addr, NULL, 0);
+      if (retval == ULONG_MAX)
+        {
+          perror("get_symbol_from_systemmap");
+          return -1;
+        }
+    }
+  fclose(fp);
+  return retval;
+}
+
+
+/* returns the number N of entries in syscall table
+ * (0 .. N-1) with valid syscalls
+ */
+int fill_smap(smap_entry * sh_smap, int num)
+{
+  FILE * fp;
+  char buf[512], addr[16], name[128];
+  int  i, j, count = 0, maxcall = 0;
+
+  fp = fopen (SYSTEMMAP, "r");
+
+  if (!fp)
+    {
+      perror("fill_smap: fopen");
+      fprintf(stderr, "fill_smap: error opening <%s>\n", SYSTEMMAP);
+      return -1;
+    }
+
+  /* initialize
+   */
+  sh_sys_call.addr_sys_call_table = 0L;
+
+  while (fgets(buf, 512, fp) != NULL)
+    {
+      
+      if ( ( (buf[9] == 'D') || (buf[9] == 'd') || 
+	     (buf[9] == 'R') || (buf[9] == 'r')) && 
+	   0 == strncmp("sys_call_table", &buf[11], 14))
+	{
+	  printf("/* found sys_call_table */\n");
+	  /* --- copy symbol address ---
+	   */
+	  addr[0] = '0'; addr[1] = 'x'; addr[2] = '\0';
+	  strncat(&addr[2], buf, 8);
+	  addr[10] = '\0';
+	  sh_sys_call.addr_sys_call_table = strtoul(addr, NULL, 0);
+	  if (sh_sys_call.addr_sys_call_table == ULONG_MAX)
+	    {
+	      perror("fill_smap");
+	      return -1;
+	    }
+	  else
+	    {
+	      printf("#define SH_SYS_CALL_TABLE %s\n", addr);
+	    }
+	}
+
+      if (buf[9] != 'T')
+	continue;
+
+      if (0 == strncmp("system_call", &buf[11], 11))
+	{
+	  printf("/* found system_call */\n");
+	  /* --- copy symbol address ---
+	   */
+	  addr[0] = '0'; addr[1] = 'x'; addr[2] = '\0';
+	  strncat(&addr[2], buf, 8);
+	  addr[10] = '\0';
+	  addr_system_call = strtoul(addr, NULL, 0);
+	  if (addr_system_call == ULONG_MAX)
+	    {
+	      perror("fill_smap");
+	      return -1;
+	    }
+	}
+
+
+      if ( (buf[11]!='s' || buf[12]!='y' || buf[13]!='s' || buf[14]!='_') &&
+	   (buf[11]!='o' || buf[12]!='l' || buf[13]!='d' || buf[14]!='_'))
+	continue;
+
+      for (i = 0; i < num; ++i)
+	{
+	  for (j = 0; j < 128; ++j)
+	    {
+	      if (buf[11+j] == '\n' || buf[11+j] == '\0')
+		{
+		  name[j] = '\0';
+		  break;
+		}
+	      name[j] = buf[11+j];
+	    }
+
+
+	  if (0 == strcmp(name, sh_smap[i].name)) 
+	    {
+	      
+	      /* --- copy symbol address ---
+	       */
+	      addr[0] = '0'; addr[1] = 'x'; addr[2] = '\0';
+	      strncat(&addr[2], buf, 8);
+	      addr[10] = '\0';
+	      sh_smap[i].addr = strtoul(addr, NULL, 0);
+	      if (sh_smap[i].addr == ULONG_MAX)
+		{
+		  perror("fill_smap");
+		  return -1;
+		}
+	      ++count;
+	      if (i > maxcall) maxcall = i;
+	      /* printf("maxcall = %d\n", maxcall); */
+	      /* break; */
+      	    }
+	}
+    }
+  fclose(fp);
+  if ((count > 0) && (maxcall > 0))
+    return maxcall+1;
+  else
+    return count;
+}
+
+
+struct inode_operations {
+  int (*create) (int *,int *,int);
+  int * (*lookup) (int *,int *);
+  int (*link) (int *,int *,int *);
+  int (*unlink) (int *,int *);
+  int (*symlink) (int *,int *,const char *);
+  int (*mkdir) (int *,int *,int);
+  int (*rmdir) (int *,int *);
+  int (*mknod) (int *,int *,int,int);
+  int (*rename) (int *, int *,
+                 int *, int *);
+  int (*readlink) (int *, char *,int);
+  int (*follow_link) (int *, int *);
+  void (*truncate) (int *);
+  int (*permission) (int *, int);
+  int (*revalidate) (int *);
+  /*
+    int (*setattr) (int *, int *);
+    int (*getattr) (int *, int *);
+    int (*setxattr) (int *, const char *, void *, size_t, int);
+    ssize_t (*getxattr) (int *, const char *, void *, size_t);
+    ssize_t (*listxattr) (int *, char *, size_t);
+    int (*removexattr) (int *, const char *);
+  */
+};
+
+struct file_operations {
+  int (*create) (int *,int *,int);
+};
+
+struct proc_dir_entry {
+  unsigned short low_ino;
+  unsigned short namelen;
+  const char * name;
+  mode_t mode;
+  nlink_t nlink;
+  uid_t uid;
+  gid_t gid;
+  unsigned long size; 
+  struct inode_operations * proc_iops;
+  struct file_operations * proc_fops;
+  /*
+  get_info_t *get_info;
+  struct module *owner;
+  struct proc_dir_entry *next, *parent, *subdir;
+  void *data;
+  read_proc_t *read_proc;
+  write_proc_t *write_proc;
+  atomic_t count;         
+  int deleted;  
+  */          
+};
+
+
+
+int main(int argc, char * argv[])
+{
+  int i, count, maxcall, qq;
+  int which = 4;
+  smap_entry sh_smap[SH_MAXCALLS];
+  struct utsname utbuf;
+  char *p = NULL;
+
+  unsigned long proc_root;
+  unsigned long proc_root_iops;
+  unsigned long proc_root_lookup;
+
+  unsigned long addr_ni_syscall = 0;
+
+  if (argc > 1)
+    {
+      if (strcmp(argv[1], "-h") == 0 ||  strcmp(argv[1], "--help") == 0)
+	usage(EXIT_SUCCESS);
+      else if (strcmp(argv[1], "-v") == 0 ||
+	       strcmp(argv[1], "--verbose") == 0)
+	verbose = 1;
+    }
+
+  if (0 != uname(&utbuf))
+    {
+      perror("kern_head: uname");
+      exit (EXIT_FAILURE);
+    }
+
+  if (strncmp(utbuf.release, SH_KERNEL_VERSION, 3) != 0)
+    {
+      fprintf(stderr, "kern_head: current kernel version %s does not match\n",
+	      utbuf.release);
+      fprintf(stderr, "kern_head: %s from config.h\n", SH_KERNEL_VERSION);
+      fprintf(stderr, "kern_head: continuing with %s\n", SH_KERNEL_VERSION);
+
+      p = SH_KERNEL_VERSION;
+    } else {
+      p = utbuf.release;
+    }
+
+  if      (strncmp(p, "2.2", 3) == 0)
+    which = 2;
+  else if (strncmp(p, "2.4", 3) == 0)
+    which = 4;
+  else if (strncmp(p, "2.6", 3) == 0)
+    which = 6;
+  else
+    {
+      fprintf(stderr, "kern_head: kernel %s not supported\n", p);
+      exit (EXIT_FAILURE);
+    }
+
+  
+  if (utbuf.machine[0] != 'i' || utbuf.machine[2] != '8' || 
+      utbuf.machine[3] != '6')
+    {
+      fprintf(stderr, "kern_head: machine %s not supported\n", utbuf.machine);
+      exit (EXIT_FAILURE);
+    }
+
+  if (0 != getuid())
+    {
+      fprintf(stderr, "\n");
+      
+      fprintf(stderr, "NOTE:  kern_head: must run as 'root' (need to read from /dev/kmem)\n");
+      fprintf(stderr, "       If you get this message, then proceed as follows:\n");
+      fprintf(stderr, "       $ su\n");
+      fprintf(stderr, "       $ ./kern_head > sh_ks.h\n");
+      fprintf(stderr, "       $ exit\n");
+      fprintf(stderr, "       $ make\n\n");
+      exit (EXIT_FAILURE);
+    }
+      
+  printf("#ifndef SH_KERN_CALLS_H\n");
+  printf("#define SH_KERN_CALLS_H\n\n");
+
+  printf("\n/* Kernel %s, machine %s -- use table %s */\n\n", 
+	 p, utbuf.machine,
+	 (which == 2) ? "callz_2p2" : "callz_2p4");
+      
+
+  /* initiate the system call table 
+   */
+  for (i = 0; i < SH_MAXCALLS; ++i)
+    {
+      if (which == 2)
+	{
+	  if (callz_2p2[i] == NULL)
+	    break;
+	  strcpy(sh_smap[i].name, callz_2p2[i]);
+	}
+      else
+	{
+	  if (callz_2p4[i] == NULL)
+	    break;
+	  strcpy(sh_smap[i].name, callz_2p4[i]);
+	}
+      sh_smap[i].addr    = 0UL;
+    }
+
+  if (which == 6) /* fix syscall map for 2.6 */
+    {
+      strcpy(sh_smap[0].name,   "sys_restart_syscall");
+      strcpy(sh_smap[180].name, "sys_pread64");
+      strcpy(sh_smap[181].name, "sys_pwrite64");
+    }
+  count = i;
+
+  /* get the actual number of the highest syscalls and use no more.
+   * get sys_call_table and system_call
+   */
+  maxcall = fill_smap(sh_smap, count);
+  if ( maxcall < 0)
+    {
+      printf("#endif\n");
+      fprintf(stderr, "kern_head: fill_smap failed\n");
+      exit (EXIT_FAILURE);
+    }
+  if (addr_system_call == 0L) 
+    {
+      printf("#endif\n");
+      fprintf(stderr, 
+	      "kern_head: address of system_call not found in System.map\n");
+      fprintf(stderr, 
+	      "** This indicates that your System.map does not provide\n");
+      fprintf(stderr, 
+	      "** the required information, and thus use of the\n");
+      fprintf(stderr, 
+	      "** --with-kcheck option is not possible\n");
+      exit (EXIT_FAILURE);
+    }
+
+  for (i = 0; i < maxcall; ++i)
+    {
+      if (0 == strcmp(sh_smap[i].name, "sys_ni_syscall"))
+        {
+          addr_ni_syscall = sh_smap[i].addr;
+          break;
+        }
+    }
+  if (which < 6)
+    {
+      maxcall = (maxcall > 256) ? 256 : maxcall;
+    }
+
+  for (i = 0; i < maxcall; ++i)
+    {
+      if (sh_smap[i].addr == 0UL)
+        {
+          if (verbose > 0)
+            fprintf(stderr, "** unknown syscall **: [%s]\n", sh_smap[i].name);
+          strcpy(sh_smap[i].name, "sys_ni_syscall");
+          sh_smap[i].addr = addr_ni_syscall;
+        }
+    }
+
+
+  /* get the location of the syscall table address within system_call
+   */
+  if ( get_dispatch (&qq) < 0)
+    {
+      printf("#endif\n");
+      fprintf(stderr, "kern_head: get_dispatch failed\n");
+      exit (EXIT_FAILURE);
+    }
+
+  if (qq <= 252)
+    printf("#define SYS_CALL_LOC  %d\n", qq);
+  else
+    {
+      printf("#endif\n");
+      fprintf(stderr, "kern_head: SYS_CALL_LOC (%d) too large\n", qq);
+      exit(EXIT_FAILURE);
+    }
+  printf("#define SH_SYS_CALL_ADDR %#lx\n\n", addr_system_call);
+
+  printf("static unsigned char system_call_code[256] = { 0 };\n");
+
+  printf("#define SH_MAXCALLS %d\n\n", maxcall);
+
+#ifdef SH_IDT_TABLE
+  printf("static unsigned char idt_table[2048] = { 0 };\n");
+#endif
+
+  printf("typedef struct _sh_syscall_t {\n");
+#ifdef SH_SYSCALL_CODE
+  printf("  unsigned int  code[2];  /* 8 bytes */\n");
+#endif
+  printf("  unsigned long addr;\n");
+  printf("  char *        name;\n");
+  printf("} sh_syscall_t;\n\n");
+
+  printf("static sh_syscall_t sh_syscalls[] = {\n");
+
+  for (i = 0; i < maxcall; ++i) 
+    {
+#ifdef SH_SYSCALL_CODE
+      printf(" /* %03d */   { { 0, 0 }, 0, N_(%c%s%c) },\n", 
+	     i, '"', sh_smap[i].name, '"');
+#else
+      printf(" /* %03d */   { 0, N_(%c%s%c) },\n", 
+	     i, '"', sh_smap[i].name, '"');
+#endif
+    }
+#ifdef SH_SYSCALL_CODE
+  printf(" /* eof */   { { 0x00000000, 0x00000000 }, 0x00000000,  NULL }\n");
+#else
+  printf(" /* eof */   { 0x00000000,  NULL }\n");
+#endif
+  printf("};\n\n");
+
+
+  /* get proc addresses
+   */
+  proc_root =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                          "proc_root", 'D');
+  if (proc_root == 0) 
+    {
+      proc_root =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                              "proc_root", 'd');
+    }
+  if (proc_root == 0) 
+    {
+      proc_root =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                              "proc_root", 'R');
+    }
+  if (proc_root != 0) {
+    printf("#define PROC_ROOT_LOC %#lx\n\n", proc_root);
+  }
+
+  proc_root_lookup =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                                 "proc_root_lookup", 't');
+  if (proc_root_lookup == 0) 
+    {
+      proc_root_lookup =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                                     "proc_root_lookup", 'T');
+    }
+  if (proc_root_lookup != 0) {
+    printf("#define PROC_ROOT_LOOKUP_LOC %#lx\n\n", proc_root_lookup);
+  }
+
+  proc_root_iops =  get_symbol_from_systemmap (SYSTEMMAP, 
+                                               "proc_root_inode_operations", 
+                                               'd');
+  if (proc_root_iops == 0) 
+    {
+      proc_root_iops = get_symbol_from_systemmap (SYSTEMMAP, 
+                                                  "proc_root_inode_operations",
+                                                  'D');
+    }
+  if (proc_root_iops == 0) 
+    {
+      proc_root_iops = get_symbol_from_systemmap (SYSTEMMAP, 
+                                                  "proc_root_inode_operations",
+                                                  'R');
+    }
+  if (proc_root_iops != 0) {
+    printf("#define PROC_ROOT_IOPS_LOC %#lx\n\n", proc_root_iops);
+  }
+
+  printf("#endif\n");
+
+  exit (EXIT_SUCCESS);
+}
+
+/* if defined(HOST_IS_LINUX) */
+#endif
+
+/************************************************************
+ *
+ *
+ *  FreeBSD Implementation
+ *
+ ************************************************************/
+
+#if defined(HOST_IS_FREEBSD) || defined(__OpenBSD__)
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <err.h>
+#include <kvm.h>
+#include <fcntl.h>
+#include <nlist.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+
+#ifdef __FreeBSD__
+#include <sys/sysent.h>
+#endif
+
+#include <sys/syscall.h>
+
+#ifndef  SYS_MAXSYSCALL
+#define  SYS_MAXSYSCALL	512
+#endif
+
+/* number of system calls */
+#define SH_MAXCALLS 512
+#include "kern_head.h"
+static int verbose = 0;
+
+#ifdef __OpenBSD__
+struct proc;
+struct sysent {
+	short sy_narg;
+	short sy_argsize;
+	int   (*sy_call)(struct proc *, void *, register_t *);
+};
+#endif
+
+typedef struct _smap_entry {
+  unsigned int  code[2];  /* 8 bytes */
+  unsigned long addr;
+  char          name[64];
+} smap_entry;
+
+union {
+  unsigned long addr_sys_call_table;
+  unsigned char str_sys_call_table[sizeof(unsigned long)];
+} sh_sys_call;
+
+struct nlist sys_list[SYS_MAXSYSCALL+1];
+
+struct  nlist   list[2];
+
+
+int main(int argc, char * argv[])
+{
+  int i, count, which;
+  smap_entry sh_smap[SYS_MAXSYSCALL];
+  struct utsname utbuf;
+  char errbuf[_POSIX2_LINE_MAX];
+
+  struct sysent  sy;
+  unsigned long offset = 0L;
+  kvm_t *kd;
+
+  list[0].n_name = "_sysent";
+  list[1].n_name = NULL;
+
+  if (argc > 1)
+    {
+      if (strcmp(argv[1], "-h") == 0 ||  strcmp(argv[1], "--help") == 0)
+	usage(EXIT_SUCCESS);
+      else if (strcmp(argv[1], "-v") == 0 ||
+	       strcmp(argv[1], "--verbose") == 0)
+	verbose = 1;
+    }
+
+  if (0 != uname(&utbuf))
+    {
+      perror("kern_head: uname");
+      exit (EXIT_FAILURE);
+    }
+
+  if      (utbuf.release[0] == '4')
+    which = 4;
+  else if (utbuf.release[0] == '5')
+    which = 5;
+  else
+    {
+      fprintf(stderr, "kern_head: kernel %s not supported\n", utbuf.release);
+      exit (EXIT_FAILURE);
+    }
+
+  if (utbuf.machine[0] != 'i' || utbuf.machine[2] != '8' || 
+      utbuf.machine[3] != '6')
+    {
+      fprintf(stderr, "kern_head: machine %s not supported\n", utbuf.machine);
+      exit (EXIT_FAILURE);
+    }
+
+  if (0 != getuid())
+    {
+      fprintf(stderr, "\n");
+      fprintf(stderr, "NOTE:  kern_head: must run as 'root' ");
+      fprintf(stderr, "(need to read from /dev/kmem)\n");
+      fprintf(stderr, "       If you get this message, then proceed ");
+      fprintf(stderr, "as follows:\n");
+      fprintf(stderr, "       $ su\n");
+      fprintf(stderr, "       $ ./kern_head > sh_ks.h\n");
+      fprintf(stderr, "       $ exit\n");
+      fprintf(stderr, "       $ make\n\n");
+      exit (EXIT_FAILURE);
+    }
+
+  kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
+  if (!kd)
+    {
+      fprintf(stderr, "check_sysent: kvm_openfiles: %s\n", errbuf);
+      exit(EXIT_FAILURE);
+    }
+
+  i = kvm_nlist(kd, list);
+  if (i == -1)
+    {
+      fprintf(stderr, "check_sysent: kvm_nlist: %s\n", kvm_geterr(kd));
+      exit(EXIT_FAILURE);
+    }
+
+  if (which == 4)
+    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n", 
+        	 utbuf.release, utbuf.machine, "callz_fbsd");
+  if (which == 5)
+    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
+                 utbuf.release, utbuf.machine, "callz_fbsd5");
+      
+  i = 0;
+  if (which == 4) {
+    while ((callz_fbsd[i] != NULL) && (i < SYS_MAXSYSCALL))
+      {
+	sys_list[i].n_name = callz_fbsd[i];
+	/* fprintf(stderr, "sys_list[%d] = %s\n", i, sys_list[i].n_name); */
+	++i;
+      }
+    if ((utbuf.release[1] == '.') && (utbuf.release[2] == '1') && 
+	(utbuf.release[3] == '0'))
+      {
+	sys_list[336].n_name = callz_fbsd[290]; /* sendfile -> nosys */
+      }
+  } else {
+    while ((callz_fbsd5[i] != NULL) && (i < SYS_MAXSYSCALL))
+      {
+	sys_list[i].n_name = callz_fbsd5[i];
+	/* fprintf(stderr, "sys_list[%d] = %s\n", i, sys_list[i].n_name); */
+	++i;
+      }
+  }
+  count = i;
+  sys_list[i].n_name = NULL;
+   
+  i = kvm_nlist(kd, sys_list);
+  if (i == -1)
+    {
+      fprintf(stderr, "check_sysent: kvm_nlist: %s\n", kvm_geterr(kd));
+      /* exit(EXIT_FAILURE); */
+    }
+  else if (i != 0 && verbose != 0)
+     {
+	fprintf(stderr, "check_sysent: kvm_nlist: %d out of %d invalid.\n",
+		i, count);
+	fprintf(stderr, "              Probably callz_fbsd in kern_head.c\n");
+	fprintf(stderr, "              is not for your kernel version.\n");
+	fprintf(stderr, "              (No reason to worry, kcheck will "\
+                                       "work anyway)\n\n");
+     }
+
+  for (i = 0; i < count /* SYS_MAXSYSCALL */; i++) 
+    {
+       if (NULL == sys_list[i].n_name)
+	 break;
+       if (!sys_list[i].n_value && 0 != strcmp(sys_list[i].n_name, "_nosys")
+	   && verbose != 0)
+	{
+	  fprintf(stderr,"check_sysent: not found: slot %03d [%s]\n", 
+		  i, sys_list[i].n_name);
+	  /* exit(EXIT_FAILURE); */
+	}
+      offset = list[0].n_value + (i*sizeof(struct sysent));
+      if (kvm_read(kd, offset, &sy, sizeof(struct sysent)) < 0)
+	{
+	  fprintf(stderr,"check_sysent: kvm_read: %s\n", kvm_geterr(kd));
+	  exit(EXIT_FAILURE);
+	}
+
+      if (verbose > 0)
+	fprintf(stderr, "(kvm_nlist) %#lx   %#lx (sysent[%03d])  %03d [%s]\n",
+		(unsigned long) sys_list[i].n_value,
+		(unsigned long) sy.sy_call,
+		i, i, sys_list[i].n_name);
+
+      if((unsigned long)sy.sy_call != sys_list[i].n_value && 
+	 sys_list[i].n_value != 0 &&
+	 0 != strcmp(sys_list[i].n_name, "_nosys") &&
+	 (unsigned long)sy.sy_call != sys_list[290].n_value)  
+	{
+          fprintf(stderr,
+                  "WARNING: (kvm_nlist) %#lx != %#lx (sysent[%03d])  %03d [%s]\n",
+		  (unsigned long) sys_list[i].n_value,
+		  (unsigned long) sy.sy_call,
+		  i, i, sys_list[i].n_name);
+	}
+      sh_smap[i].addr = (unsigned long) sy.sy_call;
+      strncpy(sh_smap[i].name, sys_list[i].n_name, 64);
+      if(kvm_read(kd, (unsigned int) sy.sy_call, &(sh_smap[i].code[0]), 
+		  2 * sizeof(unsigned int)) < 0)
+	{
+	  fprintf(stderr,"check_sysent: kvm_read: %s\n", kvm_geterr(kd));
+	  exit(EXIT_FAILURE);
+	}
+    }
+
+  if(kvm_close(kd) < 0) 
+    {
+      fprintf(stderr,"check_sysent: kvm_nlist: %s\n", kvm_geterr(kd));
+      exit(EXIT_FAILURE);
+    }
+ 
+  printf("#ifndef SH_KERN_CALLS_H\n");
+  printf("#define SH_KERN_CALLS_H\n\n");
+
+  printf("#define SH_MAXCALLS %d\n\n", count);
+
+  printf("typedef struct _sh_syscall_t {\n");
+  printf("  unsigned int  code[2];  /* 8 bytes */\n");
+  printf("  unsigned long addr;\n");
+  printf("  char *        name;\n");
+  printf("} sh_syscall_t;\n\n");
+
+  printf("static sh_syscall_t sh_syscalls[] = {\n");
+  for (i = 0; i < count; ++i) {
+    printf(" /* %03d */ {{ 0x%-8.8x, 0x%-8.8x }, 0x%-8.8lx, N_(%c%s%c) },\n", 
+	   i, sh_smap[i].code[0], sh_smap[i].code[1], 
+	   sh_smap[i].addr, '"', sh_smap[i].name, '"');
+  }
+  printf(" /* eof */   { { 0x00000000, 0x00000000 }, 0x00000000,  NULL }\n");
+  printf("};\n\n");
+  printf("#endif\n");
+  return 0;
+}
+/* if defined(HOST_IS_FREEBSD) */
+#endif
+
+/* #if defined(SH_USE_KERN) */
+#else
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main()
+{
+  printf("#ifndef SH_KERN_CALLS_H\n");
+  printf("#define SH_KERN_CALLS_H\n\n");
+
+  printf("/* Dummy header. */\n\n");
+
+  printf("typedef struct _sh_syscall_t {\n");
+  printf("  unsigned long addr;\n");
+  printf("  char *        name;\n");
+  printf("} sh_syscall_t;\n\n");
+
+  printf("#endif\n");
+
+  return (EXIT_SUCCESS);
+}
+
+/* #ifdef SH_USE_KERN */
+#endif
Index: trunk/src/make-tests.sh
===================================================================
--- trunk/src/make-tests.sh	(revision 591)
+++ 	(revision )
@@ -1,75 +1,0 @@
-#!/bin/sh
-
-# Auto generate single AllTests file for CuTest.
-# Searches through all *.c files in the current directory.
-# Prints to stdout.
-# Author: Asim Jalis
-# Date: 01/08/2003
-
-# Modified to return non-zero if any test has failed
-# Rainer Wichmann, 29. Jan 2006
-# ...and to print to stderr if any test has failed
-# Rainer Wichmann, 31. Jan 2006
-
-if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi
-
-echo '
-
-/* This is auto-generated code. Edit at your own peril. */
-
-#include "config.h"
-#include <stdio.h>
-#include "CuTest.h"
-'
-
-cat $FILES | grep '^void Test' | 
-    sed -e 's/(.*$//' \
-        -e 's/$/(CuTest*);/' \
-        -e 's/^/extern /'
-
-echo \
-'
-
-int RunAllTests(void) 
-{
-    CuString *output = CuStringNew();
-    CuSuite* suite = CuSuiteNew();
-
-'
-cat $FILES | grep '^void Test' | 
-    sed -e 's/^void //' \
-        -e 's/(.*$//' \
-        -e 's/^/    SUITE_ADD_TEST(suite, /' \
-        -e 's/$/);/'
-
-echo \
-'
-    CuSuiteRun(suite);
-    CuSuiteSummary(suite, output);
-    CuSuiteDetails(suite, output);
-    if (suite->failCount > 0)
-      fprintf(stderr, "%s%c", output->buffer, 0x0A);
-    else
-      fprintf(stdout, "%s%c", output->buffer, 0x0A);
-    return suite->failCount;
-}
-
-int main(void)
-{
-#if !defined(USE_SYSTEM_MALLOC)
-    typedef void assert_handler_tp(const char * error, const char *file, int line);
-    extern assert_handler_tp *dnmalloc_set_handler(assert_handler_tp *new);
-    extern void safe_fatal  (const char * details, const char *f, int l);
-#endif
-#if !defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK)
-    extern int dnmalloc_pthread_init(void);
-    dnmalloc_pthread_init();
-#endif
-#if !defined(USE_SYSTEM_MALLOC)
-    (void) dnmalloc_set_handler(safe_fatal);
-#endif
-    int retval;
-    retval = RunAllTests();
-    return (retval == 0) ? 0 : 1;
-}
-'
Index: trunk/src/minilzo.c
===================================================================
--- trunk/src/minilzo.c	(revision 591)
+++ trunk/src/minilzo.c	(revision 1)
@@ -82,8 +82,12 @@
 #else
 #  include <sys/types.h>
-#  if defined(__STDC__)
+#  if defined(STDC_HEADERS)
 #    include <string.h>
 #    include <stdlib.h>
+#  endif
+#  if defined(HAVE_STDDEF_H)
 #    include <stddef.h>
+#  endif
+#  if defined(HAVE_MEMORY_H)
 #    include <memory.h>
 #  endif
@@ -2395,6 +2399,6 @@
 #  endif
 #  if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 2)
-#    define NEED_IP(x, y) \
-    if ( ((y > 0) && (x > (LZO_UINT_MAX - y))) || ((lzo_uint)(ip_end - ip) < (lzo_uint)((x)+(y))) )  goto input_overrun
+#    define NEED_IP(x) \
+	    if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x))  goto input_overrun
 #  endif
 #endif
@@ -2406,6 +2410,6 @@
 #  if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 2)
 #    undef TEST_OP
-#    define NEED_OP(x,y) \
-    if (  ((y > 0) && (x > (LZO_UINT_MAX - y))) || ((lzo_uint)(op_end - op) < (lzo_uint)((x)+(y))) )  goto output_overrun
+#    define NEED_OP(x) \
+	    if ((lzo_uint)(op_end - op) < (lzo_uint)(x))  goto output_overrun
 #  endif
 #endif
@@ -2435,12 +2439,10 @@
 #  define HAVE_NEED_IP
 #else
-    /* #  define NEED_IP(x)            ((void) 0) */
-#error "no need_ip"
+#  define NEED_IP(x)            ((void) 0)
 #endif
 #if defined(NEED_OP)
 #  define HAVE_NEED_OP
 #else
-    /* #  define NEED_OP(x)            ((void) 0) */
-#error "no need_op"
+#  define NEED_OP(x)            ((void) 0)
 #endif
 
@@ -2511,5 +2513,5 @@
 	if (t < 4)
 	    goto match_next;
-	assert(t > 0); NEED_OP(t, 0); NEED_IP(t, 1);
+	assert(t > 0); NEED_OP(t); NEED_IP(t+1);
 	do *op++ = *ip++; while (--t > 0);
 	goto first_literal_run;
@@ -2523,14 +2525,14 @@
 	if (t == 0)
 	{
-	  NEED_IP(1, 0);
+	    NEED_IP(1);
 	    while (*ip == 0)
 	    {
 		t += 255;
 		ip++;
-		NEED_IP(1, 0);
+		NEED_IP(1);
 	    }
 	    t += 15 + *ip++;
 	}
-	assert(t > 0); NEED_OP(t,3); NEED_IP(t,4);
+	assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
 #if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
 #if !defined(LZO_UNALIGNED_OK_4)
@@ -2589,5 +2591,5 @@
 	m_pos -= *ip++ << 2;
 #endif
-	TEST_LOOKBEHIND(m_pos,out); NEED_OP(3,0);
+	TEST_LOOKBEHIND(m_pos,out); NEED_OP(3);
 	*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
 #endif
@@ -2646,5 +2648,5 @@
 		t = (t >> 5) - 1;
 #endif
-		TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t,(3-1));
+		TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
 		goto copy_match;
 #endif
@@ -2655,10 +2657,10 @@
 		if (t == 0)
 		{
-		  NEED_IP(1,0);
+		    NEED_IP(1);
 		    while (*ip == 0)
 		    {
 			t += 255;
 			ip++;
-			NEED_IP(1,0);
+			NEED_IP(1);
 		    }
 		    t += 31 + *ip++;
@@ -2699,10 +2701,10 @@
 		if (t == 0)
 		{
-		  NEED_IP(1,0);
+		    NEED_IP(1);
 		    while (*ip == 0)
 		    {
 			t += 255;
 			ip++;
-			NEED_IP(1,0);
+			NEED_IP(1);
 		    }
 		    t += 7 + *ip++;
@@ -2747,5 +2749,5 @@
 		m_off = 1 + (t >> 2) + (*ip++ << 2);
 #endif
-		NEED_OP(2,0);
+		NEED_OP(2);
 		t = 2; COPY_DICT(t,m_off)
 #else
@@ -2759,5 +2761,5 @@
 		m_pos -= *ip++ << 2;
 #endif
-		TEST_LOOKBEHIND(m_pos,out); NEED_OP(2,0);
+		TEST_LOOKBEHIND(m_pos,out); NEED_OP(2);
 		*op++ = *m_pos++; *op++ = *m_pos;
 #endif
@@ -2767,10 +2769,10 @@
 #if defined(COPY_DICT)
 
-	    NEED_OP(t,(3-1));
+	    NEED_OP(t+3-1);
 	    t += 3-1; COPY_DICT(t,m_off)
 
 #else
 
-	    TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t,(3-1));
+	    TEST_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
 #if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
 #if !defined(LZO_UNALIGNED_OK_4)
@@ -2810,5 +2812,5 @@
 
 match_next:
-	    assert(t > 0); NEED_OP(t,0); NEED_IP(t,1);
+	    assert(t > 0); NEED_OP(t); NEED_IP(t+1);
 	    do *op++ = *ip++; while (--t > 0);
 	    t = *ip++;
Index: trunk/src/rijndael-alg-fst.c
===================================================================
--- trunk/src/rijndael-alg-fst.c	(revision 591)
+++ trunk/src/rijndael-alg-fst.c	(revision 1)
@@ -1,1235 +1,280 @@
-/*	$NetBSD: rijndael-alg-fst.c,v 1.7 2005/12/11 12:20:52 christos Exp $	*/
-/*	$KAME: rijndael-alg-fst.c,v 1.10 2003/07/15 10:47:16 itojun Exp $	*/
+/*
+ * rijndael-alg-fst.c   v2.3   April '2000
+ *
+ * Optimised ANSI C code
+ *
+ * authors: v1.0: Antoon Bosselaers
+ *          v2.0: Vincent Rijmen
+ *          v2.3: Paulo Barreto
+ *
+ * This code is placed in the public domain.
+ */
+
+#include "config_xor.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef SH_ENCRYPT
+
+#include "rijndael-alg-fst.h"
+
+#include "rijndael-boxes-fst.h"
+
+int rijndaelKeySched(word8 k[MAXKC][4], word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
+	/* Calculate the necessary round keys
+	 * The number of calculations depends on keyBits and blockBits
+	 */ 
+	int j, r, t, rconpointer = 0;
+	word8 tk[MAXKC][4];
+	int KC = ROUNDS - 6;
+
+	for (j = KC-1; j >= 0; j--) {
+		*((word32*)tk[j]) = *((word32*)k[j]);
+	}
+	r = 0;
+	t = 0;
+	/* copy values into round key array */
+	for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
+		for (; (j < KC) && (t < 4); j++, t++) {
+			*((word32*)W[r][t]) = *((word32*)tk[j]);
+		}
+		if (t == 4) {
+			r++;
+			t = 0;
+		}
+	}
+		
+	while (r < ROUNDS + 1) { /* while not enough round key material calculated */
+		/* calculate new values */
+		tk[0][0] ^= S[tk[KC-1][1]];
+		tk[0][1] ^= S[tk[KC-1][2]];
+		tk[0][2] ^= S[tk[KC-1][3]];
+		tk[0][3] ^= S[tk[KC-1][0]];
+		tk[0][0] ^= rcon[rconpointer++];
+
+		if (KC != 8) {
+			for (j = 1; j < KC; j++) {
+				*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
+			}
+		} else {
+			for (j = 1; j < KC/2; j++) {
+				*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
+			}
+			tk[KC/2][0] ^= S[tk[KC/2 - 1][0]];
+			tk[KC/2][1] ^= S[tk[KC/2 - 1][1]];
+			tk[KC/2][2] ^= S[tk[KC/2 - 1][2]];
+			tk[KC/2][3] ^= S[tk[KC/2 - 1][3]];
+			for (j = KC/2 + 1; j < KC; j++) {
+				*((word32*)tk[j]) ^= *((word32*)tk[j-1]);
+			}
+		}
+		/* copy values into round key array */
+		for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
+			for (; (j < KC) && (t < 4); j++, t++) {
+				*((word32*)W[r][t]) = *((word32*)tk[j]);
+			}
+			if (t == 4) {
+				r++;
+				t = 0;
+			}
+		}
+	}		
+	return 0;
+}
+
+int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
+	int r;
+	word8 *w;
+
+	for (r = 1; r < ROUNDS; r++) {
+		w = W[r][0];
+		*((word32*)w) =
+			  *((word32*)U1[w[0]])
+			^ *((word32*)U2[w[1]])
+			^ *((word32*)U3[w[2]])
+			^ *((word32*)U4[w[3]]);
+
+		w = W[r][1];
+		*((word32*)w) =
+			  *((word32*)U1[w[0]])
+			^ *((word32*)U2[w[1]])
+			^ *((word32*)U3[w[2]])
+			^ *((word32*)U4[w[3]]);
+
+		w = W[r][2];
+		*((word32*)w) =
+			  *((word32*)U1[w[0]])
+			^ *((word32*)U2[w[1]])
+			^ *((word32*)U3[w[2]])
+			^ *((word32*)U4[w[3]]);
+
+		w = W[r][3];
+		*((word32*)w) =
+			  *((word32*)U1[w[0]])
+			^ *((word32*)U2[w[1]])
+			^ *((word32*)U3[w[2]])
+			^ *((word32*)U4[w[3]]);
+	}
+	return 0;
+}	
+
 /**
- * rijndael-alg-fst.c
- *
- * @version 3.0 (December 2000)
- *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
- *
- * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto@terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''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 AUTHORS OR CONTRIBUTORS 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.
+ * Encrypt a single block. 
  */
-
-#include "config_xor.h"
-
-#include <sys/types.h>
-#include <string.h>
-
-#ifdef SH_ENCRYPT
-
-typedef unsigned char u8;
-#if defined(HAVE_INT_32)
-typedef unsigned int u32;
-#elif defined(HAVE_LONG_32)
-typedef unsigned long u32;
-#elif defined(HAVE_SHORT_32)
-typedef unsigned short u32;
-#else
-#error "No 32 bit integer type found"
+int rijndaelEncrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
+	int r;
+	word8 temp[4][4];
+
+    *((word32*)temp[0]) = *((word32*)(a   )) ^ *((word32*)rk[0][0]);
+    *((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[0][1]);
+    *((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[0][2]);
+    *((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[0][3]);
+    *((word32*)(b    )) = *((word32*)T1[temp[0][0]])
+						^ *((word32*)T2[temp[1][1]])
+						^ *((word32*)T3[temp[2][2]]) 
+						^ *((word32*)T4[temp[3][3]]);
+    *((word32*)(b + 4)) = *((word32*)T1[temp[1][0]])
+						^ *((word32*)T2[temp[2][1]])
+						^ *((word32*)T3[temp[3][2]]) 
+						^ *((word32*)T4[temp[0][3]]);
+    *((word32*)(b + 8)) = *((word32*)T1[temp[2][0]])
+						^ *((word32*)T2[temp[3][1]])
+						^ *((word32*)T3[temp[0][2]]) 
+						^ *((word32*)T4[temp[1][3]]);
+    *((word32*)(b +12)) = *((word32*)T1[temp[3][0]])
+						^ *((word32*)T2[temp[0][1]])
+						^ *((word32*)T3[temp[1][2]]) 
+						^ *((word32*)T4[temp[2][3]]);
+	for (r = 1; r < ROUNDS-1; r++) {
+		*((word32*)temp[0]) = *((word32*)(b   )) ^ *((word32*)rk[r][0]);
+		*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
+		*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
+		*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
+
+		*((word32*)(b    )) = *((word32*)T1[temp[0][0]])
+							^ *((word32*)T2[temp[1][1]])
+							^ *((word32*)T3[temp[2][2]]) 
+							^ *((word32*)T4[temp[3][3]]);
+		*((word32*)(b + 4)) = *((word32*)T1[temp[1][0]])
+							^ *((word32*)T2[temp[2][1]])
+							^ *((word32*)T3[temp[3][2]]) 
+							^ *((word32*)T4[temp[0][3]]);
+		*((word32*)(b + 8)) = *((word32*)T1[temp[2][0]])
+							^ *((word32*)T2[temp[3][1]])
+							^ *((word32*)T3[temp[0][2]]) 
+							^ *((word32*)T4[temp[1][3]]);
+		*((word32*)(b +12)) = *((word32*)T1[temp[3][0]])
+							^ *((word32*)T2[temp[0][1]])
+							^ *((word32*)T3[temp[1][2]]) 
+							^ *((word32*)T4[temp[2][3]]);
+	}
+	/* last round is special */   
+	*((word32*)temp[0]) = *((word32*)(b   )) ^ *((word32*)rk[ROUNDS-1][0]);
+	*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[ROUNDS-1][1]);
+	*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[ROUNDS-1][2]);
+	*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[ROUNDS-1][3]);
+	b[ 0] = T1[temp[0][0]][1];
+	b[ 1] = T1[temp[1][1]][1];
+	b[ 2] = T1[temp[2][2]][1];
+	b[ 3] = T1[temp[3][3]][1];
+	b[ 4] = T1[temp[1][0]][1];
+	b[ 5] = T1[temp[2][1]][1];
+	b[ 6] = T1[temp[3][2]][1];
+	b[ 7] = T1[temp[0][3]][1];
+	b[ 8] = T1[temp[2][0]][1];
+	b[ 9] = T1[temp[3][1]][1];
+	b[10] = T1[temp[0][2]][1];
+	b[11] = T1[temp[1][3]][1];
+	b[12] = T1[temp[3][0]][1];
+	b[13] = T1[temp[0][1]][1];
+	b[14] = T1[temp[1][2]][1];
+	b[15] = T1[temp[2][3]][1];
+	*((word32*)(b   )) ^= *((word32*)rk[ROUNDS][0]);
+	*((word32*)(b+ 4)) ^= *((word32*)rk[ROUNDS][1]);
+	*((word32*)(b+ 8)) ^= *((word32*)rk[ROUNDS][2]);
+	*((word32*)(b+12)) ^= *((word32*)rk[ROUNDS][3]);
+
+	return 0;
+}
+
+/**
+ * Decrypt a single block.
+ */
+int rijndaelDecrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
+	int r;
+	word8 temp[4][4];
+	
+    *((word32*)temp[0]) = *((word32*)(a   )) ^ *((word32*)rk[ROUNDS][0]);
+    *((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[ROUNDS][1]);
+    *((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[ROUNDS][2]);
+    *((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[ROUNDS][3]);
+
+    *((word32*)(b   )) = *((word32*)T5[temp[0][0]])
+           ^ *((word32*)T6[temp[3][1]])
+           ^ *((word32*)T7[temp[2][2]]) 
+           ^ *((word32*)T8[temp[1][3]]);
+	*((word32*)(b+ 4)) = *((word32*)T5[temp[1][0]])
+           ^ *((word32*)T6[temp[0][1]])
+           ^ *((word32*)T7[temp[3][2]]) 
+           ^ *((word32*)T8[temp[2][3]]);
+	*((word32*)(b+ 8)) = *((word32*)T5[temp[2][0]])
+           ^ *((word32*)T6[temp[1][1]])
+           ^ *((word32*)T7[temp[0][2]]) 
+           ^ *((word32*)T8[temp[3][3]]);
+	*((word32*)(b+12)) = *((word32*)T5[temp[3][0]])
+           ^ *((word32*)T6[temp[2][1]])
+           ^ *((word32*)T7[temp[1][2]]) 
+           ^ *((word32*)T8[temp[0][3]]);
+	for (r = ROUNDS-1; r > 1; r--) {
+		*((word32*)temp[0]) = *((word32*)(b   )) ^ *((word32*)rk[r][0]);
+		*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[r][1]);
+		*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[r][2]);
+		*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[r][3]);
+		*((word32*)(b   )) = *((word32*)T5[temp[0][0]])
+           ^ *((word32*)T6[temp[3][1]])
+           ^ *((word32*)T7[temp[2][2]]) 
+           ^ *((word32*)T8[temp[1][3]]);
+		*((word32*)(b+ 4)) = *((word32*)T5[temp[1][0]])
+           ^ *((word32*)T6[temp[0][1]])
+           ^ *((word32*)T7[temp[3][2]]) 
+           ^ *((word32*)T8[temp[2][3]]);
+		*((word32*)(b+ 8)) = *((word32*)T5[temp[2][0]])
+           ^ *((word32*)T6[temp[1][1]])
+           ^ *((word32*)T7[temp[0][2]]) 
+           ^ *((word32*)T8[temp[3][3]]);
+		*((word32*)(b+12)) = *((word32*)T5[temp[3][0]])
+           ^ *((word32*)T6[temp[2][1]])
+           ^ *((word32*)T7[temp[1][2]]) 
+           ^ *((word32*)T8[temp[0][3]]);
+	}
+	/* last round is special */   
+	*((word32*)temp[0]) = *((word32*)(b   )) ^ *((word32*)rk[1][0]);
+	*((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[1][1]);
+	*((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[1][2]);
+	*((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[1][3]);
+	b[ 0] = S5[temp[0][0]];
+	b[ 1] = S5[temp[3][1]];
+	b[ 2] = S5[temp[2][2]];
+	b[ 3] = S5[temp[1][3]];
+	b[ 4] = S5[temp[1][0]];
+	b[ 5] = S5[temp[0][1]];
+	b[ 6] = S5[temp[3][2]];
+	b[ 7] = S5[temp[2][3]];
+	b[ 8] = S5[temp[2][0]];
+	b[ 9] = S5[temp[1][1]];
+	b[10] = S5[temp[0][2]];
+	b[11] = S5[temp[3][3]];
+	b[12] = S5[temp[3][0]];
+	b[13] = S5[temp[2][1]];
+	b[14] = S5[temp[1][2]];
+	b[15] = S5[temp[0][3]];
+	*((word32*)(b   )) ^= *((word32*)rk[0][0]);
+	*((word32*)(b+ 4)) ^= *((word32*)rk[0][1]);
+	*((word32*)(b+ 8)) ^= *((word32*)rk[0][2]);
+	*((word32*)(b+12)) ^= *((word32*)rk[0][3]);
+
+	return 0;
+}
+
 #endif
-
-#include "rijndael-alg-fst.h"
-
-#define FULL_UNROLL 1
-/*
-Te0[x] = S [x].[02, 01, 01, 03];
-Te1[x] = S [x].[03, 02, 01, 01];
-Te2[x] = S [x].[01, 03, 02, 01];
-Te3[x] = S [x].[01, 01, 03, 02];
-Te4[x] = S [x].[01, 01, 01, 01];
-
-Td0[x] = Si[x].[0e, 09, 0d, 0b];
-Td1[x] = Si[x].[0b, 0e, 09, 0d];
-Td2[x] = Si[x].[0d, 0b, 0e, 09];
-Td3[x] = Si[x].[09, 0d, 0b, 0e];
-Td4[x] = Si[x].[01, 01, 01, 01];
-*/
-
-static const u32 Te0[256] = {
-    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
-    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
-    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
-    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
-    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
-    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
-    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
-    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
-    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
-    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
-    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
-    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
-    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
-    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
-    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
-    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
-    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
-    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
-    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
-    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
-    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
-    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
-    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
-    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
-    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
-    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
-    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
-    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
-    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
-    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
-    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
-    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
-    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
-    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
-    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
-    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
-    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
-    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
-    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
-    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
-    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
-    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
-    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
-    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
-    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
-    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
-    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
-    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
-    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
-    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
-    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
-    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
-    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
-    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
-    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
-    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
-    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
-    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
-    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
-    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
-    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
-    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
-    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
-    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
-};
-static const u32 Te1[256] = {
-    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
-    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
-    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
-    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
-    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
-    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
-    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
-    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
-    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
-    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
-    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
-    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
-    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
-    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
-    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
-    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
-    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
-    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
-    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
-    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
-    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
-    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
-    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
-    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
-    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
-    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
-    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
-    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
-    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
-    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
-    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
-    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
-    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
-    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
-    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
-    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
-    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
-    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
-    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
-    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
-    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
-    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
-    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
-    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
-    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
-    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
-    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
-    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
-    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
-    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
-    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
-    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
-    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
-    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
-    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
-    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
-    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
-    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
-    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
-    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
-    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
-    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
-    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
-    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
-};
-static const u32 Te2[256] = {
-    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
-    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
-    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
-    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
-    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
-    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
-    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
-    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
-    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
-    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
-    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
-    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
-    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
-    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
-    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
-    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
-    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
-    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
-    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
-    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
-    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
-    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
-    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
-    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
-    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
-    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
-    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
-    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
-    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
-    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
-    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
-    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
-    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
-    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
-    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
-    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
-    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
-    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
-    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
-    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
-    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
-    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
-    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
-    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
-    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
-    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
-    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
-    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
-    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
-    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
-    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
-    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
-    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
-    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
-    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
-    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
-    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
-    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
-    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
-    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
-    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
-    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
-    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
-    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
-};
-static const u32 Te3[256] = {
-
-    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
-    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
-    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
-    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
-    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
-    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
-    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
-    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
-    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
-    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
-    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
-    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
-    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
-    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
-    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
-    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
-    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
-    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
-    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
-    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
-    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
-    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
-    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
-    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
-    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
-    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
-    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
-    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
-    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
-    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
-    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
-    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
-    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
-    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
-    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
-    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
-    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
-    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
-    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
-    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
-    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
-    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
-    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
-    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
-    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
-    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
-    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
-    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
-    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
-    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
-    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
-    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
-    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
-    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
-    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
-    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
-    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
-    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
-    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
-    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
-    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
-    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
-    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
-    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
-};
-static const u32 Te4[256] = {
-    0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
-    0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
-    0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
-    0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
-    0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
-    0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
-    0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
-    0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
-    0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
-    0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
-    0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
-    0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
-    0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
-    0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
-    0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
-    0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
-    0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
-    0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
-    0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
-    0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
-    0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
-    0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
-    0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
-    0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
-    0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
-    0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
-    0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
-    0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
-    0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
-    0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
-    0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
-    0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
-    0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
-    0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
-    0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
-    0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
-    0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
-    0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
-    0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
-    0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
-    0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
-    0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
-    0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
-    0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
-    0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
-    0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
-    0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
-    0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
-    0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
-    0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
-    0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
-    0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
-    0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
-    0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
-    0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
-    0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
-    0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
-    0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
-    0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
-    0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
-    0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
-    0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
-    0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
-    0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
-};
-static const u32 Td0[256] = {
-    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
-    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
-    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
-    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
-    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
-    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
-    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
-    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
-    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
-    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
-    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
-    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
-    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
-    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
-    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
-    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
-    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
-    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
-    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
-    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
-    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
-    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
-    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
-    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
-    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
-    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
-    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
-    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
-    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
-    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
-    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
-    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
-    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
-    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
-    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
-    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
-    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
-    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
-    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
-    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
-    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
-    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
-    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
-    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
-    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
-    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
-    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
-    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
-    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
-    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
-    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
-    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
-    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
-    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
-    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
-    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
-    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
-    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
-    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
-    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
-    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
-    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
-    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
-    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
-};
-static const u32 Td1[256] = {
-    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
-    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
-    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
-    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
-    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
-    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
-    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
-    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
-    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
-    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
-    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
-    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
-    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
-    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
-    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
-    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
-    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
-    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
-    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
-    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
-    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
-    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
-    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
-    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
-    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
-    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
-    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
-    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
-    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
-    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
-    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
-    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
-    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
-    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
-    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
-    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
-    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
-    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
-    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
-    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
-    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
-    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
-    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
-    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
-    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
-    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
-    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
-    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
-    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
-    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
-    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
-    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
-    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
-    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
-    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
-    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
-    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
-    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
-    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
-    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
-    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
-    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
-    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
-    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
-};
-static const u32 Td2[256] = {
-    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
-    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
-    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
-    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
-    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
-    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
-    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
-    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
-    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
-    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
-    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
-    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
-    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
-    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
-    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
-    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
-    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
-    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
-    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
-    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
-
-    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
-    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
-    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
-    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
-    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
-    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
-    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
-    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
-    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
-    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
-    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
-    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
-    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
-    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
-    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
-    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
-    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
-    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
-    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
-    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
-    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
-    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
-    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
-    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
-    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
-    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
-    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
-    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
-    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
-    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
-    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
-    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
-    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
-    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
-    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
-    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
-    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
-    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
-    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
-    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
-    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
-    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
-    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
-    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
-};
-static const u32 Td3[256] = {
-    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
-    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
-    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
-    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
-    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
-    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
-    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
-    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
-    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
-    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
-    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
-    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
-    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
-    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
-    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
-    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
-    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
-    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
-    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
-    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
-    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
-    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
-    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
-    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
-    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
-    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
-    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
-    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
-    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
-    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
-    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
-    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
-    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
-    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
-    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
-    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
-    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
-    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
-    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
-    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
-    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
-    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
-    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
-    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
-    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
-    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
-    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
-    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
-    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
-    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
-    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
-    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
-    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
-    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
-    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
-    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
-    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
-    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
-    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
-    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
-    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
-    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
-    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
-    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
-};
-static const u32 Td4[256] = {
-    0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
-    0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
-    0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
-    0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
-    0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
-    0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
-    0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
-    0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
-    0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
-    0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
-    0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
-    0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
-    0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
-    0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
-    0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
-    0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
-    0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
-    0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
-    0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
-    0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
-    0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
-    0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
-    0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
-    0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
-    0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
-    0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
-    0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
-    0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
-    0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
-    0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
-    0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
-    0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
-    0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
-    0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
-    0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
-    0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
-    0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
-    0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
-    0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
-    0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
-    0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
-    0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
-    0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
-    0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
-    0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
-    0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
-    0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
-    0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
-    0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
-    0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
-    0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
-    0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
-    0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
-    0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
-    0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
-    0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
-    0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
-    0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
-    0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
-    0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
-    0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
-    0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
-    0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
-    0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
-};
-static const u32 rcon[] = {
-	0x01000000, 0x02000000, 0x04000000, 0x08000000,
-	0x10000000, 0x20000000, 0x40000000, 0x80000000,
-	0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
-};
-
-
-#ifdef _MSC_VER
-#define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
-#define GETU32(p) SWAP(*((u32 *)(p)))
-#define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
-#else
-#define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] <<  8) ^ ((u32)(pt)[3]))
-#define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >>  8); (ct)[3] = (u8)(st); }
-#endif
-
-/**
- * Expand the cipher key into the encryption key schedule.
- *
- * @return	the number of rounds for the given cipher key size.
- */
-int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) {
-   	int i = 0;
-	u32 temp;
-
-	rk[0] = GETU32(cipherKey     );
-	rk[1] = GETU32(cipherKey +  4);
-	rk[2] = GETU32(cipherKey +  8);
-	rk[3] = GETU32(cipherKey + 12);
-	if (keyBits == 128) {
-		for (;;) {
-			temp  = rk[3];
-			rk[4] = rk[0] ^
-				(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
-				(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
-				(Te4[(temp      ) & 0xff] & 0x0000ff00) ^
-				(Te4[(temp >> 24)       ] & 0x000000ff) ^
-				rcon[i];
-			rk[5] = rk[1] ^ rk[4];
-			rk[6] = rk[2] ^ rk[5];
-			rk[7] = rk[3] ^ rk[6];
-			if (++i == 10) {
-				return 10;
-			}
-			rk += 4;
-		}
-	}
-	rk[4] = GETU32(cipherKey + 16);
-	rk[5] = GETU32(cipherKey + 20);
-	if (keyBits == 192) {
-		for (;;) {
-			temp = rk[ 5];
-			rk[ 6] = rk[ 0] ^
-				(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
-				(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
-				(Te4[(temp      ) & 0xff] & 0x0000ff00) ^
-				(Te4[(temp >> 24)       ] & 0x000000ff) ^
-				rcon[i];
-			rk[ 7] = rk[ 1] ^ rk[ 6];
-			rk[ 8] = rk[ 2] ^ rk[ 7];
-			rk[ 9] = rk[ 3] ^ rk[ 8];
-			if (++i == 8) {
-				return 12;
-			}
-			rk[10] = rk[ 4] ^ rk[ 9];
-			rk[11] = rk[ 5] ^ rk[10];
-			rk += 6;
-		}
-	}
-	rk[6] = GETU32(cipherKey + 24);
-	rk[7] = GETU32(cipherKey + 28);
-	if (keyBits == 256) {
-        for (;;) {
-        	temp = rk[ 7];
-        	rk[ 8] = rk[ 0] ^
-        		(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
-        		(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
-        		(Te4[(temp      ) & 0xff] & 0x0000ff00) ^
-        		(Te4[(temp >> 24)       ] & 0x000000ff) ^
-        		rcon[i];
-        	rk[ 9] = rk[ 1] ^ rk[ 8];
-        	rk[10] = rk[ 2] ^ rk[ 9];
-        	rk[11] = rk[ 3] ^ rk[10];
-			if (++i == 7) {
-				return 14;
-			}
-        	temp = rk[11];
-        	rk[12] = rk[ 4] ^
-        		(Te4[(temp >> 24)       ] & 0xff000000) ^
-        		(Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
-        		(Te4[(temp >>  8) & 0xff] & 0x0000ff00) ^
-        		(Te4[(temp      ) & 0xff] & 0x000000ff);
-        	rk[13] = rk[ 5] ^ rk[12];
-        	rk[14] = rk[ 6] ^ rk[13];
-        	rk[15] = rk[ 7] ^ rk[14];
-
-			rk += 8;
-        }
-	}
-	return 0;
-}
-
-/**
- * Expand the cipher key into the decryption key schedule.
- *
- * @return	the number of rounds for the given cipher key size.
- */
-int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) {
-	int Nr, i, j;
-	u32 temp;
-
-	/* expand the cipher key: */
-	Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits);
-	/* invert the order of the round keys: */
-	for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) {
-		temp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;
-		temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
-		temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
-		temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
-	}
-	/* apply the inverse MixColumn transform to all round keys but the first and the last: */
-	for (i = 1; i < Nr; i++) {
-		rk += 4;
-		rk[0] =
-			Td0[Te4[(rk[0] >> 24)       ] & 0xff] ^
-			Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
-			Td2[Te4[(rk[0] >>  8) & 0xff] & 0xff] ^
-			Td3[Te4[(rk[0]      ) & 0xff] & 0xff];
-		rk[1] =
-			Td0[Te4[(rk[1] >> 24)       ] & 0xff] ^
-			Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
-			Td2[Te4[(rk[1] >>  8) & 0xff] & 0xff] ^
-			Td3[Te4[(rk[1]      ) & 0xff] & 0xff];
-		rk[2] =
-			Td0[Te4[(rk[2] >> 24)       ] & 0xff] ^
-			Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
-			Td2[Te4[(rk[2] >>  8) & 0xff] & 0xff] ^
-			Td3[Te4[(rk[2]      ) & 0xff] & 0xff];
-		rk[3] =
-			Td0[Te4[(rk[3] >> 24)       ] & 0xff] ^
-			Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
-			Td2[Te4[(rk[3] >>  8) & 0xff] & 0xff] ^
-			Td3[Te4[(rk[3]      ) & 0xff] & 0xff];
-	}
-	return Nr;
-}
-
-void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]) {
-	u32 s0, s1, s2, s3, t0, t1, t2, t3;
-#ifndef FULL_UNROLL
-    int r;
-#endif /* ?FULL_UNROLL */
-
-    /*
-	 * map byte array block to cipher state
-	 * and add initial round key:
-	 */
-	s0 = GETU32(pt     ) ^ rk[0];
-	s1 = GETU32(pt +  4) ^ rk[1];
-	s2 = GETU32(pt +  8) ^ rk[2];
-	s3 = GETU32(pt + 12) ^ rk[3];
-#ifdef FULL_UNROLL
-    /* round 1: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];
-   	/* round 2: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
-    /* round 3: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
-   	/* round 4: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
-    /* round 5: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
-   	/* round 6: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
-    /* round 7: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
-   	/* round 8: */
-   	s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
-   	s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
-   	s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
-   	s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
-    /* round 9: */
-   	t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
-   	t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
-   	t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
-   	t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
-    if (Nr > 10) {
-        /* round 10: */
-        s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
-        s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
-        s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
-        s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
-        /* round 11: */
-        t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
-        t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
-        t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
-        t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
-        if (Nr > 12) {
-            /* round 12: */
-            s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >>  8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
-            s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >>  8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
-            s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >>  8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
-            s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >>  8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
-            /* round 13: */
-            t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >>  8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
-            t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >>  8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
-            t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >>  8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
-            t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >>  8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
-        }
-    }
-    rk += Nr << 2;
-#else  /* !FULL_UNROLL */
-    /*
-	 * Nr - 1 full rounds:
-	 */
-    r = Nr >> 1;
-    for (;;) {
-        t0 =
-            Te0[(s0 >> 24)       ] ^
-            Te1[(s1 >> 16) & 0xff] ^
-            Te2[(s2 >>  8) & 0xff] ^
-            Te3[(s3      ) & 0xff] ^
-            rk[4];
-        t1 =
-            Te0[(s1 >> 24)       ] ^
-            Te1[(s2 >> 16) & 0xff] ^
-            Te2[(s3 >>  8) & 0xff] ^
-            Te3[(s0      ) & 0xff] ^
-            rk[5];
-        t2 =
-            Te0[(s2 >> 24)       ] ^
-            Te1[(s3 >> 16) & 0xff] ^
-            Te2[(s0 >>  8) & 0xff] ^
-            Te3[(s1      ) & 0xff] ^
-            rk[6];
-        t3 =
-            Te0[(s3 >> 24)       ] ^
-            Te1[(s0 >> 16) & 0xff] ^
-            Te2[(s1 >>  8) & 0xff] ^
-            Te3[(s2      ) & 0xff] ^
-            rk[7];
-
-        rk += 8;
-        if (--r == 0) {
-            break;
-        }
-
-        s0 =
-            Te0[(t0 >> 24)       ] ^
-            Te1[(t1 >> 16) & 0xff] ^
-            Te2[(t2 >>  8) & 0xff] ^
-            Te3[(t3      ) & 0xff] ^
-            rk[0];
-        s1 =
-            Te0[(t1 >> 24)       ] ^
-            Te1[(t2 >> 16) & 0xff] ^
-            Te2[(t3 >>  8) & 0xff] ^
-            Te3[(t0      ) & 0xff] ^
-            rk[1];
-        s2 =
-            Te0[(t2 >> 24)       ] ^
-            Te1[(t3 >> 16) & 0xff] ^
-            Te2[(t0 >>  8) & 0xff] ^
-            Te3[(t1      ) & 0xff] ^
-            rk[2];
-        s3 =
-            Te0[(t3 >> 24)       ] ^
-            Te1[(t0 >> 16) & 0xff] ^
-            Te2[(t1 >>  8) & 0xff] ^
-            Te3[(t2      ) & 0xff] ^
-            rk[3];
-    }
-#endif /* ?FULL_UNROLL */
-    /*
-	 * apply last round and
-	 * map cipher state to byte array block:
-	 */
-	s0 =
-		(Te4[(t0 >> 24)       ] & 0xff000000) ^
-		(Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te4[(t2 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te4[(t3      ) & 0xff] & 0x000000ff) ^
-		rk[0];
-	PUTU32(ct     , s0);
-	s1 =
-		(Te4[(t1 >> 24)       ] & 0xff000000) ^
-		(Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te4[(t3 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te4[(t0      ) & 0xff] & 0x000000ff) ^
-		rk[1];
-	PUTU32(ct +  4, s1);
-	s2 =
-		(Te4[(t2 >> 24)       ] & 0xff000000) ^
-		(Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te4[(t0 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te4[(t1      ) & 0xff] & 0x000000ff) ^
-		rk[2];
-	PUTU32(ct +  8, s2);
-	s3 =
-		(Te4[(t3 >> 24)       ] & 0xff000000) ^
-		(Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
-		(Te4[(t1 >>  8) & 0xff] & 0x0000ff00) ^
-		(Te4[(t2      ) & 0xff] & 0x000000ff) ^
-		rk[3];
-	PUTU32(ct + 12, s3);
-}
-
-void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]) {
-	u32 s0, s1, s2, s3, t0, t1, t2, t3;
-#ifndef FULL_UNROLL
-    int r;
-#endif /* ?FULL_UNROLL */
-
-    /*
-	 * map byte array block to cipher state
-	 * and add initial round key:
-	 */
-    s0 = GETU32(ct     ) ^ rk[0];
-    s1 = GETU32(ct +  4) ^ rk[1];
-    s2 = GETU32(ct +  8) ^ rk[2];
-    s3 = GETU32(ct + 12) ^ rk[3];
-#ifdef FULL_UNROLL
-    /* round 1: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];
-    /* round 2: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
-    /* round 3: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
-    /* round 4: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
-    /* round 5: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
-    /* round 6: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
-    /* round 7: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
-    /* round 8: */
-    s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
-    s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
-    s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
-    s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
-    /* round 9: */
-    t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
-    t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
-    t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
-    t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
-    if (Nr > 10) {
-        /* round 10: */
-        s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
-        s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
-        s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
-        s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
-        /* round 11: */
-        t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
-        t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
-        t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
-        t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
-        if (Nr > 12) {
-            /* round 12: */
-            s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >>  8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
-            s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >>  8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
-            s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >>  8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
-            s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >>  8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
-            /* round 13: */
-            t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >>  8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
-            t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >>  8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
-            t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >>  8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
-            t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >>  8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
-        }
-    }
-	rk += Nr << 2;
-#else  /* !FULL_UNROLL */
-    /*
-     * Nr - 1 full rounds:
-     */
-    r = Nr >> 1;
-    for (;;) {
-        t0 =
-            Td0[(s0 >> 24)       ] ^
-            Td1[(s3 >> 16) & 0xff] ^
-            Td2[(s2 >>  8) & 0xff] ^
-            Td3[(s1      ) & 0xff] ^
-            rk[4];
-        t1 =
-            Td0[(s1 >> 24)       ] ^
-            Td1[(s0 >> 16) & 0xff] ^
-            Td2[(s3 >>  8) & 0xff] ^
-            Td3[(s2      ) & 0xff] ^
-            rk[5];
-        t2 =
-            Td0[(s2 >> 24)       ] ^
-            Td1[(s1 >> 16) & 0xff] ^
-            Td2[(s0 >>  8) & 0xff] ^
-            Td3[(s3      ) & 0xff] ^
-            rk[6];
-        t3 =
-            Td0[(s3 >> 24)       ] ^
-            Td1[(s2 >> 16) & 0xff] ^
-            Td2[(s1 >>  8) & 0xff] ^
-            Td3[(s0      ) & 0xff] ^
-            rk[7];
-
-        rk += 8;
-        if (--r == 0) {
-            break;
-        }
-
-        s0 =
-            Td0[(t0 >> 24)       ] ^
-            Td1[(t3 >> 16) & 0xff] ^
-            Td2[(t2 >>  8) & 0xff] ^
-            Td3[(t1      ) & 0xff] ^
-            rk[0];
-        s1 =
-            Td0[(t1 >> 24)       ] ^
-            Td1[(t0 >> 16) & 0xff] ^
-            Td2[(t3 >>  8) & 0xff] ^
-            Td3[(t2      ) & 0xff] ^
-            rk[1];
-        s2 =
-            Td0[(t2 >> 24)       ] ^
-            Td1[(t1 >> 16) & 0xff] ^
-            Td2[(t0 >>  8) & 0xff] ^
-            Td3[(t3      ) & 0xff] ^
-            rk[2];
-        s3 =
-            Td0[(t3 >> 24)       ] ^
-            Td1[(t2 >> 16) & 0xff] ^
-            Td2[(t1 >>  8) & 0xff] ^
-            Td3[(t0      ) & 0xff] ^
-            rk[3];
-    }
-#endif /* ?FULL_UNROLL */
-    /*
-	 * apply last round and
-	 * map cipher state to byte array block:
-	 */
-   	s0 =
-   		(Td4[(t0 >> 24)       ] & 0xff000000) ^
-   		(Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
-   		(Td4[(t2 >>  8) & 0xff] & 0x0000ff00) ^
-   		(Td4[(t1      ) & 0xff] & 0x000000ff) ^
-   		rk[0];
-	PUTU32(pt     , s0);
-   	s1 =
-   		(Td4[(t1 >> 24)       ] & 0xff000000) ^
-   		(Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
-   		(Td4[(t3 >>  8) & 0xff] & 0x0000ff00) ^
-   		(Td4[(t2      ) & 0xff] & 0x000000ff) ^
-   		rk[1];
-	PUTU32(pt +  4, s1);
-   	s2 =
-   		(Td4[(t2 >> 24)       ] & 0xff000000) ^
-   		(Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
-   		(Td4[(t0 >>  8) & 0xff] & 0x0000ff00) ^
-   		(Td4[(t3      ) & 0xff] & 0x000000ff) ^
-   		rk[2];
-	PUTU32(pt +  8, s2);
-   	s3 =
-   		(Td4[(t3 >> 24)       ] & 0xff000000) ^
-   		(Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
-   		(Td4[(t1 >>  8) & 0xff] & 0x0000ff00) ^
-   		(Td4[(t0      ) & 0xff] & 0x000000ff) ^
-   		rk[3];
-	PUTU32(pt + 12, s3);
-}
-
-#endif
Index: trunk/src/rijndael-api-fst.c
===================================================================
--- trunk/src/rijndael-api-fst.c	(revision 591)
+++ trunk/src/rijndael-api-fst.c	(revision 1)
@@ -1,408 +1,319 @@
-/*	$NetBSD: rijndael-api-fst.c,v 1.24 2011/05/14 16:46:55 jmmv Exp $	*/
-
-/**
- * rijndael-api-fst.c
+/*
+ * rijndael-api-fst.c   v2.3   April '2000
  *
- * @version 2.9 (December 2000)
+ * Optimised ANSI C code
  *
- * Optimised ANSI C code for the Rijndael cipher (now AES)
+ * authors: v1.0: Antoon Bosselaers
+ *          v2.0: Vincent Rijmen
+ *          v2.1: Vincent Rijmen
+ *          v2.2: Vincent Rijmen
+ *          v2.3: Paulo Barreto
+ *          v2.4: Vincent Rijmen
  *
- * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
- * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
- * @author Paulo Barreto <paulo.barreto@terra.com.br>
- *
- * This code is hereby placed in the public domain.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''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 AUTHORS OR CONTRIBUTORS 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.
- *
- * Acknowledgements:
- *
- * We are deeply indebted to the following people for their bug reports,
- * fixes, and improvement suggestions to this implementation. Though we
- * tried to list all contributions, we apologise in advance for any
- * missing reference.
- *
- * Andrew Bales <Andrew.Bales@Honeywell.com>
- * Markus Friedl <markus.friedl@informatik.uni-erlangen.de>
- * John Skodon <skodonj@webquill.com>
+ * This code is placed in the public domain.
  */
+
 #include "config_xor.h"
 
+#include <stdio.h>
+#include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 
-
 #ifdef SH_ENCRYPT
 
+#include "rijndael-alg-fst.h"
 #include "rijndael-api-fst.h"
 
-static void xor16(u8 *d, const u8 *a, const u8* b)
-{
-  size_t i;
-
-	for (i = 0; i < 4; i++) {
-		*d++ = *a++ ^ *b++;
-		*d++ = *a++ ^ *b++;
-		*d++ = *a++ ^ *b++;
-		*d++ = *a++ ^ *b++;
-	}
+int makeKey(keyInstance *key, RIJ_BYTE direction, int keyLen, char *keyMaterial) {
+  word8 k[MAXKC][4];
+  int i;
+  char *keyMat;
+  
+  if (key == NULL) {
+    return BAD_KEY_INSTANCE;
+  }
+  
+  if ((direction == DIR_ENCRYPT) || (direction == DIR_DECRYPT)) {
+    key->direction = direction;
+  } else {
+    return BAD_KEY_DIR;
+  }
+  
+  if ((keyLen == 128) || (keyLen == 192) || (keyLen == 256)) { 
+    key->keyLen = keyLen;
+  } else {
+    return BAD_KEY_MAT;
+  }
+  
+  if (keyMaterial != NULL) {
+    strncpy(key->keyMaterial, keyMaterial, keyLen/4);
+  }
+  
+  key->ROUNDS = keyLen/32 + 6;
+  
+  /* initialize key schedule: */
+  keyMat = key->keyMaterial;
+#ifndef BINARY_KEY_MATERIAL
+  for (i = 0; i < key->keyLen/8; i++) {
+    int t, j;
+    
+    t = *keyMat++;
+    if ((t >= '0') && (t <= '9')) j = (t - '0') << 4;
+    else if ((t >= 'a') && (t <= 'f')) j = (t - 'a' + 10) << 4; 
+    else if ((t >= 'A') && (t <= 'F')) j = (t - 'A' + 10) << 4; 
+    else return BAD_KEY_MAT;
+    
+    t = *keyMat++;
+    if ((t >= '0') && (t <= '9')) j ^= (t - '0');
+    else if ((t >= 'a') && (t <= 'f')) j ^= (t - 'a' + 10); 
+    else if ((t >= 'A') && (t <= 'F')) j ^= (t - 'A' + 10); 
+    else return BAD_KEY_MAT;
+    
+    k[i >> 2][i & 3] = (word8)j; 
+  }
+#else
+  for (i = 0; i < key->keyLen/8; i++) {
+    k[i >> 2][i & 3] = (word8)keyMat[i]; 
+  }
+#endif /* ?BINARY_KEY_MATERIAL */
+  rijndaelKeySched(k, key->keySched, key->ROUNDS);
+  if (direction == DIR_DECRYPT) {
+    rijndaelKeyEncToDec(key->keySched, key->ROUNDS);
+  }
+  
+  return TRUE;
 }
 
-int
-rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen,
-    const char *keyMaterial)
-{
-	u8 cipherKey[RIJNDAEL_MAXKB];
-	int i;
-
-	if (key == NULL) {
-		return BAD_KEY_INSTANCE;
-	}
-
-	if ((direction == DIR_ENCRYPT) || (direction == DIR_DECRYPT)) {
-		key->direction = direction;
-	} else {
-		return BAD_KEY_DIR;
-	}
-
-	if ((keyLen == 128) || (keyLen == 192) || (keyLen == 256)) {
-		key->keyLen = keyLen;
-	} else {
-		return BAD_KEY_MAT;
-	}
-
-	if (keyMaterial != NULL) {
-	        char temp[RIJNDAEL_MAX_KEY_SIZE];
-		for (i = 0; i < key->keyLen/8; i++) {
-		  int t, j;
-		  
-		  t = *keyMaterial++;
-		  if ((t >= '0') && (t <= '9')) j = (t - '0') << 4;
-		  else if ((t >= 'a') && (t <= 'f')) j = (t - 'a' + 10) << 4; 
-		  else if ((t >= 'A') && (t <= 'F')) j = (t - 'A' + 10) << 4; 
-		  else return BAD_KEY_MAT;
-		  
-		  t = *keyMaterial++;
-		  if ((t >= '0') && (t <= '9')) j ^= (t - '0');
-		  else if ((t >= 'a') && (t <= 'f')) j ^= (t - 'a' + 10); 
-		  else if ((t >= 'A') && (t <= 'F')) j ^= (t - 'A' + 10); 
-		  else return BAD_KEY_MAT;
-		  
-		  temp[i] = (u8)j; 
-		}
-
-		/* memcpy(key->keyMaterial, keyMaterial, keyLen/8); */
-		/* cppcheck-suppress uninitvar */
-		memcpy(key->keyMaterial, temp, keyLen/8);
-	}
-
-	/* initialize key schedule: */
-	memcpy(cipherKey, key->keyMaterial, keyLen/8);
-	if (direction == DIR_ENCRYPT) {
-		key->Nr = rijndaelKeySetupEnc(key->rk, cipherKey, keyLen);
-	} else {
-		key->Nr = rijndaelKeySetupDec(key->rk, cipherKey, keyLen);
-	}
-	rijndaelKeySetupEnc(key->ek, cipherKey, keyLen);
-	return TRUE;
+int cipherInit(cipherInstance *cipher, RIJ_BYTE mode, char *IV) {
+  if ((mode == MODE_ECB) || (mode == MODE_CBC) || (mode == MODE_CFB1)) {
+    cipher->mode = mode;
+  } else {
+    return BAD_CIPHER_MODE;
+  }
+  if (IV != NULL) {
+#ifndef BINARY_KEY_MATERIAL
+    int i;
+    for (i = 0; i < MAX_IV_SIZE; i++) {
+      int t, j;
+      
+      t = IV[2*i];
+      if ((t >= '0') && (t <= '9')) j = (t - '0') << 4;
+      else if ((t >= 'a') && (t <= 'f')) j = (t - 'a' + 10) << 4; 
+      else if ((t >= 'A') && (t <= 'F')) j = (t - 'A' + 10) << 4; 
+      else return BAD_CIPHER_INSTANCE;
+      
+      t = IV[2*i+1];
+      if ((t >= '0') && (t <= '9')) j ^= (t - '0');
+      else if ((t >= 'a') && (t <= 'f')) j ^= (t - 'a' + 10); 
+      else if ((t >= 'A') && (t <= 'F')) j ^= (t - 'A' + 10); 
+      else return BAD_CIPHER_INSTANCE;
+      
+      cipher->IV[i] = (word8)j;
+    }
+#else
+    memcpy(cipher->IV, IV, MAX_IV_SIZE);
+#endif /* ?BINARY_KEY_MATERIAL */
+  } else {
+    memset(cipher->IV, 0, MAX_IV_SIZE);
+  }
+  return TRUE;
 }
 
-int
-rijndael_cipherInit(cipherInstance *cipher, BYTE mode, const char *IV)
-{
-	if ((mode == MODE_ECB) || (mode == MODE_CBC) || (mode == MODE_CFB1)) {
-		cipher->mode = mode;
-	} else {
-		return BAD_CIPHER_MODE;
-	}
-	if (IV != NULL) {
-		memcpy(cipher->IV, IV, RIJNDAEL_MAX_IV_SIZE);
-	} else {
-		memset(cipher->IV, 0, RIJNDAEL_MAX_IV_SIZE);
-	}
-	return TRUE;
+int blockEncrypt(cipherInstance *cipher, keyInstance *key,
+		 RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer) {
+  int i, k, numBlocks;
+  word8 block[16], iv[4][4];
+  
+  if (cipher == NULL ||
+      key == NULL ||
+      key->direction == DIR_DECRYPT) {
+    return BAD_CIPHER_STATE;
+  }
+  if (input == NULL || inputLen <= 0) {
+    return 0; /* nothing to do */
+  }
+  
+  numBlocks = inputLen/128;
+  
+  switch (cipher->mode) {
+  case MODE_ECB: 
+    for (i = numBlocks; i > 0; i--) {
+      rijndaelEncrypt(input, outBuffer, key->keySched, key->ROUNDS);
+      input += 16;
+      outBuffer += 16;
+    }
+    break;
+    
+  case MODE_CBC:
+    /* fix the memory alignment for HP-UX 10.20 
+     * R. Wichmann  Mon Jun 18 22:36:55 CEST 2001
+     */
+#if STRICT_ALIGN 
+    memcpy(iv, cipher->IV, 16); 
+    ((word32*)block)[0] = ((word32*)iv)[0] ^ ((word32*)input)[0];
+    ((word32*)block)[1] = ((word32*)iv)[1] ^ ((word32*)input)[1];
+    ((word32*)block)[2] = ((word32*)iv)[2] ^ ((word32*)input)[2];
+    ((word32*)block)[3] = ((word32*)iv)[3] ^ ((word32*)input)[3];
+#else  /* !STRICT_ALIGN */
+    ((word32*)block)[0] = ((word32*)cipher->IV)[0] ^ ((word32*)input)[0];
+    ((word32*)block)[1] = ((word32*)cipher->IV)[1] ^ ((word32*)input)[1];
+    ((word32*)block)[2] = ((word32*)cipher->IV)[2] ^ ((word32*)input)[2];
+    ((word32*)block)[3] = ((word32*)cipher->IV)[3] ^ ((word32*)input)[3];
+#endif /* ?STRICT_ALIGN */
+    rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
+    input += 16;
+    for (i = numBlocks - 1; i > 0; i--) {
+      ((word32*)block)[0] = ((word32*)outBuffer)[0] ^ ((word32*)input)[0];
+      ((word32*)block)[1] = ((word32*)outBuffer)[1] ^ ((word32*)input)[1];
+      ((word32*)block)[2] = ((word32*)outBuffer)[2] ^ ((word32*)input)[2];
+      ((word32*)block)[3] = ((word32*)outBuffer)[3] ^ ((word32*)input)[3];
+      outBuffer += 16;
+      rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
+      input += 16;
+    }
+    break;
+    
+  case MODE_CFB1:
+#if STRICT_ALIGN 
+    memcpy(iv, cipher->IV, 16); 
+#else  /* !STRICT_ALIGN */
+    *((word32*)iv[0]) = *((word32*)(cipher->IV   ));
+    *((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
+    *((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
+    *((word32*)iv[3]) = *((word32*)(cipher->IV+12));
+#endif /* ?STRICT_ALIGN */
+    for (i = numBlocks; i > 0; i--) {
+      for (k = 0; k < 128; k++) {
+	*((word32*) block    ) = *((word32*)iv[0]);
+	*((word32*)(block+ 4)) = *((word32*)iv[1]);
+	*((word32*)(block+ 8)) = *((word32*)iv[2]);
+	*((word32*)(block+12)) = *((word32*)iv[3]);
+	rijndaelEncrypt(block, block, key->keySched, key->ROUNDS);
+	outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7);
+	iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7);
+	iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7);
+	iv[0][2] = (iv[0][2] << 1) | (iv[0][3] >> 7);
+	iv[0][3] = (iv[0][3] << 1) | (iv[1][0] >> 7);
+	iv[1][0] = (iv[1][0] << 1) | (iv[1][1] >> 7);
+	iv[1][1] = (iv[1][1] << 1) | (iv[1][2] >> 7);
+	iv[1][2] = (iv[1][2] << 1) | (iv[1][3] >> 7);
+	iv[1][3] = (iv[1][3] << 1) | (iv[2][0] >> 7);
+	iv[2][0] = (iv[2][0] << 1) | (iv[2][1] >> 7);
+	iv[2][1] = (iv[2][1] << 1) | (iv[2][2] >> 7);
+	iv[2][2] = (iv[2][2] << 1) | (iv[2][3] >> 7);
+	iv[2][3] = (iv[2][3] << 1) | (iv[3][0] >> 7);
+	iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7);
+	iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7);
+	iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7);
+	iv[3][3] = (iv[3][3] << 1) | ((outBuffer[k/8] >> (7-(k&7))) & 1);
+      }
+    }
+    break;
+    
+  default:
+    return BAD_CIPHER_STATE;
+  }
+  
+  return 128*numBlocks;
 }
 
-int
-rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
-    const BYTE *input, int inputLen, BYTE *outBuffer)
-{
-	int i, k, t, numBlocks;
-	u8 block[16], *iv;
-
-	if (cipher == NULL ||
-		key == NULL ||
-		key->direction == DIR_DECRYPT) {
-		return BAD_CIPHER_STATE;
-	}
-	if (input == NULL || inputLen <= 0) {
-		return 0; /* nothing to do */
-	}
-
-	numBlocks = inputLen/128;
-
-	switch (cipher->mode) {
-	case MODE_ECB:
-		for (i = numBlocks; i > 0; i--) {
-			rijndaelEncrypt(key->rk, key->Nr, input, outBuffer);
-			input += 16;
-			outBuffer += 16;
-		}
-		break;
-
-	case MODE_CBC:
-		iv = (u8 *)cipher->IV;
-		for (i = numBlocks; i > 0; i--) {
-			xor16(block, input, iv);
-			rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
-			iv = outBuffer;
-			input += 16;
-			outBuffer += 16;
-		}
-		break;
-
-	case MODE_CFB1:
-		iv = (u8 *)cipher->IV;
-		for (i = numBlocks; i > 0; i--) {
-			memcpy(outBuffer, input, 16);
-			for (k = 0; k < 128; k++) {
-				rijndaelEncrypt(key->ek, key->Nr, iv, block);
-				outBuffer[k >> 3] ^=
-				    (block[0] & 0x80U) >> (k & 7);
-				for (t = 0; t < 15; t++) {
-					iv[t] = (iv[t] << 1) | (iv[t + 1] >> 7);
-				}
-				iv[15] = (iv[15] << 1) |
-				    ((outBuffer[k >> 3] >> (7 - (k & 7))) & 1);
-			}
-			outBuffer += 16;
-			input += 16;
-		}
-		break;
-
-	default:
-		return BAD_CIPHER_STATE;
-	}
-
-	return 128 * numBlocks;
+int blockDecrypt(cipherInstance *cipher, keyInstance *key,
+		 RIJ_BYTE *input, int inputLen, RIJ_BYTE *outBuffer) {
+  int i, k, numBlocks;
+  word8 block[16], iv[4][4];
+  
+  if (cipher == NULL ||
+      key == NULL ||
+      ((cipher->mode != MODE_CFB1) && (key->direction == DIR_ENCRYPT))) {
+    return BAD_CIPHER_STATE;
+  }
+  if (input == NULL || inputLen <= 0) {
+    return 0; /* nothing to do */
+  }
+  
+  numBlocks = inputLen/128;
+  
+  switch (cipher->mode) {
+  case MODE_ECB: 
+    for (i = numBlocks; i > 0; i--) { 
+      rijndaelDecrypt(input, outBuffer, key->keySched, key->ROUNDS);
+      input += 16;
+      outBuffer += 16;
+    }
+    break;
+    
+  case MODE_CBC:
+#if STRICT_ALIGN 
+    memcpy(iv, cipher->IV, 16); 
+#else
+    *((word32*)iv[0]) = *((word32*)(cipher->IV   ));
+    *((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
+    *((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
+    *((word32*)iv[3]) = *((word32*)(cipher->IV+12));
+#endif
+    for (i = numBlocks; i > 0; i--) {
+      rijndaelDecrypt(input, block, key->keySched, key->ROUNDS);
+      ((word32*)block)[0] ^= *((word32*)iv[0]);
+      ((word32*)block)[1] ^= *((word32*)iv[1]);
+      ((word32*)block)[2] ^= *((word32*)iv[2]);
+      ((word32*)block)[3] ^= *((word32*)iv[3]);
+#if STRICT_ALIGN
+      memcpy(iv, input, 16);
+      memcpy(outBuffer, block, 16);
+#else
+      *((word32*)iv[0]) = ((word32*)input)[0]; ((word32*)outBuffer)[0] = ((word32*)block)[0];
+      *((word32*)iv[1]) = ((word32*)input)[1]; ((word32*)outBuffer)[1] = ((word32*)block)[1];
+      *((word32*)iv[2]) = ((word32*)input)[2]; ((word32*)outBuffer)[2] = ((word32*)block)[2];
+      *((word32*)iv[3]) = ((word32*)input)[3]; ((word32*)outBuffer)[3] = ((word32*)block)[3];
+#endif
+      input += 16;
+      outBuffer += 16;
+    }
+    break;
+    
+  case MODE_CFB1:
+#if STRICT_ALIGN 
+    memcpy(iv, cipher->IV, 16); 
+#else
+    *((word32*)iv[0]) = *((word32*)(cipher->IV));
+    *((word32*)iv[1]) = *((word32*)(cipher->IV+ 4));
+    *((word32*)iv[2]) = *((word32*)(cipher->IV+ 8));
+    *((word32*)iv[3]) = *((word32*)(cipher->IV+12));
+#endif
+    for (i = numBlocks; i > 0; i--) {
+      for (k = 0; k < 128; k++) {
+	*((word32*) block    ) = *((word32*)iv[0]);
+	*((word32*)(block+ 4)) = *((word32*)iv[1]);
+	*((word32*)(block+ 8)) = *((word32*)iv[2]);
+	*((word32*)(block+12)) = *((word32*)iv[3]);
+	rijndaelEncrypt(block, block, key->keySched, key->ROUNDS);
+	iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7);
+	iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7);
+	iv[0][2] = (iv[0][2] << 1) | (iv[0][3] >> 7);
+	iv[0][3] = (iv[0][3] << 1) | (iv[1][0] >> 7);
+	iv[1][0] = (iv[1][0] << 1) | (iv[1][1] >> 7);
+	iv[1][1] = (iv[1][1] << 1) | (iv[1][2] >> 7);
+	iv[1][2] = (iv[1][2] << 1) | (iv[1][3] >> 7);
+	iv[1][3] = (iv[1][3] << 1) | (iv[2][0] >> 7);
+	iv[2][0] = (iv[2][0] << 1) | (iv[2][1] >> 7);
+	iv[2][1] = (iv[2][1] << 1) | (iv[2][2] >> 7);
+	iv[2][2] = (iv[2][2] << 1) | (iv[2][3] >> 7);
+	iv[2][3] = (iv[2][3] << 1) | (iv[3][0] >> 7);
+	iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7);
+	iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7);
+	iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7);
+	iv[3][3] = (iv[3][3] << 1) | ((input[k/8] >> (7-(k&7))) & 1);
+	outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7);
+      }
+    }
+    break;
+    
+  default:
+    return BAD_CIPHER_STATE;
+  }
+  
+  return 128*numBlocks;
 }
 
-/**
- * Encrypt data partitioned in octets, using RFC 2040-like padding.
- *
- * @param   input           data to be encrypted (octet sequence)
- * @param   inputOctets		input length in octets (not bits)
- * @param   outBuffer       encrypted output data
- *
- * @return	length in octets (not bits) of the encrypted output buffer.
- */
-int
-rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key,
-    const BYTE *input, int inputOctets, BYTE *outBuffer)
-{
-	int i, numBlocks, padLen;
-	u8 block[16], *iv;
-
-	if (cipher == NULL ||
-		key == NULL ||
-		key->direction == DIR_DECRYPT) {
-		return BAD_CIPHER_STATE;
-	}
-	if (input == NULL || inputOctets <= 0) {
-		return 0; /* nothing to do */
-	}
-
-	numBlocks = inputOctets / 16;
-
-	switch (cipher->mode) {
-	case MODE_ECB:
-		for (i = numBlocks; i > 0; i--) {
-			rijndaelEncrypt(key->rk, key->Nr, input, outBuffer);
-			input += 16;
-			outBuffer += 16;
-		}
-		padLen = 16 - (inputOctets - 16*numBlocks);
-		memcpy(block, input, 16 - padLen);
-		memset(block + 16 - padLen, padLen, padLen);
-		rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
-		break;
-
-	case MODE_CBC:
-		iv = (u8 *)cipher->IV;
-		for (i = numBlocks; i > 0; i--) {
-			xor16(block, input, iv);
-			rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
-			iv = outBuffer;
-			input += 16;
-			outBuffer += 16;
-		}
-		padLen = 16 - (inputOctets - 16*numBlocks);
-		for (i = 0; i < 16 - padLen; i++) {
-			block[i] = input[i] ^ iv[i];
-		}
-		for (i = 16 - padLen; i < 16; i++) {
-			block[i] = (BYTE)padLen ^ iv[i];
-		}
-		rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
-		break;
-
-	default:
-		return BAD_CIPHER_STATE;
-	}
-
-	return 16 * (numBlocks + 1);
-}
-
-int
-rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key,
-    const BYTE *input, int inputLen, BYTE *outBuffer)
-{
-	int i, k, t, numBlocks;
-	u8 block[16], *iv;
-
-	if (cipher == NULL ||
-		key == NULL ||
-		(cipher->mode != MODE_CFB1 && key->direction == DIR_ENCRYPT)) {
-		return BAD_CIPHER_STATE;
-	}
-	if (input == NULL || inputLen <= 0) {
-		return 0; /* nothing to do */
-	}
-
-	numBlocks = inputLen/128;
-
-	switch (cipher->mode) {
-	case MODE_ECB:
-		for (i = numBlocks; i > 0; i--) {
-			rijndaelDecrypt(key->rk, key->Nr, input, outBuffer);
-			input += 16;
-			outBuffer += 16;
-		}
-		break;
-
-	case MODE_CBC:
-		iv = (u8 *)cipher->IV;
-		for (i = numBlocks; i > 0; i--) {
-			rijndaelDecrypt(key->rk, key->Nr, input, block);
-			xor16(block, block, iv);
-			if (numBlocks > 1)
-			  memcpy(cipher->IV, input, 16);
-			memcpy(outBuffer, block, 16);
-			input += 16;
-			outBuffer += 16;
-		}
-		break;
-
-    case MODE_CFB1:
-		iv = (u8 *)cipher->IV;
-		for (i = numBlocks; i > 0; i--) {
-			memcpy(outBuffer, input, 16);
-			for (k = 0; k < 128; k++) {
-				rijndaelEncrypt(key->ek, key->Nr, iv, block);
-				for (t = 0; t < 15; t++) {
-					iv[t] = (iv[t] << 1) | (iv[t + 1] >> 7);
-				}
-				iv[15] = (iv[15] << 1) |
-				    ((input[k >> 3] >> (7 - (k & 7))) & 1);
-				outBuffer[k >> 3] ^= (block[0] & 0x80U) >>
-				    (k & 7);
-			}
-			outBuffer += 16;
-			input += 16;
-		}
-		break;
-
-	default:
-		return BAD_CIPHER_STATE;
-	}
-
-	return 128 * numBlocks;
-}
-
-int
-rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
-    const BYTE *input, int inputOctets, BYTE *outBuffer)
-{
-	int i, numBlocks, padLen;
-	u8 block[16], *iv;
-
-	if (cipher == NULL ||
-		key == NULL ||
-		key->direction == DIR_ENCRYPT) {
-		return BAD_CIPHER_STATE;
-	}
-	if (input == NULL || inputOctets <= 0) {
-		return 0; /* nothing to do */
-	}
-	if (inputOctets % 16 != 0) {
-		return BAD_DATA;
-	}
-
-	numBlocks = inputOctets/16;
-
-	switch (cipher->mode) {
-	case MODE_ECB:
-		/* all blocks but last */
-		for (i = numBlocks - 1; i > 0; i--) {
-			rijndaelDecrypt(key->rk, key->Nr, input, outBuffer);
-			input += 16;
-			outBuffer += 16;
-		}
-		/* last block */
-		rijndaelDecrypt(key->rk, key->Nr, input, block);
-		padLen = block[15];
-		if (padLen >= 16) {
-			return BAD_DATA;
-		}
-		for (i = 16 - padLen; i < 16; i++) {
-			if (block[i] != padLen) {
-				return BAD_DATA;
-			}
-		}
-		memcpy(outBuffer, block, 16 - padLen);
-		break;
-
-	case MODE_CBC:
-		iv = (u8 *)cipher->IV;
-		/* all blocks but last */
-		for (i = numBlocks - 1; i > 0; i--) {
-			rijndaelDecrypt(key->rk, key->Nr, input, block);
-			xor16(block, block, iv);
-			memcpy(cipher->IV, input, 16);
-			memcpy(outBuffer, block, 16);
-			input += 16;
-			outBuffer += 16;
-		}
-		/* last block */
-		rijndaelDecrypt(key->rk, key->Nr, input, block);
-		xor16(block, block, iv);
-		padLen = block[15];
-		if (padLen <= 0 || padLen > 16) {
-			return BAD_DATA;
-		}
-		for (i = 16 - padLen; i < 16; i++) {
-			if (block[i] != padLen) {
-				return BAD_DATA;
-			}
-		}
-		memcpy(outBuffer, block, 16 - padLen);
-		break;
-
-	default:
-		return BAD_CIPHER_STATE;
-	}
-
-	return 16 * numBlocks - padLen;
-}
-
 #endif
Index: trunk/src/samhain.c
===================================================================
--- trunk/src/samhain.c	(revision 591)
+++ trunk/src/samhain.c	(revision 1)
@@ -34,8 +34,15 @@
 #include <errno.h>
 
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
 
 #ifdef HAVE_MEMORY_H
@@ -56,21 +63,18 @@
 
 #include "samhain.h"
-#include "sh_pthread.h"
+#include "sh_files.h"
 #include "sh_utils.h"
 #include "sh_error.h"
 #include "sh_unix.h"
-#include "sh_files.h"
 #include "sh_getopt.h"
 #include "sh_readconf.h"
 #include "sh_hash.h"
-#include "sh_dbIO.h"
-#include "sh_restrict.h"
-
-#include "sh_nmail.h"
+
+#include "sh_mail.h"
 
 #include "sh_tiger.h"
-#include "sh_sig.h"
+#include "sh_gpg.h"
 #include "sh_mem.h"
-#include "sh_xfer.h"
+#include "sh_forward.h"
 #include "sh_tools.h"
 #include "sh_hash.h"
@@ -82,5 +86,4 @@
 #include "sh_ignore.h"
 #include "sh_prelink.h"
-#include "sh_sem.h"
 #endif
 
@@ -110,12 +113,8 @@
 volatile  int      sh_global_suspend_flag;
 volatile  int      sig_fresh_trail;        /* SIGIOT  */
-volatile  int      sh_thread_pause_flag = S_FALSE;
 volatile  int      sig_config_read_again;  /* SIGHUP  */
 volatile  int      sig_terminate;          /* SIGQUIT */
 volatile  int      sig_termfast;           /* SIGTERM */
 volatile  int      sig_force_check;        /* SIGTTOU */
-volatile  int      sig_force_silent;       /* SIGTSTP */
-volatile  int      sh_global_check_silent;
-volatile  int      sh_load_delta_flag;
 long int           eintr__result;
 char               sh_sig_msg[SH_MINIBUF];
@@ -138,60 +137,4 @@
 #endif
 
-#ifdef HAVE_PTHREAD
-struct gt {
-  size_t g_count;
-  char * g_glob;
-};
-
-pthread_key_t g_key;
-
-int sh_g_thread()
-{
-  struct gt * ptr = calloc(1,sizeof(struct gt));
-  if (!ptr)
-    return -1;
-  ptr->g_count    = 0;
-  ptr->g_glob     = calloc(1, SH_MAX_GLOBS * (GLOB_LEN+1));
-  if (!(ptr->g_glob))
-    {
-      free(ptr);
-      return -1;
-    }
-  return pthread_setspecific(g_key, ptr);
-}
-
-void sh_g_destroy(void * data)
-{
-  struct gt * ptr = (struct gt *) data;
-  free(ptr->g_glob);
-  free(ptr);
-  return;
-}
-
-void sh_g_init(void)
-{
-#if !defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK)
-  extern int dnmalloc_pthread_init(void);
-  dnmalloc_pthread_init();
-#endif
-
-  if (0 != pthread_key_create(&g_key, sh_g_destroy))
-    {
-      perror("1");
-      exit(EXIT_FAILURE);
-    }
-
-  if (0 != sh_g_thread())
-    {
-      perror("2");
-      exit(EXIT_FAILURE);
-    }
-  return;
-}
-#define SH_G_INIT sh_g_init()
-#else
-#define SH_G_INIT ((void)0)
-#endif
-
 char * globber(const char * str)
 {
@@ -199,24 +142,14 @@
   size_t j;
 
-#ifndef HAVE_PTHREAD
+  static   size_t  items = 0;
   static   size_t  count = 0;
   static   char glob[SH_MAX_GLOBS * (GLOB_LEN+1)];
-#else
-  struct gt * ptr = pthread_getspecific(g_key);
-  size_t count;
-  char *  glob;
-
-  if (ptr) {
-    count = ptr->g_count;
-    glob  = ptr->g_glob;
-  } else {
+
+  if (str == NULL)
     return NULL;
-  }
-#endif
-
-  if (str != NULL)
+  else
     j = strlen(str);
-  else
-    return NULL;
+
+  ++items;
 
   ASSERT((j <= GLOB_LEN), _("j <= GLOB_LEN"))
@@ -230,4 +163,5 @@
     {
       count = 0;
+      items = 0;
     }
 
@@ -242,9 +176,5 @@
 
   i     = count;
-#ifdef HAVE_PTHREAD
-  ptr->g_count = count + j + 1;
-#else
   count = count + j + 1;
-#endif
   return &glob[i];
 }
@@ -263,7 +193,4 @@
 }
 
-#else
-/* not stealth */
-#define SH_G_INIT ((void)0)
 #endif
 
@@ -311,7 +238,4 @@
   ErrFlag[0] |= (1 << 11);
 #endif
-
-  sh.delayload = 0;
-
 #ifdef MKA_13
   ErrFlag[0] |= (1 << 12);
@@ -338,12 +262,5 @@
   sig_termfast           = 0;           /* SIGTERM */
   sig_force_check        = 0;           /* SIGTTOU */
-  sig_force_silent       = 0;           /* SIGTSTP */
-  sh_global_check_silent = 0;
-  sh_load_delta_flag     = 0;
-  sh_sig_msg[4] = '\0';
-  sh_sig_msg[3] = 'e';
-  sh_sig_msg[2] = 'n';
-  sh_sig_msg[1] = 'o';
-  sh_sig_msg[0] = 'N';
+  strcpy ( sh_sig_msg, _("None"));
 
 #ifdef MKB_01
@@ -380,8 +297,4 @@
 #endif
 
-  sh.pid = (UINT64) getpid();
-
-  sh.outpath = NULL;
-
   /* The flags.
    */
@@ -390,5 +303,4 @@
   sh.flag.update          = S_FALSE;
   sh.flag.opts            = S_FALSE;
-  sh.flag.started         = S_FALSE;
   if (is_samhainctl_init == S_FALSE)
     sh.flag.isdaemon        = S_FALSE;
@@ -406,5 +318,4 @@
   sh.flag.hidefile        = S_FALSE;
   sh.flag.loop            = S_FALSE;
-  sh.flag.inotify         = 0;
 
 #ifdef MKB_09
@@ -435,10 +346,6 @@
   /* The stats.
    */
-  sh.statistics.bytes_speed   = 0;
-  sh.statistics.bytes_hashed  = 0;
-  sh.statistics.files_report  = 0;
-  sh.statistics.files_error   = 0;
-  sh.statistics.files_nodir   = 0;
-
+  sh.statistics.bytes_speed  = 0;
+  sh.statistics.bytes_hashed = 0;
   sh.statistics.mail_success = 0;
   sh.statistics.mail_failed  = 0;
@@ -475,5 +382,5 @@
    */
   (void) sl_strlcpy (sh.host.name,  _("localhost"),  SH_MINIBUF);
-  sh.host.system[0]     = '\0'; /* flawfinder: ignore *//* ff bug */
+  sh.host.system[0]     = '\0';
   sh.host.release[0]    = '\0';
   sh.host.machine[0]    = '\0';
@@ -541,26 +448,14 @@
    */
 #if defined(SH_WITH_MAIL)
-  if (0 != strcmp (DEFAULT_MAILADDRESS, _("NULL")))
-    {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-      char * saveptr;
-      (void) sl_strncpy(q, DEFAULT_MAILADDRESS, SH_PATHBUF);
-      p = strtok_r (q, ", \t", &saveptr);
-      if (p)
-	{
-	  (void) sh_nmail_add_compiled_recipient (p);
-	  while (NULL != (p = strtok_r (NULL, ", \t", &saveptr)))
-	    (void) sh_nmail_add_compiled_recipient (p);
-	}
-#else
+  if (0 == strcmp (DEFAULT_MAILADDRESS, _("NULL")))
+    {
       (void) sl_strncpy(q, DEFAULT_MAILADDRESS, SH_PATHBUF);
       p = strtok (q, ", \t");
       if (p)
 	{
-	  (void) sh_nmail_add_compiled_recipient (p);
+	  (void) sh_mail_setaddress_int (p);
 	  while (NULL != (p = strtok (NULL, ", \t")))
-	    (void) sh_nmail_add_compiled_recipient (p);
-	}
-#endif
+	    (void) sh_mail_setaddress_int (p);
+	}
     }
 #endif
@@ -647,54 +542,48 @@
   sh.looptime     = 60;
 
-#ifdef SCREW_IT_UP
-  sh.sigtrap_max_duration = 500000; /* 500ms */
-#endif
-
   /* The struct to hold privileged information.
    */
-  skey = calloc(1,sizeof(sh_key_t));
-  if (skey != NULL)
-    {
-
-      skey->mlock_failed = S_FALSE;
-      skey->rngI         = BAD;
-      /* properly initialized later 
-       */
-      skey->rng0[0] = 0x03; skey->rng0[1] = 0x09; skey->rng0[2] = 0x17;
-      skey->rng1[0] = 0x03; skey->rng1[1] = 0x09; skey->rng1[2] = 0x17;
-      skey->rng2[0] = 0x03; skey->rng2[1] = 0x09; skey->rng2[2] = 0x17;
-      
-      for (i = 0; i < KEY_BYT; ++i)
-	skey->poolv[i] = '\0';
-      
-      skey->poolc        = 0;
-      
-      skey->ErrFlag[0]   = ErrFlag[0];
-      ErrFlag[0]         = 0;
-      skey->ErrFlag[1]   = ErrFlag[1];
-      ErrFlag[1]         = 0;
-      
-      dez = &(TcpFlag[POS_TF-1][0]);
-      for (i = 0; i < PW_LEN; ++i)
-	{ 
-	  skey->pw[i] = (char) (*dez); 
-	  (*dez)      = '\0';
-	  ++dez; 
-	}
-      
-      skey->sh_sockpass[0]  = '\0';
-      skey->sigkey_old[0]   = '\0';
-      skey->sigkey_new[0]   = '\0';
-      skey->mailkey_old[0]  = '\0';
-      skey->mailkey_new[0]  = '\0';
-      skey->crypt[0]        = '\0'; /* flawfinder: ignore *//* ff bug */
-      skey->session[0]      = '\0';
-      skey->vernam[0]       = '\0';
-    }
-  else
+  skey = (sh_key_t *) malloc (sizeof(sh_key_t));
+  if (skey == NULL) 
     {
       perror(_("sh_init"));
       _exit (EXIT_FAILURE);
     }
+
+  skey->mlock_failed = SL_FALSE;
+  skey->rngI         = BAD;
+  /* properly initialized later 
+   */
+  skey->rng0[0] = 0x03; skey->rng0[1] = 0x09; skey->rng0[2] = 0x17;
+  skey->rng1[0] = 0x03; skey->rng1[1] = 0x09; skey->rng1[2] = 0x17;
+  skey->rng2[0] = 0x03; skey->rng2[1] = 0x09; skey->rng2[2] = 0x17;
+
+  for (i = 0; i < KEY_BYT; ++i)
+    skey->poolv[i] = '\0';
+
+  skey->poolc        = 0;
+
+  skey->ErrFlag[0]   = ErrFlag[0];
+  ErrFlag[0]         = 0;
+  skey->ErrFlag[1]   = ErrFlag[1];
+  ErrFlag[1]         = 0;
+
+  dez = &(TcpFlag[POS_TF-1][0]);
+  for (i = 0; i < PW_LEN; ++i)
+    { 
+       skey->pw[i] = (char) (*dez); 
+      (*dez)      = '\0';
+      ++dez; 
+    }
+
+  skey->sh_sockpass[0]  = '\0';
+  skey->sigkey_old[0]   = '\0';
+  skey->sigkey_new[0]   = '\0';
+  skey->mailkey_old[0]  = '\0';
+  skey->mailkey_new[0]  = '\0';
+  skey->crypt[0]        = '\0';
+  skey->session[0]      = '\0';
+  skey->vernam[0]       = '\0';
+
 
   sh_unix_memlock();
@@ -724,7 +613,8 @@
 #endif
 #if defined(SH_WITH_SERVER)
-  extern int sh_socket_remove (void);
-  extern int sh_html_zero();
-#endif
+  extern int sh_socket_remove ();
+#endif
+
+  SL_ENTER(_("exit_handler"));
 
 #if defined(SH_WITH_SERVER)
@@ -735,10 +625,7 @@
   for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
     {
-      if (modList[modnum].initval == SH_MOD_ACTIVE)
+      if (modList[modnum].initval == GOOD)
 	(void) modList[modnum].mod_cleanup();
     }
-#ifdef HAVE_PTHREAD
-  sh_pthread_cancel_all();
-#endif
 #endif
 
@@ -748,5 +635,5 @@
   if (sh.mailNum.alarm_last > 0) 
     {
-      (void) sh_nmail_flush ();
+      (void) sh_mail_msg (NULL);
     }
 #endif
@@ -755,8 +642,5 @@
    */
 #if defined(SH_WITH_SERVER)
-  /* zero out the status file at exit, such that the status
-   * of client becomes unknown in the beltane interface
-   */
-  sh_html_zero();
+  sh_forward_html_write();
 #endif
 
@@ -767,27 +651,10 @@
   sh_files_deldirstack ();
   sh_files_delfilestack ();
-  sh_files_delglobstack ();
   sh_hash_hashdelete();
-  sh_files_hle_reg (NULL);
-  (void) sh_ignore_clean ();
-  /*
-   * Only flush on exit if running as deamon.
-   * Otherwise we couldn't run another instance
-   * while the deamon is running (would leave the
-   * deamon with flushed ruleset).
-   */
-  if (sh.flag.isdaemon == S_TRUE)
-    {
-      sh_audit_delete_all ();
-    }
 #endif
 #if defined(SH_WITH_SERVER)
-  sh_xfer_free_all ();
-#endif
-#if defined(SH_WITH_MAIL)
-  sh_nmail_free();
+  sh_forward_free_all ();
 #endif
   delete_cache();
-  sh_userid_destroy ();
   sh_mem_stat();
 #endif
@@ -799,19 +666,9 @@
   /* --- Checksum of executable. ---
    */
-  {
-    volatile  int sig_store = sig_termfast;
-
-    sig_termfast = 0;
-    (void) sh_unix_self_check();
-    sig_termfast = sig_store;
-  }
+  (void) sh_unix_self_check();
 
 
   /* --- Exit Message. ---
    */
-  if (sh.flag.exit == EXIT_FAILURE && !strcmp(sh_sig_msg, _("None")))
-    sl_strlcpy(sh_sig_msg, _("exit_failure"), SH_MINIBUF);
-  if (sh.flag.exit == EXIT_SUCCESS && !strcmp(sh_sig_msg, _("None")))
-    sl_strlcpy(sh_sig_msg, _("exit_success"), SH_MINIBUF);
   sh_error_handle ((-1), FIL__, __LINE__, sh.flag.exit, MSG_EXIT_NORMAL, 
 		   sh.prg_name, sh_sig_msg);
@@ -823,14 +680,16 @@
   /* --- Restrict error logging to stderr. ---
    */
+#ifdef WITH_MESSAGE_QUEUE
   close_ipc ();
+#endif
   sh_error_only_stderr (S_TRUE);
 
+
   /* --- Remove lock, delete critical information. ---
    */
   (void) sh_unix_rm_lock_file (sh.srvlog.name);
-  if (sh.flag.isdaemon == S_TRUE)
-    (void) sh_unix_rm_pid_file ();
+  (void) sh_unix_rm_pid_file ();
   if (skey != NULL)
-    memset (skey, 0, sizeof(sh_key_t));
+    memset (skey, (int) '\0', sizeof(sh_key_t));
   
   /* --- Exit. ---
@@ -854,38 +713,26 @@
 #if defined(__linux__) || defined(sun) || defined(__sun) || defined(__sun__)
 #include <dirent.h>
-static pid_t * procdirSamhain (void)
+static pid_t * procdirSamhain ()
 {
-  pid_t        * pidlist;
+  pid_t        * pidlist = malloc(sizeof(pid_t) * 65535);
   struct dirent * d;
   DIR *        dp;
   long         ino;
   struct stat  buf;
-  int          i;
+  int          i = 0;
   pid_t        pid, mypid = getpid();
   char       * tail;
   char         exef[128];
 
+  for (i = 0; i < 65535; ++i) pidlist[i] = 0;
+  i = 0;
+
   if (0 != stat(SH_INSTALL_PATH, &buf))
-    {
-      return NULL;
-    }
+    return NULL;
 
   ino = (long) buf.st_ino;
     
-  if (NULL == (dp = opendir(_("/proc"))))
-    {
-      /* cppcheck-suppress resourceLeak */
-      return NULL;
-    }
-
-  SH_MUTEX_LOCK(mutex_readdir);
-
-  pidlist =  calloc(1, sizeof(pid_t) * 65535);
-  if (!pidlist)
-    goto unlock_and_out;
-
-  for (i = 0; i < 65535; ++i) pidlist[i] = 0;
-
-  i = 0;
+  if (NULL == (dp = opendir("/proc")))
+    return NULL;
   while (NULL != (d = readdir(dp)) && i < 65535)
     {
@@ -908,14 +755,9 @@
 	}
     }
-
- unlock_and_out:
-  ;
-  SH_MUTEX_UNLOCK(mutex_readdir);
-
   closedir(dp);
   return pidlist;
 }
 #else
-static pid_t * procdirSamhain (void)
+static pid_t * procdirSamhain ()
 {
   return NULL;
@@ -966,7 +808,7 @@
   if (!fp)
     { if (errno != ENOENT) perror(_("fopen")); return 0; }
-  if (NULL == fgets(line, sizeof(line), fp))
-    { perror(_("fgets")); (void) sl_fclose(FIL__, __LINE__, fp); return 0; }
-  (void) sl_fclose(FIL__, __LINE__, fp); 
+  if (NULL == fgets(line, 255, fp))
+    { perror(_("fgets")); (void) fclose(fp); return 0; }
+  (void) fclose(fp); 
   p = line; 
   while (*p == ' '  || *p == '\f' || *p == '\n' || 
@@ -1016,17 +858,18 @@
   pid_t       * pidlist;
   int         i;
-#ifdef WCONTINUED
-      int wflags = WNOHANG|WUNTRACED|WCONTINUED;
-#else
-      int wflags = WNOHANG|WUNTRACED;
-#endif
-
-  fullpath = strdup (SH_INSTALL_PATH);
+
+
+  fullpath = malloc(strlen(SH_INSTALL_PATH)+1);
   if (fullpath == NULL)
-    { perror(_("strdup")); exit (1); }
-
-  argp[0]  = strdup (SH_INSTALL_PATH);
+    { perror(_("malloc")); exit (1); }
+  else
+    strcpy(fullpath, SH_INSTALL_PATH);                 /* known to fit  */
+
+  argp[0] = malloc(strlen(SH_INSTALL_PATH)+1);
   if (argp[0] == NULL)
-    { perror(_("strdup")); exit (1); }
+    { perror(_("malloc")); exit (1); }
+  else
+    strcpy(argp[0], SH_INSTALL_PATH);                  /* known to fit  */
+
 
   for (times = 1; times < 32; ++times)  argp[times] = NULL;
@@ -1036,7 +879,9 @@
   for (times = 2; times < res; ++times)  
     {
-      argp[times-1] = strdup (argv[times]);
+      argp[times-1] = malloc(strlen(argv[times])+1);
       if (argp[times-1] == NULL)
-	{ perror(_("strdup")); exit (1); }
+	{ perror(_("malloc")); exit (1); }
+      else
+	strcpy(argp[times-1], argv[times]);              /* known to fit  */
     }
 
@@ -1054,9 +899,9 @@
 	exit (1);
       case  0:
-	if (0 != sl_close_fd (FIL__, __LINE__, 0))
+	if (0 != close (0))
 	  {
 	    _exit(4);
 	  }
-	(void) execv(fullpath, argp); /* flawfinder: ignore *//* wtf? */
+	(void) execv(fullpath, argp); 
 	if (errno == EPERM)
 	  _exit(4);
@@ -1066,6 +911,6 @@
       default:
 	times = 0;
-	while (times < 300) {
-	  respid = waitpid(pid, &status, wflags);
+	while (times < 64) {
+	  respid = waitpid(pid, &status, WNOHANG|WUNTRACED);
 	  if ((pid_t)-1 == respid)
 	    {
@@ -1075,5 +920,4 @@
 	  else if (pid == respid)
 	    {
-#ifndef USE_UNO
 	      if (0 != WIFEXITED(status))
 		{
@@ -1083,12 +927,9 @@
 	      else
 		exit (1);
-#else
-	      exit (1);
-#endif
 	    }
 	  ++times;
 	  (void) retry_msleep(1, 0);
 	}
-	exit (0); /* assume that it runs ok */
+	exit (1);
       }
     }
@@ -1100,8 +941,5 @@
       pidlist = procdirSamhain ();
       if (pid == 0 && NULL == pidlist) /* pid file not found */ 
-	{
-	  free(fullpath);
-	  return (0);
-	}
+	return (0);
 	  
       status = 0;
@@ -1118,5 +956,4 @@
 	    }
 	}
-      free(fullpath);
       if (status == 7)
 	return 0;
@@ -1155,5 +992,5 @@
 	}
     }
-  free(fullpath); /* silence smatch false positive */
+
   exit (1); /* no exit handler installed yet */
   /*@notreached@*/
@@ -1185,5 +1022,5 @@
 /* Add a new schedule to the linked list of schedules
  */
-static sh_schedule_t * sh_set_schedule_int (const char * str, 
+static sh_schedule_t * sh_set_schedule_int (char * str, 
 					    sh_schedule_t * FileSchedIn, 
 					    /*@out@*/ int * status)
@@ -1198,5 +1035,5 @@
       FileSchedIn = NULL;
       *status = 0;
-      SL_RETURN(NULL, _("sh_set_schedule_int"));
+      return 0;
     }
 
@@ -1209,7 +1046,5 @@
       SL_RETURN(FileSchedIn , _("sh_set_schedule_int"));
     }
-  else {
-    FileSched->next = FileSchedIn;
-  }
+  FileSched->next = FileSchedIn;
   SL_RETURN(FileSched , _("sh_set_schedule_int"));
 }
@@ -1217,5 +1052,5 @@
 /* Add a new schedule to the linked list FileSchedOne
  */
-int sh_set_schedule_one (const char * str)
+int sh_set_schedule_one (char * str)
 {
   int status;
@@ -1226,5 +1061,5 @@
 /* Add a new schedule to the linked list FileSchedTwo
  */
-int sh_set_schedule_two (const char * str)
+int sh_set_schedule_two (char * str)
 {
   int status;
@@ -1233,285 +1068,4 @@
 }
 
-static int sh_flag_silent = S_FALSE;
-
-int sh_set_silent_full (const char * str)
-{
-  int status = sh_util_flagval(str, &sh_flag_silent);
-  return status;
-}
-
-
-void do_reconf()
-{
-  int status, modnum;
-
-  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_RECONF);
-  
-  sh_thread_pause_flag = S_TRUE;
-
-  for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
-    {
-      if (0 != (SH_MODFL_NEEDPAUSED & modList[modnum].flags) &&
-	  modList[modnum].initval == SH_MOD_THREAD)
-	{
-	  int count = 50;
-	  while (count && 0 == (SH_MODFL_ISPAUSED & modList[modnum].flags))
-	    retry_msleep(0, 100), --count;
-	}
-    }
-  
-#if defined(WITH_EXTERNAL)
-  /* delete list of external tasks
-   */
-  (void) sh_ext_cleanup();
-#endif
-#if defined(SH_WITH_MAIL)
-  sh_nmail_free();
-#endif
-  
-  /* delete the file list, make all database
-   * entries visible (allignore = FALSE)
-   */
-  (void) sh_files_deldirstack ();
-  (void) sh_files_delfilestack ();
-  (void) sh_files_delglobstack ();
-  (void) sh_ignore_clean ();
-  (void) hash_full_tree ();
-  sh_audit_delete_all ();
-  
-  
-#if defined(SH_WITH_CLIENT)
-  reset_count_dev_server();
-#endif
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  sh_restrict_purge ();
-  
-  
-  FileSchedOne = free_sched(FileSchedOne);
-  FileSchedTwo = free_sched(FileSchedTwo);
-  
-  for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
-    {
-      /* sh_thread_pause_flag is true, and we block in lock
-       * until check has returned, so we are sure check will
-       * not run until sh_thread_pause_flag is set to false
-       */
-      /* if (modList[modnum].initval >= SH_MOD_ACTIVE) */
-      (void) modList[modnum].mod_reconf();
-    }
-#endif
-  
-  reset_count_dev_console();
-  reset_count_dev_time();
-  
-  (void) sh_unix_maskreset();
-  
-#ifdef RELOAD_DATABASE
-  sh_hash_hashdelete();
-
-  if (0 != sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))
-    {
-      char hashbuf[KEYBUF_SIZE];
-      (void) sl_strlcpy(sh.data.hash,
-			sh_tiger_hash (file_path('D', 'R'), 
-				       TIGER_FILE, TIGER_NOLIM, 
-				       hashbuf, sizeof(hashbuf)), 
-			KEY_LEN+1);
-    }
-#endif
-  (void) sl_trust_purge_user();
-  (void) sh_files_hle_reg (NULL);
-  (void) sh_prelink_run (NULL, NULL, 0, 0);
-  
-  /* --------------------------
-   * --- READ CONFIGURATION ---
-   * --------------------------
-   */
-  (void) sh_readconf_read ();
-  sig_config_read_again = 0;
-  (void) sh_files_setrec();
-  (void) sh_files_test_setup();
-  sh_audit_commit ();
-  
-  if (0 != sh.flag.nice)
-    {
-#ifdef HAVE_SETPRIORITY
-      setpriority(PRIO_PROCESS, 0, sh.flag.nice);
-#else
-      nice(sh.flag.nice);
-#endif
-    }
-  
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    {
-      sh.flag.isdaemon = S_FALSE;
-      sh.flag.loop     = S_FALSE;
-    }
-  
-  
-  /* --- Initialize modules. ---
-   */
-  TPT((0, FIL__, __LINE__, _("msg=<Initialize modules.>\n")));
-  for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
-    {
-      status = modList[modnum].mod_init(&(modList[modnum]));
-      
-      if (status < 0)
-	{
-	  if (status == (-1)) {
-	    sh_error_handle (SH_ERR_NOTICE, FIL__, __LINE__, 
-			     status, MSG_MOD_FAIL,
-			     _(modList[modnum].name),
-			     status+SH_MOD_OFFSET);
-	  } else {
-	    sh_error_handle ((-1), FIL__, __LINE__, 
-			     status, MSG_MOD_FAIL,
-			     _(modList[modnum].name),
-			     status+SH_MOD_OFFSET);
-	  }
-	  modList[modnum].initval = SH_MOD_FAILED;
-	}
-      else
-	{
-	  sh_error_handle ((-1), FIL__, __LINE__, status, MSG_MOD_OK,
-			   _(modList[modnum].name));
-	  modList[modnum].initval = status;
-	}
-    }
-  
-  /* module is properly set up now
-   */
-  sh_thread_pause_flag = S_FALSE;
-
-  return;
-}
-
-static void check_signals (volatile int *flag_check_1, 
-			   volatile int * flag_check_2)
-{
-  if (sig_raised > 0) 
-    {
-      
-      TPT((0, FIL__, __LINE__, _("msg=<Process a signal.>\n")))
-	
-	if (sig_termfast == 1)  /* SIGTERM */
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-	    --sig_raised; --sig_urgent;
-	    aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-	  }
-      
-      if (sig_force_check == 1) /* SIGTTOU / SIGTSTP */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Check run triggered.>\n")));
-	  *flag_check_1 = 1; *flag_check_2 = 1;
-	  sig_force_check = 0; --sig_raised;
-	  if (sig_force_silent)
-	    {
-	      sig_force_silent       = 0;
-	      sh_global_check_silent = (sh_flag_silent == S_FALSE) ? SH_SILENT_STD : SH_SILENT_FULL;
-	    }
-	  sh_sem_trylock();
-	}
-      
-      if (sig_config_read_again == 1 && /* SIGHUP */
-	  sh_global_suspend_flag == 0)
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Re-read configuration.>\n")));
-	  do_reconf();
-	  --sig_raised;
-	}
-      
-      if (sig_fresh_trail == 1) /* SIGIOT */
-	{
-	  if (sh_global_suspend_flag == 0)
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      
-	      /* Logfile access 
-	       */
-#ifdef SH_USE_XML
-	      (void) sh_log_file (NULL, NULL);
-#endif
-	      TPT((0, FIL__, __LINE__, _("msg=<Logfile stop/restart.>\n")));
-	      sh_error_only_stderr (S_TRUE);
-	      (void) sh_unix_rm_lock_file(sh.srvlog.name);
-	      (void) retry_msleep(3, 0);
-	      sh.flag.log_start = S_TRUE;
-	      sh_error_only_stderr (S_FALSE);
-	      sh_thread_pause_flag = S_FALSE;
-	      sig_fresh_trail       = 0;
-	      --sig_raised;
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	}
-      
-      if (sig_terminate == 1)  /* SIGQUIT */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-	  strncpy (sh_sig_msg, _("Quit"), 20);
-	  --sig_raised;
-	  aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-	}
-	  
-      if (sig_debug_switch == 1)  /* SIGUSR1 */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Debug switch.>\n")));
-	  sh_error_dbg_switch();
-	  sig_debug_switch = 0;
-	  --sig_raised;
-	}
-	  
-      if (sig_suspend_switch > 0)  /* SIGUSR2 */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Suspend switch.>\n")));
-	  if (sh_global_suspend_flag != 1) {
-	    SH_MUTEX_LOCK_UNSAFE(mutex_thread_nolog);
-	    sh_global_suspend_flag = 1;
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_SUSPEND, 
-			    sh.prg_name);
-	  } else {
-	    sh_global_suspend_flag = 0;
-	    SH_MUTEX_UNLOCK_UNSAFE(mutex_thread_nolog);
-	  }
-	  --sig_suspend_switch;
-	  --sig_raised; --sig_urgent;
-	}
-
-      if (sh_load_delta_flag > 0 &&
-	  sh_global_suspend_flag == 0)  /* DELTA Command */
-	{
-	  if (0 == sh_dbIO_load_delta())
-	    {
-	      --sh_load_delta_flag; --sig_raised;
-	    } 
-	}
-
-      sig_raised = (sig_raised < 0) ? 0 : sig_raised;
-      sig_urgent = (sig_urgent < 0) ? 0 : sig_urgent;
-      TPT((0, FIL__, __LINE__, _("msg=<End signal processing.>\n")));
-    }
-  return;
-}
-
-void check_for_delta_db()
-{
-  /* Need to contact the server.
-   */
-  if (sh_global_check_silent < SH_SILENT_FULL)
-    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_CHECK_2);
-
-  if (sig_raised > 0 && sh_load_delta_flag > 0)  /* DELTA Command */
-    {
-      /* There was a DELTA Command
-       */
-      if (0 == sh_dbIO_load_delta())
-	{
-	  --sh_load_delta_flag; --sig_raised;
-	} 
-    }
-  return;
-}
-
 #endif
 
@@ -1521,15 +1075,11 @@
  *
  *******************************************************/
-#if !defined(SH_CUTEST)
 int main(int argc, char * argv[])
-#else
-int undef_main(int argc, char * argv[])
-#endif
 {
 #if defined(INET_SYSLOG)
-  extern int    sh_xfer_create_syslog_socket (int flag);
+  extern int    create_syslog_socket (int flag);
 #endif
 #if defined(SH_WITH_SERVER)
-  extern int    sh_create_tcp_socket(void);
+  extern int    sh_create_tcp_socket();
 #endif
 
@@ -1539,14 +1089,14 @@
   float         st_1, st_2;
   int           status;
-  volatile long          cct = 0; /* main loop iterations */
-
-  volatile int           flag_check_1 = 0;
-  volatile int           flag_check_2 = 0;
+  long          cct = 0; /* main loop iterations */
+
+  int           flag_check_1 = 0;
+  int           flag_check_2 = 0;
 
   int           check_done   = 0;
 #endif
 
-  volatile time_t        told;
-  volatile time_t        tcurrent;
+  time_t        told;
+  time_t        tcurrent;
   size_t        tzlen;
   char *        tzptr;
@@ -1554,23 +1104,10 @@
 
 #if defined (SH_STEALTH_NOCL)
-  char    command_line[256];
+  char  * command_line;
   int     my_argc = 0;
   char  * my_argv[32];
 #endif
 
-#if !defined(USE_SYSTEM_MALLOC)
-  typedef void assert_handler_tp(const char * error, const char *file, int line);
-  extern assert_handler_tp *dnmalloc_set_handler(assert_handler_tp *new);
-  (void) dnmalloc_set_handler(safe_fatal);
-#endif
-
-  SH_G_INIT; /* Must precede any use of _() */
-
   SL_ENTER(_("main"));
-
-  /* --- Close all but first three file descriptors. ---
-   */
-  sh_unix_closeall(3, -1, S_FALSE); /* at program start */
-
 
   if (argc >= 2 && 0 != getuid() &&
@@ -1673,15 +1210,10 @@
   /* Save the timezone.
    */
-  if (NULL != (tzptr = getenv("TZ"))) /* flawfinder: ignore */
+  if ((tzptr = getenv("TZ")) != NULL)
     {
       tzlen       = strlen(tzptr);
-      if (tzlen < 1024)
-	{
-	  sh.timezone = calloc(1, tzlen + 1);
-	  if (sh.timezone != NULL)
-	    (void) sl_strlcpy (sh.timezone, tzptr, tzlen + 1);
-	}
-      else
-	sh.timezone = NULL;
+       sh.timezone = malloc (tzlen + 1);
+      if (sh.timezone != NULL)
+	 (void) sl_strlcpy (sh.timezone, tzptr, tzlen + 1);
     }
   else
@@ -1691,9 +1223,11 @@
   /* --------  INIT  --------    
    */
-  sh_unix_ign_sigpipe();
 
   /* Restrict error logging to stderr.
    */
   sh_error_only_stderr (S_TRUE);
+
+  BREAKEXIT(sh_derr);
+  (void) sh_derr();
 
   /* Check that first three descriptors are open.
@@ -1714,10 +1248,4 @@
 #endif
 
-  /* --- First check for an attached debugger (after setting
-         sh.sigtrap_max_duration which has to be done before). ---
-   */
-  BREAKEXIT(sh_derr);
-  (void) sh_derr();
-
   /* --- Get local hostname. ---
    */
@@ -1730,6 +1258,4 @@
 
 #if !defined(SH_STEALTH_NOCL)
-  sh_argc_store = argc;
-  sh_argv_store = argv;
   (void) sh_getopt_get (argc, argv);
 #else
@@ -1737,22 +1263,14 @@
       strlen(argv[1]) > 0 && strlen(NOCL_CODE) > 0)
     {
-      if ( 0 == strcmp(argv[1], NOCL_CODE) )
-	{
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-	  char * saveptr;
-#endif
+      if ( 0 == strcmp(argv[1], NOCL_CODE) &&
+	   NULL != (command_line = (char *) SH_ALLOC(256 * sizeof(char))))
+	{
 	  my_argv[0] = argv[0]; ++my_argc;  
 	  command_line[0] = '\0';
-	  if (NULL != fgets (command_line, sizeof(command_line), stdin))
-	    command_line[sizeof(command_line)-1] = '\0';
-
+	  (void*) fgets (command_line, 255, stdin);
+	  command_line[255] = '\0';
 	  do {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
 	    my_argv[my_argc] = 
-	      strtok_r( (my_argc == 1) ? command_line : NULL, " \n", &saveptr);
-#else
-	    my_argv[my_argc] = 
-	      strtok( (my_argc == 1) ? command_line : NULL, " \n");
-#endif 
+	      strtok( (my_argc == 1) ? command_line : NULL, " \n"); 
 	    if (my_argv[my_argc] != NULL) {
 	      ++my_argc;
@@ -1761,9 +1279,6 @@
 	    }
 	  } while (my_argc < 32);
-
-	  sh_argc_store = my_argc;
-	  sh_argv_store = my_argv;
-
 	  (void) sh_getopt_get (my_argc, my_argv);
+	  SH_FREE (command_line);
 	}
       else
@@ -1776,4 +1291,9 @@
   sh.flag.opts = S_FALSE;
   
+
+  /* close all other files
+   */
+  sh_unix_closeall(3, -1); /* after processing CL options */
+
 
   /* --- Get user info. ---
@@ -1797,6 +1317,4 @@
   BREAKEXIT(sh_readconf_read);
   (void) sh_readconf_read ();
-
-  sh_calls_enable_sub();
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
@@ -1832,13 +1350,9 @@
     }
 
-  /* --- load database; checksum of database
-   */
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-  if (0 == sh.delayload)
-    sh_hash_init_and_checksum();
-#endif
-
-  /* --- initialize signal handling etc.; fork daemon
-   */
+  /* initialize signal handling etc
+   */
+  if (sh.flag.isdaemon == S_TRUE)
+    sh_error_only_stderr (BAD);
+
   if (sh_unix_init(sh.flag.isdaemon) == -1) 
     {
@@ -1848,12 +1362,4 @@
     }
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-  if (sh.delayload)
-    {
-      sleep(sh.delayload);
-      sh_hash_init_and_checksum();
-    }
-#endif
-
   /* --- drop privileges eventually ---
    */
@@ -1861,5 +1367,5 @@
   sh_create_tcp_socket ();
 #if defined(INET_SYSLOG)
-  sh_xfer_create_syslog_socket (S_TRUE);
+  create_syslog_socket (S_TRUE);
 #endif
   SL_REQUIRE(sl_policy_get_real(DEFAULT_IDENT) == SL_ENONE, 
@@ -1883,5 +1389,29 @@
    */
 #if defined(INET_SYSLOG) && defined(SH_WITH_SERVER)
-  sh_xfer_create_syslog_socket (S_FALSE);
+  create_syslog_socket (S_FALSE);
+#endif
+
+
+  /* checksum of database
+   */
+#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
+  TPT((0, FIL__, __LINE__, _("msg=<Get checksum of the database.>\n")))
+  if (sh.flag.checkSum == SH_CHECK_CHECK) 
+    {
+      if (0 == sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))
+	{
+	  /* fetch the file from server to get checksum
+	   */
+	  sh_hash_init ();
+	  /* sh_hash_hashdelete (); */
+	}
+      else
+	{
+	  (void) sl_strlcpy(sh.data.hash,
+			    sh_tiger_hash (file_path('D', 'R'), 
+					   TIGER_FILE, 0), 
+			    KEY_LEN+1);
+	}
+    }
 #endif
 
@@ -1890,6 +1420,4 @@
    */
   sh_error_only_stderr (S_FALSE);
-
-  sh.flag.started = S_TRUE;
 
   /****************************************************
@@ -1901,7 +1429,9 @@
 #if defined(SH_WITH_SERVER) && !defined(SH_WITH_CLIENT)
 
-#if defined(WITH_GPG)
-  /* log startup */
-  sh_sig_log_startup ();
+#if (defined(WITH_GPG) || defined(WITH_PGP))
+  /* do nothing -- we exit earlier if error 
+  if (0 != sh_gpg_check_sign (1)) 
+    aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+  */
 #else
   sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H,
@@ -1924,7 +1454,10 @@
   if (sh.flag.checkSum == SH_CHECK_CHECK) 
     {
-#if defined(WITH_GPG)
-      /* log startup */
-      sh_sig_log_startup ();
+#if (defined(WITH_GPG) || defined(WITH_PGP))
+      /* do nothing -- we exit earlier if error 
+	 if (0 != sh_gpg_check_sign (2)) 
+	 aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+      */
+      ;
 #else
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_2H,
@@ -1936,7 +1469,10 @@
   else
     {
-#if defined(WITH_GPG)
-      /* log startup */
-      sh_sig_log_startup ();
+#if (defined(WITH_GPG) || defined(WITH_PGP))
+      /* do nothing -- we exit earlier if error 
+      if (0 != sh_gpg_check_sign (1)) 
+	aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+      */
+      ;
 #else
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H,
@@ -1948,5 +1484,5 @@
 
  
-  if ((skey == NULL) || (skey->mlock_failed == S_TRUE))
+  if ((skey == NULL) || (skey->mlock_failed == SL_TRUE))
     sh_error_handle ((-1), FIL__, __LINE__, EPERM, MSG_MLOCK);
 
@@ -1970,10 +1506,10 @@
   if (sh.flag.isserver == S_TRUE)
     { 
-      sh_xfer_start_server();
+      sh_receive();
       TPT((0, FIL__, __LINE__, _("msg=<End server.>\n")))
       aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
     }
 #else
-  sh_xfer_start_server();
+  sh_receive();
   TPT((0, FIL__, __LINE__, _("msg=<End server.>\n")))
   aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
@@ -1995,6 +1531,5 @@
   for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
     {
-      status = modList[modnum].mod_init(&(modList[modnum]));
-      if ( status < 0 )
+      if (0 != (status = modList[modnum].mod_init()))
 	{
 	  if (status == (-1)) {
@@ -2002,11 +1537,11 @@
 			     MSG_MOD_FAIL,
 			     _(modList[modnum].name),
-			     status+SH_MOD_OFFSET);
+			     status);
 	  } else {
 	    sh_error_handle ((-1), FIL__, __LINE__, status, MSG_MOD_FAIL,
 			     _(modList[modnum].name),
-			     status+SH_MOD_OFFSET);
+			     status);
 	  }
-	  modList[modnum].initval = SH_MOD_FAILED;
+	  modList[modnum].initval = S_FALSE;
 	}
       else
@@ -2014,5 +1549,5 @@
 	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MOD_OK,
 			   _(modList[modnum].name));
-	  modList[modnum].initval = status;
+	  modList[modnum].initval = S_TRUE;
 	}
     }
@@ -2022,5 +1557,5 @@
   (void) sh_files_setrec();
   (void) sh_files_test_setup();
-  sh_audit_commit ();
+
 
   /* --------  NICE LEVEL   ---------
@@ -2037,15 +1572,8 @@
     }
 
-  /*  --------  CREATE SEMAPHORE  ---------
-   */
-  sh_sem_open();
-
   /*  --------  MAIN LOOP  ---------
    */
-  sh.statistics.bytes_speed   = 0;
-  sh.statistics.bytes_hashed  = 0;
-  sh.statistics.files_report  = 0;
-  sh.statistics.files_error   = 0;
-  sh.statistics.files_nodir   = 0;
+  sh.statistics.bytes_speed  = 0;
+  sh.statistics.bytes_hashed = 0;
 
   while (1 == 1) 
@@ -2059,16 +1587,192 @@
       tcurrent = time (NULL);
 
-      do {
-	check_signals(&flag_check_1, &flag_check_2);
-	if (sh_global_suspend_flag == 1)
+      if (sig_raised > 0) 
+	{
+
+	  TPT((0, FIL__, __LINE__, _("msg=<Process a signal.>\n")))
+
+	  if (sig_termfast == 1)  /* SIGTERM */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	      /* strncpy (sh_sig_msg, _("SIGTERM"), 20); */
+	      --sig_raised; --sig_urgent;
+	      aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	    }
+
+	  if (sig_force_check == 1) /* SIGTTOU */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Check run triggered.>\n")));
+	      flag_check_1 = 1;
+	      flag_check_2 = 1;
+	      sig_force_check = 0;
+	      --sig_raised; 
+	    }
+	  
+	  if (sig_config_read_again == 1) /* SIGHUP */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Re-read configuration.>\n")))
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_RECONF);
+
+#if defined(WITH_EXTERNAL)
+	      /* delete list of external tasks
+	       */
+	      (void) sh_ext_cleanup();
+#endif
+	      /* delete the file list, make all database
+	       * entries visible (allignore = FALSE)
+	       */
+	      (void) sh_files_deldirstack ();
+	      (void) sh_files_delfilestack ();
+	      (void) sh_ignore_clean ();
+	      (void) hash_full_tree ();
+
+#if defined(SH_WITH_CLIENT)
+	      reset_count_dev_server();
+#endif
+#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
+
+
+	      FileSchedOne = free_sched(FileSchedOne);
+	      FileSchedTwo = free_sched(FileSchedTwo);
+
+	      for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
+		{
+		  if (modList[modnum].initval == GOOD)
+		    (void) modList[modnum].mod_reconf();
+		}
+#endif
+
+#if defined(SH_WITH_MAIL)
+	      reset_count_dev_mail();
+#endif
+	      reset_count_dev_console();
+	      reset_count_dev_time();
+
+	      (void) sh_unix_maskreset();
+ 
+	      /* Should this be included ??? 
+	       * (i.e. should we reload the database ?)
+	       */
+#ifdef RELOAD_DATABASE
+	      sh_hash_hashdelete();
+#endif
+	      (void) sl_trust_purge_user();
+	      (void) sh_files_hle_reg (NULL);
+	      (void) sh_prelink_run (NULL, NULL, 0);
+
+	      /* --------------------------
+	       * --- READ CONFIGURATION ---
+	       * --------------------------
+	       */
+	      (void) sh_readconf_read ();
+	      sig_config_read_again = 0;
+	      (void) sh_files_setrec();
+	      (void) sh_files_test_setup();
+	      if (0 != sh.flag.nice)
+		{
+#ifdef HAVE_SETPRIORITY
+		  setpriority(PRIO_PROCESS, 0, sh.flag.nice);
+#else
+		  nice(sh.flag.nice);
+#endif
+		}
+
+	      if (sh.flag.checkSum == SH_CHECK_INIT)
+		{
+		  sh.flag.isdaemon = S_FALSE;
+		  sh.flag.loop     = S_FALSE;
+		}
+
+	      /* --- Initialize modules. ---
+	       */
+	      TPT((0, FIL__, __LINE__, _("msg=<Initialize modules.>\n")));
+	      for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
+		{
+		  if (0 != (status = modList[modnum].mod_init()))
+		    {
+		      if (status == (-1)) {
+			sh_error_handle (SH_ERR_NOTICE, FIL__, __LINE__, 
+					 status, MSG_MOD_FAIL,
+					 _(modList[modnum].name),
+					 status);
+		      } else {
+			sh_error_handle ((-1), FIL__, __LINE__, 
+					 status, MSG_MOD_FAIL,
+					 _(modList[modnum].name),
+					 status);
+		      }
+		      modList[modnum].initval = S_FALSE;
+		    }
+		  else
+		    {
+		      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MOD_OK,
+				       _(modList[modnum].name));
+		      modList[modnum].initval = S_TRUE;
+		    }
+		}
+	      
+	      --sig_raised;
+	    }
+	  
+	  if (sig_fresh_trail == 1) /* SIGIOT */
+	    {
+	      /* Logfile access 
+	       */
+#ifdef SH_USE_XML
+	      (void) sh_log_file (NULL, NULL);
+#endif
+	      TPT((0, FIL__, __LINE__, _("msg=<Logfile stop/restart.>\n")));
+	      sh_error_only_stderr (S_TRUE);
+	      (void) sh_unix_rm_lock_file(sh.srvlog.name);
+	      (void) retry_msleep(3, 0);
+	      sh.flag.log_start = S_TRUE;
+	      sh_error_only_stderr (S_FALSE);
+	      sig_fresh_trail       = 0;
+	      --sig_raised;
+	    }
+	  
+	  if (sig_terminate == 1)  /* SIGQUIT */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	      strncpy (sh_sig_msg, _("Quit"), 20);
+	      --sig_raised; --sig_urgent;
+	      aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	    }
+	  
+	  if (sig_debug_switch == 1)  /* SIGUSR1 */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Debug switch.>\n")));
+	      sh_error_dbg_switch();
+	      sig_debug_switch = 0;
+	      --sig_raised;
+	    }
+	  
+	  if (sig_suspend_switch == 1)  /* SIGUSR2 */
+	    {
+	      TPT((0, FIL__, __LINE__, _("msg=<Suspend switch.>\n")));
+	      if (sh_global_suspend_flag == 1) {
+		sh_global_suspend_flag = 0;
+	      } else {
+		sh_error_handle((-1), FIL__, __LINE__, 0, MSG_SUSPEND, 
+				sh.prg_name);
+		sh_global_suspend_flag = 1;
+	      }
+	      sig_suspend_switch = 0;
+	      --sig_raised; --sig_urgent;
+	    }
+	  sig_raised = (sig_raised < 0) ? 0 : sig_raised;
+	  sig_urgent = (sig_urgent < 0) ? 0 : sig_urgent;
+	  TPT((0, FIL__, __LINE__, _("msg=<End signal processing.>\n")));
+	}
+      
+      if (sh_global_suspend_flag == 1)
+	{
 	  (void) retry_msleep (1, 0);
-      } while (sh_global_suspend_flag == 1);
+	  continue;
+	}
       
       /* see whether its time to check files
        */
-      if      (sh.flag.checkSum == SH_CHECK_INIT ||
-	       (sh.flag.inotify & SH_INOTIFY_DOSCAN) != 0 ||
-	       (sh.flag.checkSum == SH_CHECK_CHECK &&
-		(sh.flag.isdaemon == S_FALSE && sh.flag.loop == S_FALSE)))
+      if      (sh.flag.checkSum == SH_CHECK_INIT)
 	{
 	  flag_check_1 = 1;
@@ -2103,17 +1807,4 @@
 	  (flag_check_1 == 1 || flag_check_2 == 1))
 	{
-	  sh_sem_trylock();
-
-	  /* Starting a check now, so make sure to fetch delta DB
-	   * if there is one to download.
-	   */
-	  check_for_delta_db();
-
-	  SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_INSCAN; );
-	  /* Refresh list files matching glob patterns.
-	   */
-	  if (sh.flag.checkSum != SH_CHECK_INIT)
-	    sh_files_check_globPatterns();
-
 	  /* 
 	   * check directories and files
@@ -2124,7 +1815,4 @@
 	  sh.statistics.dirs_checked   = 0;
 	  sh.statistics.files_checked  = 0;
-	  sh.statistics.files_report   = 0;
-	  sh.statistics.files_error    = 0;
-	  sh.statistics.files_nodir    = 0;
 
 	  TPT((0, FIL__, __LINE__, _("msg=<Check directories.>\n")))
@@ -2134,5 +1822,5 @@
 	      (void) sh_dirs_chk  (1);
 #ifndef SH_PROFILE
-	      (void) retry_aud_chdir (FIL__, __LINE__, "/");
+	      (void) chdir ("/");
 #endif
 	    }
@@ -2141,5 +1829,5 @@
 	      (void) sh_dirs_chk  (2); 
 #ifndef SH_PROFILE
-	      (void) retry_aud_chdir (FIL__, __LINE__, "/");
+	      (void) chdir ("/");
 #endif
 	    }
@@ -2149,5 +1837,7 @@
 	    (void) sh_files_chk ();
 
-	  if (sig_urgent > 0) { sh_sem_unlock(sh.statistics.files_report); sh_global_check_silent = 0; continue; }
+	  if (sig_urgent > 0)
+	    continue;
+
 	  /*
 	   * check for files not visited
@@ -2159,5 +1849,6 @@
 	    }
 
-	  if (sig_urgent > 0) { sh_sem_unlock(sh.statistics.files_report); sh_global_check_silent = 0; continue; }
+	  if (sig_urgent > 0)
+	    continue;
 
 	  /* reset
@@ -2165,20 +1856,16 @@
 	  TPT((0, FIL__, __LINE__, _("msg=<Reset status.>\n")))
 	  sh_dirs_reset  ();
-
-	  if (sig_urgent > 0) { sh_sem_unlock(sh.statistics.files_report); sh_global_check_silent = 0; continue; }
+	  if (sig_urgent > 0)
+	    continue;
 
 	  sh_files_reset ();
-	  check_done   = 1;
-
 	  flag_check_1 = 0;
 	  flag_check_2 = 0;
-	  sh_sem_unlock(sh.statistics.files_report);
-
-	  SH_INOTIFY_IFUSED( sh.flag.inotify &= ~SH_INOTIFY_INSCAN; );
-	  SH_INOTIFY_IFUSED( sh.flag.inotify &= ~SH_INOTIFY_DOSCAN; );
-
-	  (void) sh_prelink_run (NULL, NULL, 0, 0);
-
-	  if (sig_urgent > 0) { sh_global_check_silent = 0; continue; }
+	  check_done   = 1;
+
+	  (void) sh_prelink_run (NULL, NULL, 0);
+
+	  if (sig_urgent > 0)
+	    continue;
 
 	  runtim = time(NULL) - sh.statistics.time_start;
@@ -2186,6 +1873,5 @@
 	
 	  if ((sh.statistics.dirs_checked == 0) && 
-	      (sh.statistics.files_checked == 0) &&
-	      (sh_global_check_silent < SH_SILENT_FULL))
+	      (sh.statistics.files_checked == 0))
 	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_CHECK_0);
 
@@ -2205,19 +1891,12 @@
 	      sh.statistics.bytes_speed = (unsigned long) st_1;
 
-	      if (sh_global_check_silent < SH_SILENT_FULL)
-		sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_CHECK_1,
-				 (long) runtim, 
-				 0.001 * st_1);
-
-	      if (sh.flag.checkSum != SH_CHECK_INIT)
-		sh_efile_report();
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_CHECK_1,
+			       (long) runtim, 
+			       0.001 * st_1);
 	    }
-	  
-	  if (0 == sh_global_check_silent)
-	    sh.fileCheck.alarm_last = time (NULL);
-
-	  sh_global_check_silent = 0;
-	  
-	  if (sig_urgent > 0) continue;
+	  sh.fileCheck.alarm_last = time (NULL);
+
+	  if (sig_urgent > 0)
+	    continue;
 
 	  /*
@@ -2226,9 +1905,10 @@
 #if defined(SH_WITH_MAIL)
 	  TPT((0, FIL__, __LINE__, _("msg=<Flush mail queue.>\n")))
-	  (void) sh_nmail_flush ();
+	  (void) sh_mail_msg (NULL);
 #endif
 	}
       
-      if (sig_urgent > 0) continue;
+      if (sig_urgent > 0)
+	continue;
       
       /* execute modules
@@ -2237,9 +1917,9 @@
       for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
 	{
-	  if (modList[modnum].initval == SH_MOD_ACTIVE &&
+	  if (modList[modnum].initval == GOOD &&
 	      0 != modList[modnum].mod_timer(tcurrent))
 	    if (0 != (status = modList[modnum].mod_check()))
 	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_MOD_EXEC,
-			       _(modList[modnum].name), (long) (status+SH_MOD_OFFSET));
+			       _(modList[modnum].name), (long) status);
 	}
       
@@ -2248,5 +1928,5 @@
        */ 
       if      (sh.flag.checkSum == SH_CHECK_INIT)
-	sh_dbIO_data_write (NULL, NULL);
+	sh_hash_pushdata (NULL, NULL);
 
       /* write out database
@@ -2255,34 +1935,12 @@
 	  sh.flag.update == S_TRUE && 
 	  check_done == 1)
-	sh_dbIO_writeout_update ();
-
-      /* no-op unless MEM_LOG is defined in sh_mem.c
-       */
-#ifdef MEM_DEBUG
-      sh_mem_dump ();
-#endif
-
-      {
-	char * stale;
-
-	stale = sl_check_stale();
-	if (stale)
-	  {
-	    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    stale, _("sl_check_stale"));
-	  }
-
-	stale = sl_check_badfd();
-	if (stale)
-	  {
-	    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    stale, _("sl_check_stale"));
-	  }
-      }
+	sh_hash_writeout ();
 
       /* no loop if not daemon
        */
-      if (sh.flag.isdaemon != S_TRUE && sh.flag.loop == S_FALSE) break;
-      if (sig_urgent > 0) continue;
+      if (sh.flag.isdaemon != S_TRUE && sh.flag.loop == S_FALSE)
+	break; 
+      if (sig_urgent > 0)
+	continue;
 
       /* see whether its time to send mail
@@ -2292,9 +1950,10 @@
 	{
 	  TPT((0, FIL__, __LINE__, _("msg=<Flush mail queue.>\n")))
-	  (void) sh_nmail_flush ();
+	  (void) sh_mail_msg (NULL);
 	  sh.mailTime.alarm_last = time (NULL);
 	}
 #endif
-      if (sig_urgent > 0) continue;
+      if (sig_urgent > 0)
+	continue;
             
       /* log the timestamp
@@ -2316,10 +1975,7 @@
       (void) taus_seed();
       
-      if (sig_urgent > 0) continue;
+      if (sig_urgent > 0)
+	continue;
       
-      /* reset cache
-       */
-      sh_userid_destroy();
-
       /* go to sleep
        */
@@ -2343,5 +1999,5 @@
 #if defined(SH_WITH_MAIL)
   if (sh.mailNum.alarm_last > 0) 
-    (void)sh_nmail_flush ();
+    (void)sh_mail_msg (NULL);
 #endif
 
Index: trunk/src/samhain_erase.c
===================================================================
--- trunk/src/samhain_erase.c	(revision 1)
+++ trunk/src/samhain_erase.c	(revision 1)
@@ -0,0 +1,140 @@
+/***************************************************************************
+ *
+ * Purpose:
+ * -------
+ *   Hide loaded kernel modules with names including the string MAGIC_HIDE 
+
+ *
+ * Configuration:
+ * -------------
+ *   If not building within the samhain system, you may remove the 
+ *   line '#include "config.h"' and in the line
+ *   '#define MAGIC_HIDE SH_MAGIC_HIDE', replace SH_MAGIC_HIDE with
+ *   "someString" (in quotes !).
+ */
+
+
+#include "config.h" 
+
+#define MAGIC_HIDE SH_MAGIC_HIDE
+
+/*  #define MAGIC_HIDE "someString"              */
+
+/* define this if you have a modversioned kernel */
+/*  #define MODVERSIONS                           */
+
+/*
+ * Install:
+ * -------
+ *   gcc -Wall -O2 -c samhain_erase.c
+ *   mv samhain_hide.o  /lib/modules/KERNEL_VERSION/misc/
+ *   
+ *   (Replace KERNEL_VERSION with your kernel's version.)
+ *
+ * Usage:
+ * -----
+ *   To load the module:
+ *    insmod samhain_hide (for improved safety: 'sync && insmod samhain_hide')
+ *
+ *   To unload the module 
+ *    rmmod samhain_hide  (for improved safety: 'sync && rmmod samhain_hide')
+ * 
+ * 
+ * Tested on:
+ * ---------
+ *   Linux 2.2
+ *
+ * Copyright:
+ * ---------
+ *   Copyright (C) 2001 Rainer Wichmann (http://la-samhna.de)
+ *
+ * License: 
+ * -------
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License, version 2, as
+ *   published by the Free Software Foundation.
+ *                                                                         
+ *   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.              
+ *
+ ***************************************************************************/
+
+#define __KERNEL__
+#define MODULE
+
+/* The configure options (#defines) for the Kernel
+ */
+#include <linux/config.h>
+
+#ifdef CONFIG_MODVERSIONS
+#include <linux/modversions.h>
+#endif
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/string.h>
+
+#define N_(string) string
+#include "config.h"
+
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("GPL");  
+#endif
+
+#undef  NULL
+#define NULL ((void *)0)
+
+
+int init_module()
+{
+  struct module * ptr;
+  struct module * prev;
+  int             found  = 0;
+
+  ptr  = &(__this_module);
+  prev = &(__this_module);
+
+  /* skip this module to allow 'rmmod'
+   */
+  ptr  = ptr->next;
+
+  while (ptr)
+    {
+      found = 0;
+
+      if (ptr->name && ptr->name[0] != '\0')
+	{
+	  /* printk("%s <%s>\n", ptr->name, SH_MAGIC_HIDE); */
+	  if (NULL != strstr(ptr->name, SH_MAGIC_HIDE))
+	    {
+	      prev->next = ptr->next;
+	      /* printk("-->HIDE\n"); */
+	      found = 1;
+	    }
+	} 
+
+      if (ptr->next)
+	{
+	  if (found == 0)
+	    prev = ptr;
+	  ptr = ptr->next;
+	}
+      else
+	break;
+    }
+
+  return 0;
+}
+
+void cleanup_module()
+{
+	return;
+}
+
+
Index: trunk/src/samhain_hide.c
===================================================================
--- trunk/src/samhain_hide.c	(revision 1)
+++ trunk/src/samhain_hide.c	(revision 1)
@@ -0,0 +1,780 @@
+/***************************************************************************
+ *
+ * Purpose:
+ * -------
+ *   (1) Hide files with the string MAGIC_HIDE in filename,
+ *       where MAGIC_HIDE is defined below. 
+ *       By default,  MAGIC_HIDE is defined as "samhain".
+ *
+ *   (2) Hide all processes, if the executable has the string MAGIC_HIDE 
+ *       in its name.
+ *
+ *
+ * Configuration:
+ * -------------
+ *   If not building within the samhain system, you may remove the 
+ *   line '#include "config.h"' and in the line
+ *   '#define MAGIC_HIDE SH_MAGIC_HIDE', replace SH_MAGIC_HIDE with
+ *   "someString" (in quotes !).
+ */
+
+/* #define _(string) string */
+#include "config.h" 
+
+#undef _
+#define _(string) string
+
+/* define if this is a 2.6 kernel                 */
+/* #define LINUX26                                */
+
+#define MAGIC_HIDE SH_MAGIC_HIDE
+
+/*  #define MAGIC_HIDE "someString"               */
+
+/* define this if you have a modversioned kernel  */
+/*  #define MODVERSIONS                           */
+
+/* the address of the sys_call_table (not exported in 2.5 kernels) */
+#define MAGIC_ADDRESS SH_SYSCALLTABLE
+
+/*
+ * Install:
+ * -------
+ *   gcc -Wall -O2 -c samhain_hide.c
+ *   mv samhain_hide.o  /lib/modules/KERNEL_VERSION/misc/
+ *   
+ *   (Replace KERNEL_VERSION with your kernel's version.)
+ *
+ * Usage:
+ * -----
+ *   To load the module:
+ *    insmod samhain_hide (for improved safety: 'sync && insmod samhain_hide')
+ *
+ *   To unload the module 
+ *    rmmod samhain_hide  (for improved safety: 'sync && rmmod samhain_hide')
+ * 
+ *
+ * Details:
+ * -------
+ *   The following kernel syscalls are replaced:
+ *     sys_getdents     [hide files/directories/processes (/proc/PID)]
+ * 
+ * Tested on:
+ * ---------
+ *   Linux 2.2, 2.4, 2.6
+ *
+ * Copyright:
+ * ---------
+ *   Copyright (C) 2001, 2002 Rainer Wichmann (http://la-samhna.de)
+ *
+ * License: 
+ * -------
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License, version 2, as
+ *   published by the Free Software Foundation.
+ *                                                                         
+ *   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 defines:
+ *
+ *****************************************************/
+
+/* This is a Linux Loadable Kernel Module.
+ */
+
+#ifndef LINUX26
+#define __KERNEL__
+#define MODULE
+#endif
+#define LINUX
+
+/* Define for debugging.   
+ */
+/* #define HIDE_DEBUG  */   /* query_module */
+/* #define FILE_DEBUG  */   /* getdents     */
+/* #define READ_DEBUG  */   /* read         */
+/* #define PROC_DEBUG  */   /* procfs       */
+
+
+/*****************************************************
+ *
+ *  The include files:
+ *
+ *****************************************************/
+
+
+/* The configure options (#defines) for the Kernel
+ */
+#include <linux/config.h>
+
+#ifndef LINUX26
+#ifdef CONFIG_MODVERSIONS
+#include <linux/modversions.h>
+#endif
+#endif
+
+
+#ifdef LINUX26
+#include <linux/init.h>
+#endif
+
+#include <linux/module.h>
+
+/* File tables structures. If directory caching is used,
+ * <linux/dcache.h> will be included here, and __LINUX_DCACHE_H
+ * will thus be defined.
+ */
+#include <linux/fs.h>
+#include <linux/proc_fs.h>
+
+/* Include the SYS_syscall defines.
+ */
+#ifndef LINUX26
+#include <sys/syscall.h>
+#else
+#define SYS_getdents 141
+#define SYS_getdents64 220
+#endif
+
+
+/* Includes for 'getdents' per the manpage.
+ */
+#include <linux/types.h>
+#include <linux/dirent.h>
+#include <linux/unistd.h>
+
+/* To access userspace memory.
+ */
+#include <asm/uaccess.h>
+
+/* Include for lock_kernel().
+ */
+#include <linux/smp_lock.h>
+
+/* Include for fget().
+ */
+#include <linux/file.h>
+
+/*****************************************************
+ *
+ *  The global variables:
+ *
+ *****************************************************/
+
+/* The kernel syscall table. Not exported anymore in 2.5 ff., and also
+ * not in the RedHat 2.4 kernel.
+ */
+
+#if 0
+extern void * sys_call_table[];
+#define sh_sys_call_table sys_call_table
+#endif
+
+unsigned long * sh_sys_call_table = (unsigned long *) MAGIC_ADDRESS;
+
+/* The old address of the sys_getdents syscall.
+ */
+int (*old_getdents)(unsigned int, struct dirent *, unsigned int);
+#ifdef __NR_getdents64
+long (*old_getdents64)(unsigned int, struct dirent64 *, unsigned int);
+#endif
+
+char hidden[] = MAGIC_HIDE;
+ 
+
+/*****************************************************
+ *
+ *  The functions:
+ *
+ *****************************************************/
+
+
+MODULE_AUTHOR("Rainer Wichmann");
+MODULE_DESCRIPTION("Hide files/processes/modules with MAGIC_HIDE in name.");
+#if defined(MODULE_LICENSE) || defined(LINUX26)
+MODULE_LICENSE("GPL");  
+#endif
+
+#ifdef LINUX26
+/* Default is to hide ourselves.
+ */
+static int removeme = 1;
+
+MODULE_PARM (removeme, "i");
+#endif
+
+
+/* 
+ *  struct task_struct is defined in linux/sched.h
+ *
+ *  as of 2.4.20, the vanilla kernel holds (among others):
+ *        struct task_struct *next_task, *prev_task;
+ *
+ *  Redhat kernel seems to have a different scheduler.
+ *  use:
+ *        struct task_struct * find_task_by_pid (int pid);
+ */
+
+#if defined(SH_VANILLA_KERNEL) && !defined(LINUX26)
+/*
+ * Fetch the task struct for a given PID.
+ */
+struct task_struct * fetch_task_struct (int pid)
+{
+  struct task_struct * task_ptr;
+
+#ifdef PROC_DEBUG
+  printk("FETCH TASK %d\n", pid);
+#endif
+
+  task_ptr = current;
+
+  do 
+    {
+      if (task_ptr->pid == (pid_t) pid )
+	return (task_ptr);
+      task_ptr = task_ptr->next_task;
+    } 
+  while (task_ptr != current);
+
+#ifdef PROC_DEBUG
+  printk("FETCH TASK: NOT FOUND !!!\n");
+#endif
+
+  return (NULL);
+}
+
+#else
+/*
+ *  RedHat 2.4.20 kernel
+ */
+struct task_struct * fetch_task_struct (int pid)
+{
+  struct task_struct * task_ptr = NULL;
+  task_ptr = find_task_by_pid (pid);
+  return (task_ptr);
+}
+#endif
+
+/* Convert a string to an int. 
+ * Does not recognize integers with a sign (+/-) in front.
+ */
+int my_atoi(char * in_str)
+{
+  int i      = 0;
+  int retval = 0;
+  int conv   = 0;
+
+  if (in_str == NULL)
+    return (-1);
+
+  while(in_str[i] != '\0')
+    {
+      /* Break if not numeric.
+       */
+      if (in_str[i] < '0' || in_str[i] > '9')
+	break;
+
+      ++conv;
+      
+      /* Leading zeroes (should not happen in /proc)
+       */
+      if (retval == 0 && in_str[i] == '0')
+	retval = retval;
+      else
+	retval = retval * 10;
+
+      retval = retval + (in_str[i] - '0');
+
+      i++;
+    }
+      
+  if (conv == 0)
+    return (-1);
+  else
+    return (retval); 
+}
+
+/* Purpose:
+ * 
+ *   Hide all files/dirs that include the string MAGIC_HIDE in their
+ *   name. 
+ */
+int new_getdents (unsigned int fd, struct dirent *dirp, unsigned int count)
+{
+  int                  status = 0;    /* Return value from original getdents */
+  struct inode       * dir_inode;
+  int                  dir_is_proc = 0;
+
+  struct dirent      * dirp_prev;
+  struct dirent      * dirp_new;
+  struct dirent      * dirp_current;
+
+  int                  dir_table_bytes;
+  int                  forward_bytes;
+  struct task_struct * task_ptr;
+  int                  hide_it = 0;
+  long                 dirp_offset;
+
+  lock_kernel();
+
+  status = (*old_getdents)(fd, dirp, count);
+
+#ifdef FILE_DEBUG
+  printk("STATUS %d\n", status);
+#endif
+
+  /*  0: end of directory.
+   * -1: some error
+   */
+  if (status <= 0)
+    {
+      unlock_kernel();
+      return (status);
+    }
+
+  /* Handle directory caching. dir_inode is the inode of the directory.
+   */
+#if defined(__LINUX_DCACHE_H)
+  dir_inode  = current->files->fd[fd]->f_dentry->d_inode;
+#else
+  dir_inode  = current->files->fd[fd]->f_inode;
+#endif
+
+  /* Check for the /proc directory
+   */
+  if (dir_inode->i_ino == PROC_ROOT_INO 
+#ifndef LINUX26
+      && !MAJOR(dir_inode->i_dev) && 
+      MINOR(dir_inode->i_dev) == 1
+#endif
+      )
+    dir_is_proc = 1;
+
+  /* Allocate space for new dirent table. Can't use GFP_KERNEL 
+   * (kernel oops)
+   */
+  dirp_new = (struct dirent *) kmalloc (status, GFP_ATOMIC);
+
+  if (dirp_new == NULL)
+    {
+      unlock_kernel();
+      return (status);
+    }
+
+  /* Copy the dirp table to kernel space.
+   */
+  copy_from_user(dirp_new, dirp, status);
+
+#ifdef FILE_DEBUG
+  printk("COPY to kernel\n");
+#endif
+
+  /* Loop over the dirp table to find entries to hide.
+   */
+  dir_table_bytes = status;
+  dirp_current    = dirp_new;
+  dirp_prev       = NULL;
+
+  while (dir_table_bytes > 0)
+    {
+      hide_it = 0;
+
+      if (dirp_current->d_reclen == 0)
+	break;
+
+      dirp_offset = dirp_current->d_off;
+      
+#ifdef FILE_DEBUG
+      printk("DIRENT %d  %d  %ld\n", 
+	     dir_table_bytes,
+	     dirp_current->d_reclen,
+	     dirp_current->d_off);
+#endif
+
+      dir_table_bytes -= dirp_current->d_reclen;
+      forward_bytes    = dirp_current->d_reclen;
+
+#ifdef FILE_DEBUG
+      printk("ENTRY %s\n", dirp_current->d_name);
+#endif
+
+      /* If /proc is scanned (e.g. by 'ps'), hide the entry for
+       * any process where the executable has MAGIC_HIDE in its name.
+       */
+      if (dir_is_proc == 1)
+	{
+	  task_ptr = fetch_task_struct(my_atoi(dirp_current->d_name));
+	  if (task_ptr != NULL)
+	    {
+	      if (strstr(task_ptr->comm, hidden) != NULL)
+		hide_it = 1;
+	    }
+	}
+      /* If it is a regular directory, hide any entry with
+       * MAGIC_HIDE in its name.
+       */
+      else
+	{
+	  if (strstr (dirp_current->d_name, hidden) != NULL)
+	    hide_it = 1;
+	}
+
+      if (hide_it == 1)
+	{
+#ifdef FILE_DEBUG
+	  printk("  -->HIDDEN %s\n", dirp_current->d_name);
+#endif
+	  if (dir_table_bytes > 0)
+	    {
+	      status -= dirp_current->d_reclen;
+	      memmove (dirp_current, 
+		       (char *) dirp_current + dirp_current->d_reclen, 
+		       dir_table_bytes);
+
+	      /* Set forward_bytes to 0, because now dirp_current is the
+	       * (previously) next entry in the dirp table.
+	       */
+	      forward_bytes    = 0;
+	      dirp_prev        = dirp_current;
+	    }
+	  else
+	    {
+	      status -= dirp_current->d_reclen;
+	      if (dirp_prev != NULL)
+		dirp_prev->d_off = dirp_offset;
+	    }
+	  
+	}
+      else
+	{
+	  dirp_prev        = dirp_current;
+	  if (dir_table_bytes == 0 && dirp_prev != NULL)
+	    dirp_prev->d_off = dirp_offset;
+	}
+
+      /* Next entry in dirp table.
+       */
+      if (dir_table_bytes > 0)
+	dirp_current = (struct dirent *) ( (char *) dirp_current + 
+					   forward_bytes);
+    }
+
+  /* Copy our modified dirp table back to user space.
+   */
+  copy_to_user(dirp, dirp_new, status);
+#ifdef FILE_DEBUG
+  printk("COPY to user\n");
+#endif
+
+  kfree (dirp_new);
+#ifdef FILE_DEBUG
+  printk("KFREE\n");
+#endif
+
+  unlock_kernel();
+  return (status);
+}
+
+
+/* For 2.4 kernel
+ */
+#ifdef __NR_getdents64
+long new_getdents64 (unsigned int fd, struct dirent64 *dirp, 
+		     unsigned int count)
+{
+  long                 status = 0;    /* Return value from original getdents */
+  struct inode       * dir_inode;
+  int                  dir_is_proc = 0;
+
+  struct dirent64    * dirp_prev;
+  struct dirent64    * dirp_new;
+  struct dirent64    * dirp_current;
+
+  int                  dir_table_bytes;
+  int                  forward_bytes;
+  struct task_struct * task_ptr;
+  int                  hide_it = 0;
+  __s64                dirp_offset;
+
+  lock_kernel();
+
+  status = (*old_getdents64)(fd, dirp, count);
+
+#ifdef FILE_DEBUG
+  printk("STATUS64 %ld\n", status);
+#endif
+
+  /*  0: end of directory.
+   * -1: some error
+   */
+  if (status <= 0)
+    {
+      unlock_kernel();
+      return (status);
+    }
+
+  /* Handle directory caching. dir_inode is the inode of the directory.
+   */
+#if defined(__LINUX_DCACHE_H)
+  dir_inode  = current->files->fd[fd]->f_dentry->d_inode;
+#else
+  dir_inode  = current->files->fd[fd]->f_inode;
+#endif
+
+#ifdef FILE_DEBUG
+  printk("INODE64\n");
+#endif
+
+  /* Check for the /proc directory
+   */
+  if (dir_inode->i_ino == PROC_ROOT_INO
+#ifndef LINUX26  
+      && !MAJOR(dir_inode->i_dev) /*  && 
+      MINOR(dir_inode->i_dev) == 1 */
+      /* MINOR commented out because of problems with 2.4.17 */
+#endif
+      )
+    {
+      dir_is_proc = 1;
+
+#ifdef PROC_DEBUG
+      printk("PROC_CHECK64\n");
+#endif
+    }
+
+  /* Allocate space for new dirent table. Can't use GFP_KERNEL 
+   * (kernel oops)
+   */
+  dirp_new = kmalloc ((size_t)status, GFP_ATOMIC);
+
+#ifdef FILE_DEBUG
+  printk("KMALLOC64_0\n");
+#endif
+
+  if (dirp_new == NULL)
+    {
+      unlock_kernel();
+      return (status);
+    }
+
+#ifdef FILE_DEBUG
+  printk("KMALLOC64\n");
+#endif
+
+  /* Copy the dirp table to kernel space.
+   */
+  copy_from_user(dirp_new, dirp, status);
+
+#ifdef FILE_DEBUG
+  printk("COPY64 to kernel\n");
+#endif
+
+  /* Loop over the dirp table to find entries to hide.
+   */
+  dir_table_bytes = status;
+  dirp_current    = dirp_new;
+  dirp_prev       = NULL;
+
+  while (dir_table_bytes > 0)
+    {
+      hide_it = 0;
+
+      if (dirp_current->d_reclen == 0)
+	break;
+
+      dirp_offset = dirp_current->d_off;
+      
+#ifdef FILE_DEBUG
+      printk("DIRENT %d  %d  %lld\n", 
+	     dir_table_bytes,
+	     dirp_current->d_reclen,
+	     dirp_current->d_off);
+#endif
+
+      dir_table_bytes -= dirp_current->d_reclen;
+      forward_bytes    = dirp_current->d_reclen;
+
+#ifdef FILE_DEBUG
+      printk("ENTRY %s\n", dirp_current->d_name);
+#endif
+
+      /* If /proc is scanned (e.g. by 'ps'), hide the entry for
+       * any process where the executable has MAGIC_HIDE in its name.
+       */
+      if (dir_is_proc == 1)
+	{
+#ifdef PROC_DEBUG
+	  printk("PROC %s\n", dirp_current->d_name);
+#endif
+	  task_ptr = fetch_task_struct(my_atoi(dirp_current->d_name));
+	  if (task_ptr != NULL)
+	    {
+#ifdef PROC_DEBUG
+	      printk("PROC %s <> %s\n", task_ptr->comm, hidden);
+#endif
+	      if (strstr(task_ptr->comm, hidden) != NULL)
+		hide_it = 1;
+	    }
+	}
+      /* If it is a regular directory, hide any entry with
+       * MAGIC_HIDE in its name.
+       */
+      else
+	{
+	  if (strstr (dirp_current->d_name, hidden) != NULL)
+	    hide_it = 1;
+	}
+
+      if (hide_it == 1)
+	{
+#ifdef FILE_DEBUG
+	  printk("  -->HIDDEN %s\n", dirp_current->d_name);
+#endif
+	  if (dir_table_bytes > 0)
+	    {
+	      status -= dirp_current->d_reclen;
+	      memmove (dirp_current, 
+		       (char *) dirp_current + dirp_current->d_reclen, 
+		       dir_table_bytes);
+
+	      /* Set forward_bytes to 0, because now dirp_current is the
+	       * (previously) next entry in the dirp table.
+	       */
+	      forward_bytes    = 0;
+	      dirp_prev        = dirp_current;
+	    }
+	  else
+	    {
+	      status -= dirp_current->d_reclen;
+	      if (dirp_prev != NULL)
+		dirp_prev->d_off = dirp_offset;
+	    }
+	  
+	}
+      else
+	{
+	  dirp_prev        = dirp_current;
+	  if (dir_table_bytes == 0 && dirp_prev != NULL)
+	    dirp_prev->d_off = dirp_offset;
+	}
+
+      /* Next entry in dirp table.
+       */
+      if (dir_table_bytes > 0)
+	dirp_current = (struct dirent64 *) ( (char *) dirp_current + 
+					     forward_bytes);
+    }
+
+  /* Copy our modified dirp table back to user space.
+   */
+  copy_to_user(dirp, dirp_new, status);
+  kfree (dirp_new);
+  unlock_kernel();
+  return (status);
+}
+#endif
+
+#ifdef LINUX26
+static struct module *find_module(const char *name)
+{
+        struct module *mod;
+	struct list_head * modules = (struct list_head *) SH_LIST_MODULES;
+
+        list_for_each_entry(mod, modules, list) {
+                if (strcmp(mod->name, name) == 0)
+                        return mod;
+        }
+        return NULL;
+}
+#endif
+
+/* The initialisation function. Automatically called when module is inserted
+ * via the 'insmod' command.
+ */
+#ifdef LINUX26
+static int __init samhain_hide_init(void)
+#else
+int init_module(void)
+#endif
+{
+
+  lock_kernel();
+
+  /* Unfortunately this does not fully prevent the module from appearing
+   * in /proc/ksyms. 
+   */
+#ifndef LINUX26
+  EXPORT_NO_SYMBOLS;
+#endif
+
+  /* Replace the 'sys_getdents' syscall with the new version.
+   */
+  old_getdents                        = (void*) sh_sys_call_table[SYS_getdents];
+  sh_sys_call_table[SYS_getdents]     = (unsigned long) new_getdents;
+  
+#ifdef __NR_getdents64
+  old_getdents64                      = (void*) sh_sys_call_table[SYS_getdents64];
+  sh_sys_call_table[SYS_getdents64]   = (unsigned long) new_getdents64;
+#endif
+
+#ifdef LINUX26
+  {
+    spinlock_t * modlist_lock = (spinlock_t * ) SH_MODLIST_LOCK;
+    struct module *mod = find_module(SH_INSTALL_NAME"_hide");
+    if (mod) {
+      /* Delete from various lists */
+      spin_lock_irq(modlist_lock);
+      if (removeme == 1)
+	{
+	  list_del(&mod->list);
+	}
+      spin_unlock_irq(modlist_lock);
+    }
+  }
+#endif
+
+  unlock_kernel();
+  return (0);
+}
+
+/* The cleanup function. Automatically called when module is removed
+ * via the 'rmmod' command.
+ */
+#ifdef LINUX26
+static void __exit samhain_hide_cleanup(void)
+#else
+void cleanup_module(void)
+#endif
+{
+  lock_kernel();
+
+  /* Restore the new syscalls to the original version.
+   */
+  sh_sys_call_table[SYS_getdents]     = (unsigned long) old_getdents;
+#ifdef __NR_getdents64
+  sh_sys_call_table[SYS_getdents64]   = (unsigned long) old_getdents64;
+#endif
+
+  unlock_kernel();
+}
+
+#ifdef LINUX26
+module_init(samhain_hide_init);
+module_exit(samhain_hide_cleanup);
+#endif
+
+
Index: trunk/src/samhain_setpwd.c
===================================================================
--- trunk/src/samhain_setpwd.c	(revision 591)
+++ trunk/src/samhain_setpwd.c	(revision 1)
@@ -1,3 +1,8 @@
 #include "config_xor.h"
+
+#ifdef HAVE_BROKEN_INCLUDES
+#define _ANSI_C_SOURCE
+#define _POSIX_SOURCE
+#endif
 
 #include <stdio.h>
@@ -8,130 +13,8 @@
 #include <unistd.h>
 #include <sys/types.h>
-#include <signal.h>
-#include <sys/wait.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <errno.h>
-#include <sys/time.h>
 #include <time.h>
 
-#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)
-#include <sched.h>
-#endif
-
-#if defined(HAVE_INT_32)
-typedef unsigned int UINT32;
-#elif defined(HAVE_LONG_32)
-typedef unsigned long UINT32;
-#elif defined(HAVE_SHORT_32)
-typedef unsigned short UINT32;
-#endif
-
-#define TAUS_MAX 4294967295UL
-
-static UINT32 taus_state[3];
-
-static UINT32 taus_get ()
-{
-
-#define TAUSWORTHE(s,a,b,c,d) ((s &c) <<d) ^ (((s <<a) ^s) >>b)
-  taus_state[0] = TAUSWORTHE (taus_state[0], 13, 19, 4294967294UL, 12);
-  taus_state[1] = TAUSWORTHE (taus_state[1],  2, 25, 4294967288UL,  4);
-  taus_state[2] = TAUSWORTHE (taus_state[2],  3, 11, 4294967280UL, 17);
-  return (taus_state[0] ^ taus_state[1] ^ taus_state[2]);
-}
-
-static void taus_seed ()
-{
-  unsigned char buf[12];
-  unsigned char buf2[12];
-  unsigned char buf3[12];
-  ssize_t count;
-  size_t nbytes = sizeof(buf);
-  size_t where  = 0;
-
-  struct timeval t1, t2;
-  UINT32 delta, k[3];
-  int i, j;
-
-  int fd = open ("/dev/urandom", O_RDONLY);
-
-  if (fd == -1)
-    {
-      gettimeofday(&t1, NULL);
-      delta = t1.tv_usec;
-      memcpy(&buf[0], &delta, 4);
-      gettimeofday(&t1, NULL);
-      delta = t1.tv_usec;
-      memcpy(&buf[4], &delta, 4);
-      gettimeofday(&t1, NULL);
-      delta = t1.tv_usec;
-      memcpy(&buf[8], &delta, 4);
-      goto second;
-    }
-
-  do {
-    count = read(fd, &buf[where], nbytes);
-    if (count == -1 && errno == EINTR)
-      continue;
-    where  += count;
-    nbytes -= count;
-  } while (nbytes);
-
-  close(fd);
-
- second:
-  for (i = 0; i < 12; ++i)
-    {
-      gettimeofday(&t1, NULL);
-      if (0 == fork())
-	_exit(EXIT_SUCCESS);
-      wait(NULL);
-      gettimeofday(&t2, NULL);
-      delta = t2.tv_usec - t1.tv_usec;
-      buf2[i] = (unsigned char) delta;
-    }
-
-  for (i = 0; i < 12; ++i)
-    {
-      gettimeofday(&t1, NULL);
-      for (j = 0; j < 32768; ++j)
-	{
-	  if (0 == kill (j,0))
-	    k[i % 3] ^= j;
-	}
-      gettimeofday(&t2, NULL);
-      delta = t2.tv_usec - t1.tv_usec;
-      buf3[i] ^= (unsigned char) delta;
-    }
-
-  memcpy(&taus_state[0], &buf3[0], 4);
-  memcpy(&taus_state[1], &buf3[4], 4);
-  memcpy(&taus_state[2], &buf3[8], 4);
-
-  taus_state[0] ^= k[0];
-  taus_state[1] ^= k[1];
-  taus_state[2] ^= k[2];
-  
-  memcpy(&k[0], &buf2[0], 4);
-  memcpy(&k[1], &buf2[4], 4);
-  memcpy(&k[2], &buf2[8], 4);
-
-  taus_state[0] ^= k[0];
-  taus_state[1] ^= k[1];
-  taus_state[2] ^= k[2];
-  
-  memcpy(&k[0], &buf[0], 4);
-  memcpy(&k[1], &buf[4], 4);
-  memcpy(&k[2], &buf[8], 4);
-
-  taus_state[0] ^= k[0];
-  taus_state[1] ^= k[1];
-  taus_state[2] ^= k[2];
-
-  taus_state[0] |= (UINT32) 0x03;
-  taus_state[1] |= (UINT32) 0x09;
-  taus_state[2] |= (UINT32) 0x17;
-}
 
 #ifdef SH_STEALTH
@@ -229,8 +112,6 @@
 
   char * newn;
-  size_t nlen;
   int    oldf;
   int    newf;
-  int    ret;
 
   unsigned long bytecount;
@@ -246,32 +127,32 @@
   char * oldpwd = (char *) malloc(5 * 8 + 2); 
 
-  memset (newpwd, 0, 5 * 8 + 2); 
-  memset (oldpwd, 0, 5 * 8 + 2); 
+  memset (newpwd, '\0', 5 * 8 + 2); 
+  memset (oldpwd, '\0', 5 * 8 + 2); 
 
 
   if (argc < 4) 
     {
-      fprintf (stderr, "%s", _("\nUsage: samhain_setpwd <filename> <suffix> "\
+      fprintf (stderr, _("\nUsage: samhain_setpwd <filename> <suffix> "\
 	       "<new_password>\n\n"));
-      fprintf (stderr, "%s", _("   This program is a utility that will:\n"));
-      fprintf (stderr, "%s", _("    - search in the binary executable "\
-	       "<filename> for samhain's\n"));
-      fprintf (stderr, "%s", _("      compiled-in default password,\n"));
-      fprintf (stderr, "%s", _("    - change it to <new_password>,\n"));
-      fprintf (stderr, "%s", _("    - and output the modified binary to "\
+      fprintf (stderr, _("   This program is a utility that will:\n"));
+      fprintf (stderr, _("    - search in the binary executable <filename> "\
+	       "for samhain's\n"));
+      fprintf (stderr, _("      compiled-in default password,\n"));
+      fprintf (stderr, _("    - change it to <new_password>,\n"));
+      fprintf (stderr, _("    - and output the modified binary to "\
 	       "<filename>.<suffix>\n\n"));
-      fprintf (stderr, "%s", _("   To allow for non-printable chars, "\
+      fprintf (stderr, _("   To allow for non-printable chars, "\
 			 "<new_password> must be\n")); 
-      fprintf (stderr, "%s", _("   a 16-digit hexadecimal "\
+      fprintf (stderr, _("   a 16-digit hexadecimal "\
 	       "number (only 0-9,A-F allowed in input),\n"));
-      fprintf (stderr, "%s", _("   thus corresponding"\
+      fprintf (stderr, _("   thus corresponding"\
 			 "   to an 8-byte password.\n\n"));
-      fprintf (stderr, "%s", _("   Example: 'samhain_setpwd samhain new "\
+      fprintf (stderr, _("   Example: 'samhain_setpwd samhain new "\
 	       "4142434445464748'\n"));
-      fprintf (stderr, "%s", _("   takes the file 'samhain', sets the "\
-	       "password to 'ABCDEFGH'\n")); 
-      fprintf (stderr, "%s", _("   ('A' = 41 hex, 'B' = 42 hex, ...) "\
+      fprintf (stderr, _("   takes the file 'samhain', sets the password to "\
+	       "'ABCDEFGH'\n")); 
+      fprintf (stderr, _("   ('A' = 41 hex, 'B' = 42 hex, ...) "\
 	       "and outputs the result\n"));
-      fprintf (stderr, "%s", _("   to 'samhain.new'.\n"));
+      fprintf (stderr, _("   to 'samhain.new'.\n"));
       return  EXIT_FAILURE;
     }
@@ -279,7 +160,6 @@
   if (strlen(argv[3]) != 16)
     {
-      fprintf (stdout, 
-	       _("ERROR <new_password> |%s| has not exactly 16 chars\n"),
-	       argv[3]);
+      fprintf (stdout, _("ERROR <new_password> %s has not exactly 16 chars\n"),
+	       argv[0]);
       fflush(stdout);
       return  EXIT_FAILURE;
@@ -316,5 +196,5 @@
   (void) umask (0);
 
-  taus_seed();
+  srand(time(NULL) ^ getpid());
 
   bytecount = 0;
@@ -326,9 +206,8 @@
   oldf = open(argv[1], O_RDONLY);
 
-  nlen = strlen(argv[1])+strlen(argv[2])+2;
-  newn = (char *) malloc (nlen);
-  strncpy(newn, argv[1], nlen); newn[nlen-1] = '\0';
-  strncat(newn, ".", nlen);     newn[nlen-1] = '\0';
-  strncat(newn, argv[2], nlen); newn[nlen-1] = '\0';
+  newn = (char *) malloc (strlen(argv[1])+strlen(argv[2])+2);
+  strcpy(newn, argv[1]);
+  strcat(newn, ".");
+  strcat(newn, argv[2]);
   newf = open(newn, O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU);
 
@@ -361,5 +240,5 @@
 	{
 	  suc = 1;
-	  fprintf (stdout, "%s", _("INFO   old password found\n"));
+	  fprintf (stdout, _("INFO   old password found\n"));
 	  fflush(stdout);
 	  for (i = 0; i < 8; ++i)
@@ -386,5 +265,5 @@
 		      (unsigned char) *found_it);
 
-	      ccd = (unsigned char) (256.0 * (taus_get()/(TAUS_MAX+1.0)));
+	      ccd = (unsigned char) (256.0 * rand()/(RAND_MAX+1.0));
 	      sprintf(&newpwd[i*2], _("%02x"), 
 		      (unsigned char) ccd);
@@ -399,16 +278,10 @@
 
 
-      ret = write (newf, buf, dat);
-      if (dat > 0 && ret < 0)
-	{
-	  fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
-	  fflush(stdout);
-	  return EXIT_FAILURE;
-	}
+      write (newf, buf, dat);
     }
 
   if (suc == 1 && badcnt == 7)
     {
-      fprintf (stdout, "%s", _("INFO   finished\n"));
+      fprintf (stdout, _("INFO   finished\n"));
       close (newf);
       close (oldf);
@@ -420,6 +293,6 @@
   lseek (newf, 0, SEEK_SET);
 
-  fprintf (stdout, "%s", _("INFO   Not found in first pass.\n"));
-  fprintf (stdout, "%s", _("INFO   Second pass ..\n"));
+  fprintf (stdout, _("INFO   Not found in first pass.\n"));
+  fprintf (stdout, _("INFO   Second pass ..\n"));
 
   /* offset the start point
@@ -427,11 +300,5 @@
 
   dat = read (oldf, buf, (GRAB_SIZE / 2));
-  ret = write (newf, buf, dat);
-  if (dat > 0 && ret < 0)
-    {
-      fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
-      fflush(stdout);
-      return EXIT_FAILURE;
-    }
+  write (newf, buf, dat);
 
   bytecount = 0;
@@ -450,5 +317,5 @@
 	{
 	  suc = 1;
-	  fprintf (stdout, "%s", _("INFO   old password found\n"));
+	  fprintf (stdout, _("INFO   old password found\n"));
 	  for (i = 0; i < 8; ++i)
 	    {
@@ -473,5 +340,5 @@
 		      (unsigned char) *found_it);
 
-	      ccd = (unsigned char) (256.0 * taus_get()/(TAUS_MAX+1.0));
+	      ccd = (unsigned char) (256.0 * rand()/(RAND_MAX+1.0));
 	      sprintf(&newpwd[i*2], _("%02x"), 
 		      (unsigned char) ccd);
@@ -484,11 +351,5 @@
 	}
 
-      ret = write (newf, buf, dat);
-      if (dat > 0 && ret < 0)
-	{
-	  fprintf(stdout, _("ERROR Cannot write to output file %s.\n"), newn);
-	  fflush(stdout);
-	  return EXIT_FAILURE;
-	}
+      write (newf, buf, dat);
     }
 
@@ -498,5 +359,5 @@
   if (suc == 1 && badcnt == 7)
     {
-      fprintf (stdout, "%s", _("INFO   finished\n"));
+      fprintf (stdout, _("INFO   finished\n"));
       fflush(stdout);
       return 0;
@@ -505,9 +366,9 @@
   if (suc == 0 || badcnt < 7)
     {
-      fprintf (stdout, "%s", _("ERROR incomplete replacement\n"));
+      fprintf (stdout, _("ERROR incomplete replacement\n"));
     }
   else 
     {
-      fprintf (stdout, "%s", _("ERROR bad replacement\n"));
+      fprintf (stdout, _("ERROR bad replacement\n"));
     }
   fflush(stdout);
Index: trunk/src/samhain_stealth.c
===================================================================
--- trunk/src/samhain_stealth.c	(revision 591)
+++ trunk/src/samhain_stealth.c	(revision 1)
@@ -270,35 +270,29 @@
 static void usage ()
 {
-      fprintf(stdout, "%s", _("\nUsage:  samhain_stealth -i|s|g|o <where> "\
-			      "[what]\n\n"));
-
-      fprintf(stdout, "%s", _("   -i info on PS image 'where'\n"));
-      fprintf(stdout, "%s", _("      (how much bytes can be hidden in it).\n"));
-      fprintf(stdout, "%s", _("   -s hide file 'what' in PS image 'where'\n"));
-      fprintf(stdout, "%s", _("   -g get hidden data from PS image 'where'\n"));
-      fprintf(stdout, "%s", _("      (output to stdout)\n"));
-      fprintf(stdout, "%s", _("   -o size of file 'where' = offset to "\
-			      "end-of-file\n"));
-      fprintf(stdout, "%s", _("      (same as wc -c).\n\n"));
-      fprintf(stdout, "%s", _(" Example: let bar.ps be the ps file, and"\
-			      "foo the config file\n"));
-      fprintf(stdout, "%s", _("   1) extract with: samhain_stealth "\
-			      "-g bar.ps >foo\n"));
-      fprintf(stdout, "%s", _("   2) hide with:    samhain_stealth "\
-			      "-s bar.ps foo\n\n"));
-
-      fprintf(stdout, "%s", _(" This program hides a file in an UNCOMPRESSED "\
-			      "postscript\n"));
-      fprintf(stdout, "%s", _(" image. To generate such an image, you may " \
-			      "use e.g.:\n"));
-      fprintf(stdout, "%s", _("   'convert +compress foo.jpg bar.ps'.\n"));
-      fprintf(stdout, "%s", _("   'gimp' apparently saves postscript "\
-			      "uncompressed by default\n"));
-      fprintf(stdout, "%s", _("         (V 1.06 of the postscript plugin).\n"));
-      fprintf(stdout, "%s", _("   'xv' seems to save with run-length "\
-			      "compression, which is unsuitable.\n"));
-      fprintf(stdout, "%s", _(" The program does not check the "\
-			      "compression type of the PS file.\n"));
-      fprintf(stdout, "%s", _(" Just have a look at the result to check.\n"));
+      fprintf(stdout, _("\nUsage:  samhain_stealth -i|s|g|o <where> "\
+			"[what]\n\n"));
+
+      fprintf(stdout, _("   -i info on PS image 'where'\n"));
+      fprintf(stdout, _("      (how much bytes can be hidden in it).\n"));
+      fprintf(stdout, _("   -s hide file 'what' in PS image 'where'\n"));
+      fprintf(stdout, _("   -g get hidden data from PS image 'where'\n"));
+      fprintf(stdout, _("      (output to stdout)\n\n"));
+      fprintf(stdout, _("   -o size of file 'where' = offset to "\
+			"end-of-file\n"));
+      fprintf(stdout, _("      (same as wc -c).\n"));
+
+      fprintf(stdout, _(" This program hides a file in an UNCOMPRESSED "\
+	      "postscript\n"));
+      fprintf(stdout, _(" image. To generate such an image, you may "\
+	      "use e.g.:\n"));
+      fprintf(stdout, _("   'convert +compress foo.jpg bar.ps'.\n"));
+      fprintf(stdout, _("   'gimp' apparently saves postscript uncompressed "\
+			"by default\n"));
+      fprintf(stdout, _("          (V 1.06 of the postscript plugin).\n"));
+      fprintf(stdout, _("   'xv' seems to save with run-length compression, "\
+	      "which is unsuitable.\n"));
+      fprintf(stdout, _(" The program does not check the compression type of "\
+	      "the PS file.\n"));
+      fprintf(stdout, _(" Just have a look at the result to check.\n\n"));
       return;
 }
@@ -341,6 +335,5 @@
       if (fd == -1) 
 	{
-	  fprintf(stderr, _("Error: could not open() %s for reading\n"), 
-		  argv[2]);
+	  fprintf(stderr, _("Error: could not open() %s for reading\n"), argv[2]);
 	  return (1);
 	}
@@ -397,5 +390,5 @@
 
       fprintf(stdout, _(" .. hide %s in %s .. \n"), argv[3], argv[2]);
-      while (fgets(buf, sizeof(buf), infil))
+      while (fgets(buf, 1023, infil))
 	{
 	  lseek(fd, off_data, SEEK_SET);
@@ -414,5 +407,5 @@
        */
       lseek(fd, off_data, SEEK_SET);
-      add_off = hidein_hex_block(fd, _("\n[EOF]\n"), 7);
+      add_off = hidein_hex_block(fd, _("[EOF]\n"), 6);
       if (add_off == -1)
 	{
@@ -421,5 +414,5 @@
 	  return (1);
 	}
-      fprintf(stdout, "%s", _(" .. finished\n"));
+      fprintf(stdout, _(" .. finished\n"));
       return (0);
     }
@@ -462,3 +455,4 @@
   return (1);
 }
-
+  
+      
Index: trunk/src/sh_audit.c
===================================================================
--- trunk/src/sh_audit.c	(revision 591)
+++ 	(revision )
@@ -1,647 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2010 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#include "samhain.h"
-#include "sh_error.h"
-
-#undef  FIL__
-#define FIL__  _("sh_audit.c")
-
-#if !defined(SH_COMPILE_STATIC) && defined(__linux__) && defined(HAVE_AUPARSE_H) && defined(HAVE_AUPARSE_LIB)
-#include <auparse.h>
-
-#include "sh_extern.h"
-#include "sh_utils.h"
-
-
-#define REC_SIZE_SYSCALL 32
-#define REC_SIZE_EXE     64
-#define REC_SIZE_SUCCESS 32
-
-struct recordState {
-  char syscall[REC_SIZE_SYSCALL];
-  char exe[REC_SIZE_EXE];
-  char success[REC_SIZE_SUCCESS];
-  unsigned int auid;
-  unsigned int uid;
-  unsigned int gid; 
-  unsigned int euid; 
-  unsigned int egid;
-  unsigned int fsuid; 
-  unsigned int fsgid;
-  time_t time;
-  unsigned int milli;
-};
-
-static int listRecords (auparse_state_t * au, struct recordState * state)
-{
-  if (auparse_first_record(au) != 1)
-    return -1;
-
-  state->time  = auparse_get_time(au);
-  state->milli = auparse_get_milli(au);
-
-  if (auparse_find_field(au, _("syscall")))
-    sl_strlcpy(state->syscall, auparse_interpret_field(au), REC_SIZE_SYSCALL);
-
-  if (auparse_find_field(au, _("success")))
-    sl_strlcpy(state->success, auparse_interpret_field(au), REC_SIZE_SUCCESS);
-
-  if (auparse_find_field(au, "uid"))
-    state->uid = auparse_get_field_int(au);
-  if (auparse_find_field(au, "gid"))
-    state->gid = auparse_get_field_int(au);
-
-  if (auparse_find_field(au, _("euid")))
-    state->euid = auparse_get_field_int(au);
-  if (auparse_find_field(au, _("fsuid")))
-    state->fsuid = auparse_get_field_int(au);
-
-  auparse_first_field(au);
-
-  if (auparse_find_field(au, _("auid")))
-    state->auid = auparse_get_field_int(au);
-
-  auparse_first_field(au);
-
-  if (auparse_find_field(au, _("egid")))
-    state->egid = auparse_get_field_int(au);
-  if (auparse_find_field(au, _("fsgid")))
-    state->fsgid = auparse_get_field_int(au);
-
-  auparse_first_field(au);
-
-  if (auparse_find_field(au, "exe"))
-    sl_strlcpy(state->exe, auparse_interpret_field(au), REC_SIZE_EXE);
-
-  return 0;
-}
-    
-static char * doAuparse (const char * file, time_t time, int tol, char * result, size_t rsize, int redo_flag)
-{
-  struct recordState state;
-  struct recordState stateFetched;
-  unsigned int       found_flag = 0;
-  
-  auparse_state_t * au = auparse_init(AUSOURCE_LOGS, NULL);
-
-  if (!au)
-    {
-      char ebuf[SH_ERRBUF_SIZE];
-      int  errnum = errno;
-
-      sl_snprintf(ebuf, sizeof(ebuf), _("Error in auparse_init() - %s\n"), 
-		  strerror(errnum));
-      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-		       ebuf,
-		       _("doAuparse") );
-      return NULL;
-    }
-
-  if (ausearch_add_interpreted_item(au, _("name"), "=", file, 
-				    AUSEARCH_RULE_CLEAR) != 0)
-    {
-      goto err;
-    }
-
-  if (time != 0)
-    {
-      ausearch_add_timestamp_item(au, ">=", time-tol, 0, AUSEARCH_RULE_AND);
-      ausearch_add_timestamp_item(au, "<=", time+tol, 0, AUSEARCH_RULE_AND);
-    }
-
-  if (ausearch_set_stop(au, AUSEARCH_STOP_RECORD) != 0)
-    {
-      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		       _("Error in ausearch_set_stop\n"),
-		       _("doAuparse") );
-      goto err;
-    }
-
-  memset(&state, 0, sizeof(state));
-
-  while (ausearch_next_event(au) == 1) 
-    {
-      memset(&stateFetched, '\0', sizeof(state));
-      listRecords(au, &stateFetched);
-      if (0 == strcmp(stateFetched.success, "yes"))
-	{
-	  memcpy(&state, &stateFetched, sizeof(state));
-	  ++found_flag;
-	}
-      auparse_next_event(au);
-    }
-
-  if (found_flag == 0 && redo_flag == S_FALSE)
-    {
-      size_t len = strlen(file);
-      char * path = SH_ALLOC(len + 2);
-      char * altres;
-      
-      sl_strlcpy(path, file, len+2);
-      path[len] = '/'; path[len+1] = '\0';
-      auparse_destroy(au);
-      
-      altres = doAuparse(path, time, tol, result, rsize, S_TRUE);
-
-      SH_FREE(path);
-      return altres;
-    }
-  
-  if (0 == strcmp(state.success, "yes"))
-    {
-      char   time_str[81];
-      char * tmp_exe = sh_util_safe_name(state.exe);
-
-      (void) sh_unix_gmttime (state.time, time_str, sizeof(time_str));
-      sl_snprintf(result, rsize, 
-		  _("time=%lu.%u, timestamp=%s, syscall=%s, auid=%u, uid=%u, gid=%u, euid=%u, egid=%u, fsuid=%u, fsgid=%u, exe=%s"),
-		  (unsigned long) state.time, state.milli, time_str, 
-		  state.syscall,
-		  state.auid, state.uid, state.gid, state.euid, state.egid, 
-		  state.fsuid, state.fsgid, tmp_exe);
-      SH_FREE(tmp_exe);
-      auparse_destroy(au);
-      return result;
-    }
-
- err:
-  auparse_destroy(au);
-  return NULL;
-}
-
-#define SH_AUDIT_DEF "wa"
-static char sh_audit_flags[32] = SH_AUDIT_DEF;
-
-int sh_audit_set_flags(const char * str)
-{
-  if (!str || strlen(str) >= sizeof(sh_audit_flags))
-    return -1;
-  sl_strlcpy(sh_audit_flags, str, sizeof(sh_audit_flags));
-  return 0;
-}
-static void reset_audit_flags()
-{
-  sl_strlcpy(sh_audit_flags, SH_AUDIT_DEF, sizeof(sh_audit_flags));
-  return;
-}
-
-
-static int sh_audit_checkdaemon();
-static int  actl_pnum = -1;
-static char * actl_paths[4] = 
-  { 
-    N_("/sbin/auditctl"), 
-    N_("/usr/sbin/auditctl"),
-    N_("/bin/auditctl"), 
-    N_("/usr/bin/auditctl") 
-  };
-
-static char * getflags (char * file);
-
-/* Public function to fetch an audit record for path 'file', time 'time'
- * The 'result' array should be sized ~256 char. 
- */
-char * sh_audit_fetch (char * file, time_t mtime, time_t ctime, time_t atime, char * result, size_t rsize)
-{
-  char * res   = NULL;
-  char * flags = getflags(file);
-
-  if (sh_audit_checkdaemon() >= 0)
-    {
-      time_t new;
-
-      if (flags && (strchr(flags, 'r') || strchr(flags, 'x')) && atime >= ctime && atime >= mtime) { new = atime; }
-      else if (mtime >= ctime) { new = mtime; }
-      else                     { new = ctime; }
-
-      res = doAuparse (file, new, 1, result, rsize, S_FALSE);
-
-      if (!res)
-	{
-	  res = doAuparse (file, new, 3, result, rsize, S_FALSE);
-	}
-
-    }
-  return res;
-}
-
-void sh_audit_delete_all ()
-{
-  int p = sh_audit_checkdaemon();
-
-  if (p >= 0)
-    {
-      char ctl[64];
-
-      sl_snprintf(ctl, sizeof(ctl), _("%s -D -k samhain"),
-		  _(actl_paths[p]));
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-		       0, MSG_E_SUBGEN,
-		       _("Deleting audit daemon rules with key samhain"),
-		       _("sh_audit_delete_all") );
-
-      sl_strlcpy(ctl, _(actl_paths[p]), sizeof(ctl));
-      sh_ext_system(ctl, ctl, "-D", "-k", _("samhain"), NULL);
-    }
-  reset_audit_flags();
-  return;
-}
-
-static int  sh_audit_isdir(const char * file)
-{
-  struct stat buf;
-
-  if ( (0 == lstat (file, &buf)) && S_ISDIR(buf.st_mode))
-    return S_TRUE;
-  return S_FALSE;
-}
-
-static void sh_audit_mark_int (const char * file, const char * flags)
-{
-  static int flushRules = 0;
-
-  int p = sh_audit_checkdaemon();
-
-  /* Flush all rules at startup.
-   */
-  if (flushRules == 0)
-    {
-      sh_audit_delete_all ();
-      flushRules = 1;
-    }
-
-  if (p >= 0)
-    {
-      size_t len = strlen(file) + 64;
-      char * command = SH_ALLOC(len);
-      char * safe;
-      char   ctl[64];
-      char   a1[32];
-      char   a2[32];
-      char   a3[32];
-      char   a4[32];
-
-      sl_snprintf(command, len, _("%s -w %s -p %s -k samhain"),
-		  _(actl_paths[p]), file, flags);
-
-      safe = sh_util_safe_name_keepspace(command);
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-		       0, MSG_E_SUBGEN,
-		       safe,
-		       _("sh_audit_mark") );
-
-      SH_FREE(safe);
-
-      sl_strlcpy(ctl, _(actl_paths[p]), sizeof(ctl));
-      sl_strlcpy(command, file, len);
-
-      sl_strlcpy(a3, _("samhain"), sizeof(a3));
-      sl_strlcpy(a4, flags, sizeof(a4));
-      sh_ext_system(ctl, ctl, "-w", command, "-p", a4, "-k", a3, NULL);
-
-      /* Placing a watch on a directory will not place a watch on the
-       * directory inode, so we do this explicitely. 
-       */
-      if (S_TRUE == sh_audit_isdir(file))
-	{
-	  safe = sh_util_safe_name(file);
-	  sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-			   0, MSG_E_SUBGPATH,
-			   _("Add path watch for directory"),
-			   _("sh_audit_mark_int"), safe );
-	  SH_FREE(safe);
-	  sl_strlcpy(command, _("path="), len);
-	  sl_strlcat(command, file, len);
-	  sl_strlcpy(a1, _("always,exit"), sizeof(a1));
-	  sl_strlcpy(a2, _("perm="), sizeof(a2));
-	  sl_strlcat(a2, flags, sizeof(a2));
-	  sh_ext_system(ctl, ctl, "-a", a1, "-F", command, "-F", a2, "-k", a3, NULL);
-	}
-      SH_FREE(command);
-    }
-  return;
-}
-
-#define SH_AU_FLAGS_SIZ 32
-struct aud_list {
-  char * file;
-  char   flags[SH_AU_FLAGS_SIZ];
-  struct aud_list * next;
-};
-
-struct aud_list * mark_these = NULL;
-static int marked_committed = 0;
-
-static void delete_listofmarked()
-{
-  struct aud_list * tmp;
-  struct aud_list * this = mark_these;
-
-  mark_these = NULL;
-  
-  while (this)
-    {
-      tmp  = this;
-      this = this->next;
-      
-      SH_FREE(tmp->file);
-      SH_FREE(tmp);
-    }
-  marked_committed = 0;
-}
-
-static char * getflags (char * file)
-{
-  struct aud_list * this = mark_these;
-
-  while (this)
-    {
-      if (0 == strcmp(file, this->file))
-	return this->flags;
-      this = this->next;
-    }
-  /* no explicit rule for this file */
-  return NULL;
-}
-
-static void add_this (char * file)
-{
-  struct aud_list * this = SH_ALLOC(sizeof(struct aud_list));
-  size_t len = strlen(file);
-
-  this->file = sh_util_strdup(file);
-
-  /* strip trailing '/' */
-  if ((len > 1) && (file[len-1] == '/'))
-    this->file[len-1] = '\0';
-
-  sl_strlcpy(this->flags, sh_audit_flags, SH_AU_FLAGS_SIZ);
-  
-  this->next = mark_these;
-  mark_these = this;
-  return;
-}
-
-/* Check whether it is already covered by a higher directory
- */
-static int test_exchange (struct aud_list * this, const char * file)
-{
-  size_t len0 = sl_strlen(this->file);
-  size_t len1 = sl_strlen(file);
-  int    ret  = -1;
-
-  if (!file || !this || !this->file)
-    return 0;
-  
-  if (len0 == len1)
-    {
-      return strcmp(this->file, file);
-    }
-  else
-    {
-      if (0 == strcmp(this->flags, sh_audit_flags))
-	{
-	  char * s0 = SH_ALLOC(len0 + 2);
-	  char * s1 = SH_ALLOC(len1 + 2);
-	  
-	  sl_strlcpy(s0, this->file, len0 + 2); 
-	  sl_strlcpy(s1, file,       len1 + 2); 
-	  
-	  if (s0 < s1)
-	    {
-	      sl_strlcat(s0, "/", len0 + 2);
-	      ret = strncmp(s0, s1, len0 + 1);
-	    }
-	  else
-	    {
-	      sl_strlcat(s1, "/", len1 + 2);
-	      if (0 == strncmp(s0, s1, len1 + 1))
-		{
-		  size_t len = strlen(file);
-		  SH_FREE(this->file);
-		  this->file = sh_util_strdup(file);
-		  if ((len > 1) && (file[len-1] == '/'))
-		    this->file[len-1] = '\0';
-		  ret = 0;
-		}
-	    }
-	  SH_FREE(s0);
-	  SH_FREE(s1);
-	}
-    }
-  
-  return ret;
-}
-
-/* Place a path on the list of of paths to be watched
- */
-void sh_audit_mark (char * file)
-{
-  struct aud_list * this;
-
-  if (marked_committed != 0) 
-    delete_listofmarked();
-  
-  if (!mark_these) {
-    add_this (file);
-    return;
-  }
-
-  this = mark_these;
-
-  while (this)
-    {
-      /* Check whether it is already covered by a higher
-       * directory 
-       */
-      if (0 == test_exchange(this, file))
-	return;
-
-      this = this->next;
-    }
-
-  add_this (file);
-  return;
-}
-
-void sh_audit_commit ()
-{
-  struct aud_list * this = mark_these;
-
-  while (this)
-    {
-      sh_audit_mark_int (this->file, this->flags);
-      this = this->next;
-    }
-  marked_committed = 1;
-}
-
-static int sh_audit_checkdaemon()
-{
-  int  i;
-  static int flag = 0;
-  char command[64];
-  char * p;
-
-  if (flag != 0)
-    return -1;
-
-  if (actl_pnum >= 0)
-    return actl_pnum;
-
-  for (i = 0; i < 4; ++i)
-    {
-      if (0 == access(_(actl_paths[i]), F_OK))/* flawfinder: ignore */
-	{
-	  if (0 == access(_(actl_paths[i]), X_OK))/* flawfinder: ignore */
-	    {
-	      actl_pnum = i;
-	      break;
-	    }
-	  else
-	    {
-	      char ebuf[SH_ERRBUF_SIZE];
-	      int  errnum = errno;
-	      
-	      sl_snprintf(ebuf, sizeof(ebuf), 
-			  _("Cannot execute auditctl - %s\n"), 
-			  strerror(errnum));
-	      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-			       errnum, MSG_E_SUBGEN,
-			       ebuf,
-			       _("sh_audit_checkdaemon") );
-	      flag = 1;
-	      actl_pnum = -1;
-	      return -1;
-	    }
-	}
-    }
-
-  if (actl_pnum == -1 && flag == 0)
-    {
-      char ebuf[SH_ERRBUF_SIZE];
-      int  errnum = errno;
-      
-      sl_snprintf(ebuf, sizeof(ebuf), 
-		  _("Cannot find auditctl - %s\n"), 
-		  strerror(errnum));
-      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-		       errnum, MSG_E_SUBGEN,
-		       ebuf,
-		       _("sh_audit_checkdaemon") );
-      flag = 1;
-      actl_pnum = -1;
-      return -1;
-    }
-
-  /* We found an executable auditctl */
-
-  sl_snprintf(command, sizeof(command), _("%s -s"), _(actl_paths[actl_pnum]));
-  sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-		   0, MSG_E_SUBGEN,
-		   command,
-		   _("sh_audit_checkdaemon") );
-  p = sh_ext_popen_str (command);
-
-  if (p)
-    {
-      int retval = -1;
-      if (strstr(p, _(" pid=0 ")))
-	{
-	  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-			   0, MSG_E_SUBGEN,
-			   _("Audit daemon for Linux kernel audit system is not running"),
-			   _("sh_audit_checkdaemon") );
-	  flag = 1;
-	  actl_pnum = -1;
-	}
-      else
-	{
-	  retval = actl_pnum;
-	  sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-			   retval, MSG_E_SUBGEN,
-			   _("Audit daemon is running"),
-			   _("sh_audit_checkdaemon") );
-	}
-      SH_FREE(p);
-      return retval;
-    }
-
-  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-		   errno, MSG_E_SUBGEN,
-		   _("No output from auditctl -s"),
-		   _("sh_audit_checkdaemon") );
-  flag = 1;
-  actl_pnum = -1;
-  return -1;
-}
-
-/* HAVE_AUPARSE_H */
-#else
-char * sh_audit_fetch (char * file, time_t mtime, time_t ctime, time_t atime, char * result, size_t rsize)
-{
-  (void) file;
-  (void) mtime;
-  (void) ctime;
-  (void) atime;
-  (void) result;
-  (void) rsize;
-
-  return 0;
-}
-void sh_audit_mark (const char * file)
-{
-  (void) file;
-  sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		  _("Setting audit watch not supported"),
-		  _("sh_audit_mark"));
-  return;
-}
-void sh_audit_delete_all ()
-{
-  return;
-}
-void sh_audit_commit ()
-{
-  return;
-}
-int sh_audit_set_flags(const char * str)
-{
-  (void) str;
-  return -1;
-}
-#endif
-
-/* client || standalone */
-#endif
-
Index: trunk/src/sh_calls.c
===================================================================
--- trunk/src/sh_calls.c	(revision 591)
+++ trunk/src/sh_calls.c	(revision 1)
@@ -34,5 +34,4 @@
 #include <signal.h>
 #include <sys/socket.h>
-#include <netdb.h>
 #include <netinet/in.h>
 
@@ -51,18 +50,14 @@
 #include "samhain.h"
 #include "sh_error.h"
-#include "sh_ipvx.h"
-#include "sh_sub.h"
-#include "sh_utils.h"
+#include "sh_calls.h"
 
 #undef  FIL__
 #define FIL__  _("sh_calls.c")
 
-extern int flag_err_debug;
-
 char aud_err_message[64];
 
 typedef struct cht_struct 
 {
-  const char           * str;
+  char           * str;
   unsigned long    val;
 } cht_type;
@@ -87,5 +82,5 @@
 /* Set aud functions
  */
-int sh_aud_set_functions(const char * str_s)
+int sh_aud_set_functions(char * str_s)
 {
   int i = 0;
@@ -114,5 +109,5 @@
 /* Need to catch EINTR for these functions.
  */
-long int retry_sigaction(const char * file, int line,
+long int retry_sigaction(char * file, int line,
 			 int signum,  const  struct  sigaction  *act,
 			 struct sigaction *oldact)
@@ -120,5 +115,4 @@
   int error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
   errno              = 0;
 
@@ -132,5 +126,5 @@
   if (val_retry < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_SIGACT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) signum );
   }
@@ -139,20 +133,13 @@
 }
 
-static struct sh_sockaddr bind_addr;
+static struct in_addr bind_addr;
 static int        use_bind_addr = 0;
 
-int sh_calls_set_bind_addr (const char * str)
-{
-  static int reject = 0;
-
-  if (reject == 1)
-    return (0);
-
-  if (sh.flag.opts == S_TRUE)  
-    reject = 1;
-
-  if (0 == sh_ipvx_aton(str, &bind_addr)) 
-    return -1;
-
+int sh_calls_set_bind_addr (char * str)
+{
+  if (0 == /*@-unrecog@*/inet_aton(str, &bind_addr)/*@+unrecog@*/) 
+    {
+      return -1;
+    }
   use_bind_addr = 1;
   return 0;
@@ -160,11 +147,10 @@
 
 
-long int retry_connect(const char * file, int line, int sockfd, 
+long int retry_connect(char * file, int line, int sockfd, 
 		       struct sockaddr *serv_addr, int addrlen)
 {
   int error;
-  int err_bind = 0;
   long int val_retry = 0;
-  char errbuf[SH_ERRBUF_SIZE];
+  static struct sockaddr_in new_addr;
 
   SL_ENTER(_("retry_connect"));
@@ -172,62 +158,40 @@
   errno = 0;
 
-  if (use_bind_addr) 
-    {
-      int slen = SH_SS_LEN(bind_addr);
-      struct sockaddr *b_addr = sh_ipvx_sockaddr_cast(&bind_addr);
-
-      if (bind_addr.ss_family == AF_INET)
-	b_addr->sa_family = AF_INET;
-#if defined(USE_IPVX)
-      else
-	b_addr->sa_family = AF_INET6;
+  if (0 != use_bind_addr) 
+    {
+      memcpy(&new_addr.sin_addr, &bind_addr, sizeof(struct in_addr));
+      new_addr.sin_family = AF_INET;
+      
+      val_retry = /*@-unrecog@*/bind(sockfd, 
+				     (struct sockaddr*)&new_addr, 
+				     sizeof(struct sockaddr_in))/*@+unrecog@*/;
+    }
+
+  if (val_retry == 0)
+    {
+      do {
+	val_retry = 
+	  /*@-unrecog@*/connect(sockfd, serv_addr, addrlen)/*@+unrecog@*/;
+      } while (val_retry < 0 && errno == EINTR);
+    }
+
+  error = errno;
+  if (val_retry != 0) {
+    /* ugly cast back to struct sockaddr_in :-(
+     */
+    sh_error_handle ((-1), file, line, error, MSG_ERR_CONNECT, 
+		     sh_error_message(error),
+		     (long) sockfd,
+		     /*@-unrecog -type@*/
+		     (long) ntohs(((struct sockaddr_in *)serv_addr)->sin_port),
+		     /*@+unrecog +type@*/
+#ifdef HAVE_INET_ATON
+		     /*@-unrecog -type@*/
+		     inet_ntoa( ((struct sockaddr_in *)serv_addr)->sin_addr )
+		     /*@+unrecog +type@*/
+#else
+		     _("unknown")
 #endif
-      val_retry = bind(sockfd, b_addr, slen);
-    }
-
-  if (val_retry == 0)
-    {
-      do {
-	val_retry = connect(sockfd, serv_addr, addrlen);
-      } while (val_retry < 0 && (errno == EINTR || errno == EINPROGRESS));
-    }
-  else
-    {
-      err_bind = 1;
-    }
-
-  error = errno;
-  if (val_retry != 0) {
-    long eport = 0;
-    char eaddr[SH_IP_BUF];
-    char emesg[SH_BUFSIZE];
-    struct sockaddr *err_addr = serv_addr;
-    struct sh_sockaddr ss;
-
-    if (err_bind)
-      err_addr = sh_ipvx_sockaddr_cast(&bind_addr);
-
-    sh_ipvx_save(&ss, err_addr->sa_family, err_addr);
-    sh_ipvx_ntoa(eaddr, sizeof(eaddr), &ss);
-    
-    if (err_addr->sa_family == AF_INET)
-      eport = (long) ntohs(((struct sockaddr_in *)serv_addr)->sin_port);
-#if defined(USE_IPVX)
-    else
-      eport = (long) ntohs(((struct sockaddr_in6 *)serv_addr)->sin6_port);
-#endif
-
-    sl_strlcpy(emesg, sh_error_message(error, errbuf, sizeof(errbuf)), sizeof(emesg));
-    sl_strlcat(emesg, 
-	       (err_addr->sa_family == AF_INET) ? _(", AF_INET") : _(", AF_INET6"),
-	       sizeof(emesg));
-
-    sl_strlcat(emesg, 
-	       (err_bind) ? _(", bind") : _(", connect"),
-	       sizeof(emesg));
-    
-    sh_error_handle ((-1), file, line, error, MSG_ERR_CONNECT,
-		     emesg,
-		     (long) sockfd, eport, eaddr);
+		     );
   }
   errno = error;    
@@ -235,13 +199,10 @@
 }
 
-long int retry_accept(const char * file, int line, int fd, 
-		      struct sh_sockaddr *serv_addr, int * addrlen)
+long int retry_accept(char * file, int line, int fd, 
+		      struct sockaddr *serv_addr, int * addrlen)
 {
   int  error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
-  struct sockaddr_storage ss;
-
-  ACCEPT_TYPE_ARG3 my_addrlen = sizeof(ss);
+  ACCEPT_TYPE_ARG3 my_addrlen = (ACCEPT_TYPE_ARG3) *addrlen;
 
   errno              = 0;
@@ -250,193 +211,65 @@
 
   do {
-    val_retry = accept(fd, (struct sockaddr *)&ss, &my_addrlen);
+    val_retry = /*@-unrecog@*/accept(fd, serv_addr, &my_addrlen)/*@+unrecog@*/;
   } while (val_retry < 0 && errno == EINTR);
-
+  *addrlen = (int) my_addrlen;
   error = errno;
   if (val_retry < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_ACCEPT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) fd );
   }
-  errno = error;
-
-  if (flag_err_debug == S_TRUE)
-    {
-      char ipbuf[SH_IP_BUF];
-      char buf[SH_BUFSIZE];
-#if defined(USE_IPVX)
-      sl_strlcpy(errbuf, _("Address family: "), sizeof(errbuf));
-      sl_strlcat(errbuf, 
-		 (ss.ss_family == AF_INET6) ? _("AF_INET6") : _("AF_INET"),
-		 sizeof(errbuf));
-      getnameinfo((struct sockaddr *)&ss, my_addrlen,
-		  ipbuf, sizeof(ipbuf), NULL, 0, NI_NUMERICHOST);
-#else
-      struct sockaddr_in sa;
-      char * p;
-      memcpy(&(sa), (struct sockaddr_in*)&ss, sizeof(struct sockaddr_in));
-      p = inet_ntoa(sa.sin_addr);
-      sl_strlcpy(ipbuf, p, sizeof(ipbuf));
-      sl_strlcpy(errbuf, _("Address family: AF_INET"), sizeof(errbuf));
-#endif
-      sl_strlcpy(buf, _("Address: "), sizeof(buf));
-      sl_strlcat(buf, ipbuf, sizeof(buf));
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		       errbuf, _("retry_accept"));
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		       buf, _("retry_accept"));
-    }
-
-  sh_ipvx_save(serv_addr, ss.ss_family, (struct sockaddr *) &ss);
-
-  if (flag_err_debug == S_TRUE)
-    {
-      char ipbuf[SH_IP_BUF];
-      char ipbuf2[SH_IP_BUF];
-      char buf[SH_BUFSIZE];
-#if defined(USE_IPVX)
-      int len = (serv_addr->ss_family == AF_INET) ? 
-	sizeof(struct sockaddr_in) :
-	sizeof(struct sockaddr_in6);
-      getnameinfo(sh_ipvx_sockaddr_cast(serv_addr), len,
-		  ipbuf2, sizeof(ipbuf2), NULL, 0, NI_NUMERICHOST);
-#else
-      char * p = inet_ntoa((serv_addr->sin).sin_addr);
-      sl_strlcpy(ipbuf2, p, sizeof(ipbuf2));
-#endif
-      sh_ipvx_ntoa (ipbuf, sizeof(ipbuf), serv_addr);
-      sl_snprintf(buf, sizeof(buf), _("Address: %s / %s"),
-		  ipbuf, ipbuf2);
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		       buf, _("retry_accept"));
-    }
-
-  *addrlen = (int) my_addrlen;
+  errno = error;    
   SL_RETURN(val_retry, _("retry_accept"));
 }
 
-static int sh_enable_use_sub = 0;
-
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-#if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-static int sh_use_sub = 0;
-#else
-static int sh_use_sub = 1;
-#endif
-#else
-static int sh_use_sub = 0;
-#endif
-
-void sh_calls_enable_sub()
-{
-  sh_enable_use_sub = 1;
-  return;
-}
-
-int sh_calls_set_sub (const char * str)
-{
-  int ret = sh_util_flagval(str, &sh_use_sub);
-
-  if ((ret == 0) && (!sh_use_sub))
-    {
-      sh_kill_sub();
-    }
-  return ret;
-}
-
-long int retry_lstat_ns(const char * file, int line, 
-			const char *file_name, struct stat *buf)
+long int retry_lstat(char * file, int line, 
+		     const char *file_name, struct stat *buf)
 {
   int error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
  
-  SL_ENTER(_("retry_lstat_ns"));
+  SL_ENTER(_("retry_lstat"));
 
   do {
     val_retry = /*@-unrecog@*/lstat (file_name, buf)/*@+unrecog@*/;
   } while (val_retry < 0 && errno == EINTR);
-
   error = errno;
   if (val_retry < 0) {
-      (void) sh_error_message(error, aud_err_message, 64);
+      (void) sl_strlcpy(aud_err_message, sh_error_message(error), 64);
       sh_error_handle ((-1), file, line, error, MSG_ERR_LSTAT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       file_name );
   }
   errno = error;    
-
-  SL_RETURN(val_retry, _("retry_lstat_ns"));
-}
-
-long int retry_lstat(const char * file, int line, 
-		     const char *file_name, struct stat *buf)
+  SL_RETURN(val_retry, _("retry_lstat"));
+}
+
+long int retry_stat(char * file, int line, 
+		    const char *file_name, struct stat *buf)
 {
   int error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
- 
-  SL_ENTER(_("retry_lstat"));
-
-  if (sh_use_sub && sh_enable_use_sub)
-    {
-      val_retry = sh_sub_lstat (file_name, buf);
-    }
-  else
-    {
-      do {
-	val_retry = /*@-unrecog@*/lstat (file_name, buf)/*@+unrecog@*/;
-      } while (val_retry < 0 && errno == EINTR);
-    }
-
-  error = errno;
-  if (val_retry < 0) {
-      (void) sh_error_message(error, aud_err_message, 64);
-      sh_error_handle ((-1), file, line, error, MSG_ERR_LSTAT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
-		       file_name );
-  }
-  errno = error;    
-
-  SL_RETURN(val_retry, _("retry_lstat"));
-}
-
-long int retry_stat(const char * file, int line, 
-		    const char *file_name, struct stat *buf)
-{
-  int error;
-  long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
  
   SL_ENTER(_("retry_stat"));
 
-  if (sh_use_sub && sh_enable_use_sub)
-    {
-      val_retry = sh_sub_stat (file_name, buf);
-    }
-  else
-    {
-      do {
-	val_retry = stat (file_name, buf);
-      } while (val_retry < 0 && errno == EINTR);
-    }
-
+  do {
+    val_retry = stat (file_name, buf);
+  } while (val_retry < 0 && errno == EINTR);
   error = errno;
   if (val_retry < 0) {
-      (void) sh_error_message(error, aud_err_message, 64);
+      (void) sl_strlcpy(aud_err_message, sh_error_message(error), 64);
       sh_error_handle ((-1), file, line, error, MSG_ERR_STAT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       file_name );
   }
   errno = error;    
-
   SL_RETURN(val_retry, _("retry_stat"));
 }
 
-long int retry_fstat(const char * file, int line, int filed, struct stat *buf)
+long int retry_fstat(char * file, int line, int filed, struct stat *buf)
 {
   int error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
  
   SL_ENTER(_("retry_fstat"));
@@ -448,5 +281,5 @@
   if (val_retry < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_FSTAT, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) filed );
   }
@@ -455,9 +288,8 @@
 }
 
-long int retry_fcntl(const char * file, int line, int fd, int cmd, long arg)
+long int retry_fcntl(char * file, int line, int fd, int cmd, long arg)
 {
   int error;
   long int val_retry = -1;
-  char errbuf[SH_ERRBUF_SIZE];
   errno              = 0;
 
@@ -479,5 +311,5 @@
   if (val_retry < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_FCNTL, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) fd, (long) cmd, arg );
   }
@@ -492,4 +324,6 @@
   struct timespec req, rem;
 #endif
+
+  SL_ENTER(_("retry_fcntl"));
 
   errno  = 0;
@@ -512,16 +346,23 @@
 #else
   if (sec > 0)
-    sleep (sec); /* nanosleep not available */
-  else {
+    {
+      sleep (sec);
+    }
+  else
+    {
 #ifdef HAVE_USLEEP
-    if (millisec > 0)
-      usleep(1000 * millisec);
+      if (millisec > 0)
+	{
+	  usleep(1000 * millisec);
+	}
 #else
-    if (millisec > 0)
-      sleep (1);
+      if (millisec > 0)
+	{
+	  sleep (1);
+	}
 #endif
-  }
+    }
 #endif
-  return result;
+  SL_RETURN(result, _("retry_msleep"));
 }
 
@@ -532,7 +373,7 @@
  ***************************************************/
 
-long int retry_aud_execve  (const char * file, int line, 
-			    const  char *dateiname, char *const argv[],
-			    char *const envp[])
+long int retry_aud_execve  (char * file, int line, 
+			    const  char *dateiname, char * argv[],
+			    char * envp[])
 {
   uid_t a = geteuid();
@@ -540,5 +381,4 @@
   int   i;
   int   error;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("retry_aud_execve"));
@@ -553,6 +393,5 @@
   error = errno;
   if (i < 0) {
-      sh_error_handle ((-1), file, line, error, MSG_ERR_EXEC, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+      sh_error_handle ((-1), file, line, error, MSG_ERR_EXEC, sh_error_message(error),
 		       dateiname, (long) a, (long) b );
   }
@@ -562,10 +401,9 @@
 
 
-long int retry_aud_utime (const char * file, int line, 
-			  char * path, struct utimbuf *buf)
+long int retry_aud_utime (char * file, int line, 
+			   char * path, struct utimbuf *buf)
 {
   long int val_return;
   int  error;
-  char errbuf[SH_ERRBUF_SIZE];
   errno      = 0;
 
@@ -584,5 +422,5 @@
   if (val_return < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_UTIME, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       path, 
 		       (unsigned long) buf->actime, 
@@ -593,10 +431,9 @@
 }
 
-long int retry_aud_unlink (const char * file, int line, 
+long int retry_aud_unlink (char * file, int line, 
 			   char * path)
 {
   long int val_return;
   int error;
-  char errbuf[SH_ERRBUF_SIZE];
   errno      = 0;
 
@@ -612,6 +449,5 @@
 		     path);
   if (val_return < 0) {
-      sh_error_handle ((-1), file, line, error, MSG_ERR_UNLINK, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+      sh_error_handle ((-1), file, line, error, MSG_ERR_UNLINK, sh_error_message(error),
 		       path);
   }
@@ -620,10 +456,9 @@
 }
 
-long int retry_aud_dup2 (const char * file, int line, 
+long int retry_aud_dup2 (char * file, int line, 
 			 int fd, int fd2)
 {
   long int val_return;
   int error;
-  char errbuf[SH_ERRBUF_SIZE];
   errno      = 0;
 
@@ -640,5 +475,5 @@
   if (val_return < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_DUP, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) fd, val_return);
   }
@@ -647,10 +482,9 @@
 }
 
-long int retry_aud_dup (const char * file, int line, 
+long int retry_aud_dup (char * file, int line, 
 			int fd)
 {
   long int val_return;
   int error;
-  char errbuf[SH_ERRBUF_SIZE];
   errno      = 0;
 
@@ -666,5 +500,5 @@
   if (val_return < 0) {
       sh_error_handle ((-1), file, line, error, MSG_ERR_DUP, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) fd, val_return);
   }
@@ -675,10 +509,9 @@
 
   
-long int retry_aud_chdir (const char * file, int line, 
+long int retry_aud_chdir (char * file, int line, 
 			  const char *path)
 {
   long int val_return;
   int      error      = 0;
-  char errbuf[SH_ERRBUF_SIZE];
   errno      = 0;
 
@@ -694,6 +527,5 @@
 		     path);
   if (val_return < 0) {
-      sh_error_handle ((-1), file, line, error, MSG_ERR_CHDIR, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+      sh_error_handle ((-1), file, line, error, MSG_ERR_CHDIR, sh_error_message(error),
 		       path);
   }
@@ -703,5 +535,5 @@
 
 
-long int aud_open_noatime (const char * file, int line, int privs,
+long int aud_open_noatime (char * file, int line, int privs,
 			   const char *pathname, int flags, mode_t mode,
 			   int * o_noatime)
@@ -709,41 +541,22 @@
   long int val_return;
   int error;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("aud_open"));
 
-#ifdef USE_SUID
-  if (0 == strcmp(pathname, "/usr/bin/sudo"))
-    {
-      uid_t ruid; uid_t euid; uid_t suid;
-      getresuid(&ruid, &euid, &suid);
-    }
-  if (privs == SL_YESPRIV)
-    sl_set_suid();
-#else
+  val_return = open (pathname, *o_noatime|flags, mode);
+  if ((val_return < 0) && (*o_noatime != 0))
+    {
+      val_return = open (pathname, flags, mode);
+      if (val_return >= 0)
+	*o_noatime = 0;
+    }
+  error = errno;
   /*@-noeffect@*/
   (void) privs; /* fix compiler warning */
   /*@+noeffect@*/
-#endif
-
-  val_return = open (pathname, *o_noatime|flags, mode);
-
-#ifdef USE_SUID
-  if (privs == SL_YESPRIV)
-    sl_unset_suid();
-#endif
-
-  if ((val_return < 0) && (*o_noatime != 0))
-    {
-      /* cppcheck-suppress resourceLeak */
-      val_return = open (pathname, flags, mode);
-      if (val_return >= 0)
-	*o_noatime = 0;
-    }
-  error = errno;
 
   if (val_return < 0)
     {
-      (void) sh_error_message(error, aud_err_message, 64);
+      (void) sl_strlcpy(aud_err_message, sh_error_message(error), 64);
     }
 
@@ -755,5 +568,5 @@
   if (val_return < 0) {
     sh_error_handle ((-1), file, line, error, MSG_ERR_OPEN, 
-		     sh_error_message(error, errbuf, sizeof(errbuf)),
+		     sh_error_message(error),
 		     pathname, (long) flags, (long) mode, val_return);
   }
@@ -762,34 +575,21 @@
 }
 
-long int aud_open (const char * file, int line, int privs,
+long int aud_open (char * file, int line, int privs,
 		   const char *pathname, int flags, mode_t mode)
 {
   long int val_return;
   int error;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("aud_open"));
 
-#ifdef USE_SUID
-  if (privs == SL_YESPRIV)
-    sl_set_suid();
-#else
+  val_return = open (pathname, flags, mode);
+  error = errno;
   /*@-noeffect@*/
   (void) privs; /* fix compiler warning */
   /*@+noeffect@*/
-#endif
-
-  val_return = open (pathname, flags, mode);
-
-#ifdef USE_SUID
-  if (privs == SL_YESPRIV)
-    sl_unset_suid();
-#endif
-
-  error = errno;
 
   if (val_return < 0)
     {
-      (void) sh_error_message(error, aud_err_message, 64);
+      (void) sl_strlcpy(aud_err_message, sh_error_message(error), 64);
     }
 
@@ -801,5 +601,5 @@
   if (val_return < 0) {
     sh_error_handle ((-1), file, line, error, MSG_ERR_OPEN, 
-		     sh_error_message(error, errbuf, sizeof(errbuf)),
+		     sh_error_message(error),
 		     pathname, (long) flags, (long) mode, val_return);
   }
@@ -808,9 +608,8 @@
 }
   
-long int aud_kill (const char * file, int line, pid_t pid, int sig)
+long int aud_kill (char * file, int line, pid_t pid, int sig)
 {
   int  myerror;
   long int val_return = kill (pid, sig);
-  char errbuf[SH_ERRBUF_SIZE];
   myerror = errno;
 
@@ -822,5 +621,5 @@
   if (val_return < 0) {
       sh_error_handle ((-1), file, line, myerror, MSG_ERR_KILL, 
-		       sh_error_message(myerror, errbuf, sizeof(errbuf)),
+		       sh_error_message(myerror),
 		       (long) pid, (long) sig);
   }
@@ -830,34 +629,33 @@
   
 /*@noreturn@*/
-void aud_exit (const char * file, int line, int exitval)
+void aud_exit (char * file, int line, int fd)
 {
   if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0)
     sh_error_handle ((-1), file, line, 0, MSG_AUD_EXIT,
-		      (long) exitval);
+		      (long) fd);
 
   SL_ENTER(_("aud_exit"));
 
-  sh.flag.exit = exitval;
-  exit(exitval);
+  sh.flag.exit = fd;
+  exit(fd);
 }
 
 /*@noreturn@*/
-void aud__exit (const char * file, int line, int exitval)
+void aud__exit (char * file, int line, int fd)
 {
   if (sh.flag.audit != 0 && (sh.flag.aud_mask & AUD_EXIT) != 0)
     sh_error_handle ((-1), file, line, 0, MSG_AUD_EXIT,
-		      (long) exitval);
+		      (long) fd);
 
   SL_ENTER(_("aud__exit"));
 
-  sh.flag.exit = exitval;
-  _exit(exitval);
-}
-
-pid_t aud_fork (const char * file, int line)
+  sh.flag.exit = fd;
+  _exit(fd);
+}
+
+pid_t aud_fork (char * file, int line)
 {
   int error;
   pid_t i = fork();
-  char errbuf[SH_ERRBUF_SIZE];
 
   error = errno;
@@ -869,5 +667,5 @@
   if (i == (pid_t) -1) {
     sh_error_handle ((-1), file, line, error, MSG_ERR_FORK, 
-		     sh_error_message(error, errbuf, sizeof(errbuf)),
+		     sh_error_message(error),
 		     (long) i);
   }
@@ -876,9 +674,8 @@
 }
 
-int aud_setuid (const char * file, int line, uid_t uid)
+int aud_setuid (char * file, int line, uid_t uid)
 {
   int error = 0;
   int i = 0;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("aud_setuid"));
@@ -897,5 +694,5 @@
   if (i < 0) {
     sh_error_handle ((-1), file, line, error, MSG_ERR_SETUID, 
-		     sh_error_message(error, errbuf, sizeof(errbuf)),
+		     sh_error_message(error),
 		     (long) uid);
   }
@@ -904,9 +701,8 @@
 }
 
-int aud_setgid (const char * file, int line, gid_t gid)
+int aud_setgid (char * file, int line, gid_t gid)
 {
   int error = 0;
   int i = 0;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("aud_setgid"));
@@ -926,5 +722,5 @@
   if (i < 0) {
     sh_error_handle ((-1), file, line, error, MSG_ERR_SETGID, 
-		     sh_error_message(error, errbuf, sizeof(errbuf)),
+		     sh_error_message(error),
 		     (long) gid);
   }
@@ -933,9 +729,8 @@
 }
 
-int aud_pipe (const char * file, int line, int modus[2])
+int aud_pipe (char * file, int line, int * modus)
 {
   int error;
   int i = pipe (modus);
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("aud_pipe"));
@@ -954,9 +749,9 @@
     if (i < 0)
       sh_error_handle ((-1), file, line, error, MSG_ERR_PIPE, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) 0, (long) 0);
     else
       sh_error_handle ((-1), file, line, error, MSG_ERR_PIPE, 
-		       sh_error_message(error, errbuf, sizeof(errbuf)),
+		       sh_error_message(error),
 		       (long) modus[0], (long) modus[1]);
   }
Index: trunk/src/sh_cat.c
===================================================================
--- trunk/src/sh_cat.c	(revision 591)
+++ trunk/src/sh_cat.c	(revision 1)
@@ -8,5 +8,5 @@
 /*@-nullassign@*/
 
-const char * class_cat[] = {
+char * class_cat[] = {
   N_("AUD"),     /*  0 */
   N_("PANIC"),   /*  1 */
@@ -40,5 +40,5 @@
   { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=\"Checksum\" chk=\"%s\" path=\"%s\"")},
   { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=\"d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld\"")},
-  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking %16s\" path=\"%s\"")},
+  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking\" path=\"%s\"")},
 #endif
 
@@ -70,13 +70,9 @@
   { MSG_CHECK_0,     SH_ERR_WARN,    RUN,   N_("msg=\"No files or directories defined for checking\"")},
   { MSG_CHECK_1,     SH_ERR_STAMP,   STAMP, N_("msg=\"File check completed.\" time=\"%ld\" kBps=\"%f\"")},
-  { MSG_CHECK_2,     SH_ERR_STAMP,   STAMP, N_("msg=\"File check starting.\"")},
   { MSG_STAMP,       SH_ERR_STAMP,   STAMP, N_("msg=\"---- TIMESTAMP ----\"")},
-  { MSG_DCLOSE,      SH_ERR_NOTICE,  RUN,   N_("msg=\"Finished writing baseline database.\"")},
-  
+
   { MSG_D_START,     SH_ERR_INFO,    RUN,   N_("msg=\"Downloading configuration file\"")},
   { MSG_D_DSTART,    SH_ERR_INFO,    RUN,   N_("msg=\"Downloading database file\"")},
   { MSG_D_FAIL,      SH_ERR_INFO,    RUN,   N_("msg=\"No file from server, trying local file\"")},
-  { MSG_D_DELTAOK,   SH_ERR_SEVERE,  RUN,   N_("msg=\"Delta database downloaded\", path=\"%s\"")},
-  { MSG_D_DELTAFAIL, SH_ERR_SEVERE,  RUN,   N_("msg=\"Delta database download failed\", path=\"%s\"")},
 
 
@@ -97,4 +93,17 @@
   { MSG_SUID_QREPORT,SH_ERR_SEVERE,  EVENT, N_("msg=\"Quarantine report: %s\" path=\"%s\"") },
   { MSG_SUID_ERROR,  SH_ERR_SEVERE,  EVENT, N_("msg=\"Quarantine error: %s\"") },
+#endif
+
+#ifdef SH_USE_KERN
+  /* FreeBSD */
+  { MSG_KERN_POLICY, SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY KERNEL BSD syscall table: new: %#lx old: %#lx\" syscall=\"%03d %s\"") },
+  { MSG_KERN_POL_CO, SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY KERNEL BSD syscall code: new: %#x,%#x old: %#x,%#x\" syscall=\"%03d %s\"") },
+
+  /* Linux */
+  { MSG_KERN_SYSCALL,SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Kernel] SYSCALL modified syscall\" syscall=\"%03d %s\" %s") },
+  { MSG_KERN_PROC,   SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Kernel] PROC modified proc filesystem: %s\"") },
+  { MSG_KERN_IDT,    SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Kernel] IDT modified interrupt %03d: new: 0x%-8.8lx %-9s %3d %c old: 0x%-8.8lx %-9s %3d %c\" %s") },
+  { MSG_KERN_GATE,   SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Kernel] SYS_GATE modified system_call: new: %#x,%#x old: %#x,%#x\" syscall=\"%03d %s\" %s") },
+
 #endif
 
@@ -113,54 +122,15 @@
   { MSG_UT_ROT,      SH_ERR_WARN,    RUN,   N_("msg=\"Logfile size decreased\" path=\"%s\"")},
 
-  { MSG_UT_BAD,      SH_ERR_SEVERE,  EVENT, N_("msg=\"Login at disallowed time\" userid=\"%s\" host=\"%s\" time=\"%s\"")},
-  { MSG_UT_FIRST,    SH_ERR_SEVERE,  EVENT, N_("msg=\"First login from this host\" userid=\"%s\" host=\"%s\" time=\"%s\"")},
-  { MSG_UT_OUTLIER,  SH_ERR_SEVERE,  EVENT, N_("msg=\"Login time outlier\" userid=\"%s\" host=\"%s\" time=\"%s\"")},
-
-#endif
-
-#ifdef SH_USE_PROCESSCHECK
-  { MSG_PCK_CHECK,   SH_ERR_INFO,    RUN,   N_("msg=\"Checking processes in pid interval [%ld,%ld]\"")},
-  { MSG_PCK_OK,      SH_ERR_ALL,     RUN,   N_("msg=\"PID %ld found with tests %s\"")},
-  { MSG_PCK_P_HIDDEN,SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Process] Hidden pid: %ld tests: %s\" path=\"%s\" userid=\"%s\"")},
-  { MSG_PCK_HIDDEN,  SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Process] Hidden pid: %ld tests: %s\"")},
-  { MSG_PCK_FAKE,    SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Process] Fake pid: %ld tests: %s\"")},
-  { MSG_PCK_MISS,    SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Process] Missing: %s\"")},
-#endif
-
-#ifdef SH_USE_PORTCHECK
-  { MSG_PORT_MISS,   SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [ServiceMissing] %s\"")},
-  { MSG_PORT_NEW,    SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [ServiceNew] %s\" path=\"%s\"  pid=\"%lu\" userid=\"%s\"")},
-  { MSG_PORT_RESTART,SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [ServiceRestarted] %s\" path=\"%s\" pid=\"%lu\" userid=\"%s\"")},
-  { MSG_PORT_NEWPORT,SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [ServicePortSwitch] %s\" path=\"%s\" pid=\"%lu\" userid=\"%s\"")},
 #endif
 
 #ifdef SH_USE_MOUNTS
-  { MSG_MNT_CHECK,   SH_ERR_INFO,    RUN,   N_("msg=\"Checking mounts\"")},
+  { MSG_MNT_CHECK,   SH_ERR_NOTICE,  RUN,   N_("msg=\"Checking mounts\"")},
   { MSG_MNT_MEMLIST, SH_ERR_ERR,     RUN,   N_("msg=\"Cannot read mount list from memory\"")},
-  { MSG_MNT_MNTMISS, SH_ERR_WARN,    EVENT, N_("msg=\"POLICY [Mounts] Mount missing\" path=\"%s\"")},
-  { MSG_MNT_OPTMISS, SH_ERR_WARN,    EVENT, N_("msg=\"POLICY [Mounts] Mount option missing\" path=\"%s\" option=\"%s\"")},
+  { MSG_MNT_MNTMISS, SH_ERR_WARN,    EVENT, N_("msg=\"Mount missing\" path=\"%s\"")},
+  { MSG_MNT_OPTMISS, SH_ERR_WARN,    EVENT, N_("msg=\"Mount option missing\" path=\"%s\" option=\"%s\"")},
 #endif
 
 #ifdef SH_USE_USERFILES
   { MSG_USERFILES_SUMMARY,SH_ERR_INFO,    RUN,   N_("msg=\"Checked for users files\"") },
-#endif
-
-#ifdef USE_LOGFILE_MONITOR
-  { MSG_LOGMON_CHKS, SH_ERR_INFO,    RUN,   N_("msg=\"Checking logfile %s\"") },
-  { MSG_LOGMON_CHKE, SH_ERR_INFO,    RUN,   N_("msg=\"Finished logfile %s, %lu new records processed\"") },
-  { MSG_LOGMON_MISS, SH_ERR_ERR,     RUN,   N_("msg=\"Missing logfile %s\"") },
-  { MSG_LOGMON_EOPEN,SH_ERR_ERR,     RUN,   N_("msg=\"Cannot open logfile %s\"") },
-  { MSG_LOGMON_EREAD,SH_ERR_ERR,     RUN,   N_("msg=\"Error while reading logfile %s\"") },
-  { MSG_LOGMON_REP,  SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Logfile] %s\" time=\"%s\" host=\"%s\" path=\"%s\"") },
-  { MSG_LOGMON_SUM,  SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Logfile] %s\" host=\"%s\" path=\"%s\"") },
-  { MSG_LOGMON_COR,  SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Logfile] Correlation event %s occured %d time(s)\"") },
-  { MSG_LOGMON_MARK, SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [Logfile] Event %s missing for %lu seconds\"") },
-  { MSG_LOGMON_BURST, SH_ERR_SEVERE, EVENT, N_("msg=\"POLICY [Logfile] Repeated %d times: %s\" host=\"%s\"") },
-#endif
-
-#ifdef USE_REGISTRY_CHECK
-  { MSG_REG_MISS,   SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [RegistryKeyMissing] %s\" path=\"%s\" %s")},
-  { MSG_REG_NEW,    SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [RegistryKeyNew] %s\" path=\"%s\" %s")},
-  { MSG_REG_CHANGE, SH_ERR_SEVERE,  EVENT, N_("msg=\"POLICY [RegistryKeyChanged] %s\" path=\"%s\" %s")},
 #endif
 
@@ -172,5 +142,5 @@
   { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=\"Checksum\" chk=\"%s\" path=\"%s\"")},
   { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=\"d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld\"")},
-  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking %16s\" path=\"%s\"")},
+  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=\"Checking\" path=\"%s\"")},
 #endif
 
@@ -187,5 +157,5 @@
   { MSG_FI_NOGRP,    SH_ERR_ERR,     FIL,   N_("interface=\"getgrgid\" msg=\"No such group\" group=\"%ld\" path=\"%s\"")},
   { MSG_FI_NOUSR,    SH_ERR_ERR,     FIL,   N_("interface=\"getpwuid\" msg=\"No such user\" userid=\"%ld\" path=\"%s\"")},
-  { MSG_FI_STAT,     SH_ERR_ERR,     FIL,   N_("interface=\"%s\" msg=\"%s\" userid=\"%ld\" path=\"%s\"")},
+  { MSG_FI_LSTAT,    SH_ERR_ERR,     FIL,   N_("interface=\"lstat\" msg=\"%s\" path=\"%s\"")},
   { MSG_FI_OBSC,     SH_ERR_ERR,     FIL,   N_("msg=\"Weird filename\" path=\"%s\"")},
   { MSG_FI_OBSC2,    SH_ERR_ERR,     FIL,   N_("msg=\"Weird filename\" path=\"%s/%s\"")},
@@ -211,5 +181,5 @@
   { MSG_TCP_MISMATCH,SH_ERR_ERR,     TCP,   N_("msg=\"Protocol mismatch\"")},
   { MSG_TCP_MISENC,  SH_ERR_ERR,     TCP,   N_("msg=\"Encryption mismatch in %s: server: %s client: %s\"")},
-  { MSG_TCP_NONAME,  SH_ERR_ERR,     TCP,   N_("msg=\"No server name known\"")},
+  { MSG_TCP_NONAME,  SH_ERR_ERR,     TCP,   N_("msg=\"No server name available\"")},
   { MSG_TCP_UNEXP,   SH_ERR_ERR,     TCP,   N_("msg=\"Unexpected reply\"")},
   { MSG_TCP_EFIL,    SH_ERR_ERR,     TCP,   N_("msg=\"Could not open temporary file\"")},
@@ -225,5 +195,4 @@
 
   { MSG_TCP_CREG,    SH_ERR_ALL,     TCP,   N_("msg=\"Registered %s, salt %s, verifier %s\"")},
-  { MSG_TCP_AREG,    SH_ERR_ALL,     TCP,   N_("msg=\"Registered %s, hostname %s\"")},
   { MSG_TCP_FAUTH,   SH_ERR_INFO,    TCP,   N_("msg=\"Force authentication\" host=\"%s\"")},
 
@@ -246,5 +215,5 @@
   { MSG_TCP_ILL,     SH_ERR_SEVERE,  TCP,   N_("msg=\"Restart without prior exit\" host=\"%s\"")},
   { MSG_TCP_SYNC,    SH_ERR_SEVERE,  TCP,   N_("msg=\"Out of sync\" host=\"%s\"")},
-  { MSG_TCP_RESET,   SH_ERR_NOTICE,  TCP,   N_("msg=\"Connection reset by peer\" host=\"%s\"")},
+  { MSG_TCP_RESET,   SH_ERR_SEVERE,  TCP,   N_("msg=\"Connection reset by peer\" host=\"%s\"")},
   { MSG_TCP_CNEW,    SH_ERR_INFO,    TCP,   N_("msg=\"New connection\" socket_id=\"%d\"")},
   { MSG_E_HTML,      SH_ERR_ERR,     ERR,   N_("msg=\"Error writing HTML status\"")},
@@ -265,5 +234,5 @@
   { MSG_MSTAMP,      SH_ERR_STAMP,   STAMP, N_("msg=\"Memory used:  max.=%lu, current=%lu\"")},
   { MSG_MSTAMP2,     SH_ERR_STAMP,   STAMP, N_("msg=\"Blocks: %d allocated, %d freed, %d maximum\"")},
-  { MSG_E_MNULL,     SH_ERR_ERR,     ERR,   N_("msg=\"Dereferenced NULL pointer allocated in %s, line %d\" source_file=\"%s\" source_line=\"%d\"")},
+  { MSG_E_MNULL,     SH_ERR_ERR,     ERR,   N_("msg=\"Dereferenced NULL pointer\" source_file=\"%s\" source_line=\"%d\"")},
   { MSG_E_MMEM,      SH_ERR_ERR,     ERR,   N_("msg=\"Out of memory\" source_file=\"%s\" source_line=\"%d\"")},
   { MSG_E_MREC,      SH_ERR_ERR,     ERR,   N_("msg=\"Free() on unrecorded block\" source_file=\"%s\" source_line=\"%d\"")},
@@ -276,8 +245,7 @@
   { MSG_E_HASH,      SH_ERR_ERR,     ERR,   N_("msg=\"Incorrect checksum\" path=\"%s\"")},
   { MSG_E_ACCESS,    SH_ERR_ERR,     ERR,   N_("msg=\"File not accessible\" userid=\"%ld\" path=\"%s\"")},
-  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=\"Not accessible or not a regular file (%s / %s)\" path=\"%s\"")},
-  { MSG_E_NOTREG,    SH_ERR_ERR,     ERR,   N_("msg=\"Not a regular file\" path=\"%s\"")},
+  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=\"Not accessible or not a regular file\" path=\"%s\"")},
   { MSG_E_TIMEOUT,   SH_ERR_ERR,     ERR,   N_("msg=\"Timeout (%d sec) while checksumming file\" path=\"%s\"")},
-  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=\"Device not available or timeout during read attempt\" userid=\"%ld\" path=\"%s\"")},
+  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=\"Device not available\" userid=\"%ld\" path=\"%s\"")},
   { MSG_LOCKED,      SH_ERR_ERR,     ERR,   N_("msg=\"File lock error\" userid=\"%ld\" path=\"%s\" obj=\"%s\"")},
   { MSG_PIDFILE,      SH_ERR_ERR,     ERR,   N_("msg=\"Could not write PID file\" userid=\"%ld\" path=\"%s\"")},
@@ -374,5 +342,5 @@
   { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=<Checksum>, chk=<%s>, path=<%s>")},
   { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=<d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld>")},
-  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking %16s>, path=<%s>")},
+  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking>, path=<%s>")},
 #endif
 
@@ -403,13 +371,9 @@
   { MSG_CHECK_0,     SH_ERR_WARN,    RUN,   N_("msg=<No files or directories defined for checking>")},
   { MSG_CHECK_1,     SH_ERR_STAMP,   STAMP, N_("msg=<File check completed.>, time=<%ld>, kBps=<%f>")},
-  { MSG_CHECK_2,     SH_ERR_STAMP,   STAMP, N_("msg=<File check starting.>")},
   { MSG_STAMP,       SH_ERR_STAMP,   STAMP, N_("msg=<---- TIMESTAMP ---->")},
-  { MSG_DCLOSE,      SH_ERR_NOTICE,  RUN,   N_("msg=<Finished writing baseline database.>")},
 
   { MSG_D_START,     SH_ERR_INFO,    RUN,   N_("msg=<Downloading configuration file>")},
   { MSG_D_DSTART,    SH_ERR_INFO,    RUN,   N_("msg=<Downloading database file>")},
   { MSG_D_FAIL,      SH_ERR_INFO,    RUN,   N_("msg=<No file from server, trying local file>")},
-  { MSG_D_DELTAOK,   SH_ERR_SEVERE,  RUN,   N_("msg=<Delta database downloaded>, path=<%s>")},
-  { MSG_D_DELTAFAIL, SH_ERR_SEVERE,  RUN,   N_("msg=<Delta database download failed>, path=<%s>")},
 
 
@@ -433,6 +397,6 @@
 
 #ifdef SH_USE_KERN
-  { MSG_KERN_POLICY, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Kernel] BSD syscall table: new: %#lx old: %#lx>, syscall=<%03d %s>") },
-  { MSG_KERN_POL_CO, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Kernel] BSD syscall code: new: %#x,%#x old: %#x,%#x>, syscall=<%03d %s>") },
+  { MSG_KERN_POLICY, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY KERNEL BSD syscall table: new: %#lx old: %#lx>, syscall=<%03d %s>") },
+  { MSG_KERN_POL_CO, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY KERNEL BSD syscall code: new: %#x,%#x old: %#x,%#x>, syscall=<%03d %s>") },
 
   { MSG_KERN_SYSCALL,SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Kernel] SYSCALL modified> syscall=<%03d %s>, %s") },
@@ -460,23 +424,4 @@
   { MSG_UT_ROT,      SH_ERR_WARN,    RUN,   N_("msg=<Logfile size decreased>, path=<%s>")},
 
-  { MSG_UT_BAD,      SH_ERR_SEVERE,  EVENT, N_("msg=<Login at disallowed time> userid=<%s> host=<%s> time=<%s>")},
-  { MSG_UT_FIRST,    SH_ERR_SEVERE,  EVENT, N_("msg=<First login from this host> userid=<%s> host=<%s> time=<%s>")},
-  { MSG_UT_OUTLIER,  SH_ERR_SEVERE,  EVENT, N_("msg=<Login time outlier> userid=<%s> host=<%s> time=<%s>")},
-#endif
-
-#ifdef SH_USE_PROCESSCHECK
-  { MSG_PCK_CHECK,   SH_ERR_INFO,    RUN,   N_("msg=<Checking processes in pid interval [%ld,%ld]>")},
-  { MSG_PCK_OK,      SH_ERR_ALL,     RUN,   N_("msg=<PID %ld found with tests %s>")},
-  { MSG_PCK_P_HIDDEN,SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Process] Hidden pid: %ld tests: %s> path=<%s> userid=<%s>")},
-  { MSG_PCK_HIDDEN,  SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Process] Hidden pid: %ld tests: %s>")},
-  { MSG_PCK_FAKE,    SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Process] Fake pid: %ld tests: %s>")},
-  { MSG_PCK_MISS,    SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Process] Missing: %s>")},
-#endif
-
-#ifdef SH_USE_PORTCHECK
-  { MSG_PORT_MISS,   SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [ServiceMissing] %s>")},
-  { MSG_PORT_NEW,    SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [ServiceNew] %s> path=<%s> pid=<%lu> userid=<%s>")},
-  { MSG_PORT_RESTART,SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [ServiceRestarted] %s> path=<%s> pid=<%lu> userid=<%s>")},
-  { MSG_PORT_NEWPORT,SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [ServicePortSwitch] %s> path=<%s> pid=<%lu> userid=<%s>")},
 #endif
 
@@ -484,29 +429,10 @@
   { MSG_MNT_CHECK,   SH_ERR_INFO,    RUN,   N_("msg=<Checking mounts>")},
   { MSG_MNT_MEMLIST, SH_ERR_ERR,     RUN,   N_("msg=<Cannot read mount list from memory>")},
-  { MSG_MNT_MNTMISS, SH_ERR_WARN,    EVENT, N_("msg=<POLICY [Mounts] Mount missing>, path=<%s>")},
-  { MSG_MNT_OPTMISS, SH_ERR_WARN,    EVENT, N_("msg=<POLICY [Mounts] Mount option missing>, path=<%s>, option=<%s>")},
+  { MSG_MNT_MNTMISS, SH_ERR_WARN,    EVENT, N_("msg=<Mount missing>, path=<%s>")},
+  { MSG_MNT_OPTMISS, SH_ERR_WARN,    EVENT, N_("msg=<Mount option missing>, path=<%s>, option=<%s>")},
 #endif
 
 #ifdef SH_USE_USERFILES
   { MSG_USERFILES_SUMMARY,SH_ERR_INFO,    RUN,   N_("msg=<Checked for users files>") },
-#endif
-
-#ifdef USE_LOGFILE_MONITOR
-  { MSG_LOGMON_CHKS, SH_ERR_INFO,    RUN,   N_("msg=<Checking logfile %s>") },
-  { MSG_LOGMON_CHKE, SH_ERR_INFO,    RUN,   N_("msg=<Finished logfile %s, %lu new records processed>") },
-  { MSG_LOGMON_MISS, SH_ERR_ERR,     RUN,   N_("msg=<Missing logfile %s>") },
-  { MSG_LOGMON_EOPEN,SH_ERR_ERR,     RUN,   N_("msg=<Cannot open logfile %s>") },
-  { MSG_LOGMON_EREAD,SH_ERR_ERR,     RUN,   N_("msg=<Error while reading logfile %s>") },
-  { MSG_LOGMON_REP,  SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Logfile] %s> time=<%s>, host=<%s>, path=<%s>") },
-  { MSG_LOGMON_SUM,  SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Logfile] %s> host=<%s> path=<%s>") },
-  { MSG_LOGMON_COR,  SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Logfile] Correlation event %s occured %d time(s)>") },
-  { MSG_LOGMON_MARK, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [Logfile] Event %s missing for %lu seconds>") },
-  { MSG_LOGMON_BURST, SH_ERR_SEVERE, EVENT, N_("msg=<POLICY [Logfile] Repeated %d times: %s>, host=<%s> ") },
-#endif
-
-#ifdef USE_REGISTRY_CHECK
-  { MSG_REG_MISS,   SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [RegistryKeyMissing] %s>, path=<%s>, %s")},
-  { MSG_REG_NEW,    SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [RegistryKeyNew] %s>, path=<%s>, %s")},
-  { MSG_REG_CHANGE, SH_ERR_SEVERE,  EVENT, N_("msg=<POLICY [RegistryKeyChanged] %s>, path=<%s>, %s")},
 #endif
 
@@ -518,5 +444,5 @@
   { MSG_FI_CSUM,     SH_ERR_ALL,     FIL,   N_("msg=<Checksum>, chk=<%s>, path=<%s>")},
   { MSG_FI_DSUM,     SH_ERR_INFO,    FIL,   N_("msg=<d: %3ld, -: %3ld, l: %3ld, |: %3ld, s: %3ld, c: %3ld, b: %3ld>")},
-  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking %16s>, path=<%s>")},
+  { MSG_FI_CHK,      SH_ERR_INFO,    FIL,   N_("msg=<Checking>, path=<%s>")},
 #endif
 
@@ -533,5 +459,5 @@
   { MSG_FI_NOGRP,    SH_ERR_ERR,     FIL,   N_("msg=<No such group>, interface=<getgrgid>, group=<%ld>, path=<%s>")},
   { MSG_FI_NOUSR,    SH_ERR_ERR,     FIL,   N_("msg=<No such user>, interface=<getpwuid>, userid=<%ld>, path=<%s>")},
-  { MSG_FI_STAT,     SH_ERR_ERR,     FIL,   N_("interface=<%s>, msg=<%s>, userid=<%ld>, path=<%s>")},
+  { MSG_FI_LSTAT,    SH_ERR_ERR,     FIL,   N_("msg=<%s>, interface=<lstat>, path=<%s>")},
   { MSG_FI_OBSC,     SH_ERR_ERR,     FIL,   N_("msg=<Weird filename>, path=<%s>")},
   { MSG_FI_OBSC2,    SH_ERR_ERR,     FIL,   N_("msg=<Weird filename>, path=<%s/%s>")},
@@ -570,5 +496,4 @@
 
   { MSG_TCP_CREG,    SH_ERR_ALL,     TCP,   N_("msg=<Registered %s, salt %s, verifier %s>")},
-  { MSG_TCP_AREG,    SH_ERR_ALL,     TCP,   N_("msg=<Registered %s, hostname %s>")},
   { MSG_TCP_FAUTH,   SH_ERR_INFO,    TCP,   N_("msg=<Force authentication>, client=<%s>")},
 
@@ -591,5 +516,5 @@
   { MSG_TCP_ILL,     SH_ERR_SEVERE,  TCP,   N_("msg=<Restart without prior exit>, client=<%s>")},
   { MSG_TCP_SYNC,    SH_ERR_SEVERE,  TCP,   N_("msg=<Out of sync>, client=<%s>")},
-  { MSG_TCP_RESET,   SH_ERR_NOTICE,  TCP,   N_("msg=<Connection reset by peer>, client=<%s>")},
+  { MSG_TCP_RESET,   SH_ERR_SEVERE,  TCP,   N_("msg=<Connection reset by peer>, client=<%s>")},
   { MSG_TCP_CNEW,    SH_ERR_INFO,    TCP,   N_("msg=<New connection>, socket_id=<%d>")},
   { MSG_E_HTML,      SH_ERR_ERR,     ERR,   N_("msg=<Error writing HTML status>")},
@@ -621,8 +546,7 @@
   { MSG_E_HASH,      SH_ERR_ERR,     ERR,   N_("msg=<Incorrect checksum>, path=<%s>")},
   { MSG_E_ACCESS,    SH_ERR_ERR,     ERR,   N_("msg=<File not accessible>, userid=<%ld>, path=<%s>")},
-  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=<Not accessible or not a regular file (%s / %s)>, path=<%s>")},
-  { MSG_E_NOTREG,    SH_ERR_ERR,     ERR,   N_("msg=<Not a regular file>, path=<%s>")},
+  { MSG_E_READ,      SH_ERR_ERR,     ERR,   N_("msg=<Not accessible or not a regular file>, path=<%s>")},
   { MSG_E_TIMEOUT,   SH_ERR_ERR,     ERR,   N_("msg=<Timeout (%d sec) while checksumming file>, path=<%s>")},
-  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=<Device not available or timeout during read attempt>, userid=<%ld>, path=<%s>")},
+  { MSG_NODEV,       SH_ERR_ERR,     ERR,   N_("msg=<Device not available>, userid=<%ld>, path=<%s>")},
   { MSG_LOCKED,      SH_ERR_ERR,     ERR,   N_("msg=<File lock error>, userid=<%ld>, path=<%s>, obj=<%s>")},
   { MSG_PIDFILE,      SH_ERR_ERR,     ERR,   N_("msg=<Could not write PID file>, userid=<%ld>, path=<%s>")},
Index: trunk/src/sh_checksum.c
===================================================================
--- trunk/src/sh_checksum.c	(revision 591)
+++ 	(revision )
@@ -1,638 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2013 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-#include "samhain.h"
-#include "sh_checksum.h"
-#include <string.h>
-
-#undef  FIL__
-#define FIL__  _("sh_checksum.c")
-
-/*
- * sha2.c
- *
- * Version 1.0.0beta1
- *
- * Written by Aaron D. Gifford <me@aarongifford.com>
- *
- * Copyright 2000 Aaron D. Gifford.  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. Neither the name of the copyright holder nor the names of 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(S) AND CONTRIBUTOR(S) ``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(S) OR CONTRIBUTOR(S) 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.
- *
- */
-
-/* Modified for use in samhain by R. Wichmann */
-
-#if WORDS_BIGENDIAN
-#define SHA2_BIG_ENDIAN    4321
-#define SHA2_BYTE_ORDER SHA2_BIG_ENDIAN
-#else
-#define SHA2_LITTLE_ENDIAN 1234
-#define SHA2_BYTE_ORDER SHA2_LITTLE_ENDIAN
-#endif
-
-#if SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN
-#define REVERSE32(w,x)  { \
-        sha2_word32 tmp = (w); \
-        tmp = (tmp >> 16) | (tmp << 16); \
-        (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \
-}
-#define REVERSE64(w,x)  { \
-        sha2_word64 tmp = (w); \
-        tmp = (tmp >> 32) | (tmp << 32); \
-        tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \
-              ((tmp & 0x00ff00ff00ff00ffULL) << 8); \
-        (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
-              ((tmp & 0x0000ffff0000ffffULL) << 16); \
-}
-#endif
-
-/*
- * Macro for incrementally adding the unsigned 64-bit integer n to the
- * unsigned 128-bit integer (represented using a two-element array of
- * 64-bit words):
- */
-#define ADDINC128(w,n)  { \
-        (w)[0] += (sha2_word64)(n); \
-        if ((w)[0] < (n)) { \
-                (w)[1]++; \
-        } \
-}
-
-/*** THE SIX LOGICAL FUNCTIONS ****************************************/
-/*
- * Bit shifting and rotation (used by the six SHA-XYZ logical functions:
- *
- *   NOTE:  The naming of R and S appears backwards here (R is a SHIFT and
- *   S is a ROTATION) because the SHA-256/384/512 description document
- *   (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this
- *   same "backwards" definition.
- */
-/* Shift-right (used in SHA-256, SHA-384, and SHA-512): */
-#define R(b,x)          ((x) >> (b))
-/* 32-bit Rotate-right (used in SHA-256): */
-#define S32(b,x)        (((x) >> (b)) | ((x) << (32 - (b))))
-/* 64-bit Rotate-right (used in SHA-384 and SHA-512): */
-#define S64(b,x)        (((x) >> (b)) | ((x) << (64 - (b))))
-
-/* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */
-#define Ch(x,y,z)       (((x) & (y)) ^ ((~(x)) & (z)))
-#define Maj(x,y,z)      (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
-
-/* Four of six logical functions used in SHA-256: */
-#define Sigma0_256(x)   (S32(2,  (x)) ^ S32(13, (x)) ^ S32(22, (x)))
-#define Sigma1_256(x)   (S32(6,  (x)) ^ S32(11, (x)) ^ S32(25, (x)))
-#define sigma0_256(x)   (S32(7,  (x)) ^ S32(18, (x)) ^ R(3 ,   (x)))
-#define sigma1_256(x)   (S32(17, (x)) ^ S32(19, (x)) ^ R(10,   (x)))
-
-/*** INTERNAL FUNCTION PROTOTYPES *************************************/
-/* NOTE: These should not be accessed directly from outside this
- * library -- they are intended for private internal visibility/use
- * only.
- */
-void SHA256_Transform(SHA256_CTX*, const sha2_word32*);
-
-/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
-/* Hash constant words K for SHA-256: */
-static const sha2_word32 K256[64] = {
-        0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
-        0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
-        0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
-        0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
-        0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
-        0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
-        0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
-        0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
-        0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
-        0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
-        0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
-        0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
-        0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
-        0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
-        0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
-        0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
-};
-
-/* Initial hash value H for SHA-256: */
-static const sha2_word32 sha256_initial_hash_value[8] = {
-        0x6a09e667UL,
-        0xbb67ae85UL,
-        0x3c6ef372UL,
-        0xa54ff53aUL,
-        0x510e527fUL,
-        0x9b05688cUL,
-        0x1f83d9abUL,
-        0x5be0cd19UL
-};
-
-/*
- * Constant used by SHA256/384/512_End() functions for converting the
- * digest to a readable hexadecimal character string:
- */
-static const char *sha2_hex_digits = "0123456789abcdef";
-
-/*** SHA-256: *********************************************************/
-void SHA256_Init(SHA256_CTX* context) {
-  if (context == (SHA256_CTX*)0) {
-    return;
-  }
-  memcpy(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH);
-  /* bcopy(sha256_initial_hash_value, context->state, SHA256_DIGEST_LENGTH); */
-  memset(context->buffer, 0, SHA256_BLOCK_LENGTH);
-  /* bzero(context->buffer, SHA256_BLOCK_LENGTH); */
-  
-  context->bitcount = 0;
-}
-
-#ifdef SHA2_UNROLL_TRANSFORM
-
-/* Unrolled SHA-256 round macros: */
-
-#if SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN
-
-#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h)       \
-        REVERSE32(*data++, W256[j]); \
-        T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
-             K256[j] + W256[j]; \
-        (d) += T1; \
-        (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
-        j++
-
-#else /* SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN */
-
-#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h)       \
-        T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \
-             K256[j] + (W256[j] = *data++); \
-        (d) += T1; \
-        (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
-        j++
-
-#endif /* SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN */
-
-#define ROUND256(a,b,c,d,e,f,g,h)       \
-        s0 = W256[(j+1)&0x0f]; \
-        s0 = sigma0_256(s0); \
-        s1 = W256[(j+14)&0x0f]; \
-        s1 = sigma1_256(s1); \
-        T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \
-             (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \
-        (d) += T1; \
-        (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \
-        j++
-
-void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) {
-  sha2_word32     a, b, c, d, e, f, g, h, s0, s1;
-  sha2_word32     T1, *W256;
-  int             j;
-  
-  W256 = (sha2_word32*)context->buffer;
-  
-  /* Initialize registers with the prev. intermediate value */
-  a = context->state[0];
-  b = context->state[1];
-  c = context->state[2];
-  d = context->state[3];
-  e = context->state[4];
-  f = context->state[5];
-  g = context->state[6];
-  h = context->state[7];
-  
-  j = 0;
-  do {
-    /* Rounds 0 to 15 (unrolled): */
-    ROUND256_0_TO_15(a,b,c,d,e,f,g,h);
-    ROUND256_0_TO_15(h,a,b,c,d,e,f,g);
-    ROUND256_0_TO_15(g,h,a,b,c,d,e,f);
-    ROUND256_0_TO_15(f,g,h,a,b,c,d,e);
-    ROUND256_0_TO_15(e,f,g,h,a,b,c,d);
-    ROUND256_0_TO_15(d,e,f,g,h,a,b,c);
-    ROUND256_0_TO_15(c,d,e,f,g,h,a,b);
-    ROUND256_0_TO_15(b,c,d,e,f,g,h,a);
-  } while (j < 16);
-  
-  /* Now for the remaining rounds to 64: */
-  do {
-    ROUND256(a,b,c,d,e,f,g,h);
-    ROUND256(h,a,b,c,d,e,f,g);
-    ROUND256(g,h,a,b,c,d,e,f);
-    ROUND256(f,g,h,a,b,c,d,e);
-    ROUND256(e,f,g,h,a,b,c,d);
-    ROUND256(d,e,f,g,h,a,b,c);
-    ROUND256(c,d,e,f,g,h,a,b);
-    ROUND256(b,c,d,e,f,g,h,a);
-  } while (j < 64);
-  
-  /* Compute the current intermediate hash value */
-  context->state[0] += a;
-  context->state[1] += b;
-  context->state[2] += c;
-  context->state[3] += d;
-  context->state[4] += e;
-  context->state[5] += f;
-  context->state[6] += g;
-  context->state[7] += h;
-  
-  /* Clean up */
-  a = b = c = d = e = f = g = h = T1 = 0;
-}
-
-#else /* SHA2_UNROLL_TRANSFORM */
-
-void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) {
-  sha2_word32     a, b, c, d, e, f, g, h, s0, s1;
-  sha2_word32     T1, T2, *W256;
-  int             j;
-  
-  W256 = (sha2_word32*)context->buffer;
-  
-  /* Initialize registers with the prev. intermediate value */
-  a = context->state[0];
-  b = context->state[1];
-  c = context->state[2];
-  d = context->state[3];
-  e = context->state[4];
-  f = context->state[5];
-  g = context->state[6];
-  h = context->state[7];
-  
-  j = 0;
-  do {
-#if SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN
-    /* Copy data while converting to host byte order */
-    REVERSE32(*data++,W256[j]);
-    /* Apply the SHA-256 compression function to update a..h */
-    T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
-#else /* SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN */
-    /* Apply the SHA-256 compression function to update a..h with copy */
-    T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
-#endif /* SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN */
-    T2 = Sigma0_256(a) + Maj(a, b, c);
-    h = g;
-    g = f;
-    f = e;
-    e = d + T1;
-    d = c;
-    c = b;
-    b = a;
-    a = T1 + T2;
-    
-    j++;
-  } while (j < 16);
-  
-  do {
-    /* Part of the message block expansion: */
-    s0 = W256[(j+1)&0x0f];
-    s0 = sigma0_256(s0);
-    s1 = W256[(j+14)&0x0f]; 
-    s1 = sigma1_256(s1);
-    
-    /* Apply the SHA-256 compression function to update a..h */
-    T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + 
-      (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0);
-    T2 = Sigma0_256(a) + Maj(a, b, c);
-    h = g;
-    g = f;
-    f = e;
-    e = d + T1;
-    d = c;
-    c = b;
-    b = a;
-    a = T1 + T2;
-    
-    j++;
-  } while (j < 64);
-  
-  /* Compute the current intermediate hash value */
-  context->state[0] += a;
-  context->state[1] += b;
-  context->state[2] += c;
-  context->state[3] += d;
-  context->state[4] += e;
-  context->state[5] += f;
-  context->state[6] += g;
-  context->state[7] += h;
-  
-  /* Clean up */
-  a = b = c = d = e = f = g = h = T1 = T2 = 0;
-}
-
-#endif /* SHA2_UNROLL_TRANSFORM */
-
-void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
-  unsigned int    freespace, usedspace;
-  
-  if (len == 0) {
-    /* Calling with no data is valid - we do nothing */
-    return;
-  }
-  
-  usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
-  
-  if (usedspace > 0) {
-    /* Calculate how much free space is available in the buffer */
-    freespace = SHA256_BLOCK_LENGTH - usedspace;
-    
-    if (len >= freespace) {
-      /* Fill the buffer completely and process it */
-      memcpy(&context->buffer[usedspace], data, freespace);
-      /* bcopy(data, &context->buffer[usedspace], freespace); */
-      context->bitcount += freespace << 3;
-      len -= freespace;
-      data += freespace;
-      SHA256_Transform(context, (sha2_word32*)context->buffer);
-    } else {
-      /* The buffer is not yet full */
-      memcpy(&context->buffer[usedspace], data, len);
-      /* bcopy(data, &context->buffer[usedspace], len); */
-      context->bitcount += len << 3;
-      
-      /* Clean up: */
-      usedspace = freespace = 0;
-      return;
-    }
-  }
-  while (len >= SHA256_BLOCK_LENGTH) {
-    /* Process as many complete blocks as we can */
-    SHA256_Transform(context, (const sha2_word32*)data);
-    context->bitcount += SHA256_BLOCK_LENGTH << 3;
-    len -= SHA256_BLOCK_LENGTH;
-    data += SHA256_BLOCK_LENGTH;
-  }
-  if (len > 0) {
-    /* There's left-overs, so save 'em */
-    memcpy(context->buffer, data, len);
-    /* bcopy(data, context->buffer, len); */
-    context->bitcount += len << 3;
-  }
-  /* Clean up: */
-  usedspace = freespace = 0;
-}
-
-void SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) 
-{
-  sha2_word32     *d = (sha2_word32*)digest;
-  unsigned int    usedspace;
-  union {
-    sha2_word64     bitcount;
-    sha2_byte       buffer[sizeof(sha2_word64)];
-  } sha2_union;
-  
-  /* If no digest buffer is passed, we don't bother doing this: */
-  if (digest != (sha2_byte*)0) {
-    
-    usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
-    
-#if SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN
-    /* Convert FROM host byte order */
-    REVERSE64(context->bitcount,context->bitcount);
-#endif
-    if (usedspace > 0) {
-      /* Begin padding with a 1 bit: */
-      context->buffer[usedspace++] = 0x80;
-      
-      if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) {
-	/* Set-up for the last transform: */
-	memset(&context->buffer[usedspace], 0, SHA256_SHORT_BLOCK_LENGTH - usedspace);
-      } else {
-	if (usedspace < SHA256_BLOCK_LENGTH) {
-	  memset(&context->buffer[usedspace], 0, SHA256_BLOCK_LENGTH - usedspace);
-	}
-	/* Do second-to-last transform: */
-	SHA256_Transform(context, (sha2_word32*)context->buffer);
-	
-	/* And set-up for the last transform: */
-	memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH);
-      }
-    } else {
-      /* Set-up for the last transform: */
-      memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH);
-      
-      /* Begin padding with a 1 bit: */
-      *context->buffer = 0x80;
-    }
-
-    /* Set the bit count (with fix for gcc type-punning warning): */
-    sha2_union.bitcount = context->bitcount;
-    memcpy (&context->buffer[SHA256_SHORT_BLOCK_LENGTH], sha2_union.buffer, sizeof(sha2_word64));
-    /* *(sha2_word64*) &context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; */
-    
-    /* Final transform: */
-    SHA256_Transform(context, (sha2_word32*)context->buffer);
-    
-#if SHA2_BYTE_ORDER == SHA2_LITTLE_ENDIAN
-    {
-      /* Convert TO host byte order */
-      int     j;
-      for (j = 0; j < 8; j++) {
-	REVERSE32(context->state[j],context->state[j]);
-	*d++ = context->state[j];
-      }
-    }
-#else
-    memset(d, context->state, SHA256_DIGEST_LENGTH);
-    /* bcopy(context->state, d, SHA256_DIGEST_LENGTH); */
-#endif
-  }
-  
-  /* Clean up state data: */
-  memset(context, 0, sizeof(SHA256_CTX));
-  usedspace = 0;
-}
-
-#include "sh_utils.h"
-
-/* If buffer is of length KEYBUF_SIZE, the digest will fit */
-char *SHA256_End(SHA256_CTX* context, char buffer[KEYBUF_SIZE]) 
-{
-  sha2_byte       digest[SHA256_DIGEST_LENGTH];
-  
-  if (buffer != (char*)0) {
-    SHA256_Final(digest, context);
-    sh_util_base64_enc ((unsigned char *)buffer, digest,  SHA256_DIGEST_LENGTH);
-  } else {
-    memset(context, 0, sizeof(SHA256_CTX));
-  }
-  memset(digest, 0, SHA256_DIGEST_LENGTH);
-  return buffer;
-}
-
-char* SHA256_Data(const sha2_byte* data, size_t len, char digest[KEYBUF_SIZE]) 
-{
-  SHA256_CTX      context;
-  
-  SHA256_Init(&context);
-  SHA256_Update(&context, data, len);
-  return SHA256_End(&context, digest);
-}
-
-char* SHA256_Base2Hex(char * b64digest, char * hexdigest) 
-{
-  int        i;
-  sha2_byte data[512];
-  sha2_byte *d;
-  size_t     len;
-  char * buffer;
-
-  len = strlen(b64digest);
-  sh_util_base64_dec ((unsigned char*) data, (unsigned char *)b64digest, len);
-  d = data;
-
-  buffer = hexdigest;
-  for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
-    *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-    *buffer++ = sha2_hex_digits[*d & 0x0f];
-    d++;
-  }
-  *buffer = (char)0;
-
-  return hexdigest;
-}
-
-char * SHA256_ReplaceBaseByHex(const char * str, char * before, char after)
-{
-  char   keybuf[KEYBUF_SIZE];
-  char * s   = strstr(str, before);
-
-  if (s)
-    {
-      char * p;
-
-      s += strlen(before);
-      memcpy(keybuf, s, sizeof(keybuf));
-      keybuf[sizeof(keybuf)-1] = '\0';
-      p = strchr(keybuf, after);
-
-      if (p)
-	{
-	  char   hexbuf[SHA256_DIGEST_STRING_LENGTH];
-	  char * ret = SH_ALLOC(strlen(str) + 1 + sizeof(keybuf)); 
-	  char * r   = ret;
-
-	  *p = '\0';
-	  SHA256_Base2Hex(keybuf, hexbuf);
-
-	  memcpy(ret, str, (s - str));
-	  r += (int)(s - str); *r = '\0';
-	  strcpy(r, hexbuf); /* flawfinder: ignore */
-	  r += strlen(hexbuf);
-	  p = strchr(s, after);
-	  strcpy(r, p);      /* flawfinder: ignore */
-
-	  return ret;
-	}
-    }
-  return NULL;
-}
-
-
-#ifdef SH_CUTEST
-#include <stdlib.h>
-#include "CuTest.h"
-
-void Test_sha256 (CuTest *tc) {
-
-  char hexdigest[SHA256_DIGEST_STRING_LENGTH];
-  char b64digest[KEYBUF_SIZE];
-  char * b64;
-  char * buffer;
-  size_t len;
-  sha2_byte data[512];
-  sha2_byte *d;
-  int        i;
-
-  data[0] = '\0'; len = 0;
-  b64 = SHA256_Data(data, len, b64digest);
-  CuAssertPtrNotNull(tc, b64);
-
-  len = strlen((char*)b64);
-  sh_util_base64_dec (data, (unsigned char*)b64, len);
-  d = data;
-  buffer = hexdigest;
-  for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
-    *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-    *buffer++ = sha2_hex_digits[*d & 0x0f];
-    d++;
-  }
-  *buffer = (char)0;
-  CuAssertStrEquals(tc, hexdigest, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
-
-  memset(hexdigest, 0, sizeof(hexdigest));
-  buffer = SHA256_Base2Hex(b64digest, hexdigest);
-  CuAssertPtrNotNull(tc, buffer);
-  CuAssertStrEquals(tc, hexdigest, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
-  CuAssertStrEquals(tc,    buffer, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
-
-  strcpy((char*)data, "The quick brown fox jumps over the lazy dog"); len = strlen((char*)data);
-  b64 = SHA256_Data(data, len, b64digest);
-  CuAssertPtrNotNull(tc, b64);
-
-  len = strlen((char*)b64);
-  sh_util_base64_dec (data, (unsigned char*)b64, len);
-  d = data;
-  buffer = hexdigest;
-  for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
-    *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-    *buffer++ = sha2_hex_digits[*d & 0x0f];
-    d++;
-  }
-  *buffer = (char)0;
-  CuAssertStrEquals(tc, hexdigest, "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592");
-
-  strcpy((char*)data, "The quick brown fox jumps over the lazy dog."); len = strlen((char*)data);
-  b64 = SHA256_Data(data, len, b64digest);
-  CuAssertPtrNotNull(tc, b64);
-
-  len = strlen((char*)b64);
-  sh_util_base64_dec (data, (unsigned char*)b64, len);
-  d = data;
-  buffer = hexdigest;
-  for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
-    *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-    *buffer++ = sha2_hex_digits[*d & 0x0f];
-    d++;
-  }
-  *buffer = (char)0;
-  CuAssertStrEquals(tc, hexdigest, "ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c");
-
-}
-
-#endif
Index: trunk/src/sh_database.c
===================================================================
--- trunk/src/sh_database.c	(revision 591)
+++ trunk/src/sh_database.c	(revision 1)
@@ -33,6 +33,4 @@
 /* #define DB_DEBUG  */
 
-#define SH_REAL_SET
-
 #include "samhain.h"
 
@@ -51,5 +49,4 @@
   int    val;
   int    size;
-  int    alen;
   size_t off;
 } my_attr;
@@ -61,5 +58,5 @@
   char            msg[1024];
   char            sev[8];
-  char            path[MAX_PATH_STORE+1];
+  char            path[12288];
   char            user[9];
   char            group[9];
@@ -75,5 +72,5 @@
   char            module[8];
   char            syscall[16];
-  char            ip[SH_IP_BUF];     
+  char            ip[16];     
   char            tty[16];    
   char            peer[64];
@@ -82,6 +79,6 @@
   char            interface[64];   
   char            ltime[64];   
-  char            dir[MAX_PATH_STORE+1];   
-  char            linked_path[MAX_PATH_STORE+1]; 
+  char            dir[1024];   
+  char            linked_path[1024]; 
   char            service[64];   
   char            facility[32];   
@@ -107,10 +104,8 @@
   char            chksum_old[50];
   char            chksum_new[50];
-  char            link_old[MAX_PATH_STORE+1];
-  char            link_new[MAX_PATH_STORE+1];
-  char            acl_old[1024];
-  char            acl_new[1024];
-
-  unsigned long   ulong_data[20];
+  char            link_old[1024];
+  char            link_new[1024];
+
+  long            long_data[20];
 
   /*
@@ -125,105 +120,90 @@
 } dbins;
 
-static my_attr * attr_tab_srch = NULL;
-static int       attr_tab_srch_siz = 0;
-
 static my_attr attr_tab[] = {
-  { NULL, N_("sev"),         0,   1,    8, 0, offsetof(struct dbins_, sev) },
-  { NULL, N_("tstamp"),      0,   2,   16, 0, offsetof(struct dbins_, time) },
-  { NULL, N_("remote_host"), 0,   3,   64, 0, offsetof(struct dbins_, host) },
-  { NULL, N_("msg"),         0,   4, 1024, 0, offsetof(struct dbins_, msg) },
-
-  { NULL, N_("path"),        0,   5,MAX_PATH_STORE+1, 0, offsetof(struct dbins_, path)  },
+  { NULL, N_("sev"),         0,   1,    8, offsetof(struct dbins_, sev) },
+  { NULL, N_("tstamp"),      0,   2,   16, offsetof(struct dbins_, time) },
+  { NULL, N_("remote_host"), 0,   3,   64, offsetof(struct dbins_, host) },
+  { NULL, N_("msg"),         0,   4, 1024, offsetof(struct dbins_, msg) },
+
+  { NULL, N_("path"),        0,   5,12288, offsetof(struct dbins_, path)  },
   /* username -> userid; replace (long) 'userid' - below - by 'dummy' */ 
-  { NULL, N_("userid"),      0,   6,    9, 0, offsetof(struct dbins_, user)  },
-  { NULL, N_("group"),       0,   7,    9, 0, offsetof(struct dbins_, group)  },
-  { NULL, N_("program"),     0,   8,    8, 0, offsetof(struct dbins_, program)  },
-  { NULL, N_("subroutine"),  0,   9,   16, 0, offsetof(struct dbins_, subroutine)},
-  { NULL, N_("status"),      0,  10,   12, 0, offsetof(struct dbins_, status)  },
-  { NULL, N_("hash"),        0,  11,   50, 0, offsetof(struct dbins_, hash)  },
-  { NULL, N_("path_data"),   0,  12, 1024, 0, offsetof(struct dbins_, path_data)  },
-  { NULL, N_("hash_data"),   0,  13,   50, 0, offsetof(struct dbins_, hash_data)  },
-  { NULL, N_("key_uid"),     0,  14,   64, 0, offsetof(struct dbins_, key_uid)  },
-  { NULL, N_("key_uid_data"),0,  15,   64, 0, offsetof(struct dbins_, key_uid_data)},
-  { NULL, N_("key_id"),      0,  16,   16, 0, offsetof(struct dbins_, key_id)  },
-  { NULL, N_("module"),      0,  17,    8, 0, offsetof(struct dbins_, module)  },
-  { NULL, N_("syscall"),     0,  19,   16, 0, offsetof(struct dbins_, syscall)  },
-  { NULL, N_("ip"),          0,  20,SH_IP_BUF, 0, offsetof(struct dbins_, ip)  },
-  { NULL, N_("tty"),         0,  21,   16, 0, offsetof(struct dbins_, tty)  },
-  { NULL, N_("peer"),        0,  22,   64, 0, offsetof(struct dbins_, peer)  },
-  { NULL, N_("obj"),         0,  23, 1024, 0, offsetof(struct dbins_, obj)  },
-  { NULL, N_("interface"),   0,  24,   64, 0, offsetof(struct dbins_, interface)},
-  { NULL, N_("time"),        0,  25,   64, 0, offsetof(struct dbins_, ltime)  },
-  { NULL, N_("dir"),         0,  26, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, dir)  },
-  { NULL, N_("linked_path"), 0,  27, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, linked_path)},
-  { NULL, N_("service"),     0,  29,   64, 0, offsetof(struct dbins_, service)},
-  { NULL, N_("facility"),    0,  30,   32, 0, offsetof(struct dbins_, facility) },
-  { NULL, N_("priority"),    0,  31,   32, 0, offsetof(struct dbins_, priority) },
-  { NULL, N_("syslog_msg"),  0,  32, 1024, 0, offsetof(struct dbins_, syslog_msg)  },
-
-  { NULL, N_("mode_old"),    0,  33,   16, 0, offsetof(struct dbins_, mode_old) },
-  { NULL, N_("mode_new"),    0,  34,   16, 0, offsetof(struct dbins_, mode_new) },
-  { NULL, N_("device_old"),  0,  35,   16, 0, offsetof(struct dbins_, device_old)}, 
-  { NULL, N_("device_new"),  0,  36,   16, 0, offsetof(struct dbins_, device_new)},
-  { NULL, N_("owner_old"),   0,  37,    9, 0, offsetof(struct dbins_, owner_old)},
-  { NULL, N_("owner_new"),   0,  38,    9, 0, offsetof(struct dbins_, owner_new)},
-  { NULL, N_("group_old"),   0,  39,    9, 0, offsetof(struct dbins_, group_old)},
-  { NULL, N_("group_new"),   0,  40,    9, 0, offsetof(struct dbins_, group_new)},
-  { NULL, N_("ctime_old"),   0,  41,   20, 0, offsetof(struct dbins_, ctime_old)},
-  { NULL, N_("ctime_new"),   0,  42,   20, 0, offsetof(struct dbins_, ctime_new)},
-  { NULL, N_("atime_old"),   0,  43,   20, 0, offsetof(struct dbins_, atime_old)},
-  { NULL, N_("atime_new"),   0,  44,   20, 0, offsetof(struct dbins_, atime_new)},
-  { NULL, N_("mtime_old"),   0,  45,   20, 0, offsetof(struct dbins_, mtime_old)},
-  { NULL, N_("mtime_new"),   0,  46,   20, 0, offsetof(struct dbins_, mtime_new)},
-  { NULL, N_("chksum_old"),  0,  47,   50, 0, offsetof(struct dbins_, chksum_old)},
-  { NULL, N_("chksum_new"),  0,  48,   50, 0, offsetof(struct dbins_, chksum_new)},
-  { NULL, N_("link_old"),    0,  49, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_old)},
-  { NULL, N_("link_new"),    0,  50, MAX_PATH_STORE+1, 0, offsetof(struct dbins_, link_new)},
-
-  /* These go into  dbins.ulong_data[n - START_SEC_LONGS] */             				    
-  { NULL, N_("size_old"),     0,  51,    0, 0, 0  },
-  { NULL, N_("size_new"),     0,  52,    0, 0, 0  },
-  { NULL, N_("hardlinks_old"),0,  53,    0, 0, 0  },
-  { NULL, N_("hardlinks_new"),0,  54,    0, 0, 0  },
-  { NULL, N_("inode_old"),    0,  55,    0, 0, 0  }, 
-  { NULL, N_("inode_new"),    0,  56,    0, 0, 0  }, 
-					    
-  { NULL, N_("imode_old"),    0,  57,    0, 0, 0  },
-  { NULL, N_("imode_new"),    0,  58,    0, 0, 0  },
-  { NULL, N_("iattr_old"),    0,  59,    0, 0, 0  },
-  { NULL, N_("iattr_new"),    0,  60,    0, 0, 0  },
-  { NULL, N_("idevice_old"),  0,  61,    0, 0, 0  }, 
-  { NULL, N_("idevice_new"),  0,  62,    0, 0, 0  }, 
-  { NULL, N_("iowner_old"),   0,  63,    0, 0, 0  },
-  { NULL, N_("iowner_new"),   0,  64,    0, 0, 0  },
-  { NULL, N_("igroup_old"),   0,  65,    0, 0, 0  },
-  { NULL, N_("igroup_new"),   0,  66,    0, 0, 0  },
-
-  { NULL, N_("port"),         0,  67,    0, 0, 0  },
-  { NULL, N_("return_code"),  0,  68,    0, 0, 0  },
-
-  { NULL, N_("checkflags_old"), 0,  69,    0, 0, 0  },
-  { NULL, N_("checkflags_new"), 0,  70,    0, 0, 0  },
-
-  /* END_SEC_LONGS                                         */
-
-  { NULL, N_("host"),         0,  71,   64, 0, offsetof(struct dbins_, fromhost)},
-  { NULL, N_("attr_old"),     0,  72,   16, 0, offsetof(struct dbins_, attr_old)},
-  { NULL, N_("attr_new"),     0,  73,   16, 0, offsetof(struct dbins_, attr_new)},
-  { NULL, N_("acl_old"),      0,  74, 1024, 0, offsetof(struct dbins_, acl_old)},
-  { NULL, N_("acl_new"),      0,  75, 1024, 0, offsetof(struct dbins_, acl_new)},
-
-  { NULL, NULL,      0,  0, 0, 0, 0 }
+  { NULL, N_("userid"),      0,   6,    9, offsetof(struct dbins_, user)  },
+  { NULL, N_("group"),       0,   7,    9, offsetof(struct dbins_, group)  },
+  { NULL, N_("program"),     0,   8,    8, offsetof(struct dbins_, program)  },
+  { NULL, N_("subroutine"),  0,   9,   16, offsetof(struct dbins_, subroutine)},
+  { NULL, N_("status"),      0,  10,   12, offsetof(struct dbins_, status)  },
+  { NULL, N_("hash"),        0,  11,   50, offsetof(struct dbins_, hash)  },
+  { NULL, N_("path_data"),   0,  12, 1024, offsetof(struct dbins_, path_data)  },
+  { NULL, N_("hash_data"),   0,  13,   50, offsetof(struct dbins_, hash_data)  },
+  { NULL, N_("key_uid"),     0,  14,   64, offsetof(struct dbins_, key_uid)  },
+  { NULL, N_("key_uid_data"),0,  15,   64, offsetof(struct dbins_, key_uid_data)},
+  { NULL, N_("key_id"),      0,  16,   16, offsetof(struct dbins_, key_id)  },
+  { NULL, N_("module"),      0,  17,    8, offsetof(struct dbins_, module)  },
+  { NULL, N_("syscall"),     0,  19,   16, offsetof(struct dbins_, syscall)  },
+  { NULL, N_("ip"),          0,  20,   16, offsetof(struct dbins_, ip)  },
+  { NULL, N_("tty"),         0,  21,   16, offsetof(struct dbins_, tty)  },
+  { NULL, N_("peer"),        0,  22,   64, offsetof(struct dbins_, peer)  },
+  { NULL, N_("obj"),         0,  23, 1024, offsetof(struct dbins_, obj)  },
+  { NULL, N_("interface"),   0,  24,   64, offsetof(struct dbins_, interface)},
+  { NULL, N_("time"),        0,  25,   64, offsetof(struct dbins_, ltime)  },
+  { NULL, N_("dir"),         0,  26, 1024, offsetof(struct dbins_, dir)  },
+  { NULL, N_("linked_path"), 0,  27, 1024, offsetof(struct dbins_, linked_path)},
+  { NULL, N_("service"),     0,  29,   64, offsetof(struct dbins_, service)},
+  { NULL, N_("facility"),    0,  30,   32, offsetof(struct dbins_, facility) },
+  { NULL, N_("priority"),    0,  31,   32, offsetof(struct dbins_, priority) },
+  { NULL, N_("syslog_msg"),  0,  32, 1024, offsetof(struct dbins_, syslog_msg)  },
+
+  { NULL, N_("mode_old"),    0,  33,   16, offsetof(struct dbins_, mode_old) },
+  { NULL, N_("mode_new"),    0,  34,   16, offsetof(struct dbins_, mode_new) },
+  { NULL, N_("device_old"),  0,  35,   16, offsetof(struct dbins_, device_old)}, 
+  { NULL, N_("device_new"),  0,  36,   16, offsetof(struct dbins_, device_new)},
+  { NULL, N_("owner_old"),   0,  37,    9, offsetof(struct dbins_, owner_old)},
+  { NULL, N_("owner_new"),   0,  38,    9, offsetof(struct dbins_, owner_new)},
+  { NULL, N_("group_old"),   0,  39,    9, offsetof(struct dbins_, group_old)},
+  { NULL, N_("group_new"),   0,  40,    9, offsetof(struct dbins_, group_new)},
+  { NULL, N_("ctime_old"),   0,  41,   20, offsetof(struct dbins_, ctime_old)},
+  { NULL, N_("ctime_new"),   0,  42,   20, offsetof(struct dbins_, ctime_new)},
+  { NULL, N_("atime_old"),   0,  43,   20, offsetof(struct dbins_, atime_old)},
+  { NULL, N_("atime_new"),   0,  44,   20, offsetof(struct dbins_, atime_new)},
+  { NULL, N_("mtime_old"),   0,  45,   20, offsetof(struct dbins_, mtime_old)},
+  { NULL, N_("mtime_new"),   0,  46,   20, offsetof(struct dbins_, mtime_new)},
+  { NULL, N_("chksum_old"),  0,  47,   50, offsetof(struct dbins_, chksum_old)},
+  { NULL, N_("chksum_new"),  0,  48,   50, offsetof(struct dbins_, chksum_new)},
+  { NULL, N_("link_old"),    0,  49, 1024, offsetof(struct dbins_, link_old)},
+  { NULL, N_("link_new"),    0,  50, 1024, offsetof(struct dbins_, link_new)},
+               
+  { NULL, N_("size_old"),     0,  51,    0, 0  },
+  { NULL, N_("size_new"),     0,  52,    0, 0  },
+  { NULL, N_("hardlinks_old"),0,  53,    0, 0  },
+  { NULL, N_("hardlinks_new"),0,  54,    0, 0  },
+  { NULL, N_("inode_old"),    0,  55,    0, 0  }, 
+  { NULL, N_("inode_new"),    0,  56,    0, 0  }, 
+
+  { NULL, N_("imode_old"),    0,  57,    0, 0  },
+  { NULL, N_("imode_new"),    0,  58,    0, 0  },
+  { NULL, N_("iattr_old"),    0,  59,    0, 0  },
+  { NULL, N_("iattr_new"),    0,  60,    0, 0  },
+  { NULL, N_("idevice_old"),  0,  61,    0, 0  }, 
+  { NULL, N_("idevice_new"),  0,  62,    0, 0  }, 
+  { NULL, N_("iowner_old"),   0,  63,    0, 0  },
+  { NULL, N_("iowner_new"),   0,  64,    0, 0  },
+  { NULL, N_("igroup_old"),   0,  65,    0, 0  },
+  { NULL, N_("igroup_new"),   0,  66,    0, 0  },
+
+  { NULL, N_("port"),         0,  67,    0, 0  },
+  { NULL, N_("return_code"),  0,  68,    0, 0  },
+  /* { NULL, N_("userid"),        0,  69,    0, 0  }, old 'userid', 1.8.1 */
+
+  { NULL, N_("host"),         0,  70,   64, offsetof(struct dbins_, fromhost)},
+  { NULL, N_("attr_old"),     0,  71,   16, offsetof(struct dbins_, attr_old)},
+  { NULL, N_("attr_new"),     0,  72,   16, offsetof(struct dbins_, attr_new)},
+
+  { NULL, NULL,      0,  0, 0, 0 }
 };
 
-#define SH_SLOT_CHECKFLAGS 69
-
-/* need special attention b/o reserved SQL words    */
-#define SH_SLOT_HOST    71
+#define SH_SLOT_HOST    70
 #define SH_SLOT_GROUP    7
-
-/* these go into dbins.ulong_data[n-START_SEC_LONGS */
 #define START_SEC_LONGS 51
-#define END_SEC_LONGS   70
+#define END_SEC_LONGS   68
 
 #if defined(HAVE_INT_32)
@@ -239,15 +219,13 @@
 typedef unsigned char uint8;
 
-typedef struct md5_ctx
-{
-  uint32 A;
-  uint32 B;
-  uint32 C;
-  uint32 D;
-
-  uint32 total[2];
-  uint32 buflen;
-  char buffer[128];
+typedef struct
+{
+        uint32 h[4];
+        uint32 data[16];
+        uint8  offset;
+        uint32  nblocks;
+        int  count;
 } md5Param;
+
 
 
@@ -267,10 +245,10 @@
 static int  sh_persistent_dbconn = S_TRUE;
 
-int sh_database_use_persistent (const char * str)
+int sh_database_use_persistent (char * str)
 {
   return sh_util_flagval (str, &sh_persistent_dbconn);
 }
 
-static int insert_value (char * ptr, const char * str)
+static int insert_value (char * ptr, char * str)
 {
   if (!ptr || !str)
@@ -284,5 +262,5 @@
 static void init_db_entry (dbins * ptr)
 {
-  memset (ptr, 0, sizeof(dbins));
+  memset (ptr, (int) '\0', sizeof(dbins));
   ptr->next = NULL;
   return;
@@ -290,21 +268,21 @@
   
 
-int sh_database_set_database (const char * str)
+int sh_database_set_database (char * str)
 {
   return insert_value (db_name, str);
 }
-int sh_database_set_table (const char * str)
+int sh_database_set_table (char * str)
 {
   return insert_value (db_table, str);
 }
-int sh_database_set_host (const char * str)
+int sh_database_set_host (char * str)
 {
   return insert_value (db_host, str);
 }
-int sh_database_set_user (const char * str)
+int sh_database_set_user (char * str)
 {
   return insert_value (db_user, str);
 }
-int sh_database_set_password (const char * str)
+int sh_database_set_password (char * str)
 {
   return insert_value (db_password, str);
@@ -511,5 +489,4 @@
 static    OCIError  * o_error = NULL;
 static    OCIStmt   * o_statement;
-static    OCIBind   * o_bind = (OCIBind *) 0;
 static    text        o_errormsg[512];
 static    sb4         o_errorcode;
@@ -537,5 +514,5 @@
     {
       if (str[len-1] == '\n')
-	str[len-1] = '\0';
+	str[len-1] == '\0';
     }
   return str;
@@ -549,6 +526,4 @@
   char         row_query[128];
   int          retry     = 0;
-  static SH_TIMEOUT sh_timer = { 0, 3600, S_TRUE };
-
 
   SL_ENTER(_("sh_database_query"));
@@ -585,5 +560,5 @@
  oracle_doconnect:
 
-  if (!getenv("ORACLE_HOME")) /* flawfinder: ignore */
+  if (!getenv("ORACLE_HOME")) 
     {
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
@@ -648,39 +623,27 @@
 	       (OraText*) db_password, sl_strlen(db_password), 
 	       (OraText*) db_name,     sl_strlen(db_name))) 
-      {
-   
-	connected = 0;
-
-	sh_timer.flag_ok = S_FALSE;
-
-	if (S_TRUE == sh_util_timeout_check(&sh_timer))
-	  {
-	    OCIErrorGet(o_error, 1, NULL, &o_errorcode, 
-			o_errormsg, sizeof(o_errormsg), OCI_HTYPE_ERROR);
-	    sh_stripnl (o_errormsg);
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    o_errormsg, 
-			    _("sh_database_query"));
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    _("check database is listed in tnsnames.ora"), 
-			    _("sh_database_query"));
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    _("check tnsnames.ora readable"), 
-			    _("sh_database_query"));
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    _("check database accessible with sqlplus"), 
-			    _("sh_database_query"));
-	    sl_snprintf(row_query, 127, 
-			_("OCILogon: Connection to database '%s' failed"), 
-			db_name); 
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			    row_query, _("sh_database_query")); 
-
-	    goto err_out;
-	  }
-	else
-	  {
-	    SL_RETURN(0, _("sh_database_query"));
-	  }
+      {   
+	OCIErrorGet(o_error, 1, NULL, &o_errorcode, 
+		    o_errormsg, sizeof(o_errormsg), OCI_HTYPE_ERROR);
+	sh_stripnl (o_errormsg);
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			o_errormsg, 
+			_("sh_database_query"));
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			_("check database is listed in tnsnames.ora"), 
+			_("sh_database_query"));
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			_("check tnsnames.ora readable"), 
+			_("sh_database_query"));
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			_("check database accessible with sqlplus"), 
+			_("sh_database_query"));
+	sl_snprintf(row_query, 127, 
+		    _("OCILogon: Connection to database '%s' failed"), 
+		    db_name); 
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+			row_query, _("sh_database_query")); 
+	bad_init = 1;
+	SL_RETURN(-1, _("sh_database_query")); 
       }
  
@@ -695,16 +658,15 @@
  oracle_connected:
 
-  /* Get row index
-   */
-  sl_strlcpy (row_query, _("SELECT log_log_index_seq.NEXTVAL FROM dual"), 128);
-
+  /* 
+   * Insert
+   */
 #ifdef DB_DEBUG
   sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		  row_query, 
+		  query, 
 		  _("sh_database_query"));
 #endif
 
   if (OCIStmtPrepare(o_statement, o_error, 
-		     (OraText*) row_query, sl_strlen(row_query), 
+		     (OraText*) query, sl_strlen(query), 
 		     OCI_NTV_SYNTAX, OCI_DEFAULT))
     {
@@ -717,5 +679,5 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
 	  { 
 	    ++retry; sh_database_reset(); goto oracle_doconnect; 
@@ -723,7 +685,8 @@
       goto err_out;
     }
-
-  if (OCIStmtExecute(o_servicecontext, o_statement, o_error, 
-		     0, 0, NULL, NULL, OCI_DEFAULT))
+ 
+   if (OCIStmtExecute(o_servicecontext, 
+		      o_statement, o_error, 1,  0, 
+		      NULL, NULL, OCI_COMMIT_ON_SUCCESS))
     {
       OCIErrorGet(o_error, 1, NULL, 
@@ -735,5 +698,5 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
 	  { 
 	    ++retry; sh_database_reset(); goto oracle_doconnect; 
@@ -742,7 +705,24 @@
     }
 
-  if (OCIDefineByPos (o_statement, &o_define, o_error, 1, 
-		      &result, sizeof(result), 
-		      SQLT_INT, 0, 0, 0, OCI_DEFAULT))
+#ifdef DB_DEBUG
+  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		  _("No error on insert"), 
+		  _("sh_database_query"));
+#endif
+
+  /* Get row index
+   */
+  sl_strlcpy (row_query, _("SELECT MAX(log_index) FROM "), 128);
+  sl_strlcat (row_query, db_table, 128);
+
+#ifdef DB_DEBUG
+  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		  row_query, 
+		  _("sh_database_query"));
+#endif
+
+  if (OCIStmtPrepare(o_statement, o_error, 
+		     (OraText*) row_query, sl_strlen(row_query), 
+		     OCI_NTV_SYNTAX, OCI_DEFAULT))
     {
       OCIErrorGet(o_error, 1, NULL, 
@@ -754,5 +734,5 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
 	  { 
 	    ++retry; sh_database_reset(); goto oracle_doconnect; 
@@ -760,5 +740,7 @@
       goto err_out;
     }
-  if (OCIStmtFetch (o_statement, o_error, 1, OCI_FETCH_NEXT, OCI_DEFAULT))
+
+  if (OCIStmtExecute(o_servicecontext, o_statement, o_error, 
+		     0, 0, NULL, NULL, OCI_DEFAULT))
     {
       OCIErrorGet(o_error, 1, NULL, 
@@ -770,5 +752,5 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
 	  { 
 	    ++retry; sh_database_reset(); goto oracle_doconnect; 
@@ -776,25 +758,8 @@
       goto err_out;
     }
-  
-#ifdef DB_DEBUG
-  sl_snprintf(row_query, 127, _("Returned value: %d"), result); 
-  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		  row_query, 
-		  _("sh_database_query"));
-#endif
-
-  *id = result;
-
-  /* do the insert
-   */
-#ifdef DB_DEBUG
-  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		  query, 
-		  _("sh_database_query"));
-#endif
-
-  if (OCIStmtPrepare(o_statement, o_error, 
-		     (OraText*) query, sl_strlen(query), 
-		     OCI_NTV_SYNTAX, OCI_DEFAULT))
+
+  if (OCIDefineByPos (o_statement, &o_define, o_error, 1, 
+		      &result, sizeof(result), 
+		      SQLT_INT, 0, 0, 0, OCI_DEFAULT))
     {
       OCIErrorGet(o_error, 1, NULL, 
@@ -806,14 +771,11 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
-	{ 
-	  ++retry; sh_database_reset(); goto oracle_doconnect; 
-	}
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
+	  { 
+	    ++retry; sh_database_reset(); goto oracle_doconnect; 
+	  }
       goto err_out;
     }
- 
-  if (OCIBindByPos(o_statement, &o_bind, o_error, 1,
-		   (dvoid *) &result, (sword) sizeof(result), SQLT_INT, 
-		   (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT))
+  if (OCIStmtFetch (o_statement, o_error, 1, OCI_FETCH_NEXT, OCI_DEFAULT))
     {
       OCIErrorGet(o_error, 1, NULL, 
@@ -825,5 +787,5 @@
 		      _("sh_database_query"));
       if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
+	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9)) 
 	  { 
 	    ++retry; sh_database_reset(); goto oracle_doconnect; 
@@ -831,29 +793,13 @@
       goto err_out;
     }
-
-   if (OCIStmtExecute(o_servicecontext, 
-		      o_statement, o_error, 1,  0, 
-		      NULL, NULL, OCI_COMMIT_ON_SUCCESS))
-    {
-      OCIErrorGet(o_error, 1, NULL, 
-		  &o_errorcode, o_errormsg, sizeof(o_errormsg), 
-		  OCI_HTYPE_ERROR);
-      sh_stripnl (o_errormsg);
-      sh_error_handle((-1), FIL__, __LINE__, (long) o_errorcode, MSG_E_SUBGEN,
-		      o_errormsg, 
-		      _("sh_database_query"));
-      if (retry == 0 && 
-	  (3114 == o_errorcode || 0 == strncmp(o_errormsg, _("ORA-03114"), 9))) 
-	  { 
-	    ++retry; sh_database_reset(); goto oracle_doconnect; 
-	  }
-      goto err_out;
-    }
-
+  
 #ifdef DB_DEBUG
+  sl_snprintf(row_query, 127, _("Returned value: %d"), result); 
   sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		  _("No error on insert"), 
+		  row_query, 
 		  _("sh_database_query"));
 #endif
+
+  *id = result;
 
   if (sh_persistent_dbconn == S_FALSE)
@@ -872,6 +818,13 @@
    * Error
    */
-  sh_database_reset();
-
+  if (sh_persistent_dbconn == S_FALSE)
+    {
+      OCILogoff(o_servicecontext, o_error);
+      OCIHandleFree((dvoid *) o_statement,      OCI_HTYPE_STMT);
+      OCIHandleFree((dvoid *) o_servicecontext, OCI_HTYPE_SVCCTX);
+      OCIHandleFree((dvoid *) o_error,          OCI_HTYPE_ERROR);
+      o_error = NULL;
+      connected = 0;
+    }
   SL_RETURN(-1, _("sh_database_query"));
 }
@@ -887,14 +840,8 @@
  ******************************************************************/
 
-#if defined(HAVE_PGSQL_LIBPQ_FE_H)
+#ifdef HAVE_PGSQL_LIBPQ_FE_H
 #include <pgsql/libpq-fe.h>
-#elif defined(HAVE_POSTGRESQL_LIBPQ_FE_H)
-#include <postgresql/libpq-fe.h>
 #else
-#if !defined(USE_UNO)
 #include <libpq-fe.h>
-#else
-#include <postgresql/libpq-fe.h>
-#endif
 #endif
 
@@ -915,6 +862,4 @@
   PGresult        * res;
   unsigned int      i;
-  const char      * params[1];
-  char              id_param[32];
   static SH_TIMEOUT sh_timer = { 0, 3600, S_TRUE };
 
@@ -987,29 +932,26 @@
 
 
-  /* get the unique row index
-   */
-  res = PQexec(conn, _("SELECT NEXTVAL('log_log_index_seq')"));
-  if (PQresultStatus(res) != PGRES_TUPLES_OK) 
+  /* do the insert
+   */
+  res = PQexec(conn, query);
+  if (PQresultStatus(res) != PGRES_COMMAND_OK) 
     {
       PQclear(res);
       goto err_out;
     }
-
-  *id = atoi (PQgetvalue(res, 0, 0)); 
   PQclear(res);
 
-  sl_snprintf(id_param, 32, "%ld", *id);
-  params[0] = id_param;
-
-  /* do the insert
-   */
-  res = PQexecParams(conn, query, 1, NULL, params, NULL, NULL, 1);
-  if (PQresultStatus(res) != PGRES_COMMAND_OK) 
+  /* get the unique row index
+   */
+  res = PQexec(conn, _("SELECT last_value FROM log_log_index_seq"));
+  if (PQresultStatus(res) != PGRES_TUPLES_OK) 
     {
       PQclear(res);
       goto err_out;
     }
+
+  *id = atoi (PQgetvalue(res, 0, 0)); 
+
   PQclear(res);
-
   if (S_FALSE == sh_persistent_dbconn)
     {
@@ -1057,5 +999,5 @@
 static int        connection_status = S_FALSE;
 
-void sh_database_reset(void)
+void sh_database_reset()
 {
   connection_status = S_FALSE;
@@ -1067,5 +1009,5 @@
 {
   int               status = 0;
-  const char      * p;
+  char            * p;
   static MYSQL    * db_conn = NULL;
   static SH_TIMEOUT sh_timer = { 0, 3600, S_TRUE };
@@ -1114,15 +1056,4 @@
 	}
 
-      /* Read in defaults from /etc/my.cnf and associated files,
-       * suggested by arjones at simultan dyndns org
-       * see: - http://dev.mysql.com/doc/refman/5.0/en/option-files.html
-       *        for the my.cnf format,
-       *      - http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html
-       *        for possible options
-       * We don't check the return value because it's useless (failure due 
-       * to lack of access permission is not reported).
-       */
-      mysql_options(db_conn, MYSQL_READ_DEFAULT_GROUP, _("samhain"));
-
       status = 0;
   
@@ -1144,5 +1075,4 @@
 	    }
 	}
-      
       connection_status = S_TRUE;
     }
@@ -1169,5 +1099,5 @@
     }
 
-  if (flag_err_debug == S_TRUE)
+  if (flag_err_debug == SL_TRUE)
     {
       p = mysql_info (db_conn);
@@ -1221,30 +1151,32 @@
   long len;
 
-  if (!((end == NULL) || (val == NULL) || (size == NULL)))
-    {
-      if (val[0] != '\0')
-	{
-	  if (*size > 1)
-	    {
-	      *end = ','; ++end; (*size) -= 1;
-	      if (flag == 1) { *end = '\''; ++end; (*size) -= 1; }
-	      *end = '\0';
-	    }
-	  len = (long) strlen(val);
-	  if ((long) *size > (len+1))
-	    {
-	      (void) sl_strlcat(end, val, (size_t) *size);
-	      end   += len; (*size) -= len;
-	      if (flag == 1) { *end = '\''; ++end;  (*size) -= 1; }
-	      *end = '\0'; 
-	    }
-	}
-    }
-  
+  if (!end    || !val   || !size)
+    return end;
+
+  if (val[0] == '\0')
+    {
+      return end;
+    }
+  else
+    {
+      if (*size > 1)
+	{
+	  *end = ','; ++end; (*size) -= 1;
+	  if (flag == 1) { *end = '\''; ++end; (*size) -= 1; }
+	  *end = '\0';
+	}
+      len = (long) strlen(val);
+      if ((long) *size > (len+1))
+	{
+	  (void) sl_strlcat(end, val, (size_t) *size);
+	  end   += len; (*size) -= len;
+	  if (flag == 1) { *end = '\''; ++end;  (*size) -= 1; }
+	  *end = '\0'; 
+	}
+    }
   return end;
 }
 
-#define SH_QUERY_MAX SH_MSG_BUF
-/* define SH_QUERY_MAX 16383 */
+#define SH_QUERY_MAX 16383
 
 static
@@ -1257,4 +1189,5 @@
   char * values;
 
+  int    status;
   long   the_id;
   int    size;
@@ -1271,7 +1204,4 @@
   int  cnt;
 
-  size_t len_val;
-  size_t len_col;
-
   SL_ENTER(_("sh_database_entry"));
 
@@ -1294,10 +1224,10 @@
   /*@+bufferoverflowhigh@*/
 
-#if defined(WITH_ORACLE)
+#ifdef WITH_ORACLE
   /* Oracle needs some help for the time format (fix by Michael Somers)
    */
   (void)
   sl_snprintf (values, SH_QUERY_MAX,  
-	       _("(:1,%s,%c%s%c,to_date(%c%s%c,'YYYY-MM-DD HH24:MI:SS'),%c%s%c,%c%s%c"),
+	       _("(%s,%c%s%c,to_date(%c%s%c,'YYYY-MM-DD HH24:MI:SS'),%c%s%c,%c%s%c"),
                id >= 0 ? num : _("NULL"),
                '\'', db_entry->host,'\'', 
@@ -1307,21 +1237,4 @@
                (db_entry->msg[0] == '\0' ? _("NULL") : db_entry->msg),
                '\'');
-  (void) sl_snprintf (columns, 1023, 
-		      _("(log_index,log_ref,log_host,log_time,log_sev,log_msg"));
-#elif defined(WITH_POSTGRES)
-  /* Prepare query for PQexecParams
-   */
-  (void)
-  sl_snprintf (values, SH_QUERY_MAX, 
-	       _("($1,%s,%c%s%c,%c%s%c,%c%s%c,%c%s%c"),
-	       id >= 0 ? num : _("NULL"),
-	       '\'', db_entry->host,'\'', 
-	       '\'', db_entry->time,'\'', 
-	       '\'', db_entry->sev, '\'',
-	       '\'', 
-	       (db_entry->msg[0] == '\0' ? _("NULL") : db_entry->msg), 
-	       '\'');
-  (void) sl_snprintf (columns, 1023, 
-		      _("(log_index,log_ref,log_host,log_time,log_sev,log_msg"));
 #else
   (void)
@@ -1334,8 +1247,8 @@
 	       (db_entry->msg[0] == '\0' ? _("NULL") : db_entry->msg), 
 	       '\'');
+#endif
+
   (void) sl_snprintf (columns, 1023, 
 		      _("(log_ref,log_host,log_time,log_sev,log_msg"));
-#endif
-
 
   /*@-type@*//* byte* versus char[..] */
@@ -1354,11 +1267,8 @@
   /*@+type@*/
 
-  len_val = strlen(values);
-  size    =  (int) (SH_QUERY_MAX - len_val);
-  end     =  values + len_val;
-
-  len_col = strlen(columns);
-  c_size  =  1023   - (int) len_col; /* sizeof(colums) == 1024 */
-  c_end   =  columns + len_col;
+  size   =  (int) (SH_QUERY_MAX - strlen(values));
+  end    =  values + strlen(values);
+  c_size =  1023   - (int) strlen(columns); /* sizeof(colums) == 1024 */
+  c_end  =  columns + strlen(columns);
 
   i = 4;
@@ -1366,10 +1276,4 @@
   while (attr_tab[i].attr != NULL)
     {
-      if (SH_SLOT_CHECKFLAGS == attr_tab[i].val) {
-	if (db_entry->ulong_data[attr_tab[i].val-START_SEC_LONGS] == 0 &&
-	    db_entry->ulong_data[attr_tab[i+1].val-START_SEC_LONGS] == 0)
-	  { i+= 2; continue; } 
-      }
-
       if (attr_tab[i].size != 0)
 	{
@@ -1386,26 +1290,20 @@
 	  if (p != end)
 	    {
-	      if ((attr_tab[i].val != SH_SLOT_HOST) &&
-		  (attr_tab[i].val != SH_SLOT_GROUP))
-		{
-		  c_end = null_or_val (c_end, attr_tab[i].attr, &c_size,0);
-		}
+	      /* 
+	       * 'host' is a reserved word in SQL
+	       */
+	      if (attr_tab[i].val == SH_SLOT_HOST)
+		c_end = null_or_val (c_end, _("fromhost"), &c_size,0);
+	      /* 
+	       * 'group' is a reserved word in SQL
+	       */
+	      else if (attr_tab[i].val == SH_SLOT_GROUP)
+		c_end = null_or_val (c_end, _("grp"), &c_size,0);
 	      else
-		{
-		  /* 
-		   * 'host' is a reserved word in SQL
-		   */
-		  if (attr_tab[i].val == SH_SLOT_HOST)
-		    c_end = null_or_val (c_end, _("fromhost"), &c_size,0);
-		  /* 
-		   * 'group' is a reserved word in SQL
-		   */
-		  else /* if (attr_tab[i].val == SH_SLOT_GROUP) */
-		    c_end = null_or_val (c_end, _("grp"), &c_size,0);
-		}
+		c_end = null_or_val (c_end, attr_tab[i].attr, &c_size,0);
 	    }
 	  /*@-type@*//* byte* versus char[..] */
 	  if (attr_tab[i].inHash == 1 && 
-	      *((char *)(db_entry)+attr_tab[i].off) != '\0')
+	      ((char *)(db_entry)+attr_tab[i].off) != '\0')
 	    {
 	      (void)md5Update(&crc, 
@@ -1419,6 +1317,6 @@
 	{
 	  (void)
-	  sl_snprintf(end, (size_t)(size-1), _(",\'%lu\'"), 
-		      db_entry->ulong_data[attr_tab[i].val-START_SEC_LONGS]);
+	  sl_snprintf(end, (size_t)(size-1), _(",\'%ld\'"), 
+		      db_entry->long_data[attr_tab[i].val-START_SEC_LONGS]);
 	  while (*end != '\0') { ++end; --size; }
 	  (void) sl_snprintf(c_end, (size_t)(c_size-1), 
@@ -1430,5 +1328,5 @@
 	      (void)
 	      md5Update(&crc,
-			(sh_byte *) db_entry->ulong_data[attr_tab[i].val-START_SEC_LONGS], 
+			(sh_byte *) db_entry->long_data[attr_tab[i].val-START_SEC_LONGS], 
 			sizeof(long));
 	      /*@+type@*/
@@ -1463,5 +1361,5 @@
 		      db_table, columns, values);
 
-  sh_database_query (query, &the_id);
+  status = sh_database_query (query, &the_id);
 
   /*@-usedef@*//* no, 'values' is allocated here */
@@ -1473,66 +1371,45 @@
 }
  
-static int sh_database_comp_attr (const void *m1, const void *m2) 
-{
-  const my_attr *mi1 = (const my_attr *) m1;
-  const my_attr *mi2 = (const my_attr *) m2;
-  return strcmp(mi1->attr, mi2->attr);
-}
-
-
-static void init_attr_table(void)
+
+static void init_attr_table()
 {
   static  int first = S_TRUE;
-  int         i, j;
+  int         i;
 
 #ifdef SH_STEALTH
-  int     k;
-
-  if (first == S_FALSE)
-    return;
-
-  i = 0;
-  while (attr_tab[i].attr_o != NULL)
-    {
-      j = strlen(attr_tab[i].attr_o);
-      attr_tab[i].attr = calloc(1, j+1); /* only once */
-      if (NULL == attr_tab[i].attr)
-	return;
-      for (k = 0; k < j; ++k)
-	attr_tab[i].attr[k] = attr_tab[i].attr_o[k] ^ XOR_CODE;
-      attr_tab[i].attr[j] = '\0';
-      attr_tab[i].alen = strlen(attr_tab[i].attr_o);
-      ++i;
-    }
-  first = S_FALSE;
-
+  int     j, k;
+
+  if (first == S_TRUE)
+    {
+      i = 0;
+      while (attr_tab[i].attr_o != NULL)
+	{
+	  j = strlen(attr_tab[i].attr_o);
+	  attr_tab[i].attr = malloc (j+1); /* only once */
+	  if (NULL == attr_tab[i].attr)
+	    SL_RETURN (NULL, _("sh_database_parse"));
+	  for (k = 0; k < j; ++k)
+	    attr_tab[i].attr[k] = attr_tab[i].attr_o[k] ^ XOR_CODE;
+	  attr_tab[i].attr[j] = '\0';
+	  ++i;
+	}
+      first = S_FALSE;
+    }
 #else
-
-  if (first == S_FALSE)
-    return;
-
-  i = 0;
-  while (attr_tab[i].attr_o != NULL)
-    {
-      attr_tab[i].attr = attr_tab[i].attr_o;
-      attr_tab[i].alen = strlen(attr_tab[i].attr_o);
-      ++i;
-    }
-  first = S_FALSE;
-
+  if (first == S_TRUE)
+    {
+      i = 0;
+      while (attr_tab[i].attr_o != NULL)
+	{
+	  attr_tab[i].attr = attr_tab[i].attr_o;
+	  ++i;
+	}
+      first = S_FALSE;
+    }
 #endif
-
-  /* create a sorted table for binary search
-   */
-  attr_tab_srch = SH_ALLOC(i * sizeof(my_attr));
-  for (j=0; j<i; ++j)
-    memcpy(&attr_tab_srch[j], &attr_tab[j], sizeof(my_attr));
-  qsort(attr_tab_srch, i, sizeof(my_attr), sh_database_comp_attr);
-  attr_tab_srch_siz = i;
-
   return;
 }
 
-int sh_database_add_to_hash  (const char * str)
+int sh_database_add_to_hash  (char * str)
 {
   int i;
@@ -1555,53 +1432,26 @@
 }
 
-static int is_escaped(char * p_in) {
+static int is_escaped(char * p) {
 
   int    escp = 0;
   int    retv = S_TRUE;
-  unsigned char * p = (unsigned char *) p_in;
-
-  if (*p != '\0')
-    {
-      do 
-	{
-	  if (*p <=  126 && *p >= 32)
-	    {
-	      if (escp == 0)
-		{
-		  if      (!((*p == '\'') || (*p == '\"') || (*p == '\\'))) 
-		    /* do nothing */;
-		  else if (*p == '\\') 
-		    {
-#ifndef WITH_MYSQL
-		      if (p[1] == '\'')
-			{
-			  *p = '\'';
-			}
-#endif
-		      escp = 1;
-		    }
-		  else  
-		    retv = S_FALSE; /* (*p == '\'' || *p == '\"') */
-		}
-	      else /* escp == 1 */
-		{
-		  escp = 0;
-		}
-	    }
-	  else /* *p > 126 || *p < 32 */
-	    {
-	      retv = S_FALSE;
-	    }
-	  
-	  ++p;
-	  
-	} 
-      while (*p != '\0');
-    }
-
-  if (escp == 0)
-    return retv;
-  else
-    return S_FALSE;
+
+  while (*p != '\0') 
+    {
+      if (*p == '\\')
+	{
+	  escp = (escp == 1) ? 0 : 1;
+	}
+      else if (*p == '\'' && escp == 0)
+	{
+	  retv = S_FALSE;
+	}
+      else 
+	{
+	  escp = 0;
+	}
+      ++p;
+    }
+  return retv;
 }
 
@@ -1619,7 +1469,4 @@
   int     i;
   size_t  j;
-  my_attr * res;
-  my_attr key;
-  char    key_str[64];
 
   SL_ENTER(_("sh_database_parse"));
@@ -1638,6 +1485,11 @@
     SL_RETURN (NULL, _("sh_database_parse"));
 
-  while ((*p != '\0') && (*p != '>'))
-    {
+  while ((p != NULL) && (*p != '\0') && (*p != '>'))
+    {
+      if (p[0] == '/' && p[1] == '>')
+	SL_RETURN (&p[2], _("sh_database_parse"));
+      if (p[0] == '/' && p[1] == 'l' && p[2] == 'o' && 
+	  p[3] == 'g' && p[4] == '>')
+	SL_RETURN (&p[5], _("sh_database_parse"));
       if (p[0] == 'l' && p[1] == 'o' && p[2] == 'g' &&
 	  (p[3] == ' ' || p[3] == '>'))
@@ -1646,9 +1498,4 @@
 	  goto parse;
 	}
-      else if (p[0] == '/' && p[1] == '>')
-	SL_RETURN (&p[2], _("sh_database_parse"));
-      else if (p[0] == '/' && p[1] == 'l' && p[2] == 'o' && 
-	  p[3] == 'g' && p[4] == '>')
-	SL_RETURN (&p[5], _("sh_database_parse"));
       ++p;
     }
@@ -1657,19 +1504,13 @@
  parse:
 
-  while (*p == ' ' || *p == '>')
+  while ((p != NULL) && (*p == ' ' || *p == '>'))
     ++p;
 
-  if (*p == '\0')
+  if (!p || *p == '\0')
     SL_RETURN(NULL, _("sh_database_parse"));
-
-  if (*p != '<' && *p != '/')
-    goto par2;
 
   if (p[0] == '<' && p[1] == 'l' &&
       p[2] == 'o' && p[3] == 'g')
     {
-      /* 
-       * recursive call 
-       */
       new       = SH_ALLOC(sizeof(dbins));
       init_db_entry(new);
@@ -1685,83 +1526,62 @@
     SL_RETURN (&p[5], _("sh_database_parse"));
 
- par2:
 
   /* non-whitespace 
    */
-  for (i=0; i < 64; ++i)
-    {
-      if (p[i] != '=')
-	{
-	  key_str[i] = p[i];
-	}
-      else
-	{
-	  key_str[i] = '\0';
-	  break;
-	}
-    }
-  key_str[63] = '\0';
-  key.attr = &key_str[0];
-
-  res = bsearch(&key, attr_tab_srch, attr_tab_srch_siz,
-		sizeof(my_attr), sh_database_comp_attr);
-
-  if (res != NULL)
-    {
-      j = res->alen; /* strlen(attr_tab[i].attr); */
-      if (p[j] == '=' && p[j+1] == '"')
+  i = 0;
+  while (attr_tab[i].attr != NULL)
+    {
+      j = strlen(attr_tab[i].attr);
+      if (0 == strncmp(p, attr_tab[i].attr, j) && 
+	  p[j] == '=' && p[j+1] == '"')
 	{
 	  q = strchr(&p[j+2], '"');
-	  if (q)
-	    {
-	      *q = '\0';
-
-	      if (S_TRUE == is_escaped(&p[j+2])) {
-
-		if      (res->val == 1)
-		  (void) sl_strlcpy(db_entry->sev, &p[j+2], 
-				    (size_t)res->size);
-		else if (res->val == 2)
-		  {
-		    z = strchr(&p[j+2], 'T');
-		    if (z) *z = ' ';
-		    (void) sl_strlcpy(db_entry->time, &p[j+2],  20);
-		  }
-		else if (res->val == 3)
-		  (void) sl_strlcpy(db_entry->host, &p[j+2], 
-				    (size_t) res->size);
-		else if (res->val == 4)
-		  (void) sl_strlcpy(db_entry->msg,  &p[j+2], 
-				    (size_t) res->size);
-		else if (res->size != 0)
-		  {
-		    (void) sl_strlcpy( (((char *)(db_entry))+ res->off),
-				       &p[j+2], 
-				       (size_t) res->size);
-		  }
-		else if (res->val >= START_SEC_LONGS && res->val <= END_SEC_LONGS)
-		  {
-		    db_entry->ulong_data[res->val-START_SEC_LONGS]
-		      = strtoul(&p[j+2], (char **) NULL, 0);
-		  }
-
-		*q = '"';
-		p  = q; 
-		++p;
-
-		goto parse;
-	      }
-	      else { /* S_FALSE == is_escaped(&p[j+2]) */
-		sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-				_("Message not properly escaped"), 
-				_("sh_database_parse"));
-		SL_RETURN(NULL, _("sh_database_parse"));
-	      }
-	    }
-	  else /* q == NULL */
+	  if (!q)
 	    {
 	      SL_RETURN(NULL, _("sh_database_parse"));
 	    }
-	}
+	  else
+	    {
+	      *q = '\0';
+
+	      if (S_FALSE == is_escaped(&p[j+2])) {
+		SL_RETURN(NULL, _("sh_database_parse"));
+	      }
+
+	      if      (attr_tab[i].val == 1)
+		(void) sl_strlcpy(db_entry->sev, &p[j+2], 
+				  (size_t)attr_tab[i].size);
+	      else if (attr_tab[i].val == 2)
+		{
+		  z = strchr(&p[j+2], 'T');
+		  if (z) *z = ' ';
+		  (void) sl_strlcpy(db_entry->time, &p[j+2],  20);
+		}
+	      else if (attr_tab[i].val == 3)
+		(void) sl_strlcpy(db_entry->host, &p[j+2], 
+				  (size_t) attr_tab[i].size);
+	      else if (attr_tab[i].val == 4)
+		(void) sl_strlcpy(db_entry->msg,  &p[j+2], 
+				  (size_t) attr_tab[i].size);
+	      else if (attr_tab[i].size != 0)
+		{
+		  (void) sl_strlcpy( (((char *)(db_entry))+ attr_tab[i].off),
+				     &p[j+2], 
+				     (size_t) attr_tab[i].size);
+		}
+	      else if (attr_tab[i].val >= START_SEC_LONGS)
+		{
+		  db_entry->long_data[attr_tab[i].val-START_SEC_LONGS]
+		    = atol(&p[j+2]);
+		}
+
+	      *q = '"';
+	      p  = q; 
+	      ++p;
+
+	      goto parse;
+	    }
+	}
+      ++i;
     }
 
@@ -1776,58 +1596,18 @@
 static int enter_wrapper = 1;
 
-int set_enter_wrapper (const char * str)
+int set_enter_wrapper (char * str)
 {
   return sh_util_flagval(str, &enter_wrapper);
 }
 
-/* recursively enter linked list of messages into database, last first
- * - last is client (if this is a client message received by client)
- */
-long sh_database_insert_rec (dbins * curr, int depth, char * host)
-{
-  unsigned long    id = 0;
-
-  SL_ENTER(_("sh_database_insert_rec"));
-
-  if (curr->next)
-    {
-      /*
-      prev = curr->next;
-      sl_strlcpy(prev->host, curr->host, 64);
-      id = sh_database_insert_rec (curr->next, (depth + 1));
-      */
-      ++depth;
-      id = sh_database_insert_rec (curr->next, depth, curr->host);
-    }
-
-  if (host) 
-    sl_strlcpy(curr->host, host, 64);
-
-  if (id != 0)                       /* this is a server wrapper          */
-    {
-      if (enter_wrapper != 0)
-	{
-	  id = sh_database_entry (curr, id);
-	}
-    }
-  else
-    {
-      /*
-       * id = -1 is the client message; log_ref will be NULL 
-       */
-      if (depth > 0)                  /* this is a client message         */
-	id = sh_database_entry (curr, -1);
-      else                            /* this is a generic server message */
-	id = sh_database_entry (curr, 0);
-    }
-
-  SH_FREE(curr);
-
-  SL_RETURN(id, _("sh_database_insert_rec"));
-}
-
 int sh_database_insert (char * message)
 {
   dbins * db_entry;
+  dbins * prev;
+  dbins * curr;
+  long    id = 0;
+#ifdef HOST_SWITCH
+  char  * temp[64];
+#endif
 
   SL_ENTER(_("sh_database_insert"));
@@ -1840,7 +1620,32 @@
   (void) sh_database_parse (message, db_entry);
 
-  /* recursively enter the linked list into the database
-   */
-  (void) sh_database_insert_rec (db_entry, 0, NULL);
+  /* Enter the list into the database. Actually, the list can only have
+   * two entries at most.
+   */
+  curr = db_entry;
+  if (curr->next)
+    {
+      prev = curr->next;
+#ifdef HOST_SWITCH
+      strncpy(temp, prev->host,       64);
+#endif
+      strncpy(prev->host, curr->host, 64);
+#ifdef HOST_SWITCH
+      strncpy(curr->host, temp,       64);
+#endif
+      id = sh_database_entry (prev, -1);
+      SH_FREE(prev);
+    }
+
+  if (id != 0)                       /* this is a server wrapper          */
+    {
+      if (enter_wrapper != 0)
+	(void) sh_database_entry (curr, id);
+    }
+  else                                /* this is a generic server message */
+    {
+      (void) sh_database_entry (curr, 0);
+    }
+  SH_FREE(curr);
 
   SL_RETURN(0, _("sh_database_insert"));
Index: trunk/src/sh_dbCheck.c
===================================================================
--- trunk/src/sh_dbCheck.c	(revision 591)
+++ 	(revision )
@@ -1,122 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <string.h>
-
-#include "samhain.h"
-#include "sh_unix.h"
-#include "sh_utils.h"
-#include "sh_hash.h"
-#include "sh_files.h"
-#include "sh_tiger.h"
-
-#include "sh_dbIO.h"
-#include "sh_dbIO_int.h"
-#include "sh_pthread.h"
-
-#undef  FIL__
-#define FIL__  _("sh_dbCheck.c")
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) 
-
-static void file_verify(sh_file_t * p)
-{
-  int reported = 0;
-  unsigned long check_flags;
-  char * dir_name;
-  char * file_name;
-
-  if (p->next != NULL)
-    file_verify(p->next);
-  if (p->fullpath == NULL || p->fullpath[0] != '/')
-    return;
-
-  check_flags = p->theFile.checkflags;
-
-  if (!MODI_INITIALIZED(check_flags)) {
-    MODI_SET(check_flags, MODI_INIT|MASK_READONLY_);
-    sh_tiger_get_mask_hashtype(&check_flags);
-  }
-
-  dir_name   = sh_util_dirname(p->fullpath);
-  file_name  = sh_util_basename(p->fullpath);
-
-  if (SH_FILE_UNKNOWN == sh_files_filecheck (SH_LEVEL_READONLY, check_flags,
-					     dir_name, file_name,
-					     &reported, 0))
-    ++sh.statistics.files_report;
-
-  SH_FREE(dir_name);
-  SH_FREE(file_name);
-  return;
-}
-
-static void dbCheck_setup()
-{
-  sh_hash_set_initialized();
-  sh.flag.isdaemon = S_FALSE; 
-  sh.flag.loop     = S_FALSE;
-  sh.flag.update   = S_FALSE;
-  sh.flag.checkSum = SH_CHECK_CHECK;
-  
-  sh.statistics.files_report  = 0;
-  ShDFLevel[SH_ERR_T_FILE]    = SH_ERR_SEVERE;
-  ShDFLevel[SH_ERR_T_RO]      = SH_ERR_SEVERE;
-  ShDFLevel[SH_ERR_T_NAME]    = SH_ERR_SEVERE;
-
-  return;
-}
-#include <stddef.h>
-int sh_dbCheck_verify (const char * db_file)
-{
-  unsigned int i;
-  sh_file_t ** mtab = get_default_data_table();
-  
-  sh_error_only_stderr (S_TRUE);
-  sh_error_setprint(_("none"));
-
-  /* for sh.effective.home in open_tmp() */
-  sh_unix_getUser (); 
-
-  if (sh_dbIO_load_db_file(mtab, db_file) < 0)
-    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-
-  dbCheck_setup();
-
-  /* Don't lock because:
-   * (a) we are single-treaded, thus it's not required
-   * (b) it will lead to deadlocking
-   */
-  for (i = 0; i < TABSIZE; ++i)
-    {
-      if (mtab[i] != NULL) 
-	file_verify(mtab[i]);
-    }
-  
-  sh_hash_unvisited (SH_ERR_INFO);
-  
-  if (0 != sh.statistics.files_report)
-    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-  aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-  return 0;
-}
-
-#endif
Index: trunk/src/sh_dbCreate.c
===================================================================
--- trunk/src/sh_dbCreate.c	(revision 591)
+++ 	(revision )
@@ -1,227 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_hash.h"
-#include "sh_files.h"
-
-#include "sh_dbIO.h"
-#include "sh_dbIO_int.h"
-#include "sh_pthread.h"
-#include "sh_guid.h"
-
-#undef  FIL__
-#define FIL__  _("sh_dbCreate.c")
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) 
-
-static int dbCreate_writeout()
-{
-  char   uuid[SH_UUID_BUF];
-  char * path;
-  int    retval;
-
-  if (sh.outpath == NULL || sh.outpath[0] == '\0')
-    {
-      sh_uuid_generate_random(uuid, sizeof(uuid));
-      path = sh_util_strconcat(_("file."), sh.host.name, ".", uuid, NULL);
-    }
-  else
-    path = sh_util_strdup(sh.outpath);
-
-  retval = sh_dbIO_writeout_to_path(path);
-  SH_FREE(path);
-  return retval;
-}
-
-static void  dbCreate_run_filecheck(unsigned long add_mask, char * str)
-{
-  int status;
-
-  int reported = 0;
-  unsigned long check_flags = (MASK_READONLY_ | MODI_INIT | add_mask);
-  char * dir_name   = sh_util_dirname(str);
-  char * file_name  = sh_util_basename(str);
-
-  status = sh_files_filecheck (SH_LEVEL_READONLY, check_flags,
-			       dir_name, file_name, &reported, 0);
-
-  if (status == SH_FILE_UNKNOWN)
-    {
-      sh_hash_insert_null(str);
-    }
-
-  return;
-}
-
-static int dbCreate_filecheck(char * str)
-{
-  unsigned long add_mask = 0;
-
-  if (*str == '+')
-    {
-      add_mask = MODI_TXT;
-      ++str; while (isspace((int)*str)) ++str;
-    }
-  if (*str != '/')
-    {
-      char * tmp  = sh_util_safe_name (str);
-      sh_error_handle((-1), FIL__, __LINE__, EINVAL, MSG_E_SUBGPATH,
-		      _("Not an absolute path"), 
-		      _("dbCreate_filecheck"), tmp);
-      SH_FREE(tmp);
-      return -1;
-    }
-  dbCreate_run_filecheck(add_mask, str);
-  return 0;
-}
-
-char * rtrim(char * str)
-{
-  size_t len;
-
-  if (!str)
-    return str;
-
-  len = strlen(str);
-  while (len > 0)
-    {
-      --len;
-      if (str[len] == '\n' || str[len] == '\r')
-        str[len] = '\0';
-      else
-        break;
-    }
-    
-  return str;
-}
-
-static int dbCreate_loop(FILE * fd)
-{
-  int  status, retval = 0;
-  size_t linesize = MAX_PATH_STORE+2;
-  char * line = SH_ALLOC(linesize);
-
-  do {
-    status = sh_dbIO_getline(fd, line, linesize);
-
-    if (status > 0)
-      {
-	char * str = rtrim(line);   
-	while (isspace((int)*str)) ++str;
-	if (*str != '#')
-	  {
-	    int    fstatus = -1;
-	    size_t len     = 0;
-	    char * p       = sh_files_parse_input(str, &len);
-
-	    if (p)
-	      {
-		fstatus = dbCreate_filecheck(p);
-		SH_FREE(p);
-	      }
-	    if (fstatus != 0)
-	      retval = -1;
-	  }
-      }
-  } while (status != -1);
-
-  SH_FREE(line);
-  return retval;
-}
-
-static FILE * dbCreate_open (const char * path)
-{
-  FILE * fd = fopen(path, "r");
-  if (!fd)
-    {
-      int error = errno;
-      char * tmp  = sh_util_safe_name (path);
-      sh_error_handle((-1), FIL__, __LINE__, error, MSG_E_SUBGPATH,
-		      _("Cannot open file for read"), 
-		      _("dbCreate_open"), tmp);
-      SH_FREE(tmp);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
-  return fd;
-}
-
-static void dbCreate_setup()
-{
-  sh_hash_set_initialized();
-  sh.flag.isdaemon = S_FALSE; 
-  sh.flag.loop     = S_FALSE;
-  sh.flag.update   = S_FALSE;
-  sh.flag.checkSum = SH_CHECK_CHECK;
-  
-  sh.statistics.files_report  = 0;
-  ShDFLevel[SH_ERR_T_FILE]    = SH_ERR_SEVERE;
-  ShDFLevel[SH_ERR_T_RO]      = SH_ERR_SEVERE;
-  ShDFLevel[SH_ERR_T_NAME]    = SH_ERR_SEVERE;
-
-  sh_error_only_stderr (S_TRUE);
-  sh_error_setprint(_("none"));
-
-  return;
-}
-
-
-int sh_dbCreate (const char * path)
-{
-  FILE * fd;
-
-  /* Initialize application status
-   */
-  dbCreate_setup();
-
-  /* Open file list
-   */
-  fd = dbCreate_open(path);
-
-  /* Load the database
-   */
-  sh_hash_init_and_checksum();
-
-  /* Loop over file list to check files.
-   */
-  dbCreate_loop(fd);
-
-  /* Close file list
-   */
-  fclose(fd);
-
-  /* Write out database
-   */
-  if (0 != dbCreate_writeout())
-    aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-
-  /* Exit on success.
-   */
-  aud_exit(FIL__, __LINE__, EXIT_SUCCESS);
-  return 0;
-}
-    
-#endif
Index: trunk/src/sh_dbIO.c
===================================================================
--- trunk/src/sh_dbIO.c	(revision 591)
+++ 	(revision )
@@ -1,1902 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_dbIO_int.h"
-#include "sh_hash.h"
-#include "sh_dbIO.h"
-#include "sh_sig.h"
-#include "sh_tiger.h"
-#include "sh_xfer.h"
-#include "sh_pthread.h"
-#include "sh_socket.h"
-#include "sh_files.h"
-
-#undef  FIL__
-#define FIL__  _("sh_dbIO.c")
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) 
-
-/* external prototypes                                                     */
-
-extern int get_the_fd (SL_TICKET ticket);
-
-SH_MUTEX_EXTERN(mutex_hash);
-
-/******************************************************************
- *
- * Get a single line
- *
- ******************************************************************/
-static FILE * sh_fin_fd = NULL;
-
-int sh_dbIO_getline (FILE * fd, char * line, const size_t sizeofline)
-{
-  size_t  n = 0;
-
-  SL_REQUIRE(sizeofline >= SH_MINIBUF, _("sizeofline >= SH_MINIBUF"));
-
-  if (NULL != fgets(line, sizeofline, fd))
-    {
-      n = strlen(line);
-      if (n > 0 && line[n-1] == '\n') {
-	n--; line[n] = '\0';
-      }
-    } 
-  else {
-    line[0] = '\0';
-    return -1;
-  }
-
-  return n;
-}
-
-/******************************************************************
- *
- * Fast forward to start of data
- *
- ******************************************************************/
-
-static void reopen_fin_fd(SL_TICKET fd)
-{
-  if (sh_fin_fd != NULL)
-    {
-      sl_fclose (FIL__, __LINE__, sh_fin_fd);
-      sh_fin_fd = NULL;
-    }
-
-  sh_fin_fd = fdopen(dup(get_the_fd(fd)), "rb");
-  return;
-}
-
-
-static int seek_sof(FILE * fd, char * line, int size, const char * file)
-{
-  long i;
-
-  while (1) 
-    {
-      i =  sh_dbIO_getline (fd, line, size);
-      if (i < 0 ) 
-	{
-	  SH_FREE(line);
-	  dlog(1, FIL__, __LINE__, 
-	       _("The file signature database: %s does not\ncontain any data, or the start-of-file marker is missing (unlikely,\nunless modified by hand).\n"),
-	       (NULL == file) ? _("(null)") : file);
-	       
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
-			   ( (NULL == file) ? _("(null)") : file)
-			   );
-	  return -1;
-	}
-
-#if defined(SH_STEALTH)
-      if (0 == sl_strncmp (line, N_("[SOF]"), 5)) 
-#else
-      if (0 == sl_strncmp (line, _("[SOF]"),  5)) 
-#endif
-	break;
-    }
-  fflush(fd);
-  return 0;
-}
-
-static int sh_dbIO_setdataent (SL_TICKET fd, char * line, int size, 
-			       const char * file)
-{
-  int retval;
-
-  SL_ENTER(_("sh_dbIO_setdataent"));
-
-  sl_rewind (fd);
-  reopen_fin_fd(fd);
-
-  if (!sh_fin_fd)
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("The file signature database: %s is not readable.\n"),
-	   (NULL == file) ? _("(null)") : file);
-      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
-		       ( (NULL == file) ? _("(null)") : file)
-		       );
-      SL_RETURN( -1, _("sh_dbIO_setdataent"));
-    }
-
-  retval = seek_sof(sh_fin_fd, line, size, file);
-  SL_RETURN( retval, _("sh_dbIO_setdataent"));
-}
-
-/* Seek to [SOF] and truncate remainder of file
- */
-static int sh_dbIO_setdataent_old (SL_TICKET fd, char * line, int size, 
-				   const char * file)
-{
-  FILE * fdp;
-  
-  SL_ENTER(_("sh_dbIO_setdataent_old"));
-
-  sl_rewind (fd);
-  fdp = sl_stream(fd, "r+");
-  if (0 != seek_sof(fdp, line, size, file))
-    SL_RETURN( SL_EREAD, _("sh_dbIO_setdataent_old"));
-
-  lseek(fileno(fdp), ftello(fdp), SEEK_SET);
-
-  if (0 != ftruncate(fileno(fdp), ftello(fdp)))
-    {
-      char ebuf[SH_ERRBUF_SIZE];
-      int errnum = errno;
-      sh_error_message(errnum, ebuf, sizeof(ebuf));
-      sh_error_handle ((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-		       ebuf, _("sh_dbIO_setdataent_old") );
-      SL_RETURN( SL_EWRITE, _("sh_dbIO_setdataent_old"));
-    }
-  SL_RETURN( 0, _("sh_dbIO_setdataent_old"));
-}
-
-/******************************************************************
- *
- * IO helper functions
- *
- ******************************************************************/
-
-
-static UINT32 * swap_32 (UINT32 * iptr)
-{
-#ifdef WORDS_BIGENDIAN
-  unsigned char swap;
-  unsigned char * ii = (unsigned char *) iptr;
-  swap = ii[0]; ii[0] = ii[3]; ii[3] = swap;
-  swap = ii[1]; ii[1] = ii[2]; ii[2] = swap;
-  return iptr;
-#else
-  return iptr;
-#endif
-}
-
-static UINT64 *  swap_64 (UINT64 * iptr)
-{
-#ifdef WORDS_BIGENDIAN
-#ifdef UINT64_IS_32
-  swap_32 ((UINT32*) iptr);
-#else
-  unsigned char swap;
-  unsigned char * ii = (unsigned char *) iptr;
-  swap = ii[0]; ii[0] = ii[7]; ii[7] = swap;
-  swap = ii[1]; ii[1] = ii[6]; ii[6] = swap;
-  swap = ii[2]; ii[2] = ii[5]; ii[5] = swap;
-  swap = ii[3]; ii[3] = ii[4]; ii[4] = swap;
-#endif
-  return iptr;
-#else
-  return iptr;
-#endif
-}
-
-static unsigned short *  swap_short (unsigned short * iptr)
-{
-#ifdef WORDS_BIGENDIAN
-  if (sizeof(short) == 4)
-    swap_32 ((UINT32*) iptr);
-  else
-    {
-      /* alignment problem */
-      static unsigned short ooop = *iptr;
-      unsigned short hi   = (ooop & 0xff00);
-      unsigned short lo   = (ooop & 0xff);
-      ooop = (lo << 8) | (hi >> 8);
-      return &ooop;
-    }
-  return iptr;
-#else
-  return iptr;
-#endif
-}
-
-static void swap_data(sh_filestore_t * ft)
-{
-  swap_32(&(ft->mode));
-  swap_32(&(ft->linkmode));
-  swap_64(&(ft->dev));
-  swap_64(&(ft->rdev));
-  swap_32(&(ft->hardlinks));
-  swap_32(&(ft->ino));
-  swap_64(&(ft->size));
-  swap_64(&(ft->atime));
-  swap_64(&(ft->mtime));
-  swap_64(&(ft->ctime));
-  swap_32(&(ft->owner));
-  swap_32(&(ft->group));
-  swap_32(&(ft->checkflags));
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  swap_32(&(ft->attributes));
-#endif
-  ft->mark = *(swap_short(&(ft->mark)));
-  return;
-}
-
-#define QUOTE_CHAR '='
-
-char * unquote_string (const char * str, size_t len)
-{
-  int    i = 0, t1, t2;
-  char * tmp = NULL;
-  size_t l2, j, k = 0;
-
-  SL_ENTER(_("unquote_string"));
-
-  if (str != NULL)
-    {
-      l2  = len - 2;
-      tmp = SH_ALLOC(len + 1);
-
-      for (j = 0; j <= len; ++j)
-	{
-	  if (str[j] != QUOTE_CHAR)
-	    {
-	      tmp[k] = str[j];
-	    }
-	  else if (str[j] == QUOTE_CHAR && j < l2)
-	    {
-	      t1 = sh_util_hexchar(str[j+1]);
-	      t2 = sh_util_hexchar(str[j+2]);
-	      if ((t1|t2) >= 0)
-		{
-		  i = 16 * t1 + t2;
-		  tmp[k] = i; 
-		  j += 2;
-		}
-	      else
-		{
-		  tmp[k] = str[j];
-		}
-	    }
-	  else
-	    tmp[k] = str[j];
-	  ++k;
-	}
-    }
-  SL_RETURN(tmp, _("unquote_string"));
-}
-
-static char * int2hex (unsigned char i, char * i2h)
-{
-  static char hexchars[] = "0123456789ABCDEF";
-
-  i2h[0] = hexchars[(((i) & 0xF0) >> 4)]; /* high */
-  i2h[1] = hexchars[((i) & 0x0F)];        /* low  */
-
-  return i2h;
-}
-
-char * quote_string (const char * str, size_t len)
-{
-  char * tmp;
-  char * tmp2;
-  size_t l2, j, i = 0, k = 0;
-  char   i2h[2];
-
-  SL_ENTER(_("quote_string"));
-
-  if (str == NULL)
-    {
-      SL_RETURN(NULL, _("quote_string"));
-    }
-
-  for (j = 0; j < len; ++j)
-    if (str[j] == '\n' || str[j] == QUOTE_CHAR) ++i;
-
-  l2 = len + 1;
-  if (sl_ok_muls(3, i) && sl_ok_adds(l2, (3*i)))
-    {
-      tmp = SH_ALLOC(len + 1 + 3*i);
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      _("integer overflow"), 
-		      _("quote_string"));
-      SL_RETURN(NULL, _("quote_string"));
-    }
-
-  for (j = 0; j <= len; ++j)
-    {
-      if (str[j] == '\n')
-	{
-	  tmp2 = int2hex((unsigned char) '\n', i2h);
-	  tmp[k] = QUOTE_CHAR; ++k;
-	  tmp[k] = tmp2[0];    ++k;
-	  tmp[k] = tmp2[1];
-	}
-      else if (str[j] == QUOTE_CHAR)
-	{
-	  tmp2 = int2hex((unsigned char) QUOTE_CHAR, i2h);
-	  tmp[k] = QUOTE_CHAR; ++k;
-	  tmp[k] = tmp2[0];    ++k;
-	  tmp[k] = tmp2[1];
-	}
-      else
-	{
-	  tmp[k] = str[j];
-	}
-      ++k;
-    }
-  SL_RETURN(tmp, _("quote_string"));
-}
-
-static char * unquote_path(char * line, long i)
-{
-  char * tmp  = unquote_string (line, i);
-  size_t len  = sl_strlen(tmp)+1;
-  char * path = SH_ALLOC(len);
-
-  (void) sl_strlcpy (path, tmp, len);
-  if (tmp)
-    SH_FREE(tmp);
-  /* do not strip newline twice...
-  if (len > 1) {
-    if (path[len-2] == '\n')
-      path[len-2] = '\0';
-  }
-  ****/
-  return path;
-}
-
-/******************************************************************
- *
- * Use different init rootfs (patch by Kemal H.)
- *
- ******************************************************************/
-
-static char * sh_dbIO_rootfs = NULL;
-static size_t sh_dbIO_rootfs_len = 0;
-
-int sh_dbIO_init_rootfs (const char * rootfs)
-{
-  if (NULL == sh_dbIO_rootfs)
-    {
-      sh_dbIO_rootfs     = sh_util_strdup (rootfs);
-      sh_dbIO_rootfs_len = sl_strlen(sh_dbIO_rootfs);
-      return 0;
-    }
-  return -1;
-}
-
-size_t sh_dbIO_get_rootfs_len()
-{
-  return sh_dbIO_rootfs_len;
-}
-
-/* Prepend rootfs when reading from config file ('path' must be allocated with sufficient space).
- */
-char * sh_dbIO_rootfs_prepend(char * path)
-{
-  if (0 == sh_dbIO_rootfs_len)
-    return path;
-  
-  memmove (path + sh_dbIO_rootfs_len, path, sl_strlen(path) + 1);
-  memcpy  (path, sh_dbIO_rootfs, sh_dbIO_rootfs_len);
-
-  return path;
-}
-
-
-/* Strip rootfs when writing to database file.
- */
-char * sh_dbIO_rootfs_strip(char * path)
-{
-  if (sh_dbIO_rootfs_len == 0)
-    {
-      return path;
-    }
-  else
-    {
-      size_t len = sl_strlen(path);
-
-      memmove (path, path + sh_dbIO_rootfs_len, len + 1 - sh_dbIO_rootfs_len);
-      if(path[0] != '/')
-	{
-	  path[0]='/';
-	  path[1]='\0';
-	}
-    }
-
-  return path;
-}
-
-char * sh_dbIO_rootfs_strip_link(char * path)
-{
-  if (sh_dbIO_rootfs_len == 0)
-    return path;
-  if (strstr(path, sh_dbIO_rootfs) == path)
-    {
-      size_t len = sl_strlen(path);
-
-      memmove (path, path + sh_dbIO_rootfs_len, len + 1 - sh_dbIO_rootfs_len);
-    }
-  return path;
-}
-
-/******************************************************************
- *
- * Read next record and return it
- *
- ******************************************************************/
-
-static void corrupt_record(char * file, int line, const char * filepath)
-{
-  dlog(1, file, line, 
-       _("There is a corrupt record in the file signature database: %s\n"),
-       (NULL == filepath)? _("(null)") : filepath);
-  sh_error_handle ((-1), file, line, 0, MSG_E_SUBGPATH,
-		   _("Corrupt record in file signature database"), 
-		   _("sh_dbIO_getdataent"),
-		   ( (NULL == filepath) ? _("(null)") : filepath) );
-  return;
-}
-
-static void wrong_version(char * file, int line, const char * filepath)
-{
-  dlog(1, file, line, 
-       _("There is a record with a bad version number in the file signature database: %s\nThis may be caused by using '-t init' repeatedly to initialise the database, without (re)moving the database file.\n"),
-       (NULL == filepath) ? _("(null)") : filepath);
-  sh_error_handle((-1), file, line, 0, MSG_E_SUBGPATH,
-		  _("Record with bad version number in file signature database"), 
-		  _("sh_dbIO_getdataent"),
-		  (NULL == filepath) ? _("(null)") : filepath);
-  return;
-}
-
-static void hexdump(unsigned char * data, size_t size)
-{
-  unsigned int count =0;
-  char ith[3];
-
-  do {
-    int2hex(data[count], ith); ith[2] = '\0';
-    printf("%2s", ith);
-    ++count;
-    if (count % 40 == 0) putc('\n', stdout);
-  } while (count < size);
-}
-
-static size_t dbIO_fread_struct (sh_filestore_t * ptr, FILE *stream, 
-				 const char * path, int * errflag)
-{
-  sh_filestore_old_t old_struct;
-  fpos_t position;
-  static int oldflag = -1;
-
- start:
-  if (oldflag != -1) /* 'initialized' case first */
-    {
-      if (oldflag == 0)
-	return fread (ptr, sizeof(sh_filestore_t), 1, stream);
-
-      else
-	{
-	  unsigned short mark;
-	  if (1 != fread (&old_struct, sizeof(old_struct), 1, stream))
-	    return 0;
-
-	  /* set mark to current version */
-	  mark = old_struct.mark;
-	  mark = *(swap_short(&(mark)));
-	  if ((mark & ~REC_FLAGS_MASK) != OLD_REC_MAGIC)
-	    {
-	      sh_filestore_old_t try_struct;
-	      char try[5];
-
-	      if (1 == 0)
-		hexdump((unsigned char *)&old_struct, sizeof(old_struct));
-	      memset(&try_struct, 0, sizeof(try_struct));
-	      if (!memcmp(&old_struct, &try_struct, sizeof(try_struct)))
-		return 0; /* NULL read */
-	      if (1 != fread (try, sizeof(try), 1, stream))
-		return 0;
-	      if (feof(stream))
-		return 0;
-
-	      wrong_version(FIL__, __LINE__, path);
-	      *errflag = -1;
-	      return 0;
-	    }
-	  if ((mark & REC_FLAGS_ATTR) != 0)
-	    mark = REC_MAGIC|REC_FLAGS_ATTR;
-	  else
-	    mark = REC_MAGIC;
-	  mark = *(swap_short(&(mark)));
-	  old_struct.mark = mark;
-
-	  /* copy into current struct version */
-	  memcpy(ptr, &old_struct, sizeof(old_struct));
-	  ptr->checkflags = 0;
-	  return 1;
-	}
-    }
-  else /* not initialized yet, test DB version */
-    {
-      if (0 == fgetpos(stream, &position))
-	{
-	  unsigned short mark;
-
-	  if (1 != fread (&old_struct, sizeof(old_struct), 1, stream))
-	    return 0;
-
-	  mark = old_struct.mark;
-	  mark = *(swap_short(&(mark)));
-	  if ((mark & ~REC_FLAGS_MASK) == REC_MAGIC)
-	    oldflag = 0;
-	  else if ((mark & ~REC_FLAGS_MASK) == OLD_REC_MAGIC)
-	    oldflag = 1;
-	  else
-	    {
-	      wrong_version(FIL__, __LINE__, path);
-	      *errflag = -1;
-	      return 0;
-	    }
-
-	  /* return to previous position and read data */
-	  if (0 != fsetpos(stream, &position))
-	    return 0;
-	  goto start;
-	}
-      return 0;
-    }
-}
-
-int sig_end_detected (void * ft)
-{
-  char * str = (char *) ft;
-  char cmp[SH_MINIBUF];
-
-  sl_strlcpy(cmp, _("-----BEGIN PGP SIGNATURE-----"), sizeof(cmp));
-
-  if ( 0 == memcmp(str, cmp, strlen(cmp)) ) 
-    return S_TRUE;
-  return S_FALSE;
-}
-
-static sh_file_t *  sh_dbIO_getdataent (char * line, int size, 
-					const char * filepath, int * errflag)
-{
-  sh_file_t * p;
-  sh_filestore_t ft;
-  long i;
-  char * fullpath;
-  char * linkpath;
-  char * attr_string = NULL;
-
-  SL_ENTER(_("sh_dbIO_getdataent"));
-
-  *errflag = 0;
-
-  p = SH_ALLOC(sizeof(sh_file_t));
-
-  /* Read next record -- Part One 
-   */
-  if (1 != dbIO_fread_struct (&ft, sh_fin_fd, filepath, errflag))
-    {
-      SH_FREE(p);
-      SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-    }
-
-  ft.mark = *(swap_short(&(ft.mark)));
-
-  if ((ft.mark & ~REC_FLAGS_MASK) != REC_MAGIC)
-    {
-      if (sig_end_detected(&ft))
-	{
-	  SH_FREE(p);
-	  SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-	}
-      SH_FREE(p);
-      wrong_version(FIL__, __LINE__, filepath);
-      *errflag = -1;
-      SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-    }
-
-  ft.mark = *(swap_short(&(ft.mark)));
-  swap_data(&ft);
-
-  /* Read next record -- Part Two -- Fullpath
-   */
-  i = sh_dbIO_getline (sh_fin_fd, line, size);
-
-  if (i <= 0 ) 
-    {
-      SH_FREE(p);
-      corrupt_record(FIL__, __LINE__, filepath);
-      *errflag = -1;
-      SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-    }
-
-  fullpath = unquote_path(line, i);
-  
-  /* Read next record -- Part Three -- Linkpath
-   */
-  i =  sh_dbIO_getline (sh_fin_fd, line, size);
-
-  if (i <= 0 ) 
-    {
-      SH_FREE(fullpath); SH_FREE(p);
-      corrupt_record(FIL__, __LINE__, filepath);
-      *errflag = -1;
-      SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-    }
-
-  linkpath = unquote_path(line, i);
-
-  /* Read next record -- Part Four -- attr_string
-   */
-  if ((ft.mark & REC_FLAGS_ATTR) != 0)
-    {
-      i =  sh_dbIO_getline (sh_fin_fd, line, size);
-      if (i <= 0 ) 
-	{
-	  SH_FREE(fullpath); SH_FREE(linkpath); SH_FREE(p);
-	  corrupt_record(FIL__, __LINE__, filepath);
-	  *errflag = -1;
-	  SL_RETURN( NULL, _("sh_dbIO_getdataent"));
-	}
-
-      attr_string = unquote_path(line, i);
-    }
-
-  /* Read next record -- Part Four -- Decode
-   */
-#if defined(SH_STEALTH)
-  sh_do_decode(fullpath,    sl_strlen(fullpath));
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  sh_do_decode(ft.c_attributes,   sl_strlen(ft.c_attributes));
-#endif
-  sh_do_decode(ft.c_mode,   sl_strlen(ft.c_mode));
-  sh_do_decode(ft.c_owner,  sl_strlen(ft.c_owner));
-  sh_do_decode(ft.c_group,  sl_strlen(ft.c_group));
-  sh_do_decode(ft.checksum, sl_strlen(ft.checksum));  
-  /* 
-   * TXT entries are c_mode[0] != 'l' and do not get decoded 
-   */
-  if (ft.c_mode[0] == 'l' && linkpath[0] != '-')
-    {  
-      sh_do_decode(linkpath, sl_strlen(linkpath));
-    }
-  if ((ft.mark & REC_FLAGS_ATTR) != 0)
-    {  
-      sh_do_decode(attr_string, sl_strlen(attr_string));
-    }
-#endif
-
-  memcpy( &(*p).theFile, &ft, sizeof(sh_filestore_t) );
-
-  /* init fflags, such that suid files in 
-   * database are recognized as such 
-   */
-  {
-    mode_t mode = (mode_t) ft.mode;
-
-    if (S_ISREG(mode) &&
-	(0 !=(S_ISUID & mode) ||
-#if defined(HOST_IS_LINUX)
-	 (0 !=(S_ISGID & mode) && 
-	  0 !=(S_IXGRP & mode)) 
-#else  
-	 0 !=(S_ISGID & mode)
-#endif
-	 )
-	)
-      p->fflags = SH_FFLAG_SUIDCHK;
-
-    else
-      p->fflags = 0;
-  }
-
-  p->modi_mask   = ft.checkflags;
-  if (MODI_ISSET(ft.checkflags, MODI_ALLIGNORE))
-    SET_SH_FFLAG_ALLIGNORE(p->fflags);
-  p->fullpath    = fullpath;
-  p->linkpath    = linkpath;
-  p->attr_string = attr_string;
-
-  /* set to an invalid value 
-   */
-  ft.mark = (REC_MAGIC + 5);
-
-  SL_REQUIRE((*errflag == 0), _("errflag not set correctly"));
-  SL_RETURN( p, _("sh_dbIO_getdataent"));
-}
-
-/******************************************************************
- *
- * Data loading routines
- *
- ******************************************************************/
-static SL_TICKET load_data_from_server(const char * uuid)
-{
-  SL_TICKET fd = -1;
-
-#if defined(SH_WITH_CLIENT)
-  char hashbuf[KEYBUF_SIZE];
-
-  /* Data file from Server
-   */
-  if (0 != sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))
-    return -1;
-
-  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_D_DSTART);
-  fd = sh_xfer_request_file((!uuid) ? _("DATA") : uuid);
-
-  if (SL_ISERROR(fd))
-    {
-      if (!uuid)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FBAD);
-	  dlog(1, FIL__, __LINE__, 
-	       _("Could not retrieve the file signature database from the server(errnum = %ld).\nPossible reasons include:\n - the server is not running,\n - session key negotiation failed (see the manual for proper setup), or\n - the server cannot access the file.\n"), fd);  
-	}
-      else
-	sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_TCP_FBAD);
-      return fd;
-    }
-  sl_rewind (fd);
-
-  if (!uuid)
-    {
-      sl_strlcpy (sh.data.hash, 
-		  sh_tiger_hash (file_path('D', 'R'),  
-				 fd, TIGER_NOLIM, hashbuf, sizeof(hashbuf)),
-		  KEY_LEN+1);
-      sl_rewind (fd);
-    }
-#else
-  (void) uuid;
-#endif
-  return fd;
-}
-
-static SL_TICKET load_data_from_disk(const char * filepath)
-{
-  char hashbuf[KEYBUF_SIZE];
-  SL_TICKET fd = -1;
-
-  /* Local data file
-   */
-  if ( SL_ISERROR(fd = sl_open_read(FIL__, __LINE__, filepath, SL_YESPRIV)) )
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<Error opening: %s>\n"), filepath));
-      dlog(1, FIL__, __LINE__, 
-    _("Could not open the local file signature database for reading because\nof the following error: %s (errnum = %ld)\nIf this is a permission problem, you need to change file permissions\nto make the file readable for the effective UID: %d\n"), 
-	   sl_get_errmsg(), fd, (int) sl_ret_euid());
-      sh_error_handle ((-1), FIL__, __LINE__, fd, MSG_EXIT_ABORT1, 
-		       sh.prg_name);
-      return -1;
-    }
-  
-  TPT(( 0, FIL__, __LINE__, _("msg=<Opened database: %s>\n"), 
-	filepath));
-
-  if (sh.data.hash[0] == '\0')
-    {
-      char hashbuf[KEYBUF_SIZE];
-      sl_strlcpy(sh.data.hash, 
-		 sh_tiger_hash (filepath, TIGER_FILE, TIGER_NOLIM, hashbuf, sizeof(hashbuf)), 
-		 KEY_LEN+1);
-    }
-  else
-    {
-      if (0 != sl_strncmp(sh.data.hash, 
-			  sh_tiger_hash (filepath, fd, TIGER_NOLIM, 
-					 hashbuf, sizeof(hashbuf)),
-			  KEY_LEN)
-	  && sh.flag.checkSum != SH_CHECK_INIT) 
-	{
-	  dlog(1, FIL__, __LINE__, 
-	       _("The checksum of the file signature database has changed since startup: %s -> %s\n"),
-	       sh.data.hash, sh_tiger_hash (filepath, fd, TIGER_NOLIM, 
-					    hashbuf, sizeof(hashbuf)));
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_AUTH,
-			   ( (NULL == filepath) ? _("(null)") :
-			     filepath )
-			   );
-	}
-    }
-  sl_rewind (fd);
-  return fd;
-}
-
-static SL_TICKET verify_data (SL_TICKET fd)
-{
-#if defined(WITH_SIG)
-  SL_TICKET fdTmp;
-
-  /* extract the data and copy to temporary file
-   */
-  fdTmp = sh_sig_extract_signed(fd);
-
-  if (sig_termfast == 1)  /* SIGTERM */
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-      --sig_raised; --sig_urgent;
-      return -1;
-    }
-
-  sl_close(fd);
-  fd = fdTmp;
-
-  /* Validate signature of open file.
-   */
-  if (0 != sh_sig_check_signature (fd, SIG_DATA))
-    {
-      sl_close(fd);
-      return -1;
-    }
-  sl_rewind (fd);
-
-  fdTmp = sh_sig_extract_signed_data(fd);
-  sl_close(fd);
-  fd = fdTmp;  
-#endif
-
-  return fd;
-}
-
-static int read_data(SL_TICKET fd, sh_file_t * tab[TABSIZE], 
-		     const char * filepath)
-{
-  sh_file_t * p;
-  int errflag = 0;
-  char * line = SH_ALLOC(MAX_PATH_STORE+2);
-
-  /* fast forward to start of data
-   */
-  if (0 != sh_dbIO_setdataent(fd, line, MAX_PATH_STORE+1, filepath))
-    return -1;
-
-  while (1) 
-    {
-      if (sig_termfast == 1)  /* SIGTERM */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-	  --sig_raised; --sig_urgent;
-	  SH_FREE(line);
-	  return -1;
-	}
-
-      p = sh_dbIO_getdataent (line, MAX_PATH_STORE+1, filepath, &errflag);
-      if (p != NULL)
-	{
-	  if (!sh_hash_is_null_record(&(p->theFile)))
-	    hashinsert (tab, p);
-	  else
-	    sh_hash_remove_unconditional (p->fullpath);
-	}
-      else
-	break;
-    }
-
-  if (line != NULL)
-    SH_FREE(line);
-
-  /* Always keep db in memory, so we have no open file
-   */
-  sl_close (fd);
-
-  sl_fclose (FIL__, __LINE__, sh_fin_fd);
-  sh_fin_fd = NULL;
-
-  return errflag;
-}
-
-
-static int sh_dbIO_load_db_int(sh_file_t * tab[TABSIZE], 
-			       const char * filepath, const char * uuid)
-{
-#define FGETS_BUF 16384
-
-  SL_TICKET fd = -1;
-
-  if (uuid)
-    {
-      fd = load_data_from_server(uuid);
-      if (SL_ISERROR(fd))
-	return -1;
-    }
-  else if (!filepath)
-    {
-      char * dbpath = file_path('D', 'R');
-
-      fd = load_data_from_server(NULL);
-
-      if (SL_ISERROR(fd))
-	{
-	  if (*dbpath == '/')
-	    fd = load_data_from_disk(dbpath);
-	}
-    }
-  else
-    {
-      fd = load_data_from_disk(filepath);
-    }
-
-  if (SL_ISERROR(fd))
-    return -1;
-
-  if (sig_termfast == 1)  /* SIGTERM */
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-      --sig_raised; --sig_urgent;
-      aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-    }
-
-  fd = verify_data(fd);
-  if (SL_ISERROR(fd))
-    return -1;
-
-  if (!uuid) { int i; for (i = 0; i < TABSIZE; ++i) tab[i] = NULL; }
-
-  return read_data (fd, tab, filepath);
-}
-
-
-int sh_dbIO_load_db(sh_file_t * tab[TABSIZE])
-{
-  return sh_dbIO_load_db_int(tab, NULL, NULL);
-}
-int sh_dbIO_load_db_file(sh_file_t * tab[TABSIZE], const char * filepath)
-{
-  return sh_dbIO_load_db_int(tab, filepath, NULL);
-}
-
-int sh_dbIO_load_delta()
-{
-  int    status = 0;
-#if defined(SH_WITH_CLIENT)
-  sh_file_t ** mtab = get_default_data_table();
-  int errflag = 0;
-  unsigned int count;
-  time_t last;
-
-  if ( sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      if (sh_hash_get_initialized() != 0)
-	{
-	  char * uuid = sh_socket_get_uuid(&errflag, &count, &last);
-
-	  if (!uuid) 
-	    return errflag;
-
-	  if (count > 0)
-	    sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, count, MSG_E_SUBGEN,
-			  _("Retrying download of delta DB"), 
-			  _("sh_dbIO_load_delta"));
-
-	  status = sh_dbIO_load_db_int(mtab, NULL, uuid);
-	  if (status < 0)
-	    {
-	      /* Return status < 0 indicates that max_try is exceeded
-	       */
-	      if (sh_socket_return_uuid(uuid, count, last) < 0)
-		sh_error_handle((-1), FIL__, __LINE__, -1, MSG_D_DELTAFAIL, uuid);
-	    }
-	  else
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_D_DELTAOK, uuid);
-	    }
-	  SH_FREE(uuid);
-	}
-      else
-	{
-	  /* not initialized yet */
-	  sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			  _("Download of delta DB skipped, not initialized yet"), 
-			  _("sh_dbIO_load_delta"));
-	  return -1;
-	}
-    }
-#endif
-  return status;
-}
-
-/******************************************************************
- *
- * Writing out a file to the database.
- *
- ******************************************************************/ 
-static int       pushdata_isfirst =  1;
-static SL_TICKET pushdata_fd      = -1;
-
-static int       pushdata_stdout  =  S_FALSE;
-
-static char * sh_db_version_string = NULL;
-
-int sh_dbIO_writeout_stdout (const char * str)
-{
-  if (!str)
-    { pushdata_stdout  =  S_TRUE; return 0; }
-  return -1;
-}
-
-int sh_dbIO_version_string(const char * str)
-{
-  if (str)
-    {
-      if (sh_db_version_string != NULL) {
-	SH_FREE(sh_db_version_string);
-      }
-      if (0 == sl_strncmp(str, _("NULL"), 4))
-	{
-	  sh_db_version_string = NULL;
-	  return 0;
-	}
-      sh_db_version_string = sh_util_strdup(str);
-      return 0;
-    }
-  return -1;
-}
-
-void do_writeout_checks(const char * outpath)
-{
-  if ((pushdata_stdout == S_TRUE) && (sh.flag.update == S_TRUE))
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("You cannot write the database to stdout when you use update rather than init.\n"));
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
-		      _("Writing database to stdout with update"), 
-		      sh.prg_name, 
-		      _("sh_dbIO_data_write_int"));
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  if ((pushdata_stdout == S_TRUE) && (sl_is_suid()))
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("You cannot write the database to stdout when running with suid privileges.\n"));
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
-		      _("Writing database to stdout when suid"), 
-		      sh.prg_name, 
-		      _("sh_dbIO_data_write_int"));
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-
-  if ( (pushdata_isfirst == 1) && (pushdata_stdout == S_FALSE) && 
-       ( (NULL == outpath) || (0 == sl_strcmp(outpath, _("REQ_FROM_SERVER"))) ) )
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("You need to configure a local path for initializing the database\nlike ./configure --with-data-file=REQ_FROM_SERVER/some/local/path\n"));
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
-		      _("No local path for database specified"), 
-		      sh.prg_name, 
-		      _("sh_dbIO_data_write_int"));
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  if ((pushdata_isfirst == 1) && (pushdata_stdout == S_FALSE))  
-    {
-      /* Warn that file already exists; file_path != NULL here because
-       * checked above
-       */
-      struct stat sbuf;
-
-      if (0 == retry_lstat(FIL__, __LINE__, outpath, &sbuf))
-	{
-	  if (sh.flag.update == S_FALSE)
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_FI_DBEX,
-			      file_path('D', 'W'));
-	    }
-	}
-    }
-
-  return;
-}
-
-static SL_TICKET open_writeout_data_truncate(const char * path)
-{
-  int status;
-  SL_TICKET fd;
-
-  if ( SL_ISERROR(fd = sl_open_rdwr_trunc(FIL__, __LINE__, path, SL_YESPRIV))) 
-    {
-      sh_error_handle((-1), FIL__, __LINE__, fd, MSG_E_ACCESS,
-		      geteuid(), path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  if (SL_ISERROR(status = sl_lock (fd)))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
-		      _("Failed to lock baseline database"), _("sh_dbIO_data_write_int"),
-		      path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-  return fd;
-}
-
-static SL_TICKET open_writeout_data(const char * path)
-{
-  int status;
-  SL_TICKET fd;
-
-  if ( SL_ISERROR(fd = sl_open_rdwr(FIL__, __LINE__, path, SL_YESPRIV))) 
-    {
-      sh_error_handle((-1), FIL__, __LINE__, fd, MSG_E_ACCESS,
-		      geteuid(), path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  if (SL_ISERROR(status = sl_lock (fd)))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
-		      _("Failed to lock baseline database"), _("sh_dbIO_data_write_int"),
-		      path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-  return fd;
-}
-
-static void seek_writeout_data(SL_TICKET fd, const char * path)
-{
-  int status;
-
-  if ( SL_ISERROR(status = sl_forward(fd))) 
-    {
-      sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
-		      _("Failed to seek to end of baseline database"),
-		      _("seek_writeout_data"),
-		      path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-  return;
-}
-
-/* Seek to [SOF] and truncate remainder
- */
-static int seek_writeout_data_old(SL_TICKET fd, const char * path)
-{
-  char * line = SH_ALLOC(MAX_PATH_STORE+1);
-
-  /* This will do an ftruncate() after the sof marker
-   */
-  if (SL_ISERROR(sh_dbIO_setdataent_old (fd, line, MAX_PATH_STORE, path)))
-    {
-      SH_FREE(line);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-		      _("Failed to seek to start of baseline database"),
-		      _("seek_writeout_data_old"),
-		      path);
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-  SH_FREE(line);
-  return 0;
-}
-
-char * prep_path(char * path, int flag)
-{
-  size_t old_len = sl_strlen(path);
-  char * tmp;
-  size_t tmp_len;
-  size_t path_len;
-  char * outpath = NULL;
-#if !defined(SH_STEALTH)
-  (void) flag;
-#endif
-
-#if defined(SH_STEALTH)
-  if (flag == S_TRUE)
-    sh_do_encode(path, old_len);
-#endif
-  tmp = quote_string(path, old_len);
-  tmp_len = sl_strlen(tmp);
-#if defined(SH_STEALTH)
-  if (flag == S_TRUE)
-    sh_do_decode(path, old_len);
-#endif
-
-  if (tmp && tmp_len <= MAX_PATH_STORE) 
-    {
-      outpath = sh_util_strdup(path);
-    } 
-  else 
-    {
-      char hashbuf[KEYBUF_SIZE];
-      
-      outpath = sh_util_strdup(sh_tiger_hash (path,
-					      TIGER_DATA, old_len, 
-					      hashbuf, sizeof(hashbuf)));
-    }
-  if (tmp) 
-    SH_FREE(tmp);
-
-  path_len = sl_strlen(outpath);
-#if defined(SH_STEALTH)
-  if (flag == S_TRUE)
-    sh_do_encode(outpath, path_len);
-#endif
-  
-  tmp = quote_string(outpath, path_len);
-  if (tmp) {
-    SH_FREE(outpath);
-    outpath = tmp;
-  }
-  return outpath;
-}
-
-static char * prep_attr(char * attr_str)
-{
-  char * tmp;
-  char * outstr = NULL;
-  size_t old_len = sl_strlen(attr_str);
-
-#if defined(SH_STEALTH)
-  sh_do_encode(attr_str, old_len);
-#endif
-
-  tmp = quote_string(attr_str, old_len);
-  if (tmp)
-    {
-      outstr = tmp;
-    }
-
-#if defined(SH_STEALTH)
-  sh_do_decode(attr_str, old_len);
-#endif
-  return outstr;
-}
-
-static void prep_encode(sh_filestore_t * p)
-{
-#if defined(SH_STEALTH)
-  sh_do_encode(p->c_mode,   sl_strlen(p->c_mode));
-  sh_do_encode(p->c_owner,  sl_strlen(p->c_owner));
-  sh_do_encode(p->c_group,  sl_strlen(p->c_group));
-  sh_do_encode(p->checksum, sl_strlen(p->checksum));
-  sh_do_encode(p->c_attributes,   sl_strlen(p->c_attributes));
-#else
-  (void) p;
-#endif
-  return;
-}
-
-static void prep_struct(sh_filestore_t * p, file_type * buf, char * fileHash)
-{
-#if !defined(__linux__) && !defined(HAVE_STAT_FLAGS)
-  int    i;
-#endif
-  p->mark = REC_MAGIC;
-  sl_strlcpy(p->c_mode,   buf->c_mode,   CMODE_SIZE);
-  sl_strlcpy(p->c_group,  buf->c_group,  GROUP_MAX+1);
-  sl_strlcpy(p->c_owner,  buf->c_owner,  USER_MAX+1);
-  if (fileHash) {
-    sl_strlcpy(p->checksum, fileHash,      KEY_LEN+1);
-  }
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  sl_strlcpy(p->c_attributes, buf->c_attributes, ATTRBUF_SIZE);
-#else
-  for (i = 0; i < ATTRBUF_USED; ++i) p->c_attributes[i] = '-';
-  p->c_attributes[ATTRBUF_USED] = '\0';
-#endif
- 
-  prep_encode(p);
-  
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  p->attributes  = (UINT32) buf->attributes;
-#else
-  p->attributes  = 0;
-#endif
-  p->linkmode    = (UINT32) buf->linkmode;
-  p->hardlinks   = (UINT32) buf->hardlinks;
-  p->dev   = (UINT64) buf->dev;
-  p->rdev  = (UINT64) buf->rdev;
-  p->mode  = (UINT32) buf->mode;
-  p->ino   = (UINT32) buf->ino;
-  p->size  = (UINT64) buf->size;
-  p->mtime = (UINT64) buf->mtime;
-  p->atime = (UINT64) buf->atime;
-  p->ctime = (UINT64) buf->ctime;
-  p->owner = (UINT32) buf->owner;
-  p->group = (UINT32) buf->group;
-
-  p->checkflags = (UINT32) buf->check_flags; 
-  
-  return;
-}
-
-
-static void write_start_header(SL_TICKET fd)
-{
-  char   timestring[81];
-
-  if (pushdata_stdout == S_FALSE)
-    {
-      sl_write (fd, _("\n#Host "), 7);
-      sl_write (fd, sh.host.name, 
-		sl_strlen(sh.host.name));
-      sl_write (fd, _(" Version "), 9);
-      sl_write (fd, sh_db_version_string, 
-		sl_strlen(sh_db_version_string));
-      sl_write (fd, _(" Date "), 6);
-      (void) sh_unix_time(0, timestring, sizeof(timestring));
-      sl_write (fd, timestring, strlen(timestring));
-      sl_write (fd,        "\n", 1);
-    } 
-  else 
-    {
-      printf ("%s",_("\n#Host "));
-      printf ("%s", sh.host.name);
-      printf ("%s",_(" Version "));
-      printf ("%s", sh_db_version_string);
-      printf ("%s",_(" Date "));
-      (void) sh_unix_time(0, timestring, sizeof(timestring));
-      printf ("%s\n", timestring);
-    }
-}
-
-static void write_start_marker(SL_TICKET fd)
-{
-  if (sh_db_version_string != NULL)
-    {
-      write_start_header(fd);
-    }
-  
-  if (pushdata_stdout == S_FALSE)
-    {
-#if defined(SH_STEALTH)
-      sl_write      (fd,        "\n", 1);
-      sl_write_line (fd, N_("[SOF]"), 5);
-#else
-      sl_write_line (fd, _("\n[SOF]"),  6);
-#endif
-    }
-  else 
-    {
-#if defined(SH_STEALTH)
-      puts (N_("[SOF]"));
-#else
-      puts (_("\n[SOF]"));
-#endif
-    }
-}
-
-static void   write_record(SL_TICKET fd, sh_filestore_t * p, 
-			   char * fullpath, char * linkpath, char * attr_string)
-{
-  static char ll[2] = { '-', '\0' };
-  char * lpath;
-
-  if (!linkpath || 0 == sl_strlen(linkpath))
-    lpath = ll;
-  else
-    /* cppcheck-suppress uninitvar */
-    lpath = linkpath;
-
-  if (pushdata_stdout == S_FALSE)
-    {
-      if (SL_ENONE != sl_write (fd,        p, sizeof(sh_filestore_t)))
-	{
-	  char * tmp = sh_util_safe_name(fullpath);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			  _("Failed to write record to baseline database"),
-			  _("write_record"),
-			  tmp);
-	  SH_FREE(tmp);
-	  aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
-	}
-      if (SL_ENONE != sl_write_line_fast (fd, fullpath, sl_strlen(fullpath)))
-	{
-	  char * tmp = sh_util_safe_name(fullpath);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			  _("Failed to write path to baseline database"),
-			  _("write_record"),
-			  tmp);
-	  SH_FREE(tmp);
-	  aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
-	}
-      if (SL_ENONE != sl_write_line_fast (fd,    lpath, sl_strlen(lpath)))
-	{
-	  char * tmp = sh_util_safe_name(fullpath);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			  _("Failed to write lpath to baseline database"),
-			  _("write_record"),
-			  tmp);
-	  SH_FREE(tmp);
-	  aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
-	}
-      if (attr_string)
-	sl_write_line_fast (fd, attr_string, sl_strlen(attr_string));
-    } 
-  else 
-    {
-      if (fwrite (p, sizeof(sh_filestore_t), 1, stdout))
-	{
-	  puts (fullpath);
-	  puts (lpath);
-	  if (attr_string)
-	    puts (attr_string);
-	}
-      else
-	{
-	  perror(_("Error writing database"));
-	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-	}
-    }
-
-  SH_FREE(fullpath);
-  if (linkpath)
-    SH_FREE(linkpath);
-  if (attr_string)
-    SH_FREE(attr_string);
-
-  return;
-}
-
-static void sh_dbIO_data_write_int (file_type * buf, char * fileHash, 
-				    const char * outpath, int truncate)
-{
-  sh_filestore_t p;
-  char *  fullpath = NULL;
-  char *  linkpath = NULL;
-  char *  attr_string = NULL;
-
-  SL_ENTER(_("sh_dbIO_data_write_int"));
-
-  do_writeout_checks(outpath);
-
-  if (sh.flag.update == S_FALSE)
-    {
-      if (pushdata_stdout == S_FALSE && pushdata_fd == -1)
-	{
-	  if (truncate == S_TRUE)
-	    pushdata_fd = open_writeout_data_truncate(outpath);
-	  else
-	    {
-	      pushdata_fd = open_writeout_data(outpath);
-	      /* Seek to eof */
-	      seek_writeout_data(pushdata_fd, outpath);
-	    }
-	}
-    }
-  else /* update == TRUE */
-    {
-      if (pushdata_isfirst == 1)
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Update.>\n")));
-	  pushdata_fd = open_writeout_data(outpath);
-	  /* Seek to sof and truncate */
-	  seek_writeout_data_old(pushdata_fd, outpath);
- 	}
-    }
-
-  /* unconditionally initialize the structure */
-  memset(&p, 0, sizeof(sh_filestore_t));
-
-  if (buf != NULL) 
-    {
-      fullpath = prep_path(buf->fullpath, S_TRUE);
-    }
-
-  /* NOTE: TXT entries are c_mode[0] != 'l' and do not get decoded 
-   */
-  if (buf != NULL /* && buf->c_mode[0] == 'l' */ && buf->link_path != NULL) 
-    {  
-      if (buf->c_mode[0] == 'l')
-	linkpath = prep_path(buf->link_path, S_TRUE);
-      else
-	linkpath = prep_path(buf->link_path, S_FALSE);
-    }
-
-  if (buf != NULL && buf->attr_string != NULL) 
-    {
-      attr_string = prep_attr(buf->attr_string);
-    }
-
-  if (buf != NULL) 
-    {
-      prep_struct(&p, buf, fileHash);
-      if (attr_string)
-	p.mark |= REC_FLAGS_ATTR;
-      swap_data(&p);
-    }
-
-  /* write the start marker 
-   */
-  if (pushdata_isfirst == 1) 
-    {
-      if (sh.flag.update == S_FALSE)
-	write_start_marker(pushdata_fd);
-      pushdata_isfirst = 0;
-    }
-
-  if (buf && fullpath)
-    {
-      write_record(pushdata_fd, &p, fullpath, linkpath, attr_string);
-    }
-
-  if ((sh.flag.update != S_TRUE) && (pushdata_stdout == S_FALSE))
-    {
-      if (sh.flag.checkSum != SH_CHECK_INIT || (buf == NULL && fileHash == NULL))
-	{
-	  if (SL_ISERROR(sl_close (pushdata_fd))) 
-	    {
-	      char * tmp = sh_util_safe_name(outpath);
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			      _("Failed to close baseline database"),
-			      _("sh_dbIO_data_write_int"),
-			      tmp);
-	      SH_FREE(tmp);
-	    }
-	  else {
-	    if (sh.flag.checkSum == SH_CHECK_INIT)
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_DCLOSE);
-	  }
-	  pushdata_fd = -1;
-	}
-    }
-
-  SL_RET0(_("sh_dbIO_data_write_int"));
-}
-
-SH_MUTEX_STATIC(mutex_writeout,PTHREAD_MUTEX_INITIALIZER);
-
-void sh_dbIO_data_write (file_type * buf, char * fileHash)
-{
-  SH_MUTEX_LOCK(mutex_writeout); 
-  sh_dbIO_data_write_int (buf, fileHash, file_path('D', 'W'), S_FALSE);
-  SH_MUTEX_UNLOCK(mutex_writeout); 
-  return;
-}
-
-
-static int dbIO_writeout(sh_file_t * mtab[TABSIZE], const char * outpath, int truncate)
-{
-  sh_file_t * p;
-  int         i;
-  file_type * f;
-  char   fileHash[KEY_LEN + 1];
-
-  SL_ENTER(_("dbIO_writeout"));
-
-  SH_MUTEX_LOCK(mutex_writeout); 
-  if (!SL_ISERROR(pushdata_fd))
-    {
-      sl_close(pushdata_fd);
-      pushdata_fd = -1;
-    }
-  pushdata_isfirst =  1;
-
-
-  SH_MUTEX_LOCK(mutex_hash);
-  for (i = 0; i < TABSIZE; ++i)
-    {
-      for (p = mtab[i]; p; p = p->next)
-	{
-	  f = sh_hash_create_ft (p, fileHash);
-	  sh_dbIO_data_write_int (f, fileHash, outpath, (i == 0) ? truncate : S_FALSE);
-	  if (f->attr_string) SH_FREE(f->attr_string);
-	  if (f->link_path)   SH_FREE(f->link_path);
-	  SH_FREE(f);
-	}
-    }
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  if (!SL_ISERROR(pushdata_fd))
-    {
-      sl_close(pushdata_fd);
-      pushdata_fd = -1;
-    }
-  pushdata_isfirst =  1;
-  SH_MUTEX_UNLOCK(mutex_writeout); 
-
-  SL_RETURN (0, _("dbIO_writeout"));
-}
-
-int sh_dbIO_writeout_update()
-{
-  sh_file_t ** mtab = get_default_data_table();
-
-  if (S_TRUE == file_is_remote())
-    {
-      sh_error_handle((-1), FIL__, __LINE__, S_FALSE, MSG_E_SUBGEN, 
-		      _("Baseline database is remote"), _("sh_dbIO_writeout"));
-      SL_RETURN (1, _("sh_dbIO_writeout_update"));
-    }
-
-  return dbIO_writeout(mtab, file_path('D', 'W'), S_FALSE);
-}
-
-int sh_dbIO_writeout_to_path(const char * path)
-{
-  sh_file_t ** mtab = get_default_data_table();
-  return dbIO_writeout(mtab, path, S_TRUE);
-}
-
-static void dbIO_write_record(sh_file_t * record, SL_TICKET fd)
-{
-  sh_filestore_t * p = &(record->theFile);
-  char * fullpath    = NULL;
-  char * linkpath    = NULL;
-  char * attr_string = NULL;
-
-  fullpath = prep_path(record->fullpath, S_TRUE);
-
-  /* NOTE: TXT entries are c_mode[0] != 'l' and do not get decoded 
-   */
-  if (record->linkpath != NULL && 0 != strcmp("-", record->linkpath)) 
-    {  
-      if (p->c_mode[0] == 'l')
-	linkpath = prep_path(record->linkpath, S_TRUE);
-      else
-	linkpath = prep_path(record->linkpath, S_FALSE);
-    }
-
-  if (record->attr_string != NULL) 
-    attr_string = prep_attr(record->attr_string);
-
-  prep_encode(p);
-  swap_data(p);
-
-  write_record(fd, p, fullpath, linkpath, attr_string);
-  return;
-}
-
-static void dbIO_write_entry(sh_file_t * p)
-{
-  static int is_first = 1;
-
-  if (is_first)
-    {
-      pushdata_isfirst =  1;
-      if (!sh.outpath || sh.outpath[0] == '\0') 
-	pushdata_stdout  =  S_TRUE;
-      else
-	pushdata_fd = open_writeout_data_truncate(sh.outpath);
-      write_start_marker(pushdata_fd);
-      pushdata_isfirst = 0;
-      is_first = 0;
-    }
-
-  dbIO_write_record(p, pushdata_fd);
-
-}
-
-
-/******************************************************************
- *
- * Listing the database.
- *
- ******************************************************************/ 
-
-static int ListBinary = S_FALSE;
-static char * ListFilter = NULL;
-
-int sh_dbIO_list_binary (const char * c)
-{
-  (void) c;
-  ListBinary = S_TRUE;
-  return 0;
-}
-int sh_dbIO_list_filter (const char * c)
-{
-  ListFilter = sh_util_strdup(c);
-  return 0;
-}
-
-#include "zAVLTree.h"
-
-static zAVLTree * filter_list = NULL;
-extern char * rtrim (char * str);
-
-#include <ctype.h>
-static void read_filter()
-{
-  int    i, n = 0;
-  size_t len;
-  char * key;
-  char * str;
-  char * line = SH_ALLOC(SH_MAXBUF);
-  FILE * fd   = fopen(ListFilter, "r");
-  
-  if (!fd)
-    {
-      perror(_("read_filter: fopen:"));
-      _exit(EXIT_FAILURE);
-    }
-  do {
-    i = sh_dbIO_getline (fd, line, SH_MAXBUF);
-    str = rtrim(line);
-    while (isspace((int)*str)) ++str;
-
-    key = sh_files_parse_input(str, &len);
-
-    if (key && *key == '/')
-      {
-	zAVL_string_set(&filter_list, key);
-	++n;
-      }
-  } while (i >= 0);
-
-  fclose(fd);
-  SH_FREE(line);
-
-  if (n == 0)
-    {
-      fprintf(stderr, _("read_filter: empty file <%s>\n"), ListFilter);
-      _exit (EXIT_FAILURE);
-    }
-  return;
-}
-
-static int check_filter(char * path)
-{
-  if (NULL == zAVL_string_get(filter_list, path))
-    return S_FALSE;
-  return S_TRUE;
-}
-
-int sh_dbIO_list_db (const char * db_file)
-{
-  sh_file_t * p;
-  SL_TICKET fd;
-  char * line;
-  int  errflag = 0;
-  int  flag = 0;
-  char * ListFile = get_list_file();
-
-  if (!db_file)
-    {
-      fputs(_("ERROR: no database file given\n"), stderr);
-      _exit(EXIT_FAILURE);
-      return -1; 
-    }
-  if (sl_is_suid())
-    {
-      fputs(_("ERROR: insufficient privilege\n"), stderr);
-      _exit (EXIT_FAILURE);
-      return -1; /* for Mac OSX compiler */
-    }
-  if (0 == strcmp(db_file, _("default")))
-    db_file = file_path('D', 'W');
-  if (!db_file)
-    {
-      fputs(_("ERROR: no filename\n"), stderr);
-      _exit(EXIT_FAILURE);
-      return -1; 
-    }
-
-  if (ListFilter) 
-    read_filter();
-
-  line = SH_ALLOC(MAX_PATH_STORE+2);
-
-  if ( SL_ISERROR(fd = sl_open_read(FIL__, __LINE__, db_file, SL_YESPRIV))) 
-    {
-      fprintf(stderr, _("ERROR: can't open %s for read (errnum = %ld)\n"), 
-	      db_file, fd);
-      _exit(EXIT_FAILURE);
-      return -1; 
-    }
-
-  /* fast forward to start of data
-   */
-  if (0 != sh_dbIO_setdataent(fd, line, MAX_PATH_STORE+1, db_file))
-    {
-      fprintf(stderr, _("ERROR: can't find start marker in %s\n"), 
-	      db_file);
-      _exit(EXIT_FAILURE);
-      return -1; 
-    }
-
-  while (1) 
-    {
-      p = sh_dbIO_getdataent (line, MAX_PATH_STORE+1, db_file, &errflag);
-      if ((p != NULL) && (p->fullpath[0] == '/'))
-	{
-	  if (!ListFile)
-	    {
-	      flag = 1;
-	      if (ListFilter && S_FALSE == check_filter(p->fullpath))
-		continue;
-	      if (ListBinary)
-		dbIO_write_entry (p);
-	      else
-		sh_hash_list_db_entry (p); 
-	    }
-	  else
-	    {
-	      if (0 != sl_strcmp(ListFile, p->fullpath))
-		{
-		  continue;
-		}
-	      flag = 1;
-	      if ('l' != p->theFile.c_mode[0])
-		{
-		  if (sh_hash_printcontent(p->linkpath) < 0)
-		    {
-		      fputs(_("Error listing file content\n"), stderr);
-		      _exit(EXIT_FAILURE);
-		      return -1;
-		    }
-		}
-	      else
-		{
-		  fputs(_("File is a link\n"), stderr);
-		  _exit(EXIT_FAILURE);
-		  return -1;
-		}
-	      break;
-	    }
-	}
-      else if (p == NULL)
-	{
-	  break;
-	}
-    }
-
-  if (line != NULL)
-    SH_FREE(line);
-  sl_close (fd);
-
-  fflush(NULL);
-
-  if (flag == 0)
-    {
-      fputs(_("File not found.\n"), stderr);
-      _exit(EXIT_FAILURE);
-    }
-  else if (errflag < 0)
-    {
-      fputs(_("Error while reading file.\n"), stderr);
-      _exit(EXIT_FAILURE);
-    }
-      
-  _exit(EXIT_SUCCESS);
-  return 0; 
-}
-
-/* if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) */
-#endif
Index: trunk/src/sh_entropy.c
===================================================================
--- trunk/src/sh_entropy.c	(revision 591)
+++ trunk/src/sh_entropy.c	(revision 1)
@@ -30,8 +30,15 @@
 #endif
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
+
 
 #include <stdlib.h>
@@ -110,5 +117,5 @@
 int sh_entropy(int getbytes, char * nbuf)
 {
-    int fd = -1;
+    static int fd = -1;
     int n;
     byte buffer[256+2];
@@ -131,5 +138,5 @@
     if( do_restart ) {
         if( fd != -1 ) {
-            sl_close_fd(FIL__, __LINE__,  fd );
+            close( fd );
             fd = -1;
         }
@@ -140,9 +147,8 @@
         struct sockaddr_un addr;
         int addr_len;
-	int retval;
-
-#ifdef EGD_SOCKET_NAME
+
+      #ifdef EGD_SOCKET_NAME
         bname = EGD_SOCKET_NAME;
-#endif
+      #endif
         if ( !bname || !*bname )
             bname = _("=entropy");
@@ -164,5 +170,5 @@
         memset( &addr, 0, sizeof(addr) );
         addr.sun_family = AF_UNIX;
-        sl_strlcpy( addr.sun_path, name, sizeof(addr.sun_path) );
+        strcpy( addr.sun_path, name );              /* known to fit  */
         addr_len = offsetof( struct sockaddr_un, sun_path )
                    + strlen( addr.sun_path );
@@ -178,8 +184,5 @@
 	    SL_RETURN( -1, _("sh_entropy") );
 	  }
-	do {
-	  retval = connect(fd, (struct sockaddr *) &sinr, sizeof(sinr));
-	} while (retval < 0 && (errno == EINTR || errno == EINPROGRESS));
-        if( retval == -1 )
+        if( connect( fd, (struct sockaddr*)&addr, addr_len) == -1 )
 	  {
 	    myerror = errno;
@@ -188,5 +191,4 @@
 			     _("sh_entropy") ); 
 	    SH_FREE(name);
-	    sl_close_fd(FIL__, __LINE__, fd);
 	    SL_RETURN( -1, _("sh_entropy") );
 	  }
@@ -204,6 +206,5 @@
 	    sh_error_handle ((-1), FIL__, __LINE__, myerror, MSG_E_SUBGEN,
 			     _("cannot write to EGD"),
-			     _("sh_entropy") );
-	    sl_close_fd(FIL__, __LINE__, fd);
+			     _("sh_entropy") ); 
 	    SL_RETURN( -1, _("sh_entropy") );
 	  }
@@ -246,6 +247,5 @@
 	    sh_error_handle ((-1), FIL__, __LINE__, myerror, MSG_E_SUBGEN,
 			     _("cannot write to EGD"),
-			     _("sh_entropy") );
-	    sl_close_fd(FIL__, __LINE__, fd);
+			     _("sh_entropy") ); 
 	    SL_RETURN( -1, _("sh_entropy") );
 	  }
@@ -267,5 +267,5 @@
     }
     memset(buffer, 0, sizeof(buffer) );
-    sl_close_fd(FIL__, __LINE__, fd);
+
     SL_RETURN( 0, _("sh_entropy") ); /* success */
 }
@@ -276,11 +276,33 @@
 #if defined (HAVE_URANDOM)
 
-#include "sh_pthread.h"
-
-int read_mbytes(int timeout_val, const char * path, char * nbuf, int nbytes)
+#include <setjmp.h>
+
+static jmp_buf          entropy_timeout;
+
+static void sh_entropy_alarmhandle (int mysignal)
 {
-  int m_count;
+  (void) mysignal; /* avoid compiler warning */
+  longjmp (entropy_timeout, 1);
+}
+
+
+int read_mbytes(int timeout_val, char * path, char * nbuf, int nbytes)
+{
+  int count, m_count;
   int fd2;
 
+  struct  sigaction  new_act;
+  sigset_t           unblock;
+
+  struct sigaction      old_act;
+  volatile unsigned int old_alarm = 0;
+
+  new_act.sa_handler = sh_entropy_alarmhandle;
+  sigemptyset( &new_act.sa_mask );       /* set an empty mask       */
+  new_act.sa_flags = 0;                  /* init sa_flags           */
+
+  sigemptyset(&unblock);
+  sigaddset  (&unblock, SIGALRM);
+
   SL_ENTER(_("read_mbytes"));
 
@@ -288,12 +310,59 @@
     {
       /* Test whether file is a character device, and is 
-       * readable.
-       */
-      if (0 == sh_unix_device_readable(fd2)) 
+       * not world writeable.
+       */
+      if (0 == sh_unix_file_exists(fd2)) 
 	{
-	  m_count = sl_read_timeout_fd(fd2, nbuf, nbytes, 
-				       timeout_val, S_FALSE);
-	  if (m_count < 0)
-	    m_count = 0;
+
+	  /* alarm was triggered
+	   */
+	  if (setjmp(entropy_timeout) != 0)
+	    {
+	      alarm(0);
+	      sigaction (SIGALRM, &old_act, NULL);
+	      alarm(old_alarm);
+	      sigprocmask(SIG_UNBLOCK, &unblock, NULL);
+	      TPT((0,FIL__,__LINE__, _("msg=<read_mbytes: timeout>\n"))); 
+	      close (fd2);
+	      SL_RETURN(0, _("read_mbytes"));
+	    }
+
+	  /* timeout after 30 seconds
+	   */
+	  old_alarm = alarm(0);
+	  sigaction (SIGALRM, &new_act, &old_act);
+	  alarm(timeout_val);
+
+	  m_count = 0;
+
+	  while (m_count < nbytes) 
+	    {
+	      errno = 0; /* paranoia */
+	      count = read (fd2, &nbuf[m_count], nbytes-m_count);
+
+	      switch (count)
+		{
+		case -1:
+#ifdef EWOULDBLOCK
+                  if (errno == EINTR || errno == EAGAIN ||
+                      errno == EWOULDBLOCK)
+#else
+                  if (errno == EINTR || errno == EAGAIN)
+#endif
+                    continue;
+
+                  /* if errno == -1 && no continue: fallthrough to this */
+                case 0:
+                  break;
+                default:
+                  m_count += count;
+                }
+	    }
+	  close (fd2);
+
+	  alarm(0);
+	  sigaction (SIGALRM, &old_act, NULL);
+	  alarm(old_alarm);
+	  sigprocmask(SIG_UNBLOCK, &unblock, NULL);
 	}
       else
@@ -302,6 +371,4 @@
   else
     m_count = 0;
-
-  sl_close_fd(FIL__, __LINE__, fd2);
 
   TPT((0, FIL__, __LINE__, _("msg=<read_mbytes: OK>\n"))); 
@@ -317,5 +384,4 @@
   int    i, m_count = 0;
   char * keybuf;
-  UINT32 kbuf[KEY_BYT/sizeof(UINT32)];
   char   addbuf[2 * KEY_BYT];
 
@@ -327,10 +393,10 @@
     nbytes = KEY_BYT;
 
-  memset(nbuf, 0, nbytes);
+  memset(nbuf, '\0', nbytes);
 
 #ifdef NAME_OF_DEV_URANDOM
-  m_count = read_mbytes ( 10, NAME_OF_DEV_URANDOM, nbuf, nbytes);
+  m_count = read_mbytes (30, NAME_OF_DEV_RANDOM, nbuf, nbytes);
 #else
-  m_count = read_mbytes (300, NAME_OF_DEV_RANDOM,  nbuf, nbytes);
+  m_count = read_mbytes (300, NAME_OF_DEV_RANDOM, nbuf, nbytes);
 #endif
 
@@ -339,5 +405,5 @@
 #ifdef NAME_OF_DEV_URANDOM
       sh_error_handle (SH_ERR_NOTICE, FIL__, __LINE__, EIO, MSG_NODEV, 
-		       (long) sh.real.uid, NAME_OF_DEV_URANDOM);
+		       (long) sh.real.uid, NAME_OF_DEV_RANDOM);
 #else
       sh_error_handle ((-1), FIL__, __LINE__, EIO, MSG_NODEV, 
@@ -346,11 +412,11 @@
     }
 
-#ifdef NAME_OF_DEV_RANDOM
+#ifdef NAME_OF_DEV_URANDOM
   if (m_count < nbytes)
     {
-      i = read_mbytes(300, NAME_OF_DEV_RANDOM, &nbuf[m_count], nbytes-m_count);
+      i = read_mbytes(30, NAME_OF_DEV_URANDOM, &nbuf[m_count], nbytes-m_count);
       if (i == 0)
 	sh_error_handle ((-1), FIL__, __LINE__, EIO, MSG_NODEV, 
-			 (long) sh.real.uid, NAME_OF_DEV_RANDOM);
+			 (long) sh.real.uid, NAME_OF_DEV_URANDOM);
       else
 	m_count += i;
@@ -363,5 +429,5 @@
       /* -- Add previous entropy into the new pool. --
        */
-      memset(addbuf, 0, sizeof(addbuf));
+      memset(addbuf, '\0', sizeof(addbuf));
       for (i = 0; i < m_count; ++i)
 	addbuf[i]         = nbuf[i];
@@ -369,11 +435,9 @@
 	addbuf[i+KEY_BYT] = skey->poolv[i];
       keybuf = (char *) sh_tiger_hash_uint32 (addbuf, 
-					      TIGER_DATA, 2 * KEY_BYT,
-					      kbuf, KEY_BYT/sizeof(UINT32));
-      memset(addbuf, 0, sizeof(addbuf));
+					      TIGER_DATA, 2 * KEY_BYT);
+      memset(addbuf, '\0', sizeof(addbuf));
       
       /* -- Give out nbytes bytes from the new pool. --
        */
-      SH_MUTEX_LOCK_UNSAFE(mutex_skey);
       for (i = 0; i < KEY_BYT; ++i)
 	{
@@ -382,7 +446,5 @@
 	    nbuf[i] = keybuf[i];
 	}
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-      memset (keybuf, 0, KEY_BYT);
-      memset (kbuf,   0, sizeof(kbuf));
+      memset (keybuf, '\0', KEY_BYT);
       
       SL_RETURN(0, _("sh_entropy"));
@@ -409,13 +471,11 @@
 #endif
 #ifndef FD_ZERO
-#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
+#define FD_ZERO(p)      memset((char *)(p), '\0', sizeof(*(p)))
 #endif
 
 #include "sh_static.h"
-#include "sh_pthread.h"
 
 static
 char   * com_path[] = {
-  N_("/usr/bin/xpg4/"),
   N_("/usr/ucb/"),
   N_("/bin/"),
@@ -424,5 +484,4 @@
   N_("/usr/sbin/"),
   N_("/usr/local/bin/"),
-  N_("/opt/local/bin/"),
   NULL
 };
@@ -439,5 +498,5 @@
 
 static
-sourcetable_t source_template[] = {
+sourcetable_t source[] = {
   { N_("w"),
     N_("w"),
@@ -508,31 +567,12 @@
   int pipedes[2];
   FILE *outf = NULL;
+  struct passwd * tempres;
   char * arg[4];
   char * envp[2];
-  size_t len;
-  char   arg0[80];
-  char   arg1[80];
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  struct passwd    pwd;
-  char           * buffer;
-  struct passwd *  tempres;
-#else
-  struct passwd * tempres;
-#endif
 
   SL_ENTER(_("sh_popen"));
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-  sh_getpwnam_r(DEFAULT_IDENT, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-  tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
-
-  strncpy (arg0, _("/bin/sh"), sizeof(arg0));
-  arg[0] = arg0;
-  strncpy (arg1, _("-c"), sizeof(arg1));
-  arg[1] = arg1;
+  arg[0] = _("/bin/sh");
+  arg[1] = _("-c");
   arg[2] = command;
   arg[3] = NULL;
@@ -540,8 +580,7 @@
   if (sh.timezone != NULL)
     {
-      len = sl_strlen(sh.timezone) + 4;
-      envp[0] = calloc(1, len);     /* free() ok     */
+      envp[0] = malloc (sl_strlen(sh.timezone) + 4);     /* free() ok     */
       if (envp[0] != NULL)
-	sl_snprintf (envp[0], len, "TZ=%s", sh.timezone);
+	sprintf (envp[0], "TZ=%s", sh.timezone);         /* known to fit  */
       else
 	envp[0] = NULL;
@@ -561,6 +600,4 @@
   }
   
-  fflush (NULL);
-
   source->pid = aud_fork(FIL__, __LINE__);
   
@@ -568,6 +605,6 @@
    */
   if (source->pid == (pid_t) - 1) {
-    sl_close_fd(FIL__, __LINE__, pipedes[0]);
-    sl_close_fd(FIL__, __LINE__, pipedes[1]);
+    close(pipedes[0]);
+    close(pipedes[1]);
     if (envp[0] != NULL) free(envp[0]);
     SL_RETURN(NULL, _("sh_popen"));
@@ -576,23 +613,19 @@
   if (source->pid == (pid_t) 0) 
     {
-      int val_return;
 
       /* child - make read side of the pipe stdout 
        */
-      do {
-	val_return = dup2 (pipedes[STDOUT_FILENO], STDOUT_FILENO);
-      } while (val_return < 0 && errno == EINTR);
-
-      if (val_return < 0)
-	_exit(EXIT_FAILURE);
+      if (retry_aud_dup2(FIL__, __LINE__, 
+			 pipedes[STDOUT_FILENO], STDOUT_FILENO) < 0)
+	aud__exit(FIL__, __LINE__, EXIT_FAILURE);
       
       /* close the pipe descriptors 
        */
-      sl_close_fd   (FIL__, __LINE__, pipedes[STDIN_FILENO]);
-      sl_close_fd   (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
+      close   (pipedes[STDIN_FILENO]);
+      close   (pipedes[STDOUT_FILENO]);
 
       /* don't leak file descriptors
        */
-      sh_unix_closeall (3, -1, S_TRUE); /* in child process */
+      sh_unix_closeall (3, -1); /* in child process */
 
       /* zero priv info
@@ -603,73 +636,57 @@
        */
       i = 0; 
-      if (0 == geteuid()) 
-	{
-  
-	  if (NULL != tempres) {
-	    i = setgid(tempres->pw_gid);
-
-	    /*** locks up in dnmalloc ***/
-	    /*
-	     * if (i == 0)
-	     *   i = sh_unix_initgroups(DEFAULT_IDENT ,tempres->pw_gid);
-	     */
-
-	    if (i == 0) 
-	      i = setuid(tempres->pw_uid);
-	    /* make sure we cannot get root again
-	     */
-	    if ((tempres->pw_uid != 0) && 
-		(setuid(0) >= 0))
-	      i = -1;
-	  } else {
+      if (0 == geteuid()) {  
+	tempres = sh_getpwnam(DEFAULT_IDENT);
+	if (NULL != tempres) {
+	  i = aud_setgid(FIL__, __LINE__, tempres->pw_gid); 
+	  if (i == 0)
+	    i = sh_unix_initgroups(DEFAULT_IDENT ,tempres->pw_gid);
+	  if (i == 0) 
+	    i = aud_setuid(FIL__, __LINE__, tempres->pw_uid);
+	  /* make sure we cannot get root again
+	   */
+	  if ((tempres->pw_uid != 0) && (aud_setuid(FIL__, __LINE__, 0) >= 0))
 	    i = -1;
-	  }
+	} else {
+	  i = -1;
 	}
+      }
       
       /* some problem ...
        */
       if (i == -1) {
-	_exit(EXIT_FAILURE);
+	aud__exit(FIL__, __LINE__, EXIT_FAILURE);
       }
       
-      /* cppcheck-suppress leakNoVarFunctionCall */
-      if (NULL != freopen (_("/dev/null"), "r+", stderr))
-	{
+      freopen (_("/dev/null"), "r+", stderr);
       
-	  /* exec the program */
-	  do {
-	    val_return = execve (_("/bin/sh"), arg, envp);
-	  } while (val_return < 0 && errno == EINTR);
-	}
-
+      /* exec the program */
+      retry_aud_execve (FIL__, __LINE__, _("/bin/sh"), arg, envp);
+      
       /* failed 
        */
-      _exit(EXIT_FAILURE);
-    }
-
-  /* parent
-   */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  SH_FREE(buffer);
-#endif
-
-  if (envp[0] != NULL) 
-    free(envp[0]);
-  
-  sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-  retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFD, FD_CLOEXEC);
-  
-  outf = fdopen (pipedes[STDIN_FILENO], "r");
-  
-  if (outf == NULL) 
-    {
-      aud_kill (FIL__, __LINE__, source->pid, SIGKILL);
-      sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-      waitpid (source->pid, NULL, 0);
-      source->pid = 0;
-      SL_RETURN(NULL, _("sh_popen"));
-    }
-  
-  SL_RETURN(outf, _("sh_popen"));
+      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+    /* parent
+     */
+    if (envp[0] != NULL) 
+      free(envp[0]);
+
+    close (pipedes[STDOUT_FILENO]);
+    retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFD, FD_CLOEXEC);
+
+    outf = fdopen (pipedes[STDIN_FILENO], "r");
+
+    if (outf == NULL) 
+      {
+        aud_kill (FIL__, __LINE__, source->pid, SIGKILL);
+	close (pipedes[STDOUT_FILENO]);
+        waitpid (source->pid, NULL, 0);
+        source->pid = 0;
+	SL_RETURN(NULL, _("sh_popen"));
+      }
+
+    SL_RETURN(outf, _("sh_popen"));
 }
 
@@ -678,42 +695,15 @@
 {
     int status = 0;
-    int retval;
-    char msg[128];
-    char errbuf[SH_ERRBUF_SIZE];
 
     SL_ENTER(_("sh_pclose"));
 
-    retval = sl_fclose(FIL__, __LINE__, source->pipe);
-    if (retval)
+    status = fclose(source->pipe);
+    if (status)
       {
-	sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, retval, 
-			 MSG_E_SUBGEN,
-			 sh_error_message(retval, errbuf, sizeof(errbuf)),
-                         _("sh_pclose"));
 	SL_RETURN((-1), _("sh_pclose"));
       }
 
-    retval = waitpid(source->pid, &status, 0);
-    if (retval != source->pid)
-      {
-	sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, retval, 
-			 MSG_E_SUBGEN,
-			 sh_error_message(retval, errbuf, sizeof(errbuf)),
-                         _("sh_pclose"));
-
-	status = -1;
-      }
-#if !defined(USE_UNO)
-    else if (WIFSIGNALED(status))
-      {
-	sl_snprintf(msg, sizeof(msg), _("Subprocess terminated by signal %d"),
-		    WTERMSIG(status));
-	sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, retval, 
-			 MSG_E_SUBGEN,
-			 msg,
-                         _("sh_pclose"));
-	status = -1;
-      }
-#endif
+    if (waitpid(source->pid, NULL, 0) != source->pid)
+      status = -1;
 
     source->pipe = NULL;
@@ -738,5 +728,4 @@
 
   char * keybuf;
-  UINT32 kbuf[KEY_BYT/sizeof(UINT32)];
   char   addbuf[2 * KEY_BYT];
 
@@ -746,8 +735,5 @@
   int    maxFD = 0;
   int    imax, selcount;
-  char errbuf[SH_ERRBUF_SIZE];
-
-  sourcetable_t  *source = NULL;
-  
+
   SL_ENTER(_("sh_entropy"));
 
@@ -760,5 +746,4 @@
   /* --- If there is entropy in the pool, return it. ---
    */
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
   if (skey->poolc >= nbytes)
     {
@@ -769,8 +754,6 @@
 	  --skey->poolc;
 	}
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); /* alternative path */
       SL_RETURN(0, _("sh_entropy"));
     }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
 
 
@@ -783,17 +766,9 @@
     {
       sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-		      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+		      sh_error_message (caperr), 
 		      _("sl_get_cap_sub"));
     }
 
-  while (source_template[i].command != NULL) {
-    ++i;
-  }
-  source = SH_ALLOC(i * sizeof(sourcetable_t));
-  for (j = 0; j < i;++j)
-    memcpy(&source[j], &source_template[j], sizeof(sourcetable_t));
-  i = 0;
-
-  while (source_template[i].command != NULL) {
+  while (source[i].command != NULL) {
 
     j = 0;
@@ -803,5 +778,4 @@
 	sl_strlcat(combuf, _(source[i].command), 80);
 
-	/* flawfinder: ignore */
 	if ( access (combuf, X_OK) == 0) 
 	  {
@@ -925,47 +899,20 @@
     }
   buffer[bufcount] = '\0';
-  
-  SH_FREE(source);
 
   if (0 != (caperr = sl_drop_cap_sub()))
     {
       sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-		      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+		      sh_error_message (caperr), 
 		      _("sl_drop_cap_sub"));
     }
 
-#ifdef HAVE_GETTIMEOFDAY
-  {
-    unsigned short tseed[3];
-
-    gettimeofday(&tv, 0);
-    tseed[0] = tv.tv_sec & 0xFFFF;
-    tseed[1] = tv.tv_usec & 0xFFFF;
-    tseed[2] = (tv.tv_sec ^ tv.tv_usec) >> 16;
-    keybuf = (char *) sh_tiger_hash_uint32 ((char *) tseed, 
-					    TIGER_DATA, sizeof(tseed),
-					    kbuf, KEY_BYT/sizeof(UINT32));
-    memset(addbuf, 0, sizeof(addbuf));
-    for (i = 0; i < KEY_BYT; ++i)
-      {
-	addbuf[i]         = keybuf[i];
-	addbuf[i+KEY_BYT] = skey->poolv[i];
-      }
-    SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-    for (i = 0; i < KEY_BYT; ++i)
-      skey->poolv[i] ^= keybuf[i];
-    SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-  }
-#endif
-
   if (bufcount > 0) 
     {
       keybuf = (char *) sh_tiger_hash_uint32 (buffer, 
-					      TIGER_DATA, sl_strlen(buffer),
-					      kbuf, KEY_BYT/sizeof(UINT32));
+					      TIGER_DATA, sl_strlen(buffer));
 
       /* add previous entropy into the new pool
        */
-      memset(addbuf, 0, sizeof(addbuf));
+      memset(addbuf, '\0', sizeof(addbuf));
       for (i = 0; i < KEY_BYT; ++i)
 	{
@@ -974,17 +921,14 @@
 	}
       keybuf = (char *) sh_tiger_hash_uint32 (addbuf, 
-					      TIGER_DATA, sizeof(addbuf),
-					      kbuf, KEY_BYT/sizeof(UINT32));
-      memset(addbuf, 0, sizeof(addbuf));
+					      TIGER_DATA, sizeof(addbuf));
+      memset(addbuf, '\0', sizeof(addbuf));
       
       /* store in system pool
        */
-      SH_MUTEX_LOCK_UNSAFE(mutex_skey);
       for (i = 0; i < KEY_BYT; ++i)
 	skey->poolv[i] = keybuf[i];
       skey->poolc = KEY_BYT;
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-      memset (buffer, 0, BUF_ENT+2);
-      memset (keybuf, 0, KEY_BYT);
+      memset (buffer, '\0', BUF_ENT+2);
+      memset (keybuf, '\0', KEY_BYT);
       SH_FREE(buffer);
     } 
@@ -997,5 +941,4 @@
   /* give out nbytes Bytes from the entropy pool
    */
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
   for (i = 0; i < nbytes; ++i)
     {
@@ -1003,5 +946,4 @@
       --skey->poolc;
     }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
 
   SL_RETURN(0, _("sh_entropy"));
@@ -1011,38 +953,8 @@
 #endif
 
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_entropy (CuTest *tc)
-{
-  char                 bufx[9 * sizeof(UINT32) + 1];
-  char                 bufy[9 * sizeof(UINT32) + 1];
-  int                  status;
-  int                  count;
-
-  for (count = 0; count < 20; ++count)
-    {
-      memset(skey->poolv, 0, KEY_BYT);
-      skey->poolc = 0;
-
-      status = sh_entropy (24, bufx);
-      CuAssertTrue(tc, 0 == status);
-      
-      memset(skey->poolv, 0, KEY_BYT);
-      skey->poolc = 0;
-
-      status = sh_entropy (24, bufy);
-      CuAssertTrue(tc, 0 == status);
-      
-      CuAssertTrue(tc, 0 != memcmp(bufx, bufy, 24));
-    }
-}
-#endif
-
-
-
-
-
-
-
-
+
+
+
+
+
+
Index: trunk/src/sh_err_console.c
===================================================================
--- trunk/src/sh_err_console.c	(revision 591)
+++ trunk/src/sh_err_console.c	(revision 1)
@@ -25,5 +25,4 @@
 #include "sh_error.h"
 #include "sh_utils.h"
-#include "sh_sem.h"
 
 #undef  FIL__
@@ -33,11 +32,9 @@
 #include <sys/types.h>
 #include <fcntl.h>
-#include <sys/stat.h>
 #include <unistd.h>
 #include <signal.h>
-#include <sys/socket.h>
-#include <sys/un.h>
 
 extern int  OnlyStderr;
+
  
 #if !defined(O_NONBLOCK)
@@ -56,8 +53,4 @@
 #include <sys/msg.h>
 
-#if !defined(EIDRM)
-#define EIDRM (EINVAL)
-#endif
-
 struct sh_msgbuf {
   long mtype;
@@ -73,22 +66,20 @@
 /* Open the SysV message queue, creating it when neccesary
  */
-static int open_queue(void)
+static int open_ipc(void)
 {
   key_t            key;
-#if defined(WITH_TPT) 
-  char errbuf[SH_ERRBUF_SIZE];
-#endif
-
-  SL_ENTER(_("open_queue"));
+  int              error;
+
+  SL_ENTER(_("open_ipc"));
 
   /* get key
    */
-  key = ftok (DEFAULT_DATAROOT, '#');
-
+  key = ftok ("/tmp", '#');
   if (key == (key_t) -1)
     {
+      error = errno;
       TPT(( 0, FIL__, __LINE__, _("msg=<ftok: %s> errno=<%d>\n"), 
-	    sh_error_message(errno, errbuf, sizeof(errbuf)), errno));
-      SL_RETURN(-1, _("open_queue"));
+	    sh_error_message(error), error));
+      SL_RETURN(-1, _("open_ipc"));
     }
 
@@ -99,25 +90,27 @@
   if (msgid < 0)
     {
+      error = errno;
       TPT(( 0, FIL__, __LINE__, _("msg=<msgget: %s> errno=<%d>\n"), 
-	    sh_error_message(errno, errbuf, sizeof(errbuf)), errno));
-      SL_RETURN(-1, _("open_queue"));
-    }
-
-  SL_RETURN(0, _("open_queue"));
-}
-
-/* Close the SysV message queue and/or semaphore
+	    sh_error_message(error), error));
+      SL_RETURN(-1, _("open_ipc"));
+    }
+
+  SL_RETURN(0, _("open_ipc"));
+}
+
+/* Close the SysV message queue
  */
 void close_ipc (void)
 {
+  SL_ENTER(_("close_ipc"));
+
   if (msgid != (-1))
     (void) msgctl (msgid, IPC_RMID, NULL);
-  sh_sem_close();
-  return;
+  SL_RET0(_("close_ipc"));
 }
 
 /* Enable the message queue
  */
-int enable_msgq(const char * foo)
+int enable_msgq(char * foo)
 {
   int i;
@@ -128,33 +121,14 @@
 }
 
+/* #define MY_MAX_MSG    254 */
 #define MY_MAX_MSG    1022
 
-static void remove_message()
-{
-  int rc;
-  struct {
-    long    mtype;       /* Message type. */
-    char    mtext[128];  /* Message text. */
-  } recv_msg;
-
-  recv_msg.mtype = 1;
-  do {
-    rc = msgrcv(msgid, &recv_msg, sizeof(recv_msg.mtext), 1, 
-		MSG_NOERROR|IPC_NOWAIT);
-  } while (rc < 0 && errno == EINTR);
-
-  memset(&recv_msg, 0, sizeof(recv_msg));
-  return;
-}
-
-static int push_message_queue (const char * msg)
+static int push_message_queue (char * msg)
 {
   struct sh_msgbuf*   recv_msg = NULL;
   int              rc       = -1;
   static int       status   = -1;
+  int              error;
   int              count    = 0;
-#if defined(WITH_TPT) 
-  char errbuf[SH_ERRBUF_SIZE];
-#endif
 
   SL_ENTER(_("push_message_queue"));
@@ -169,10 +143,10 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<msg_queue not open>\n"))); 
-      status = open_queue();
+      status = open_ipc();
     }
 
   if (status < 0)
     {
-      TPT(( 0, FIL__, __LINE__, _("msg=<open_queue() failed>\n"))); 
+      TPT(( 0, FIL__, __LINE__, _("msg=<open_ipc() failed>\n"))); 
       SL_RETURN(-1, _("push_message_queue"));
     }
@@ -181,6 +155,6 @@
    *   long mtype;
    *   char mtext[1];  <-- sizeof(mtext) will be  1+MY_MAX_MSG
-   * } */
-
+   * }
+   */
   recv_msg = (struct sh_msgbuf*) SH_ALLOC(sizeof(struct sh_msgbuf)+MY_MAX_MSG);
   recv_msg->mtype = 1;
@@ -193,37 +167,45 @@
   if (count > 1)
     {
-      memset(recv_msg, 0, MY_MAX_MSG+1);
       SH_FREE(recv_msg);
       SL_RETURN(-1, _("push_message_queue"));
     }
 
-  do { errno = 0;
+  /* send the message
+   */ 
+  do {
+    errno = 0;
     rc = msgsnd(msgid, recv_msg, strlen(recv_msg->mtext)+1, IPC_NOWAIT);
-
-    if (rc == -1 && errno == EAGAIN)
-      remove_message();
-  } while (rc < 0 && (errno == EINTR && errno == EAGAIN));
+  }
+  while (rc < 0 && errno == EINTR);
   
   if (rc == -1 && errno != EAGAIN) 
     {
-      /* EIDRM is not in OpenBSD */
-      if (errno == EINVAL || errno == EIDRM) {
-	TPT(( 0, FIL__, __LINE__, _("msg=<msg_queue not open>\n"))); 
-	status = open_queue();
-	if (status == 0) {
-	  ++count;
-	  goto send_it; }
-      } else {
-	TPT(( 0, FIL__, __LINE__, _("msg=<msgsnd: %s> errno=<%d>\n"), 
-	      sh_error_message(errno, errbuf, sizeof(errbuf)), errno));
-	memset(recv_msg, 0, MY_MAX_MSG+1);
-	SH_FREE(recv_msg);
-	SL_RETURN(-1, _("push_message_queue"));
-      }
-    }
-
-  memset(recv_msg, 0, MY_MAX_MSG+1);
+      /* EIDRM is not in OpenBSD
+       */
+      if (errno == EINVAL
+#if defined(EIDRM)
+	  || errno == EIDRM
+#endif
+	  )
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<msg_queue not open>\n"))); 
+	  status = open_ipc();
+	  if (status == 0)
+	    {
+	      ++count;
+	      goto send_it;
+	    }
+	}
+      else
+	{
+	  error = errno;
+	  TPT(( 0, FIL__, __LINE__, _("msg=<msgsnd: %s> errno=<%d>\n"), 
+		sh_error_message(error), error));
+	  SH_FREE(recv_msg);
+	  SL_RETURN(-1, _("push_message_queue"));
+	}
+    }
+
   SH_FREE(recv_msg);
-
   SL_RETURN(0, _("push_message_queue"));
 }
@@ -240,25 +222,11 @@
 #endif
 
-#else /* no message queue */
-
-void close_ipc() { sh_sem_close(); return; }
-
 #endif
 
 static int count_dev_console = 0;
 
-typedef enum { SH_LOG_UNIX, SH_LOG_OTHER, SH_LOG_INDEF } sh_log_devtype;
-
-static sh_log_devtype dt[2] = { SH_LOG_INDEF, SH_LOG_INDEF };
-static int            st[2] = { SOCK_DGRAM, SOCK_DGRAM };
-
 void reset_count_dev_console(void)
 {
   count_dev_console = 0;
-  dt[0] = SH_LOG_INDEF;
-  dt[1] = SH_LOG_INDEF;
-  st[0] = SOCK_DGRAM;
-  st[1] = SOCK_DGRAM;
-  
   return;
 }
@@ -266,5 +234,5 @@
 /* ---- Set the console device. ----
  */
-int sh_log_set_console (const char * address)
+int sh_log_set_console (char * address)
 {
   SL_ENTER(_("sh_log_set_console"));
@@ -284,7 +252,7 @@
 
 #if defined(WITH_TRACE) || defined(WITH_TPT)
-char *  sh_log_console_name (void)
-{
-  if (sh.srvcons.name[0] == '\0' ||
+char *  sh_log_console_name ()
+{
+  if (! sh.srvcons.name || sh.srvcons.name[0] == '\0' ||
       0 == strcmp(sh.srvcons.name, _("NULL")))
     return (_("/dev/console"));
@@ -297,92 +265,11 @@
 #endif
 
-static int  find_socktype(const char * name)
-{
-#ifdef SOCK_SEQPACKET
-    int socktypes[3] = { SOCK_DGRAM, SOCK_SEQPACKET, SOCK_STREAM };
-    int try = 3;
-#else
-    int socktypes[2] = { SOCK_DGRAM, SOCK_STREAM };
-    int try = 2;
-#endif
-    int i;
-    for (i = 0; i < try; ++i) {
-	struct sockaddr_un addr;
-	int fd;
-    
-	if ( (fd = socket(AF_UNIX, socktypes[i], 0)) == -1) {
-	    return -1;
-	}
-	memset(&addr, 0, sizeof(addr));
-	addr.sun_family = AF_UNIX;
-	sl_strlcpy(addr.sun_path, name, sizeof(addr.sun_path));
-	if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == 0) {
-	    close(fd);
-	    return socktypes[i];
-	}
-	close(fd);
-    }
-    return -1;
-}
-
-int sh_log_console_open (const char * name, int slot)
-{
-  int fd = -1;
-
-  if (dt[slot] == SH_LOG_INDEF)
-    {
-      struct stat sb;
-      if (retry_stat(FIL__, __LINE__, name, &sb) == 0)
-	{
-	  if ((sb.st_mode & S_IFMT) == S_IFSOCK)
-	    {
-	      dt[slot] = SH_LOG_UNIX;
-	      st[slot] = find_socktype(name);
-	      if (st[slot] == -1) {
-	        sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		   _("Could not determine socket type."),  
-		   name);
-	      }
-	    }
-	  else
-	    dt[slot] = SH_LOG_OTHER;
-	}
-    }
-      
-  if (dt[slot] == SH_LOG_OTHER) {
-    fd = open ( name, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
-  }
-  else if (dt[slot] == SH_LOG_UNIX && st[slot] != -1) {
-    struct sockaddr_un addr;
-    
-    if ( (fd = socket(AF_UNIX, st[slot], 0)) == -1) {
-	  char ebuf[SH_ERRBUF_SIZE];
-	  int  errnum = errno;
-	  sh_error_handle ((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-	    sh_error_message(errnum, ebuf, sizeof(ebuf)),  
-	    name);
-      return -1;
-    }
-    memset(&addr, 0, sizeof(addr));
-    addr.sun_family = AF_UNIX;
-    sl_strlcpy(addr.sun_path, name, sizeof(addr.sun_path));
-    if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
-	  char ebuf[SH_ERRBUF_SIZE];
-	  int  errnum = errno;
-	  sh_error_handle ((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-	    sh_error_message(errnum, ebuf, sizeof(ebuf)),
-	    name);
-      return -1;
-    }
-  }
-  return fd;
-}
-
 /* ---- Print out a message. ----
  */
-int  sh_log_console (const /*@null@*/char *errmsg)
+int  sh_log_console (/*@null@*/char *errmsg)
 {
   static int service_failure[2] = { 0, 0};
   int    fd[2] = { -1, -1};
+  int    sflags;
   int    cc;
   size_t len;
@@ -391,6 +278,6 @@
   /* static int logkey_seen = 0; */
   int    error;
+  struct sigaction sa_new, sa_old;
   static int blockMe = 0;
-  int    val_return;
 
   SL_ENTER(_("sh_log_console"));
@@ -411,16 +298,21 @@
 #endif
 
+  sa_new.sa_handler = SIG_IGN;
+  (void) sigemptyset(&sa_new.sa_mask);
+  sa_new.sa_flags   = 0;
+
+  /* Ignore SIGPIPE in case the console is actually a pipe.
+   */
+  (void) retry_sigaction(FIL__, __LINE__, SIGPIPE, &sa_new, &sa_old);
+ 
   if (sh.flag.isdaemon == S_FALSE || OnlyStderr == S_TRUE)
     {
       len = strlen(errmsg);
-      do {
-	val_return = write(STDERR_FILENO, errmsg, len);
-      } while (val_return < 0 && errno == EINTR); 
-      do {
-	val_return = write(STDERR_FILENO, "\n", 1);
-      } while (val_return < 0 && errno == EINTR); 
+      (void) write(STDERR_FILENO, errmsg, len);
+      (void) write(STDERR_FILENO, "\n", 1);
       /* 
        * fprintf (stderr, "%s\n", errmsg); 
        */
+      (void) retry_sigaction(FIL__, __LINE__, SIGPIPE, &sa_old, NULL);
       blockMe = 0;
       SL_RETURN(0, _("sh_log_console"));
@@ -429,12 +321,28 @@
   /* --- daemon && initialized ---
    */
-  if ( OnlyStderr == S_FALSE ) 
-    {
-      fd[0] = sh_log_console_open ( sh.srvcons.name, 0);
-
-      if (sh.srvcons.alt[0] != '\0')
+  if ( (OnlyStderr == S_FALSE) ) 
+    {
+      fd[0] = open ( sh.srvcons.name, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
+      if (fd[0] >= 0) {
+	sflags = (int) retry_fcntl(FIL__, __LINE__, fd[0], F_GETFL, 0);
+	if (sflags >= 0)
+	  {
+	    (void) retry_fcntl(FIL__, __LINE__, fd[0], 
+			       F_SETFL, sflags & ~O_NONBLOCK);
+	  }
+      }
+
+      if (sh.srvcons.alt != NULL && sh.srvcons.alt[0] != '\0')
 	{
-	  fd[1] = sh_log_console_open (sh.srvcons.alt, 1);
-	  ccMax = 2;
+	  fd[1] = open (sh.srvcons.alt, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
+	  if (fd[1] >= 0) {
+	    sflags = (int) retry_fcntl(FIL__, __LINE__, fd[1], F_GETFL, 0);
+	    if (sflags >= 0)
+	      {
+		(void) retry_fcntl(FIL__, __LINE__, fd[1], 
+				   F_SETFL, sflags & ~O_NONBLOCK);
+	      }
+	    ccMax = 2;
+	  }
 	}
 
@@ -453,13 +361,7 @@
 	  if (fd[cc] >= 0)
 	    {
-	      do {
-		val_return = write(fd[cc], errmsg, strlen(errmsg));
-	      } while (val_return < 0 && errno == EINTR);
-	      if (dt[cc] != SH_LOG_UNIX || st[cc] == SOCK_STREAM) {
-	        do {
-	          val_return = write(fd[cc], "\r\n",              2);
-	        } while (val_return < 0 && errno == EINTR);
-	      }
-	      (void) sl_close_fd(FIL__, __LINE__, fd[cc]);
+	      (void) write(fd[cc], errmsg, strlen(errmsg));
+	      (void) write(fd[cc], "\r\n",              2);
+	      (void) close(fd[cc]);
 	      service_failure[cc] = 0;
 	    }
@@ -469,4 +371,5 @@
     retval = 0;
 
+  (void) retry_sigaction(FIL__, __LINE__, SIGPIPE, &sa_old, NULL);
   blockMe = 0;
   SL_RETURN(retval, _("sh_log_console"));
Index: trunk/src/sh_err_log.c
===================================================================
--- trunk/src/sh_err_log.c	(revision 591)
+++ trunk/src/sh_err_log.c	(revision 1)
@@ -24,5 +24,4 @@
 #include <sys/types.h>
 #include <unistd.h>
-#include <time.h>
 
 #include "samhain.h"
@@ -70,5 +69,5 @@
   /* open the file, then check it 
    */
-  if ( SL_ISERROR(fd = sl_open_read (FIL__, __LINE__, path, SL_NOPRIV)))
+  if ( SL_ISERROR(fd = sl_open_read (path, SL_NOPRIV)))
     {
       fprintf(stderr, _("Could not open file <%s>\n"), path);
@@ -117,5 +116,5 @@
 static int just_list = S_FALSE;
 
-int sh_error_logverify_mod (const char * s)
+int sh_error_logverify_mod (char * s)
 {
   just_list = S_TRUE;
@@ -126,5 +125,5 @@
 } 
 
-int sh_error_logverify (const char * s)
+int sh_error_logverify (char * s)
 {
   SL_TICKET fd;
@@ -146,5 +145,4 @@
   char c_cont;
   int  chk_mode = CHK_KEY;
-  char hashbuf[KEYBUF_SIZE];
 
   sh_error_logoff();
@@ -164,5 +162,5 @@
     }
 
-  if ( SL_ISERROR(fd = sl_open_read (FIL__, __LINE__, s, SL_NOPRIV)) )
+  if ( SL_ISERROR(fd = sl_open_read (s, SL_NOPRIV)) )
     {
       fprintf(stderr, 
@@ -185,6 +183,6 @@
 #endif
 
-  buf  = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 );
-  bufc = (char *) SH_ALLOC( 2*SH_MSG_BUF+1 );
+  buf  = (char *) SH_ALLOC( 2*SH_BUFSIZE+1 );
+  bufc = (char *) SH_ALLOC( 2*SH_BUFSIZE+1 );
 
   while (1 == 1) 
@@ -192,5 +190,5 @@
       /* get the log message
        */
-      if (sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0) 
+      if (sh_unix_getline (fd, buf, (2*SH_BUFSIZE)) < 0) 
 	break;
 
@@ -223,5 +221,5 @@
 	  start = 1;
 	  do {
-	    if ( sh_unix_getline (fd, buf, (2*SH_MSG_BUF)) < 0)
+	    if ( sh_unix_getline (fd, buf, (2*SH_BUFSIZE)) < 0)
 	      break;
 	  } while (buf[0] == '\0' || buf[0] == '\n');
@@ -294,5 +292,5 @@
 	{
 	  do {
-	    if ( sh_unix_getline (fd, bufc, (2*SH_MSG_BUF)) < 0)
+	    if ( sh_unix_getline (fd, bufc, (2*SH_BUFSIZE)) < 0)
 	      break;
 	  } while (bufc[0] == '\0' || bufc[0] == '\n');
@@ -302,7 +300,7 @@
 	      /* A continuation line. Add the newline. 
 	       */
-	      (void) sl_strlcat(buf, "\n", 2*SH_MSG_BUF+1);
+	      (void) sl_strlcat(buf, "\n", 2*SH_BUFSIZE+1);
 	      ++len;
-	      (void) sl_strlcat(buf, bufc, 2*SH_MSG_BUF+1);
+	      (void) sl_strlcat(buf, bufc, 2*SH_BUFSIZE+1);
 	      len += (int) sl_strlen(bufc);
 	    }
@@ -378,13 +376,12 @@
 	      key[0] = '\0';
 	      
-	      while (strlen(key) < KEY_LEN ) 
+	      while (sl_strlen(key) < KEY_LEN ) 
 		{ 
 		  if (key[0] != '\n' && key[0] != '\0')
-		    fprintf(stdout, "%s",_("New audit trail, enter key: "));
+		    fprintf(stdout, _("New audit trail, enter key: "));
 		  else if (key[0] == '\n')
 		    {
 		      (void) sl_strlcpy(key, 
-					sh_tiger_hash(NULL, TIGER_DATA, 0, 
-						      hashbuf, sizeof(hashbuf)), 
+					sh_tiger_hash(NULL, TIGER_DATA, 0), 
 					KEY_LEN+1);
 		      chk_mode = CHK_NON;
@@ -393,17 +390,15 @@
 		  (void) fflush(stdout); 
 		  key[0] = '\0';
-		  if (NULL != fgets(key, sizeof(key), stdin))
+		  (void) fgets(key, KEY_LEN+2, stdin);
+		  if (key[0] != '\n') 
 		    {
-		      if (key[0] != '\n') 
-			{
-			  if (key[strlen(key) - 1] == '\n')
-			    key[strlen(key) - 1] = '\0';
-			}
-		      if (key[0] == '/')
-			{
-			  chk_mode = CHK_FIL;
-			  (void) sl_strlcpy(path, key, KEY_LEN+1); 
-			  break;
-			}
+		      if (key[strlen(key) - 1] == '\n')
+			key[strlen(key) - 1] = '\0';
+		    }
+		  if (key[0] == '/')
+		    {
+		      chk_mode = CHK_FIL;
+		      (void) sl_strlcpy(path, key, KEY_LEN+1); 
+		      break;
 		    }
 		}
@@ -419,5 +414,5 @@
 		{
 		  chk_mode = CHK_KEY;
-		  fprintf(stdout, "%s",_("Key not found in file\n"));
+		  fprintf(stdout, _("Key not found in file\n"));
 		  goto findKey;
 		}
@@ -433,10 +428,9 @@
 	   */
 	  (void) sl_strlcpy (key, 
-			     sh_tiger_hash (key, TIGER_DATA, KEY_LEN,
-					    hashbuf, sizeof(hashbuf)), 
+			     sh_tiger_hash (key, TIGER_DATA, KEY_LEN), 
 			     KEY_LEN+1);
 	}
       
-      (void) sl_strlcat ( buf, key, 2*SH_MSG_BUF + 1);
+      (void) sl_strlcat ( buf, key, 2*SH_BUFSIZE + 1);
       
 #ifdef SH_STEALTH
@@ -446,6 +440,5 @@
       status = sl_strncmp (signature, 
 			   sh_tiger_hash (buf, TIGER_DATA, 
-					  (unsigned long) sl_strlen(buf),
-					  hashbuf, sizeof(hashbuf)),
+					  (unsigned long) sl_strlen(buf)),
 			   KEY_LEN);
       
@@ -541,5 +534,5 @@
   if (status == 0)
     {
-      fd = sl_open_write (FIL__, __LINE__, logfile, SL_YESPRIV);
+      fd = sl_open_write (logfile, SL_YESPRIV);
       if (SL_ISERROR(fd))
         {
@@ -560,7 +553,5 @@
         {
 	  tmp  = sh_util_safe_name (logfile);
-	  len      = sl_strlen(tmp);
-	  if (sl_ok_adds (6, len))
-	    len += 6;
+	  len      = 6 + sl_strlen(tmp);
 	  lockfile = SH_ALLOC(len);
 	  (void) sl_strlcpy(lockfile,        tmp, len);
@@ -598,6 +589,5 @@
         (*service_failure) = 1;
       }
-      if (tmp)
-	SH_FREE(tmp);
+      SH_FREE(tmp);
       SL_RETURN(-1, _("sh_log_open"));
     }
@@ -614,5 +604,5 @@
   char            sigkey_old[KEY_LEN+1];
   char            sigkey_new[KEY_LEN+1];
-  char            crypto[KEY_LEN+1];
+  char            crypt[KEY_LEN+1]; 
   struct  lfstc * next;
 } open_logfile;
@@ -623,5 +613,5 @@
 
 #ifdef SH_WITH_SERVER
-int set_flag_sep_log (const char * str)
+int set_flag_sep_log (char * str)
 {
   return sh_util_flagval(str, &flag_sep_log);
@@ -644,5 +634,5 @@
 
   SL_TICKET            fd = -1;
-  size_t               status;
+  long int             status;
   struct _sh_log_buf   log_msg;
 
@@ -652,6 +642,5 @@
   char               * sigkey_new;
   char               * sigkey_old;
-  char               * crypto;
-  char                 hashbuf[KEYBUF_SIZE];
+  char               * crypt;
 
   SL_ENTER(_("sh_log_file"));
@@ -667,5 +656,5 @@
 	  /* don't write second EOF mark
 	   */
-	  if (current->log_start != S_TRUE && sh.flag.islocked == GOOD)
+	  if (current->log_start != S_TRUE)
 	    {
 	      /* Don't use inet_peer == NULL, userwise a lock file will
@@ -743,7 +732,7 @@
       current->service_failure = 0;
       current->log_start       = S_TRUE;
-      memset(current->sigkey_old, 0, KEY_LEN+1);
-      memset(current->sigkey_new, 0, KEY_LEN+1);
-      memset(current->crypto,     0, KEY_LEN+1);
+      memset(current->sigkey_old, (int)'\0', KEY_LEN+1);
+      memset(current->sigkey_new, (int)'\0', KEY_LEN+1);
+      memset(current->crypt,      (int)'\0', KEY_LEN+1);
       current->next            = logfile_list;
       logfile_list             = current;
@@ -760,20 +749,14 @@
    */
 
-  status      =  sl_strlen (errmsg);
-  if (!sl_ok_adds(status, (2*KEY_LEN)) || !sl_ok_adds((2*KEY_LEN + status),32))
-    {
-      sl_close(fd);
-      SL_RETURN ((-1), _("sh_log_file"));
-    }
-      
+  status      = (long) sl_strlen (errmsg);
   log_msg.msg = (char *) SH_ALLOC ((size_t) (2*KEY_LEN + status + 32)); 
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-  if (skey->mlock_failed == S_FALSE) 
-    {
-      if ( (-1) == sh_unix_mlock( FIL__, __LINE__, log_msg.msg, 
+  if (skey->mlock_failed == SL_FALSE) 
+    {
+      if ( (-1) == sh_unix_mlock( log_msg.msg, 
 				  (size_t)(2*KEY_LEN + status + 32) ) ) 
 	{
-	  skey->mlock_failed = S_TRUE;
+	  skey->mlock_failed = SL_TRUE;
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
 	  sh_error_handle ((-1), FIL__, __LINE__, EPERM, MSG_MLOCK); 
@@ -782,7 +765,7 @@
     }
 #else
-  if (skey->mlock_failed == S_FALSE) 
-    {
-      skey->mlock_failed = S_TRUE;
+  if (skey->mlock_failed == SL_FALSE) 
+    {
+      skey->mlock_failed = SL_TRUE;
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
       sh_error_handle ((-1), FIL__, __LINE__, EPERM, MSG_MLOCK);
@@ -858,5 +841,5 @@
       sigkey_old = current->sigkey_old;
       sigkey_new = current->sigkey_new;
-      crypto     = current->crypto;
+      crypt      = current->crypt;
     }
   else
@@ -864,5 +847,5 @@
       sigkey_old = skey->sigkey_old;
       sigkey_new = skey->sigkey_new;
-      crypto     = skey->crypt;      /* flawfinder: ignore */
+      crypt      = skey->crypt;
     }
 
@@ -881,20 +864,19 @@
        */
       (void) sl_strlcpy(sigkey_new, 
-			sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN,
-				       hashbuf, sizeof(hashbuf)), 
+			sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN), 
 			KEY_LEN+1);
 
       /* Copy it to 'crypt' for encryption.
        */
-      (void) sl_strlcpy(crypto, sigkey_new, KEY_LEN+1);
+      (void) sl_strlcpy(crypt, sigkey_new, KEY_LEN+1);
 
       /* Use message and compiled-in key to encrypt.
        */
       BREAKEXIT(sh_util_encode);
-      sh_util_encode(crypto, log_msg.msg, 0, 'B');
+      sh_util_encode(crypt, log_msg.msg, 0, 'B');
 
       /* Send out the key.
        */
-      (void) sh_unix_time(0, log_msg.timestamp, KEY_LEN+1); 
+      (void) sl_strlcpy(log_msg.timestamp, sh_unix_time(0), KEY_LEN+1); 
 
       store1               = errFlags.loglevel;
@@ -918,6 +900,6 @@
 
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_KEY_MAIL,
-		       sh.prg_name, crypto, 
-		       crypto, log_msg.timestamp);
+		       sh.prg_name, crypt, 
+		       crypt, log_msg.timestamp);
 
       /* send to other allowed channels
@@ -931,5 +913,5 @@
 
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_KEY,
-		       sh.prg_name, crypto);
+		       sh.prg_name, crypt);
 
       /* Cleanup.
@@ -944,5 +926,5 @@
 
 
-      memset (crypto, 0, KEY_LEN);
+      memset (crypt, (int) '\0', KEY_LEN);
       sh.flag.log_start    = S_FALSE;  
       current->log_start   = S_FALSE;
@@ -952,6 +934,5 @@
       log_msg.timestamp[0] = '\0';
       (void) sl_strlcpy (sigkey_new, 
-			 sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN, 
-					hashbuf, sizeof(hashbuf)),
+			 sh_tiger_hash (sigkey_old, TIGER_DATA, KEY_LEN),
 			 KEY_LEN+1);
     }
@@ -959,35 +940,32 @@
   /* --- Sign the message with the signature key. ---
    */
-  sh_tiger_hash (log_msg.msg, TIGER_DATA,
-		 (unsigned long)(status + KEY_LEN), 
-		 (char *) hashbuf, (size_t) sizeof(hashbuf));
 
   (void) sl_strlcat (log_msg.msg, sigkey_new, (size_t)(status + KEY_LEN + 2));
+  
   (void) sl_strlcpy (log_msg.signature,
-		     sh_tiger_hash (log_msg.msg, (TigerType) TIGER_DATA,
-				    (unsigned long)(status + KEY_LEN), 
-				    hashbuf, sizeof(hashbuf)),
+		     sh_tiger_hash (log_msg.msg, TIGER_DATA, 
+				    (unsigned long)(status + KEY_LEN)), 
 		     KEY_LEN+1);
   (void) sl_strlcpy (sigkey_old, sigkey_new, KEY_LEN+1); 
 
-  /*@-usedef@*/
+  /*@-bufferoverflowhigh -usedef@*/
 #ifdef SH_USE_XML
   if (log_msg.timestamp[0] != '\0')
-    sl_snprintf(log_msg.sig, sizeof(log_msg.sig),
+    sprintf(log_msg.sig,                            /* known to fit  */
 #ifdef FIX_XML
-		_("\n<sig>%s%s</sig></log>\n"),          /* <sig> FIX XML */
-#else
-		_("\nsig>%s%s</sig></log>\n"),          /* <sig> FIX XML */
-#endif
-		log_msg.signature, log_msg.timestamp);
+	    _("\n<sig>%s%s</sig></log>\n"),          /* <sig> FIX XML */
+#else
+	    _("\nsig>%s%s</sig></log>\n"),          /* <sig> FIX XML */
+#endif
+	    log_msg.signature, log_msg.timestamp);
   else
-    sl_snprintf(log_msg.sig, sizeof(log_msg.sig),
+    sprintf(log_msg.sig,                            /* known to fit  */
 #ifdef FIX_XML
-		_("\n<sig>%s</sig></log>\n"),            /* <sig> FIX XML */
-#else
-		_("\nsig>%s</sig></log>\n"),            /* <sig> FIX XML */
-#endif
-		log_msg.signature);
-  /*@+usedef@*/
+	    _("\n<sig>%s</sig></log>\n"),            /* <sig> FIX XML */
+#else
+	    _("\nsig>%s</sig></log>\n"),            /* <sig> FIX XML */
+#endif
+	    log_msg.signature);
+  /*@+bufferoverflowhigh +usedef@*/
 
 #ifdef SH_STEALTH
@@ -1046,6 +1024,6 @@
   /* --- Clean up and free record. ---
    */
-  memset (log_msg.msg,       0, (size_t)(status + 2*KEY_LEN + 32));
-  memset (log_msg.signature, 0, KEY_LEN);
+  memset (log_msg.msg,       (int)'\0', (size_t)(status + 2*KEY_LEN + 32));
+  memset (log_msg.signature, (int)'\0', KEY_LEN);
   (void) sh_unix_munlock (log_msg.msg,  
 			  (size_t)(status + 2*KEY_LEN + 32));
@@ -1055,278 +1033,2 @@
 }
 
-/* >>>>>>>>>>>>>>>>>>>>>>>>>>>> efile <<<<<<<<<<<<<<<<<< */
-
-static char * gEfile = NULL;
-static int    gFail  = 0;
-static long   gGid   = 0;
-
-int sh_efile_group(const char * str)
-{
-  int  fail;
-  long gid = sh_group_to_gid(str, &fail);
-
-  if (fail < 0)
-    {
-      return -1;
-    }
-  gGid = gid;
-  return 0;
-}
-
-
-int sh_efile_path(const char * str) 
-{
-  if (!str || !strcmp(str, _("none")))
-    {
-      if (gEfile)
-	SH_FREE(gEfile);
-      gEfile = NULL;
-    }
-  else if (str[0] != '/')
-    {
-      return -1;
-    }
-  else
-    {
-      if (gEfile)
-	SH_FREE(gEfile);
-      gEfile = sh_util_strdup(str);
-    }
-  gFail = 0;
-  return 0;
-}
-
-/* write lock for filename
- */
-static int sh_efile_lock (char * filename, int flag)
-{
-  extern int get_the_fd (SL_TICKET ticket);
-  size_t len;
-  int    res = -1;
-  char myPid[64];
-  SL_TICKET  fd;
-  char * lockfile;
-  int    status;
-
-  sprintf (myPid, "%ld\n", (long) sh.pid);             /* known to fit  */
-
-  if (filename == NULL)
-    return res;
-
-  len = sl_strlen(filename);
-  if (sl_ok_adds(len, 6))
-    len += 6;
-  lockfile = SH_ALLOC(len);
-  sl_strlcpy(lockfile, filename,   len);
-  sl_strlcat(lockfile, _(".lock"), len);
-
-  if (  0 !=  (status = tf_trust_check (lockfile, SL_YESPRIV))
-	&& gFail == 0)
-    {
-      char * tmp  = sh_util_safe_name (lockfile);
-      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_TRUST,
-			   (long) sh.effective.uid, tmp);
-      ++gFail;
-      SH_FREE(tmp);
-    }
-
-  if (status == 0)
-    {
-      if (flag == 0)
-	{
-	  /* --- Delete the lock file. --- 
-	   */
-	  res = retry_aud_unlink (FIL__, __LINE__, lockfile);
-	}
-      else
-	{
-	  unsigned int count = 0;
-
-	  /* fails if file exists 
-	   */
-	  do {
-	    fd = sl_open_safe_rdwr (FIL__, __LINE__, 
-				    lockfile, SL_YESPRIV);
-	    if (SL_ISERROR(fd))
-	      {
-		retry_msleep(0, 100);
-		++count;
-	      }
-
-	  } while (SL_ISERROR(fd) && count < 3);
-      
-	  if (!SL_ISERROR(fd))
-	    {
-	      int filed;
-
-	      res = sl_write (fd, myPid, sl_strlen(myPid));
-	      filed = get_the_fd(fd);
-	      fchmod (filed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
-	      sl_close (fd);
-	    }
-	  else
-	    {
-	      static int nFail = 0;
-
-	      if (nFail == 0)
-		{
-		  char errmsg[1024];
-		  char * tmp  = sh_util_safe_name (lockfile);
-		  
-		  sl_snprintf(errmsg, sizeof(errmsg), 
-			      _("Error creating lockfile %s"),
-			      tmp);
-		  
-		  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-				   0, MSG_E_SUBGEN,
-				   errmsg, _("sh_efile_lock"));
-		  ++nFail;
-		  SH_FREE(tmp);
-		}
-	    }
-	}
-    }
-
-  SH_FREE(lockfile);
-  return res;
-}
-
-static size_t gSave[6] = { 0 };
-
-static void sh_efile_clear()
-{
-  int i;
-
-  for (i = 0; i < 6; ++i)
-    gSave[i] = 0;
-  return;
-}
-
-static void sh_efile_load(size_t * tmp)
-{
-  int i;
-
-  if (S_TRUE == sl_ok_adds (gSave[0], sh.statistics.bytes_hashed))
-    gSave[0] += sh.statistics.bytes_hashed;
-  if (S_TRUE == sl_ok_adds (gSave[1], sh.statistics.dirs_checked))
-    gSave[1] += sh.statistics.dirs_checked;
-  if (S_TRUE == sl_ok_adds (gSave[2], sh.statistics.files_checked))
-    gSave[2] += sh.statistics.files_checked;
-  if (S_TRUE == sl_ok_adds (gSave[3], sh.statistics.files_report))
-    gSave[3] += sh.statistics.files_report;
-  if (S_TRUE == sl_ok_adds (gSave[4], sh.statistics.files_error))
-    gSave[4] += sh.statistics.files_error;
-  if (S_TRUE == sl_ok_adds (gSave[5], sh.statistics.files_nodir))
-    gSave[5] += sh.statistics.files_nodir;
-
-  for (i = 0; i < 6; ++i)
-    tmp[i] = gSave[i];
-  return;
-}
-
-void sh_efile_report()
-{
-  extern int get_the_fd (SL_TICKET ticket);
-  SL_TICKET     fd;
-  char         *efile;
-  int           status = -1;
-
-  if (gEfile)
-    {
-      size_t tmp[6];
-
-      sh_efile_load(tmp);
-
-      efile = sh_util_strdup(gEfile);
-      
-      if (sh_efile_lock (efile, 1) < 0)
-	goto end;
-
-      if (  0 !=  (status = tf_trust_check (efile, SL_YESPRIV))
-	    && gFail == 0)
-	{
-	  char * tmp  = sh_util_safe_name (efile);
-	  sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_TRUST,
-			   (long) sh.effective.uid, tmp);
-	  ++gFail;
-	  SH_FREE(tmp);
-	}
-      
-      if (status == 0)
-	{
-	  fd = sl_open_write (FIL__, __LINE__, efile, SL_YESPRIV);
-
-	  if (!SL_ISERROR(fd))
-	    {
-	      char report[511];
-	      char tstamp[TIM_MAX];
-
-	      time_t now = time(NULL);
-	      int  filed = get_the_fd(fd);
-
-	      (void) sh_unix_time (now, tstamp, sizeof(tstamp));
-#ifdef HAVE_LONG_LONG
-	      sl_snprintf(report, sizeof(report), 
-			  _("%s %lld %ld %ld %ld %ld %ld %ld\n"),
-			  tstamp,
-			  (long long) now,
-			  (long) tmp[0], (long) tmp[1], (long) tmp[2], 
-			  (long) tmp[3], (long) tmp[4], (long) tmp[5]);
-#else
-	      sl_snprintf(report, sizeof(report), 
-			  _("%s %ld %ld %ld %ld %ld %ld %ld\n"),
-			  tstamp,
-			  (long) now,
-			  (long) tmp[0], (long) tmp[1], (long) tmp[2], 
-			  (long) tmp[3], (long) tmp[4], (long) tmp[5]);
-#endif
-			  
-	      status = sl_forward(fd);
-	      if (!SL_ISERROR(status))
-		sl_write (fd, report,  strlen(report));
-	      (void) sl_sync(fd);
-
-	      /* make group writeable, such that nagios can truncate */
-	      fchmod (filed, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
-	      status = fchown (filed, -1, gGid);
-	      if (status < 0)
-		{
-		  int  errnum = errno;
-		  static int nFail = 0;
-		  if (nFail == 0)
-		    {
-		      char errmsg[1024];
-		      char buf[256];
-		      char * tmp  = sh_util_safe_name (efile);
-
-		      sl_snprintf(errmsg, sizeof(errmsg), 
-				  _("Error changing group of %s to %ld: %s"),
-				  tmp, gGid, 
-				  sh_error_message (errnum, buf, sizeof(buf)));
-		      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
-				       errnum, MSG_E_SUBGEN,
-				       errmsg, _("sh_efile_report"));
-		      ++nFail;
-		      SH_FREE(tmp);
-		    }
-		}
-
-	      (void) sl_close(fd);
-	    }
-	  else
-	    {
-	      status = -1;
-	    }
-	}
-  
-      (void) sh_efile_lock (efile, 0);
-    end:
-      SH_FREE(efile);
-
-      if (!SL_ISERROR(status))
-	{
-	  sh_efile_clear();
-	}
-    }
-  return;
-}
Index: trunk/src/sh_err_syslog.c
===================================================================
--- trunk/src/sh_err_syslog.c	(revision 591)
+++ trunk/src/sh_err_syslog.c	(revision 1)
@@ -31,5 +31,5 @@
 
 typedef struct log_fac_struct {
-  const char * name;
+  char * name;
   int    facility;
 } logfct;
@@ -110,5 +110,5 @@
 /* set syslog facility 
  */
-int  sh_log_set_facility (const char * c)
+int  sh_log_set_facility (char * c)
 {
   int loop = 0; 
@@ -131,26 +131,5 @@
 }
   
-static int sh_stamp_priority = LOG_ERR;
-
-/* set priority for heartbeat messages
- */
-int  sh_log_set_stamp_priority (const char * c)
-{
-  int retval = 0;
-
-  if      (0 == strcmp(c, _("LOG_DEBUG")))   { sh_stamp_priority = LOG_DEBUG; }
-  else if (0 == strcmp(c, _("LOG_INFO")))    { sh_stamp_priority = LOG_INFO;  }
-  else if (0 == strcmp(c, _("LOG_NOTICE")))  { sh_stamp_priority = LOG_NOTICE;}
-  else if (0 == strcmp(c, _("LOG_WARNING"))) { sh_stamp_priority = LOG_WARNING;}
-  else if (0 == strcmp(c, _("LOG_ERR")))     { sh_stamp_priority = LOG_ERR;   }
-  else if (0 == strcmp(c, _("LOG_CRIT")))    { sh_stamp_priority = LOG_CRIT;  }
-  else if (0 == strcmp(c, _("LOG_ALERT")))   { sh_stamp_priority = LOG_ALERT; }
-#ifdef LOG_EMERG
-  else if (0 == strcmp(c, _("LOG_EMERG")))   { sh_stamp_priority = LOG_EMERG; }
-#endif
-  else { retval = -1; }
-
-  return retval;
-}  
+  
 
 /* syslog error message
@@ -175,5 +154,5 @@
   else if (severity == SH_ERR_NOTICE) priority = LOG_NOTICE;
   else if (severity == SH_ERR_WARN)   priority = LOG_WARNING;
-  else if (severity == SH_ERR_STAMP)  priority = sh_stamp_priority;
+  else if (severity == SH_ERR_STAMP)  priority = LOG_ERR;
   else if (severity == SH_ERR_ERR)    priority = LOG_ERR;
   else if (severity == SH_ERR_SEVERE) priority = LOG_CRIT;
Index: trunk/src/sh_error.c
===================================================================
--- trunk/src/sh_error.c	(revision 591)
+++ trunk/src/sh_error.c	(revision 1)
@@ -20,17 +20,8 @@
 #include "config_xor.h"
 
-/* Required on Linux to get the correct strerror_r function. Also
- * for recursive mutexes (_XOPEN_SOURCE >= 500). Gives funny error
- * on Solaris 10/gcc ('c99' compiler required - huh? Isn't gcc 
- * good enough?).
- */
-#if !defined(__sun__) && !defined(__sun)
-#define _XOPEN_SOURCE 600
-#undef  _GNU_SOURCE
-#endif
-#include <string.h>
 #include <stdio.h>     
 #include <stdlib.h>     
 #include <stdarg.h>
+#include <string.h>
 #include <ctype.h>
 #include <limits.h>
@@ -59,8 +50,7 @@
 #include "sh_unix.h"
 #include "sh_tiger.h"
-#include "sh_nmail.h"
-#include "sh_xfer.h"
+#include "sh_mail.h"
+#include "sh_forward.h"
 #include "sh_prelude.h"
-#include "sh_pthread.h"
 
 #if defined(WITH_DATABASE)
@@ -77,6 +67,6 @@
 extern int clt_class;
 
-int flag_err_debug = S_FALSE;
-int flag_err_info  = S_FALSE;
+int flag_err_debug = SL_FALSE;
+int flag_err_info  = SL_FALSE;
 
 int  ShDFLevel[SH_ERR_T_END];
@@ -100,11 +90,11 @@
 static int  sh_error_init (void);
 
-inline
-static const char * get_format(unsigned long msg_id, int * priority, 
-			       unsigned int * class);
+/*@owned@*//*@null@*/inline
+static char * get_format(unsigned long msg_id, /*@out@*/int * priority, 
+			 /*@out@*/unsigned int * class);
 
 static int sh_error_string (struct _log_t * lmsg, va_list vl);
 
-extern int  sh_log_console (/*@null@*/const char *message);
+extern int  sh_log_console (/*@null@*/char *message);
 extern int  sh_log_syslog  (int  severity, /*@null@*/char *message);
 extern int  sh_log_file    (/*@null@*/char *message, 
@@ -112,5 +102,5 @@
 /* convert a string to a numeric priority
  */ 
-int sh_error_convert_level (const char * str_s);
+int sh_error_convert_level (char * str_s);
 
 static int  IsInitialized = BAD;
@@ -120,7 +110,4 @@
 int  OnlyStderr    = S_TRUE; 
 
-/* --- Enable facilities not safe for closeall(). --- 
- */
-int  enableUnsafe  = S_FALSE;
 
 /*********************************************
@@ -128,12 +115,11 @@
  *********************************************/
 
-int sh_error_verify (const char * s)
+int sh_error_verify (char * s)
 {
   char * foo;
-  char hashbuf[KEYBUF_SIZE];
 
   if (s[0] == '/')
     {
-      foo = sh_tiger_hash_gpg (s, TIGER_FILE, TIGER_NOLIM);
+      foo = sh_tiger_hash_gpg (s, TIGER_FILE, 0);
       fprintf (stdout, _("%s\n"),  foo);
       SH_FREE(foo);
@@ -143,7 +129,5 @@
       fprintf (stdout, _("string=<%s>, hash=<%s>\n"), 
 	       s, sh_tiger_hash (s, TIGER_DATA, 
-				 (unsigned long) sl_strlen(s), 
-				 hashbuf, sizeof(hashbuf))
-	       );
+				 (unsigned long) sl_strlen(s)));
     }
   (void) fflush(stdout);
@@ -164,62 +148,56 @@
 }
 
-void sh_error_enable_unsafe (int flag)
-{
-  enableUnsafe    = flag;
-  return;
-}
-
 static int dbg_store = 0;
 static int dbg_flag  = 0;
 
 static
-void compute_flag_err_debug(void)
+void compute_flag_err_debug()
 {
   if ((errFlags.loglevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.printlevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.maillevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.exportlevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.sysloglevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.externallevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.databaselevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else if ((errFlags.preludelevel & SH_ERR_ALL) != 0)
-    flag_err_debug = S_TRUE;
+    flag_err_debug = SL_TRUE;
   else
-    flag_err_debug = S_FALSE;
+    flag_err_debug = SL_FALSE;
   return;
 }
 
 static
-void compute_flag_err_info(void)
+void compute_flag_err_info()
 {
   if ((errFlags.loglevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.printlevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.maillevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.exportlevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.sysloglevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.externallevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.databaselevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else if ((errFlags.preludelevel & SH_ERR_INFO) != 0)
-    flag_err_info = S_TRUE;
+    flag_err_info = SL_TRUE;
   else
-    flag_err_info = S_FALSE;
+    flag_err_info = SL_FALSE;
   return;
 }
 
-void sh_error_dbg_switch(void)
+void sh_error_dbg_switch()
 {
   if (dbg_flag == 0)
@@ -230,5 +208,5 @@
 			     SH_ERR_SEVERE | SH_ERR_FATAL);
       dbg_flag  = 1;
-      flag_err_debug = S_TRUE;
+      flag_err_debug = SL_TRUE;
     }
   else {
@@ -241,16 +219,14 @@
 }
 
-static int sh_error_set_classmask (const char * str, int * facility_mask)
+static int sh_error_set_classmask (/*@notnull@*/char * c, int * facility_mask)
 {
   char * p;
-  char * q;
   int    num = 0;
   unsigned int    i;
   size_t len;
-  char * c;
 
   SL_ENTER(_("sh_error_set_classmask"));
   
-  if (str == NULL)
+  if (c == NULL)
     SL_RETURN( -1, _("sh_error_set_classmask"));
 
@@ -258,11 +234,7 @@
     (void) sh_error_init();
 
-  if (str[0] == (char) 34)
-    ++str;
-  len = strlen(str);
-
-  c = SH_ALLOC(len+1);
-  sl_strlcpy(c, str, len+1);
-
+  if (c[0] == (char) 34)
+    ++c;
+  len = strlen(c);
   if (c[len-1] == (char) 34)
     c[len-1] = '\0';
@@ -271,25 +243,14 @@
 
   do {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-    char * saveptr;
-    if (num == 0) {
-      p = strtok_r (c, " ,\t", &saveptr);
-      ++num;
-    } else {
-      p = strtok_r (NULL, " ,\t", &saveptr);
-    }
-#else
-    if (num == 0) {
-      p = strtok (c, " ,\t");
-      ++num;
-    } else {
+    if (num == 0)
+      {
+	p = strtok (c, " ,\t");
+	++num;
+      }
+    else
       p = strtok (NULL, " ,\t");
-    }
-#endif
 
     if (p == NULL)
       break;
-
-    q = p; while (*q != '\0') { *q = toupper( (int) *q); ++q; }
 
     for (i = 0; i < SH_CLA_MAX; ++i)
@@ -312,37 +273,36 @@
   } while (p);
 
-  SH_FREE(c);
   SL_RETURN( 0, _("sh_error_set_classmask"));
 }
 
-int sh_error_log_mask (const char * c)
+int sh_error_log_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.log_class)));
 }
-int sh_error_mail_mask (const char * c)
+int sh_error_mail_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.mail_class)));
 }
-int sh_error_print_mask (const char * c)
+int sh_error_print_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.print_class)));
 }
-int sh_error_export_mask (const char * c)
+int sh_error_export_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.export_class)));
 }
-int sh_error_syslog_mask (const char * c)
+int sh_error_syslog_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.syslog_class)));
 }
-int sh_error_external_mask (const char * c)
+int sh_error_external_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.external_class)));
 }
-int sh_error_database_mask (const char * c)
+int sh_error_database_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.database_class)));
 }
-int sh_error_prelude_mask (const char * c)
+int sh_error_prelude_mask (char * c)
 {
   return (sh_error_set_classmask(c, &(errFlags.prelude_class)));
@@ -351,100 +311,92 @@
 
 
-char * sh_error_message (int tellme, char * str, size_t len)
-{
-
-#if defined(HAVE_STRERROR_R)
-  if (len > 0) str[0] = '\0';
-  strerror_r(tellme, str, len);
-  return str;
-#elif defined(HAVE_STRERROR)
-  sl_strlcpy(str, strerror(tellme), len);
-  return str;
+/*@owned@*/char * sh_error_message (int tellme)
+{
+
+#if defined(HAVE_STRERROR)
+  /*@i@*/return strerror(tellme);
 #else
 
-  char *p = NULL;
 #ifdef EACCES
-    if (tellme == EACCES)  p = _("Permission denied.");
+    if (tellme == EACCES)  return _("Permission denied.");
 #endif
 #ifdef EAGAIN
-    if (tellme == EAGAIN)  p = _("Try again.");
+    if (tellme == EAGAIN)  return _("Try again.");
 #endif
 #ifdef EBADF
-    if (tellme == EBADF)   p = _("File descriptor in bad state.");
+    if (tellme == EBADF)   return _("File descriptor in bad state.");
 #endif
 #ifdef EEXIST
-    if (tellme == EEXIST)  p = _("File exists.");
+    if (tellme == EEXIST)  return _("File exists.");
 #endif
 #ifdef EFAULT
-    if (tellme == EFAULT)  p = _("Bad address.");
+    if (tellme == EFAULT)  return _("Bad address.");
 #endif
 #ifdef EINVAL
-    if (tellme == EINVAL)  p = _("Invalid argument.");
+    if (tellme == EINVAL)  return _("Invalid argument.");
 #endif
 #ifdef EISDIR
-    if (tellme == EISDIR)  p = _("Is a directory.");
+    if (tellme == EISDIR)  return _("Is a directory.");
 #endif
 #ifdef EINTR
-    if (tellme == EINTR)   p = _("System call was interrupted.");
+    if (tellme == EINTR)   return _("System call was interrupted.");
 #endif
 #ifdef EIO
-    if (tellme == EIO)     p = _("Low-level I/O error.");
+    if (tellme == EIO)     return _("Low-level I/O error.");
 #endif
 #ifdef ELOOP
-    if (tellme == ELOOP)   p = _("Too many symbolic links encountered.");
+    if (tellme == ELOOP)   return _("Too many symbolic links encountered.");
 #endif
 #ifdef EMFILE
-    if (tellme == EMFILE)  p = _("Too many open files.");
+    if (tellme == EMFILE)  return _("Too many open files.");
 #endif
 #ifdef EMLINK
-    if (tellme == EMLINK)  p = _("Too many links.");
+    if (tellme == EMLINK)  return _("Too many links.");
 #endif
 #ifdef ENAMETOOLONG
     if (tellme == ENAMETOOLONG) 
-                           p = _("File name too long."); 
+                           return _("File name too long."); 
 #endif
 #ifdef ENFILE
-    if (tellme == ENFILE)  p = _("File table overflow.");
+    if (tellme == ENFILE)  return _("File table overflow.");
 #endif
 #ifdef ENOENT
-    if (tellme == ENOENT)  p = _("File does not exist.");
+    if (tellme == ENOENT)  return _("File does not exist.");
 #endif
 #ifdef ENOMEM
-    if (tellme == ENOMEM)  p = _("Out of memory.");
+    if (tellme == ENOMEM)  return _("Out of memory.");
 #endif
 #ifdef ENOSPC
-    if (tellme == ENOSPC)  p = _("No space on device.");
+    if (tellme == ENOSPC)  return _("No space on device.");
 #endif
 #ifdef ENOTDIR
-    if (tellme == ENOTDIR) p = _("Not a directory.");
+    if (tellme == ENOTDIR) return _("Not a directory.");
 #endif
 #ifdef ENOTSOCK
-    if (tellme == ENOTSOCK) p = _("Not a socket.");
+    if (tellme == ENOTSOCK) return _("Not a socket.");
 #endif
 #ifdef EOPNOTSUPP
-    if (tellme == EOPNOTSUPP) p = _("Socket is not of type SOCK_STREAM.");
+    if (tellme == EOPNOTSUPP) return _("Socket is not of type SOCK_STREAM.");
 #endif
 #ifdef EPERM
-    if (tellme == EPERM)   p = _("Permission denied.");
+    if (tellme == EPERM)   return _("Permission denied.");
 #endif
 #ifdef EPIPE
-    if (tellme == EPIPE)   p = _("No read on pipe.");
+    if (tellme == EPIPE)   return _("No read on pipe.");
 #endif
 #ifdef EROFS
-    if (tellme == EROFS)    p = _("Read-only file system.");
+    if (tellme == EROFS)    return _("Read-only file system.");
 #endif
 #ifdef ETXTBSY
-    if (tellme == ETXTBSY) p = _("Text file busy.");
+    if (tellme == ETXTBSY) return _("Text file busy.");
 #endif
 #ifdef EWOULDBLOCK
     if (tellme == EWOULDBLOCK) 
-      p = _("No connections on non-blocking socket.");
+      return _("No connections on non-blocking socket.");
 #endif
 #ifdef EXDEV
-    if (tellme == EXDEV)    p = _("Not on same file system.");
-#endif
-    if (!p) p = _("Unknown error");
-    sl_strlcpy(str, p, len);
-    return str;
+    if (tellme == EXDEV)    return _("Not on same file system.");
+#endif
+    return _("Unknown error");
 #endif /* ifndef HAVE_STRERROR */
 }
@@ -471,5 +423,5 @@
 typedef struct eef 
 {
-  const char * str;
+  char * str;
   int    val;
 } eef_struc;
@@ -494,10 +446,8 @@
 };
 
-int sh_error_convert_level (const char * str_s)
+int sh_error_convert_level (char * str_s)
 {
   int i;
   int level = (-1);
-  char * tmp;
-  char * q;
   
   SL_ENTER(_("sh_error_convert_level"));
@@ -506,10 +456,7 @@
      SL_RETURN( -1, _("sh_error_convert_level"));
 
-  q = sh_util_strdup(str_s);
-  tmp = q; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; }
-  
   for (i = 0; i < SH_EEF_MAX; ++i)
     {
-      if (0 == sl_strncmp(q, _(eef_tab[i].str), 
+      if (0 == sl_strncmp(str_s, _(eef_tab[i].str), 
                           sl_strlen(eef_tab[i].str))) 
 	{
@@ -519,5 +466,4 @@
     }
 
-  SH_FREE(q);
   SL_RETURN( level, _("sh_error_convert_level"));
 }
@@ -526,5 +472,5 @@
 /* --- Set severity levels. ---
  */
-int sh_error_set_iv (int iv, const char *  str_s)
+int sh_error_set_iv (int iv, char *  str_s)
 {
   int level = (-1);
@@ -558,20 +504,13 @@
 }
 
-int sh_error_set_level(const char * str_in, int * facility)
+int sh_error_set_level(char * str_in, int * facility)
 {
   register int  i, j, f = BAD;
 
   int  old_facility;
-  char * str_s;
-  char * str_orig;
-  char * tmp;
+  char * str_s = str_in;
 
   SL_ENTER(_("sh_error_set_level"));
 
-  str_s = sh_util_strdup(str_in);
-  str_orig = str_s;
-  
-  tmp = str_s; while (*tmp != '\0') { *tmp = tolower( (int) *tmp); ++tmp; }
-  
   if (IsInitialized == BAD) 
     (void) sh_error_init();
@@ -664,9 +603,4 @@
     }
 
-  if (!str_s)
-    {
-      if (str_orig) SH_FREE(str_orig);
-      SL_RETURN ((-1), _("sh_error_set_level"));
-    }
   /* skip to end of string
    */
@@ -692,17 +626,15 @@
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 
 		       _("priority"), str_in);
-      SH_FREE(str_orig);
       SL_RETURN (-1, _("sh_error_set_level"));
     }
   compute_flag_err_debug();
   compute_flag_err_info();
-  SH_FREE(str_orig);
   SL_RETURN (0, _("sh_error_set_level"));
 }
 
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#ifdef SH_WITH_CLIENT
 /* set severity for TCP export
  */
-int sh_error_setexport(const char *  str_s)
+int sh_error_setexport(char *  str_s)
 {
   static int reject = 0;
@@ -721,5 +653,5 @@
 extern void dlog_set_active(int flag);
 
-int sh_error_setprint(const char *  str_s)
+int sh_error_setprint(char *  str_s)
 {
   static int reject = 0;
@@ -744,5 +676,5 @@
 /* set level for error logging
  */
-int sh_error_setlog(const char * str_s)
+int sh_error_setlog(char * str_s)
 {
   static int reject = 0;
@@ -759,5 +691,5 @@
 /* set severity for syslog
  */
-int sh_error_set_syslog (const char * str_s)
+int sh_error_set_syslog (char * str_s)
 {
   static int reject = 0;
@@ -774,5 +706,5 @@
 /* set severity for external
  */
-int sh_error_set_external (const char * str_s)
+int sh_error_set_external (char * str_s)
 {
   static int reject = 0;
@@ -790,5 +722,5 @@
 /* set severity for database
  */
-int sh_error_set_database (const char * str_s)
+int sh_error_set_database (char * str_s)
 {
   static int reject = 0;
@@ -806,5 +738,5 @@
 /* set severity for prelude
  */
-int sh_error_set_prelude (const char * str_s)
+int sh_error_set_prelude (char * str_s)
 {
   static int reject = 0;
@@ -822,7 +754,7 @@
 /* init or re-init log facilities that need it
  */
-void sh_error_fixup(void)
-{
-#if defined(HAVE_LIBPRELUDE)
+void sh_error_fixup()
+{
+#if defined(HAVE_LIBPRELUDE_9)
   if ((errFlags.preludelevel & SH_ERR_NOT)   == 0)
     sh_prelude_init();
@@ -838,7 +770,7 @@
 /* to be called from sh_prelude_reset
  */
-void sh_error_init_prelude(void)
-{
-#if defined(HAVE_LIBPRELUDE)
+void sh_error_init_prelude()
+{
+#if defined(HAVE_LIBPRELUDE_9)
   if ((errFlags.preludelevel & SH_ERR_NOT)   == 0)
     sh_prelude_init();
@@ -852,5 +784,5 @@
 /* set severity for mailing
  */
-int sh_error_setseverity (const char * str_s)
+int sh_error_setseverity (char * str_s)
 {
   static int reject = 0;
@@ -866,70 +798,14 @@
 #ifdef SH_WITH_SERVER
 static char inet_peer[SH_MINIBUF] = { '\0' };
-#ifdef HAVE_LIBPRELUDE
-static char inet_peer_ip[SH_IP_BUF] = { '\0' };
-
-void sh_error_set_peer_ip(const char * str)
+
+void sh_error_set_peer(const char * str)
 {
   if (str == NULL)
-    inet_peer_ip[0] = '\0';
+    memset(inet_peer, '\0', SH_MINIBUF);
   else
-    sl_strlcpy(inet_peer_ip, str, sizeof(inet_peer_ip));
-}
-#endif
-
-void sh_error_set_peer(const char * str)
-{
-  if (str == NULL)
-    inet_peer[0] = '\0';
-  else
-    sl_strlcpy(inet_peer, str, sizeof(inet_peer));
-}
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-#include "sh_checksum.h"
-static char * sh_error_replace(const char * msg)
-{
-  char * ret   = NULL;
-
-  if (sh_tiger_get_hashtype () == SH_SHA256)
-    {
-      char * store = NULL;
-
-#ifdef SH_USE_XML
-      char c_end  = '"';
-      char * str  = _("chksum_old=\"");
-      char * str2 = _("chksum_new=\"");
-#else
-      char c_end  = '>';
-      char * str  = _("chksum_old=<");
-      char * str2 = _("chksum_new=<");
-#endif
-
-      ret = SHA256_ReplaceBaseByHex(msg, str, c_end);
-
-      if (ret) {
-	store = ret;
-	ret   = SHA256_ReplaceBaseByHex(ret, str2, c_end);
-	if (ret)
-	  SH_FREE(store);
-	else
-	  ret = store;
-      } else {
-	ret   = SHA256_ReplaceBaseByHex(msg, str2, c_end);
-      }
-    }
-  return ret;
-}
-static void sh_replace_free(char * msg)
-{
-  if (msg)
-    SH_FREE(msg);
-  return;
-}
-#else
-static char * sh_error_replace(const char * msg) { (void) msg; return NULL; }
-static void sh_replace_free(char * msg) { (void) msg; return; }
-#endif
+    sl_strlcpy(inet_peer, str, SH_MINIBUF);
+}
+#endif
+  
 
 /**********************************************************
@@ -944,7 +820,5 @@
  **********************************************************/
 
-SH_MUTEX_RECURSIVE(mutex_err_handle);
-
-void sh_error_handle (int sev1, const char * file, long line, 
+void sh_error_handle (int sev, char * file, long line, 
 		      long status, unsigned long msg_id, ...)
 {
@@ -954,18 +828,14 @@
   int    severity;
   unsigned int class;
-  const char * fmt;
-  volatile int sev = sev1;            /* Avoids the 'clobbered by longjmp' warning. */
-
-  int    flag_inet;
+  char * fmt;
+
+  int    flag_inet  = S_FALSE;
+  int    class_inet = clt_class;      /* initialize from global */
 
 #ifdef SH_WITH_SERVER
-  int    class_inet = clt_class;      /* initialize from global */
   char   local_inet_peer[SH_MINIBUF];
-#ifdef HAVE_LIBPRELUDE
-  char   local_inet_peer_ip[SH_IP_BUF];
-#endif    
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#endif
+
+#ifdef SH_WITH_CLIENT
   char   * ex_msg;
 #endif
@@ -973,6 +843,4 @@
   char   * escape_msg;
 #endif
-
-  char   * hexmsg = NULL;
 
   static int    own_block = 0;
@@ -988,5 +856,5 @@
   static int syslog_block = 0;
   static int log_block    = 0;
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined(SH_WITH_CLIENT)
   static int export_block = 0;
 #endif
@@ -1003,7 +871,4 @@
   SL_ENTER(_("sh_error_handle"));
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_err_handle);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_err_handle);
-
 #ifdef SH_WITH_SERVER
   /* copy the global string into a local array
@@ -1011,45 +876,34 @@
   if ((msg_id == MSG_TCP_MSG) && (inet_peer[0] != '\0'))
     {
-      sl_strlcpy(local_inet_peer, inet_peer, sizeof(local_inet_peer));
+      sl_strlcpy(local_inet_peer, inet_peer, SH_MINIBUF);
       sh_error_set_peer(NULL);
     }
   else
     local_inet_peer[0] = '\0';
-
-#ifdef HAVE_LIBPRELUDE
-  if ((msg_id == MSG_TCP_MSG) && (inet_peer_ip[0] != '\0'))
-    {
-      sl_strlcpy(local_inet_peer_ip, inet_peer_ip, sizeof(local_inet_peer_ip));
-      sh_error_set_peer_ip(NULL);
-    }
-  else
-    local_inet_peer_ip[0] = '\0';
 #endif
 
   clt_class = (-1);      /* reset global */
-#endif
-
 
   if (own_block == 1)
     {
-      goto exit_here;
+      SL_RET0(_("sh_error_handle"));
     }
 
   /* --- Initialize to default values. ---
    */
+  own_block = 1;
   if (IsInitialized == BAD) 
     (void) sh_error_init();
-
-  /* Returns pointer to (constant|thread-specific) static memory
-   */
+  own_block = 0;
+
+  /* --- Consistency checks. ---
+   */
+  own_block = 1;
   fmt = /*@i@*/get_format (msg_id, &severity, &class);
-
-#ifdef SH_WITH_SERVER
+  own_block = 0;
+
   if (class_inet != (-1))
     class = (unsigned int) class_inet;
-#endif
-
-  /* --- Consistency check. ---
-   */
+
   ASSERT((fmt != NULL), _("fmt != NULL"))
   if (fmt == NULL)
@@ -1058,5 +912,5 @@
 	      _("ERROR: msg=<NULL format>, file=<%s>, line=<%ld>\n"), 
 	      file, line);
-      goto exit_here;
+      SL_RET0(_("sh_error_handle"));
     }
 
@@ -1066,23 +920,7 @@
     severity = sev;
 
-  /* --- Some statistics. ---
-   */
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-  if ( ((1 << class) & ERROR_CLA) && 
-       (severity & (SH_ERR_ERR|SH_ERR_SEVERE|SH_ERR_FATAL)))
-    {
-      ++sh.statistics.files_error;
-    }
-#endif
-
-  /* these are messages from remote sources
-   */
   if ((severity  & SH_ERR_INET) != 0)
     {
       flag_inet = S_TRUE;
-    }
-  else
-    {
-      flag_inet  = S_FALSE;
     }
 
@@ -1095,5 +933,5 @@
        ( (errFlags.sysloglevel  & severity    ) == 0 || 
 	 (errFlags.syslog_class & (1 << class)) == 0 )     &&
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_CLIENT)
+#ifdef SH_WITH_CLIENT
        ( (errFlags.exportlevel  & severity    ) == 0 ||
 	 (errFlags.export_class & (1 << class)) == 0 )     &&
@@ -1114,23 +952,16 @@
 	 (errFlags.mail_class    & (1 << class)) == 0 )
 #ifdef SH_WITH_SERVER
-       && (flag_inet == S_FALSE) /* still log messages from remote sources */
+      && (flag_inet == S_FALSE)
 #endif
        )
     {
-      goto exit_here;
+      SL_RET0(_("sh_error_handle"));
     }
 
   if ((severity & SH_ERR_NOT) != 0)
     {
-      goto exit_here;
-    }
-  
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-  if ((sh_global_check_silent > SH_SILENT_STD) &&
-      (((1 << FIL) & (1 << class)) != 0))
-    {
-      goto exit_here;
-    }
-#endif
+      SL_RET0(_("sh_error_handle"));
+    }
+
 
   /* Allocate space for the message.
@@ -1147,8 +978,11 @@
   lmsg->line     = line;
   lmsg->status   = status;
+  own_block = 0;
+
 
   /* Format the log message with timestamp etc.
    * Allocate lmsg->msg
    */
+  own_block = 1;
   va_start (vl, msg_id);
   (void) sh_error_string (lmsg, vl);
@@ -1156,5 +990,4 @@
   own_block = 0;
 
-  hexmsg = sh_error_replace(lmsg->msg);
 
   /* Log to stderr.
@@ -1177,5 +1010,5 @@
 	   *  Reports first error after failure. Always tries.
 	   */
-	  (void) sh_log_console (hexmsg ? hexmsg : lmsg->msg);
+	  (void) sh_log_console (lmsg->msg);
 	  print_block = 0;
 	}
@@ -1185,5 +1018,5 @@
   /* Full logging enabled.
    */
-  if (OnlyStderr == S_FALSE)  /* full error logging enabled */
+  if (OnlyStderr == BAD)  /* full error logging enabled */
     {
 
@@ -1205,5 +1038,5 @@
 	       * Ignores errors. Always tries.
 	       */
-	      (void) sh_log_syslog (lmsg->severity, hexmsg ? hexmsg : lmsg->msg);
+	      (void) sh_log_syslog (lmsg->severity, lmsg->msg);
 	      syslog_block = 0;
 	    }
@@ -1227,5 +1060,5 @@
 	       *  Reports first error after failure. Always tries.
 	       */
-	      (void) sh_ext_execute ('l', 'o', 'g', hexmsg ? hexmsg : lmsg->msg, 0);
+	      (void) sh_ext_execute ('l', 'o', 'g', lmsg->msg, 0);
 	      external_block = 0;
 	    }
@@ -1242,5 +1075,5 @@
 	  class != AUD)
 	{
-	  if (database_block == 0 && enableUnsafe == S_TRUE)
+	  if (database_block == 0)
 	    {
 	      /* truncates; query_max is 16k
@@ -1280,37 +1113,27 @@
        * to log server
        ****************************************************/
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#ifdef SH_WITH_CLIENT
       /* Export by TCP.
        */
-
-      if ( ((errFlags.exportlevel  & severity  )   != 0 &&
-	    (errFlags.export_class & (1 << class)) != 0 &&
-	    (errFlags.exportlevel  & SH_ERR_NOT)   == 0 &&
-	    class != AUD                               )
-#ifdef SH_WITH_SERVER
-	   /* always log inet to export */
-	   || (flag_inet == S_TRUE && sh.srvexport.name[0] != '\0') 
-#endif
-          /* sh.flag.isserver != GOOD                    && */
-          /* (flag_inet == S_FALSE) */ /* don't log inet to export */
-	   )
+      if ((errFlags.exportlevel  & severity  )   != 0 &&
+          (errFlags.export_class & (1 << class)) != 0 &&
+          (errFlags.exportlevel  & SH_ERR_NOT)   == 0 &&
+	  class != AUD                                &&
+          sh.flag.isserver != GOOD                    &&
+          (flag_inet == S_FALSE) ) /* don't log inet to export */
         {
           if (export_block == 0)
             {
 	      int retval;
-	      size_t ex_len;
 
 	      /* will truncate to 65280 bytes 
 	       */
               export_block = 1;
-	      /* ex_len = 64 + sl_strlen(lmsg->msg) + 1; */
-	      ex_len = sl_strlen(lmsg->msg);
-	      if (sl_ok_adds(ex_len, 65))
-		ex_len = 64 + ex_len + 1;
-	      ex_msg = SH_ALLOC (ex_len);
-
-	      sl_snprintf(ex_msg, ex_len, _("%d?%u?%s"),
-		      severity, class, lmsg->msg);
-              retval = sh_xfer_report (ex_msg);
+	      ex_msg = SH_ALLOC (64 + sl_strlen(lmsg->msg) + 1);
+	      /*@-bufferoverflowhigh@*/
+	      sprintf(ex_msg, _("%d?%u?%s"),             /* known to fit  */
+			   severity, class, lmsg->msg);
+	      /*@-bufferoverflowhigh@*/
+              retval = sh_forward (ex_msg);
 	      SH_FREE(ex_msg);
               export_block = 0;
@@ -1342,9 +1165,9 @@
 	      mail_block = 1;
 
-	      BREAKEXIT(sh_nmail_msg);
+	      BREAKEXIT(sh_mail_msg);
 	      if ( (severity & SH_ERR_FATAL) == 0) 
-		retval = sh_nmail_pushstack (severity, hexmsg ? hexmsg : lmsg->msg, NULL);
+		retval = sh_mail_pushstack (lmsg->msg);
 	      else 
-		retval = sh_nmail_msg (severity, hexmsg ? hexmsg : lmsg->msg, NULL);
+		retval = sh_mail_msg (lmsg->msg);
 
 	      mail_block = 0;
@@ -1368,5 +1191,5 @@
 	  )
 	{
-	  if (prelude_block == 0 && enableUnsafe == S_TRUE)
+	  if (prelude_block == 0)
 	    {
 	      /* will truncate to 998 bytes 
@@ -1378,13 +1201,7 @@
 	       *  Reports first error after failure. Always tries.
 	       */
-#if defined(HAVE_LIBPRELUDE) && defined(SH_WITH_SERVER) 
-	      (void) sh_prelude_alert (severity, (int) class, 
-				       hexmsg ? hexmsg : lmsg->msg, lmsg->status, msg_id, 
-				       local_inet_peer_ip);
-#else
-	      (void) sh_prelude_alert (severity, (int) class, 
-				       hexmsg ? hexmsg : lmsg->msg, lmsg->status, msg_id, 
-				       NULL);
-#endif
+	      (void) sh_prelude_alert (severity, (int) class, lmsg->msg,
+				       lmsg->status, msg_id);
+
 	      prelude_block = 0;
 	    }
@@ -1422,8 +1239,8 @@
 		    (void) sh_log_file (lmsg->msg, NULL);
 		  else
-                    (void) sh_log_file (lmsg->msg, local_inet_peer);
+		    (void) sh_log_file (lmsg->msg, local_inet_peer);
 		}
 #else
-              (void) sh_log_file (hexmsg ? hexmsg : lmsg->msg, NULL);
+              (void) sh_log_file (lmsg->msg, NULL);
 #endif
 	      /* sh_log_file (lmsg->msg); */
@@ -1440,95 +1257,13 @@
   if (lmsg->msg)
     SH_FREE( lmsg->msg );
-  sh_replace_free(hexmsg);
-
-  memset ( lmsg, 0, sizeof(struct _log_t) );
+
+  memset ( lmsg, (int) '\0', sizeof(struct _log_t) );
   MUNLOCK( (char *) lmsg,       sizeof(struct _log_t) );
   SH_FREE( lmsg );
   own_block = 0;
 
- exit_here:
-  ; /* label at end of compound statement */
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_err_handle);
-
   /*@i@*/SL_RET0(_("sh_error_handle"));
 /*@i@*/}
 
-#if defined(SH_WITH_MAIL)
-void sh_error_mail (const char * alias, int sev, 
-		    const char * file, long line, 
-		    long status, unsigned long msg_id, ...)
-{
-  va_list         vl;                 /* argument list          */
-  struct _log_t * lmsg;
-
-  int    severity;
-  unsigned int class;
-  const char * fmt;
-  int retval; 
-
-  SL_ENTER(_("sh_error_mail"));
-
-  /* Returns pointer to (constant|thread-specific) static memory
-   */
-  fmt = /*@i@*/get_format (msg_id, &severity, &class);
-
-  if (!fmt)
-    {
-      SL_RET0(_("sh_error_mail"));
-    }
-
-  /* --- Override the catalogue severity. ---
-   */
-  if (sev != (-1))
-    severity = sev;
-
-  /* --- Build the message. ---
-   */
-  lmsg = (struct _log_t *) SH_ALLOC(sizeof(struct _log_t));
-  MLOCK( (char *) lmsg, sizeof(struct _log_t));
-  /*@i@*/lmsg->msg = NULL;
-
-  /*@i@*/(void) sl_strlcpy(lmsg->format, fmt, SH_PATHBUF);
-  (void) sl_strlcpy(lmsg->file, file, SH_PATHBUF);
-  lmsg->severity = severity;
-  lmsg->class    = (int) class;
-  lmsg->line     = line;
-  lmsg->status   = status;
-
-  /* Format the log message with timestamp etc.
-   * Allocate lmsg->msg
-   */
-  va_start (vl, msg_id);
-  (void) sh_error_string (lmsg, vl);
-  va_end (vl);
-
-  if ( (severity & SH_ERR_FATAL) == 0) 
-    retval = sh_nmail_pushstack (severity, lmsg->msg, alias);
-  else 
-    retval = sh_nmail_msg (severity, lmsg->msg, alias);
-  
-  if (retval == -2)
-    {
-      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_QUEUE_FULL,
-		       _("email"));
-    }
-  SL_RET0(_("sh_error_mail"));
-}
-#else
-void sh_error_mail (const char * alias, int sev, 
-		    const char * file, long line, 
-		    long status, unsigned long msg_id, ...)
-{
-  (void) alias;
-  (void) sev;
-  (void) file;
-  (void) line;
-  (void) status;
-  (void) msg_id;
-
-  return;
-}
-/* defined(SH_WITH_MAIL) */
-#endif 
 
 /* -------------------------  
@@ -1543,5 +1278,5 @@
  */
 /*@owned@*/ /*@null@*/inline
-static const char * get_format(unsigned long msg_id, /*@out@*/ int * priority, 
+static char * get_format(unsigned long msg_id, /*@out@*/ int * priority, 
 			 /*@out@*/unsigned int * class)
 {
@@ -1558,5 +1293,5 @@
 	  *priority = (int) msg_cat[i].priority;
 	  *class    = (unsigned int) msg_cat[i].class;
-	  SL_RETURN (((const char *) _(msg_cat[i].format)), _("get_format"));
+	  SL_RETURN (_(msg_cat[i].format), _("get_format"));
 	}
       ++i;
@@ -1571,8 +1306,8 @@
 /* allocate space for user-defined message header
  */
-int sh_error_ehead (/*@null@*/const char * str_s)
+int sh_error_ehead (/*@null@*/char * str_s)
 {
   size_t size;
-  const char * s;
+  char * s;
 
   SL_ENTER(_("sh_error_ehead"));
@@ -1589,5 +1324,5 @@
   
   size = /*@i@*/strlen(s);
-  if (/*@i@*/s[size-1] == (char) 34) --size; /* truncate */
+  if (/*@i@*/s[size-1] == (char) 34) --size;
 
   if (ehead_format != NULL)
@@ -1706,5 +1441,5 @@
   }
 
-  (void) sh_unix_time (0, tst, 64);
+  (void) sl_strlcpy (tst, sh_unix_time (0), 64);
   line = (unsigned long) lmsg->line;
   (void) sl_strlcpy (cla, _(class_cat[lmsg->class]), 11);
@@ -1747,10 +1482,6 @@
       len      = sl_strlen(lmsg->msg);
       /*@i@*/required = sl_vsnprintf(&(lmsg->msg[len]), 
-				     (lmsg->msg_len - len), lmsg->format, vl);
-
-      if ((required >= 0) && 
-	  sl_ok_adds(required, len) &&
-	  sl_ok_adds((required+len), 4) &&
-	  ((required + len) > (lmsg->msg_len - 4)) )
+			      (lmsg->msg_len - len), lmsg->format, vl);
+      if ( (required + len) > (lmsg->msg_len - 4) )
 	{
 	  /*@i@*/p = SH_ALLOC(required + len + 4);
@@ -1760,5 +1491,5 @@
 	  lmsg->msg_len = required + len + 4;
 	  (void) sl_vsnprintf(&(lmsg->msg[len]), 
-			      (required + 1), lmsg->format, vl2);
+			      (required + len + 1), lmsg->format, vl2);
 	}
       va_end(vl2);
@@ -1805,13 +1536,7 @@
 			     SH_ERR_STAMP | SH_ERR_ERR    | SH_ERR_SEVERE |
 			     SH_ERR_FATAL);
-  flag_err_info           = S_TRUE;
-#endif
-
-#if defined(SH_WITH_SERVER)
-  errFlags.exportlevel    = SH_ERR_NOT;
-#else
+#endif
   errFlags.exportlevel    = (SH_ERR_STAMP | SH_ERR_ERR    | SH_ERR_SEVERE |
 			     SH_ERR_FATAL);
-#endif
 
   errFlags.log_class      = 0xFFFF;
Index: trunk/src/sh_extern.c
===================================================================
--- trunk/src/sh_extern.c	(revision 591)
+++ trunk/src/sh_extern.c	(revision 1)
@@ -40,5 +40,5 @@
 static FILE * pdbgc = NULL;
 #define PDBG_OPEN    if (pdbg == NULL) pdbg = fopen(PDGBFILE"main",  "a")  
-#define PDBG_CLOSE   sl_fclose (FIL__, __LINE__, pdbg); pdbg = NULL
+#define PDBG_CLOSE   fclose (pdbg); pdbg = NULL
 #define PDBG(arg)    fprintf(pdbg,  "PDBG: step %d\n", arg); fflush(pdbg)
 #define PDBG_D(arg)  fprintf(pdbg,  "PDBG: %d\n", arg); fflush(pdbg)
@@ -46,5 +46,5 @@
 
 #define PDBGC_OPEN   if (pdbgc == NULL) pdbgc = fopen(PDGBFILE"child", "a")  
-#define PDBGC_CLOSE  sl_fclose (FIL__, __LINE__, pdbgc); pdbgc = NULL
+#define PDBGC_CLOSE  fclose (pdbgc); pdbgc = NULL
 #define PDBGC(arg)   fprintf(pdbgc, "PDBGC: step %d\n", arg); fflush(pdbgc)
 #define PDBGC_D(arg) fprintf(pdbgc, "PDBGC: %d\n", arg); fflush(pdbgc)
@@ -74,8 +74,15 @@
 #include <sys/wait.h>
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
+#else
+#include <time.h>
 #endif
-#include <time.h>
+#endif
+
 
 #include "samhain.h"
@@ -85,5 +92,4 @@
 #include "sh_extern.h"
 #include "sh_calls.h"
-#include "sh_filter.h"
 #define SH_NEED_PWD_GRP 1
 #include "sh_static.h"
@@ -109,8 +115,7 @@
   FILE * outf = NULL;
   char * envp[1];
-  char * argp[2];
+  char * argp[1];
 
   char * errfile;
-  char errbuf[SH_ERRBUF_SIZE];
 
   static int some_error = 0;
@@ -121,29 +126,22 @@
   int         pfd = -1;
 #endif
-
+  
   SL_ENTER(_("sh_ext_popen"));
 
   /* Linux, HP-UX and FreeBSD will happily accept envp = argp = NULL
-   * (newer Linuxes (gcc 4.4.4) warn on argp == NULL, but accept it,
-   * as reported by T. Luettgert)
    * Solaris (and probably some other Unices) 
    *         needs a valid *envp[] with envp[0] = NULL;
    *         and similarly for argp
-   * OpenBSD finally needs non-null argp[0] ...
    */
-  argp[0] = task->command;
-  argp[1] = NULL;
   envp[0] = NULL;
+  argp[0] = NULL;
 
   /* 
    * --  check whether path is trustworthy
    */
-  status = sl_trustfile(task->command, NULL, NULL);
-#if 0
   if ((uid_t) -1 != task->trusted_users[0])
     {
       status = sl_trustfile(task->command, task->trusted_users, NULL);
     }
-#endif
 
   PDBG_OPEN;
@@ -180,13 +178,10 @@
    * --  check whether the checksum is correct; with linux emulate fdexec
    */
-#if ( !defined(__linux__) || ( defined(__linux__) && defined(HAVE_PTHREAD)) ) && !defined(SL_DEBUG)
+#if !defined(__linux__) && !defined(SL_DEBUG)
   if (task->checksum[0]  != '\0')
     {
-      char hashbuf[KEYBUF_SIZE];
       PDBG_S("checksum test");
       if (0 != sl_strcmp(task->checksum, 
-			 sh_tiger_hash (task->command, TIGER_FILE, TIGER_NOLIM,
-					hashbuf, sizeof(hashbuf))
-			 )
+			 sh_tiger_hash (task->command, TIGER_FILE, 0))
 	  )
 	{
@@ -216,15 +211,13 @@
       errnum = errno;
       sh_error_handle((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN, 
-		      sh_error_message(errnum, errbuf, sizeof(errbuf)), _("pipe"));
+		      sh_error_message(errnum), _("pipe"));
       SL_RETURN ((-1), _("sh_ext_popen"));
     }
 
   PDBG(3);
-
+  
   /* 
-   * -- Flush streams and fork 
+   * -- Fork 
    */
-  fflush (NULL);
-
   task->pid = aud_fork(FIL__, __LINE__);
 
@@ -233,10 +226,10 @@
       PDBG_S("fork() failure");
       /*@-usedef@*/
-      (void) sl_close_fd(FIL__, __LINE__, pipedes[0]);
-      (void) sl_close_fd(FIL__, __LINE__, pipedes[1]);
+      (void) close(pipedes[0]);
+      (void) close(pipedes[1]);
       /*@+usedef@*/
       errnum = errno;
       sh_error_handle((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN, 
-		      sh_error_message(errnum, errbuf, sizeof(errbuf)), _("fork"));
+		      sh_error_message(errnum), _("fork"));
       SL_RETURN ((-1), _("sh_ext_popen"));
     }
@@ -251,9 +244,9 @@
       if (S_TRUE == task->fork_twice)
 	{
-	  task->pid = fork();
+	  task->pid = aud_fork(FIL__, __LINE__);
 
 	  if (task->pid == (pid_t) - 1) 
 	    {
-	      _exit (EXIT_FAILURE);
+	      aud__exit (FIL__, __LINE__, EXIT_FAILURE);
 	    }
 	}
@@ -261,6 +254,4 @@
       if (task->pid == (pid_t) 0)
 	{
-	  int val_return;
-
 	  PDBGC_OPEN;
 	  PDBGC(1);
@@ -271,19 +262,13 @@
 	  if (task->rw == 'w')
 	    {
-	      do {
-		val_return = dup2 (pipedes[STDIN_FILENO], STDIN_FILENO);
-	      } while (val_return < 0 && errno == EINTR);
-
-	      if (val_return < 0)
-		_exit(EXIT_FAILURE);
+	      if (retry_aud_dup2(FIL__, __LINE__, 
+				 pipedes[STDIN_FILENO], STDIN_FILENO) < 0)
+		aud__exit(FIL__, __LINE__,EXIT_FAILURE);
 	    }
 	  else
 	    {
-	      do {
-		val_return = dup2 (pipedes[STDOUT_FILENO], STDOUT_FILENO);
-	      } while (val_return < 0 && errno == EINTR);
-
-	      if (val_return < 0)
-		_exit(EXIT_FAILURE);
+	      if (retry_aud_dup2(FIL__, __LINE__,
+				 pipedes[STDOUT_FILENO], STDOUT_FILENO) < 0)
+		aud__exit(FIL__, __LINE__,EXIT_FAILURE);
 	    }
 	  PDBGC(2);
@@ -292,11 +277,11 @@
 	  /* close the pipe descriptors 
 	   */
-	  (void) sl_close_fd   (FIL__, __LINE__, pipedes[STDIN_FILENO]);
-	  (void) sl_close_fd   (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
+	  (void) close   (pipedes[STDIN_FILENO]);
+	  (void) close   (pipedes[STDOUT_FILENO]);
 	  
 	  /* don't leak file descriptors
 	   */
 #if !defined(PDGBFILE)
-	  sh_unix_closeall (3, task->com_fd, S_TRUE); /* in child process */
+	  sh_unix_closeall (3, task->com_fd); /* in child process */
 #endif
 
@@ -311,13 +296,10 @@
 	      memset(skey, 0, sizeof(sh_key_t));
 
-	      if (setgid((gid_t) task->run_user_gid) != 0)
-		_exit(EXIT_FAILURE);
-	      if (setuid((uid_t) task->run_user_uid) != 0)
-		_exit(EXIT_FAILURE);
-
+	      (void) aud_setgid(FIL__, __LINE__,(gid_t) task->run_user_gid);
+	      (void) aud_setuid(FIL__, __LINE__,(uid_t) task->run_user_uid);
 	      /* make sure we cannot get root again
 	       */
-	      if (setuid(0) >= 0)
-		_exit(EXIT_FAILURE);
+	      if (aud_setuid(FIL__, __LINE__,0) >= 0)
+		aud__exit(FIL__, __LINE__,EXIT_FAILURE);
 	    }
 	  
@@ -338,8 +320,6 @@
 	    {
 	      PDBGC_S("r");
-	      do {
-		val_return = dup2 (STDOUT_FILENO, STDERR_FILENO);
-	      } while (val_return < 0 && errno == EINTR);
-
+	      (void) retry_aud_dup2 (FIL__, __LINE__, 
+				     STDOUT_FILENO, STDERR_FILENO);
 	      (void) fcntl  (STDIN_FILENO, F_SETFD, FD_CLOEXEC);
 	      /*
@@ -355,101 +335,45 @@
 	   * --  emulate an fdexec with checksum testing
 	   */
-
-#if !defined(HAVE_PTHREAD)
 	  if (task->checksum[0]  != '\0')
-#endif
 	    {
 	      PDBGC_S("fexecve");
 	      if (task->com_fd != (-1))
 		{
-		  do {
-		    val_return = dup (task->com_fd);
-		  } while (val_return < 0 && errno == EINTR);
-		  pfd = val_return;
+		  pfd = retry_aud_dup(FIL__, __LINE__, task->com_fd);
 		  if (pfd < 0)
 		    {
-		      PDBGC_S("fexecve: dup failed");
-		      _exit(EXIT_FAILURE);
+		      PDBGC_S("fexecve: dup2 failed");
+		      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 		    }
 		}
-#if !defined(HAVE_PTHREAD)
 	      else
 		{
-		  char hashbuf[KEYBUF_SIZE];
-
 		  fd = 
-		    sl_open_read(FIL__, __LINE__, task->command, 
+		    sl_open_read(task->command, 
 				 task->privileged==0 ? SL_NOPRIV : SL_YESPRIV);
-
+		  tiger_fd = fd;
 		  if (0 != sl_strcmp(task->checksum, 
 				     sh_tiger_hash (task->command, 
-						    fd, TIGER_NOLIM, hashbuf, sizeof(hashbuf))))
+						    TIGER_FD, 0)))
 		    {
 		      PDBGC_S("fexecve: checksum mismatch");
-		      sl_close(fd);
-		      _exit(EXIT_FAILURE);
+		      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 		    }
-
 		  pfd = get_the_fd(fd);
-
-		  do {
-		    val_return = dup (pfd);
-		  } while (val_return < 0 && errno == EINTR);
-		  pfd = val_return;
-
-		  sl_close(fd);
-		  fd = -1;
-
-		  if (pfd < 0)
-		    {
-		      PDBGC_S("fexecve: dup (2) failed");
-		      _exit(EXIT_FAILURE);
-		    }
 		}
-#endif
               
 	      PDBGC(5);
-	      /* Cannot use sprintf because of deadlock in malloc/free */
-	      {
-		static char digit[] = "0123456789";
-		char str0[128];
-		char str1[128];
-		int ival = pfd;
-		unsigned int n = 0;
-		unsigned int m = 0;
-
-		if (ival < 0) ival = -ival;
-		do {
-		  str0[n] = digit[ival % 10];
-		  ++n;
-		  ival /= 10;
-		} while (ival);
-
-		if (pfd < 0)
-		  {
-		    str0[n] = '-';
-		    ++n;
-		  }
-		str0[n] = '\0';
-		str1[n] = '\0';
-		while (n > 0)
-		  {
-		    str1[m] = str0[n-1];
-		    ++m; --n;
-		  }
-		sl_strlcpy(pname, _("/proc/self/fd/"), sizeof(pname));
-		sl_strlcat(pname, str1, sizeof(pname));
-	      }
-              if (access(pname, R_OK|X_OK) == 0) /* flawfinder: ignore */
+	      sprintf(pname, _("/proc/self/fd/%d"),      /* known to fit  */
+			   pfd);
+              if (access(pname, R_OK|X_OK) == 0) 
 		{
 		  PDBGC(6);
 		  PDBGC_CLOSE;
 		  fcntl  (pfd, F_SETFD, FD_CLOEXEC);
-		  do {
-		    val_return = execve (pname, 
-					 (task->argc == 0) ? argp : task->argv, 
-					 (task->envc == 0) ? NULL : task->envv
-					 );
-		  } while (val_return < 0 && errno == EINTR);
+		  retry_aud_execve (FIL__, __LINE__, 
+				    pname, 
+				    (task->argc == 0) ? NULL : task->argv, 
+				    (task->envc == 0) ? NULL : task->envv
+				    );
 		  
 		  errnum = errno;
@@ -461,5 +385,5 @@
 		  /* failed 
 		   */
-		  _exit((errnum == 0) ? (EXIT_SUCCESS) : (EXIT_FAILURE));
+		  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
               }
 	      PDBGC_S("fexecve: not working");
@@ -470,5 +394,5 @@
 		sl_close(fd);
 	      else if (pfd != -1)
-		sl_close_fd(FIL__, __LINE__, pfd);
+		close(fd);
 	    }
 #endif
@@ -478,14 +402,13 @@
 	   * --  execute path if executable
 	   */
-	  if (0 == access(task->command, R_OK|X_OK)) /* flawfinder: ignore */
+	  if (0 == access(task->command, R_OK|X_OK))
 	    {
 	      PDBGC(5);
 	      PDBGC_CLOSE;
-	      do {
-		val_return = execve (task->command, 
-				     (task->argc == 0) ? argp : task->argv, 
-				     (task->envc == 0) ? envp : task->envv
-				     );
-	      } while (val_return < 0 && errno == EINTR);
+	      (void) retry_aud_execve (FIL__, __LINE__, 
+				       task->command, 
+				       (task->argc == 0) ? argp : task->argv, 
+				       (task->envc == 0) ? envp : task->envv
+				       );
 	    }
 	  errnum = errno;
@@ -497,5 +420,5 @@
 	  /* failed 
 	   */
-	  _exit((errnum == 0) ? (EXIT_SUCCESS) : (EXIT_FAILURE));
+	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
       /* 
@@ -504,5 +427,5 @@
       if (S_TRUE == task->fork_twice)
 	{
-	  _exit (0);
+	  aud__exit (FIL__, __LINE__, 0);
 	}
     }
@@ -524,5 +447,5 @@
     {
       PDBG_S("is w");
-      (void) sl_close_fd (FIL__, __LINE__, pipedes[STDIN_FILENO]);
+      (void) close (pipedes[STDIN_FILENO]);
       (void) retry_fcntl (FIL__, __LINE__, pipedes[STDOUT_FILENO], 
 			  F_SETFD, FD_CLOEXEC);
@@ -532,5 +455,5 @@
     {
       PDBG_S("is r");
-      (void) sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
+      (void) close (pipedes[STDOUT_FILENO]);
       (void) retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], 
 			  F_SETFD, FD_CLOEXEC);
@@ -554,6 +477,6 @@
 
       (void) aud_kill (FIL__, __LINE__, task->pid, SIGKILL);
-      (void) sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-      (void) sl_close_fd (FIL__, __LINE__, pipedes[STDIN_FILENO]);
+      (void) close (pipedes[STDOUT_FILENO]);
+      (void) close (pipedes[STDIN_FILENO]);
       (void) waitpid (task->pid, NULL, 0);
       task->pid = 0;
@@ -569,5 +492,5 @@
   PDBG_D(task->pipeFD);
 
-  task->pipeTI = sl_make_ticket(FIL__, __LINE__, task->pipeFD, _("pipe"), outf);
+  task->pipeTI = sl_make_ticket(task->pipeFD, _("pipe"));
 
   flags = (int) retry_fcntl (FIL__, __LINE__, task->pipeFD, F_GETFL, 0);
@@ -595,15 +518,10 @@
   char  infomsg[256];
 
-#ifdef WCONTINUED
-      int wflags = WNOHANG|WUNTRACED|WCONTINUED;
-#else
-      int wflags = WNOHANG|WUNTRACED;
-#endif
-
   SL_ENTER(_("sh_ext_pclose"));
 
-  PDBG_OPEN;
+  PDBGC_OPEN;
   PDBG_S(" -> pclose");
   (void) fflush(task->pipe);
+  (void) fclose(task->pipe);
   if (!SL_ISERROR(task->pipeTI))
     (void) sl_close(task->pipeTI);
@@ -618,43 +536,39 @@
 
     nochmal:
-      retval = waitpid(task->pid, &(task->exit_status), wflags);
+      retval = waitpid(task->pid, &(task->exit_status), WNOHANG|WUNTRACED);
       /*@-bufferoverflowhigh@*/
       if (task->pid == retval)
 	{
-#ifndef USE_UNO
 	  if (WIFEXITED(task->exit_status) != 0)
 	    {
 	      task->exit_status = WEXITSTATUS(task->exit_status);
-	      if ((flag_err_debug == S_TRUE) || (task->exit_status != 0))
-		sl_snprintf(infomsg, sizeof(infomsg),
-			    _("Subprocess exited normally with status %d"),
-			    task->exit_status);
+	      if ((flag_err_debug == SL_TRUE) || (task->exit_status != 0))
+		sprintf(infomsg,                         /* known to fit  */
+			_("Subprocess exited normally with status %d"),
+			task->exit_status);
 	    }
 	  else if (WIFSIGNALED(task->exit_status) != 0)
 	    {
-	      sl_snprintf(infomsg, sizeof(infomsg),
-			  _("Subprocess terminated by signal %d"),
-			  WTERMSIG(task->exit_status));
+	      sprintf(infomsg,                           /* known to fit  */
+		      _("Subprocess terminated by signal %d"),
+		      WTERMSIG(task->exit_status));
 	      task->exit_status = EXIT_FAILURE;
 	    }
 	  else if (WIFSTOPPED(task->exit_status) != 0)
 	    {
-	      sl_snprintf(infomsg, sizeof(infomsg),
-			  _("Subprocess stopped by signal %d, killing"),
-			  WSTOPSIG(task->exit_status));
+	      sprintf(infomsg,                           /* known to fit  */
+		      _("Subprocess stopped by signal %d, killing"),
+		      WSTOPSIG(task->exit_status));
 	      task->exit_status = EXIT_FAILURE;
 	      (void) aud_kill (FIL__, __LINE__, task->pid, 9);
 	      (void) retry_msleep (0, 30);
-	      (void) waitpid (task->pid, NULL, wflags);
+	      (void) waitpid (task->pid, NULL, WNOHANG|WUNTRACED);
 	    }
 	  else
 	    {
-	      sl_snprintf(infomsg, sizeof(infomsg),
-			  _("Subprocess exit status unknown"));
+	      sprintf(infomsg,                           /* known to fit  */
+		      _("Subprocess exit status unknown"));
 	      task->exit_status = EXIT_FAILURE;
 	    }
-#else
-	  task->exit_status = EXIT_FAILURE;
-#endif 
 	}
       else if (0 == retval)
@@ -667,6 +581,6 @@
 	    }
 	  (void) aud_kill (FIL__, __LINE__, task->pid, 9);
-	  sl_snprintf(infomsg, sizeof(infomsg),
-		      _("Subprocess not yet exited, killing"));
+	  sprintf(infomsg,                               /* known to fit  */
+		  _("Subprocess not yet exited, killing"));
 	  task->exit_status = EXIT_FAILURE;
 	  (void) waitpid (task->pid, NULL, 0);
@@ -674,11 +588,11 @@
       else
 	{
-	  sl_snprintf(infomsg, sizeof(infomsg),
-		      _("Waitpid returned error %d\n"), errno);
+	  sprintf(infomsg,                               /* known to fit  */
+		  _("Waitpid returned error %d\n"), errno);
 	  task->exit_status = EXIT_FAILURE;
 	}
       /*@+bufferoverflowhigh@*/
       status = task->exit_status;
-      if (flag_err_debug == S_TRUE)
+      if (flag_err_debug == SL_TRUE)
 	{
 	  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, task->exit_status, 
@@ -720,7 +634,5 @@
       tas->argv[i]          = NULL;
       tas->envv[i]          = NULL;
-#if 0
       tas->trusted_users[i] = (uid_t) -1;
-#endif
     }
 
@@ -734,5 +646,5 @@
 
 
-int sh_ext_tas_add_envv(sh_tas_t * tas, const char * key, const char * val)
+int sh_ext_tas_add_envv(sh_tas_t * tas, char * key, char * val)
 {
   size_t sk = 0, sv = 0;
@@ -751,8 +663,4 @@
     sv = strlen(val) + 1;
 
-  if (!sl_ok_adds(sk, sv))
-    {
-      SL_RETURN (-1, _("sh_ext_tas_add_envv"));
-    }
   si = tas->envc;
   tas->envv[si] = SH_ALLOC(sk + sv);
@@ -789,5 +697,5 @@
 }
 
-int sh_ext_tas_add_argv(sh_tas_t * tas, const char * val)
+int sh_ext_tas_add_argv(sh_tas_t * tas, char * val)
 {
   size_t sv = 0;
@@ -814,5 +722,5 @@
 }
 
-void sh_ext_tas_command(sh_tas_t * tas, const char * command)
+void sh_ext_tas_command(sh_tas_t * tas, char * command)
 {
   size_t len = sl_strlen(command);
@@ -843,175 +751,4 @@
 }
 
-static void task_init (sh_tas_t * task)
-{
-  sh_ext_tas_init(task);
-
-  (void) sh_ext_tas_add_envv (task, _("SHELL"), 
-			      _("/bin/sh")); 
-  (void) sh_ext_tas_add_envv (task, _("PATH"),  
-			      _("/sbin:/bin:/usr/sbin:/usr/bin:/usr/ucb")); 
-  (void) sh_ext_tas_add_envv (task, _("IFS"), " \n\t"); 
-
-  if (sh.timezone != NULL)
-    {
-      (void) sh_ext_tas_add_envv(task,  "TZ", sh.timezone);
-    }
-  return;
-}
-
-int sh_ext_popen_init (sh_tas_t * task, const char * command, char * argv0, ...)
-{
-  va_list vl;
-  int status;
-
-  task_init (task);
-  
-  if (!argv0)
-    {
-      sh_ext_tas_command(task,  _("/bin/sh"));
-
-      (void) sh_ext_tas_add_argv(task,  _("/bin/sh"));
-      (void) sh_ext_tas_add_argv(task,  _("-c"));
-      (void) sh_ext_tas_add_argv(task,  command);
-    }
-  else
-    {
-      char * s;
-
-      sh_ext_tas_command(task,  command);
-
-      (void) sh_ext_tas_add_argv(task, argv0);
-
-      va_start (vl, argv0);
-      s = va_arg (vl, char * );
-      while (s != NULL)
-	{
-	  (void) sh_ext_tas_add_argv(task, s);
-	  s = va_arg (vl, char * );
-	}
-      va_end (vl);
-
-    }
-  task->rw = 'r';
-  task->fork_twice = S_FALSE;
-
-  status = sh_ext_popen(task);
-
-  return status;
-}
-
-/* Execute a system command */
-
-int sh_ext_system (char * command, char * argv0, ...)
-{
-  sh_tas_t task;
-  int    status;
-  va_list vl;
-  char * s;
-
-  SL_ENTER(_("sh_ext_system"));
-
-  task_init (&task);
-  
-  sh_ext_tas_command(&task,  command);
-
-  (void) sh_ext_tas_add_argv(&task, argv0);
-  
-  va_start (vl, argv0);
-  s = va_arg (vl, char * );
-  while (s != NULL)
-    {
-      (void) sh_ext_tas_add_argv(&task, s);
-      s = va_arg (vl, char * );
-    }
-  va_end (vl);
-
-  task.rw = 'r';
-  task.fork_twice = S_FALSE;
-
-  status = sh_ext_popen(&task);
-
-  if (status != 0)
-    {
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-                      _("Could not execute command"), _("sh_ext_system"));
-      SL_RETURN ((-1), _("sh_ext_system"));
-    }
-
-  /* close pipe and return exit status
-   */
-  (void) sh_ext_pclose(&task);
-  sh_ext_tas_free (&task);
-  SL_RETURN ((status), _("sh_ext_system"));
-}
-
-/* Execute command, return first line of output
- * ifconfig | grep -1 lo | tail -n 1 | sed s/.*inet addr:\([0-9.]*\)\(.*\)/\1/
- */
-char * sh_ext_popen_str (const char * command)
-{
-  sh_tas_t task;
-  struct  sigaction  new_act;
-  struct  sigaction  old_act;
-  char * out = NULL;
-  int    status;
-
-  SL_ENTER(_("sh_ext_popen_str"));
-
-  status = sh_ext_popen_init (&task, command, NULL, NULL);
-
-  if (status != 0)
-    {
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-                      _("Could not open pipe"), _("sh_ext_popen_str"));
-      SL_RETURN ((NULL), _("sh_ext_popen_str"));
-    }
-
-   /* ignore SIGPIPE (instead get EPIPE if connection is closed)
-    */
-   new_act.sa_handler = SIG_IGN;
-   new_act.sa_flags   = 0;
-   sigemptyset( &new_act.sa_mask );
-   
-   (void) retry_sigaction (FIL__, __LINE__, SIGPIPE, &new_act, &old_act);
-   
-  /* read from the open pipe
-   */
-  if (task.pipe != NULL)
-    {
-      int try = 1200; /* 1000 * 0.1 = 120 sec */
-      sh_string * s = sh_string_new(0);
-      do {
-	sh_string_read(s, task.pipe, 0);
-	if (sh_string_len(s) == 0)
-	  {
-	    /* cppcheck-suppress syntaxError */
-	    --try; retry_msleep(0, 100);
-	  }
-      } while (sh_string_len(s) == 0 && try != 0);
-
-      if (sh_string_len(s) == 0)
-	{
-	  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			  _("No output from command"), _("sh_ext_popen_str"));
-	}
-
-      out = sh_util_strdup(sh_string_str(s));
-      sh_string_destroy(&s);
-    }
-
-  /* restore old signal handler
-   */
-  (void) retry_sigaction (FIL__, __LINE__, SIGPIPE, &old_act, NULL);
-
-  /* close pipe and return exit status
-   */
-  (void) sh_ext_pclose(&task);
-  sh_ext_tas_free (&task);
-  SL_RETURN ((out), _("sh_ext_popen_str"));
-}
-
-
-
 
 /* ---------------  EXTERN STUFF ------------------- */
@@ -1023,6 +760,10 @@
   char     type[4];
 
-  sh_filter_type * filter;
-
+  int      for_c;
+  char   * for_v[32];
+  int      fand_c;
+  char   * fand_v[32];
+  int      fnot_c;
+  char   * fnot_v[32];
   time_t   deadtime;
   time_t   last_run;
@@ -1052,4 +793,5 @@
 sh_com_t * command_init(void)
 {
+  int         i;
   uid_t       ff_euid;
   sh_com_t  * ext_com = NULL;
@@ -1061,5 +803,5 @@
   if (!ext_com)
     {
-      SL_RETURN( NULL, _("command_init"));
+      SL_RETURN( NULL, ("command_init"));
     }
 
@@ -1067,19 +809,25 @@
 
   (void) sl_get_euid(&ff_euid);
-#if 0
   ext_com->tas.trusted_users[0] = (uid_t) 0;
   ext_com->tas.trusted_users[1] = (uid_t) (ff_euid);
-#endif
 
   /* ------------------------------------------------- */
 
   set3(ext_com->type, 'l', 'o', 'g');
-  ext_com->filter       = NULL;
+  ext_com->for_c        = 0;
+  ext_com->fand_c       = 0;
+  ext_com->fnot_c       = 0;
   ext_com->deadtime     = 0;
   ext_com->last_run     = 0;
 
+  for (i = 0; i < 32; ++i)
+    {
+      ext_com->for_v[i]         = NULL;
+      ext_com->fand_v[i]        = NULL;
+      ext_com->fnot_v[i]        = NULL;
+    }
   ext_com->next             = NULL;
 
-  SL_RETURN( ext_com, _("command_init"));
+  SL_RETURN( ext_com, ("command_init"));
 }
 
@@ -1094,8 +842,6 @@
 
 static
-int sh_ext_add_envv(const char * key, const char * val)
-{
-  int retval; 
-
+int sh_ext_add_envv(char * key, char * val)
+{
   SL_ENTER(_("sh_ext_add_envv"));
 
@@ -1107,10 +853,7 @@
     }
 
-  retval = sh_ext_tas_add_envv(&(ext_coms->tas), key, val);
-
-  if (retval >= 0) 
-    retval = 0;
-
-  SL_RETURN (retval, _("sh_ext_add_envv"));
+  (void) sh_ext_tas_add_envv(&(ext_coms->tas), key, val);
+
+  SL_RETURN (0, _("sh_ext_add_envv"));
 }
 
@@ -1118,5 +861,5 @@
 
 static 
-int sh_ext_init(const char * command)
+int sh_ext_init(char * command)
 {
   sh_com_t * retval;
@@ -1153,11 +896,7 @@
 
 static
-int sh_ext_uid (const char * user, /*@out@*/uid_t * uid, /*@out@*/gid_t * gid)
-{
-  struct passwd *  tempres;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  struct passwd    pwd;
-  char           * buffer = SH_ALLOC(SH_PWBUF_SIZE);
-#endif
+int sh_ext_uid (char * user, /*@out@*/uid_t * uid, /*@out@*/gid_t * gid)
+{
+  struct passwd * tempres;
 
   SL_ENTER(_("sh_ext_uid"));
@@ -1167,15 +906,7 @@
   if (user == NULL)
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
       SL_RETURN (-1, _("sh_ext_uid"));
     }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  sh_getpwnam_r(user, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
   tempres = sh_getpwnam(user);
-#endif
 
   if (NULL != tempres) 
@@ -1183,13 +914,7 @@
       *uid = tempres->pw_uid;  
       *gid = tempres->pw_gid;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
       SL_RETURN (0, _("sh_ext_uid"));
     } 
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  SH_FREE(buffer);
-#endif
   SL_RETURN (-1, _("sh_ext_uid"));
 }
@@ -1197,11 +922,9 @@
 
 static
-int sh_ext_add (const char * argstring, int * ntok, char * stok[])
+int sh_ext_add (char * argstring, int * ntok, char * stok[])
 {
   int    i = 0;
   size_t s;
   char * p;
-  char * new;
-  size_t len;
 
   SL_ENTER(_("sh_ext_add"));
@@ -1212,23 +935,10 @@
     }
 
-  len = strlen(argstring) + 1;
-  new = SH_ALLOC(len);
-  sl_strlcpy(new, argstring, len); 
-
   do
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-      char * saveptr;
       if (i == 0)
-	p = strtok_r (new, ", \t", &saveptr);
-      else
-	p = strtok_r (NULL, ", \t", &saveptr);
-#else
-      if (i == 0)
-	p = strtok (new, ", \t");
+	p = strtok (argstring, ", \t");
       else
 	p = strtok (NULL, ", \t");
-#endif
-
       if (p == NULL)
 	break;
@@ -1247,5 +957,4 @@
 
   *ntok = i;
-  SH_FREE(new);
 
   SL_RETURN (0, _("sh_ext_add"));
@@ -1262,5 +971,5 @@
  * -- start a new external command, and add it to the list
  */ 
-int sh_ext_setcommand(const char * cmd)
+int sh_ext_setcommand(char * cmd)
 {
   int i;
@@ -1280,4 +989,5 @@
 int sh_ext_cleanup(void)
 {
+  int i;
   sh_com_t * retval;
 
@@ -1291,6 +1001,10 @@
       sh_ext_tas_free (&(retval->tas));
 
-      if (retval->filter)
-	sh_filter_free (retval->filter);
+      for (i = 0; i < 32; ++i)
+	{
+	  if (NULL != retval->for_v[i])  SH_FREE(retval->for_v[i]);
+	  if (NULL != retval->fand_v[i]) SH_FREE(retval->fand_v[i]);
+	  if (NULL != retval->fnot_v[i]) SH_FREE(retval->fnot_v[i]);
+	}
 
       SH_FREE(retval);
@@ -1302,49 +1016,31 @@
 
 /*
- * -- explicitely close a command
- */
-int sh_ext_close_command (const char * str)
-{
-  (void) str;
+ * -- add keywords to the OR filter
+ */
+int sh_ext_add_or (char * str)
+{
   if (ext_coms == NULL || ext_failed == (-1))
     return (-1);
-  ext_failed = (-1);
-  return 0;
+  return (sh_ext_add (str, &(ext_coms->for_c), ext_coms->for_v));
 }
 
 /*
- * -- add keywords to the OR filter
- */
-int sh_ext_add_or (const char * str)
+ * -- add keywords to the AND filter
+ */
+int sh_ext_add_and (char * str)
 {
   if (ext_coms == NULL || ext_failed == (-1))
     return (-1);
-  if (ext_coms->filter == NULL)
-    ext_coms->filter = sh_filter_alloc();
-  return (sh_filter_add(str, ext_coms->filter, SH_FILT_OR));
+  return (sh_ext_add (str, &(ext_coms->fand_c), ext_coms->fand_v));
 }
 
 /*
- * -- add keywords to the AND filter
- */
-int sh_ext_add_and (const char * str)
+ * -- add keywords to the NOT filter
+ */
+int sh_ext_add_not (char * str)
 {
   if (ext_coms == NULL || ext_failed == (-1))
     return (-1);
-  if (ext_coms->filter == NULL)
-    ext_coms->filter = sh_filter_alloc();
-  return (sh_filter_add(str, ext_coms->filter, SH_FILT_AND));
-}
-
-/*
- * -- add keywords to the NOT filter
- */
-int sh_ext_add_not (const char * str)
-{
-  if (ext_coms == NULL || ext_failed == (-1))
-    return (-1);
-  if (ext_coms->filter == NULL)
-    ext_coms->filter = sh_filter_alloc();
-  return (sh_filter_add(str, ext_coms->filter, SH_FILT_NOT));
+  return (sh_ext_add (str, &(ext_coms->fnot_c), ext_coms->fnot_v));
 }
 
@@ -1352,5 +1048,5 @@
  * -- add keywords to the CL argument list
  */
-int sh_ext_add_argv (const char * str)
+int sh_ext_add_argv (char * str)
 {
   if (ext_coms == NULL || ext_failed == (-1))
@@ -1362,9 +1058,11 @@
  * -- add a path to the environment
  */
-int sh_ext_add_default (const char * dummy)
-{
-  char * p = NULL;
+int sh_ext_add_default (char * dummy)
+{
+  /* while this assignment looks ridiculous, it is here to avoid
+   * an 'unused parameter' warning
+   */
+  char * p = (dummy == NULL ? dummy : NULL);
   int    i;
-  char   dir[SH_PATHBUF];
 
   SL_ENTER(_("sh_ext_add_default"));
@@ -1374,11 +1072,9 @@
       SL_RETURN(0, _("sh_ext_add_default"));
     }
-  p = sh_unix_getUIDdir (SH_ERR_ERR, (uid_t) ext_coms->tas.run_user_uid, 
-			 dir, sizeof(dir));
+  p = sh_unix_getUIDdir (SH_ERR_ERR, (uid_t) ext_coms->tas.run_user_uid);
   if (p)
     (void) sh_ext_add_envv (_("HOME"), p);
   (void) sh_ext_add_envv (_("SHELL"), _("/bin/sh")); 
-  (void) sh_ext_add_envv (_("PATH"),  _("/sbin:/bin:/usr/sbin:/usr/bin")); 
-  (void) sh_ext_add_envv (_("IFS"), " \n\t"); 
+  (void) sh_ext_add_envv (_("PATH"),  _("/sbin:/usr/sbin:/bin:/usr/bin")); 
   i = (p == NULL ? (-1) :  0);
   SL_RETURN(i, _("sh_ext_add_default"));
@@ -1388,8 +1084,7 @@
  * -- add an environment variable
  */
-int sh_ext_add_environ (const char * str)
+int sh_ext_add_environ (char * str)
 {
   int i;
-
   SL_ENTER(_("sh_ext_add_environ"));
   i = sh_ext_add_envv (NULL, str);
@@ -1400,5 +1095,5 @@
  * -- set deadtime
  */
-int sh_ext_deadtime (const char * str)
+int sh_ext_deadtime (char * str)
 {
   long    deadtime = 0;
@@ -1409,14 +1104,14 @@
   if (ext_coms == NULL || ext_failed == (-1) || str == NULL)
     {
-      SL_RETURN (-1, _("sh_ext_deadtime"));
+      SL_RETURN (-1, ("sh_ext_deadtime"));
     }
   deadtime = strtol(str, &tail, 10);
   if (tail == str || deadtime < 0 || deadtime == LONG_MAX)
     {
-      SL_RETURN (-1, _("sh_ext_deadtime"));
+      SL_RETURN (-1, ("sh_ext_deadtime"));
     }
   
   ext_coms->deadtime = (time_t) deadtime;  
-  SL_RETURN (0, _("sh_ext_deadtime"));  
+  SL_RETURN (0, ("sh_ext_deadtime"));  
 }
 
@@ -1424,5 +1119,5 @@
  * -- define type
  */
-int sh_ext_type (const char * str)
+int sh_ext_type (char * str)
 {
   SL_ENTER(_("sh_ext_type"));
@@ -1459,5 +1154,5 @@
  * -- define checksum
  */
-int sh_ext_checksum (const char * str)
+int sh_ext_checksum (char * str)
 {
   SL_ENTER(_("sh_ext_checksum"));
@@ -1480,5 +1175,5 @@
  * -- choose privileges
  */
-int sh_ext_priv (const char * c)
+int sh_ext_priv (char * c)
 {
 
@@ -1507,19 +1202,56 @@
 static int sh_ext_filter (char * message, sh_com_t * task)
 {
+  int i;
+  int j = 0;
   time_t now_time;
 
   SL_ENTER(_("sh_ext_filter"));
 
-  if (task->filter)
-    {
-      if (0 != sh_filter_filter (message, task->filter))
+  /* Presence of any of these keywords prevents execution.
+   */
+  if (task->fnot_c > 0)
+    {
+      for (i = 0; i < task->fnot_c; ++i)
+	{
+	  if (NULL != sl_strstr(message, task->fnot_v[i]))
+	    {
+	      SL_RETURN ((-1), _("sh_ext_filter"));
+	    }
+	}
+    }
+
+  /* Presence of all of these keywords is required for execution.
+   */
+  if (task->fand_c > 0)
+    {
+      j = 0;
+
+      for (i = 0; i < task->fand_c; ++i)
+	if (NULL != sl_strstr(message, task->fand_v[i]))
+	  ++j;
+
+      if (j != task->fand_c)
 	{
 	  SL_RETURN ((-1), _("sh_ext_filter"));
 	}
-    }
-
-  /* Filter passed, check deadtime */
-
-  if (task->deadtime != (time_t) 0)
+
+    }
+
+  /* Presence of at least one of these keywords is required for execution.
+   */
+  if (task->for_c > 0)
+    {
+      for (i = 0; i < task->for_c; ++i)
+	{
+	  if (NULL != sl_strstr(message, task->for_v[i]))
+	    {
+	      goto checkdeadtime;
+	    }
+	}
+      SL_RETURN ((-1), _("sh_ext_filter"));
+    }
+
+ checkdeadtime:
+  if (task->deadtime != (time_t) 0)   /* deadtime */
     {
       now_time = time (NULL);
@@ -1554,5 +1286,4 @@
   int        status = 0;
   char     * tmp;
-  char errbuf[SH_ERRBUF_SIZE];
 
   static  int some_error = 0;
@@ -1583,5 +1314,4 @@
   while (listval != NULL)
     {
-      PDBG_OPEN;
       PDBG(-2);
       if (t1 == listval->type[0] &&
@@ -1595,5 +1325,5 @@
 	    {
 	      sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-			      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+			      sh_error_message (caperr), 
 			      _("sl_get_cap_sub"));
 	    }
@@ -1674,5 +1404,5 @@
 	    {
 	      sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-			      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+			      sh_error_message (caperr), 
 			      _("sl_drop_cap_sub"));
 	    }
Index: trunk/src/sh_fInotify.c
===================================================================
--- trunk/src/sh_fInotify.c	(revision 591)
+++ 	(revision )
@@ -1,725 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2011       Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-/***************************************************************************
- *
- * This file provides a module for samhain to use inotify for file checking.
- *
- */
-
-#include "config_xor.h"
-
-#if (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)) 
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_modules.h"
-#include "sh_pthread.h"
-#include "sh_inotify.h"
-#include "sh_unix.h"
-#include "sh_hash.h"
-#include "sh_dbIO.h"
-#include "sh_files.h"
-#include "sh_ignore.h"
-
-#define FIL__  _("sh_fInotify.c")
-
-sh_watches sh_file_watches = SH_INOTIFY_INITIALIZER;
-
-#if defined(HAVE_SYS_INOTIFY_H) 
-
-static sh_watches sh_file_missing = SH_INOTIFY_INITIALIZER;
-
-#include <sys/inotify.h>
-
-/* --- Configuration ------- */
-
-static int ShfInotifyActive = S_FALSE;
-static int ShfInotifyClose  = S_FALSE; /* for reconf, mark instance for closing */
-
-static unsigned long ShfInotifyWatches = 0;
-
-static int sh_fInotify_active(const char *s) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_fInotify_active"));
-  value = sh_util_flagval(s, &ShfInotifyActive);
-  if (value == 0 && ShfInotifyActive != S_FALSE)
-    {
-      sh.flag.inotify |= SH_INOTIFY_USE;
-      sh.flag.inotify |= SH_INOTIFY_DOSCAN;
-      sh.flag.inotify |= SH_INOTIFY_NEEDINIT;
-    }
-  if (value == 0 && ShfInotifyActive == S_FALSE)
-    {
-      sh.flag.inotify = 0;
-    }
-  SL_RETURN((value), _("sh_fInotify_active"));
-}
-
-static int sh_fInotify_watches(const char *s) 
-{
-  int retval = -1;
-  char * foo;
-  unsigned long value;
-    
-  SL_ENTER(_("sh_fInotify_watches"));
-
-  value = strtoul(s, &foo, 0);
-  if (*foo == '\0')
-    {
-      ShfInotifyWatches = (value > 2147483647) ? 2147483647 /* MAX_INT_32 */: value;
-      retval = 0;
-    }
-  SL_RETURN((retval), _("sh_fInotify_watches"));
-}
-  
-  
-sh_rconf sh_fInotify_table[] = {
-    {
-        N_("inotifyactive"),
-        sh_fInotify_active,
-    },
-    {
-        N_("inotifywatches"),
-        sh_fInotify_watches,
-    },
-    {
-        NULL,
-        NULL
-    }
-};
-
-/* --- End Configuration --- */
-
-static int sh_fInotify_init_internal(void);
-static int sh_fInotify_process(struct inotify_event * event);
-static int sh_fInotify_report(struct inotify_event * event, char * filename,
-			      int class, unsigned long check_flags, int ftype, int rdepth);
-
-int sh_fInotify_init(struct mod_type * arg)
-{
-#ifndef HAVE_PTHREAD
-  (void) arg;
-  return SH_MOD_FAILED;
-#else
-
-  if (ShfInotifyActive == S_FALSE)
-    return SH_MOD_FAILED;
-
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    return SH_MOD_FAILED;
-
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      /* Init from main thread */
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_DOSCAN;   );
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_NEEDINIT; );
-
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	{
-	  return SH_MOD_THREAD;
-	}
-      else
-	{
-	  sh.flag.inotify = 0;
-	  return SH_MOD_FAILED;
-	}
-    }
-  else if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon != S_TRUE && sh.flag.loop != S_TRUE))
-    {
-      sh.flag.inotify = 0;
-      return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      /* Reconfigure from main thread */
-
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_DOSCAN;   );
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_NEEDINIT; );
-      return SH_MOD_THREAD;
-    }
-
-  /* Within thread, init */
-  return sh_fInotify_init_internal();
-#endif
-}
-
-int sh_fInotify_run()
-{
-  ssize_t len = -1;
-  char *  buffer;
-  static int count  = 0;
-  static int count2 = 0;
-
-  if (ShfInotifyActive == S_FALSE)
-    {
-      return SH_MOD_FAILED;
-    }
-
-  if (ShfInotifyClose == S_TRUE)
-    {
-      ShfInotifyClose = S_FALSE;
-      sh_inotify_close();
-    }
-
-  if ( (sh.flag.inotify & SH_INOTIFY_DOSCAN) ||
-       (sh.flag.inotify & SH_INOTIFY_NEEDINIT))
-    {
-      if (0 != sh_fInotify_init_internal())
-	{
-	  return SH_MOD_FAILED;
-	}
-    }
-
-  buffer = SH_ALLOC(16384);
-
-  /* Blocking read from inotify file descriptor.
-   */
-  len = sh_inotify_read_timeout (buffer, 16384, 1);
-  
-  if (len > 0)
-    {
-      struct inotify_event *event;
-      long i = 0;
-
-      while (i < len) 
-	{
-	  event = (struct inotify_event *) &(buffer[i]);
-	  
-	  sh_fInotify_process(event);
-	  
-	  i += sizeof (struct inotify_event) + event->len;
-	}
-
-      if ( (sh.flag.inotify & SH_INOTIFY_DOSCAN) ||
-	   (sh.flag.inotify & SH_INOTIFY_NEEDINIT))
-	{
-	  if (0 != sh_fInotify_init_internal())
-	    {
-	      SH_FREE(buffer);
-	      return SH_MOD_FAILED;
-	    }
-	}
-     }
-
-  /* Re-scan 'dormant' list of sh_file_missing. 
-   */ 
-  sh_inotify_recheck_watches (&sh_file_watches, &sh_file_missing);
-
-  ++count; 
-  ++count2;
-
-  if (count >= 10)
-    {
-      count = 0; /* Re-expand glob patterns to discover added files. */
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_INSCAN; );
-      sh_files_check_globFilePatterns();
-      SH_INOTIFY_IFUSED( sh.flag.inotify &= ~SH_INOTIFY_INSCAN;  );
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_NEEDINIT; );
-    }
-
-  if (count2 >= 300)
-    {
-      count2 = 0; /* Update baseline database. */
-      if (sh.flag.checkSum == SH_CHECK_CHECK && sh.flag.update == S_TRUE)
-	sh_dbIO_writeout_update ();
-    }
-
-  SH_FREE(buffer);
-  return 0;
-}
-
-/* We block in the read() call on the inotify descriptor,
- * so we always run.
- */
-int sh_fInotify_timer(time_t tcurrent)
-{
-  (void) tcurrent;
-  return 1;
-}
-
-int sh_fInotify_cleanup()
-{
-  sh_inotify_purge_dormant(&sh_file_watches);
-  sh_inotify_remove(&sh_file_watches);
-  sh_inotify_init(&sh_file_watches);
-  return 0;
-}
-
-/* This runs in the main thread, so it won't close
- * the (threadspecific) inotify instance.
- */
-int sh_fInotify_reconf()
-{
-  sh.flag.inotify   = 0;
-
-  ShfInotifyWatches = 0;
-  ShfInotifyActive  = 0;
-
-  ShfInotifyClose   = S_TRUE;
-
-  return sh_fInotify_cleanup();
-}
-
-#define PROC_WATCHES_MAX _("/proc/sys/fs/inotify/max_user_watches")
-
-static void sh_fInotify_set_nwatches()
-{
-  static int fails = 0;
-
-  if (ShfInotifyWatches == 0 || fails == 1)
-    return;
-
-  if (0 == access(PROC_WATCHES_MAX, R_OK|W_OK)) /* flawfinder: ignore */
-    {
-      FILE * fd;
-
-      if (NULL != (fd = fopen(PROC_WATCHES_MAX, "r+")))
-	{
-	  char   str[128];
-	  char * ret;
-	  char * ptr;
-	  unsigned long  wn;
-
-	  str[0] = '\0';
-	  ret = fgets(str, 128, fd);
-	  if (ret && *str != '\0')
-	    {
-	      wn = strtoul(str, &ptr, 0);
-	      if (*ptr == '\0' || *ptr == '\n')
-		{
-		  if (wn < ShfInotifyWatches)
-		    {
-		      sl_snprintf(str, sizeof(str), "%lu\n", ShfInotifyWatches);
-		      (void) fseek(fd, 0L, SEEK_SET);
-		      fputs(str, fd);
-		    }
-		  sl_fclose(FIL__, __LINE__, fd);
-		  return;
-		}
-	    }
-	  sl_fclose(FIL__, __LINE__, fd);
-	}
-    }
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		  _("Cannot set max_user_watches"), 
-		  _("sh_fInotify_set_nwatches"));
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  fails = 1;
-  return;
-}
-
-/* The watch fd is thread specific. To have it in the fInotify thread,
- * the main thread writes a list of files/dirs to watch, and here we
- * now pop files from the list to add watches for them.
- */
-static int sh_fInotify_init_internal()
-{
-  char * filename;
-  int    class;
-  int    type;
-  int    rdepth;
-  unsigned long check_flags;
-  int    retval;
-  int    errnum;
-
-  if (ShfInotifyActive == S_FALSE)
-    return SH_MOD_FAILED;
-
-  /* Wait until file scan is finished.
-   */
-  while((sh.flag.inotify & SH_INOTIFY_DOSCAN) != 0)
-    {
-      retry_msleep(1,0);
-
-      if (ShfInotifyActive == S_FALSE)
-	return SH_MOD_FAILED;
-    }
-
-  sh_fInotify_set_nwatches();
-
-  while (NULL != (filename = sh_inotify_pop_dormant(&sh_file_watches, 
-						    &class, &check_flags, 
-						    &type, &rdepth)))
-    {
-      retval = sh_inotify_add_watch(filename, &sh_file_watches, &errnum,
-				    class, check_flags, type, rdepth);
-
-      if (retval < 0)
-	{
-	  char errbuf[SH_ERRBUF_SIZE];
-
-	  sh_error_message(errnum, errbuf, sizeof(errbuf));
-
-	  if ((errnum == ENOENT) || (errnum == EEXIST))
-	    {
-	      /* (1) Did it exist at init ? 
-	       */
-	      if (sh_hash_have_it (filename) >= 0)
-		{
-		  /* (2) Do we want to report on it ?
-		   */
-		  if (S_FALSE == sh_ignore_chk_del(filename))
-		    {
-		      char * epath = sh_util_safe_name (filename);
-
-		      SH_MUTEX_LOCK(mutex_thread_nolog);
-		      sh_error_handle( SH_ERR_ALL /* debug */,
-				       FIL__, __LINE__, errnum, MSG_E_SUBGPATH, 
-				       errbuf, _("sh_fInotify_init_internal"), epath);
-		      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		      SH_FREE(epath);
-		    }
-		}
-	    }
-	  else
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, errnum, MSG_E_SUBGEN, 
-			       errbuf, _("sh_fInotify_init_internal"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	}
-      SH_FREE(filename);
-    }
-
-  /* Need this because mod_check() may run after
-   * DOSCAN is finished, hence wouldn't call init().
-   */
-  SH_INOTIFY_IFUSED( sh.flag.inotify &= ~SH_INOTIFY_NEEDINIT; );
-
-  return 0;
-}
-
-static void sh_fInotify_logmask(struct inotify_event * event)
-{
-  char dbgbuf[256];
-  
-  sl_strlcpy (dbgbuf, "inotify mask: ", sizeof(dbgbuf));
-  
-  if (event->mask & IN_ACCESS) sl_strlcat(dbgbuf, "IN_ACCESS ", sizeof(dbgbuf));
-  if (event->mask & IN_ATTRIB) sl_strlcat(dbgbuf, "IN_ATTRIB ", sizeof(dbgbuf));
-  if (event->mask & IN_CLOSE_WRITE) sl_strlcat(dbgbuf, "IN_CLOSE_WRITE ", sizeof(dbgbuf));
-  if (event->mask & IN_CLOSE_NOWRITE) sl_strlcat(dbgbuf, "IN_CLOSE_NOWRITE ", sizeof(dbgbuf));
-  if (event->mask & IN_CREATE) sl_strlcat(dbgbuf, "IN_CREATE ", sizeof(dbgbuf));
-  if (event->mask & IN_DELETE) sl_strlcat(dbgbuf, "IN_DELETE ", sizeof(dbgbuf));
-  if (event->mask & IN_DELETE_SELF) sl_strlcat(dbgbuf, "IN_DELETE_SELF ", sizeof(dbgbuf));
-  if (event->mask & IN_MODIFY) sl_strlcat(dbgbuf, "IN_MODIFY ", sizeof(dbgbuf));
-  if (event->mask & IN_MOVE_SELF) sl_strlcat(dbgbuf, "IN_MOVE_SELF ", sizeof(dbgbuf));
-  if (event->mask & IN_MOVED_FROM) sl_strlcat(dbgbuf, "IN_MOVED_FROM ", sizeof(dbgbuf));
-  if (event->mask & IN_MOVED_TO) sl_strlcat(dbgbuf, "IN_MOVED_TO ", sizeof(dbgbuf));
-  if (event->mask & IN_OPEN) sl_strlcat(dbgbuf, "IN_OPEN ", sizeof(dbgbuf));
-  if (event->mask & IN_IGNORED) sl_strlcat(dbgbuf, "IN_IGNORED ", sizeof(dbgbuf));
-  if (event->mask & IN_ISDIR) sl_strlcat(dbgbuf, "IN_ISDIR ", sizeof(dbgbuf));
-  if (event->mask & IN_Q_OVERFLOW) sl_strlcat(dbgbuf, "IN_Q_OVERFLOW ", sizeof(dbgbuf));
-  if (event->mask & IN_UNMOUNT) sl_strlcat(dbgbuf, "IN_UNMOUNT ", sizeof(dbgbuf));
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		  dbgbuf, _("sh_fInotify_process"));
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static int sh_fInotify_process(struct inotify_event * event)
-{
-  int class;
-  int ftype;
-  int rdepth;
-  unsigned long check_flags;
-  char * filename;
-  extern int flag_err_debug;
-
-  if (flag_err_debug == S_TRUE)
-    {
-      sh_fInotify_logmask(event);
-    }
-
-  if (event->wd >= 0)
-    {
-      filename = sh_inotify_search_item(&sh_file_watches, event->wd, 
-					&class, &check_flags, &ftype, &rdepth);
-
-      if (filename)
-	{
-	  sh_fInotify_report(event, filename, class, check_flags, ftype, rdepth);
-	  SH_FREE(filename);
-	}
-      else if (sh.flag.inotify & SH_INOTIFY_NEEDINIT)
-	{
-	  return 1;
-	}
-      else if ((event->mask & IN_UNMOUNT) == 0 && (event->mask & IN_IGNORED) == 0)
-	{
-	  /* Remove watch ? Seems reasonable. */
-	  sh_inotify_rm_watch(NULL, NULL, event->wd);
-
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, event->wd, MSG_E_SUBGEN, 
-			  _("Watch removed: file path unknown"), 
-			  _("sh_fInotify_process"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	}
-    }
-  else if ((event->mask & IN_Q_OVERFLOW) != 0)
-    {
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_DOSCAN;   );
-      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_NEEDINIT; );
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, event->wd, MSG_E_SUBGEN, 
-		      _("Inotify queue overflow"), 
-		      _("sh_fInotify_process"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      return 1;
-    }
-
-  return 0;
-}
-
-void sh_fInotify_report_add(char * path, int class, unsigned long check_flags)
-{
-  if (S_FALSE == sh_ignore_chk_new(path))
-    {
-      int reported = 0;
-
-      sh_files_clear_file_reported(path);
-      
-      sh_files_search_file(path, &class, &check_flags, &reported);
-      
-      sh_files_filecheck (class, check_flags, path, NULL,
-			  &reported, 0);
-      if (SH_FFLAG_REPORTED_SET(reported))
-	sh_files_set_file_reported(path);
-    }
-  return;
-}
-
-
-static void sh_fInotify_report_miss(char * name, int level)
-{
-  char * tmp = sh_util_safe_name (name);
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  if (!sh_global_check_silent)
-    sh_error_handle (level, FIL__, __LINE__, 0, MSG_FI_MISS, tmp);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  ++sh.statistics.files_report;
-  SH_FREE(tmp);
-  return;
-}
-
-static int sh_fInotify_report_change (struct inotify_event * event, 
-				      char * path, char * filename,
-				      int class, unsigned long check_flags, int ftype)
-{
-  int    reported;
-  int ret;
-
-
-  if (S_FALSE == sh_ignore_chk_mod(path))
-    {
-      ret  = sh_files_search_file(path, &class, &check_flags, &reported);
-
-      if ((ret == 0) && (event->len > 0) && (ftype == SH_INOTIFY_FILE))
-	{
-	  ; /* do nothing, watch was for directory monitored as file only */
-	}
-      else
-	{
-	  sh_files_filecheck (class, check_flags, filename,
-			      (event->len > 0) ? event->name : NULL,
-			      &reported, 0);
-	}
-    }
-  return 0;
-}
-
-
-static int sh_fInotify_report_missing (struct inotify_event * event, 
-				       char * path,
-				       int class, unsigned long check_flags, int ftype)
-{
-  int    reported;
-  int isdir = (event->mask & IN_ISDIR);
-  int level = (class == SH_LEVEL_ALLIGNORE) ? 
-    ShDFLevel[class] : 
-    ShDFLevel[(isdir == 0) ? SH_ERR_T_FILE : SH_ERR_T_DIR];
-
-  if (S_FALSE == sh_ignore_chk_del(path))
-    {
-      if (0 != hashreport_missing(path, level))
-	{
-	  int ret = sh_files_search_file(path, &class, &check_flags, &reported);
-	  
-	  if ((ret == 0) && (event->len > 0) && (ftype == SH_INOTIFY_FILE))
-	    {
-	      ; /* do nothing, watch was for directory monitored as file only */
-	    }
-	  else
-	    {
-	      /* Removal of a directory triggers:
-	       * (1) IN_DELETE IN_ISDIR
-	       * (2) IN_DELETE_SELF
-	       */
-	      if ((event->mask & IN_DELETE_SELF) == 0)
-		sh_fInotify_report_miss(path, level);
-	    }
-	}
-    }
-
-  sh_hash_set_missing(path);
-
-  if (sh.flag.reportonce == S_TRUE)
-    sh_files_set_file_reported(path);
-
-  /* Move to 'dormant' list, if not file within directory. 
-   */
-  if (event->len == 0)
-    sh_inotify_rm_watch(&sh_file_watches, &sh_file_missing, event->wd);
-
-  return 0;
-}
-
-static int sh_fInotify_report_added (struct inotify_event * event, 
-				     char * path, char * filename,
-				     int class, unsigned long check_flags, 
-				     int ftype, int rdepth)
-{
-  if (S_FALSE == sh_ignore_chk_new(path))
-    {
-      int reported;
-      int ret;
-      int retD = 0;
-      int rdepthD = rdepth;
-      
-      sh_files_clear_file_reported(path);
-	  
-      ret = sh_files_search_file(path, &class, &check_flags, &reported);
-      
-      if ((ret == 0) && (event->len > 0) && (ftype == SH_INOTIFY_FILE))
-	{
-	  ; /* do nothing, watch was for directory monitored as file only */
-	}
-      else
-	{
-	  int classD = class;
-	  int reportedD = reported; 
-	  unsigned long check_flagsD = check_flags;
-	  
-	  if (event->mask & IN_ISDIR)
-	    {
-	      retD = sh_files_search_dir(path, &classD, &check_flagsD, 
-					 &reportedD, &rdepthD);
-
-	      if (retD != 0)
-		{
-		  if (ret == 0) /* because checked as file below */
-		    {
-		      class      = classD;
-		      check_flags = check_flagsD;
-		    }
-		}
-	      rdepthD -= 1; if (rdepthD < -1) rdepthD = -1;
-	    }
-	  
-	  sh_files_filecheck (class, check_flags, filename,
-			      (event->len > 0) ? event->name : NULL,
-			      &reported, 0);
-	  
-	  if (event->mask & IN_ISDIR)
-	    {
-	      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_INSCAN;   );
-	      /* Here we use classD because we check as directory now */
-	      sh_files_checkdir (classD, check_flagsD, rdepthD, 
-				 path, (event->len > 0) ? event->name : NULL);
-	      SH_INOTIFY_IFUSED( sh.flag.inotify &= ~SH_INOTIFY_INSCAN;  );
-	      SH_INOTIFY_IFUSED( sh.flag.inotify |= SH_INOTIFY_NEEDINIT; );
-	      sh_dirs_reset  ();
-	      sh_files_reset ();
-	    }
-	}
-      
-      if (SH_FFLAG_REPORTED_SET(reported))
-	sh_files_set_file_reported(path);
-      
-      if ((ret != 0) || (event->mask & IN_ISDIR))
-	{
-	  int inotify_type = SH_INOTIFY_FILE;
-	  
-	  if ((event->mask & IN_ISDIR) && (rdepthD >= 0))
-	    inotify_type = SH_INOTIFY_DIR;
-
-	  sh_inotify_add_watch(path, &sh_file_watches, &ret,
-			       class, check_flags, 
-			       inotify_type, 
-			       rdepthD);
-	}
-    }
-  return 0;
-}
-
-static int sh_fInotify_report(struct inotify_event * event, char * filename,
-			      int class, unsigned long check_flags, int ftype, int rdepth)
-{
-  char * fullpath = NULL;
-  char * path;
-
-  if (event->len > 0)
-    {
-      fullpath = sh_util_strconcat(filename, "/", event->name, NULL);
-      path = fullpath;
-    }
-  else
-    {
-      path = filename;
-    }
-
-  if ( (event->mask & (IN_ATTRIB|IN_MODIFY)) != 0)
-    {
-      sh_fInotify_report_change (event, path, filename,
-				 class, check_flags, ftype);
-    }
-  else if ((event->mask & (IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVED_FROM)) != 0)
-    {
-      sh_fInotify_report_missing (event, path,
-				  class, check_flags, ftype);
-   }
-  else if((event->mask & (IN_CREATE|IN_MOVED_TO)) != 0)
-    {
-      sh_fInotify_report_added (event, path, filename,
-				class, check_flags, 
-				ftype, rdepth);
-    }
-
-  if (fullpath)
-    SH_FREE(fullpath);
-
-  return 0;
-}
-
-
-#endif
-
-#endif
Index: trunk/src/sh_fifo.c
===================================================================
--- trunk/src/sh_fifo.c	(revision 591)
+++ trunk/src/sh_fifo.c	(revision 1)
@@ -32,7 +32,4 @@
 #include "sh_mem.h"
 #include "sh_unix.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-#include "sh_fifo.h"
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
@@ -40,159 +37,23 @@
 #endif
 
-#define SH_FIFO_TAGGED 1
-#define SH_FIFO_M_FAIL 2
-#define SH_FIFO_MARKED 4
-
-/* Prepare an email message and return it. Iterate over list on stack and
- * check for each if it is valid for recipient 'tag'. If yes, add to the
- * returned string.
- * okNull == False means that item->s_xtra must be defined
- */
-sh_string * tag_list (SH_FIFO * fifo, char * tag,
-		      int(*valid)(int, const char*, const char*, const void*),
-		      const void * info, int okNull)
-{
-  struct dlist * item;
-  sh_string * result = NULL;
-
-  if (fifo && fifo->fifo_cts > 0)
-    {
-      item = fifo->head_ptr;
-
-      while (item)
-	{
-	  /* Same recipient, or no recipient ( := all )
-	   */
-	  if ( (tag && item->s_xtra && 0 == strcmp(item->s_xtra, tag)) ||
-	       ((okNull == S_TRUE) && !(item->s_xtra)) )
-	    {
-	      if (valid == NULL)
-		{
-		  item->transact |= SH_FIFO_TAGGED;
-		}
-	      else
-		{
-		  /* level, message, recipient, list */
-		  if (!valid(item->i_xtra, item->data, tag, info))
-		    goto skipped;
-		  item->transact |= SH_FIFO_TAGGED;
-		}
-	      if (!result)
-		{
-		  result = sh_string_new_from_lchar(item->data, strlen(item->data));
-		}
-	      else
-		{
-		  result = sh_string_cat_lchar(result, "\r\n", 2);
-		  result = sh_string_add_from_char(result, item->data);
-		}
-	    }
-	skipped:
-	  item = item->next;
-	}
-    }
-  return result;
-}
-
-void rollback_list (SH_FIFO * fifo)
-{
-  struct dlist * item;
-
-  if (fifo && fifo->fifo_cts > 0)
-    {
-      item = fifo->head_ptr;
-
-      while (item && 0 != (item->transact & SH_FIFO_TAGGED))
-	{
-	  item->transact |= SH_FIFO_M_FAIL;
-	  item = item->next;
-	}
-    }
-}
-
-void mark_list (SH_FIFO * fifo)
-{
-  struct dlist * item;
-
-  if (fifo && fifo->fifo_cts > 0)
-    {
-      item = fifo->head_ptr;
-
-      while (item && 0 != (item->transact & SH_FIFO_TAGGED))
-	{
-	  item->transact |= SH_FIFO_MARKED;
-	  item = item->next;
-	}
-    }
-}
-
-void reset_list (SH_FIFO * fifo)
-{
-  struct dlist * item;
-
-  if (fifo && fifo->fifo_cts > 0)
-    {
-      item = fifo->head_ptr;
-
-      while (item)
-	{
-	  item->transact = 0;
-	  item = item->next;
-	}
-    }
-}
-
-int commit_list (SH_FIFO * fifo)
-{
-  struct dlist * item;
-  struct dlist * getit;
-  int    retval = 0;
-
-  if (fifo && fifo->fifo_cts > 0)
-    {
-      item = fifo->head_ptr;
-
-      while (item)
-	{
-	  getit = NULL;
-
-	  if ( 0 != (item->transact & SH_FIFO_MARKED) && /* sent              */
-	       0 == (item->transact & SH_FIFO_M_FAIL) )  /* no recipient fail */
-	    {
-	      if (item == fifo->head_ptr)
-		fifo->head_ptr   = item->next;
-	      if (item == fifo->tail_ptr)
-		fifo->tail_ptr   = item->prev;
-	      if (item->prev)
-		item->prev->next = item->next;
-	      if (item->next)
-		item->next->prev = item->prev;
-	      --(fifo->fifo_cts);
-	      getit = item;
-	    }
-	  item  = item->next;
-
-	  /* Delete it
-	   */
-	  if (getit)
-	    {
-	      size_t len = sl_strlen(getit->data);
-	      memset(getit->data, 0, len);
-	      if (NULL != sl_strstr (getit->data, _("LOGKEY")))
-		MUNLOCK(getit->data, (len+1));
-	      if (getit->s_xtra)
-		SH_FREE(getit->s_xtra);
-	      SH_FREE(getit->data);
-	      SH_FREE(getit);
-	      ++retval;
-	    }
-	}
-    }
-  return retval;
-}
+#define SH_FIFO_MAX 128
+
+struct dlist {
+  /*@null@*//*@dependent@*/ struct dlist * next;
+  char         * data;
+  /*@null@*//*@dependent@*/ struct dlist * prev;
+};
+
+typedef struct fifo_str {
+  /*@null@*//*@dependent@*/ struct dlist * head_ptr;
+  /*@null@*//*@dependent@*/ struct dlist * tail_ptr;
+  int            fifo_cts;
+} SH_FIFO;
+
+
 
 /* push an item on the head of the list
  */
-int push_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str)
+int push_list (SH_FIFO * fifo, char * indat)
 {
   struct dlist * item;
@@ -218,18 +79,14 @@
     }
   item            = SH_ALLOC(sizeof(struct dlist));
-  item->data      = SH_ALLOC(len+1);
+  /*@i@*/ item->data      = SH_ALLOC(len+1);
   
   if (NULL != sl_strstr (indat, _("LOGKEY")))
-    MLOCK(item->data, (len+1));
-
-  sl_strlcpy (item->data, indat, len+1);
+    {
+      MLOCK(item->data, (len+1));
+      ;
+    }
+
+  strcpy (item->data, indat);                   /* known to fit  */
   item->data[len] = '\0';
-
-  item->i_xtra = in_i;
-  if (in_str)
-    item->s_xtra = sh_util_strdup(in_str);
-  else
-    item->s_xtra = NULL;
-  item->transact = 0;
 
   if (fifo->tail_ptr == NULL)
@@ -240,5 +97,5 @@
   else
     {
-      fifo->head_ptr->prev = item;
+      /*@i@*/ fifo->head_ptr->prev = item;
       item->prev           = NULL;
     }
@@ -254,5 +111,5 @@
 /* push an item on the tail of the list
  */
-int push_tail_list (SH_FIFO * fifo, const char * indat, int in_i, const char * in_str)
+int push_tail_list (SH_FIFO * fifo, char * indat)
 {
   struct dlist * item;
@@ -278,18 +135,14 @@
 
   item            = SH_ALLOC(sizeof(struct dlist));
-  item->data      = SH_ALLOC(len+1);
+  /*@i@*/item->data      = SH_ALLOC(len+1);
 
   if (NULL != sl_strstr (indat, _("LOGKEY")))
-    MLOCK(item->data, (len+1));
-
-  sl_strlcpy (item->data, indat, len+1);
+    {
+      MLOCK(item->data, (len+1));
+      ;
+    }
+
+  strcpy (item->data, indat);                          /* known to fit  */
   item->data[len] = '\0';
-
-  item->i_xtra = in_i;
-  if (in_str)
-    item->s_xtra = sh_util_strdup(in_str);
-  else
-    item->s_xtra = NULL;
-  item->transact = 0;
 
   if (fifo->head_ptr == NULL)
@@ -309,5 +162,5 @@
   ++(fifo->fifo_cts);
 
-  SL_RETURN((fifo->fifo_cts), _("push_tail_list"));
+  SL_RETURN((0), _("push_tail_list"));
 }
 
@@ -342,13 +195,15 @@
   len         = sl_strlen(getit->data);
   retval      = SH_ALLOC(len+1);
-  sl_strlcpy (retval, getit->data, len+1);
+  strcpy (retval, getit->data);                        /* known to fit  */
+  retval[len] = '\0';
  
   memset(getit->data, 0, len);
 
   if (NULL != sl_strstr (retval, _("LOGKEY")))
-    MUNLOCK(getit->data, (len+1));
-
-  if (getit->s_xtra)
-    SH_FREE(getit->s_xtra);
+    {
+      MUNLOCK(getit->data, (len+1));
+      ;
+    }
+
   SH_FREE(getit->data);
   SH_FREE(getit);
@@ -360,82 +215,4 @@
 
 
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_fifo (CuTest *tc) {
-
-  SH_FIFO ff;
-  int ret;
-  char * p;
-
-  fifo_init(&ff);
-
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrEquals(tc, NULL, p);
-
-  /* first sequence */
-  ret = sh_fifo_push(&ff, "one");
-  CuAssertIntEquals(tc,1,ret);
-  ret = sh_fifo_push(&ff, "two");
-  CuAssertIntEquals(tc,2,ret);
-  ret = sh_fifo_push(&ff, "three");
-  CuAssertIntEquals(tc,3,ret);
-
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"one", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"two", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"three", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrEquals(tc, NULL, p);
-
-  /* second sequence */
-  ret = sh_fifo_push(&ff, "one");
-  CuAssertIntEquals(tc,1,ret);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"one", p);
-  ret = sh_fifo_push_tail(&ff, "one");
-  CuAssertIntEquals(tc,1,ret);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"one", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrEquals(tc, NULL, p);
-
-  /* third sequence */
-  ret = sh_fifo_push(&ff, "one");
-  CuAssertIntEquals(tc,1,ret);
-  ret = sh_fifo_push(&ff, "two");
-  CuAssertIntEquals(tc,2,ret);
-  ret = sh_fifo_push(&ff, "three");
-  CuAssertIntEquals(tc,3,ret);
-
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"one", p);
-  ret = sh_fifo_push_tail(&ff, p);
-  CuAssertIntEquals(tc,3,ret);
-
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"one", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"two", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc,"three", p);
-  p = sh_fifo_pop(&ff);
-  CuAssertPtrEquals(tc, NULL, p);
-}
-
-#endif
-
-
-
-
+
+
Index: trunk/src/sh_files.c
===================================================================
--- trunk/src/sh_files.c	(revision 591)
+++ trunk/src/sh_files.c	(revision 1)
@@ -20,42 +20,7 @@
 #include "config_xor.h"
 
-#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE) && defined(HAVE_DIRENT_H) && defined(HAVE_SCANDIR)
-
-/* Linux */
-#if defined(__linux__)
-#define _XOPEN_SOURCE 700
-#define SH_USE_SCANDIR 1
-
-/* FreeBSD */
-#elif defined(__FreeBSD__)
-
-#if __FreeBSD__ >= 8
-#define __XSI_VISIBLE 700
-#define SH_USE_SCANDIR 1
-#endif
-
-/* OpenBSD */
-#elif defined(__OpenBSD__)
-#define __POSIX_VISIBLE 200809
-#define SH_USE_SCANDIR 1
-
-#elif defined(__NetBSD__)
-#define _NETBSD_SOURCE
-#define SH_USE_SCANDIR 1
-
-/* other os */
-#else
-#define _XOPEN_SOURCE 500
-
-#endif
-
-#elif defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
-#define _XOPEN_SOURCE 500
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 #include <limits.h>
 
@@ -66,14 +31,7 @@
 #include <sys/types.h>
 #include <unistd.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#if !defined(O_NOATIME)
-#if defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__PPC__))
-#define O_NOATIME 01000000
-#endif
-#endif
 
 #include <utime.h>
+
 
 #ifdef HAVE_DIRENT_H
@@ -93,13 +51,8 @@
 #endif
 #endif
-#define NEED_ADD_DIRENT
 
 #ifdef HAVE_GLOB_H
 #include <glob.h>
 #endif
-#ifdef HAVE_FNMATCH_H
-#include <fnmatch.h>
-#endif
-
 
 #include "samhain.h"
@@ -107,5 +60,4 @@
 #if (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)) 
 
-#include "sh_pthread.h"
 #include "sh_error.h"
 #include "sh_utils.h"
@@ -115,170 +67,15 @@
 #include "sh_hash.h"
 #include "sh_ignore.h"
-#include "sh_inotify.h"
 #include "zAVLTree.h"
-#include "sh_dbIO.h"
 
 #undef  FIL__
 #define FIL__  _("sh_files.c")
 
-extern sh_watches sh_file_watches;
-
-static char * sh_files_C_dequote (char * s, size_t * length)
-{
-  size_t i, len = *length;
-  int    flag = 0;
-  char  *p, *q, *po, *pend;
-  
-  /* search for backslash
-   */
-  for (i = 0; i < len; ++i)
-    {
-      if (s[i] == '\\')
-	{
-	  flag = 1;
-	  break;
-	}
-    }
-
-  if (flag == 0 || *s == '\0')
-    return s;
-
-  po = SH_ALLOC(len+1); *po = '\0'; p = po; pend = &po[len];
-
-  q = s;
-
-  do
-    {
-      if (*q == '\\')
-	{
-	  ++q;
-
-	  if (*q == '\0')
-	    { *p = *q; flag = 0; break; }
-	  else if (*q == 'a')
-	    { *p = '\a'; ++p; ++q; }
-	  else if (*q == 'b')
-	    { *p = '\b'; ++p; ++q; }
-	  else if (*q == 'f')
-	    { *p = '\f'; ++p; ++q; }
-	  else if (*q == 'n')
-	    { *p = '\n'; ++p; ++q; }
-	  else if (*q == 'r')
-	    { *p = '\r'; ++p; ++q; }
-	  else if (*q == 't')
-	    { *p = '\t'; ++p; ++q; }
-	  else if (*q == 'v')
-	    { *p = '\v'; ++p; ++q; }
-	  else if (*q == '\\')
-	    { *p = '\\'; ++p; ++q; }
-	  else if (*q == '\'')
-	    { *p = '\''; ++p; ++q; }
-	  else if (*q == '"')
-	    { *p = '"';  ++p; ++q; }
-	  else if (*q == 'x')
-	    {
-	      if (isxdigit((int) q[1]) && isxdigit((int) q[2]))
-		{
-		  /* hexadecimal value following */
-		  unsigned char cc = (16 * sh_util_hexchar(q[1])) 
-		    + sh_util_hexchar(q[2]);
-		  *p = (char) cc;
-		  ++p; q += 3;
-		}
-	      else
-		{
-		  *p = '\0'; flag = 0; break;
-		}
-	    }
-	  else if (isdigit((int)*q))
-	    {
-	      if (isdigit((int) q[1]) && q[1] < '8' && 
-		  isdigit((int) q[2]) && q[2] < '8')
-		{
-		  /* octal value following */
-		  char tmp[4];  unsigned char cc;
-		  tmp[0] = *q; ++q; tmp[1] = *q; ++q; tmp[2] = *q; ++q; 
-		  tmp[3] = '\0';
-		  cc = strtol(tmp, NULL, 8);
-		  *p = (char) cc; ++p;
-		}
-	      else
-		{
-		  *p = '\0'; flag = 0; break;
-		}
-	    }
-	  else
-	    {
-	      /* invalid escape sequence */
-	      *p = '\0'; flag = 0; break;
-	    }
-	}
-      else
-	{
-	  *p = *q; 
-	  ++p; ++q;
-	}
-    } while (*q && p <= pend);
-
-  SL_REQUIRE (p <= pend, _("p <= pend"));
-
-  if (flag)
-    {
-      *p = '\0';
-      *length = strlen(po);
-    }
-  else
-    {
-      SH_FREE(po);
-      po = NULL;
-      *length = 0;
-    }
-
-  SL_REQUIRE (*length <= len, _("*length <= len"));
-
-  SH_FREE(s);
-  return po;
-}
-
-char * sh_files_parse_input(const char * str_s, size_t * len)
-{
-  char  * p;
-  
-  if (!str_s || *str_s == '\0')
-    return NULL;
-
-  *len = sl_strlen(str_s);
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    {
-      size_t addspace = sh_dbIO_get_rootfs_len();
-      if (addspace != 0 && S_TRUE == sl_ok_adds (*len, addspace))
-	*len += addspace;
-    }
-  
-  if ( (str_s[0] == '"'  && str_s[*len-1] == '"' ) ||
-       (str_s[0] == '\'' && str_s[*len-1] == '\'') )
-    {
-      if (*len < 3)
-	return NULL;
-      --(*len);
-      p = sh_util_strdup_l(&str_s[1], *len);
-      p[*len-1] = '\0';
-      --(*len);
-    }
-  else
-    {
-      p = sh_util_strdup_l(str_s, *len);
-    }
-
-  p = sh_files_C_dequote(p, len);
-
-  return p;
-}
-
+extern int safe_logger (int signal, int method, pid_t thepid);
 
 extern int flag_err_debug;
 extern int flag_err_info;
 
-int sh_files_reportonce(const char * c)
+int sh_files_reportonce(char * c)
 {
   int i;
@@ -289,5 +86,5 @@
 }
     
-int sh_files_fulldetail(const char * c)
+int sh_files_fulldetail(char * c)
 {
   int i;
@@ -307,6 +104,4 @@
   long    NumCDev;
   long    NumBDev;
-  long    NumDoor;
-  long    NumPort;
   long    NumAll;
   long    TotalBytes;
@@ -317,9 +112,9 @@
   char                  * name;
   int                     class;
-  unsigned long           check_flags;
+  unsigned long           check_mask;
   int                     rdepth;
   short                   checked;
   short                   childs_checked;
-  short                   is_reported;
+  short                   reported;
   /* struct dirstack_entry * next; */
 } dirstack_t;
@@ -338,5 +133,4 @@
     here = (dirstack_t *) inptr;
 
-  /* cppcheck-suppress uninitStructMember */
   if (here->name != NULL)
     SH_FREE(here->name);
@@ -354,10 +148,4 @@
 }
 
-#define SH_LIST_FILE 0
-#define SH_LIST_DIR1 1
-#define SH_LIST_DIR2 2
-
-
-static int which_dirList = SH_LIST_DIR1;
 
 static zAVLTree * zdirListOne   = NULL;
@@ -365,13 +153,14 @@
 static zAVLTree * zfileList     = NULL;
 
-SH_MUTEX_STATIC(mutex_zfiles,      PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_STATIC(mutex_zglob,       PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_RECURSIVE(mutex_zdirs);
-
-static int        sh_files_fullpath  (const char * testdir, 
-				      const char * d_name, 
+
+static int        sh_files_fullpath  (char * testdir, char * d_name, 
 				      char * statpath);
-static int        sh_files_pushdir   (int class, const char * str_s);
-static int        sh_files_pushfile  (int class, const char * str_s);
+static int        sh_files_pushdir   (int class, char * str_s);
+static int        sh_files_pushfile  (int class, char * str_s);
+static int        sh_files_checkdir  (int class, int rdepth, char * dirName,
+				      char * relativeName);
+static ShFileType sh_files_filecheck (int class, char * dirName, 
+				      char * fileName, int * reported,
+				      int rsrcflag);
 
 static long MaxRecursionLevel = 0;
@@ -379,5 +168,5 @@
 /* set default recursion level
  */
-int sh_files_setrecursion (const char * flag_s)
+int sh_files_setrecursion (char * flag_s)
 {
   long flag = 0;
@@ -389,5 +178,5 @@
     SL_RETURN((-1), _("sh_files_setrecursion"));
 
-  if (sh.flag.opts == S_TRUE)  
+  if (sh.flag.opts == 1)  
     reject = 1;
 
@@ -403,120 +192,4 @@
 }
 
-static int handle_filecheck_ret(dirstack_t * ptr, char * tmp_in, int status)
-{
-  int fcount = 0;
-  char * tmp;
-
-  if (!tmp_in)
-    tmp = sh_util_safe_name (ptr->name);
-  else
-    tmp = tmp_in;
-
-  if (status == SH_FILE_UNKNOWN && (!SH_FFLAG_REPORTED_SET(ptr->is_reported)))
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<file: %s> status=<%d>\n"), 
-	    tmp, status));
-      
-      if ( sh.flag.checkSum == SH_CHECK_INIT  || 
-	   sh_hash_have_it (ptr->name) >= 0)
-	{
-	  if (S_FALSE == sh_ignore_chk_del(ptr->name))
-	    {
-	      if (0 != hashreport_missing(ptr->name, 
-					  (ptr->class == SH_LEVEL_ALLIGNORE) ? 
-					  ShDFLevel[ptr->class] : 
-					  ShDFLevel[SH_ERR_T_FILE])) {
-		if (tmp == NULL) 
-		  tmp = sh_util_safe_name (ptr->name);
-		if (!sh_global_check_silent)
-		  sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
-				   ShDFLevel[ptr->class] : 
-				   ShDFLevel[SH_ERR_T_FILE],
-				   FIL__, __LINE__, 0, MSG_FI_MISS,
-				   tmp);
-		++sh.statistics.files_report;
-	      }
-	    }
-	}
-      else /* not there at init, and still missing */
-	{
-	  if (tmp == NULL) 
-	    tmp = sh_util_safe_name (ptr->name);
-	  sh_error_handle (SH_ERR_NOTICE,
-			   FIL__, __LINE__, 0,
-			   MSG_FI_FAIL,
-			   tmp);
-	}
-
-      if (sh.flag.checkSum != SH_CHECK_INIT) 
-	sh_hash_set_missing(ptr->name);
-
-      if (sh.flag.reportonce == S_TRUE)
-	SET_SH_FFLAG_REPORTED(ptr->is_reported);
-    }
-  else 
-    {
-      /* exists (status >= 0), but was missing (reported == TRUE)
-       */
-      if (status != SH_FILE_UNKNOWN && SH_FFLAG_REPORTED_SET(ptr->is_reported))
-	{
-	  CLEAR_SH_FFLAG_REPORTED(ptr->is_reported);
-	  sh_hash_clear_flag(ptr->name, SH_FFLAG_ENOENT);
-	}
-      
-      /* Catchall
-       */
-      else if (status == SH_FILE_UNKNOWN)
-	{
-	  /* Thu Mar  7 15:09:40 CET 2002 Make sure missing file
-	   * is reported if ptr->reported == S_TRUE because the
-	   * file has been added.
-	   */
-	  if (sh_hash_have_it (ptr->name) >= 0 && 
-	      !SH_FFLAG_REPORTED_SET(ptr->is_reported))
-	    {
-	      if (S_FALSE == sh_ignore_chk_del(ptr->name))
-		{
-		  if (0 != hashreport_missing(ptr->name, 
-					      (ptr->class == SH_LEVEL_ALLIGNORE) ? 
-					      ShDFLevel[ptr->class] : 
-					      ShDFLevel[SH_ERR_T_FILE])) {
-		    if (tmp == NULL) 
-		      tmp = sh_util_safe_name (ptr->name);
-		    if (!sh_global_check_silent)
-		      sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE)? 
-				       ShDFLevel[ptr->class] : 
-				       ShDFLevel[SH_ERR_T_FILE],
-				       FIL__, __LINE__, 0, MSG_FI_MISS,
-				       tmp);
-		    ++sh.statistics.files_report;
-		  }
-		}
-
-	      /* delete from database
-	       */
-	      if (sh.flag.checkSum != SH_CHECK_INIT) 
-		sh_hash_set_missing(ptr->name);
-	    }
-	  else
-	    {
-	      if (tmp == NULL) 
-		tmp = sh_util_safe_name (ptr->name);
-	      sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, 0,
-			       MSG_FI_FAIL,
-			       tmp);
-	      if (sh.flag.checkSum != SH_CHECK_INIT)
-		sh_hash_set_visited_true(ptr->name);
-	    }
-	}
-      
-      ++fcount;
-    }
-  if (!tmp_in)
-    SH_FREE(tmp);
-
-  return fcount;
-}
-
 
 unsigned long sh_files_chk ()
@@ -529,7 +202,6 @@
 
   dirstack_t * ptr;
-  char       * dir;
+  char       * base;
   char       * file;
-  int          tmp_reported;
   
   SL_ENTER(_("sh_files_chk"));
@@ -545,6 +217,6 @@
       if (ptr->checked == S_FALSE)
 	{
-	  dir  = sh_util_dirname (ptr->name);
-	  file = sh_util_basename (ptr->name);
+	  base = sh_util_basename (ptr->name);
+	  file = sh_util_filename (ptr->name);
 #if defined(WITH_TPT)
 	  tmp = sh_util_safe_name (ptr->name);
@@ -552,33 +224,124 @@
 
 	  
-	  if (flag_err_info == S_TRUE)
+	  if (flag_err_info == SL_TRUE)
 	    {
-	      char pstr[32];
 #if !defined(WITH_TPT)
 	      tmp = sh_util_safe_name (ptr->name);
 #endif
-	      sl_strlcpy(pstr, sh_hash_getpolicy(ptr->class), sizeof(pstr));
-	      sh_error_handle ((-1),  FIL__, __LINE__, 0, 
-			       MSG_FI_CHK, pstr, tmp);
+	      sh_error_handle ((-1),  FIL__, __LINE__, 0, MSG_FI_CHK,
+			       tmp);
 	    }
 
-	  if ((sh.flag.inotify & SH_INOTIFY_INSCAN) != 0)
-	    {
-	      sh_inotify_add_watch_later(ptr->name, &sh_file_watches, NULL,
-					 ptr->class, ptr->check_flags, 
-					 SH_INOTIFY_FILE, 0);
-	    }
-
 	  BREAKEXIT(sh_files_filecheck);
-	  tmp_reported = ptr->is_reported; /* fix aliasing warning */ 
-	  status = sh_files_filecheck (ptr->class, ptr->check_flags, dir, file, 
-				       &tmp_reported, 0);
-	  ptr->is_reported = tmp_reported;
+	  status = sh_files_filecheck (ptr->class, base, file, 
+				       (int *) &(ptr->reported), 0);
 	  
 	  TPT(( 0, FIL__, __LINE__, 
 		_("msg=<filecheck complete: %s> status=<%d> reported=<%d>\n"), 
-		tmp, status, ptr->is_reported));
-
-	  fcount += handle_filecheck_ret(ptr, tmp, status);
+		tmp, status, ptr->reported));
+
+	  if (status == SH_FILE_UNKNOWN && ptr->reported == S_FALSE) 
+	    {
+	      TPT(( 0, FIL__, __LINE__, _("msg=<file: %s> status=<%d>\n"), 
+		    tmp, status));
+
+	      if ( sh.flag.checkSum == SH_CHECK_INIT  || 
+		  sh_hash_have_it (ptr->name) >= 0)
+		{
+		  if (S_FALSE == sh_ignore_chk_del(ptr->name))
+		    {
+		      if (0 != hashreport_missing(ptr->name, 
+						  (ptr->class == SH_LEVEL_ALLIGNORE) ? 
+						  ShDFLevel[ptr->class] : 
+						  ShDFLevel[SH_ERR_T_FILE])) {
+			if (tmp == NULL) 
+			  tmp = sh_util_safe_name (ptr->name);
+			sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
+					 ShDFLevel[ptr->class] : 
+					 ShDFLevel[SH_ERR_T_FILE],
+					 FIL__, __LINE__, 0, MSG_FI_MISS,
+					 tmp);
+		      }
+		    }
+		}
+	      else /* not there at init, and still missing */
+		{
+		  if (tmp == NULL) 
+		    tmp = sh_util_safe_name (ptr->name);
+		  sh_error_handle (SH_ERR_NOTICE,
+				   FIL__, __LINE__, 0,
+				   MSG_FI_FAIL,
+				   tmp);
+		}
+#ifndef REPLACE_OLD
+	      /* this will tell that we have seen the file, and thus prevent
+	       * deletion from the database, resulting in an incomplete
+	       * message when the file reappears
+	       */
+	      if (sh.flag.checkSum != SH_CHECK_INIT) 
+		sh_hash_set_visited_true(ptr->name);
+#else
+	      if (sh.flag.checkSum != SH_CHECK_INIT) 
+		sh_hash_set_missing(ptr->name);
+#endif
+	      if (sh.flag.reportonce == S_TRUE)
+		ptr->reported = S_TRUE;
+	    }
+	  else 
+	    {
+	      /* exists (status >= 0), but was missing (reported == TRUE)
+	       */
+	      if (status != SH_FILE_UNKNOWN && ptr->reported == S_TRUE)
+		{
+		  ptr->reported = S_FALSE;
+		}
+	      /* Catchall
+	       */
+	      else if (status == SH_FILE_UNKNOWN)
+		{
+		  /* Thu Mar  7 15:09:40 CET 2002 Make sure missing file
+		   * is reported if ptr->reported == S_TRUE because the
+		   * file has been added.
+		   */
+		  if (sh_hash_have_it (ptr->name) >= 0)
+		    {
+		      if (S_FALSE == sh_ignore_chk_del(ptr->name))
+			{
+			  if (0 != hashreport_missing(ptr->name, 
+						      (ptr->class == SH_LEVEL_ALLIGNORE) ? 
+						      ShDFLevel[ptr->class] : 
+						      ShDFLevel[SH_ERR_T_FILE])) {
+			    if (tmp == NULL) 
+			      tmp = sh_util_safe_name (ptr->name);
+			    sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE)? 
+					     ShDFLevel[ptr->class] : 
+					     ShDFLevel[SH_ERR_T_FILE],
+					     FIL__, __LINE__, 0, MSG_FI_MISS,
+					     tmp);
+			  }
+			}
+#ifndef REPLACE_OLD
+		      if (sh.flag.checkSum != SH_CHECK_INIT) 
+			sh_hash_set_visited_true(ptr->name);
+#else
+		      /* delete from database
+		       */
+		      if (sh.flag.checkSum != SH_CHECK_INIT) 
+			sh_hash_set_missing(ptr->name);
+#endif
+		    }
+		  else
+		    {
+		      if (tmp == NULL) 
+			tmp = sh_util_safe_name (ptr->name);
+		      sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, 0,
+				       MSG_FI_FAIL,
+				       tmp);
+		      if (sh.flag.checkSum != SH_CHECK_INIT)
+			sh_hash_set_visited_true(ptr->name);
+		    }
+		}
+	      ++fcount;
+	    }
 	  
 	  if (tmp != NULL)
@@ -587,8 +350,6 @@
 	      tmp = NULL;
 	    }
-	  if (file)
-	    SH_FREE(file);
-	  if (dir)
-	    SH_FREE(dir);
+	  SH_FREE(file);
+	  SH_FREE(base);
 
 	  ptr->checked = S_TRUE;
@@ -599,116 +360,10 @@
 }
 
-static zAVLTree * fileTree = NULL;
-static zAVLTree * dirTree  = NULL;
-
-static void clear_lists()
-{
-  if (fileTree) {
-    zAVL_string_reset(fileTree);
-    fileTree  = NULL;
-  }
-  if (dirTree) {
-    zAVL_string_reset(dirTree);
-    dirTree  = NULL;
-  }
-  return;
-}
-
-static void add_to_filelist(zAVLTree * tree)
-{
-  dirstack_t * ptr;
-  zAVLCursor   avlcursor;
-
-  SL_ENTER(_("add_to_filelist"));
-
-  SH_MUTEX_LOCK(mutex_zfiles);
-  for (ptr = (dirstack_t *) zAVLFirst(&avlcursor, tree); ptr;
-       ptr = (dirstack_t *) zAVLNext(&avlcursor))
-    zAVL_string_set (&fileTree, ptr->name);
-  SH_MUTEX_UNLOCK(mutex_zfiles);
-  SL_RET0(_("add_to_filelist"));
-}
-static void add_to_dirlist(zAVLTree * tree)
-{
-  dirstack_t * ptr;
-  zAVLCursor   avlcursor;
-
-  SL_ENTER(_("add_to_dirlist"));
-
-  SH_MUTEX_LOCK(mutex_zfiles);
-  for (ptr = (dirstack_t *) zAVLFirst(&avlcursor, tree); ptr;
-       ptr = (dirstack_t *) zAVLNext(&avlcursor))
-    zAVL_string_set (&dirTree, ptr->name);
-  SH_MUTEX_UNLOCK(mutex_zfiles);
-  SL_RET0(_("add_to_dirlist"));
-}
-char * sh_files_findfile(const char * path)
-{
-  return zAVL_string_get (fileTree, path);
-}
-
-void * sh_dummy_621_candidate;
-
-static char * intern_find_morespecific_dir(zAVLTree * tree, 
-					   const char * path, size_t * len)
-{
-  dirstack_t * ptr;
-  zAVLCursor   avlcursor;
-  size_t       l_path = strlen(path);
-  size_t       l_name;
-  char *       candidate = NULL;
-  volatile size_t       l_candidate = 0;
-  
-  if (NULL == tree)
-    return NULL;
-
-  sh_dummy_621_candidate = (void *) &candidate;
-
-  SH_MUTEX_LOCK(mutex_zfiles);
-  for (ptr = (dirstack_t *) zAVLFirst(&avlcursor, tree); ptr;
-       ptr = (dirstack_t *) zAVLNext(&avlcursor))
-    {
-      l_name = strlen(ptr->name);
-      if (l_name <= l_path)
-	{
-	  if (0 == strncmp(ptr->name, path, l_name))
-	    {
-	      if ((l_name == l_path) || (path[l_name] == '/'))
-		{
-		  if (!candidate || (l_candidate < l_name))
-		    {
-		      candidate = ptr->name;
-		      l_candidate = l_name;
-		      *len = l_candidate;
-		    }
-		}
-	    }
-	}
-    }
-  SH_MUTEX_UNLOCK(mutex_zfiles);
-  return candidate;
-}
-char * sh_files_find_mostspecific_dir(const char * path)
-{
-  size_t l_one = 0;
-  size_t l_two = 0;
-  char * one;
-  char * two;
-
-  one = intern_find_morespecific_dir(zdirListOne, path, &l_one);
-  two = intern_find_morespecific_dir(zdirListTwo, path, &l_two);
-
-  if      (l_one > l_two) return one;
-  else                    return two;
-}
-
 int sh_files_delfilestack ()
 {
   SL_ENTER(_("sh_files_delfilestack"));
 
-  SH_MUTEX_LOCK(mutex_zfiles);
   zAVLFreeTree (zfileList, free_dirstack);
   zfileList = NULL;
-  SH_MUTEX_UNLOCK(mutex_zfiles);
 
   SL_RETURN(0, _("sh_files_delfilestack"));
@@ -729,8 +384,5 @@
 	    ptr->rdepth = MaxRecursionLevel;
 	  }
-
-	if ( (ptr->rdepth      == (-1)) && 
-	     (ptr->class       == SH_LEVEL_ALLIGNORE) && 
-	     (sh.flag.checkSum != SH_CHECK_INIT))
+	if (ptr->rdepth == (-1) && sh.flag.checkSum != SH_CHECK_INIT)
 	  hash_remove_tree (ptr->name);
       }
@@ -741,16 +393,6 @@
 int sh_files_setrec ()
 {
-  volatile int ret;
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
-  clear_lists();
-  add_to_dirlist(zdirListOne);
-  add_to_dirlist(zdirListTwo);
-  add_to_filelist(zfileList);
   sh_files_setrec_int(zdirListOne);
-  ret = sh_files_setrec_int(zdirListTwo);
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-
-  return ret;
+  return sh_files_setrec_int(zdirListTwo);
 }
 
@@ -766,9 +408,6 @@
 int sh_files_deldirstack ()
 {
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
   zdirListOne = sh_files_deldirstack_int(zdirListOne);
   zdirListTwo = sh_files_deldirstack_int(zdirListTwo);
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
   return 0;
 }
@@ -781,9 +420,8 @@
   SL_ENTER(_("sh_files_reset"));
 
-  SH_MUTEX_LOCK(mutex_zfiles);
   for (ptr = (dirstack_t *) zAVLFirst(&avlcursor, zfileList); ptr;
        ptr = (dirstack_t *) zAVLNext(&avlcursor))
     ptr->checked = 0;
-  SH_MUTEX_UNLOCK(mutex_zfiles);
+
   SL_RET0(_("sh_files_reset"));
 }
@@ -797,6 +435,4 @@
   SL_ENTER(_("sh_dirs_reset"));
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
   for (ptr = (dirstack_t *) zAVLFirst(&avlcursor1, zdirListOne); ptr;
        ptr = (dirstack_t *) zAVLNext(&avlcursor1))
@@ -806,5 +442,4 @@
        ptr = (dirstack_t *) zAVLNext(&avlcursor2))
     ptr->checked = 0;
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
 
   SL_RET0(_("sh_dirs_reset"));
@@ -812,61 +447,47 @@
 
 
-int sh_files_pushfile_prelink (const char * str_s)
+int sh_files_pushfile_prelink (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_PRELINK, str_s));
 }
 
-int sh_files_pushfile_user0 (const char * str_s)
+int sh_files_pushfile_user0 (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_USER0, str_s));
 }
 
-int sh_files_pushfile_user1 (const char * str_s)
+
+int sh_files_pushfile_user1 (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_USER1, str_s));
 }
 
-int sh_files_pushfile_user2 (const char * str_s)
-{
-  return (sh_files_pushfile (SH_LEVEL_USER2, str_s));
-}
-
-int sh_files_pushfile_user3 (const char * str_s)
-{
-  return (sh_files_pushfile (SH_LEVEL_USER3, str_s));
-}
-
-int sh_files_pushfile_user4 (const char * str_s)
-{
-  return (sh_files_pushfile (SH_LEVEL_USER4, str_s));
-}
-
-
-int sh_files_pushfile_ro (const char * str_s)
+
+int sh_files_pushfile_ro (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_READONLY, str_s));
 }
 
-int sh_files_pushfile_attr (const char * str_s)
+int sh_files_pushfile_attr (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_ATTRIBUTES, str_s));
 }
 
-int sh_files_pushfile_log (const char * str_s)
+int sh_files_pushfile_log (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_LOGFILES, str_s));
 }
 
-int sh_files_pushfile_glog (const char * str_s)
+int sh_files_pushfile_glog (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_LOGGROW, str_s));
 }
 
-int sh_files_pushfile_noig (const char * str_s)
+int sh_files_pushfile_noig (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_NOIGNORE, str_s));
 }
 
-int sh_files_pushfile_allig (const char * str_s)
+int sh_files_pushfile_allig (char * str_s)
 {
   return (sh_files_pushfile (SH_LEVEL_ALLIGNORE, str_s));
@@ -891,13 +512,11 @@
 /* set mask(class)
  */
-static int sh_files_parse_mask (unsigned long * mask, const char * str)
-{
-  int l = 0, i = 0, act = 0, k = 0;
+static int sh_files_parse_mask (unsigned long * mask, char * str)
+{
+  int l, i = 0, act = 0, k = 0;
   char  myword[64];
   
   SL_ENTER(_("sh_files_parse_mask"));
 
-  myword[0] = '\0';
-
   if (str == NULL)
     {
@@ -908,8 +527,6 @@
 
   while (i < l) {
-
     if (str[i] == '\0')
       break;
-
     if (str[i] == ' ' || str[i] == '\t' || str[i] == ',')
       {
@@ -921,16 +538,13 @@
       {
 	act = +1; ++i;
-	myword[0] = '\0';
-	goto getword;
+	continue;
       }
     else if (str[i] == '-')
       {
 	act = -1; ++i;
-	myword[0] = '\0';
-	goto getword;
+	continue;
       }
     else /* a word */
       {
-      getword:
 	k = 0;
 	while (k < 63 && str[i] != ' ' && str[i] != '\t' && str[i] != ','
@@ -941,63 +555,41 @@
 	myword[k] = '\0';
 
-	if (sl_strlen(myword) == 0)
-	  {
-	    SL_RETURN ( (-1), _("sh_files_parse_mask"));
-	  }
-
 /* checksum     */
-	if      (0 == strcmp(myword, _("CHK")))
+	if (0 == strncmp(myword, _("CHK"), 3))
 	  sh_files_set_mask (mask, MODI_CHK, act);
 /* link         */
-	else if (0 == strcmp(myword, _("LNK")))
+	if (0 == strncmp(myword, _("LNK"), 3))
 	  sh_files_set_mask (mask, MODI_LNK, act);
 /* inode        */
-	else if (0 == strcmp(myword, _("RDEV")))
+	if (0 == strncmp(myword, _("RDEV"), 3))
 	  sh_files_set_mask (mask, MODI_RDEV, act);
 /* inode        */
-	else if (0 == strcmp(myword, _("INO")))
+	if (0 == strncmp(myword, _("INO"), 3))
 	  sh_files_set_mask (mask, MODI_INO, act);
 /* user         */
-	else if (0 == strcmp(myword, _("USR")))
+	if (0 == strncmp(myword, _("USR"), 3))
 	  sh_files_set_mask (mask, MODI_USR, act);
 /* group        */
-	else if (0 == strcmp(myword, _("GRP")))
+	if (0 == strncmp(myword, _("GRP"), 3))
 	  sh_files_set_mask (mask, MODI_GRP, act);
 /* mtime        */
-	else if (0 == strcmp(myword, _("MTM")))
+	if (0 == strncmp(myword, _("MTM"), 3))
 	  sh_files_set_mask (mask, MODI_MTM, act);
 /* ctime        */
-	else if (0 == strcmp(myword, _("CTM")))
+	if (0 == strncmp(myword, _("CTM"), 3))
 	  sh_files_set_mask (mask, MODI_CTM, act);
 /* atime        */
-	else if (0 == strcmp(myword, _("ATM")))
+	if (0 == strncmp(myword, _("ATM"), 3))
 	  sh_files_set_mask (mask, MODI_ATM, act);
 /* size         */
-	else if (0 == strcmp(myword, _("SIZ")))
+	if (0 == strncmp(myword, _("SIZ"), 3))
 	  sh_files_set_mask (mask, MODI_SIZ, act);
 /* file mode    */
-	else if (0 == strcmp(myword, _("MOD")))
+	if (0 == strncmp(myword, _("MOD"), 3))
 	  sh_files_set_mask (mask, MODI_MOD, act);
 /* hardlinks    */
-	else if (0 == strcmp(myword, _("HLN")))
+	if (0 == strncmp(myword, _("HLN"), 3))
 	  sh_files_set_mask (mask, MODI_HLN, act);
-/* size may grow */
-	else if (0 == strcmp(myword, _("SGROW")))
-	  sh_files_set_mask (mask, MODI_SGROW, act);
-/* use prelink */
-	else if (0 == strcmp(myword, _("PRE")))
-	  sh_files_set_mask (mask, MODI_PREL, act);
-/* get content */
-	else if (0 == strcmp(myword, _("TXT")))
-	  sh_files_set_mask (mask, MODI_TXT, act);
-/* get audit report */
-	else if (0 == strcmp(myword, _("AUDIT")))
-	  sh_files_set_mask (mask, MODI_AUDIT, act);
-	else
-	  {
-	    SL_RETURN ( (-1), _("sh_files_parse_mask"));
-	  }
-	act       = 0;
-	myword[0] = '\0';
+	
       }
   }
@@ -1005,49 +597,37 @@
 }
 
-int sh_files_redef_prelink(const char * str)
+int sh_files_redef_prelink(char * str)
 {
   return (sh_files_parse_mask(&mask_PRELINK, str));
 } 
-int sh_files_redef_user0(const char * str)
+int sh_files_redef_user0(char * str)
 {
   return (sh_files_parse_mask(&mask_USER0, str));
 } 
-int sh_files_redef_user1(const char * str)
+int sh_files_redef_user1(char * str)
 {
   return (sh_files_parse_mask(&mask_USER1, str));
 } 
-int sh_files_redef_user2(const char * str)
-{
-  return (sh_files_parse_mask(&mask_USER2, str));
-} 
-int sh_files_redef_user3(const char * str)
-{
-  return (sh_files_parse_mask(&mask_USER3, str));
-} 
-int sh_files_redef_user4(const char * str)
-{
-  return (sh_files_parse_mask(&mask_USER4, str));
-} 
-int sh_files_redef_readonly(const char * str)
+int sh_files_redef_readonly(char * str)
 {
   return (sh_files_parse_mask(&mask_READONLY, str));
 } 
-int sh_files_redef_loggrow(const char * str)
+int sh_files_redef_loggrow(char * str)
 {
   return (sh_files_parse_mask(&mask_LOGGROW, str));
 } 
-int sh_files_redef_logfiles(const char * str)
+int sh_files_redef_logfiles(char * str)
 {
   return (sh_files_parse_mask(&mask_LOGFILES, str));
 } 
-int sh_files_redef_attributes(const char * str)
+int sh_files_redef_attributes(char * str)
 {
   return (sh_files_parse_mask(&mask_ATTRIBUTES, str));
 } 
-int sh_files_redef_noignore(const char * str)
+int sh_files_redef_noignore(char * str)
 {
   return (sh_files_parse_mask(&mask_NOIGNORE, str));
 } 
-int sh_files_redef_allignore(const char * str)
+int sh_files_redef_allignore(char * str)
 {
   return (sh_files_parse_mask(&mask_ALLIGNORE, str));
@@ -1059,27 +639,21 @@
     {
     case SH_LEVEL_READONLY:
-      return (unsigned long) (mask_READONLY | MODI_INIT);
+      return (unsigned long) mask_READONLY;
     case SH_LEVEL_ATTRIBUTES:
-      return (unsigned long) (mask_ATTRIBUTES | MODI_INIT);
+      return (unsigned long) mask_ATTRIBUTES;
     case SH_LEVEL_LOGFILES:
-      return (unsigned long) (mask_LOGFILES | MODI_INIT);
+      return (unsigned long) mask_LOGFILES;
     case SH_LEVEL_LOGGROW:
-      return (unsigned long) (mask_LOGGROW | MODI_INIT);
+      return (unsigned long) mask_LOGGROW;
     case SH_LEVEL_ALLIGNORE:
-      return (unsigned long) (mask_ALLIGNORE | MODI_INIT);
+      return (unsigned long) mask_ALLIGNORE;
     case SH_LEVEL_NOIGNORE:
-      return (unsigned long) (mask_NOIGNORE | MODI_INIT);
+      return (unsigned long) mask_NOIGNORE;
     case SH_LEVEL_USER0:
-      return (unsigned long) (mask_USER0 | MODI_INIT);
+      return (unsigned long) mask_USER0;
     case SH_LEVEL_USER1:
-      return (unsigned long) (mask_USER1 | MODI_INIT);
-    case SH_LEVEL_USER2:
-      return (unsigned long) (mask_USER2 | MODI_INIT);
-    case SH_LEVEL_USER3:
-      return (unsigned long) (mask_USER3 | MODI_INIT);
-    case SH_LEVEL_USER4:
-      return (unsigned long) (mask_USER4 | MODI_INIT);
+      return (unsigned long) mask_USER1;
     case SH_LEVEL_PRELINK:
-      return (unsigned long) (mask_PRELINK | MODI_INIT);
+      return (unsigned long) mask_PRELINK;
     default:
       return (unsigned long) 0;
@@ -1105,16 +679,10 @@
 {
   char * p;
-  char errbuf[SH_ERRBUF_SIZE];
 
   SL_ENTER(_("sh_files_globerr"));
-
-  if (errnum == ENOTDIR || errnum == ENOENT)
-    {
-      SL_RETURN(0, _("sh_files_globerr"));
-    }
 
   p = sh_util_safe_name (epath);
   sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_FI_GLOB,
-		   sh_error_message (errnum, errbuf, sizeof(errbuf)), p);
+		   sh_error_message (errnum), p);
   SH_FREE(p);
 
@@ -1126,11 +694,9 @@
 #endif
 
-int sh_files_push_file_int (int class, const char * str_s, size_t len, 
-			    unsigned long check_flags)
+int sh_files_push_file_int (int class, const char * str_s, int len)
 {
   dirstack_t * new_item_ptr;
   char  * fileName;
   int     ret;
-  volatile int     count = 0;
 
   SL_ENTER(_("sh_files_push_file_int"));
@@ -1143,17 +709,16 @@
   new_item_ptr->name           = fileName;
   new_item_ptr->class          = class;
-  new_item_ptr->check_flags     = check_flags;
+  new_item_ptr->check_mask     = sh_files_maskof(class);
   new_item_ptr->rdepth         = 0;
   new_item_ptr->checked        = S_FALSE;
-  new_item_ptr->is_reported    = 0;
+  new_item_ptr->reported       = S_FALSE;
   new_item_ptr->childs_checked = S_FALSE;
 
-  SH_MUTEX_LOCK(mutex_zfiles);
   if (zfileList == NULL)
     {
-      zfileList = zAVLAllocTree (zdirstack_key, zAVL_KEY_STRING);
+      zfileList = zAVLAllocTree (zdirstack_key);
       if (zfileList == NULL) 
 	{
-	  (void) safe_logger (0, 0, NULL);
+	  (void) safe_logger (0, 0, getpid());
 	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
@@ -1161,278 +726,27 @@
 
   ret = zAVLInsert (zfileList, new_item_ptr);
-  SH_MUTEX_UNLOCK(mutex_zfiles);
 
   if (-1 == ret)
     {
-      (void) safe_logger (0, 0, NULL);
+      (void) safe_logger (0, 0, getpid());
       aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     }
-  else if (3 == ret)
-    { 
-      if (sh.flag.started != S_TRUE)
-	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE,
-			 fileName);
-      SH_FREE(fileName);
-      SH_FREE(new_item_ptr);
-      new_item_ptr = NULL;
-    }
-  else
-    {
-      int           reported;
-      unsigned long check_flags = sh_files_maskof(class);
-
-      if ((sh.flag.inotify & SH_INOTIFY_INSCAN) != 0)
-	{
-	  sh_files_filecheck (class, check_flags, str_s, NULL,
-			      &reported, 0);
-	  if (SH_FFLAG_REPORTED_SET(reported))
-	    sh_files_set_file_reported(str_s);
-	  sh_inotify_add_watch_later(str_s, &sh_file_watches, NULL,
-				     class, check_flags, 
-				     SH_INOTIFY_FILE, 0);
-	}
-
-      if (MODI_AUDIT_ENABLED(check_flags))
-	{
-	  sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			  _("Setting audit watch"),
-			  _("sh_files_push_file_int"), str_s);
-	  sh_audit_mark(str_s);
-	}
-      ++count;
-    }
-  SL_RETURN(count, _("sh_files_push_file_int"));
-}
-
-int sh_files_push_dir_int (int class, char * tail, size_t len, int rdepth, unsigned long check_flags);
-
+  if (3 == ret)
+    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE,
+		     fileName);
+
+  SL_RETURN(0, _("sh_files_push_file_int"));
+}
+
+
+static int sh_files_pushfile (int class, char * str_s)
+{
+  char  * tmp;
+  int     len;
 #ifdef HAVE_GLOB_H
-
-typedef struct globstack_entry {
-  char                  * name;
-  char                  * type_name;
-  int                     class;
-  unsigned long           check_flags;
-  int                     rdepth;
-  short                   type;
-  /* struct dirstack_entry * next; */
-} sh_globstack_t;
-
-static zAVLTree * zglobList   = NULL;
-
-zAVLKey zglobstack_key (void const * arg)
-{
-  const sh_globstack_t * sa = (const sh_globstack_t *) arg;
-  return (zAVLKey) sa->type_name;
-}
-
-
-static int sh_files_pushglob (int class, int type, const char * p, int rdepth,
-			       unsigned long check_flags_in, int flag)
-{
+  glob_t  pglob;
   int     globstatus = -1;
   unsigned int     gloop;
-  glob_t  pglob;
-
-  volatile int     count = 0;
-  volatile unsigned long check_flags = (flag == 0) ? sh_files_maskof(class) : check_flags_in;
-  
-  SL_ENTER(_("sh_files_pushglob"));
-
-  pglob.gl_offs = 0;
-  globstatus    = glob (p, 0, sh_files_globerr, &pglob);
-  
-  if (sh.flag.checkSum != SH_CHECK_INIT)
-    {
-      sh_globstack_t * new_item_ptr;
-      char  * fileName;
-      char  * typeName;
-      int     ret;
-      
-      SH_MUTEX_TRYLOCK(mutex_zfiles);
-      fileName = sh_util_strdup (p);
-      typeName = sh_util_strconcat ((type == SH_LIST_FILE) ? "F" : "D", p, NULL);
-      
-      new_item_ptr = (sh_globstack_t *) SH_ALLOC (sizeof(sh_globstack_t));
-      
-      new_item_ptr->name           = fileName;
-      new_item_ptr->type_name      = typeName;
-      new_item_ptr->class          = class;
-      new_item_ptr->check_flags    = check_flags;
-      new_item_ptr->rdepth         = rdepth;
-      new_item_ptr->type           = type;
-      
-      if (zglobList == NULL)
-	{
-	  zglobList = zAVLAllocTree (zglobstack_key, zAVL_KEY_STRING);
-	  if (zglobList == NULL) 
-	    {
-	      (void) safe_logger (0, 0, NULL);
-	      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	    }
-	}
-      
-      ret = zAVLInsert (zglobList, new_item_ptr);
-      
-      if (ret != 0) /* already in list */
-	{
-	  SH_FREE(fileName);
-	  SH_FREE(typeName);
-	  SH_FREE(new_item_ptr);
-	}
-      SH_MUTEX_TRYLOCK_UNLOCK(mutex_zfiles);
-    }
-
-
-  if (globstatus == 0 && pglob.gl_pathc > 0)
-    {
-      for (gloop = 0; gloop < (unsigned int) pglob.gl_pathc; ++gloop)
-	{
-	  if (type == SH_LIST_FILE)
-	    {
-	      count += sh_files_push_file_int (class, pglob.gl_pathv[gloop], 
-					       sl_strlen(pglob.gl_pathv[gloop]), check_flags);
-	    }
-	  else
-	    {
-	      which_dirList = type;
-
-	      count += sh_files_push_dir_int  (class, pglob.gl_pathv[gloop], 
-					       sl_strlen(pglob.gl_pathv[gloop]), rdepth, check_flags);
-	    }
-	}
-    }
-  else
-    {
-      char * tmp = sh_util_safe_name (p);
-      
-      if (pglob.gl_pathc == 0
-#ifdef GLOB_NOMATCH
-	  || globstatus == GLOB_NOMATCH
-#endif
-	  )
-	sh_error_handle ((sh.flag.started != S_TRUE) ? SH_ERR_ERR : SH_ERR_NOTICE, 
-			 FIL__, __LINE__, 
-			 globstatus, MSG_FI_GLOB,
-			 _("No matches found"), tmp);
-#ifdef GLOB_NOSPACE
-      else if (globstatus == GLOB_NOSPACE)
-	sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
-			 globstatus, MSG_FI_GLOB,
-			 _("Out of memory"), tmp);
-#endif
-#ifdef GLOB_ABORTED
-      else if (globstatus == GLOB_ABORTED)
-	sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
-			 globstatus, MSG_FI_GLOB,
-			 _("Read error"), tmp);
-#endif
-      else 
-	sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
-			 globstatus, MSG_FI_GLOB,
-			 _("Unknown error"), tmp);
-      
-      SH_FREE(tmp);
-      
-    }
-  
-  globfree(&pglob);
-  SL_RETURN(count, _("sh_files_pushglob"));
-  return count;
-}
-
-void sh_files_check_globFilePatterns()
-{
-  sh_globstack_t * testPattern;
-  zAVLCursor   cursor;
-
-  SL_ENTER(_("sh_files_check_globPatterns"));
-
-  SH_MUTEX_LOCK(mutex_zglob);
-  for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList); 
-       testPattern;
-       testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
-    {
-      if (testPattern->type == SH_LIST_FILE)
-	{
-	  sh_files_pushglob(testPattern->class, testPattern->type, 
-			    testPattern->name, testPattern->rdepth,
-			    testPattern->check_flags, 1);
-	}
-    }
-  SH_MUTEX_UNLOCK(mutex_zglob);
-  SL_RET0(_("sh_files_check_globPatterns"));
-}
-
-void sh_files_check_globPatterns()
-{
-  sh_globstack_t * testPattern;
-  zAVLCursor   cursor;
-
-  SL_ENTER(_("sh_files_check_globPatterns"));
-
-  SH_MUTEX_LOCK(mutex_zglob);
-  for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList); 
-       testPattern;
-       testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
-    {
-      sh_files_pushglob(testPattern->class, testPattern->type, 
-			testPattern->name, testPattern->rdepth,
-			testPattern->check_flags, 1);
-    }
-  SH_MUTEX_UNLOCK(mutex_zglob);
-  SL_RET0(_("sh_files_check_globPatterns"));
-}
-
-/* the destructor
- */
-void free_globstack (void * inptr)
-{
-  sh_globstack_t * here;
-
-  SL_ENTER(_("free_globstack"));
-  if (inptr == NULL)
-    SL_RET0(_("free_globstack"));
-  else
-    here = (sh_globstack_t *) inptr;
-
-  /* cppcheck-suppress uninitStructMember */
-  if (here->name != NULL)
-    SH_FREE(here->name);
-  if (here->type_name != NULL)
-    SH_FREE(here->type_name);
-  SH_FREE(here);
-  SL_RET0(_("free_globstack"));
-}
-
-int sh_files_delglobstack ()
-{
-  SL_ENTER(_("sh_files_delglobstack"));
-
-  SH_MUTEX_LOCK(mutex_zglob);
-  zAVLFreeTree (zglobList, free_globstack);
-  zglobList = NULL;
-  SH_MUTEX_UNLOCK(mutex_zglob);
-
-  SL_RETURN(0, _("sh_files_delglobstack"));
-}
-  
-
-#else
-void sh_files_check_globPatterns()
-{
-  return;
-}
-int sh_files_delglobstack ()
-{
-  return 0;
-}
-#endif
-
-static int sh_files_pushfile (int class, const char * str_s)
-{
-  size_t  len;
-  char  * tmp;
-  char  * p;
+#endif
 
   static int reject = 0;
@@ -1446,24 +760,21 @@
    * is the only one -- and will stay the only one
    */
-  if (sh.flag.opts == S_TRUE) 
+  if (sh.flag.opts == 1) 
     {
       sh_files_delfilestack ();
       sh_files_deldirstack ();
-      sh_files_delglobstack ();
       reject = 1;
     }
 
-  p = sh_files_parse_input(str_s, &len);
-  if (!p || len == 0)
-    SL_RETURN((-1), _("sh_files_pushfile"));
-
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    p = sh_dbIO_rootfs_prepend(p);
-      
+  if (str_s == NULL) 
+    SL_RETURN((-1),_("sh_files_pushfile"));
+
+  len = sl_strlen(str_s);
+
   if (len >= PATH_MAX) 
     {
       /* Name too long
        */
-      tmp = sh_util_safe_name (p);
+      tmp = sh_util_safe_name (str_s);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_2LONG,
 		       tmp);
@@ -1471,9 +782,15 @@
       SL_RETURN((-1),_("sh_files_pushfile"));
     } 
-  else if (p[0] != '/') 
+  else if (len < 1) 
+    {
+      /* Should not happen (str_s == NULL caught further above)
+       */
+      SL_RETURN((-1),_("sh_files_pushfile"));
+    } 
+  else if (str_s[0] != '/') 
     {
       /* Not an absolute path
        */
-      tmp = sh_util_safe_name (p);
+      tmp = sh_util_safe_name (str_s);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_NOPATH,
 		       tmp);
@@ -1486,26 +803,68 @@
        * special case of the root directory.
        */
-      if (p[len-1] == '/' && len > 1)
+      if (str_s[len-1] == '/' && len > 1)
 	{
-	  p[len-1] = '\0';
+	  str_s[len-1] = '\0';
 	  --len;
 	}
+      
     } 
 
 #ifdef HAVE_GLOB_H
-  if (0 == sh_files_has_metachar(p))
-    {
-      sh_files_push_file_int (class, p, len, sh_files_maskof(class));
+  if (0 == sh_files_has_metachar(str_s))
+    {
+      sh_files_push_file_int (class, str_s, len);
     }
   else
     {
-      sh_files_pushglob (class, SH_LIST_FILE, p, 0, 0, 0);
+      pglob.gl_offs = 0;
+      globstatus    = glob (str_s, 0, sh_files_globerr, &pglob);
+
+      if (globstatus == 0 && pglob.gl_pathc > 0)
+	{
+	  for (gloop = 0; gloop < (unsigned int) pglob.gl_pathc; ++gloop)
+	    sh_files_push_file_int (class, pglob.gl_pathv[gloop], 
+				    sl_strlen(pglob.gl_pathv[gloop]));
+	}
+      else
+	{
+	  tmp = sh_util_safe_name (str_s);
+
+	  if (pglob.gl_pathc == 0
+#ifdef GLOB_NOMATCH
+	      || globstatus == GLOB_NOMATCH
+#endif
+	      )
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
+			     globstatus, MSG_FI_GLOB,
+			     _("No matches found"), tmp);
+#ifdef GLOB_NOSPACE
+	  else if (globstatus == GLOB_NOSPACE)
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Out of memory"), tmp);
+#endif
+#ifdef GLOB_ABORTED
+	  else if (globstatus == GLOB_ABORTED)
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Read error"), tmp);
+#endif
+	  else 
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Unknown error"), tmp);
+
+	  SH_FREE(tmp);
+
+	}
+
+      globfree(&pglob);
     }
 
 #else
-  sh_files_push_file_int (class, p, len, sh_files_maskof(class));
-#endif
-
-  SH_FREE(p);
+  sh_files_push_file_int (class, str_s, len);
+#endif
+
   SL_RETURN((0),_("sh_files_pushfile"));
 }
@@ -1536,19 +895,10 @@
 int sh_files_is_allignore (char * str)
 {
-  int retval = 0;
-
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
-  retval = sh_files_is_allignore_int(str, zdirListOne);
-
-  if (NULL != zdirListTwo && retval == 0)
-    {
-      retval = sh_files_is_allignore_int(str, zdirListTwo);
-    }
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-  return retval;
-}
-
-void * sh_dummy_1493_ptr;
+  if (1 == sh_files_is_allignore_int(str, zdirListOne))
+    return 1;
+  if (NULL == zdirListTwo)
+    return 0;
+  return sh_files_is_allignore_int(str, zdirListTwo);
+}
 
 unsigned long sh_dirs_chk (int which)
@@ -1559,15 +909,9 @@
   dirstack_t * dst_ptr;
   int          status;
-  int          tmp_reported;
-  volatile int          filetype = SH_FILE_UNKNOWN;
-  volatile unsigned long dcount = 0;
+  unsigned long dcount = 0;
   char       * tmp;
   
   SL_ENTER(_("sh_dirs_chk"));
 
-  sh_dummy_1493_ptr = (void *) &ptr;
-  
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
   if (which == 1)
     tree = zdirListOne;
@@ -1579,10 +923,9 @@
     {
       if (sig_urgent > 0) {
-	goto out;
+	SL_RETURN(dcount, _("sh_dirs_chk"));
       }
 
       if (ptr->checked == S_FALSE)
 	{
-	  SH_MUTEX_LOCK(mutex_zfiles);
 	  /* 28 Aug 2001 check the top level directory
 	   */
@@ -1594,36 +937,25 @@
 		{
 		  BREAKEXIT(sh_files_filecheck);
-		  tmp_reported = dst_ptr->is_reported;
-		  filetype = sh_files_filecheck (dst_ptr->class, dst_ptr->check_flags, 
-						 ptr->name,  
-						 NULL,  &tmp_reported, 0);
-		  dst_ptr->is_reported = tmp_reported;
-		  (void) handle_filecheck_ret(dst_ptr, NULL, filetype);
-
+		  sh_files_filecheck (dst_ptr->class,  ptr->name,  
+				      NULL,  &status, 0);
 		  dst_ptr->checked = S_TRUE;
 		  status           = S_TRUE;
+		  break;
 		}
 	      else
 		{
 		  status           = S_TRUE;
+		  break;
 		}
 	    }
-	  SH_MUTEX_UNLOCK(mutex_zfiles);
 
 	  if (status == S_FALSE)
-	    {
-	      tmp_reported = ptr->is_reported;
-	      filetype = sh_files_filecheck (ptr->class,  ptr->check_flags, 
-					     ptr->name,  NULL,  &tmp_reported, 0);
-	      ptr->is_reported = tmp_reported;
-	      (void) handle_filecheck_ret(ptr, NULL, filetype);
-	    }
+	    sh_files_filecheck (ptr->class,  ptr->name,  NULL,  &status, 0);
 
 	  BREAKEXIT(sh_files_checkdir);
-	  status = sh_files_checkdir (ptr->class, ptr->check_flags, 
-				      ptr->rdepth, ptr->name, 
+	  status = sh_files_checkdir (ptr->class, ptr->rdepth, ptr->name, 
 				      ptr->name);
 
-	  if (status < 0 && (!SH_FFLAG_REPORTED_SET(ptr->is_reported))) 
+	  if (status < 0 && ptr->reported == S_FALSE) 
 	    {
 	      /* directory is missing
@@ -1636,15 +968,13 @@
 					      ShDFLevel[SH_ERR_T_DIR])) {
 		    tmp = sh_util_safe_name (ptr->name);
-		    if (!sh_global_check_silent)
-		      sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
-				       ShDFLevel[ptr->class] : 
-				       ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__,
-				       0, MSG_FI_MISS, tmp);
-		    ++sh.statistics.files_report;
+		    sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
+				     ShDFLevel[ptr->class] : 
+				     ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__,
+				     0, MSG_FI_MISS, tmp);
 		    SH_FREE(tmp);
 		  }
 		}
 	      if (sh.flag.reportonce == S_TRUE)
-		SET_SH_FFLAG_REPORTED(ptr->is_reported);
+		ptr->reported = S_TRUE;
 	    } 
 	  else 
@@ -1652,8 +982,7 @@
 	      /* exists (status >= 0), but was missing (reported == TRUE)
 	       */
-	      if (status >= 0 && SH_FFLAG_REPORTED_SET(ptr->is_reported))
+	      if (status >= 0 && ptr->reported == S_TRUE)
 		{
-		  CLEAR_SH_FFLAG_REPORTED(ptr->is_reported);
-		  sh_hash_clear_flag(ptr->name, SH_FFLAG_ENOENT);
+		  ptr->reported = S_FALSE;
 #if 0
 		  /* obsoleted (really?) by the mandatory sh_files_filecheck()
@@ -1661,11 +990,9 @@
 		   */
 		  tmp = sh_util_safe_name (ptr->name);
-		  if (!sh_global_check_silent)
-		    sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
-				     ShDFLevel[ptr->class] : 
-				     ShDFLevel[SH_ERR_T_DIR],
-				     FIL__, __LINE__, 0, MSG_FI_ADD,
-				     tmp);
-		  ++sh.statistics.files_report;
+		  sh_error_handle ((ptr->class == SH_LEVEL_ALLIGNORE) ? 
+				   ShDFLevel[ptr->class] : 
+				   ShDFLevel[SH_ERR_T_DIR],
+				   FIL__, __LINE__, 0, MSG_FI_ADD,
+				   tmp);
 		  SH_FREE(tmp);
 #endif
@@ -1686,90 +1013,72 @@
 	      ++dcount;
 	    }
-	  ptr->checked        = S_TRUE;
-	  ptr->childs_checked = S_TRUE;
+	  ptr->checked = S_TRUE;
 	}
 
       if (sig_urgent > 0) {
-	goto out;
+	SL_RETURN(dcount, _("sh_dirs_chk"));
       }
 
     }
- out:
-  ; /* 'label at end of compound statement' */
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-
   SL_RETURN(dcount, _("sh_dirs_chk"));
 }
 
-int sh_files_pushdir_prelink (const char * str_s)
+int sh_files_pushdir_prelink (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_PRELINK, str_s));
 }
 
-int sh_files_pushdir_user0 (const char * str_s)
+int sh_files_pushdir_user0 (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_USER0, str_s));
 }
 
-int sh_files_pushdir_user1 (const char * str_s)
+int sh_files_pushdir_user1 (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_USER1, str_s));
 }
 
-int sh_files_pushdir_user2 (const char * str_s)
-{
-  return (sh_files_pushdir (SH_LEVEL_USER2, str_s));
-}
-
-int sh_files_pushdir_user3 (const char * str_s)
-{
-  return (sh_files_pushdir (SH_LEVEL_USER3, str_s));
-}
-
-int sh_files_pushdir_user4 (const char * str_s)
-{
-  return (sh_files_pushdir (SH_LEVEL_USER4, str_s));
-}
-
-int sh_files_pushdir_attr (const char * str_s)
+int sh_files_pushdir_attr (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_ATTRIBUTES, str_s));
 }
 
-int sh_files_pushdir_ro (const char * str_s)
+int sh_files_pushdir_ro (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_READONLY, str_s));
 }
 
-int sh_files_pushdir_log (const char * str_s)
+int sh_files_pushdir_log (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_LOGFILES, str_s));
 }
 
-int sh_files_pushdir_glog (const char * str_s)
+int sh_files_pushdir_glog (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_LOGGROW, str_s));
 }
 
-int sh_files_pushdir_noig (const char * str_s)
+int sh_files_pushdir_noig (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_NOIGNORE, str_s));
 }
 
-int sh_files_pushdir_allig (const char * str_s)
+int sh_files_pushdir_allig (char * str_s)
 {
   return (sh_files_pushdir (SH_LEVEL_ALLIGNORE, str_s));
 }
 
+static int which_dirList = 1;
+
 int set_dirList (int which)
 {
   if (which == 2)
-    which_dirList = SH_LIST_DIR2;
+    which_dirList = 2;
   else
-    which_dirList = SH_LIST_DIR1;
+    which_dirList = 1;
   return 0;
 }
 
-int sh_files_push_dir_int (int class, char * tail, size_t len, int rdepth, unsigned long check_flags)
+int sh_files_push_dir_int (int class, char * tail, int len, int rdepth)
 {
   zAVLTree   * tree;
@@ -1787,13 +1096,11 @@
   new_item_ptr->name           = dirName;
   new_item_ptr->class          = class;
-  new_item_ptr->check_flags     = check_flags;
+  new_item_ptr->check_mask     = sh_files_maskof(class);
   new_item_ptr->rdepth         = rdepth;
   new_item_ptr->checked        = S_FALSE;
-  new_item_ptr->is_reported    = 0;
+  new_item_ptr->reported       = S_FALSE;
   new_item_ptr->childs_checked = S_FALSE;
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
-  if (which_dirList == SH_LIST_DIR1)
+  if (which_dirList == 1)
     {
       tree = zdirListOne;
@@ -1806,11 +1113,11 @@
   if (tree == NULL)
     {
-      tree = zAVLAllocTree (zdirstack_key, zAVL_KEY_STRING);
+      tree = zAVLAllocTree (zdirstack_key);
       if (tree == NULL) 
 	{
-	  (void) safe_logger (0, 0, NULL);
+	  (void) safe_logger (0, 0, getpid());
 	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
-      if (which_dirList == SH_LIST_DIR1)
+      if (which_dirList == 1)
 	zdirListOne = tree;
       else
@@ -1819,82 +1126,53 @@
 
   ret = zAVLInsert (tree, new_item_ptr);
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
 
   if (-1 == ret)
     {
-      (void) safe_logger (0, 0, NULL);
+      (void) safe_logger (0, 0, getpid());
       aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     }
   if (3 == ret)
-    { 
-      if (sh.flag.started != S_TRUE)
-	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE,
-			 dirName);
-      SH_FREE(dirName);
-      SH_FREE(new_item_ptr);
-      new_item_ptr = NULL;
-    }
-  else
-    {
-      if (MODI_AUDIT_ENABLED(check_flags))
-	{
-	  sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-			  _("Setting audit watch"),
-			  _("sh_files_push_file_int"), tail);
-	  sh_audit_mark(tail);
-	}
-    }
+    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE,
+		     dirName);
+
   SL_RETURN(0, _("sh_files_push_dir_int"));
 }
 
-static int sh_files_pushdir (int class, const char * str_s)
+static int sh_files_pushdir (int class, char * str_s)
 {
   char  * tmp;
-  size_t  len;
+  int     len;
   int     rdepth = 0;
   char  * tail = NULL;
-  char  * p;
+
+#ifdef HAVE_GLOB_H
+  glob_t  pglob;
+  int     globstatus = -1;
+  unsigned int     gloop;
+#endif
 
   SL_ENTER(_("sh_files_pushdir"));
 
-  if (sh.flag.opts == S_TRUE) {
+  if (sh.flag.opts == 1) {
     sh_files_delfilestack ();
     sh_files_deldirstack ();
-    sh_files_delglobstack ();
   }
 
-  p = sh_files_parse_input(str_s, &len);
-  if (!p || len == 0)
-    SL_RETURN((-1),_("sh_files_pushdir"));
-
-  if (p[0] != '/')
-    {
-      rdepth = strtol(p, &tail, 10);
-      if (tail == p)
-	{
-	  SH_FREE(p);
-	  SL_RETURN((-1), _("sh_files_pushdir"));
-	}
+  if (str_s == NULL)
+    SL_RETURN((-1), _("sh_files_pushdir"));
+  
+
+  if (str_s[0] != '/')
+    {
+      rdepth = strtol(str_s, &tail, 10);
+      if (tail == str_s)
+	SL_RETURN((-1), _("sh_files_pushdir"));
     }
   else
-    tail   = p;
+    tail   = str_s;
   
 
-  if (tail == p)
-    {
-      /* Setting to an invalid number will force MaxRecursionLevel,
-       * see sh_files_setrec_int()
-       */
-      rdepth = (-2);
-    }
-  else if ( (rdepth < (-1) || rdepth > 99) || 
-	    ((rdepth == (-1)) && (class != SH_LEVEL_ALLIGNORE)) )
-    {
-      SH_FREE(p);
-      SL_RETURN((-1), _("sh_files_pushdir"));
-    }
-
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    tail = sh_dbIO_rootfs_prepend(tail);
+  if (rdepth < (-1) || tail == str_s || rdepth > 99)
+    rdepth = (-2);
 
   len = sl_strlen(tail);
@@ -1906,10 +1184,8 @@
 		       tmp);
       SH_FREE(tmp);
-      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
   else if (len < 1) 
     {
-      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
@@ -1920,9 +1196,9 @@
 		       tmp);
       SH_FREE(tmp);
-      SH_FREE(p);
       SL_RETURN((-1), _("sh_files_pushdir"));
     } 
   else 
     {
+      
       if (tail[len-1] == '/' && len > 1)
 	{
@@ -1930,4 +1206,5 @@
 	  --len;
 	}
+      
     } 
 
@@ -1935,26 +1212,66 @@
   if (0 == sh_files_has_metachar(tail))
     {
-      sh_files_push_dir_int (class, tail, len, rdepth, sh_files_maskof(class));
+      sh_files_push_dir_int (class, tail, len, rdepth);
     }
   else
     {
-      sh_files_pushglob (class, which_dirList, tail, rdepth, 0, 0);
+      pglob.gl_offs = 0;
+      globstatus    = glob (tail, 0, sh_files_globerr, &pglob);
+
+      if (globstatus == 0 && pglob.gl_pathc > 0)
+	{
+	  for (gloop = 0; gloop < (unsigned int) pglob.gl_pathc; ++gloop)
+	    sh_files_push_dir_int (class, 
+				   pglob.gl_pathv[gloop], 
+				   sl_strlen(pglob.gl_pathv[gloop]), 
+				   rdepth);
+	}
+      else
+	{
+	  tmp = sh_util_safe_name (tail);
+
+	  if (pglob.gl_pathc == 0
+#ifdef GLOB_NOMATCH
+	      || globstatus == GLOB_NOMATCH
+#endif
+	      )
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, 
+			     globstatus, MSG_FI_GLOB,
+			     _("No matches found"), tmp);
+#ifdef GLOB_NOSPACE
+	  else if (globstatus == GLOB_NOSPACE)
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Out of memory"), tmp);
+#endif
+#ifdef GLOB_ABORTED
+	  else if (globstatus == GLOB_ABORTED)
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Read error"), tmp);
+#endif
+	  else 
+	    sh_error_handle (SH_ERR_ERR, FIL__, __LINE__,
+			     globstatus, MSG_FI_GLOB,
+			     _("Unknown error"), tmp);
+	  SH_FREE(tmp);
+	}
+
+      globfree(&pglob);
     }
 #else  
-  sh_files_push_dir_int (class, tail, len, rdepth, sh_files_maskof(class));
-#endif
-
-  SH_FREE(p);
+  sh_files_push_dir_int (class, tail, len, rdepth);
+#endif
+
   SL_RETURN((0), _("sh_files_pushdir"));
-}
-
-/**
+}  
+
 struct sh_dirent {
+  /* char               sh_d_name[NAME_MAX + 2]; */
   char             * sh_d_name;
   struct sh_dirent * next;
 };
-**/
-
-void kill_sh_dirlist (struct sh_dirent * dirlist)
+
+static void kill_sh_dirlist (struct sh_dirent * dirlist)
 {
   struct sh_dirent * this;
@@ -1972,17 +1289,17 @@
 /* -- add an entry to a directory listing
  */
-struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry, 
-				     struct sh_dirent * dirlist)
+static struct sh_dirent * addto_sh_dirlist (struct dirent * thisEntry, 
+					    struct sh_dirent * dirlist)
 {
   struct sh_dirent * this;
-  size_t len;
+  int i;
 
   if (thisEntry == NULL)
     return dirlist;
   
-  len = sl_strlen(thisEntry->d_name);
-  if (len == 0)
+  i = sl_strlen(thisEntry->d_name);
+  if (i == 0)
     return dirlist;
-  ++len;
+  ++i;
   
   this = SH_ALLOC(sizeof(struct sh_dirent));
@@ -1990,6 +1307,6 @@
     return dirlist;
 
-  this->sh_d_name = SH_ALLOC(len);
-  sl_strlcpy(this->sh_d_name, thisEntry->d_name, len);
+  this->sh_d_name = SH_ALLOC(i);
+  sl_strlcpy(this->sh_d_name, thisEntry->d_name, i);
 
   this->next = dirlist;
@@ -2001,5 +1318,5 @@
 /* Simply sets our boolean as to whether this check is active 
  */
-int sh_files_check_hardlinks (const char * opt)
+int sh_files_check_hardlinks (char * opt)
 {
   int i;
@@ -2017,5 +1334,5 @@
 static struct sh_hle_struct * sh_hl_exc = NULL;
 
-int sh_files_hle_reg (const char * str)
+int sh_files_hle_reg (char * str)
 {
   long   offset;
@@ -2077,72 +1394,41 @@
       tmp = tmp->next;
     }
-#ifdef HAVE_FNMATCH_H
-  if ( (offset == 1) && (0 == fnmatch(_("/run/user/*"), path, FNM_PATHNAME)) )
-    {
-      /* gvfs directory in /run/user/username/ */
-      SL_RETURN(0, _("sh_files_hle_test"));
-    }
-#endif
-
   SL_RETURN(-1, _("sh_files_hle_test"));
 }
 #endif
 
-/* This is the LCG from Numerical Recipies. Deterministic. 
+/* -- check a single directory and its content
  */
-static unsigned int simple_rand(unsigned int * state)
-{
-  *state = 1664525 * (*state) + 1013904223;
-  return *state;
-}
-
-void * sh_dummy_dirlist;
-void * sh_dummy_tmpcat;
-
-/* -- Check a single directory and its content. Does not
- *    check the directory inode itself.
- */
-int sh_files_checkdir (int iclass, unsigned long check_flags, 
-		       int idepth, char * iname, 
-		       char * relativeName)
-{
-  struct sh_dirent * dirlist;
-  struct sh_dirent * dirlist_orig;
+static int sh_files_checkdir (int iclass, int idepth, char * iname, 
+			      char * relativeName)
+{
+  struct sh_dirent * dirlist = NULL;
+  struct sh_dirent * dirlist_orig = NULL;
 
   DIR *           thisDir = NULL;
   struct dirent * thisEntry;
-#if defined(SH_USE_SCANDIR)
-  struct dirent **entryList;
-  int             entry;
-#endif
   int             status;
   int             dummy = S_FALSE;
-  dir_type      * theDir;
+  dir_type        theDir;
   ShFileType      checkit;
-  static unsigned int state = 1;
-
-  file_type     * theFile;
+
+
+  file_type       theFile;
   char          * tmpname;
   char          * tmpcat;
-  char errbuf[SH_ERRBUF_SIZE];
 
   int             rdepth = 0;
   int             class  = 0;
-  volatile int    rdepth_next;
-  volatile int    class_next;
-  volatile int    file_class_next;
-  volatile unsigned long   check_flags_next;
-  volatile unsigned long   file_check_flags_next;
-
-  volatile int    checked_flag  = S_FALSE;
-  volatile int    cchecked_flag = S_FALSE;
+  int             rdepth_next;
+  int             class_next;
+  int             file_class_next;
+
+  int             checked_flag  = S_FALSE;
+  int             cchecked_flag = S_FALSE;
 
   dirstack_t *    dst_ptr;
-  dirstack_t *    tmp_ptr;
 
   int             hardlink_num = 0;
-#if !defined(HOST_IS_DARWIN)
-  size_t          len;
-#endif
+
 
   SL_ENTER(_("sh_files_checkdir"));
@@ -2173,12 +1459,7 @@
     }
 
-  if (flag_err_info == S_TRUE)
-    {
-      char pstr[32];
-
-      sl_strlcpy(pstr, sh_hash_getpolicy(iclass), sizeof(pstr));
-      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK, pstr, tmpname);
-    }
-
+  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CHK,
+		   tmpname);
+  
   /* ---- check input ----
    */
@@ -2201,24 +1482,17 @@
       SL_RETURN((-1), _("sh_files_checkdir"));
     }
-
+    
+    
   /* ---- stat the directory ----
    */
-  theFile = SH_ALLOC(sizeof(file_type));
-  sl_strlcpy (theFile->fullpath, iname, PATH_MAX);
-  theFile->attr_string = NULL;
-  theFile->link_path   = NULL;
-  theFile->check_flags  = check_flags;
+  sl_strlcpy (theFile.fullpath, iname, PATH_MAX);
 
   (void) relativeName;
   status = sh_unix_getinfo (ShDFLevel[SH_ERR_T_DIR], 
 			    iname,
-			    theFile, NULL, iclass);
+			    &theFile, NULL, iclass);
 
   if ((sig_termfast == 1) || (sig_terminate == 1)) 
     {
-      if (theFile->attr_string) SH_FREE(theFile->attr_string);
-      if (theFile->link_path)   SH_FREE(theFile->link_path);
-      SH_FREE(theFile);
-      SH_FREE(tmpname);
       SL_RETURN((0), _("sh_files_checkdir"));
     }
@@ -2226,36 +1500,19 @@
   if (status == -1)
     {
-      if (theFile->attr_string) SH_FREE(theFile->attr_string);
-      if (theFile->link_path)   SH_FREE(theFile->link_path);
-      SH_FREE(theFile);
-      SH_FREE(tmpname);
+      SH_FREE(tmpname); 
       SL_RETURN((-1), _("sh_files_checkdir"));
     }
 
-  if (theFile->c_mode[0] != 'd') 
+  if (theFile.c_mode[0] != 'd') 
     { 
-      if (!sh_global_check_silent)
-	sh_error_handle (ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__, 0,
-			 MSG_FI_NODIR,
-			 tmpname);
-      ++sh.statistics.files_nodir;
-      if (theFile->attr_string) SH_FREE(theFile->attr_string);
-      if (theFile->link_path)   SH_FREE(theFile->link_path);
-      SH_FREE(theFile);
-      SH_FREE(tmpname);
+      sh_error_handle (ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__, 0,
+		       MSG_FI_NODIR,
+		       tmpname);
+      SH_FREE(tmpname); 
       SL_RETURN((-1), _("sh_files_checkdir"));
     }
 
-  if ((sh.flag.inotify & SH_INOTIFY_INSCAN) != 0)
-    {
-      sh_inotify_add_watch_later(iname, &sh_file_watches, &status,
-				 iclass, check_flags, SH_INOTIFY_DIR, idepth);
-    }
-   
-  hardlink_num = theFile->hardlinks;
-
-  if (theFile->attr_string) SH_FREE(theFile->attr_string);
-  if (theFile->link_path)   SH_FREE(theFile->link_path);
-  SH_FREE(theFile);
+  hardlink_num = theFile.hardlinks;
+
 
   /* ---- open directory for reading ---- 
@@ -2271,76 +1528,42 @@
       sh_error_handle (ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__, 0, 
 		       MSG_E_OPENDIR,
-		       sh_error_message (status, errbuf, sizeof(errbuf)), tmpname);
+		       sh_error_message (status), tmpname);
       SH_FREE(tmpname); 
+
       SL_RETURN((-1), _("sh_files_checkdir"));
     }
 
-  theDir = SH_ALLOC(sizeof(dir_type));
-
-  theDir->NumRegular  = 0;
-  theDir->NumDirs     = 0;
-  theDir->NumSymlinks = 0;
-  theDir->NumFifos    = 0;
-  theDir->NumSockets  = 0;
-  theDir->NumCDev     = 0;
-  theDir->NumBDev     = 0;
-  theDir->NumDoor     = 0;
-  theDir->NumPort     = 0;
-  theDir->NumAll      = 0;
-  theDir->TotalBytes  = 0;
-  sl_strlcpy (theDir->DirPath, iname, PATH_MAX); 
-
-
-  sh_dummy_dirlist = (void *) &dirlist;
-  sh_dummy_tmpcat  = (void *) &tmpcat;
+  theDir.NumRegular  = 0;
+  theDir.NumDirs     = 0;
+  theDir.NumSymlinks = 0;
+  theDir.NumFifos    = 0;
+  theDir.NumSockets  = 0;
+  theDir.NumCDev     = 0;
+  theDir.NumBDev     = 0;
+  theDir.NumAll      = 0;
+  theDir.TotalBytes  = 0;
+  sl_strlcpy (theDir.DirPath, iname, PATH_MAX); 
+
 
   /* ---- read ----
    */
-  SH_MUTEX_LOCK(mutex_readdir);
-
-  dirlist = NULL;
-  dirlist_orig = NULL;
-
-#if defined(SH_USE_SCANDIR)
-  entry = scandir(iname, &entryList, 0, alphasort);
-  while(entry > 0) { /* scandir() may return -1 on error! */
-      entry--;
-      thisEntry = entryList[entry];
-#else
   do {
       thisEntry = readdir (thisDir);
-#endif
       if (thisEntry != NULL) 
 	{
-	  ++theDir->NumAll;
+	  ++theDir.NumAll;
 	  if (sl_strcmp (thisEntry->d_name, ".") == 0)
 	    { 
-	      ++theDir->NumDirs;
-#if defined(SH_USE_SCANDIR)
-	      free(entryList[entry]); /* scandir() mallocs entries */
-#endif
+	      ++theDir.NumDirs;
 	      continue;
 	    }
 	  if (sl_strcmp (thisEntry->d_name, "..") == 0)
 	    {
-	      ++theDir->NumDirs;
-#if defined(SH_USE_SCANDIR)
-	      free(entryList[entry]); /* scandir() mallocs entries */
-#endif
+	      ++theDir.NumDirs;
 	      continue;
 	    }
 	  dirlist = addto_sh_dirlist (thisEntry, dirlist);
-#if defined(SH_USE_SCANDIR)
-	  free(entryList[entry]); /* scandir() mallocs entries */
-#endif
 	}
-  }
-#if defined(SH_USE_SCANDIR)
-  free(entryList);
-#else
-  while (thisEntry != NULL);
-#endif
-  
-  SH_MUTEX_UNLOCK(mutex_readdir);
+  } while (thisEntry != NULL);
 
   closedir (thisDir);
@@ -2359,12 +1582,10 @@
     if (sig_termfast == 1) 
       {
-	SH_FREE(theDir);
-	SH_FREE(tmpname);
 	SL_RETURN((0), _("sh_files_checkdir"));
       }
 
     BREAKEXIT(sh_derr);
-
-    if (0 == (simple_rand(&state) % 5)) (void) sh_derr();
+    if (0 == (rand() % 5))
+      (void) sh_derr();
     
     /* ---- Check the file. ---- 
@@ -2378,7 +1599,5 @@
     rdepth_next     = rdepth - 1;
     class_next      = class;
-    check_flags_next = check_flags;
     file_class_next = class;
-    file_check_flags_next = check_flags;
     checked_flag    = -1;
     cchecked_flag   = -1;
@@ -2388,6 +1607,4 @@
      * is checked with the policy of the parent directory
      */
-    SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-    SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
     dst_ptr         = (dirstack_t *) zAVLSearch(zdirListOne, tmpcat);
 
@@ -2399,7 +1616,7 @@
 	 */
 	file_class_next    = dst_ptr->class;
-	file_check_flags_next = dst_ptr->check_flags;
 	checked_flag       = dst_ptr->checked;
 	cchecked_flag      = dst_ptr->childs_checked;
+	break;
       }
 
@@ -2415,12 +1632,10 @@
 	     */
 	    file_class_next    = dst_ptr->class;
-	    file_check_flags_next = dst_ptr->check_flags;
 	    checked_flag       = dst_ptr->checked;
 	    cchecked_flag      = dst_ptr->childs_checked;
+	    break;
 	  }
       }
-    SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-
-    SH_MUTEX_LOCK_UNSAFE(mutex_zfiles);
+
     dst_ptr         = (dirstack_t *) zAVLSearch(zfileList, tmpcat);
 
@@ -2432,18 +1647,8 @@
 	 */
 	file_class_next    = dst_ptr->class;
-	file_check_flags_next = dst_ptr->check_flags;
 	checked_flag       = dst_ptr->checked;
-	/* not set, hence always FALSE                   */
-	/* cchecked_flag      = dst_ptr->childs_checked; */
-
-	if (checked_flag != S_TRUE)
-	  {
-	    /* -- need to check the file itself --
-	     */
-	    if (sh.flag.reportonce == S_TRUE)
-	      dummy = dst_ptr->is_reported;
-	  }
+	cchecked_flag      = dst_ptr->childs_checked;
+	break;
       }
-    SH_MUTEX_UNLOCK_UNSAFE(mutex_zfiles);
     
     /* ---- Has been checked already. ----
@@ -2456,5 +1661,5 @@
 	if (checkit == SH_FILE_DIRECTORY) 
 	  {
-	    ++theDir->NumDirs;
+	    ++theDir.NumDirs;
 	  }
 	SH_FREE(tmpcat);
@@ -2475,38 +1680,26 @@
 	/* -- need to check the file itself --
 	 */
-	/* -- moved up -- 
-	 * if (dst_ptr && sh.flag.reportonce == S_TRUE)
-	 *   dummy = dst_ptr->is_reported;
-	 */
-
-	checkit = sh_files_filecheck (file_class_next, file_check_flags_next, 
+	if (dst_ptr && sh.flag.reportonce == S_TRUE)
+	  dummy = dst_ptr->reported;
+
+	checkit = sh_files_filecheck (file_class_next, 
 				      iname, 
 				      dirlist->sh_d_name,
 				      &dummy, 0);
 
-	
-	SH_MUTEX_LOCK_UNSAFE(mutex_zfiles);
-	dst_ptr         = (dirstack_t *) zAVLSearch(zfileList, tmpcat);
-
 	if (dst_ptr && checked_flag == S_FALSE)
 	  dst_ptr->checked = S_TRUE;
-
 	/* Thu Mar  7 15:09:40 CET 2002 Propagate the 'reported' flag
 	 */
 	if (dst_ptr && sh.flag.reportonce == S_TRUE)
-	  dst_ptr->is_reported = dummy;
-
-	if (dst_ptr)
-	  dst_ptr->childs_checked = S_TRUE;
-	SH_MUTEX_UNLOCK_UNSAFE(mutex_zfiles);
+	  dst_ptr->reported = dummy;
       }
     
     if      (checkit == SH_FILE_REGULAR)   
-      ++theDir->NumRegular;
+      ++theDir.NumRegular;
     
     else if (checkit == SH_FILE_DIRECTORY) 
       {
-	++theDir->NumDirs;
-
+	++theDir.NumDirs;
 	if (rdepth_next >= 0 && cchecked_flag != S_TRUE) 
 	  {
@@ -2519,74 +1712,57 @@
 	    cchecked_flag = -1;
 	    
-	    SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-	    SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
-	    tmp_ptr     = (dirstack_t *) zAVLSearch(zdirListOne, tmpcat);
-
-	    if (tmp_ptr) 
+	    dst_ptr     = (dirstack_t *) zAVLSearch(zdirListOne, tmpcat);
+
+	    if (dst_ptr) 
 	      {
 		TPT((0, FIL__, __LINE__, 
 		     _("msg=<%s -> recursion depth %d\n>"),
-		     tmp_ptr->name, tmp_ptr->rdepth));
-		rdepth_next   = tmp_ptr->rdepth;
-		class_next    = tmp_ptr->class;
-		check_flags_next = tmp_ptr->check_flags;
+		     dst_ptr->name, dst_ptr->rdepth));
+		rdepth_next   = dst_ptr->rdepth;
+		class_next    = dst_ptr->class;
 		/* 28. Aug 2001 reversed
 		 */
-		cchecked_flag = tmp_ptr->childs_checked;
-		checked_flag  = tmp_ptr->checked;
+		cchecked_flag = dst_ptr->childs_checked;
+		checked_flag  = dst_ptr->checked;
+		break;
 	      }
 	    
 	    if (checked_flag == -1)
 	      {
-		tmp_ptr     = (dirstack_t *) zAVLSearch(zdirListTwo, tmpcat);
-
-		if (tmp_ptr) 
+		dst_ptr     = (dirstack_t *) zAVLSearch(zdirListTwo, tmpcat);
+
+		if (dst_ptr) 
 		  {
 		    TPT((0, FIL__, __LINE__, 
 			 _("msg=<%s -> recursion depth %d\n>"),
-			 tmp_ptr->name, tmp_ptr->rdepth));
-		    rdepth_next   = tmp_ptr->rdepth;
-		    class_next    = tmp_ptr->class;
-		    check_flags_next = tmp_ptr->check_flags;
+			 dst_ptr->name, dst_ptr->rdepth));
+		    rdepth_next   = dst_ptr->rdepth;
+		    class_next    = dst_ptr->class;
 		    /* 28. Aug 2001 reversed
 		     */
-		    cchecked_flag = tmp_ptr->childs_checked;
-		    checked_flag  = tmp_ptr->checked;
+		    cchecked_flag = dst_ptr->childs_checked;
+		    checked_flag  = dst_ptr->checked;
+		    break;
 		  }
 	      }
-
-	    if (tmp_ptr && cchecked_flag == S_FALSE)
-	      {
-		tmp_ptr->childs_checked = S_TRUE;
-		/*
-		 * 04. Feb 2006 avoid double checking
-		 */
-		tmp_ptr->checked        = S_TRUE;
-	      }
-	    SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-
+	    
 	    if (cchecked_flag == S_FALSE)
 	      {
-		sh_files_checkdir (class_next, check_flags_next, rdepth_next, 
-				   tmpcat, dirlist->sh_d_name);
-		/*
-		  tmp_ptr->childs_checked = S_TRUE;
-		  tmp_ptr->checked        = S_TRUE;
-		*/
+		sh_files_checkdir (class_next, rdepth_next, tmpcat, 
+				   dirlist->sh_d_name);
+		dst_ptr->childs_checked = S_TRUE;
 	      }
 	    else if (checked_flag == -1)
-	      sh_files_checkdir (class_next, check_flags_next, rdepth_next, 
-				 tmpcat, dirlist->sh_d_name);
+	      sh_files_checkdir (class_next, rdepth_next, tmpcat, 
+				 dirlist->sh_d_name);
 	    
 	  }
       }
     
-    else if (checkit == SH_FILE_SYMLINK)   ++theDir->NumSymlinks;
-    else if (checkit == SH_FILE_FIFO)      ++theDir->NumFifos;
-    else if (checkit == SH_FILE_SOCKET)    ++theDir->NumSockets;
-    else if (checkit == SH_FILE_CDEV)      ++theDir->NumCDev;
-    else if (checkit == SH_FILE_BDEV)      ++theDir->NumBDev;
-    else if (checkit == SH_FILE_DOOR)      ++theDir->NumDoor;
-    else if (checkit == SH_FILE_PORT)      ++theDir->NumPort;
+    else if (checkit == SH_FILE_SYMLINK)   ++theDir.NumSymlinks;
+    else if (checkit == SH_FILE_FIFO)      ++theDir.NumFifos;
+    else if (checkit == SH_FILE_SOCKET)    ++theDir.NumSockets;
+    else if (checkit == SH_FILE_CDEV)      ++theDir.NumCDev;
+    else if (checkit == SH_FILE_BDEV)      ++theDir.NumBDev;
     
     SH_FREE(tmpcat);
@@ -2594,29 +1770,21 @@
     if ((sig_termfast == 1) || (sig_terminate == 1)) 
       {
-	SH_FREE(theDir);
-	sh_dummy_dirlist = NULL;
-	SH_FREE(tmpname);
 	SL_RETURN((0), _("sh_files_checkdir"));
       }
     
     dirlist = dirlist->next;
-
-    /* -- moved up, only affects zfileList anyway
-     * if (dst_ptr)
-     *   dst_ptr->childs_checked = S_TRUE;
-     */
-
+    
   } while (dirlist != NULL);
 
-  if (flag_err_info == S_TRUE)
+  if (flag_err_info == SL_TRUE)
     {
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DSUM,
-		       theDir->NumDirs,
-		       theDir->NumRegular,
-		       theDir->NumSymlinks,
-		       theDir->NumFifos,
-		       theDir->NumSockets,
-		       theDir->NumCDev,
-		       theDir->NumBDev);
+		       theDir.NumDirs,
+		       theDir.NumRegular,
+		       theDir.NumSymlinks,
+		       theDir.NumFifos,
+		       theDir.NumSockets,
+		       theDir.NumCDev,
+		       theDir.NumBDev);
     }
 
@@ -2627,15 +1795,12 @@
    * Hardlink check; not done on MacOS X because of resource forks
    */
-  if ((sh_check_hardlinks == S_TRUE) && (hardlink_num != theDir->NumDirs)) 
-    {
-      if (0 != sh_files_hle_test(hardlink_num-theDir->NumDirs, iname))
+  if ((sh_check_hardlinks == S_TRUE) && (hardlink_num != theDir.NumDirs)) 
+    {
+      if (0 != sh_files_hle_test(hardlink_num-theDir.NumDirs, iname))
 	{
-	  len = strlen(tmpname);
-	  if (sl_ok_adds(len, 256)) 
-	    len += 256;
-	  tmpcat = SH_ALLOC(len);
-	  sl_snprintf(tmpcat, len, 
+	  tmpcat = SH_ALLOC(strlen(tmpname) + 256);
+	  sl_snprintf(tmpcat, strlen(tmpname) + 256, 
 		      _("%s: subdirectory count (%d) != hardlinks (%d)"),
-		      tmpname, theDir->NumDirs, hardlink_num);
+		      tmpname, theDir.NumDirs, hardlink_num);
 	  sh_error_handle (ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__, 0, 
 			   MSG_E_SUBGEN, tmpcat, _("sh_files_checkdir"));
@@ -2646,78 +1811,31 @@
 
   SH_FREE(tmpname);
-  SH_FREE(theDir);
-
-  sh_dummy_dirlist = NULL;
 
   SL_RETURN((0), _("sh_files_checkdir"));
 }
 
-void sh_files_fixup_mask (int class, unsigned long * check_flags)
-{
-  if (class == SH_LEVEL_ALLIGNORE)
-    MODI_SET((*check_flags), MODI_ALLIGNORE);
-  sh_tiger_get_mask_hashtype(check_flags);
-  return;
-}
-
 int get_the_fd (SL_TICKET ticket);
 
-static int sh_use_rsrc = S_FALSE;
-
-int sh_files_use_rsrc(const char * str)
-{
-  return sh_util_flagval(str, &sh_use_rsrc);
-}
-
-static void * sh_dummy_fileName;
-static void * sh_dummy_tmpname;
-static void * sh_dummy_tmpdir;
-
-ShFileType sh_files_filecheck (int class, unsigned long check_flags,
-			       const char * dirName, 
-			       const char * infileName,
-			       int * reported, 
-			       int rsrcflag)
+
+static ShFileType sh_files_filecheck (int class, char * dirName, 
+				      char * fileName,
+				      int * reported, 
+				      int rsrcflag)
 {
   /* 28 Aug 2001 allow NULL fileName
    */
-  char          * fullpath;
-  char            fileHash[2*(KEY_LEN + 1)];
+  char            fullpath[PATH_MAX];
+  char            fileHash[KEY_LEN + 1];
   int             status;
-  file_type     * theFile;
+  file_type       theFile;
   char          * tmpdir;
   char          * tmpname;
-  const char    * fileName;
-#if !defined(O_NOATIME)
   struct utimbuf  utime_buf;
-#endif
-  static unsigned int state = 1;
-  char            sc;
 
   SL_ENTER(_("sh_files_filecheck"));
 
-  fullpath = SH_ALLOC(PATH_MAX);
-  theFile  = SH_ALLOC(sizeof(file_type));
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_fileName = (void *) &fileName;
-  sh_dummy_tmpname  = (void *) &tmpname;
-  sh_dummy_tmpdir   = (void *) &tmpdir;
-
   BREAKEXIT(sh_derr);
-
-  if (0 == (simple_rand(&state) % 2)) (void) sh_derr();
-
-  if (dirName && infileName && (dirName[0] == '/') && (dirName[1] == '\0')
-      && (infileName[0] == '/') && (infileName[1] == '\0'))
-    {
-      fileName = NULL;
-    }
-  else
-    {
-      fileName = infileName;
-    }
+  if (0 == (rand() % 2))
+    (void) sh_derr();
 
   /* fileName may be NULL if this is a directory
@@ -2725,9 +1843,5 @@
   if (dirName == NULL /* || fileName == NULL */)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_NULL);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(fullpath);
-      SH_FREE(theFile);
       SL_RETURN(SH_FILE_UNKNOWN, _("sh_files_filecheck"));
     }
@@ -2740,9 +1854,7 @@
 	{
 	  tmpname = sh_util_safe_name (fileName);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle (ShDFLevel[SH_ERR_T_NAME], FIL__, __LINE__, 0,
 			   MSG_FI_OBSC2,
 			   "", tmpname);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 	  SH_FREE(tmpname);
 	}
@@ -2751,9 +1863,7 @@
 	  tmpdir  = sh_util_safe_name (dirName);
 	  tmpname = sh_util_safe_name (fileName);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle (ShDFLevel[SH_ERR_T_NAME], FIL__, __LINE__, 0,
 			   MSG_FI_OBSC2,
 			   tmpdir, tmpname);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 	  SH_FREE(tmpname);
 	  SH_FREE(tmpdir);
@@ -2767,23 +1877,18 @@
       tmpdir  = sh_util_safe_name (dirName);
       tmpname = sh_util_safe_name (fileName);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle (ShDFLevel[SH_ERR_T_FILE],  FIL__, __LINE__, 0,
 		       MSG_FI_2LONG2,
 		       tmpdir, tmpname);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       SH_FREE(tmpname);
       SH_FREE(tmpdir);
-      SH_FREE(fullpath);
-      SH_FREE(theFile);
       SL_RETURN(SH_FILE_UNKNOWN, _("sh_files_filecheck"));
     } 
 
+
   /* stat the file and determine checksum (if a regular file)
    */
-  sl_strlcpy (theFile->fullpath, fullpath, PATH_MAX);
-  theFile->check_flags    = check_flags /* sh_files_maskof(class) */;
-  theFile->file_reported = (*reported);
-  theFile->attr_string   = NULL;
-  theFile->link_path     = NULL;
+  sl_strlcpy (theFile.fullpath, fullpath, PATH_MAX);
+  theFile.check_mask = sh_files_maskof(class);
+  theFile.reported   = (*reported);
 
   TPT(( 0, FIL__, __LINE__, _("msg=<checking file: %s>\n"),  fullpath));
@@ -2792,6 +1897,6 @@
 			     ShDFLevel[class] : ShDFLevel[SH_ERR_T_FILE], 
 			     fileName,
-			     theFile, fileHash, class);
-
+			     &theFile, fileHash, class);
+  
   if (status != 0)
     {
@@ -2799,9 +1904,5 @@
 	    fullpath, status));
       if (class == SH_LEVEL_ALLIGNORE && sh.flag.checkSum != SH_CHECK_INIT)
-	sh_hash_set_visited_true (fullpath);
-      if (theFile->attr_string) SH_FREE(theFile->attr_string);
-      if (theFile->link_path)   SH_FREE(theFile->link_path);
-      SH_FREE(fullpath);
-      SH_FREE(theFile);
+	  sh_hash_set_visited_true (fullpath);
       SL_RETURN(SH_FILE_UNKNOWN, _("sh_files_filecheck"));
     }
@@ -2813,27 +1914,23 @@
   /* report
    */
-  if ((flag_err_debug == S_TRUE) && (theFile->c_mode[0] == '-'))
+  if ((flag_err_debug == SL_TRUE) && (theFile.c_mode[0] == '-'))
     {
       tmpname = sh_util_safe_name (fullpath); /* fixed in 1.5.4 */
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_CSUM,
 		       fileHash, tmpname);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       SH_FREE(tmpname);
     } 
   ++sh.statistics.files_checked;
       
-  if ( sh.flag.checkSum == SH_CHECK_INIT) 
-    {
-      if (class == SH_LEVEL_ALLIGNORE)
-	MODI_SET(theFile->check_flags, MODI_ALLIGNORE);
-      if (S_TRUE == sh_ignore_chk_mod(theFile->fullpath))
-	MODI_SET(theFile->check_flags, MODI_NOCHECK);
-      sh_tiger_get_mask_hashtype(&(theFile->check_flags));
-
-      sh_dbIO_rootfs_strip(theFile->fullpath);
-      if (theFile->link_path)
-	sh_dbIO_rootfs_strip_link(theFile->link_path);
-      sh_dbIO_data_write (theFile, fileHash);
+  if      ( sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_FALSE ) 
+    {
+      sh_hash_pushdata (&theFile, fileHash);
+    }
+  else if (sh.flag.checkSum == SH_CHECK_INIT && sh.flag.update == S_TRUE )
+    {
+      if (0 == sh_hash_compdata (class, &theFile, fileHash, NULL, -1))
+	{
+	  sh_hash_pushdata (&theFile, fileHash);
+	}
     }
   else if (sh.flag.checkSum == SH_CHECK_CHECK 
@@ -2842,39 +1939,30 @@
 	   ) 
     {
-      if (sh.flag.update == S_TRUE)
-	{
-	  if (class == SH_LEVEL_ALLIGNORE)
-	    MODI_SET(theFile->check_flags, MODI_ALLIGNORE);
-	  if (S_TRUE == sh_ignore_chk_mod(theFile->fullpath))
-	    MODI_SET(theFile->check_flags, MODI_NOCHECK);
-	  sh_tiger_get_mask_hashtype(&(theFile->check_flags));
-	}
-      sh_hash_compdata (class, theFile, fileHash, NULL, -1);
+      sh_hash_compdata (class, &theFile, fileHash, NULL, -1);
     }
   
-  (*reported) = theFile->file_reported;
+  (*reported) = theFile.reported;
 
   /* reset the access time 
    */
+  if (class == SH_LEVEL_NOIGNORE && (theFile.check_mask & MODI_ATM) != 0)
+    {
+      utime_buf.actime   = (time_t) theFile.atime;
+      utime_buf.modtime  = (time_t) theFile.mtime;
 #if !defined(O_NOATIME)
-  if (class == SH_LEVEL_NOIGNORE && (theFile->check_flags & MODI_ATM) != 0)
-    {
-      utime_buf.actime   = (time_t) theFile->atime;
-      utime_buf.modtime  = (time_t) theFile->mtime;
-
       retry_aud_utime (FIL__, __LINE__, fullpath, &utime_buf);
-    }
-#endif
+#endif
+    }
   
-#if defined(HOST_IS_DARWIN)
+#ifdef HOST_IS_DARWIN
   /*
    * Check for resource fork
    */
-  if ( (sh_use_rsrc == S_TRUE) && (theFile->c_mode[0] != 'd') && (rsrcflag == 0) )
+  if ( (theFile.c_mode[0] != 'd') && (rsrcflag == 0) )
     {
       int  dummy;
       static int rsrc_init = 0;
       static char rsrc[17];
-      char * testpath = SH_ALLOC(PATH_MAX);
+      char testpath[PATH_MAX];
 
       if (rsrc_init == 0) {
@@ -2888,25 +1976,17 @@
       if (sl_strlen(testpath) == (17 + sl_strlen(fullpath)))
 	{
-	  if (S_TRUE == sh_unix_file_exists (testpath))
+	  if (0 == sh_unix_file_stat (testpath))
 	    {
-	      sh_files_filecheck (class, check_flags, fullpath, rsrc, &dummy, 1);
+	      sh_files_filecheck (class, fullpath, rsrc, &dummy, 1);
 	    }
 	}
-      SH_FREE(testpath);
     }
 #else
-  (void) rsrcflag; /* avoid compiler warning */
+      (void) rsrcflag; /* avoid compiler warning */
 #endif
 
  ret_point:
 
-  sc = theFile->c_mode[0];
-
-  if (theFile->attr_string) SH_FREE(theFile->attr_string);
-  if (theFile->link_path)   SH_FREE(theFile->link_path);
-  SH_FREE(fullpath);
-  SH_FREE(theFile);
-
-  switch (sc) 
+  switch (theFile.c_mode[0]) 
     {
     case '-': SL_RETURN(SH_FILE_REGULAR, _("sh_files_filecheck"));   
@@ -2916,6 +1996,4 @@
     case 'b': SL_RETURN(SH_FILE_BDEV, _("sh_files_filecheck"));      
     case '|': SL_RETURN(SH_FILE_FIFO, _("sh_files_filecheck"));      
-    case 'D': SL_RETURN(SH_FILE_DOOR, _("sh_files_filecheck"));    
-    case 'P': SL_RETURN(SH_FILE_PORT, _("sh_files_filecheck"));    
     case 's': SL_RETURN(SH_FILE_SOCKET, _("sh_files_filecheck"));    
     default:  SL_RETURN(SH_FILE_UNKNOWN, _("sh_files_filecheck"));   
@@ -2927,6 +2005,5 @@
 /* concatenate statpath = testdir"/"d_name
  */
-static int sh_files_fullpath (const char * testdir, const char * d_name, 
-			      char * statpath)
+static int sh_files_fullpath (char * testdir, char * d_name, char * statpath)
 {
   int llen = 0;
@@ -2953,160 +2030,4 @@
 }
 
-/* -----------------------------------
- * Routines required for inotify 
- * -----------------------------------
- */
-int sh_files_search_dir(char * name, int * class, 
-			unsigned long *check_flags, int *reported,
-			int * rdepth)
-{
-  volatile int retval = 0;
-#if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H)
-  sh_globstack_t * testPattern;
-  zAVLCursor   cursor;
-#endif
-  dirstack_t * item;
-
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
-
-  item = zAVLSearch(zdirListOne, name);
-
-  if (item)
-    {
-      *check_flags = item->check_flags;
-      *class      = item->class;
-      *reported   = item->is_reported;
-      *rdepth     = item->rdepth;
-      item->checked        = S_FALSE;
-      item->childs_checked = S_FALSE;
-      item->is_reported    = S_FALSE;
-      retval = 1;
-      goto out;
-    }
-
-  item = zAVLSearch(zdirListTwo, name);
-
-  if (item)
-    {
-      *check_flags = item->check_flags;
-      *class      = item->class;
-      *reported   = item->is_reported;
-      *rdepth     = item->rdepth;
-      item->checked        = S_FALSE;
-      item->childs_checked = S_FALSE;
-      item->is_reported    = S_FALSE;
-      retval = 1;
-      goto out;
-    }
-
-#if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H)
-  SH_MUTEX_LOCK(mutex_zglob);
-  for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList); 
-       testPattern;
-       testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
-    {
-      if (testPattern->type == SH_LIST_DIR1 || 
-	  testPattern->type == SH_LIST_DIR2)
-	{
-	  if (0 == fnmatch(testPattern->name, name, FNM_PATHNAME|FNM_PERIOD))
-	    {
-	      *check_flags = testPattern->check_flags;
-	      *class      = testPattern->class;
-	      *rdepth     = testPattern->rdepth;
-	      retval = 1;
-	      break;
-	    }
-	
-	}
-    }
-  SH_MUTEX_UNLOCK(mutex_zglob);
-#endif
- out:
-  ; /* 'label at end of compound statement' */
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-  return retval;
-}
-
-int sh_files_search_file(char * name, int * class, 
-			 unsigned long *check_flags, int *reported)
-{
-  volatile int retval = 0;
-#if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H)
-  sh_globstack_t * testPattern;
-  zAVLCursor   cursor;
-#endif
-  dirstack_t * item;
-
-  SH_MUTEX_LOCK(mutex_zfiles);
-  item = zAVLSearch(zfileList, name);
-
-  if (item)
-    {
-      *check_flags = item->check_flags;
-      *class      = item->class;
-      *reported   = item->is_reported;
-      retval = 1;
-    }
-  SH_MUTEX_UNLOCK(mutex_zfiles);
-
-#if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H)
-  if (retval == 0)
-    {
-      SH_MUTEX_LOCK(mutex_zglob);
-      for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList); 
-	   testPattern;
-	   testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
-	{
-	  if (testPattern->type == SH_LIST_FILE)
-	    {
-	      if (0 == fnmatch(testPattern->name, name, 
-			       FNM_PATHNAME|FNM_PERIOD))
-		{
-		  *check_flags = testPattern->check_flags;
-		  *class      = testPattern->class;
-		  retval = 1;
-		  break;
-		}
-	      
-	    }
-	}
-      SH_MUTEX_UNLOCK(mutex_zglob);
-    }
-#endif
-
-  return retval;
-}
-
-void sh_files_set_file_reported(const char * name)
-{
-  dirstack_t * item;
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_zfiles);
-  item = zAVLSearch(zfileList, name);
-
-  if (item)
-    {
-      if (sh.flag.reportonce == S_TRUE)
-	SET_SH_FFLAG_REPORTED(item->is_reported);
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_zfiles);
-  return;
-}
-
-void sh_files_clear_file_reported(const char * name)
-{
-  dirstack_t * item;
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_zfiles);
-  item = zAVLSearch(zfileList, name);
-
-  if (item)
-    {
-      CLEAR_SH_FFLAG_REPORTED(item->is_reported);
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_zfiles);
-  return;
-}
 
 /* -----------------------------------
@@ -3122,5 +2043,4 @@
   dirstack_t * pfilL;
   zAVLCursor   cursor;
-  volatile int retval = -1;
 
   SL_ENTER(_("check_file"));
@@ -3133,18 +2053,12 @@
     {
       if (0 == strcmp(name, pfilL->name) &&
-	  (pfilL->check_flags & MODI_ATM) == 0 &&
-	  (pfilL->check_flags & MODI_CTM) == 0 &&
-	  (pfilL->check_flags & MODI_MTM) == 0)
-	{
-	  retval = 0;
-	  break;
-	}
-    }
-
-  SL_RETURN(retval, _("check_file"));
-}
-
-static void * sh_dummy_pdirL;
-
+	  (pfilL->check_mask & MODI_ATM) == 0 &&
+	  (pfilL->check_mask & MODI_CTM) == 0 &&
+	  (pfilL->check_mask & MODI_MTM) == 0)
+	SL_RETURN(0, _("check_file"));
+    }
+  SL_RETURN((-1), _("check_file"));
+}
+  
 int sh_files_test_setup_int (zAVLTree * tree)
 {
@@ -3158,6 +2072,4 @@
   SL_ENTER(_("sh_files_test_setup"));
 
-  sh_dummy_pdirL = (void *) &pdirL;
-
   for (pdirL = (dirstack_t *) zAVLFirst (&cursor1, tree); pdirL;
        pdirL = (dirstack_t *) zAVLNext  (&cursor1))
@@ -3165,5 +2077,4 @@
       dlen = strlen(pdirL->name);
 
-      SH_MUTEX_LOCK(mutex_zfiles);
       for (pfilL = (dirstack_t *) zAVLFirst (&cursor2, zfileList); pfilL;
 	   pfilL = (dirstack_t *) zAVLNext  (&cursor2))
@@ -3185,7 +2096,7 @@
 		  (0 == strncmp(pfilL->name, pdirL->name, dlen)))
 		{
-		  if ((pdirL->check_flags & MODI_ATM) != 0  ||
-		      (pdirL->check_flags & MODI_MTM) != 0  ||
-		      (pdirL->check_flags & MODI_CTM) != 0)
+		  if ((pdirL->check_mask & MODI_ATM) != 0  ||
+		      (pdirL->check_mask & MODI_MTM) != 0  ||
+		      (pdirL->check_mask & MODI_CTM) != 0)
 		    {
 		      if (check_file (pdirL->name) != 0)
@@ -3196,5 +2107,4 @@
 	    }
 	}
-      SH_MUTEX_UNLOCK(mutex_zfiles);
     }
 
@@ -3204,6 +2114,9 @@
 int sh_files_test_double (zAVLTree * firstList, zAVLTree * secondList)
 {
+  int          count;
   int          retval = 0;
+
   zAVLCursor   cursor;
+
   dirstack_t * first;
 
@@ -3214,4 +2127,5 @@
       if (NULL != zAVLSearch(secondList, first->name))
 	{
+	  ++count;
 	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE,
 			   first->name);
@@ -3222,12 +2136,10 @@
 }
 
-extern void     aud_exit   (const char * file, int line, int fd);
+extern void     aud_exit   (char * file, int line, int fd);
       
 int sh_files_test_setup ()
 {
-  int retval;
-
-  SH_MUTEX_RECURSIVE_INIT(mutex_zdirs);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_zdirs);
+  int retval = 0;
+
   /* Test for modifications allowed in ReadOnly directory
    */  
@@ -3244,188 +2156,12 @@
   if (retval != 0)
     aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_zdirs);
-
+
+  /*
+  retval = sh_files_test_double (zfileList,   NULL);
+  if (retval != 0)
+    aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+  */
   return 0;
 }
 
 #endif
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_file_lists (CuTest *tc)
-{
-#if (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE))
-
-  extern int hash_remove_tree_test(char * s, char * fullpath, size_t len_s);
-
-  char * test;
-  int ret;
-
-  sh_files_pushfile_ro("/usr/test");
-  sh_files_pushfile_ro("/usr/bin/test");
-  sh_files_pushfile_ro("/usr/bin/foo/test");
-
-  sh_files_pushdir_ro("/usr");
-  sh_files_pushdir_attr("/usr/bin");
-  sh_files_pushdir_ro("/usr/bin/foo");
-
-  add_to_dirlist(zdirListOne);
-  add_to_dirlist(zdirListTwo);
-  add_to_filelist(zfileList);
-
-  test = sh_files_findfile("/usr/tes");
-  CuAssertTrue(tc, test == NULL);
-  test = sh_files_findfile("/usr/test");
-  CuAssertPtrNotNull(tc, test);
-  test = sh_files_findfile("/usr/testi");
-  CuAssertTrue(tc, test == NULL);
-  test = sh_files_findfile("/test");
-  CuAssertTrue(tc, test == NULL);
-
-  test = sh_files_find_mostspecific_dir("/usr/bin/foo/test");
-  CuAssertStrEquals(tc, "/usr/bin/foo", test);
-  test = sh_files_find_mostspecific_dir("/usr/bin/test");
-  CuAssertStrEquals(tc, "/usr/bin", test);
-  test = sh_files_find_mostspecific_dir("/usr/test");
-  CuAssertStrEquals(tc, "/usr", test);
-  test = sh_files_find_mostspecific_dir("/test");
-  CuAssertTrue(tc, test == NULL);
-  test = sh_files_find_mostspecific_dir("/usr/foo/test");
-  CuAssertStrEquals(tc, "/usr", test);
-
-  test = sh_files_find_mostspecific_dir("/usr/bin");
-  CuAssertStrEquals(tc, "/usr/bin", test);
-
-  ret = hash_remove_tree_test("/usr", "/usr/test", strlen("/usr"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-  ret = hash_remove_tree_test("/usr", "/usr/testi", strlen("/usr"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-  ret = hash_remove_tree_test("/usr", "/usr/tes", strlen("/usr"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-
-  ret = hash_remove_tree_test("/usr/bin", "/usr/test", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-  ret = hash_remove_tree_test("/usr/bin", "/usr/testi", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-  ret = hash_remove_tree_test("/usr/bin", "/usr/tes", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-
-  ret = hash_remove_tree_test("/usr/bin", "/usr/bin/test", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-  ret = hash_remove_tree_test("/usr/bin", "/usr/bin/testi", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-  ret = hash_remove_tree_test("/usr/bin", "/usr/bin/tes", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-
-  ret = hash_remove_tree_test("/usr/bin", "/usr/bin", strlen("/usr/bin"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-  ret = hash_remove_tree_test("/usr", "/usr", strlen("/usr"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-  ret = hash_remove_tree_test("/usr", "/usrbin", strlen("/usr"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-  ret = hash_remove_tree_test("/", "/usrbin", strlen("/"));
-  CuAssertIntEquals(tc, S_TRUE, ret);
-  ret = hash_remove_tree_test("/", "/usr", strlen("/"));
-  CuAssertIntEquals(tc, S_FALSE, ret);
-
-#else
-  (void) tc; /* fix compiler warning */
-  return;
-#endif
-}
-
-void Test_file_dequote (CuTest *tc)
-{
-#if (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)) 
-
-  char str1[]  = "1234567890";
-  char str1a[] = "123456\\\"789\\r";
-  char str1b[] = "12345678\\r9";
-  char str1c[] = "12345678\\x0a_9";
-  char str1d[] = "12345678\\007_9";
-  char str1e[] = "123456789\\\\";
-
-  char str2[] = "1234567890\\xw";
-  char str3[] = "1234567890\\xw99";
-  char str4[] = "1234567890\\0ww";
-  char str5[] = "12345\\g67890";
-  char str6[] = "1234567890\\009a";
-
-  char *s, *p, *q;
-  size_t lo, lr;
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  == q);
-  CuAssertTrue(tc, lr == lo);
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1a, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  != q);
-  CuAssertTrue(tc, 0 == strcmp(q, "123456\"789\r"));
-  CuAssertTrue(tc, lr == (lo-2));
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1b, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  != q);
-  CuAssertTrue(tc, 0 == strcmp(q, "12345678\r9"));
-  CuAssertTrue(tc, lr == (lo-1));
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1c, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  != q);
-  CuAssertTrue(tc, 0 == strcmp(q, "12345678\x0a_9"));
-  CuAssertTrue(tc, lr == (lo-3));
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1d, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  != q);
-  CuAssertTrue(tc, 0 == strcmp(q, "12345678\007_9"));
-  CuAssertTrue(tc, lr == (lo-3));
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str1e, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertTrue(tc, p  != q);
-  CuAssertTrue(tc, 0 == strcmp(q, "123456789\\"));
-  CuAssertTrue(tc, lr == (lo-1));
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str2, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertTrue(tc, q == NULL);
-  CuAssertTrue(tc, lr == 0);
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str3, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertTrue(tc, q == NULL);
-  CuAssertTrue(tc, lr == 0);
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str4, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertTrue(tc, q == NULL);
-  CuAssertTrue(tc, lr == 0);
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str5, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertTrue(tc, q == NULL);
-  CuAssertTrue(tc, lr == 0);
-
-  s = SH_ALLOC(64); sl_strlcpy(s, str6, 64); p = s; lo = strlen(s); lr = lo;
-  q = sh_files_C_dequote(s, &lr);
-  CuAssertTrue(tc, q == NULL);
-  CuAssertTrue(tc, lr == 0);
-
-  return;
-#else
-  (void) tc; /* fix compiler warning */
-  return;
-#endif
-}
-#endif
-
Index: trunk/src/sh_filetype.c
===================================================================
--- trunk/src/sh_filetype.c	(revision 591)
+++ 	(revision )
@@ -1,608 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2011 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#ifndef NULL
-#if !defined(__cplusplus)
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-
-#include "samhain.h"
-#include "sh_mem.h"
-#include "sh_error_min.h"
-#include "sh_utils.h"
-
-#define FIL__ _("sh_filetype.c")
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-/* #define SH_FILE_MAIN 1 */
-#ifdef  SH_FILE_MAIN
-#include <stdio.h>
-#define _(a) a
-#define N_(a) a
-#define sl_strlcpy strncpy
-#endif
-
-#define SH_FTYPE_MAX 32
-
-/* List of filetype description, in the format: 
- * offset : type(0=text, 1=binary) : length(if binary) : G1 : G2 : G3 : Name : Teststring
- *
- * This list is mostly taken from the 'filetype' library by Paul L Daniels.
- *
- * Copyright (c) 2003, PLD
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or 
- * without modification, are permitted provided that the 
- * following conditions are met:
- * 
- *  * Redistributions of source code must retain the above 
- *  copyright notice, this list of conditions and the following 
- *  disclaimer.
- *  
- *  * 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.
- *  
- *  * Neither the name of the PLD nor the names of its contributors 
- *  may be used to endorse or promote products derived from this software 
- *  without specific prior written permission.
- *  
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- *  "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
- *  COPYRIGHT OWNER OR CONTRIBUTORS 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.
- */
-
-
-char * sh_ftype_list[] = {
-
-  N_("6:0:0:IMAGE:COMPRESSED:JPG:JFIF Jpeg:JFIF"),
-  N_("0:0:0:IMAGE:COMPRESSED:PNG:PNG:=89PNG=0d=0a=1a=0a"),
-  N_("0:0:0:IMAGE:COMPRESSED:JPG:JFIF Jpeg:=FF=D8=FF"),
-  N_("0:0:0:IMAGE:COMPRESSED:GIF:GIF:GIF97a"),
-  N_("0:0:0:IMAGE:COMPRESSED:GIF:GIF:GIF89a"),
-  N_("0:0:0:IMAGE:COMPRESSED:GIF:GIF:GIF87a"),
-  N_("0:1:4:IMAGE:COMPRESSED:TIFF:TIFF-LE:II=2A=00"),
-  N_("0:1:4:IMAGE:COMPRESSED:TIFF:TIFF-BE:MM=00=2A"),
-  N_("0:1:2:IMAGE:COMPRESSED:PCX:PCX25:=0A=00"),
-  N_("0:1:2:IMAGE:COMPRESSED:PCX:PCX28WP:=0A=02"),
-  N_("0:1:2:IMAGE:COMPRESSED:PCX:PCX28NP:=0A=03"),
-  N_("0:1:2:IMAGE:COMPRESSED:PCX:PCX30:=0A=05"),
-  N_("0:0:0:IMAGE:RAW:BMP:Bitmap:BM"),
-  N_("0:0:0:IMAGE:RAW:XPM:XPM:/* XPM */"),
-  N_("0:0:0:IMAGE:SPECIAL:AUTOCAD:DWT:AC=31=30=31"),
-  N_("0:0:0:IMAGE:SPECIAL:AUTOCAD:DWF:(DWF V"),
-  N_("0:0:0:IMAGE:SPECIAL:AUTOCAD:WMF:=D7=CD=C6=9A"),
-  N_("0:0:0:IMAGE:SPECIAL:AUTOCAD:DWG:AC10"),
-  N_("8:0:0:IMAGE:SPECIAL:COREL:CorelDraw:CDR"),
-  N_("0:0:0:IMAGE:SPECIAL:FITS:Fits file:SIMPLE=20=20="),
-  N_("1536:0:0:IMAGE:SPECIAL:VISIO:VisioDraw:Visio"),
-  N_("128:0:0:IMAGE:SPECIAL:DICM:DICOM medical:DICM"),
-  N_("0:0:0:IMAGE:SPECIAL:PHS:Photoshop:8BPS"),
-  N_("0:0:0:IMAGE:SPECIAL:XCF:Gimp XCF:gimp xcf"),
-  N_("0:0:0:MOVIE:COMPRESSED:RIFF:RIFF/AVI Movie:RIFF"),
-  N_("0:0:0:MOVIE:RAW:MOV:SGI Movie:MOVI:.mov SGI Movie"),
-  N_("0:1:4:MOVIE:COMPRESSED:MPG:Mpeg 2:=00=00=01=BA"),
-  N_("0:1:4:MOVIE:COMPRESSED:MPG:Mpeg 2:=00=00=01=B3"),
-  N_("4:0:0:MOVIE:COMPRESSED:QT:QuickTime:moov"),
-  N_("4:0:0:MOVIE:COMPRESSED:QT:QuickTime:mdat"),
-  N_("36:0:0:MOVIE:COMPRESSED:QT:QuickTime:moov"),
-  N_("36:0:0:MOVIE:COMPRESSED:QT:QuickTime:mdat"),
-  N_("68:0:0:MOVIE:COMPRESSED:QT:QuickTime:moov"),
-  N_("68:0:0:MOVIE:COMPRESSED:QT:QuickTime:mdat"),
-  N_("0:1:3:MOVIE:COMPRESSED:FLI:FLIC animation:=00=11=AF"),
-  N_("0:0:0:MOVIE:COMPRESSED:FLASH:Flash data:FWS"),
-  N_("0:0:0:MOVIE:COMPRESSED:FLASH:Flash data:CWS"),
-  N_("0:0:0:MOVIE:COMPRESSED:FLASH:Flash video:FLV"),
-  N_("0:0:0:MOVIE:COMPRESSED:WMV:WMV:=30=26=B2=75=8E=66=CF"),
-  N_("0:0:0:AUDIO:RAW:SND:Sun Audio:.snd"),
-  N_("0:0:0:AUDIO:RAW:EMOD:EMOD:Mod"),
-  N_("1080:0:0:AUDIO:RAW:MOD:SoundTracker (.M.K):.M.K"),
-  N_("1080:0:0:AUDIO:RAW:MOD:SoundTracker (M.K.):M.K."),
-  N_("1080:0:0:AUDIO:RAW:MOD:NoiseTracker:N.T."),
-  N_("1080:0:0:AUDIO:RAW:MOD:SoundTracker (M!K!):M!K!"),
-  N_("1080:0:0:AUDIO:RAW:MOD:SoundTracker (M&K!):M&K!"),
-  N_("8:0:0:AUDIO:RAW:WAVE:Wave:WAVE"),
-  N_("0:1:4:AUDIO:RAW:DEC:DEC-Audio:=00=64=73=2E"),
-  N_("0:0:0:AUDIO:STANDARD:MIDI:Midi:MThd"),
-  N_("0:0:0:AUDIO:COMPRESSED:REAL:RealMedia:.RMF"),
-  N_("0:0:0:AUDIO:COMPRESSED:OGG:Ogg Vorbis:OggS"),
-  N_("0:0:0:AUDIO:COMPRESSED:FLAC:Flac:fLaC"),
-  N_("0:1:5:AUDIO:COMPRESSED:MP3:MP3 Audio:=49=44=33=02=00"),
-  N_("0:1:5:AUDIO:COMPRESSED:MP3:MP3 Audio:=49=44=33=03=00"),
-  N_("0:1:5:AUDIO:COMPRESSED:MP3:MP3 Audio:=49=44=33=04=00"),
-  N_("0:1:2:AUDIO:COMPRESSED:MP3:MP3 Audio:=ff=fb"),
-  N_("0:1:2:AUDIO:COMPRESSED:MP3:MP3 Audio:=ff=fa"),
-  N_("2:0:0:ARCHIVE:COMPRESSED:LHA:Lha 0:-lh0-"),
-  N_("2:0:0:ARCHIVE:COMPRESSED:LHA:Lha 1:-lh1-"),
-  N_("2:0:0:ARCHIVE:COMPRESSED:LHA:Lha 4:-lz4-"),
-  N_("2:0:0:ARCHIVE:COMPRESSED:LHA:Lha z5:-lz5-"),
-  N_("2:0:0:ARCHIVE:COMPRESSED:LHA:Lha 5:-lh5-"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:RAR:RarArchive:Rar!"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:ZIP:PkZip:PK=03=04"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:7Z:7-Zip:=37=7A=BC=AF=27=1C"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:COMPRESS:Compress:=1F=89"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:GZIP:Gzip:=1F=8B"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:BZIP2:Bzip2:BZh"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:ARJ:ARJ:=60=ea"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:ARJ:ARJ:=ea=60"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:HPAK:HPack:HPAK"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:JAM:Jam:=E9,=01JAM"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:SQUISH:Squish:SQSH"),
-  N_("0:1:8:ARCHIVE:COMPRESSED:CAB:MS Cabinet:MSCF=00=00=00=00"),
-  N_("20:0:0:ARCHIVE:COMPRESSED:ZOO:Zoo:=FD=C4=A7=DC"),
-  N_("0:0:0:ARCHIVE:COMPRESSED:XPK:Amiga XPK Archive:XPKF"),
-  N_("0:0:0:ARCHIVE:PACKAGE:RPM:RPM:=ED=AB=EE=DB"),
-  N_("0:0:0:ARCHIVE:PACKAGE:DEB:DEB:!<arch>=0A""debian"),
-  N_("0:0:0:ARCHIVE:UNIX:AR:AR:!<arch>"),
-  N_("0:0:0:ARCHIVE:UNIX:AR:AR:<ar>"),
-  N_("257:1:8:ARCHIVE:UNIX:TAR:TAR:ustar=20=20=00"),
-  N_("257:1:6:ARCHIVE:UNIX:TAR:TAR:ustar=00"),
-  N_("0:0:0:LIBRARY:JAVA:CLASS:Java:=CA=FE=BA=BE"),
-  N_("2108:0:0:DOCUMENT:OFFICE:WORD:Word v5:MSWordDoc"),
-  N_("2112:0:0:DOCUMENT:OFFICE:WORD:Word v5:MSWordDoc"),
-  N_("2080:0:0:DOCUMENT:OFFICE:EXCEL:Excel v4:Microsoft Excel"),
-  N_("2080:0:0:DOCUMENT:OFFICE:WORD:MS Word:Microsoft Word"),
-  N_("0:0:0:DOCUMENT:OFFICE:WORD:Word:=94=A6=2E"),
-  N_("512:1:19:DOCUMENT:OFFICE:WORD:Word:R=00o=00o=00t=00 =00""E=00n=00t=00r=00y"),
-  N_("0:1:9:DOCUMENT:OFFICE:ALL:MSOffice:=D0=CF=11=E0=A1=B1=1A=E1=00"),
-  N_("0:0:0:DOCUMENT:ADOBE:PDF:PortableDocument:%PDF-"),
-  N_("0:0:0:DOCUMENT:ADOBE:EPS:EncapsulatedPS:%!PS-ADOBE EPS"),
-  N_("0:0:0:DOCUMENT:STANDARD:RTF:RichText:{\\rtf"),
-  N_("6:1:4:DOCUMENT:STANDARD:RTF:RichText Compressed:=00=00LZ"),
-  N_("6:0:0:DOCUMENT:ID:VCARD:VCARD:vcard"),
-  N_("0:0:0:EXECUTABLE:DOS:EXE:DosExe:MZ"),
-  N_("0:0:0:EXECUTABLE:DOS:EXE:DosExe:LZ"),
-  N_("0:0:0:EXECUTABLE:DOS:COM:DosCom 1:=E9"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#!/bin/sh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#! /bin/sh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#!/bin/bash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#! /bin/bash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#!/usr/bin/bash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Bourne:#! /usr/bin/bash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Csh:#!/usr/bin/csh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Csh:#! /usr/bin/csh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Csh:#!/bin/csh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Csh:#! /bin/csh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Korn:#! /usr/bin/ksh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Korn:#!/usr/bin/ksh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Korn:#! /bin/ksh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Korn:#!/bin/ksh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Tenex:#!/usr/bin/tcsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Tenex:#! /usr/bin/tcsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Tenex:#!/bin/tcsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Tenex:#! /bin/tcsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Zsh:#!/usr/bin/zsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Zsh:#! /usr/bin/zsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Zsh:#!/bin/zsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Zsh:#! /bin/zsh"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:ash:#!/usr/bin/ash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:ash:#! /usr/bin/ash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:ash:#!/bin/ash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:ash:#! /bin/ash"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#!/usr/bin/nawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#! /usr/bin/nawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#!/bin/nawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#! /bin/nawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#!/bin/gawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#! /bin/gawk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#!/bin/awk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:awk:#! /bin/awk"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:perl:#!/usr/bin/perl"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:perl:#! /usr/bin/perl"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:perl:#!/bin/perl"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:perl:#! /bin/perl"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Shell script:#!/"),
-  N_("0:0:0:EXECUTABLE:UNIX:SHELL:Shell script:#! /"),
-  N_("0:0:0:EXECUTABLE:UNIX:ELF:Linux ELF32:=7f""ELF=01"),
-  N_("0:0:0:EXECUTABLE:UNIX:ELF:Linux ELF:=7f""ELF=02"),
-  N_("0:0:0:EXECUTABLE:DOS:COM:DosCom 2:=8c"),
-  N_("0:0:0:EXECUTABLE:DOS:COM:DosCom 3:=eb"),
-  N_("0:0:0:EXECUTABLE:DOS:COM:DosCom 4:=b8"),
-  N_("0:1:4:EXECUTABLE:AMIGAOS:EXECUTABLE:AmigaOS Executable:=00=00=03=F3"),
-  N_("0:1:20:DATABASE:ANY:ACCESS:MSAccess:=00=01=00=00Standard=20Jet=20""DB=00"),
-  N_("0:1:2:DATABASE:ANY:MYSQL:MySQL database:=fe=01"),
-  N_("0:1:4:DATABASE:ANY:MYSQL:MySQL database:=fe=fe=03=00"),
-  N_("0:1:4:DATABASE:ANY:MYSQL:MySQL database:=fe=fe=07=00"),
-  N_("0:1:4:DATABASE:ANY:MYSQL:MySQL database:=fe=fe=05=00"),
-  N_("0:1:4:DATABASE:ANY:MYSQL:MySQL database:=fe=fe=06=00"),
-  
-  NULL, 
-  NULL, 
-  NULL, 
-  NULL, 
-
-  NULL, 
-  NULL, 
-  NULL, 
-  NULL, 
-
-  NULL, 
-  NULL, 
-  NULL, 
-  NULL, 
-
-  NULL, 
-  NULL, 
-  NULL, 
-  NULL, 
-
-  NULL,
-};
-
-static unsigned int    sh_ftype_def = 0;
-
-#define SH_FTYPE_ADD  16
-
-struct sh_ftype_rec {
-  size_t offset;
-  size_t length;
-  char   pattern[SH_FTYPE_MAX];
-
-  char   type[SH_FTYPE_MAX];
-};
-
-
-struct sh_ftype_rec ** sh_ftype_arr = NULL;
-static unsigned int    sh_ftype_nn  = 0;
-
-#if !defined(SH_FILE_MAIN)
-
-static unsigned int    sh_ftype_usr = 0;
-
-extern char * unquote_string (const char * str, size_t len);
-
-int sh_restrict_add_ftype(const char * str)
-{
-  size_t len;
-  char * cond;
-
-  if (sh_ftype_def == 0)
-    {
-      while(sh_ftype_list[sh_ftype_def] != NULL) ++sh_ftype_def;
-    }
-
-  if (!str) 
-    {
-      if (sh_ftype_usr > 0)
-	{
-	  unsigned int i, j = sh_ftype_def;
-	  
-	  for (i = 0; i < sh_ftype_usr; ++i)
-	    {
-	      SH_FREE(sh_ftype_list[j+i]);
-	      sh_ftype_list[j+i] = NULL;
-	    }   
-	  sh_ftype_usr = 0;
-	}
-
-      if (sh_ftype_arr)
-	{
-	  unsigned int i = 0;
-	  
-	  while(sh_ftype_arr[i] != NULL)
-	    {
-	      SH_FREE(sh_ftype_arr[i]);
-	      ++i;
-	    }
-	  SH_FREE(sh_ftype_arr);
-	  sh_ftype_arr = NULL;
-	}
-    }
-  else if (sh_ftype_usr < SH_FTYPE_ADD)
-    {
-      len = strlen(str);
-      cond = unquote_string(str, len);
-      sh_ftype_list[sh_ftype_def+sh_ftype_usr] = cond;
-      ++sh_ftype_usr;
-    }
-  else
-    {
-      return -1;
-    }
-  return 0;
-}
-
-
-#endif
-
-
-static int init_record(unsigned int n, char * define,
-		       struct sh_ftype_rec * record)
-{
-  unsigned int offset, dtype, length, i = 0, xn = 0;
-  char type[SH_FTYPE_MAX];
-  char pattern[SH_FTYPE_MAX];
-
-  char * end;
-  char * start;
-  
-  offset = strtoul(define, &end, 0);
-  if (*end != ':')
-    return -1;
-
-  start = end; ++start;
-  dtype  = strtoul(start,  &end, 0);
-  if (*end != ':')
-    return -1;
-
-  start = end; ++start;
-  length = strtoul(start,  &end, 0);
-  if (*end != ':')
-    return -1;
-  
-  start = end; ++start;
-
-  while (*start && (i < sizeof(type)))
-    {
-      type[i] = *start; ++start;
-      if (type[i] == ':') 
-	++xn;
-      if (xn == 3)
-	{
-	  type[i] = '\0';
-	  break;
-	}
-      ++i;
-    }
-  if (xn != 3)
-    return -1;
-
-  start = strchr(start, ':');
-
-  if (!start)
-    return -1;
-
-  ++start;
-
-  if (dtype == 0)
-    {
-      sl_strlcpy(pattern, start, sizeof(pattern));
-      length = strlen(pattern);
-    }
-  else if (length <= sizeof(pattern))
-    {
-      memcpy(pattern, start, length);
-    }
-  else
-    {
-      return -1;
-    }
-
-  for (i = 0; i < n; ++i)
-    {
-      if (sh_ftype_arr[i]->length <= length &&
-	  sh_ftype_arr[i]->offset == offset)
-	{
-	  if (0 == memcmp(sh_ftype_arr[i]->pattern, pattern, 
-			  sh_ftype_arr[i]->length))
-	    {
-#ifdef  SH_FILE_MAIN
-	      fprintf(stderr, 
-		      "Pattern %d (%s / %s) override by earlier pattern %d (%s / %s)\n",
-		      n, type, pattern,
-		      i, sh_ftype_arr[i]->type, sh_ftype_arr[i]->pattern);
-#else
-	      char errbuf[256];
-	      
-	      sl_snprintf(errbuf, sizeof(errbuf),
-			  _("Pattern %d (%s) override by earlier pattern %d (%s)"),
-			  n, type,
-			  i, sh_ftype_arr[i]->type);
-	      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			      errbuf,
-			      _("init_record"));
-#endif
-	    }
-	}
-    }
-
-
-  record->offset = offset;
-  record->length = length;
-  memcpy(record->pattern, pattern, length);
-  sl_strlcpy(record->type, type, SH_FTYPE_MAX);
-
-  return 0;
-}
-
-static void file_arr_init()
-{
-  unsigned int i, nn = 0;
-
-  if (sh_ftype_def == 0)
-    {
-      while(sh_ftype_list[sh_ftype_def] != NULL) ++sh_ftype_def;
-    }
-
-  while (sh_ftype_list[nn] != NULL) ++nn;
-
-#ifdef  SH_FILE_MAIN
-  printf("%d definitions found, defined = %d\n", nn, sh_ftype_def);
-#endif
-
-#ifdef  SH_FILE_MAIN
-  sh_ftype_arr = calloc((nn+1), sizeof(struct sh_ftype_rec *));
-#else
-  sh_ftype_arr = SH_ALLOC((nn+1) * sizeof(struct sh_ftype_rec *));
-#endif
-
-  for(i = 0; i < nn; i++)
-    {
-#ifdef  SH_FILE_MAIN
-      sh_ftype_arr[i] = calloc(1, sizeof(struct sh_ftype_rec));
-#else
-      sh_ftype_arr[i] = SH_ALLOC(sizeof(struct sh_ftype_rec));
-#endif
-
-      memset(sh_ftype_arr[i], 0, sizeof(struct sh_ftype_rec));
-      if (i < sh_ftype_def) 
-	{
-	  char   * p  = _(sh_ftype_list[i]);
-	  size_t len  = strlen(p);
-	  char * cond = unquote_string(p, len); 
-	  
-	  init_record(i,             cond, sh_ftype_arr[i]);
-	}
-      else 
-	{
-	  init_record(i, sh_ftype_list[i], sh_ftype_arr[i]);
-	}
-    }
-  sh_ftype_arr[nn] = NULL;
-  sh_ftype_nn      = nn;
-
-  return;
-}
-
-static char * check_filetype(char * filetype, 
-			     const char * buffer, size_t buflen)
-{
-  unsigned int i;
-  const char * p;
-
-  if (!sh_ftype_arr)
-    {
-      file_arr_init();
-    }
-  
-  for (i = 0; i < sh_ftype_nn; ++i)
-    {
-      if (sh_ftype_arr[i]->length > 0 && 
-	  (sh_ftype_arr[i]->length + sh_ftype_arr[i]->offset) < buflen)
-	{
-	  p = &buffer[sh_ftype_arr[i]->offset];
-
-	  if (0 == memcmp(p, sh_ftype_arr[i]->pattern, sh_ftype_arr[i]->length))
-	    {
-	      sl_strlcpy(filetype, sh_ftype_arr[i]->type, SH_FTYPE_MAX);
-	      return (filetype);
-	    }
-	}
-    }
-
-  if (buflen > 0) {
-
-    int flag = 0;
-
-    p = buffer;
-    for (i = 0; i < buflen; ++i) {
-      if (*p == '\0')
-	{
-	  sl_strlcpy(filetype, _("FILE:BINARY:UNKNOWN"), SH_FTYPE_MAX);
-	  goto out;
-	}
-      else if (!isgraph((int)*p) && !isspace((int)*p))
-	{
-	  flag = 1;
-	}
-      ++p;
-    }
-    if (flag == 0)
-      {
-	sl_strlcpy(filetype, _("FILE:TEXT:ASCII"), SH_FTYPE_MAX);
-	goto out;
-      }
-  }
-  sl_strlcpy(filetype, _("FILE:UNKNOWN:UNKNOWN"), SH_FTYPE_MAX);
- out:
-  return filetype;
-}
-
-#if !defined(SH_FILE_MAIN)
-
-int matches_filetype(SL_TICKET ft, char * test_type)
-{
-  char buffer[3072];
-  char filetype[SH_FTYPE_MAX];
-  long len;
-
-  len = sl_read_timeout (ft, buffer, sizeof(buffer), 12, S_TRUE);
-
-  sl_rewind(ft);
-
-  if (len > 0)
-    {
-      check_filetype(filetype, buffer, len);
-    }
-  else
-    {
-      sl_strlcpy(filetype, _("FILE:UNKNOWN:UNKNOWN"), SH_FTYPE_MAX);
-    }
-
-  if (0 == strcmp(filetype, test_type))
-    {
-      return 1;
-    }
-
-  return 0;
-}
-
-#else
-/* SH_FILE_MAIN */
-#include <unistd.h>
-
-int main (int argc, char * argv[])
-{
-  char buffer[3072];
-  char filetype[SH_FTYPE_MAX];
-  size_t len;
-
-  FILE * fh = fopen(argv[1], "r");
-
-  if (fh)
-    {
-      int fd = fileno(fh);
-
-      len = read(fd, buffer, 3072);
-
-      check_filetype(filetype, buffer, len);
-
-      fprintf(stdout, "%s: %s\n", argv[1], filetype);
-
-      fclose(fh);
-      
-      return 0;
-    }
-  return 1;
-}
-#endif
-
-#endif
-/* #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) */
Index: trunk/src/sh_filter.c
===================================================================
--- trunk/src/sh_filter.c	(revision 591)
+++ 	(revision )
@@ -1,301 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2009 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-
-#include "config_xor.h"
-
-#include <string.h>
-#ifdef HAVE_REGEX_H
-#include <regex.h>
-#endif
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_mem.h"
-#include "sh_filter.h"
-
-#undef  FIL__
-#define FIL__  _("sh_filter.c")
-
-
-void sh_filter_free (sh_filter_type * filter)
-{
-  int i;
-
-  if (filter)
-    {
-      for (i = 0; i < filter->for_c; ++i) {
-#ifdef HAVE_REGEX_H
-	if (filter->for_v[i])
-	  regfree(filter->for_v[i]);
-#else
-	if (filter->for_v[i])
-	  SH_FREE(filter->for_v[i]);
-#endif
-	filter->for_v[i] = NULL; 
-      }
-      filter->for_c = 0;
-
-      for (i = 0; i < filter->fand_c; ++i) {
-#ifdef HAVE_REGEX_H
-	if (filter->fand_v[i])
-	  regfree(filter->fand_v[i]);
-#else
-	if (filter->fand_v[i])
-	  SH_FREE(filter->fand_v[i]);
-#endif
-	filter->fand_v[i] = NULL; 
-      }
-      filter->fand_c = 0;
-
-      for (i = 0; i < filter->fnot_c; ++i) {
-#ifdef HAVE_REGEX_H
-	if (filter->fnot_v[i])
-	  regfree(filter->fnot_v[i]);
-#else
-	if (filter->fnot_v[i])
-	  SH_FREE(filter->fnot_v[i]);
-#endif
-	filter->fnot_v[i] = NULL; 
-      }
-      filter->fnot_c = 0;
-    }
-}
-
-
-int sh_filter_add (const char * str, sh_filter_type * filter, int type)
-{
-  int     i = 0;
-  int     flag = 0;
-  size_t  s;
-
-  char  * dupp;
-  char  * p;
-  char  * end;
-  int   * ntok;
-  void ** stok;
-
-  SL_ENTER(_("sh_filter_filteradd"));
-
-  if (NULL == str || NULL == filter)
-    {
-      SL_RETURN((-1), _("sh_filter_filteradd")); 
-    }
-
-  if (type == SH_FILT_OR) {
-    ntok = &(filter->for_c);
-    stok = filter->for_v;
-  }
-  else if (type == SH_FILT_AND) {
-    ntok = &(filter->fand_c);
-    stok = filter->fand_v;
-  }
-  else if (type == SH_FILT_NOT) {
-    ntok = &(filter->fnot_c);
-    stok = filter->fnot_v;
-  }
-  else {
-    SL_RETURN((-1), _("sh_filter_filteradd")); 
-  }
-
-  /* cppcheck-suppress uninitvar */
-  i = *ntok;
-  if (i == SH_FILT_NUM) {
-    SL_RETURN((-1), _("sh_filter_filteradd")); 
-  }
-
-  dupp = sh_util_strdup(str);
-  p   = dupp;
-
-  do
-    {
-      while (*p == ',' || *p == ' ' || *p == '\t')
-	++p;
-      if (*p == '\0')
-	break;
-
-      end = p; ++end;
-      if (*end == '\0')
-	break;
-
-      if (*p == '\'')
-	{
-	  ++p; end = p; if (*end != '\'') ++end;
-	  if (*p == '\0' || *end == '\0')
-	    break;
-	  while (*end != '\0' && *end != '\'')
-	    ++end;
-	}
-      else if (*p == '"')
-	{
-	  ++p; end = p; if (*end != '"') ++end;
-	  if (*p == '\0' || *end == '\0')
-	    break;
-	  while (*end != '\0' && *end != '"')
-	    ++end;
-	}
-      else
-	{
-	  while (*end != '\0' && *end != ',' && *end != ' ' && *end != '\t')
-	    ++end;
-	}
-      if (*end == '\0')
-	flag = 1;
-      else
-	*end = '\0';
-
-      s = strlen(p);
-      if (s > 0) 
-	{
-	  ++s;
-#ifdef HAVE_REGEX_H
-	  if (stok[i] != NULL)
-	    regfree((regex_t *) stok[i]);
-	  {
-	    int status;
-
-	    stok[i] = SH_ALLOC(sizeof(regex_t));
-
-	    status = regcomp((regex_t *) stok[i], p, 
-				 REG_NOSUB|REG_EXTENDED);
-	    if (status != 0) 
-	      {
-		char * errbuf = SH_ALLOC(BUFSIZ);
-		(void) regerror(status, (regex_t *) stok[i], 
-				errbuf, BUFSIZ); 
-		errbuf[BUFSIZ-1] = '\0';
-		sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_REGEX,
-				 errbuf, p);
-		SH_FREE(errbuf);
-	      }
-	  }
-#else
-	  if (stok[i] != NULL)
-	    SH_FREE(stok[i]);
-
-	  stok[i] = SH_ALLOC(s);
-	  (void) sl_strlcpy((char *) stok[i], p, s);
-#endif
-	  ++i;
-	}
-
-      p = end; ++p;
-
-      if (i == SH_FILT_NUM)
-	break;
-    }
-  while (p != NULL && *p != '\0' && flag == 0);
-
-  *ntok = i;
-  SH_FREE(dupp);
-
-  SL_RETURN (0, _("sh_filter_filteradd"));
-}
-
-#ifdef HAVE_REGEX_H
-static int sh_filter_cmp(const char * message, void * pattern)
-{
-  int result;
-
-  result = regexec((regex_t *)pattern, message, 0, NULL, 0);
-
-  if (result != 0)
-    return -1;
-
-  /* Successful match. */
-  return 0;
-}
-#else
-static int sh_filter_cmp(const char * message, void * pattern)
-{
-  if (NULL == sl_strstr(message, (char *)pattern))
-    return -1;
-
-  /* Successful match. */
-  return 0;
-}
-#endif
-
-/*
- * -- Check filters. Returns 0 if message passes.
- */ 
-int sh_filter_filter (const char * message, sh_filter_type * filter)
-{
-  int i;
-
-  SL_ENTER(_("sh_filter_filter"));
-
-  if (filter)
-    {
-
-      /* Presence of any of these keywords prevents execution.
-       */
-      if (filter->fnot_c > 0)
-	{
-	  for (i = 0; i < filter->fnot_c; ++i)
-	    {
-	      if (0 == sh_filter_cmp(message, filter->fnot_v[i]))
-		{
-		  SL_RETURN ((-1), _("sh_filter_filter"));
-		}
-	    }
-	}
-      
-      /* Presence of all of these keywords is required for execution.
-       */
-      if (filter->fand_c > 0)
-	{
-	  for (i = 0; i < filter->fand_c; ++i)
-	    {
-	      if (0 != sh_filter_cmp(message, filter->fand_v[i]))
-		{
-		  SL_RETURN ((-1), _("sh_filter_filter"));
-		}
-	    }
-	}
-      
-      /* Presence of at least one of these keywords is required for execution.
-       */
-      if (filter->for_c > 0)
-	{
-	  for (i = 0; i < filter->for_c; ++i)
-	    {
-	      if (0 == sh_filter_cmp(message, filter->for_v[i]))
-		{
-		  goto isok;
-		}
-	    }
-	  SL_RETURN ((-1), _("sh_filter_filter"));
-	}
-    }
-
- isok:
-  SL_RETURN ((0), _("sh_filter_filter"));
-}
-
-sh_filter_type * sh_filter_alloc(void)
-{
-  sh_filter_type * filter = SH_ALLOC(sizeof(sh_filter_type));
-
-  memset(filter, 0, sizeof(sh_filter_type));
-  filter->for_c  = 0; 
-  filter->fand_c = 0; 
-  filter->fnot_c = 0;
-  return filter;
-}
Index: trunk/src/sh_forward.c
===================================================================
--- trunk/src/sh_forward.c	(revision 1)
+++ trunk/src/sh_forward.c	(revision 1)
@@ -0,0 +1,5652 @@
+/* SAMHAIN file system integrity testing                                   */
+/* Copyright (C) 1999, 2000 Rainer Wichmann                                */
+/*                                                                         */
+/*  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.              */
+
+#include "config_xor.h"
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/* Must be early on FreeBSD
+ */
+#include <sys/types.h>
+
+/* must be .le. than (1020 * 64)
+ * (see sh_tools.c -- put_header)
+ *
+ * also: must be  (N * 16), otherwise
+ * binary files cannot be transferred encrypted
+ *
+ * 65280 = (1020*64)
+ * #define TRANS_BYTES 8000  V0.8
+ */
+#ifdef  SH_ENCRYPT_2
+#define TRANS_BYTES 65120
+#else
+#define TRANS_BYTES 65280
+#endif
+
+/* timeout for session key
+ */
+#define TIMEOUT_KEY 7200
+
+/* max time between connection attempts
+ */
+#define TIMEOUT_CON 2048 
+
+/* #undef  SRP_DEBUG */
+/* #define SRP_DEBUG */
+
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+
+/*
+#ifdef TM_IN_SYS_TIME
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+*/
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#ifdef  HAVE_UNISTD_H
+#include <errno.h>
+#include <signal.h>
+#include <setjmp.h>
+#include <pwd.h>
+#include <grp.h>
+#include <sys/stat.h>
+#include <sys/resource.h>
+#include <fcntl.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#endif
+
+#ifndef FD_SET
+#define NFDBITS         32
+#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#endif /* !FD_SET */
+#ifndef FD_SETSIZE
+#define FD_SETSIZE      32
+#endif
+#ifndef FD_ZERO
+#define FD_ZERO(p)      memset((char *)(p), '\0', sizeof(*(p)))
+#endif
+
+#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
+#include <sys/mman.h>
+#endif
+
+
+#include <netdb.h> 
+#include <sys/types.h> 
+#include <netinet/in.h> 
+#include <sys/socket.h> 
+#ifndef S_SPLINT_S
+#include <arpa/inet.h>
+#endif
+
+#include "samhain.h"
+#include "sh_tiger.h"
+#include "sh_utils.h"
+#include "sh_unix.h"
+#include "sh_forward.h"
+#include "sh_srp.h"
+#include "sh_fifo.h"
+#include "sh_tools.h"
+#include "sh_entropy.h"
+#include "sh_html.h"
+#include "sh_mail.h"
+#include "sh_socket.h"
+#define SH_NEED_GETHOSTBYXXX
+#include "sh_static.h"
+
+#ifdef SH_ENCRYPT
+#include "rijndael-api-fst.h"
+char * sh_tools_makePack (unsigned char * header, 
+			  char * payload, int payload_size,
+			  keyInstance * keyInstE);
+char * sh_tools_revertPack (unsigned char * header, char * message,
+			    keyInstance * keyInstE, 
+			    unsigned long message_size);
+#endif
+
+/* define this if you want to debug the client/server communication */
+/* #define SH_DBG_PROT 1 */
+
+#ifdef  SH_DBG_PROT
+#define SH_SHOWPROT(c,d) sh_tools_show_header((c), (d))
+#else
+#define SH_SHOWPROT(c,d) 
+#endif
+
+/* the port client will be connecting to 
+ */
+#ifndef SH_DEFAULT_PORT
+#define SH_DEFAULT_PORT 49777    
+#endif
+
+#ifndef SH_SELECT_REPEAT
+#define SH_SELECT_REPEAT 60
+#endif
+
+#ifndef SH_HEADER_SIZE
+#define SH_HEADER_SIZE 7
+#endif
+
+#ifndef SH_CHALLENGE_SIZE
+#define SH_CHALLENGE_SIZE 9
+#endif
+
+#undef  FIL__
+#define FIL__  _("sh_forward.c")
+
+int     clt_class = (-1);
+
+#ifndef SH_STANDALONE
+
+#if defined(WITH_TRACE) || defined(WITH_TPT) 
+char * hu_trans(const char * ihu)
+{
+  static char ohu[17];
+  sprintf(ohu, _("%c%03o"), '\\',                   /* known to fit  */
+	  (unsigned char) ihu[0]);
+  sprintf(&(ohu[4]), _("%c%03o"), '\\',             /* known to fit  */
+	  (unsigned char) ihu[1]);
+  sprintf(&(ohu[8]), _("%c%03o"), '\\',             /* known to fit  */
+	  (unsigned char) ihu[2]);
+  sprintf(&(ohu[12]), _("%c%03o"), '\\',            /* known to fit  */
+	  (unsigned char) ihu[3]);
+  ohu[16] = '\0';
+  return ohu;
+}
+#endif
+
+static int StripDomain = S_TRUE;
+
+int sh_forward_set_strip (char * str)
+{
+  static int fromcl = 0;
+  char dummy[2] = "F";
+
+  if (fromcl == 1)
+    return 0;
+
+  if (str == NULL)
+    {
+      fromcl = 1;
+      return (sh_util_flagval(dummy, &StripDomain));
+    }
+  else
+    return (sh_util_flagval(str, &StripDomain));
+}
+
+#include <ctype.h>
+
+const char * sh_strip_domain (char *name)
+{
+  char *          first;
+  static char     name_2[SH_MINIBUF+1];
+  register int    i = 0;
+
+  SL_ENTER(_("sh_strip_domain"));
+
+  if (StripDomain == S_FALSE || (first  = strchr(name, '.')) == NULL) 
+    {
+      SL_RETURN( name, _("sh_strip_domain"));
+    }
+  else
+    {
+
+      /* check whether it is in dotted number format
+       * --> last part must be kept
+       */
+      if (0 != is_numeric(name))
+	{
+	  SL_RETURN( name, _("sh_strip_domain"));
+	  /*
+	  i = sl_strlen(name) - 1;
+	  while (name[i] != '.' && i >= 0)
+	    --i;
+	  if (name[i] == '.') ++i;
+	  sl_strlcpy( name_2, &name[i], SH_MINIBUF +1 );
+	  */
+	}
+      else
+	{
+	  memset (name_2, 0, SH_MINIBUF+1);
+	  first = name;
+	  while (i < SH_MINIBUF && *first != '.' && *first != '\0')
+	    {
+	      name_2[i] = *first;
+	      ++first; ++i;
+	    }
+	  name_2[SH_MINIBUF] = '\0';
+	}
+    }
+
+  SL_RETURN( name_2, _("sh_strip_domain"));
+}
+
+/* #ifndef SH_STANDALONE */
+#endif
+
+#ifndef USE_SRP_PROTOCOL
+static
+void sh_passwd (char * salt, char * password, char * nounce, char *hash)
+{
+
+  char           *combi;
+  size_t          len;
+  register int i;
+  unsigned char * dez = NULL;
+
+  if (password == NULL)
+    dez = (unsigned char *) &(skey->pw[0]);
+  else if (sl_strlen(password) < PW_LEN)
+    {
+      fprintf(stderr, _("Password has less than %d chars !\n"),
+		   PW_LEN);
+      _exit(EXIT_FAILURE);
+    }
+
+  if (password == NULL)
+    {
+      /* --- copy password ---
+       */
+      for (i = 0; i < PW_LEN; ++i)
+	{ 
+	  skey->vernam[i] = (char)(*dez); 
+	  ++dez; 
+	}
+      (void) sl_strlcpy (skey->vernam,
+			 sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN), 
+			 KEY_LEN+1);
+    }
+  else
+    {
+      (void) sl_strlcpy (skey->vernam, password, KEY_LEN+1);
+    }
+
+  len = sl_strlen(salt) + sl_strlen(skey->vernam) + 1;
+  if (nounce != NULL) 
+    len += sl_strlen(nounce);
+  
+  /* H(s,P)
+   */
+  combi = SH_ALLOC(len);
+  (void) sl_strlcpy (combi, salt, len);
+  (void) sl_strlcat (combi, skey->vernam, len);
+  if (nounce != NULL)
+    (void) sl_strlcat (combi, nounce, len);
+  (void) sl_strlcpy (hash, 
+		     sh_tiger_hash(combi, TIGER_DATA, 
+				   (unsigned long) sl_strlen(combi)),
+		     KEY_LEN+1);
+
+  /*
+    fprintf(stderr, "DD: A: <%s>\n", salt);
+    fprintf(stderr, "DD: P: <%s>\n", skey->pw); 
+    fprintf(stderr, "DD: V: <%s>\n", skey->vernam); 
+    fprintf(stderr, "DD: C: <%s>\n", combi);
+    fprintf(stderr, "DD: H: <%s>\n", hash); 
+  */
+
+  SH_FREE (combi);
+  hash[KEY_LEN] = '\0';
+  return;
+}
+#endif
+
+#ifdef SH_WITH_CLIENT
+
+static int count_dev_server = 0;
+
+void reset_count_dev_server(void)
+{
+  count_dev_server = 0;
+  return;
+}
+
+int sh_forward_setlogserver (char * address)
+{
+  SL_ENTER(_("sh_forward_setlogserver"));
+
+  if (address != NULL && count_dev_server < 2 
+      && sl_strlen(address) < SH_PATHBUF && sl_strlen(address) > 0) 
+    {
+      if (count_dev_server == 0)
+	(void) sl_strlcpy (sh.srvexport.name, address, SH_PATHBUF);
+      else
+	(void) sl_strlcpy (sh.srvexport.alt,  address, SH_PATHBUF);
+
+      ++count_dev_server;
+      SL_RETURN (0, _("sh_forward_setlogserver"));
+    }
+  SL_RETURN (-1, _("sh_forward_setlogserver"));
+}
+
+static
+int sh_forward_send_intern (int mysocket, char protocol, char * micro, 
+			    char * msgbuf, unsigned long length, int docrypt)
+{
+  unsigned long           numbytes, countbytes;
+  int                     flag_err = 0;
+  unsigned char           head[SH_HEADER_SIZE];
+  char                  * outbuf;
+
+#ifdef SH_ENCRYPT
+
+  unsigned long           blkfac;
+  int                     rem;
+  unsigned long           length2;
+  char                  * msg2buf = NULL;
+  char                  * p, * q;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
+  unsigned long           j;
+  cipherInstance          cipherInst;
+  int                     err_num;
+#else
+  docrypt = SL_FALSE; /* dummy to fix compiler warning */
+#endif
+
+  SL_ENTER(_("sh_forward_send_intern"));
+
+#ifdef SH_ENCRYPT
+  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_EN2) != (char)0))
+    {
+      put_header (head, (int)protocol, &length, micro);
+      msg2buf  = sh_tools_makePack (head, msgbuf, (int) length, 
+				    &(skey->keyInstE));
+      /*@-usedef@*/
+      length   = (unsigned long) (256 * (unsigned int)head[1] + 
+				  (unsigned int)head[2]);
+      /*@+usedef@*/
+      outbuf   = msg2buf;
+    }
+  else if ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != (char)0))
+    {
+      blkfac  = length/B_SIZ;
+      rem     = (int) (length - (B_SIZ * blkfac));
+      length2 = (B_SIZ * blkfac) + ((rem == 0) ? 0 : B_SIZ);
+
+      msg2buf = SH_ALLOC((size_t)length2);
+      p       = msgbuf;
+      q       = msg2buf;
+      
+      err_num = cipherInit (&cipherInst, (RIJ_BYTE)MODE_CBC, NULL);
+
+      if (err_num < 0)
+	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			errorExplain(err_num), 
+			_("sh_forward_send_intern: cipherInit"));
+
+
+      for (j = 0; j < blkfac; ++j)
+	{
+	  memcpy(inBlock, p, B_SIZ);
+	  err_num = blockEncrypt(&cipherInst, &(skey->keyInstE), 
+				 inBlock, 128 * BNUM, outBlock);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_send_intern: blockEncrypt"));
+	  memcpy(q, outBlock, B_SIZ);
+	  p += B_SIZ;
+	  q += B_SIZ;
+	}
+      if (rem > 0)
+	{
+	  memset(inBlock, 0, B_SIZ);
+	  memcpy(inBlock, p, (size_t)rem);
+	  err_num = blockEncrypt(&cipherInst, &(skey->keyInstE), 
+				 inBlock, 128 * BNUM, outBlock);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_send_intern: blockEncrypt"));
+	  memcpy(q, outBlock, B_SIZ);
+	  q += B_SIZ;
+	}
+
+      outbuf = msg2buf;
+      length = length2;
+      put_header (head, (int)protocol, &length, micro);
+    }
+  else
+    {
+      outbuf = msgbuf;
+      put_header (head, (int)protocol, &length, micro);
+    }
+#else
+  outbuf = msgbuf;
+  put_header (head, (int)protocol, &length, micro);
+#endif
+
+  SH_SHOWPROT(head,'>');
+  
+  numbytes     = SH_HEADER_SIZE;
+  countbytes   = write_port (mysocket, 
+			     (char *) head, numbytes,
+			     &flag_err, 300);
+
+  if (countbytes == numbytes && outbuf != NULL)
+    {
+      numbytes     = (length);
+      countbytes   = write_port (mysocket, 
+				 outbuf, numbytes,
+				 &flag_err, 300);
+    }
+
+#ifdef SH_ENCRYPT
+  /*@-usedef@*/
+  if (msg2buf != NULL)
+    SH_FREE(msg2buf);
+  /*@+usedef@*/
+#endif
+
+  if (countbytes == numbytes)
+    {
+      SL_RETURN( 0, _("sh_forward_send_intern"));
+    }
+  else
+    {
+      SL_RETURN( flag_err, _("sh_forward_send_intern"));
+    }
+}
+static
+int sh_forward_send (int mysocket, char protocol, char * micro, 
+		     char * msgbuf, unsigned long length)
+{
+  int i;
+  SL_ENTER(_("sh_forward_send"));
+  TPT(( 0, FIL__, __LINE__, _("msg=<Send.>\n")));
+  i =  sh_forward_send_intern (mysocket, protocol, micro, 
+			       msgbuf, length, S_FALSE);
+  SL_RETURN(i, _("sh_forward_send"));
+}
+static
+int sh_forward_send_crypt (int mysocket, char protocol, char * micro, 
+			   char * msgbuf, unsigned long length)
+{
+  int i;
+  SL_ENTER(_("sh_forward_send_crypt"));
+#ifdef SH_ENCRYPT
+  TPT(( 0, FIL__, __LINE__, _("msg=<Send encrypted.>\n")));
+#else
+  TPT(( 0, FIL__, __LINE__, _("msg=<Send.>\n")));
+#endif
+  i = sh_forward_send_intern (mysocket, protocol, micro, 
+			      msgbuf, length, S_TRUE);
+  SL_RETURN(i, _("sh_forward_send_crypt"));
+}
+
+
+/* receive answer, add a trailing NULL to terminate string
+ * rev 0.8
+ */
+static
+long sh_forward_receive_intern (int mysocket, char protocol, char * micro,     
+				char *  msgbuf, unsigned long length, 
+				int docrypt)
+{
+  unsigned long numbytes, countbytes;
+  int           flag_err = -1;
+  unsigned char head[SH_HEADER_SIZE];
+
+#ifdef SH_ENCRYPT
+
+  unsigned long           head_length;
+  unsigned long           blkfac;
+  /* unsigned long           length2; */
+  char                  * p, * q, * tmp;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
+  unsigned long           j;
+  cipherInstance          cipherInst;
+  int                     err_num;
+#else
+  docrypt = SL_FALSE; /* dummy to fix compiler warning */
+#endif
+
+  SL_ENTER(_("sh_forward_receive_intern"));
+
+  if (micro != NULL)
+    micro[4]     = '\0';
+
+  if (msgbuf != NULL)
+    msgbuf[0]     = '\0';
+
+  numbytes     = SH_HEADER_SIZE;
+  countbytes   = read_port (mysocket, 
+			    (char *) head, numbytes,
+			    &flag_err, 300);
+
+  if (countbytes != numbytes)
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<countbytes != numbytes>\n")));
+      SL_RETURN(flag_err, _("sh_forward_receive_intern"));
+    }
+  /*@-usedef +ignoresigns@*/
+  else if (head[0] != protocol &&  
+	   (head[0] & SH_PROTO_SRP) == (char)0 /* not set */)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISMATCH);
+      SL_RETURN((-1), _("sh_forward_receive_intern"));
+    }
+  /*@+usedef -ignoresigns@*/
+  else
+    {
+      get_header (head, &numbytes, micro);
+      SH_SHOWPROT(head, '<');
+
+      if (numbytes > 0)
+	{
+	  numbytes = (numbytes > length ? length : numbytes);
+
+	  countbytes   = read_port (mysocket, 
+				    msgbuf, numbytes,
+				    &flag_err, 300);
+
+	  if (countbytes < length)
+	    msgbuf[countbytes] = '\0';
+	  else
+	    msgbuf[length-1] = '\0';
+
+	  if (flag_err != 0)
+	    {
+	      TPT(( 0, FIL__, __LINE__, _("msg=<read error>\n")));
+	      SL_RETURN((-1), _("sh_forward_receive_intern"));
+	    }
+	}
+    }
+
+#ifdef SH_ENCRYPT
+  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_EN2) != (char)0))
+    {
+      tmp = SH_ALLOC((size_t)length);
+      memcpy(tmp, msgbuf, (size_t)length);
+      tmp = sh_tools_revertPack (head, tmp, &(skey->keyInstD), countbytes);
+
+      head_length = (unsigned long) (256 * (unsigned int)head[1] + 
+				     (unsigned int)head[2]);
+      head_length = (head_length > length ? length : head_length);
+      length      = head_length;
+
+      memcpy(msgbuf, tmp, (size_t)length);
+      msgbuf[length] = '\0';
+      SH_FREE(tmp);
+      if (countbytes == numbytes) 
+	{
+	  countbytes = length; /* to avoid error on return, see below */
+	}
+      numbytes = length;
+    }
+  else if ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != (char)0))
+    {
+      /* Decrypt only complete blocks. If there is an incomplete block,
+       * something is wrong anyway.
+       * Decrypt in place.
+       */
+      blkfac  = countbytes/B_SIZ;
+      /* length2 = (B_SIZ * blkfac); */
+      p       = msgbuf;
+      q       = msgbuf;
+      
+      err_num = cipherInit (&cipherInst, (RIJ_BYTE)MODE_CBC, NULL);
+
+      if (err_num < 0)
+	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			errorExplain(err_num), 
+			_("sh_forward_receive_intern: cipherInit"));
+
+      for (j = 0; j < blkfac; ++j)
+	{
+	  memcpy(inBlock, p, B_SIZ);
+	  err_num = blockDecrypt(&cipherInst, &(skey->keyInstD), 
+				 inBlock, 128 * BNUM, outBlock);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_receive_intern: blockDecrypt"));
+	  memcpy(q, outBlock, B_SIZ);
+	  p += 16;
+	  q += 16;
+	}
+    }
+#endif
+
+  if (countbytes == numbytes)
+    {
+      SL_RETURN(((long)numbytes), _("sh_forward_receive_intern"));
+    }
+  else
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<short read>\n")));
+      SL_RETURN(flag_err, _("sh_forward_receive_intern"));
+    }
+}
+
+static
+long sh_forward_receive (int mysocket, char protocol, char * micro,     
+			 char * msgbuf, unsigned long length)
+{
+  long i;
+  SL_ENTER(_("sh_forward_receive"));
+  TPT(( 0, FIL__, __LINE__, _("msg=<Receive.>\n")));
+  i = sh_forward_receive_intern (mysocket, protocol, micro, 
+				 msgbuf, length, S_FALSE);
+  SL_RETURN(i, _("sh_forward_receive"));
+}
+
+static
+long sh_forward_receive_crypt (int mysocket, char protocol, char * micro,     
+			       char * msgbuf, unsigned long length)
+{
+  long i;
+  SL_ENTER(_("sh_forward_receive_crypt"));
+#ifdef SH_ENCRYPT
+  TPT(( 0, FIL__, __LINE__, _("msg=<Receive encrypted.>\n")));
+#else
+  TPT(( 0, FIL__, __LINE__, _("msg=<Receive.>\n")));
+#endif
+  i = sh_forward_receive_intern (mysocket, protocol, micro, 
+				 msgbuf, length, S_TRUE);
+  SL_RETURN(i, _("sh_forward_receive"));
+}
+
+/**************************************************
+ *
+ *
+ *  C L I E N T  
+ *
+ *
+ ***************************************************/
+
+
+#include <time.h>
+
+static SH_FIFO * fifo = NULL;
+
+static long sh_forward_try (char * errmsg);
+
+
+long sh_forward (char * errmsg)
+{
+  static int           have_server = GOOD;
+  long   status;
+  char * popmsg;
+  static int failed = GOOD;
+
+  SL_ENTER(_("sh_forward"));
+
+  /* --- No log server available. ---
+   */
+  if (have_server == GOOD && sh.srvexport.name[0] == '\0')
+    {
+      have_server = BAD;
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NONAME);
+      SL_RETURN (-1, _("sh_forward"));
+    }
+  else if (have_server == BAD)
+    {
+      SL_RETURN (-1, _("sh_forward"));
+    }
+
+  /* --- Allocate fifo. ---
+   */
+  if (fifo == NULL)
+    {
+      fifo = SH_ALLOC(sizeof(SH_FIFO));
+      fifo_init(fifo);
+    }
+
+  /* --- Check for messages on the queue, and send them first. ---
+   */
+  while (NULL != (popmsg = pop_list(fifo)) )
+    {
+      status = sh_forward_try (popmsg);
+      if (status != 0)
+	{
+	  (void) push_tail_list (fifo, popmsg); 
+	  SH_FREE(popmsg);
+	  if (SH_FIFO_MAX == push_list (fifo, errmsg))
+	    {
+	      SL_RETURN (-2, _("sh_forward"));
+	    }
+	  SL_RETURN (-1, _("sh_forward"));
+	}
+      SH_FREE(popmsg);
+    }
+
+  /* --- Now send the error message. ---
+   */ 
+  status = sh_forward_try (errmsg);
+  if (status != 0)
+    {
+      if (failed == GOOD)
+	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
+			 _("log server"), 
+			 sh.srvexport.name);
+      failed = BAD;
+      if (SH_FIFO_MAX == push_list (fifo, errmsg))    /* push message on stack */
+	{
+	  SL_RETURN (-2, _("sh_forward"));
+	}
+      SL_RETURN (-1, _("sh_forward"));
+    }
+
+  failed = GOOD;
+  SL_RETURN (0, _("sh_forward"));  
+}
+
+static long sh_forward_try_impl (char * errmsg, char what);
+
+static long sh_forward_try (char * errmsg)
+{
+  long i;
+  SL_ENTER(_("sh_forward_try"));
+  i = sh_forward_try_impl (errmsg, (char)SH_PROTO_MSG);
+  SL_RETURN(i, _("sh_forward_try")); 
+}
+
+long sh_forward_req_file (char * file)
+{
+  long i;
+  char tmp_file[8];
+  SL_ENTER(_("sh_forward_req_file"));
+  (void) sl_strlcpy(tmp_file, file, 8);
+  i = sh_forward_try_impl (tmp_file, (char)SH_PROTO_BIG);
+  SL_RETURN(i, _("sh_forward_req_file")); 
+}
+
+static  long sh_forward_try_impl (char * errmsg, char what)
+{
+  static int           initialized = BAD;
+  static int           conn_state  = GOOD;
+  int                  sockfd;
+  int                  flag_err;
+  char               * answer;
+
+  unsigned char        theProto;
+
+  char                 hash[KEY_LEN+1];
+  size_t               len;
+  char               * buffer;
+#ifdef SH_ENCRYPT_2
+  size_t               pos;  /* for the server command */
+#endif
+  char   head_u[5];
+
+  char   nsrv[KEY_LEN+1];
+  char   nclt[KEY_LEN+1];
+  SL_TICKET sfd = -1;
+  int    transfercount;
+
+  char   foo_M1[KEY_LEN+1];
+  UINT32 ticks;
+
+  char         error_msg[256];
+  char         error_call[SH_MINIBUF];
+  int          error_num = 0;
+
+#ifdef USE_SRP_PROTOCOL
+  char   u_real[SH_CHALLENGE_SIZE];
+  char * foo_A;
+  char * foo_Sc;
+  char * M;
+#else
+  char   nounce[KEY_LEN+1];
+  char   temp[2*KEY_LEN+1];
+  char   nonce_u[KEY_LEN+1];
+#endif
+  
+#ifdef SH_ENCRYPT
+  int err_num;
+#endif
+
+  static time_t time_now  = 1200;
+  static time_t time_last =    0;
+
+  static time_t timeout_val =  1;
+
+  SL_ENTER(_("sh_forward_try_impl"));
+
+  /* --- No message to transmit. ---
+   */
+  if (errmsg == NULL && initialized == GOOD)
+    SL_RETURN( 0, _("sh_forward_try_impl"));
+  
+  /* --- Connection in bad state. ---
+   */
+  if (initialized == BAD || conn_state == BAD)
+    {
+      timeout_val = 
+	(time_t)((timeout_val > TIMEOUT_CON) ? TIMEOUT_CON : timeout_val);
+
+      /* --- Retry bad attempt only after some time. ---
+       */
+      time_now  = time (NULL);
+      if ((time_now - time_last) < timeout_val) 
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<Within deadtime, no retry.>\n")));
+	  SL_RETURN( (-1), _("sh_forward_try_impl"));
+	}
+      TPT(( 0, FIL__, __LINE__, _("msg=<Retry.>\n")));
+    }
+  time_last  = time (NULL);
+
+
+  /* --- Try to connect to log server. ---
+   */
+  error_call[0] = '\0';
+
+  sockfd = connect_port_2 (sh.srvexport.name, sh.srvexport.alt, 
+			   SH_DEFAULT_PORT, 
+			   error_call, &error_num, error_msg, 256);
+
+  if (sockfd < 0)
+    {
+      conn_state = BAD;
+      timeout_val *= 2;
+      sh_error_handle ((-1), FIL__, __LINE__, error_num, 
+		       MSG_E_NET, error_msg, error_call,
+		       _("export"), sh.srvexport.name);
+      SL_RETURN( (-1), _("sh_forward_try_impl"));
+    }
+
+  conn_state = GOOD;
+
+  /*************************
+   *
+   *  initialization
+   * 
+   */
+
+  flag_err = 0;
+  answer   = SH_ALLOC(512);
+  MLOCK(answer, 512);
+
+
+#ifndef USE_SRP_PROTOCOL
+
+  /**************************************************
+   *
+   * --- challenge/response authentication ---
+   *
+   **************************************************/
+
+  if (initialized == BAD)
+    {
+      theProto = (unsigned char) SH_PROTO_SRP;
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<c/r: entry>\n")));
+
+      (void) sl_strlcpy (answer, sh.host.name, 512);
+
+      flag_err = sh_forward_send (sockfd, (char) theProto, _("SALT"), 
+				  answer,  (unsigned long)sl_strlen(answer));
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<c/r: sent SALT, flag_err = %d>\n"), 
+	    flag_err));
+
+      /* get nonce from server
+       */
+      if (flag_err == 0)
+	{
+	  flag_err = (int) sh_forward_receive (sockfd, (char)theProto, head_u, 
+					       answer,  511);
+	  flag_err = (flag_err < 0) ? flag_err : 0;
+	  TPT(( 0, FIL__, __LINE__, 
+		_("msg=<c/r: rcvt nonce, flag_err = %d>\n"), 
+		flag_err));
+	}
+
+      /* entry point for jump from message forward if session key must
+       * be re-initialized
+       */	 
+ initBlock:
+
+      if (0 == check_request (head_u, _("INIT")) && 
+	  flag_err == 0                         &&
+	  sl_strlen(answer) >  KEY_LEN )
+	(void) sl_strlcpy(nounce, &answer[KEY_LEN], KEY_LEN+1);
+      else
+	flag_err = (-1);
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<c/r: rcvt INIT, flag_err = %d>\n"), 
+	    flag_err));
+
+      /* verify random nonce v from server H(v, P)v
+       */
+      sh_passwd (nounce, NULL, NULL, temp);
+      if ( 0 != sl_strncmp(temp, answer, KEY_LEN))
+	flag_err = (-1);
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<c/r: vrfy nonce, flag_err = %d>\n"), 
+	    flag_err));
+
+
+      /* --- Create own nonce. ---
+       */
+      ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+				 &(skey->rng1[0]),
+				 &(skey->rng2[0]));
+      (void) sl_strlcpy(nonce_u, 
+			sh_tiger_hash((char *) &ticks, 
+				      TIGER_DATA, 
+				      (unsigned long)sizeof(UINT32)),
+			KEY_LEN+1);
+
+      /* --- Form the message H(H(u,v),P)u ---
+       */
+      (void) sl_strlcpy(temp, nonce_u, 2*KEY_LEN+1); 
+      (void) sl_strlcat(temp,  nounce, 2*KEY_LEN+1); 
+      (void) sl_strlcpy(temp, 
+			sh_tiger_hash(temp, 
+				      TIGER_DATA, 
+				      (unsigned long)sl_strlen(temp)),
+			KEY_LEN+1);
+      sh_passwd (temp, NULL, NULL, foo_M1);
+      (void) sl_strlcpy(temp, foo_M1, 2*KEY_LEN+1);
+      (void) sl_strlcat(temp, nonce_u, 2*KEY_LEN+1);
+
+      /* --- Send it to server. ---
+       */
+      if (flag_err == 0)
+	{
+	  flag_err = (int) sh_forward_send (sockfd, 
+					    (char)(theProto|SH_PROTO_SRP), 
+					    _("PASS"), temp, 
+					    (unsigned long)sl_strlen(temp));
+	  TPT(( 0, FIL__, __LINE__, _("msg=<c/r: sent PASS, flag_err = %d>\n"),
+		flag_err));
+	}
+
+      if (flag_err == 0)
+	{
+	  flag_err = (int)sh_forward_receive (sockfd,
+					      (char)(theProto|SH_PROTO_SRP), 
+					      head_u, answer,  511);  
+	  sh_passwd (nounce, NULL, nonce_u, foo_M1);
+	  (void) sl_strlcpy (skey->session, foo_M1, KEY_LEN+1);
+#ifdef SH_ENCRYPT
+	  err_num = makeKey(&(skey->keyInstE), 
+			    (RIJ_BYTE)DIR_ENCRYPT, 192, skey->session);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_try_impl: makeKey"));
+
+	  err_num = makeKey(&(skey->keyInstD), 
+			    (RIJ_BYTE)DIR_DECRYPT, 192, skey->session);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_try_impl: make_key"));
+#endif
+	  initialized = GOOD;
+	}
+
+      if (initialized == BAD)
+	{
+	  timeout_val *= 2;
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOAUTH);
+	  memset(answer, 0, sizeof(answer));
+	  MUNLOCK(answer, 512);
+	  SH_FREE(answer);
+	  SL_RETURN( (-1), _("sh_forward_try_impl"));
+	}
+      else
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_AUTH);
+	}
+    }    
+
+#else
+
+
+  /* This is the SRP authenticated key exchange protocol.
+   * Produces a session key skey->session.
+   */
+  if (initialized == BAD)
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<srp: entry>\n")));
+
+      theProto = SH_PROTO_SRP;
+
+      sl_strlcpy (answer, sh.host.name, 512);
+      flag_err = sh_forward_send    (sockfd, theProto, _("SALT "), 
+				     answer,  sl_strlen(answer)); 
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<srp: sent SALT, flag_err = %d>\n"), 
+	    flag_err));
+
+      if (flag_err == 0)
+	{
+	  flag_err = sh_forward_receive (sockfd, theProto, head_u, 
+					 answer,  511);
+	  flag_err = (flag_err < 0) ? flag_err : 0;
+	  TPT(( 0, FIL__, __LINE__, 
+		_("msg=<srp: rcvt nonce, flag_err = %d>\n"), 
+		flag_err));
+	}
+
+      /* Entry point for jump from message forward if session key must
+       * be re-initialized.
+       */	 
+    initBlock:
+      TPT(( 0, FIL__, __LINE__, _("msg=<srp: INIT>\n")));
+
+      if (flag_err == 0 &&
+	  (0 == check_request (head_u, _("INIT"))))
+	{
+	  if (0 != sh_srp_init())
+	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_EBGN);
+	  else /* if (0 == sh_srp_init()) */
+	    {
+	      TPT(( 0, FIL__, __LINE__, _("msg=<srp: bignum initialized>\n")));
+
+	      sh_srp_x (answer, NULL);  /* x        password      */
+	      sh_srp_make_a ();         /* a        random number */
+	      foo_A = sh_srp_A();       /* g^a                    */
+
+	      TPT(( 0, FIL__, __LINE__, _("msg=<srp: A = %s>\n"), foo_A));
+
+	      if (foo_A == NULL)
+		flag_err = (-1);
+
+	      if (flag_err == 0)
+		flag_err = sh_forward_send    (sockfd, 
+					       (theProto|SH_PROTO_SRP), 
+					       _("PC01"),
+					       foo_A, sl_strlen(foo_A)+1); 
+	      if (flag_err == 0)
+		{
+		  flag_err = sh_forward_receive (sockfd, 
+						 (theProto|SH_PROTO_SRP),
+						 head_u,
+						 answer, 511);
+		  flag_err = (flag_err < 0) ? flag_err : 0;
+		  TPT(( 0, FIL__, __LINE__, _("msg=<srp: B = %s>\n"), answer));
+		  TPT(( 0, FIL__, __LINE__, _("msg=<srp: u = %03o-%03o-%03o-%03o>\n"), head_u[0], head_u[1], head_u[2], head_u[3]));
+		}
+
+	      /*                     u        nounce        */
+	      /*                     B        answer        */
+	      /*                     S = (B-g^x)^(a+ux)     */
+	      
+	      if (flag_err == 0)
+		{ 
+		  if (0 != sh_srp_check_zero (answer))
+		    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_EZERO);
+		  else /* if (0 != sh_srp_check_zero (answer)) */
+		    {
+		      sl_strlcpy(u_real, sh_tiger_hash(head_u, TIGER_DATA, 4), 
+				 SH_CHALLENGE_SIZE);
+		      foo_Sc = sh_srp_S_c (u_real, answer);
+
+		      TPT(( 0, FIL__, __LINE__, _("msg=<srp: U = %s>\n"), 
+			    u_real));
+		      TPT(( 0, FIL__, __LINE__, _("msg=<srp:Sc = %s>\n"), 
+			    foo_Sc));
+
+		      /* --- Now send H(A,B,H(Sc)) and check. --- 
+		       */
+		      if (foo_Sc != NULL)
+			{
+			  sl_strlcpy(foo_M1, 
+				     sh_srp_M(foo_A, 
+					      answer, 
+					      sh_tiger_hash(foo_Sc, 
+							    TIGER_DATA, 
+							    sl_strlen(foo_Sc))),
+				     KEY_LEN+1);
+
+			  TPT(( 0, FIL__, __LINE__, _("msg=<srp:M1 = %s>\n"), 
+				foo_M1));
+
+			  flag_err = sh_forward_send(sockfd, 
+						     (theProto|SH_PROTO_SRP), 
+						     _("PC02"),
+						     foo_M1, KEY_LEN+1);
+			}
+		      else
+			{
+			  flag_err = (-1);
+			}
+
+		      if (flag_err == 0)
+			{
+			  flag_err =sh_forward_receive(sockfd, 
+						       (theProto|SH_PROTO_SRP),
+						       head_u, 
+						       answer, 511);
+			  flag_err = (flag_err < 0) ? flag_err : 0;
+			  TPT(( 0, FIL__, __LINE__, _("msg=<srp: M = %s>\n"), 
+				answer));
+			}
+
+		      if (flag_err == 0   &&
+			  (0 == check_request (head_u, _("PARP"))))
+			{
+			  /* ------  verify M2 = H(A, M1, K) --------
+			   */
+			  M = sh_srp_M (foo_A, foo_M1,
+					sh_tiger_hash(foo_Sc,
+						      TIGER_DATA,
+						      sl_strlen(foo_Sc)));
+			  if (M != NULL && 
+			      0 == sl_strncmp (answer, M, KEY_LEN+1))
+			    {
+			      sl_strlcpy (skey->session, 
+					  sh_tiger_hash(foo_Sc, 
+							TIGER_DATA,
+							sl_strlen(foo_Sc)),
+					  KEY_LEN+1);
+			      TPT(( 0, FIL__, __LINE__, 
+				    _("msg=<srp: Key = %s>\n"), 
+				    skey->session));
+
+#ifdef SH_ENCRYPT
+			      err_num = makeKey(&(skey->keyInstE), 
+						DIR_ENCRYPT, 
+						192, skey->session);
+			      if (err_num < 0)
+				sh_error_handle((-1), FIL__, __LINE__, -1, 
+						MSG_E_SUBGEN,
+						errorExplain(err_num), 
+						_("sh_forward_try_impl: makeKey"));
+			      err_num = makeKey(&(skey->keyInstD), 
+						DIR_DECRYPT, 
+						192, skey->session);
+			      if (err_num < 0)
+				sh_error_handle((-1), FIL__, __LINE__, -1, 
+						MSG_E_SUBGEN,
+						errorExplain(err_num), 
+						_("sh_forward_try_impl: makeKey"));
+#endif
+			      initialized = GOOD;
+			    }
+			}
+		      if (foo_Sc != NULL)
+			SH_FREE(foo_Sc);
+		    }
+		}
+	      if (foo_A != NULL)
+		SH_FREE(foo_A);
+	      sh_srp_exit();
+	    }
+	}
+
+      if (initialized == BAD)
+	{
+	  timeout_val *= 2;
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOAUTH);
+	  memset(answer, '\0', sizeof(answer));
+	  MUNLOCK(answer, 512);
+	  SH_FREE(answer);
+	  SL_RETURN( (-1), _("sh_forward_try_impl"));
+	}
+      else
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_AUTH);
+	}
+    }
+
+#endif
+
+  /* no message, just session key negotiated
+   */
+  if (errmsg == NULL)
+    {
+      timeout_val = 1;
+      memset(answer, 0, sizeof(answer));
+      MUNLOCK(answer, 512);
+      SH_FREE(answer);
+      TPT(( 0, FIL__, __LINE__, _("msg=<No message.>\n")));
+      SL_RETURN( (0), _("sh_forward_try_impl"));
+    }
+  else if (what == (char)SH_PROTO_BIG)
+    {
+      MUNLOCK(answer, 512);
+      SH_FREE (answer);
+      answer   = SH_ALLOC(TRANS_BYTES + 256);
+      MLOCK(answer, TRANS_BYTES + 256);
+      TPT(( 0, FIL__, __LINE__, _("msg=<File transfer.>\n")));
+    }
+
+
+  (void) sl_strlcpy (answer, sh_util_siggen(skey->session,
+					    sh.host.name,
+					    sl_strlen(sh.host.name)), 
+	      KEY_LEN+1);
+  TPT((0, FIL__, __LINE__, _("msg=<host %s>\n"), sh.host.name));
+  TPT((0, FIL__, __LINE__, _("msg=<ckey %s>\n"), skey->session));
+  TPT((0, FIL__, __LINE__, _("msg=<sign %s>\n"), answer));
+
+    
+  (void) sl_strlcat (answer, sh.host.name, 512);
+
+  TPT((0, FIL__, __LINE__, _("msg=<mesg %s>\n"), answer));
+
+  /***********************************************
+   *
+   * send the message
+   *
+   */
+
+  if (what == (char) SH_PROTO_MSG)
+    {
+      theProto = (unsigned char)SH_PROTO_MSG;
+
+      /* say HELO       
+       */
+
+      flag_err = sh_forward_send    (sockfd, 
+				     (char)theProto, _("HELO"),
+				     answer, 
+				     (unsigned long)sl_strlen(answer)); 
+      TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s, status %d.>\n"), 
+	    answer, flag_err));
+      if (flag_err == 0)
+	{ 
+	  /* --- Get challenge. ---  
+	   */
+	  flag_err = (int) sh_forward_receive (sockfd, 
+					       (char)SH_PROTO_MSG, head_u, 
+					       answer, 255);   
+	  TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s, u %s, status %d.>\n"), 
+	    answer, hu_trans(head_u), flag_err));
+	  flag_err = (flag_err < 0) ? flag_err : 0;
+	  
+	  if (flag_err == 0)
+	    {
+	      
+	      /* --- Re-negotiate key. ---
+	       */
+	      if (0 == check_request_nerr(head_u, _("INIT")))
+		{
+		  flag_err    = 0;
+		  initialized = BAD;
+		  goto initBlock;
+		}
+	      
+	      else if (0 == check_request(head_u, _("TALK")))
+		{
+
+		  /* --- Save the challenge. ---  
+		   */
+		  (void) sl_strlcpy(nsrv, answer, KEY_LEN + 1);
+		  
+		  /* --- Hash(msg,challenge,sessionkey). ---  
+		   */
+		  len    = sl_strlen(errmsg) + sl_strlen(answer) 
+		    + KEY_LEN + 1;
+		  len = (size_t)((len < 256) ? 256 : len);
+		  buffer = SH_ALLOC(len);
+		  MLOCK(buffer, len);
+		  (void) sl_strlcpy(buffer, errmsg, len);
+		  (void) sl_strlcat(buffer, answer, len);
+		  (void) sl_strlcpy(hash, 
+				    sh_util_siggen (skey->session, 
+						    buffer, 
+						    sl_strlen(buffer)), 
+				    KEY_LEN+1);
+		  TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
+		       sh_util_siggen(skey->session, buffer, 
+				      sl_strlen(buffer))));  		      
+
+		  (void) sl_strlcpy(buffer, errmsg, len);
+		  (void) sl_strlcat(buffer, hash,   len);
+
+		  flag_err = 
+		    sh_forward_send_crypt (sockfd, 
+#ifdef SH_ENCRYPT
+#ifdef SH_ENCRYPT_2
+					   (char)(SH_PROTO_MSG|SH_PROTO_ENC|SH_PROTO_EN2),
+#else
+					   (char)(SH_PROTO_MSG|SH_PROTO_ENC),
+#endif
+#else
+					   (char)(SH_PROTO_MSG),
+#endif
+					   _("MESG"),
+					   buffer, 
+					   (unsigned long)(sl_strlen(buffer)+1));
+		  TPT(( 0, FIL__, __LINE__, 
+			_("msg=<Sent %s, status %d.>\n"), 
+			answer, flag_err));
+
+		  /* --- Get confirmation. ---
+		   */
+		  if (flag_err == 0)
+		    {
+		      flag_err = (int)
+			sh_forward_receive_crypt (sockfd, 
+#ifdef SH_ENCRYPT
+#ifdef SH_ENCRYPT_2
+						  (char)(SH_PROTO_MSG|SH_PROTO_ENC|SH_PROTO_EN2|SH_PROTO_END),
+#else
+						  (char)(SH_PROTO_MSG|SH_PROTO_ENC|SH_PROTO_END),
+#endif
+#else
+						  (char)(SH_PROTO_MSG|SH_PROTO_END),
+#endif
+						  head_u, 
+						  answer, 255);   
+		      TPT(( 0, FIL__, __LINE__, 
+			    _("msg=<Rcvt %s, u %s, status %d.>\n"), 
+			    answer, hu_trans(head_u), flag_err));
+		      flag_err = (flag_err < 0) ? flag_err : 0;
+		    }
+
+
+		  /* --- Check confirmation. ---
+		   */
+		  if (flag_err == 0)
+		    {
+		      /*   CLIENT CONF RECV
+		       * 
+		       *   first KEY_LEN bytes must be
+		       *   sig(skey->session (errmsg nsrv))
+		       *
+		       */
+		      (void) sl_strlcpy(buffer, errmsg, len);
+		      (void) sl_strlcat(buffer, nsrv,   len);
+		      flag_err = sl_strncmp(answer,
+					    sh_util_siggen(skey->session, 
+							   buffer,
+							   sl_strlen(buffer)),
+					    KEY_LEN);
+		      TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
+			   sh_util_siggen(skey->session, buffer, 
+					  sl_strlen(buffer))));
+
+		      if (flag_err != 0)
+			{
+#ifdef ENOMSG
+			  flag_err = ENOMSG;
+#else
+			  flag_err = EIO;
+#endif
+			  sh_error_handle((-1), FIL__, __LINE__, flag_err,
+					  MSG_TCP_NOCONF);
+			}
+		      else
+			{
+#ifdef SH_ENCRYPT_2
+			  /* --- SERVER CMD --- */
+			  if (answer[KEY_LEN] != '\0' && 
+			      sl_strlen(answer) > (2*KEY_LEN))
+			    {
+			      pos = sl_strlen(answer) - (2*KEY_LEN);
+			      /*
+			       * buffer is  >= 256
+			       * answer has <= 255 bytes
+			       */
+			      (void) sl_strlcpy(buffer, &answer[KEY_LEN], 
+						pos+1);
+			      flag_err = 
+				sl_strncmp(&answer[KEY_LEN+pos],
+					   sh_util_siggen(skey->session, 
+							  buffer,
+							  pos),
+					   KEY_LEN);
+			      
+			      TPT((0, FIL__, __LINE__, 
+				   _("CONF RECV <%d> <%s>\n"),
+				   flag_err, &answer[KEY_LEN]));
+			      
+			      if (flag_err != 0) {
+				sh_error_handle((-1), FIL__, __LINE__, 
+						flag_err,
+						MSG_TCP_NOCONF);
+			      } else {
+				sh_socket_server_cmd(buffer);
+			      }
+			      flag_err = 0;
+
+			    } else {
+			      
+			      TPT((0, FIL__, __LINE__, 
+				   _("CONF RECV <0> <[null]>\n")));
+			      
+			    }
+			  /* --- SERVER CMD END --- */
+#endif
+			  sh_error_handle((-1), FIL__, __LINE__, 0,
+					  MSG_TCP_CONF);
+			}
+		    }
+
+		  memset(buffer, 0, len);
+		  MUNLOCK(buffer, len);
+		  SH_FREE(buffer);
+		}
+	      else
+		{
+		  /* --- Unexpected reply from server. ---
+		   */
+		  sh_error_handle((-1), FIL__, __LINE__, 0,
+				  MSG_TCP_UNEXP);
+		  flag_err = (-1);
+		}
+	    }
+	}
+    }
+
+
+  else if (what == (char)SH_PROTO_BIG)
+    {
+      theProto = (unsigned char) SH_PROTO_BIG;
+
+      /* --- Say HELO  ---       
+       */
+      flag_err = sh_forward_send    (sockfd, (char) theProto, _("HELO"),
+				     answer, (unsigned long)sl_strlen(answer));
+      TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s, status %d.>\n"), 
+	    answer, flag_err));
+
+      if (flag_err == 0)
+	{ 
+	  /* --- Get NSRV. ---  
+	   */
+	  flag_err = (int) sh_forward_receive (sockfd, 
+					       (char)SH_PROTO_BIG, head_u, 
+					       answer, 255);
+	  TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s, u %s, status %d.>\n"), 
+	    answer, hu_trans(head_u), flag_err));
+	  flag_err = (flag_err < 0) ? flag_err : 0;
+	}   
+
+      if (flag_err == 0)
+	{
+	  
+	  /* --- Re-negotiate key. ---
+	   */
+	  if (0 == check_request_nerr(head_u, _("INIT")))
+	    {
+	      flag_err    = 0;
+	      initialized = BAD;
+	      goto initBlock;
+	    }
+	  
+ 
+	  else if (0 == check_request(head_u, _("NSRV")))
+	    {
+#ifdef SH_ENCRYPT
+	      /* --- Set encryption flag. ---
+	       */
+#ifdef SH_ENCRYPT_2
+	      theProto = 
+		(unsigned char)(SH_PROTO_BIG | SH_PROTO_ENC | SH_PROTO_EN2);
+#else
+	      theProto = (unsigned char)(SH_PROTO_BIG | SH_PROTO_ENC);
+#endif
+#endif
+
+	      (void) sl_strlcpy(nsrv, answer, KEY_LEN+1);
+	      
+	      /* --- Generate a nonce. ---
+	       */
+	      ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+					 &(skey->rng1[0]),
+					 &(skey->rng2[0]));
+              
+	      (void) sl_strlcpy(nclt, 
+				sh_tiger_hash((char *) &ticks, 
+					      TIGER_DATA, 
+					      (unsigned long)sizeof(UINT32)),
+				KEY_LEN+1);
+
+	      /* --- Compute H(nsrv, nclt, skey). ---
+	       */
+	      buffer = sh_util_strconcat (nsrv, nclt, 
+					  skey->session, NULL);
+	      (void)sl_strlcpy(foo_M1, 
+			       sh_tiger_hash(buffer, TIGER_DATA,
+					     (unsigned long)sl_strlen(buffer)),
+			       KEY_LEN+1);
+	      memset (buffer, 0, sl_strlen(buffer));
+
+	      /* --- Send (nclt, msg) ---
+	       */
+	      (void) sl_strlcpy(buffer, nclt, KEY_LEN+1);
+	      (void) sl_strlcat(buffer, errmsg, KEY_LEN+5);
+
+#ifndef SH_ENCRYPT
+	      buffer[KEY_LEN+4] = theProto;
+	      buffer[KEY_LEN+5] = '\0';
+	      sh_tools_hash_add(foo_M1, buffer, KEY_LEN+5);
+#endif
+
+	      flag_err = 
+		sh_forward_send_crypt (sockfd, (char) theProto, _("NCLT"),
+				       buffer, 
+				       (unsigned long) sl_strlen(buffer));
+ 
+	      TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s, status %d.>\n"), 
+		    buffer, flag_err));
+	      SH_FREE (buffer);
+	    }   
+	}
+
+      if (flag_err == 0)
+	{
+	  /* --- Receive the file. ---
+	   */
+
+          /* --- Open a temporary file. ---
+           */
+	  
+          if ( (sfd = open_tmp ()) < 0)
+	    {
+	      flag_err = (-1);
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_EFIL);
+	    }
+	  else
+	    {
+	      /* --- Read from socket into tmp file. ---
+	       */
+	      transfercount = 0;
+	      flag_err      = 0;
+
+	      do {
+		flag_err = (int)
+		  sh_forward_receive_crypt (sockfd, 
+#ifdef SH_ENCRYPT
+#ifdef SH_ENCRYPT_2
+					    (char)(SH_PROTO_BIG|SH_PROTO_EN2|SH_PROTO_ENC),
+#else
+					    (char)(SH_PROTO_BIG|SH_PROTO_ENC),
+#endif
+#else
+					    (char)(SH_PROTO_BIG),
+#endif
+					    head_u, 
+					    answer, 
+					    TRANS_BYTES + 256);
+
+		TPT(( 0, FIL__, __LINE__, 
+		      _("msg=<Received: %d bytes, marked %s.>\n"),
+		      flag_err, hu_trans(head_u)));
+
+		if (flag_err > 0 && 0 == check_request_nerr(head_u, _("FILE")))
+		  {
+		    if (0 == hash_check (foo_M1, answer, flag_err))
+		      {
+			(void) sl_write(sfd, &answer[KEY_LEN], 
+					flag_err-KEY_LEN);
+			++transfercount;
+			flag_err = 
+			  sh_forward_send_crypt (sockfd, (char) theProto, 
+						 _("RECV"),
+						 nclt, 
+						 (unsigned long)sl_strlen(nclt));
+
+		      }
+		    else
+		      {
+			TPT(( 0, FIL__, __LINE__, 
+			      _("msg=<File transfer: Hash check failed.>\n")));
+			break;
+		      }
+		  }
+		else
+		  {
+		    TPT(( 0, FIL__, __LINE__, 
+			  _("msg=<File transfer: No more data.>\n")));
+		    break;
+		  }
+	      } while (transfercount < 32000); /* 64 Mbyte */
+		    
+	      if (0 == check_request_nerr(head_u, _("EEOT")) &&
+		  0 <  flag_err                             &&
+		  0 == hash_check (foo_M1, answer, (int)strlen(answer)))
+		{
+		  flag_err = 
+		    sh_forward_send_crypt (sockfd, (char) theProto, 
+					   _("EOTE"),
+					   nclt, 
+					   (unsigned int) sl_strlen(nclt));
+
+		  (void) rewind_tmp (sfd);
+		  (void) sl_sync(sfd);
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FOK);
+		}
+	      else
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FBAD);
+		  (void) sl_close (sfd);
+		  sfd = (-1);
+		}
+
+	      (void) close (sockfd);
+	      memset(answer, 0, TRANS_BYTES + 256);
+	      MUNLOCK(answer, TRANS_BYTES + 256);
+	      SH_FREE(answer);
+	      timeout_val = 1;
+
+	      SL_RETURN( (sfd), _("sh_forward_try_impl"));
+	    }
+	}
+
+      (void) close (sockfd);
+      memset(answer, 0, TRANS_BYTES + 256);
+      MUNLOCK(answer, TRANS_BYTES + 256);
+      SH_FREE(answer);
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FBAD);
+      timeout_val *= 2;
+
+      SL_RETURN( (-1), _("sh_forward_try_impl"));
+    }
+		  
+      
+ 
+  (void) close (sockfd);
+  memset(answer, 0, 512);
+  MUNLOCK(answer, 512);
+  SH_FREE(answer);
+
+#ifndef EIO
+#define EIO 5
+#endif
+  
+
+#ifdef SH_ERROR_H  
+  if (flag_err != 0)
+    {
+      conn_state = BAD;
+      timeout_val *= 2;
+      if (flag_err < 0 || NULL == sh_error_message(flag_err))
+	flag_err = EIO;
+      sh_error_handle((-1), FIL__, __LINE__, flag_err, MSG_TCP_ECONN,
+		      sh_error_message(flag_err));
+      SL_RETURN( (-1), _("sh_forward_try_impl"));
+    }
+#endif
+  timeout_val = 1;
+
+  SL_RETURN( (0), _("sh_forward_try_impl"));
+}
+
+/* #ifdef SH_WITH_CLIENT */
+#endif
+
+
+#if defined (SH_WITH_SERVER)
+
+#ifndef USE_SRP_PROTOCOL
+
+int sh_forward_make_client (char * str)
+{
+  /* char *          safer; */
+  char            key[KEY_LEN+1];
+  unsigned char   in[PW_LEN+1];
+  int    i = 0, j, k, l = 0;
+  
+  if (sl_strlen(str) != (PW_LEN * 2)) 
+    {
+      fprintf(stderr, 
+	      _("Input must be a %d digit hexadecimal number"\
+		" (only 0-9, a-f, A-F allowed in input)\n"),
+	      (PW_LEN * 2));
+      _exit(EXIT_FAILURE);
+    }
+  
+  while (i < (PW_LEN * 2))
+    {
+      k = sh_util_hexchar(str[i]); j = sh_util_hexchar(str[i+1]); 
+      if (k != -1 && j != -1) 
+        {
+          in[l] = (k * 16 + j);
+          ++l; i+= 2;
+        }
+      else
+        {
+          fprintf(stderr, _("Invalid char %c\n"), str[i]);
+          _exit(EXIT_FAILURE);
+        }
+    }
+  in[PW_LEN] = '\0';
+
+  sl_strlcpy ((char *)key, 
+	      sh_tiger_hash ((char*)in, TIGER_DATA, PW_LEN), 
+	      KEY_LEN+1);
+  key[KEY_LEN] = '\0';
+  
+  fprintf(stdout, _("Client entry: Client=HOSTNAME@00000000@%s\n"), 
+	  key);
+  fflush(stdout);
+
+  _exit(EXIT_SUCCESS);
+  return 0;
+}
+
+#else
+
+int sh_forward_make_client (char * str)
+{
+  char * foo_v;
+
+  char   salt[17];
+  char   key[KEY_LEN+1];
+  char   in[PW_LEN];
+  int    i = 0, j, k, l = 0;
+  
+  if (sl_strlen(str) != (PW_LEN*2)) 
+    {
+      fprintf(stderr, 
+	      _("Input must be a %d digit hexadecimal number"\
+		" (only 0-9, a-f, A-F allowed in input)\n"),
+	      (PW_LEN*2));
+      _exit(EXIT_FAILURE);
+    }
+
+    while (i < (PW_LEN*2))
+      {
+        k = sh_util_hexchar(str[i]); j = sh_util_hexchar(str[i+1]); 
+        if (k != -1 && j != -1) 
+          {
+            in[l] = (k * 16 + j);
+            ++l; i+= 2;
+          }
+        else
+          {
+            fprintf(stderr, _("Invalid char %c\n"), str[i]);
+            _exit(EXIT_FAILURE);
+          }
+      }
+    
+  
+    if (0 == sh_srp_init())
+      {
+	sh_util_keyinit(key, KEY_LEN);
+	sl_strlcpy(salt, sh_tiger_hash(key, TIGER_DATA, KEY_LEN), 17); 
+	sh_srp_x (salt, in);
+	foo_v  = sh_srp_verifier ();
+	fprintf(stdout, _("Client=HOSTNAME@%s@%s\n"), 
+		salt, foo_v);
+	fflush(stdout);
+	SH_FREE(foo_v);
+	sh_srp_exit();
+	_exit(EXIT_SUCCESS);
+      }
+    fprintf(stdout, _("ERROR initializing BigNum library.\n"));
+    fflush (stdout);
+    _exit(EXIT_FAILURE);
+    return -1;
+}
+#endif
+
+
+int sh_forward_create_password (char * dummy)
+{
+  UINT32   val[2]; 
+  char     output[KEY_LEN+1];
+
+  val[0] = taus_get (&(skey->rng0[0]), &(skey->rng0[1]), &(skey->rng0[2]));
+  val[1] = taus_get (&(skey->rng0[0]), &(skey->rng0[1]), &(skey->rng0[2]));
+
+  sl_strlcpy (output, 
+	      sh_tiger_hash((char *)(&val[0]), TIGER_DATA, 2*sizeof(UINT32)),
+	      KEY_LEN);
+
+  output[16] = '\0';
+
+  fprintf(stdout, _("%s\n"), output);
+  fflush (stdout);
+
+  if (dummy)
+    _exit(EXIT_SUCCESS);
+  else
+    _exit(EXIT_SUCCESS);  
+  return (0);  /* avoid compiler warning */
+}
+
+/* #if defined (SH_WITH_SERVER) */
+#endif
+
+/**************************************************
+ *
+ *
+ *  S E R V E R   
+ *
+ *
+ ***************************************************/
+
+#ifdef SH_WITH_SERVER
+
+#include "sh_readconf.h"
+
+
+#define CONN_FREE    0
+#define CONN_READING 1
+#define CONN_SENDING 2
+#define CONN_PAUSE   3
+#define CONN_BUSY    4
+
+char * clt_stat[] = {
+  N_("Inactive"),
+  N_("Started"),
+  N_("ILLEGAL"),
+  N_("FAILED"),
+  N_("Exited"),
+  N_("PANIC"),
+  N_("POLICY"),
+  N_("File_transfer"),
+  N_("Message"),
+  N_("TIMEOUT_EXCEEDED"),
+  N_("Suspended"),
+  N_("Filecheck"),
+};
+
+#include <time.h>
+
+/* in sh_html.h:
+ *  typedef struct client_entry {
+ *  } client_t;
+ */
+
+#include "zAVLTree.h"
+
+/* Function to return the key for indexing
+ * the argument 
+ */
+zAVLKey sh_avl_key (void const * arg)
+{
+  const client_t * sa = (const client_t *) arg;
+  return (zAVLKey) sa->hostname;
+}
+
+zAVLTree * all_clients = NULL;
+
+void sh_forward_html_write()
+{
+  SL_ENTER(_("sh_forward_html_write"));
+  sh_html_write(all_clients);
+  SL_RET0(_("sh_forward_html_write"));
+}
+
+
+int sh_forward_use_clt_class (char * c)
+{
+  int i;
+  SL_ENTER(_("sh_forward_use_clt_class"));
+  i = sh_util_flagval(c, &(sh.flag.client_class));
+  SL_RETURN(i, _("sh_forward_use_clt_class"));
+}
+
+int sh_forward_use_clt_sev (char * c)
+{
+  int i;
+  SL_ENTER(_("sh_forward_use_clt_sev"));
+  i = sh_util_flagval(c, &(sh.flag.client_severity));
+  SL_RETURN(i, _("sh_forward_use_clt_sev"));  
+}
+
+
+/* the destructor
+ */
+void free_client(void * inptr)
+{
+  client_t * here;
+
+  SL_ENTER(_("free_client"));
+  if (inptr == NULL)
+    SL_RET0(_("free_client"));
+  else
+    here = (client_t *) inptr;
+
+  if (here->hostname != NULL)
+    SH_FREE(here->hostname);
+  if (here->salt != NULL)
+    SH_FREE(here->salt);
+  if (here->verifier != NULL)
+    SH_FREE(here->verifier);
+  SH_FREE(here);
+  SL_RET0(_("free_client"));
+}
+
+int sh_forward_register_client (char * str)
+{
+  client_t   * newclt;
+  client_t   * testclt;
+
+  char       * ptr;
+  int          sepnum = 0;
+  int          sep[2];
+  register int i = 0;
+  int          siz_str = 0;
+
+  SL_ENTER(_("sh_forward_register_client"));
+
+  ptr = str; 
+  while (*ptr) {
+    if (*ptr == '@' && sepnum < 2 ) 
+      { 
+	sep[sepnum] = i;
+	++sepnum;
+      } 
+    ++ptr; ++i; 
+  }
+
+  if (all_clients == NULL)
+    {
+      all_clients = zAVLAllocTree (sh_avl_key);
+      if (all_clients == NULL) 
+	{
+	  (void) safe_logger (0, 0, getpid());
+	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	}
+    }
+  
+  if (sepnum == 2 && sep[0] > 0)
+    {
+      newclt = SH_ALLOC (sizeof(client_t));
+      newclt->hostname = SH_ALLOC (sep[0]+1);
+      newclt->salt     = SH_ALLOC (sep[1]-sep[0]);
+      newclt->verifier = SH_ALLOC (sl_strlen(str)-sep[1]+1);
+      newclt->exit_flag         = 0;
+      newclt->dead_flag         = 0;
+#ifdef SH_ENCRYPT
+#ifdef SH_ENCRYPT_2
+      newclt->encf_flag         = SH_PROTO_ENC|SH_PROTO_EN2;
+      newclt->ency_flag         = SH_PROTO_ENC|SH_PROTO_EN2;
+#else
+      newclt->encf_flag         = SH_PROTO_ENC;
+      newclt->ency_flag         = SH_PROTO_ENC;
+#endif
+#else
+      newclt->encf_flag         = 0;
+      newclt->ency_flag         = 0;
+#endif
+      newclt->session_key[0]    = '\0';
+      newclt->last_connect      = (time_t) 0;
+      newclt->session_key_timer = (time_t) 0;
+      newclt->status_now        = CLT_INACTIVE;
+      for (i = 0; i < CLT_MAX; ++i) 
+	newclt->status_arr[i] = CLT_INACTIVE;
+      sl_strlcpy(newclt->timestamp[CLT_INACTIVE],   sh_unix_time(0), TIM_MAX);
+      sl_strlcpy(newclt->hostname,  &str[0],        sep[0]+1);
+      sl_strlcpy(newclt->salt,      &str[sep[0]+1], sep[1]-sep[0]);
+      sl_strlcpy(newclt->verifier,  &str[sep[1]+1], sl_strlen(str)-sep[1]+1);
+
+      testclt = (client_t *) zAVLSearch (all_clients, newclt->hostname);
+
+      if (testclt != NULL)
+	{
+	  SH_FREE(testclt->verifier);
+	  siz_str = strlen (newclt->verifier) + 1;
+	  testclt->verifier = SH_ALLOC (siz_str);
+	  sl_strlcpy(testclt->verifier, newclt->verifier, siz_str);
+
+	  SH_FREE(testclt->salt);
+	  siz_str = strlen (newclt->salt) + 1;
+	  testclt->salt = SH_ALLOC (siz_str);
+	  sl_strlcpy(testclt->salt, newclt->salt, siz_str);
+
+	  testclt->dead_flag = 0;
+	      
+	  free_client(newclt);
+	  SL_RETURN( 0, _("sh_forward_register_client"));
+	}
+      else
+	{
+	  if (0 == zAVLInsert (all_clients, newclt))
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_CREG,
+			      newclt->hostname, 
+			      newclt->salt, newclt->verifier);
+	      SL_RETURN( 0, _("sh_forward_register_client"));
+	    }
+	}
+    }
+  SL_RETURN (-1, _("sh_forward_register_client"));
+}
+
+typedef struct {
+  int             state;
+  int             fd;
+  char          * buf;
+  unsigned char   head[SH_HEADER_SIZE];
+  char            challenge[SH_CHALLENGE_SIZE];
+  char            peer[SH_MINIBUF+1];
+  client_t      * client_entry;
+  char          * K;
+  char          * M1;
+  char          * A;
+  int             headcount;
+  unsigned long   bytecount;
+  unsigned long   bytes_to_send;
+  unsigned long   bytes_to_get;
+  int             pass;
+  unsigned long   timer;
+
+  char          * FileName;
+  unsigned long   FileLength;
+  unsigned long   FileSent;
+  char            FileType[5];
+
+  struct sockaddr_in addr_peer;
+} sh_conn_t;
+
+
+
+void sh_forward_do_free (sh_conn_t * conn)
+{
+  SL_ENTER(_("sh_forward_do_free"));
+
+  if (conn->K != NULL) 
+    {
+      SH_FREE(conn->K);
+      conn->K           = NULL;
+    }
+  if (conn->A != NULL) 
+    {
+      SH_FREE(conn->A);
+      conn->A           = NULL;
+    }
+  if (conn->M1 != NULL) 
+    {
+      SH_FREE(conn->M1);
+      conn->M1           = NULL;
+    }
+  if (conn->buf != NULL) 
+    {
+      SH_FREE(conn->buf);
+      conn->buf          = NULL;
+    }
+  if (conn->fd != (-1))
+    {
+      close (conn->fd);
+      conn->fd            = -1;
+    }
+  memset(conn->challenge, '\0', SH_CHALLENGE_SIZE);
+  conn->state         = CONN_FREE;
+  conn->headcount     = 0;
+  conn->bytecount     = 0;
+  conn->bytes_to_send = 0;
+  conn->bytes_to_get  = 0;
+  conn->pass          = 0;
+  conn->timer         = 0;
+  conn->client_entry  = NULL;
+
+  if (conn->FileName != NULL) 
+    {
+      SH_FREE(conn->FileName);
+      conn->FileName     = NULL;
+    }
+  conn->FileLength     = 0;
+  conn->FileSent       = 0;
+  memset(conn->FileType, '\0', 5);
+
+  --server_status.conn_open;
+  
+  SL_RET0(_("sh_forward_do_free"));
+}
+
+/****************************************
+ *
+ *   -- Reconfiguration. --
+ *
+ *   (1) Mark all clients as 'dead'.
+ *   (2) Reload configuration - clients
+ *       in config are non-dead now.
+ *   (3) Remove all clients still
+ *       marked as 'dead'.
+ */
+
+/* -- Mark all clients as dead.
+ */
+void sh_forward_mark_dead ()
+{
+  zAVLCursor avlcursor;
+  client_t * item;
+
+  SL_ENTER(_("sh_forward_mark_dead"));
+
+  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
+       item = (client_t *) zAVLNext(&avlcursor))
+    {
+      item->dead_flag = 1;
+    }
+  SL_RET0(_("sh_forward_mark_dead"));
+}
+
+
+/* -- Clean tree from dead clients.
+ */
+void sh_forward_clean_tree ()
+{
+  zAVLCursor avlcursor;
+  client_t * item;
+
+  SL_ENTER(_("sh_forward_clean_tree"));
+
+ repeat_search:
+
+  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
+       item = (client_t *) zAVLNext(&avlcursor))
+    {
+      if (item->dead_flag == 1)
+	{
+	  zAVLDelete (all_clients, item->hostname);
+	  free_client (item);
+	  goto repeat_search;
+	}
+    }
+  SL_RET0(_("sh_forward_clean_tree"));
+}
+
+/*
+ *
+ **********************************************/
+
+
+
+/* -- SERVER SEND FUNKTION. --
+ */
+void sh_forward_prep_send_int (sh_conn_t * conn, 
+			       char * msg, unsigned long length,
+			       char * u, char protocol,
+			       int docrypt)
+{
+  register unsigned long i;
+  unsigned long           length2;
+
+#ifdef SH_ENCRYPT
+  unsigned long           blkfac = 0;
+  int                     rem = 0;
+  char                  * p, * q;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
+  unsigned int            j;
+  cipherInstance          cipherInst;
+  int                     err_num;
+#else
+  (void) docrypt;
+#endif
+
+  SL_ENTER(_("sh_forward_prep_send_int"));
+
+  TPT((0, FIL__, __LINE__, _("msg=<%s>, docrypt=<%d>\n"), msg, docrypt ));
+
+#ifdef SH_ENCRYPT
+  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_EN2) != 0) )
+    {
+      length2 = length;
+    }
+  else if ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != 0) )
+    {
+      blkfac  = length/B_SIZ;
+      rem     = length - (B_SIZ * blkfac);
+      length2 = (B_SIZ * blkfac) + ((rem == 0) ? 0 : B_SIZ);
+    }
+  else
+    {
+      length2 = length;
+    }
+#else
+  length2 = length;
+#endif
+
+  conn->headcount     = 0;
+  conn->bytecount     = 0;
+  conn->bytes_to_send = 0;
+  conn->bytes_to_get  = 0;
+
+  if (conn->buf != NULL) 
+    {
+      SH_FREE(conn->buf);
+      conn->buf           = NULL;
+    }
+
+
+  put_header (conn->head, protocol, &length2, u);
+  SH_SHOWPROT(conn->head,'>');
+
+  TPT((0, FIL__, __LINE__, _("msg=<put_header done>\n") ));
+
+  if (msg == NULL) 
+    length2 = 0;
+  
+#ifdef SH_ENCRYPT
+  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_EN2) != 0))
+    {
+      TPT((0, FIL__, __LINE__, _("encrypting (version 2)\n")));
+      
+      conn->buf = sh_tools_makePack (conn->head, msg, length2,
+				     &(conn->client_entry->keyInstE));
+    }
+  else if ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != 0))
+    {
+      conn->buf       = SH_ALLOC(length2 + 1);
+
+      p       = msg;
+      q       = conn->buf;
+
+      TPT((0, FIL__, __LINE__, _("encrypting (version 1)\n")));
+
+      err_num = cipherInit (&cipherInst, MODE_CBC, NULL);
+      if (err_num < 0)
+	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			errorExplain(err_num), 
+			_("sh_forward_prep_send_int: cipherInit"));
+
+      for (j = 0; j < blkfac; ++j)
+	{
+	  memcpy(inBlock, p, B_SIZ);
+	  err_num = blockEncrypt(&cipherInst, &(conn->client_entry->keyInstE), 
+		       inBlock, 128 * BNUM, outBlock);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_prep_send_int: blockEncrypt"));
+	  memcpy(q, outBlock, B_SIZ);
+	  p += B_SIZ;
+	  q += B_SIZ;
+	}
+      if (rem > 0)
+	{
+	  /* incomplete block at end
+	   */
+	  memset(inBlock, '\0', B_SIZ);
+	  memcpy(inBlock, p, rem);
+	  err_num = blockEncrypt(&cipherInst, &(conn->client_entry->keyInstE), 
+		       inBlock, 128 * BNUM, outBlock);
+	  if (err_num < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			    errorExplain(err_num), 
+			    _("sh_forward_prep_send_int: blockEncrypt"));
+	  memcpy(q, outBlock, B_SIZ);
+	  q += B_SIZ;
+	}
+
+      TPT((0, FIL__, __LINE__, _("msg=<encryption done>\n") ));
+    }
+  else
+    {
+      conn->buf       = SH_ALLOC(length2 + 1);
+
+      for (i = 0; i < length2; ++i) 
+	conn->buf[i] = msg[i];
+      conn->buf[length2] = '\0';
+      TPT((0, FIL__, __LINE__, _("msg=<no encryption done>\n") ));
+    }
+#else
+  conn->buf       = SH_ALLOC(length2 + 1);
+
+  for (i = 0; i < length; ++i) 
+    conn->buf[i] = msg[i];
+  conn->buf[length2] = '\0';
+  TPT((0, FIL__, __LINE__, _("msg=<no encryption done>\n") ));
+#endif
+
+  conn->state     = CONN_SENDING;
+  SL_RET0(_("sh_forward_prep_send_int"));
+}
+
+/* -- Send/Receive. --
+ */
+void sh_forward_prep_send (sh_conn_t * conn, 
+			   char * msg, unsigned long length,
+			   char * u, char protocol)
+{
+  SL_ENTER(_("sh_forward_prep_send"));
+  sh_forward_prep_send_int (conn,  msg, length, u, protocol, S_FALSE);
+  SL_RET0(_("sh_forward_prep_send"));
+}  
+
+void sh_forward_prep_send_crypt (sh_conn_t * conn, 
+				 char * msg, unsigned long length,
+				 char * u, char protocol)
+{
+  SL_ENTER(_("sh_forward_prep_send_crypt"));
+  sh_forward_prep_send_int (conn,  msg, length, u, protocol, S_TRUE);
+  SL_RET0(_("sh_forward_prep_send_crypt"));
+}  
+
+/* #include <sys/times.h> */
+
+#if defined(WITH_EXTERNAL)
+#include "sh_extern.h"
+#endif
+
+/* -- Update the client status. --
+ *
+ * Update the status array for the client,
+ * and eventually call external program.
+ */
+static void status_update (client_t * conn, int status)
+{ 
+#if defined(WITH_EXTERNAL)
+  char msg[2 * SH_MINIBUF + TIM_MAX + 3];
+#endif
+
+  SL_ENTER(_("status_update"));
+
+  if (conn == NULL || 
+      status < 0   || status >= CLT_MAX)
+    SL_RET0(_("status_update"));
+
+  conn->status_now = status;
+  conn->status_arr[status] = status;
+  sl_strlcpy(conn->timestamp[status],
+	     sh_unix_time(0), 
+	     TIM_MAX);
+
+#if defined(WITH_EXTERNAL)
+  sprintf(msg, _("%s %s %s"),                       /* known to fit  */
+	  conn->hostname, 
+	  conn->timestamp[status],
+	  _(clt_stat[status]));
+  sh_ext_execute('s', 'r', 'v', msg, 0);
+#endif
+
+  SL_RET0(_("status_update"));
+}
+
+static time_t time_client_limit = 86400;
+
+int sh_forward_set_time_limit (char * c)
+{
+  long val;
+
+  SL_ENTER(_("sh_forward_set_time_limit"));
+
+  val = strtol (c, (char **)NULL, 10);
+  if (val <= 0)
+    SL_RETURN( (-1), _("sh_forward_set_time_limit"));
+
+  val = (val < 0 ? 0 : val);
+
+  time_client_limit = (time_t) val;
+  SL_RETURN( (0), _("sh_forward_set_time_limit"));
+}
+
+
+/* -- Check for time limit exceeded. --
+ */
+static int client_time_check()
+{
+  zAVLCursor avlcursor;
+  client_t * item;
+
+  SL_ENTER(_("client_time_check"));
+
+  if (time_client_limit == (time_t) 0)
+    SL_RETURN( 0, _("client_time_check"));
+
+  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
+       item = (client_t *) zAVLNext(&avlcursor))
+    {
+      if (item->exit_flag == 0 && item->last_connect != (time_t) 0)
+	{
+	  if ( (time(NULL) - item->last_connect) > time_client_limit)
+	    {
+	      if (item->status_now != CLT_TOOLONG)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_TIMEXC,
+				  item->hostname);
+		  status_update (item, CLT_TOOLONG);
+		}
+	    }
+	}
+    }
+  SL_RETURN( 0, _("client_time_check"));
+}
+
+static int lookup_err = SH_ERR_SEVERE;
+
+int sh_forward_lookup_level (char * c)
+{
+  int ci =  sh_error_convert_level (c);
+
+  SL_ENTER(_("sh_forward_lookup_level"));
+
+  if (ci >= 0)
+    {
+      lookup_err = ci;
+      SL_RETURN( 0, _("sh_forward_lookup_level"));
+    }
+  else
+    SL_RETURN( (-1), _("sh_forward_lookup_level"));
+}
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN  127
+#endif
+
+int check_addr (const char * claim, struct sockaddr_in addr_peer)
+{
+  char               h_name[MAXHOSTNAMELEN + 1];
+  char               h_peer[MAXHOSTNAMELEN + 1];
+  char               h_peer_IP[16];
+  char               tmp_peer_IP[16];
+  struct hostent   * he;
+  char            ** p = NULL;
+  int                i;
+  int                flag = 0;
+
+  SL_ENTER(_("check_addr"));
+
+  if (claim == NULL)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		      _("NULL input"), _("check_addr"));
+      SL_RETURN ((-1), _("check_addr"));
+    }
+
+  /* Make sure we have the canonical name for the client
+   */
+  he = sh_gethostbyname (claim);
+
+  if (he != NULL && he->h_name != NULL)
+    {
+      if (NULL == strchr(he->h_name, '.') && he->h_addr_list != NULL)
+	{
+	  he = sh_gethostbyaddr(he->h_addr_list[0], 
+				he->h_length, 
+				he->h_addrtype);
+	}
+    }
+
+  /* copy canonical name into h_name
+   */
+  if (he != NULL && he->h_name != NULL)
+    sl_strlcpy(h_name, he->h_name, MAXHOSTNAMELEN + 1);
+  else
+    {
+      sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_RESCLT,
+		      claim);
+      SL_RETURN ((0), _("check_addr"));
+    }
+
+
+  /* get canonical name of socket peer
+   */
+  he = sh_gethostbyaddr ((char *) &(addr_peer.sin_addr), 
+			 sizeof(addr_peer.sin_addr),
+			 AF_INET);
+
+  if (he != NULL && he->h_name != NULL)
+    {
+      if (0 == sl_strcmp(he->h_name, _("localhost")))
+	sl_strlcpy(h_peer, sh.host.name, MAXHOSTNAMELEN + 1);
+      else
+	sl_strlcpy(h_peer, he->h_name, MAXHOSTNAMELEN + 1);
+    }
+  else
+    {
+      sl_strlcpy(tmp_peer_IP,
+		 inet_ntoa (*(struct in_addr *) &(addr_peer.sin_addr)),
+		 16);
+      sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_RESPEER,
+		      claim, tmp_peer_IP);
+      SL_RETURN ((0), _("check_addr"));
+    }
+
+  sl_strlcpy(h_peer_IP, 
+	     inet_ntoa (*(struct in_addr *) he->h_addr),
+	     16);
+
+#if 0
+  if (S_FALSE == DoReverseLookup)
+    {
+      SL_RETURN ((0), _("check_addr"));
+    }
+#endif
+
+  /* reverse lookup
+   */
+  if (0 != sl_strncmp(_("127."), 
+		      inet_ntoa (*(struct in_addr *) &(addr_peer.sin_addr)),
+		      4))
+    {
+      he = sh_gethostbyname(h_peer);
+      
+      if (he != NULL)
+	{
+	  for (p = he->h_addr_list; *p; ++p)
+	    {
+	      if (0 == memcmp (*p, &(addr_peer.sin_addr), 
+			       sizeof(addr_peer.sin_addr))) 
+		break;
+	      ++i;
+	    }
+	}
+      if (he == NULL || *p == NULL) 
+	{
+	  sl_strlcpy(tmp_peer_IP,
+		     inet_ntoa (*(struct in_addr *) &(addr_peer.sin_addr)),
+		     16);
+	  sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_LOOKERS,
+			  claim, h_peer, tmp_peer_IP);
+	  SL_RETURN ((0), _("check_addr"));
+	}
+    }
+
+
+  if ((0 == sl_strcmp(h_peer, h_name)) || (0 == sl_strcmp(h_peer_IP, h_name)))
+    {
+      SL_RETURN ((0), _("check_addr"));
+    }
+  else
+    {
+      i = 0;
+      while (he->h_aliases[i] != NULL)
+	{
+	  if (0 == sl_strcmp(he->h_aliases[i], h_name))
+	    {
+	      flag = 1;
+	      break;
+	    }
+	  ++i;
+	}
+      if (flag == 0) 
+	sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_LOOKUP,
+			claim, h_peer);
+    }
+
+  SL_RETURN ((0), _("check_addr"));
+}
+
+static int UseSocketPeer = S_FALSE;
+
+int set_socket_peer (char * c)
+{
+  return sh_util_flagval(c, &UseSocketPeer);
+}
+
+
+/* -- Search register. --
+ */
+client_t * search_register(sh_conn_t * conn, int pos)
+{
+  client_t * this_client;
+  char       peer_ip[16];
+  char       peer_name[MAXHOSTNAMELEN+1];
+  char     * search_string;
+  struct sockaddr_in peer_addr;
+  struct hostent   * he;
+  char    ** p = NULL;
+
+  SL_ENTER(_("search_register"));
+
+  if (UseSocketPeer == S_TRUE)
+    {
+      peer_addr = conn->addr_peer;
+      sl_strlcpy(peer_ip, 
+		 inet_ntoa (*(struct in_addr *) &(peer_addr.sin_addr)), 16);
+
+      /* get canonical name of socket peer
+       */
+      he = sh_gethostbyaddr ((char *) &(peer_addr.sin_addr), 
+			     sizeof(peer_addr.sin_addr),
+			     AF_INET);
+
+      if (he != NULL && he->h_name != NULL)
+	{
+	  if (0 == sl_strcmp(he->h_name, _("localhost")))
+	    sl_strlcpy(peer_name, sh.host.name, MAXHOSTNAMELEN + 1);
+	  else
+	    sl_strlcpy(peer_name, he->h_name, MAXHOSTNAMELEN + 1);
+
+	  /* Reverse lookup 
+	   */
+	  if (0 != sl_strncmp(peer_ip, _("127."), 4))
+	    {
+	      he = sh_gethostbyname(peer_name);
+	      
+	      if (he != NULL)
+	      {
+		for (p = he->h_addr_list; *p; ++p)
+		  {
+		    if (0 == memcmp (*p, &(peer_addr.sin_addr), 
+				     sizeof(peer_addr.sin_addr))) 
+		      break;
+		  }
+	      }
+	      if (he == NULL || *p == NULL) 
+	      {
+		/*
+		sh_error_handle(lookup_err, FIL__, __LINE__, 0, 
+				MSG_TCP_LOOKERS,
+				conn->buf[pos], peer_name, peer_ip);
+		*/
+		sl_strlcpy(peer_name, peer_ip, MAXHOSTNAMELEN + 1);
+	      }
+	    }
+	}
+      else
+	{
+	  sl_strlcpy(peer_name, peer_ip, MAXHOSTNAMELEN + 1);
+	}
+      search_string = peer_name;
+    }
+  else
+    {
+      search_string = &(conn->buf[pos]);
+
+      if (0 != check_addr (search_string, conn->addr_peer))
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+			  _("Reverse lookup failed"), search_string);
+	  sh_forward_do_free (conn);
+	  SL_RETURN( NULL, _("search_register"));
+	} 
+    }
+
+  /* ----  search the register  -----
+   */
+  this_client = zAVLSearch(all_clients, search_string);
+
+  if (this_client == NULL)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+		      _("Not in client list"), search_string);
+      sh_forward_do_free (conn);
+      SL_RETURN( NULL, _("search_register"));
+    } 
+  if (this_client->exit_flag == 1)
+    {
+      TPT((0, FIL__, __LINE__, _("msg=<this_client->exit_flag == 1>\n")));
+      this_client->session_key_timer = (time_t) 0;
+      this_client->session_key[0]    = '\0';
+      this_client->exit_flag         = 0;    
+    }
+  TPT((0, FIL__, __LINE__, _("msg=<search_register: client %s>\n"), 
+       this_client->hostname));
+  TPT((0, FIL__, __LINE__, _("msg=<search_register: key %s>\n"), 
+       this_client->session_key));
+  SL_RETURN( this_client, _("search_register"));
+}  
+
+
+/************************************************************************
+ *
+ * Here we check the message received, and decide on the answer to send
+ * (if any). The connection is in CONN_PAUSED state, thus we must:
+ * (i)   define the proper reaction
+ * (ii)  reset to CONN_READING or CONN_WRITING or CONN_FREE
+ * (iii) eventually reset the connection entry
+ *
+ *************************************************************************/
+static
+void check_protocol(sh_conn_t * conn, int state)
+{
+  client_t * this_client; 
+
+  char     * cmd;
+
+  char       hash[SH_MAXMSGLEN + KEY_LEN + KEY_LEN + 1];
+  char     * buffer;
+  long       len;
+
+  int        clt_sev;
+  char     * ptok;
+
+  UINT32     ticks;
+  int        i;
+  char     * test;
+  char       u[5] = "OOOO";
+
+  SL_TICKET  sfd = -1;
+  char     * read_buf = 0;
+  char     * send_buf;
+  int        bytes;
+
+#ifdef SH_ENCRYPT
+  int        blkfac;
+  int        rem;
+  int        send_bytes;
+  int        err_num;
+#endif
+
+
+#ifdef USE_SRP_PROTOCOL
+  char     * foo_B;
+  char     * foo_Ss;
+#endif
+
+  SL_ENTER(_("check_protocol"));
+
+  /* seed / re-seed the PRNG if required
+   */
+  (void) taus_seed();
+
+
+  /* protocols: 
+   * -- (iii)    file transfer
+   * -- (ii)     authenticated message transfer
+   * -- (i)      SRP key exchange
+   */
+
+  /* --------- FILE TRANSFER  -----------
+   */
+  if ( (conn->head[0] & SH_PROTO_SRP) == 0  &&
+       (conn->head[0] & SH_PROTO_BIG) != 0  /* is set */ )
+    {
+
+      if (state == SH_DO_READ)        /* finished reading */
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<File transfer - entry.>\n")));
+
+	  /* -- Client requests challenge. --
+	   */
+	  if (0 == check_request_nerr ((char *) &(conn->head[3]), _("HELO")))
+	    {
+
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<File transfer - HELO (1).>\n")));
+
+	      if (conn->buf == NULL || sl_strlen(conn->buf) <= KEY_LEN)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      /* ----  search the register  -----
+	       */
+	      
+	      this_client = search_register (conn, KEY_LEN);
+	      if (this_client == NULL)
+		SL_RET0(_("check_protocol"));
+
+	      /* ---- force authentication -----
+	       */
+
+	      if (this_client->session_key[0] == '\0' ||
+		  (time(NULL) - this_client->session_key_timer) 
+		  > (time_t) TIMEOUT_KEY )
+		{
+		  /* fake an auth request and jump there
+		   */
+		  conn->head[0]  = (conn->head[0] | SH_PROTO_SRP);
+		  conn->head[3]  = 'S';
+		  conn->head[4]  = 'A';
+		  conn->head[5]  = 'L';
+		  conn->head[6]  = 'T';
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FAUTH,
+				  &(conn->buf[KEY_LEN]));
+		  strcpy(conn->buf,                      /* known to fit  */
+			 &(conn->buf[KEY_LEN])); 
+		  this_client->session_key[0]    = '\0';
+		  this_client->session_key_timer = (time_t) 1;
+		  goto servInit;
+		}
+
+	      /* --- check whether hostname is properly signed ---
+	       */ 
+	      if (conn->K != NULL) 
+		{
+		  SH_FREE(conn->K);
+		  conn->K = NULL;
+		}
+	      i = sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1;
+	      conn->K = SH_ALLOC(i);
+
+	      sl_strlcpy (conn->K, 
+			  sh_util_siggen(this_client->session_key,
+					 &(conn->buf[KEY_LEN]),
+					 sl_strlen(&(conn->buf[KEY_LEN]))),
+			  KEY_LEN+1);
+	      TPT((0, FIL__, __LINE__, _("msg=<host %s>\n"),
+		   &(conn->buf[KEY_LEN])));
+	      TPT((0, FIL__, __LINE__, _("msg=<ckey %s>\n"),
+		   this_client->session_key));
+	      TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
+		   sh_util_siggen(this_client->session_key, 
+				  &(conn->buf[KEY_LEN]), 
+				  sl_strlen(&(conn->buf[KEY_LEN])))));
+
+	      if (0 != sl_strncmp(conn->K, conn->buf, KEY_LEN))
+		{
+		  TPT((0, FIL__, __LINE__, _("msg=<clt %s>\n"), conn->buf));
+		  TPT((0, FIL__, __LINE__, _("msg=<srv %s>\n"), conn->K));
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Signature mismatch"), 
+				  &(conn->buf[KEY_LEN]));
+
+		  this_client->session_key_timer =
+		    time(NULL) - (2*TIMEOUT_KEY);
+
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		}
+	      SH_FREE(conn->K); 
+	      conn->K = NULL;
+
+	      /* --- create and send a nonce ---
+	       */
+	      
+	      conn->client_entry = this_client;
+	      sl_strlcpy (conn->peer, &(conn->buf[KEY_LEN]), SH_MINIBUF+1);
+
+	      ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+					 &(skey->rng1[0]),
+					 &(skey->rng2[0]));
+	      if (conn->K != NULL) 
+		{
+		  SH_FREE(conn->K);
+		  conn->K = NULL;
+		}
+	      conn->K = SH_ALLOC(KEY_LEN+1);
+	      sl_strlcpy (conn->K, 
+			  sh_tiger_hash ((char *) &ticks, 
+					 TIGER_DATA, sizeof(UINT32)), 
+			  KEY_LEN+1);
+
+	      TPT((0, FIL__, __LINE__, _("msg=<send nonce>\n")));
+	      sh_forward_prep_send (conn, conn->K, KEY_LEN+1, _("NSRV"), 
+				    SH_PROTO_BIG);
+	    }
+
+	  /* --- Client has send a message. Check state and message. ---
+	   */
+	  else if (0 == check_request_nerr((char *)&(conn->head[3]), _("NCLT")) &&
+		   conn->client_entry != NULL                           &&
+		   sl_strlen(conn->buf) > KEY_LEN                       &&
+		   conn->K != NULL)
+	    {
+
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<File transfer - NCLT (3).>\n")));
+
+	      /* --- get client nonce and compute hash ---
+	       */
+	      if (conn->A != NULL)
+		{
+		  SH_FREE(conn->A);
+		  conn->A = NULL;
+		}
+	      conn->A = SH_ALLOC(3*KEY_LEN+1);
+	      sl_strlcpy (conn->A, conn->K, KEY_LEN+1); 
+	      sl_strlcat(conn->A, conn->buf, /* ignore remainder */
+			 2*KEY_LEN+1);
+	      sl_strlcat(conn->A, conn->client_entry->session_key, 
+			 3*KEY_LEN+1);
+	      sl_strlcpy (conn->K, sh_tiger_hash(conn->A,TIGER_DATA,3*KEY_LEN),
+			  KEY_LEN+1);
+	      SH_FREE(conn->A); 
+	      conn->A = NULL;
+
+
+#ifdef SH_ENCRYPT
+	      if ((conn->client_entry->encf_flag != 0) &&
+		  ((conn->head[0] & SH_PROTO_ENC) == 0)) 
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
+				  _("file download"),
+#ifdef SH_ENCRYPT_2
+				  _("version2"),
+#else
+				  _("version1"),
+#endif
+				  _("none"));
+		  if (sl_strlen(conn->buf) > (KEY_LEN + 5)) {
+		    if (sh_tools_hash_vfy(conn->K, conn->buf, KEY_LEN+5)) {
+		      if (conn->buf[KEY_LEN+4] == conn->head[0]) {
+			/* conn->client_entry->encf_flag = 0 */ ; /* FIXME */
+		      }
+		    }
+		  }
+		}
+	      else if ((conn->client_entry->encf_flag != 0) &&
+		       ((conn->head[0] & SH_MASK_ENC) != 
+			conn->client_entry->encf_flag))
+		{
+		  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, 
+				  MSG_TCP_MISENC,
+				  _("file download"),
+#ifdef SH_ENCRYPT_2
+				  _("version2"),
+#else
+				  _("version1"),
+#endif
+				  ((conn->head[0] & SH_PROTO_EN2) == SH_PROTO_EN2) ? _("version2") : _("version1")
+				  );
+		  conn->client_entry->encf_flag = 
+		    (conn->head[0] & SH_MASK_ENC);
+		}
+#else
+	      if ((conn->head[0] & SH_PROTO_ENC) != 0) 
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, 
+				  MSG_TCP_MISENC,
+				  _("file download"),
+				  _("none"), 
+				  ((conn->head[0] & SH_PROTO_EN2) == SH_PROTO_EN2) ? _("version2") : _("version1"));
+		}
+#endif
+
+
+	      /* ---- K = H(NSRV, NCLT, session_key) -------
+	       */ 
+
+	      if (conn->FileName != NULL)
+		{
+		  SH_FREE(conn->FileName);
+		  conn->FileName = NULL;
+		}
+
+	      if (0 == sl_strncmp (_("CONF"), &(conn->buf[KEY_LEN]), 4))
+		{
+		  strcpy(conn->FileType, _("CONF"));     /* known to fit  */
+		  conn->FileName = get_client_conf_file(conn->peer, 
+							&(conn->FileLength));
+		  conn->FileSent = 0;
+		}
+	      else  if (0 == sl_strncmp (_("DATA"), &(conn->buf[KEY_LEN]), 4))
+		{
+		  strcpy(conn->FileType, _("DATA"));     /* known to fit  */
+		  conn->FileName = get_client_data_file(conn->peer, 
+							&(conn->FileLength));
+		  conn->FileSent = 0;
+		}
+	      else
+		{
+		  ptok = sh_util_safe_name(&(conn->buf[KEY_LEN]));
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FFILE,
+				  conn->peer, 
+				  ptok);
+		  SH_FREE(ptok);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  sh_forward_do_free (conn);
+		}
+
+	      bytes = -1;
+
+	      if (conn != NULL && conn->FileName != NULL)
+		{
+		  sfd = sl_open_read(conn->FileName, SL_YESPRIV);
+		  if (!SL_ISERROR(sfd))
+		    {
+		      read_buf = SH_ALLOC(TRANS_BYTES);
+		      bytes = sl_read (sfd, read_buf, TRANS_BYTES);
+		      sl_close(sfd);
+		    }
+
+		  else
+		    {
+		      sh_error_handle((-1), FIL__, __LINE__, sfd, 
+				      MSG_E_ACCESS,
+				      (long) geteuid(),
+				      conn->FileName);
+		    }
+		  if (bytes >= 0)
+		    {
+#ifdef SH_ENCRYPT
+		      /* need to send N * B_SIZ bytes
+		       */ 
+		      blkfac = bytes / B_SIZ;
+		      rem    = bytes - (blkfac * B_SIZ);
+		      if (rem != 0)
+			{
+			  memset(&read_buf[bytes], '\n', (B_SIZ-rem));
+			  ++blkfac;
+			  send_bytes = blkfac * B_SIZ;
+			}
+		      else
+			send_bytes = bytes;
+
+		      send_buf = hash_me(conn->K, read_buf, 
+					 send_bytes);
+
+		      sh_forward_prep_send_crypt (conn, send_buf, 
+						  send_bytes+KEY_LEN, 
+						  _("FILE"),  
+						  SH_PROTO_BIG|conn->client_entry->encf_flag);
+#else
+		      send_buf = hash_me(conn->K, read_buf, bytes);
+		      sh_forward_prep_send_crypt (conn, send_buf, 
+						  bytes+KEY_LEN, 
+						  _("FILE"),  SH_PROTO_BIG);
+#endif
+		      conn->FileSent += bytes;
+		      if (send_buf != NULL) 
+			{
+			  SH_FREE(send_buf);
+			}
+		      SH_FREE(read_buf);
+		    }
+		}
+
+	      if (conn == NULL    || conn->FileName == NULL || 
+		  SL_ISERROR(sfd) || bytes < 0)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, sfd, MSG_TCP_NFILE,
+				  conn->peer, 
+				  (conn->FileName == NULL) ? 
+				  _("(NULL)") : conn->FileName);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  sh_forward_do_free (conn);
+		}
+
+	    }
+	  
+	 else if (0 == check_request_nerr((char *)&(conn->head[3]), 
+					  _("RECV"))                    &&
+		   conn->client_entry != NULL                           &&
+		   conn->K != NULL                                      &&
+		   conn->FileName != NULL)
+	    {
+
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<File transfer - RCVT (5+).>\n")));
+
+	      if (conn->FileSent == conn->FileLength)
+		{
+		  send_buf = hash_me(conn->K, conn->peer, 
+				     sl_strlen(conn->peer));
+#ifdef SH_ENCRYPT
+		  sh_forward_prep_send_crypt (conn, send_buf, 
+					      sl_strlen(conn->peer)+KEY_LEN, 
+					      _("EEOT"),  
+					      SH_PROTO_BIG|conn->client_entry->encf_flag);
+#else
+		  sh_forward_prep_send_crypt (conn, send_buf, 
+					      sl_strlen(conn->peer)+KEY_LEN, 
+					      _("EEOT"),  
+					      SH_PROTO_BIG);
+#endif
+		  SH_FREE(send_buf);
+		}
+	      else
+		{
+		  bytes = -1;
+		  sfd = sl_open_read(conn->FileName, SL_YESPRIV);
+		  if (!SL_ISERROR(sfd))
+		    {
+		      read_buf = SH_ALLOC(TRANS_BYTES);
+		      sl_seek (sfd, (off_t) conn->FileSent);
+		      bytes = sl_read (sfd, read_buf, TRANS_BYTES);
+		      sl_close(sfd);
+		    }
+		  else
+		    {
+		      sh_error_handle((-1), FIL__, __LINE__, sfd, 
+				      MSG_E_ACCESS,
+				      (long) geteuid(),
+				      conn->FileName);
+		    }
+		  if (bytes >= 0)
+		    {
+#ifdef SH_ENCRYPT
+		      /* need to send N * B_SIZ bytes
+		       */ 
+		      blkfac = bytes / B_SIZ;
+		      rem    = bytes - (blkfac * B_SIZ);
+		      if (rem != 0)
+			{
+			  memset(&read_buf[bytes], '\n', (B_SIZ-rem));
+			  ++blkfac;
+			  send_bytes = blkfac * B_SIZ;
+			}
+		      else
+			send_bytes = bytes;
+
+		      send_buf = hash_me(conn->K, read_buf, 
+					 send_bytes);
+
+		      sh_forward_prep_send_crypt (conn, send_buf, 
+						  send_bytes+KEY_LEN, 
+						  _("FILE"),  
+						  SH_PROTO_BIG|conn->client_entry->encf_flag);
+#else
+
+		      send_buf = hash_me(conn->K, read_buf, bytes);
+		      sh_forward_prep_send_crypt (conn, send_buf, 
+						  bytes+KEY_LEN, 
+						  _("FILE"),  
+						  SH_PROTO_BIG);
+#endif
+
+		      conn->FileSent += bytes;
+		      SH_FREE(send_buf);
+		      SH_FREE(read_buf);
+		    }
+		  else
+		    {
+		      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NFILE,
+				      conn->peer,
+				      (conn->FileName == NULL) ? 
+				      _("(NULL)") : conn->FileName);
+		      status_update (conn->client_entry, CLT_FAILED);
+		      sh_forward_do_free (conn);
+		    }
+		}
+	    }
+
+
+	  else if (0 == check_request_nerr((char *)&(conn->head[3]), 
+					   _("EOTE")) &&
+		   conn->client_entry != NULL)
+	    {
+
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<File transfer - EOTE (7).>\n")));
+
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_OKFILE,
+			      conn->peer);
+
+	      if ((conn->client_entry->status_now != CLT_SUSPEND) &&
+		  (conn->client_entry->status_now != CLT_TOOLONG))
+		{ status_update (conn->client_entry, CLT_FILE); }
+	      else
+		{ conn->client_entry->session_key[0]    = '\0'; }
+	      conn->client_entry->last_connect = time (NULL);
+	      sh_forward_do_free (conn);
+	    }
+	    
+
+	  /* client does something unexpected
+	   */
+	  else  /* ---- ??? ----- */
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
+			      1, conn->pass, conn->peer,  
+			      '\\', conn->head[3], '\\',conn->head[4],
+			      '\\', conn->head[5], '\\',conn->head[6]);
+	      status_update (conn->client_entry, CLT_FAILED);
+	      sh_forward_do_free (conn);
+	    }
+	}
+
+      else if (state == SH_DO_WRITE)  /* finished writing */
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<File transfer - (wait).>\n")));
+
+	  /* challenge is sent, now wait for message from client
+	   */
+	  conn->headcount     = 0;
+	  conn->bytecount     = 0;
+	  conn->bytes_to_send = 0;
+	  conn->bytes_to_get  = 0;
+	  if (conn->buf != NULL) 
+	    {
+	      SH_FREE(conn->buf);
+	      conn->buf           = NULL;
+	    }
+	  conn->state     = CONN_READING;
+	}
+      SL_RET0(_("check_protocol"));
+    }
+
+  /* ---------  message exchange  -----------
+   */
+  if ((conn->head[0] & SH_PROTO_SRP) == 0  && 
+      (conn->head[0] & SH_PROTO_MSG) != 0  /* is set */ )
+    {
+
+      if (state == SH_DO_READ)        /* finished reading */
+	{
+
+	  TPT(( 0, FIL__, __LINE__, _("msg=<Message transfer - entry.>\n")));
+
+	  /* client requests challenge
+	   */
+	 if (0 == check_request_nerr ((char *)&(conn->head[3]), _("HELO")))
+	    {
+
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<Message transfer - HELO (1).>\n")));
+
+	      if (conn->buf == NULL || sl_strlen(conn->buf) <= KEY_LEN )
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s.>\n"), conn->buf));
+
+	      /* ----  search the register  -----
+	       */
+	      this_client = search_register (conn, KEY_LEN);
+	      if (NULL == this_client)
+		SL_RET0(_("check_protocol"));
+
+	      /* ---- force authentication -----
+	       */
+	      if ( (this_client->session_key[0] == '\0') || 
+		   ((time(NULL)-this_client->session_key_timer) 
+		    > (time_t) TIMEOUT_KEY)
+		   )
+		{
+
+		  /* fake an auth request and jump there
+		   */
+		  conn->head[0]  = (conn->head[0] | SH_PROTO_SRP);
+		  conn->head[3]  = 'S';
+		  conn->head[4]  = 'A';
+		  conn->head[5]  = 'L';
+		  conn->head[6]  = 'T';
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FAUTH,
+				  &(conn->buf[KEY_LEN]));
+		  strcpy(conn->buf,                      /* known to fit  */
+			 &(conn->buf[KEY_LEN]));
+		  this_client->session_key[0]    = '\0';
+		  this_client->session_key_timer = (time_t) 1;
+
+		  goto servInit;
+		}
+	      
+	      /* check whether hostname is properly signed
+	       */ 
+	      if (conn->K != NULL)
+		{ 
+		  SH_FREE(conn->K);
+		  conn->K = NULL;
+		}
+	      i = sl_strlen(&(conn->buf[KEY_LEN])) + KEY_LEN + 1;
+	      conn->K = SH_ALLOC(i);
+
+	      sl_strlcpy (conn->K, 
+			  sh_util_siggen(this_client->session_key,
+					 &(conn->buf[KEY_LEN]),
+					 sl_strlen(&(conn->buf[KEY_LEN]))),
+			  KEY_LEN+1);
+	      TPT((0, FIL__, __LINE__, _("msg=<host %s>\n"), 
+		   &(conn->buf[KEY_LEN])));
+	      TPT((0, FIL__, __LINE__, _("msg=<ckey %s>\n"), 
+		   this_client->session_key));
+	      TPT((0, FIL__, __LINE__, _("msg=<sign %s>\n"), conn->K));
+
+	      if (0 != sl_strncmp(conn->K, conn->buf, KEY_LEN))
+		{
+		  TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s>\n"), conn->buf));
+		  TPT(( 0, FIL__, __LINE__, _("msg=<Want %s>\n"), conn->K));
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Signature mismatch"), 
+				  &(conn->buf[KEY_LEN]));
+
+		  this_client->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		}
+	      SH_FREE(conn->K); 
+	      conn->K = NULL;
+
+	      /* -- create a nonce and send it --
+	       */
+
+	      conn->client_entry = this_client;
+	      sl_strlcpy (conn->peer, &(conn->buf[KEY_LEN]), SH_MINIBUF+1);
+
+	      ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+					 &(skey->rng1[0]),
+					 &(skey->rng2[0]));
+	      test = (char *) &ticks;
+	      sh_util_cpylong (conn->challenge, test, 4);
+	      conn->challenge[4] = '\0';
+	      for (i = 0; i < 4; ++i)
+		if (conn->challenge[i] == '\0')
+		  conn->challenge[i] = 0x01;
+
+	      sh_forward_prep_send (conn, conn->challenge, 5, _("TALK"), 
+				    SH_PROTO_MSG);
+	      TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s.>\n"), 
+		    hu_trans(conn->challenge)));
+	    }
+
+	  /* Client has send a message. Check whether we are in proper
+	   * state, and verify message.
+	   */
+	  else if (0 == 
+		   check_request_nerr((char *)&(conn->head[3]), _("MESG")) &&
+		   conn->client_entry != NULL                           &&
+		   conn->client_entry->session_key[0] != '\0'           &&
+		   (len = sl_strlen(conn->buf) - KEY_LEN) > 0           &&
+		   sl_strlen(conn->challenge) == 4)
+	    {
+	      TPT(( 0, FIL__, __LINE__, 
+		    _("msg=<Message transfer - MESG (3).>\n")));
+
+#ifdef SH_ENCRYPT
+	      if (conn->client_entry->encf_flag == 0) {
+		conn->client_entry->ency_flag = 0;
+	      }
+	      if ((conn->client_entry->ency_flag != 0) && 
+		  ((conn->head[0] & SH_PROTO_ENC) == 0)) 
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
+				  _("message transfer"), 
+#ifdef SH_ENCRYPT_2
+				  _("version2"),
+#else
+				  _("version1"),
+#endif 
+				  _("none"));
+		  /* conn->client_entry->ency_flag = 0; */
+		}
+	      else if ((conn->client_entry->ency_flag != 0) &&
+		       ((conn->head[0] & SH_MASK_ENC) != 
+			conn->client_entry->ency_flag))
+		{
+		  sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, 
+				  MSG_TCP_MISENC,
+				  _("message transfer"), 
+#ifdef SH_ENCRYPT_2
+				  _("version2"),
+#else
+				  _("version1"),
+#endif 
+				  ((conn->head[0] & SH_PROTO_EN2) == SH_PROTO_EN2) ? _("version2") : _("version1"));
+		  conn->client_entry->ency_flag = 
+		    (conn->head[0] & SH_MASK_ENC); 
+		}
+#else
+	      if ((conn->head[0] & SH_PROTO_ENC) != 0) 
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, 
+				  MSG_TCP_MISENC,
+				  _("message transfer"), 
+				  _("none"), 
+				  ((conn->head[0] & SH_PROTO_EN2) == SH_PROTO_EN2) ? _("version2") : _("version1"));
+		}
+#endif
+
+	      TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s.>\n"), conn->buf));
+	      /* get hash from message end, truncate message
+	       */
+	      sl_strlcpy(hash, &(conn->buf[len]), KEY_LEN+1);
+	      conn->buf[len] = '\0';
+	      
+	      /* verify hash
+	       */
+	      buffer = sh_util_strconcat(conn->buf, conn->challenge, NULL);
+	      i =  sl_strncmp(hash, 
+			      sh_util_siggen(conn->client_entry->session_key,
+					     buffer,
+					     sl_strlen(buffer)),
+			      KEY_LEN);
+	      TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
+		   sh_util_siggen(conn->client_entry->session_key,
+				  buffer,
+				  sl_strlen(buffer))));
+
+
+	      if (0 != i)
+		{
+		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		  status_update (conn->client_entry, CLT_FAILED);
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Msg signature mismatch"), conn->peer);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		}
+	      else
+		{
+		  conn->client_entry->last_connect = time (NULL);
+
+		  if (NULL != sl_strstr(conn->buf,      _("EXIT")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      conn->client_entry->exit_flag = 1;
+		      status_update (conn->client_entry, CLT_EXITED);
+		    }
+		  else if (NULL != sl_strstr(conn->buf, _("PANIC")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      status_update (conn->client_entry, CLT_PANIC);
+		    }
+		  else if (NULL != sl_strstr(conn->buf, _("SUSPEND")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      status_update (conn->client_entry, CLT_SUSPEND);
+		    }
+		  else if (NULL != sl_strstr(conn->buf, _("POLICY")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      status_update (conn->client_entry, CLT_POLICY);
+		    }
+		  else if (NULL != sl_strstr(conn->buf, 
+					     _("File check completed")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      status_update (conn->client_entry, CLT_CHECK);
+		    }
+		  else if (NULL != sl_strstr(conn->buf, _("START")))
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      sh_socket_add2reload (conn->client_entry->hostname);
+		      if (conn->client_entry->status_now == CLT_SUSPEND) {
+			status_update (conn->client_entry, CLT_ILLEGAL);
+			sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_ILL,
+					conn->peer);
+		      }
+		      else
+			status_update (conn->client_entry, CLT_STARTED);
+		    }
+		  else
+		    {
+		      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
+		      if (0 != sl_strcmp(conn->buf, 
+					 _("Runtime configuration reloaded")))
+			{
+			  sh_socket_add2reload (conn->client_entry->hostname);
+			}
+		      status_update (conn->client_entry, CLT_MSG);
+		    }
+
+		  TPT((0, FIL__, __LINE__, _("msg=<status updated>\n")));
+		  clt_sev   = atoi(conn->buf);
+		  clt_class = (-1);
+		  ptok    = strchr(conn->buf, '?');
+		  if (ptok != NULL)
+		    {
+		      ++ptok;
+		      if (ptok != NULL && sh.flag.client_class == S_TRUE) 
+			clt_class = atoi(ptok);  /* is a global */
+		      ptok = strchr(ptok, '?');
+		      if (ptok != NULL) 
+			++ptok;
+		    }
+		  if (sh.flag.client_severity == S_FALSE)
+		    clt_sev = (-1);
+
+		  /* here we expect an xml formatted message, thus we don't
+		     escape xml special chars (flag == 0) */
+		  ptok = 
+		    sh_tools_safe_name ((ptok!=NULL) ? ptok : conn->buf, 0);
+
+		  /* push client name to error routine
+                   */
+                  sh_error_set_peer(sh_strip_domain (conn->peer));
+		  sh_error_handle(clt_sev, FIL__, __LINE__, 0, MSG_TCP_MSG,
+				  sh_strip_domain (conn->peer), 
+				  ptok);
+                  sh_error_set_peer(NULL);
+
+		  TPT((0, FIL__, __LINE__, _("msg=<%s>\n"), ptok));
+		  SH_FREE(ptok);
+		  clt_class = (-1);
+		}
+	      memset(buffer, '\0', sl_strlen(buffer));
+	      SH_FREE(buffer);
+
+	      /* SERVER CONF SEND
+	       */
+	      buffer = sh_util_strconcat(conn->buf,
+					 conn->challenge,
+					 NULL);
+	      sl_strlcpy(hash, 
+			 sh_util_siggen ( conn->client_entry->session_key,
+					  buffer,
+					  sl_strlen(buffer)),
+			 KEY_LEN+1);
+	      
+	      /* --- SERVER CMD --- */
+	      cmd = sh_socket_check (conn->peer);
+
+	      if (cmd != NULL)
+		{
+		  /* max cmd size is SH_MAXMSGLEN bytes
+		   */
+		  sl_strlcpy(&hash[KEY_LEN], cmd, SH_MAXMSGLEN);
+		  sl_strlcat(&hash[KEY_LEN],
+			     sh_util_siggen ( conn->client_entry->session_key,
+					      &hash[KEY_LEN],
+					      sl_strlen(&hash[KEY_LEN])),
+			     SH_MAXMSGLEN+KEY_LEN+1);
+		  
+		  TPT((0, FIL__, __LINE__, _("CONF SEND <0> <%s>\n"), 
+			  &hash[KEY_LEN]));
+		  
+		} else {
+		  
+		  TPT((0, FIL__, __LINE__, _("CONF SEND <0> <[NULL]>\n")));
+		  
+		}
+	      /* --- SERVER CMD END --- */
+
+	      TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
+		   sh_util_siggen(conn->client_entry->session_key,
+				  buffer,
+				  sl_strlen(buffer))));
+	  
+#ifdef SH_ENCRYPT
+	      sh_forward_prep_send_crypt (conn, hash, 
+					  sl_strlen(hash) /* KEY_LEN */, 
+					  _("CONF"), 
+					  SH_PROTO_MSG|SH_PROTO_END|conn->client_entry->ency_flag);
+#else
+	      sh_forward_prep_send_crypt (conn, hash, 
+					  sl_strlen(hash) /* KEY_LEN */, 
+					  _("CONF"), 
+					  SH_PROTO_MSG|SH_PROTO_END);
+#endif
+
+	      memset(buffer, '\0', sl_strlen(buffer));
+	      SH_FREE(buffer);
+	      
+	      /* sh_forward_do_free (conn); */
+	    }
+	  
+	  /* client does something unexpected
+	   */
+	  else  /* ---- ??? ----- */
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
+			      2, conn->pass, conn->peer,  
+			      '\\', conn->head[3], '\\',conn->head[4],
+			      '\\', conn->head[5], '\\',conn->head[6]);
+	      status_update (conn->client_entry, CLT_FAILED);
+	      conn->client_entry->session_key_timer = 
+		time(NULL) - (2*TIMEOUT_KEY);
+	      sh_forward_do_free (conn);
+	    }
+	}
+      else if (state == SH_DO_WRITE)  /* finished writing */
+	{
+	  if (0 != (conn->head[0] & SH_PROTO_END))
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_OKMSG,
+			      sh_strip_domain (conn->peer));
+	      sh_forward_do_free (conn);
+	      SL_RET0(_("check_protocol"));
+	    }
+
+	  TPT(( 0, FIL__, __LINE__, _("msg=<Msg transfer - (wait).>\n")));
+
+	  /* challenge is sent, now wait for message from client
+	   */
+	  conn->headcount     = 0;
+	  conn->bytecount     = 0;
+	  conn->bytes_to_send = 0;
+	  conn->bytes_to_get  = 0;
+	  if (conn->buf != NULL) 
+	    {
+	      SH_FREE(conn->buf);
+	      conn->buf           = NULL;
+	    }
+	  conn->state     = CONN_READING;
+	}
+      TPT((0, FIL__, __LINE__, _("msg=<return>\n") ));
+      SL_RET0(_("check_protocol"));
+    }
+
+  /* ---------  authentication  -----------
+   */
+
+  /* entry point for jump from message forward if session key must
+   * be re-initialized
+   */	 
+ servInit:
+
+  if ( (conn->head[0] & SH_PROTO_SRP) != 0   /* is set */ )
+    {
+
+#ifndef USE_SRP_PROTOCOL
+
+      if (state == SH_DO_READ)        /* finished reading */
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Authentication - entry.>\n")));
+
+	  /* first pass -- client request salt  
+	   */
+	  if (conn->pass    == 1) 
+	    {
+
+	      TPT((0, FIL__, __LINE__, 
+		   _("msg=<Authentication - SALT (1).>\n")));
+
+	      if (conn->buf == NULL || sl_strlen(conn->buf) == 0)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+		  
+
+	      /* search the register
+	       */
+
+	      this_client = search_register (conn, 0);
+	      if (NULL == this_client)
+		SL_RET0(_("check_protocol"));
+
+
+	      conn->client_entry = this_client;
+	      sl_strlcpy (conn->peer, conn->buf, SH_MINIBUF+1);
+
+	      if (0 != check_request_s((char *)&(conn->head[3]), 
+				       _("SALT"),conn->peer))
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("No salt requested"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	       
+	      /* -- create server nounce v --
+	       */
+	      ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+					 &(skey->rng1[0]),
+					 &(skey->rng2[0]));
+	      
+	      if (conn->A != NULL)
+		{
+		  SH_FREE(conn->A);
+		  conn->A = NULL;
+		}
+	      conn->A = SH_ALLOC(KEY_LEN+1);
+
+	      sl_strlcpy(conn->A, 
+			 sh_tiger_hash((char *) &ticks, 
+				       TIGER_DATA, sizeof(UINT32)),
+			 KEY_LEN+1);
+	      u[0] = 'I'; u[1] = 'N'; u[2] = 'I'; u[3] = 'T'; u[4] = '\0';
+
+	      if (conn->M1 != NULL)
+		{
+		  SH_FREE(conn->M1);
+		  conn->M1 = NULL;
+		}
+	      conn->M1 = SH_ALLOC(2*KEY_LEN+1);
+
+	      /* compute hash key H(v(server), P)v(server)
+	       */
+	      sh_passwd (conn->A, conn->client_entry->verifier, 
+			 NULL, conn->M1);
+
+	      sl_strlcat(conn->M1, conn->A, 2*KEY_LEN+1);
+
+
+	      /* --- send H(v(server), P)v(server) ----
+	       */
+      	      sh_forward_prep_send (conn, 
+				    conn->M1, 
+				    sl_strlen(conn->M1), 
+				    u, 
+				    (conn->head[0]|SH_PROTO_SRP));
+
+	      SH_FREE(conn->M1); 
+	      conn->M1 = NULL;
+	    }
+
+	  /* client -- third pass
+	   * Message is H(H(u,v),P)u
+	   *
+	   * A := v, verifier := H(password), 
+	   */
+	  else if (conn->pass    == 3                   && 
+		   conn->client_entry != NULL)
+	    {
+
+	      TPT((0, FIL__, __LINE__, 
+		   _("msg=<Authentication - PASS (3).>\n")));
+				  
+	      if (0 != check_request_s((char *) &(conn->head[3]), _("PASS"), 
+				       conn->peer)                    ||
+		  sl_strlen(conn->buf) <= KEY_LEN                        ||
+		  conn->A == NULL)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Invalid client request"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      /* store random nonce u from client
+	       */
+	      if (conn->K != NULL)
+		{
+		  SH_FREE(conn->K);
+		  conn->K = NULL;
+		}
+	      conn->K = SH_ALLOC(KEY_LEN+1);
+	      sl_strlcpy(conn->K, &(conn->buf[KEY_LEN]), KEY_LEN+1);
+
+	      /* verify random nonce u from client
+	       */
+	      if (conn->M1 != NULL)
+		{
+		  SH_FREE(conn->M1);
+		  conn->M1 = NULL;
+		}
+	      conn->M1 = sh_util_strconcat(conn->K, conn->A, NULL);
+
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: K = %s>\n"), conn->K));
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: A = %s>\n"), conn->A));
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: M = %s>\n"), conn->M1));
+
+	      sl_strlcpy(hash, sh_tiger_hash (conn->M1, 
+					      TIGER_DATA, 
+					      sl_strlen(conn->M1)), KEY_LEN+1); 
+	      sh_passwd (hash, conn->client_entry->verifier, NULL, conn->M1);
+
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: H = %s>\n"), hash));
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: P = %s>\n"), conn->M1));
+
+	      if ( 0 != sl_strncmp(conn->M1, conn->buf, KEY_LEN))
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Session key mismatch"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+		  
+
+	      /* ---- compute hash key H(v, P, u) ----
+	       */
+	      
+	      sh_passwd (conn->A, conn->client_entry->verifier, conn->K,
+			 conn->M1);
+
+	      sl_strlcpy(conn->client_entry->session_key, 
+			 conn->M1, KEY_LEN+1);
+	      TPT((0, FIL__, __LINE__, _("msg=<c/r: Key = %s>\n"), 
+		   conn->client_entry->session_key));
+
+#ifdef SH_ENCRYPT
+	       err_num = makeKey(&(conn->client_entry->keyInstE), 
+				 DIR_ENCRYPT, 192, 
+				 conn->client_entry->session_key);
+	       if (err_num < 0)
+		 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+				 errorExplain(err_num), 
+				 _("check_protocol: makeKey"));
+	       err_num = makeKey(&(conn->client_entry->keyInstD), 
+				 DIR_DECRYPT, 192, 
+				 conn->client_entry->session_key);
+	       if (err_num < 0)
+		 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+				 errorExplain(err_num), 
+				 _("check_protocol: makeKey"));
+#endif
+
+	      if (conn->K  != NULL) SH_FREE (conn->K);
+	      conn->K  = NULL;
+	      if (conn->A  != NULL) SH_FREE (conn->A);
+	      conn->A  = NULL;
+	      if (conn->M1 != NULL) SH_FREE (conn->M1);
+	      conn->M1 = NULL;
+
+	      /* if (conn->client_entry->status_now == CLT_STARTED */
+	      if (((conn->client_entry->status_now != CLT_INACTIVE) &&
+		   (conn->client_entry->status_now != CLT_EXITED)   &&
+		   (conn->client_entry->status_now != CLT_SUSPEND))
+		  && conn->client_entry->session_key_timer > (time_t) 1)
+		{
+		  status_update (conn->client_entry, CLT_ILLEGAL);
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_ILL,
+				  conn->peer);
+		}
+	      else if (conn->client_entry->session_key_timer == (time_t) 0)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NEW,
+				  conn->peer);
+		  if (conn->client_entry->status_now != CLT_SUSPEND)
+		    status_update (conn->client_entry, CLT_STARTED);
+		}
+
+	      conn->client_entry->session_key_timer = time (NULL);
+	      conn->client_entry->last_connect = time (NULL);
+
+	      /* put in read state
+	       */
+	      sh_forward_prep_send (conn, 
+				    _("AUTH"),
+				    5, 
+				    _("AUTH"), 
+				    (conn->head[0]|SH_PROTO_SRP));
+
+	    }
+	  else
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
+			      3, conn->pass, conn->peer, 
+			      '\\', conn->head[3], '\\', conn->head[4],
+			      '\\', conn->head[5], '\\', conn->head[6]);
+	      sh_forward_do_free (conn);
+	    }
+	}
+
+#else
+      /* use SRP                    */
+
+
+      if (state == SH_DO_READ)        /* finished reading */
+	{
+
+	  TPT((0, FIL__, __LINE__, _("msg=<Authentication - entry.>\n")));
+
+	  /* first pass -- client request salt  
+	   */
+	  if (conn->pass    == 1)
+	    {
+	      TPT((0, FIL__, __LINE__, 
+		   _("msg=<Authentication - SALT (1).>\n")));
+
+	      if (conn->buf == NULL)
+		{
+		  sh_error_handle( (-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      /* search the register
+	       */
+	      this_client = search_register(conn, 0);
+	      if (NULL == this_client)
+		SL_RET0(_("check_protocol"));
+
+	      conn->client_entry = this_client;
+	      sl_strlcpy (conn->peer, conn->buf, SH_MINIBUF+1);
+
+	      if (0 != check_request_s((char *)&(conn->head[3]), _("SALT"),
+				       conn->peer))
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("No salt requested"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+		  
+
+	      u[0] = 'I'; u[1] = 'N'; u[2] = 'I'; u[3] = 'T'; u[4] = '\0';
+	      
+	      sh_forward_prep_send (conn, 
+				    conn->client_entry->salt, 
+				    sl_strlen(conn->client_entry->salt), 
+				    u, 
+				    (conn->head[0]|SH_PROTO_SRP));
+	    }
+
+	  /* client has sent A -- third pass
+	   */
+	  else if (conn->pass == 3                    && 
+		   conn->client_entry != NULL)
+	    {
+
+	      TPT((0, FIL__, __LINE__, 
+		   _("msg=<Authentication - PC01 (3).>\n")));
+
+	      if (0 != check_request_s((char *)&(conn->head[3]),_("PC01"),conn->peer)||
+		  conn->buf == NULL
+		  )
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Invalid client request"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      if (0 != sh_srp_init())
+		{
+		  status_update (conn->client_entry, CLT_FAILED);
+		  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				  MSG_TCP_EBGN);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		}
+		  
+
+	      /* check A, only send B if correct 
+	       */
+	      if ( sl_strlen(conn->buf) < SH_BUFSIZE && 
+		   0 == sh_srp_check_zero (conn->buf) )
+		{
+		  len = sl_strlen(conn->buf)+1;
+
+		  if (conn->A != NULL)
+		    {
+		      SH_FREE(conn->A);
+		      conn->A = NULL;
+		    }
+		  conn->A = SH_ALLOC(len);
+		  sl_strlcpy (conn->A, conn->buf, len);
+		  
+		  /* 
+		   * compute B 
+		   */
+		  if (0 != sh_srp_make_a ())     /* b        random number */
+		    {
+		      status_update (conn->client_entry, CLT_FAILED);
+		      
+		      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				      MSG_TCP_EBGN);
+		      sh_srp_exit();
+		      sh_forward_do_free (conn);
+		      SL_RET0(_("check_protocol"));
+		    }
+             
+		  foo_B = sh_srp_B               /* B = v + g^b            */
+		    (conn->client_entry->verifier);
+
+		  if (foo_B == NULL)
+		    {
+		      status_update (conn->client_entry, CLT_FAILED);
+		      
+		      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				      MSG_TCP_EBGN);
+		      sh_srp_exit();
+		      sh_forward_do_free (conn);
+		      SL_RET0(_("check_protocol"));
+		    }
+
+		  TPT((0, FIL__, __LINE__, _("msg=<srp: A = %s>\n"), conn->A));
+		  TPT((0, FIL__, __LINE__, _("msg=<srp: B = %s>\n"), foo_B));
+
+		  /* 
+		   * create nonce u 
+		   */
+		  ticks = (UINT32) taus_get (&(skey->rng0[0]), 
+					     &(skey->rng1[0]),
+					     &(skey->rng2[0])); 
+		  test = (char *) &ticks;
+		  sh_util_cpylong (u, test, 4);  /* u        nounce        */
+		  u[4] = '\0';
+		  sl_strlcpy(conn->challenge, 
+			     sh_tiger_hash(u, TIGER_DATA, 4),
+			     SH_CHALLENGE_SIZE);
+
+		  TPT((0, FIL__, __LINE__, _("msg=<srp: u = %03o-%03o-%03o-%03o>\n"), u[0], u[1], u[2], u[3]));
+		  TPT((0, FIL__, __LINE__, _("msg=<srp: U = %s>\n"), 
+		       conn->challenge));
+
+		  /* 
+		   * compute the session key K and M1 = Hash(A,B,K)
+		   */
+		  foo_Ss = sh_srp_S_s (conn->challenge, 
+				       conn->A, 
+				       conn->client_entry->verifier);
+		  if (foo_Ss == NULL)
+		    {
+		      status_update (conn->client_entry, CLT_FAILED);
+		      
+		      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				      MSG_TCP_EBGN);
+		      sh_srp_exit();
+		      sh_forward_do_free (conn);
+		      SL_RET0(_("check_protocol"));
+		    }
+
+		  if (conn->K != NULL)
+		    {
+		      SH_FREE(conn->K);
+		      conn->K = NULL;
+		    }
+		  conn->K = SH_ALLOC(KEY_LEN+1);
+		  sl_strlcpy(conn->K, 
+			     sh_tiger_hash(foo_Ss, TIGER_DATA, 
+					   sl_strlen(foo_Ss)),
+			     KEY_LEN+1);
+
+		  if (conn->M1 != NULL)
+		    {
+		      SH_FREE(conn->M1);
+		      conn->M1 = NULL;
+		    }
+		  conn->M1 = SH_ALLOC(KEY_LEN+1);
+		  sl_strlcpy(conn->M1, 
+			  sh_srp_M (conn->A, foo_B, conn->K),
+			  KEY_LEN+1);
+
+		  TPT((0, FIL__, __LINE__, _("msg=<srp:Ss = %s>\n"), foo_Ss));
+		  TPT((0, FIL__, __LINE__, _("msg=<srp: K = %s>\n"), conn->K));
+		  TPT((0, FIL__, __LINE__, _("msg=<srp:M1 = %s>\n"),conn->M1));
+
+		  /*
+		   * send B
+		   */
+		  sh_forward_prep_send (conn, 
+					foo_B,
+					sl_strlen(foo_B)+1,
+					u,
+					(conn->head[0]|SH_PROTO_SRP));
+		  if (foo_Ss != NULL)
+		    {
+		      SH_FREE(foo_Ss);
+		      foo_Ss = NULL;
+		    }
+		  if (foo_B  != NULL)
+		    {
+		      SH_FREE(foo_B);
+		      foo_B = NULL;
+		    }
+		}
+	      else
+		{
+		  status_update (conn->client_entry, CLT_FAILED);
+
+		  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				  MSG_TCP_EZERO);
+		  sh_forward_do_free (conn);
+		}
+
+	      sh_srp_exit();
+	    }
+		  
+	  /* client has sent M1 -- fifth pass
+	   */
+	  else if (conn->pass    == 5           && 
+		   conn->client_entry != NULL) 
+	    {
+	      TPT((0, FIL__, __LINE__, 
+		   _("msg=<Authentication - PC02 (5).>\n")));
+
+	      /* check that the state is valid
+	       */
+	      if (0 != check_request_s((char *)&(conn->head[3]), _("PC02"),
+				       conn->peer)                   ||
+		  conn->A == NULL || conn->K == NULL || conn->M1 == NULL)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Invalid client request"), conn->peer);
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+		  sh_forward_do_free (conn);
+		  SL_RET0(_("check_protocol"));
+		} 
+
+	      /* ------ verify M1 = H(A,  B, K) -------
+	       * -----    send M2 = H(A, M1, K) -------
+	       */
+	      if (conn->buf != NULL && 
+		  sl_strncmp(conn->buf, conn->M1, KEY_LEN) == 0)
+		{
+		  /*
+		   * send M2
+		   */
+		  sh_forward_prep_send (conn, 
+					sh_srp_M (conn->A, conn->M1, conn->K),
+					KEY_LEN+1,
+					_("PARP"),
+					(conn->head[0]|SH_PROTO_SRP));
+
+		  if (conn->A  != NULL) SH_FREE(conn->A);  conn->A  = NULL;
+		  if (conn->M1 != NULL) SH_FREE(conn->M1); conn->M1 = NULL;
+		  sl_strlcpy(conn->client_entry->session_key, 
+			     conn->K, KEY_LEN+1);
+		  TPT((0, FIL__, __LINE__, _("msg=<key %s>\n"), 
+		       conn->client_entry->session_key));
+
+#ifdef SH_ENCRYPT
+		  err_num = makeKey(&(conn->client_entry->keyInstE), 
+				    DIR_ENCRYPT, 192, 
+				    conn->client_entry->session_key);
+		  if (err_num < 0)
+		    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+				    errorExplain(err_num), 
+				    _("sh_forward_prep_send_int: makeKey"));
+		  err_num = makeKey(&(conn->client_entry->keyInstD), 
+				    DIR_DECRYPT, 192, 
+				    conn->client_entry->session_key);
+		  if (err_num < 0)
+		    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+				    errorExplain(err_num), 
+				    _("sh_forward_prep_send_int: makeKey"));
+#endif
+
+		  if (conn->K  != NULL) SH_FREE(conn->K);  conn->K  = NULL;
+
+		  conn->client_entry->last_connect = time (NULL);
+		  
+		  if (((conn->client_entry->status_now != CLT_INACTIVE) &&
+		       (conn->client_entry->status_now != CLT_EXITED)   &&
+		       (conn->client_entry->status_now != CLT_SUSPEND))
+		      && conn->client_entry->session_key_timer > (time_t) 1)
+		    {
+		      status_update (conn->client_entry, CLT_ILLEGAL);
+
+		      sh_error_handle((-1), FIL__, __LINE__, 0, 
+				      MSG_TCP_ILL,
+				      conn->peer);
+		    }
+		  else if (conn->client_entry->session_key_timer == (time_t) 0)
+		    {
+		      sh_error_handle((-1), FIL__, __LINE__, 0, 
+				      MSG_TCP_NEW,
+				      conn->peer);
+		      if (conn->client_entry->status_now != CLT_SUSPEND)
+			status_update (conn->client_entry, CLT_STARTED);
+		    }
+		  conn->client_entry->session_key_timer = time (NULL);
+
+		}
+	      else
+		{
+		  status_update (conn->client_entry, CLT_FAILED);
+		  conn->client_entry->session_key_timer = 
+		    time(NULL) - (2*TIMEOUT_KEY);
+
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
+				  _("Session key mismatch"), conn->peer);
+		  sh_forward_do_free (conn);
+		} 
+	    }
+
+	  else
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
+			      4, conn->pass, conn->peer, 
+			      '\\', conn->head[3], '\\', conn->head[4],
+			      '\\', conn->head[5], '\\', conn->head[6]);
+	      sh_forward_do_free (conn);
+	    }
+	}
+
+#endif
+
+      else if (state == SH_DO_WRITE)  /* finished writing */
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Authentication -- (wait).>\n")));
+
+	  conn->headcount     = 0;
+	  conn->bytecount     = 0;
+	  conn->bytes_to_send = 0;
+	  conn->bytes_to_get  = 0;
+	  if (conn->buf != NULL) 
+	    {
+	      SH_FREE(conn->buf);
+	      conn->buf           = NULL;
+	    }
+	  conn->state     = CONN_READING;
+	}
+    }
+  SL_RET0(_("check_protocol"));
+}
+
+
+/***********************************************************
+ *
+ *    SERVER RECEIVE FUNCTION
+ *
+ ***********************************************************
+ */
+int sh_forward_do_read (sh_conn_t * conn)
+{
+  unsigned long   byteread;     /* bytes read         */
+
+#ifdef SH_ENCRYPT
+
+  unsigned long           blkfac = 0;
+  /* unsigned long           length2; */
+  char                  * p = NULL, * q = NULL;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
+  unsigned int            j;
+  cipherInstance          cipherInst;
+  int                     err_num;
+#endif
+
+  SL_ENTER(_("sh_forward_do_read"));
+
+  if (conn->state == CONN_SENDING)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_SYNC,
+		      conn->peer);
+      SL_RETURN( (-1), _("sh_forward_do_read"));
+    }
+
+  if (conn->headcount < SH_HEADER_SIZE) 
+    {
+      conn->bytes_to_get = SH_HEADER_SIZE - conn->headcount;
+      byteread           = read (conn->fd, &(conn->head[conn->headcount]),
+				    conn->bytes_to_get);
+      if (byteread > 0 || errno == EINTR) 
+	{
+	  if (byteread > 0) 
+	    conn->headcount += byteread;
+	  if (conn->headcount == SH_HEADER_SIZE)
+	    {
+		conn->bytes_to_get = 
+		  (256 * (unsigned int)conn->head[1] + 
+		   (unsigned int)conn->head[2]);
+		SH_SHOWPROT(conn->head, '<');
+		conn->bytecount = 0;
+	    }
+	}
+      else
+	{
+	  goto conn_reset;
+	}
+      SL_RETURN( (0), _("sh_forward_do_read"));
+    }
+
+
+  /* limit message size
+   */
+  /*
+  conn->bytes_to_get = 
+    (conn->bytes_to_get > (16*SH_BUFSIZE - 1)) ? 
+    (16*SH_BUFSIZE - 1) : conn->bytes_to_get;
+  */
+  conn->bytes_to_get = (conn->bytes_to_get > TRANS_BYTES) ? 
+    TRANS_BYTES : conn->bytes_to_get;
+
+  if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_get > 0)
+    {
+      if ((conn->bytecount > 0) && (conn->bytes_to_get > conn->bytecount))
+	{
+	  /* do nothing */;
+	}
+      else
+	{
+	  if (conn->buf != NULL)
+	    SH_FREE (conn->buf);
+	  conn->buf       = SH_ALLOC (conn->bytes_to_get + 1);
+	  conn->bytecount = 0;
+	}
+
+      byteread           = read (conn->fd, &(conn->buf[conn->bytecount]),
+				 conn->bytes_to_get - conn->bytecount);
+      if (byteread > 0 || errno == EINTR) 
+	{
+	  if (byteread > 0) 
+	    conn->bytecount    += byteread;
+	  if (conn->bytecount == conn->bytes_to_get) 
+	    {
+	      ++conn->pass;
+	      /* always terminate with NULL - we might use sl_strcmp()
+	       */
+	      conn->buf[conn->bytecount] = '\0';
+	      conn->state                = CONN_PAUSE;
+
+#ifdef SH_ENCRYPT
+	      if      ((conn->head[0] & SH_PROTO_EN2) != 0) /* if encrypted */
+		{
+		  conn->buf = 
+		    sh_tools_revertPack (conn->head, conn->buf,
+					 &(conn->client_entry->keyInstD),
+					 conn->bytecount);
+		}
+	      else if ((conn->head[0] & SH_PROTO_ENC) != 0) /* if encrypted */
+		{
+		  /* Decrypt only complete blocks. 
+		   * If there is an incomplete block,
+		   * something is wrong anyway.
+		   * Decrypt in place.
+		   */
+		  blkfac  = conn->bytecount / B_SIZ;
+		  /* length2 = (B_SIZ * blkfac); */
+		  p       = conn->buf;
+		  q       = conn->buf;
+      
+		  err_num = cipherInit (&cipherInst, MODE_CBC, NULL);
+		  if (err_num < 0)
+		    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+				    errorExplain(err_num), 
+				    _("sh_forward_do_read: cipherInit"));
+
+		  for (j = 0; j < blkfac; ++j)
+		    {
+		      memcpy(inBlock, p, B_SIZ);
+		      err_num = blockDecrypt(&cipherInst, 
+					     &(conn->client_entry->keyInstD), 
+					     inBlock, 128 * BNUM, outBlock);
+		      if (err_num < 0)
+			sh_error_handle((-1), FIL__, __LINE__, -1, 
+					MSG_E_SUBGEN,
+					errorExplain(err_num), 
+					_("sh_forward_do_read: blockDecrypt"));
+		      memcpy(q, outBlock, B_SIZ);
+		      p += 16;
+		      q += 16;
+		    }
+		}
+#endif
+
+	      /* ------  HERE CALL check_protocol(conn) -------  */
+	      check_protocol(conn, SH_DO_READ);
+	    }
+	}
+      else
+	{
+	  goto conn_reset;
+	}
+    }
+
+  else if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_get == 0)
+    {
+      if (conn->buf != NULL)
+	SH_FREE (conn->buf);
+      conn->buf       = NULL;
+      conn->bytecount = 0;
+      ++conn->pass;
+      conn->state     = CONN_PAUSE;
+      /* fprintf(stderr, "\n**** FIXME null read ****\n\n"); */
+      /* ------  HERE CALL check_protocol(conn) -------  */
+      check_protocol(conn, SH_DO_READ);
+    }
+      
+  SL_RETURN( (0), _("sh_forward_do_read"));
+
+ conn_reset:
+  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_RESET,
+		  conn->peer);
+  sh_forward_do_free ( conn );
+  SL_RETURN( (-1), _("sh_forward_do_read"));
+}
+
+#if !defined(O_NONBLOCK)
+#if defined(O_NDELAY)
+#define O_NONBLOCK  O_NDELAY
+#else
+#define O_NONBLOCK  0
+#endif
+#endif
+
+/* send to the client
+ */
+int sh_forward_do_write (sh_conn_t * conn)
+{
+  int    flags;
+  long   arg = 0;
+  long   bytesent;     /* bytes read         */
+
+  SL_ENTER(_("sh_forward_do_write"));
+
+  /* ---- consistency check ------
+   */
+  if (conn->state == CONN_READING)
+    {
+      sh_error_handle( (-1), FIL__, __LINE__, 0, MSG_TCP_SYNC,
+		      conn->peer);
+      SL_RETURN( (-1), _("sh_forward_do_write"));
+    }
+      
+  
+  flags = retry_fcntl (FIL__, __LINE__, conn->fd, F_GETFL, arg);
+  retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags|O_NONBLOCK);
+
+  /* ---- send the header ------
+   */
+  if (conn->headcount < SH_HEADER_SIZE) 
+    {
+      conn->bytes_to_send = SH_HEADER_SIZE - conn->headcount;
+      bytesent            = write (conn->fd, 
+				   &(conn->head[conn->headcount]), 
+				   conn->bytes_to_send);
+      if (bytesent >= 0 || errno == EINTR || errno == EAGAIN) 
+	{
+	  if (bytesent > 0) 
+	    conn->headcount += bytesent;
+	  if (conn->headcount == SH_HEADER_SIZE) 
+	    {
+	      conn->bytes_to_send = 
+		(256 * (int)conn->head[1] + (int)conn->head[2]);
+	    }
+	}
+      else 
+	{
+	  goto conn_reset_w;
+	}
+      if (conn->fd >= 0)
+	retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags);
+      SL_RETURN( (0), _("sh_forward_do_write"));
+    }
+
+
+  /* ---- send the body ------
+   */
+
+  if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_send > 0 &&
+      conn->buf != NULL)
+    {
+      bytesent           = write (conn->fd, &(conn->buf[conn->bytecount]), 
+				     conn->bytes_to_send - conn->bytecount);
+      if (bytesent >= 0 || errno == EINTR || errno == EAGAIN) 
+	{
+	  if (bytesent > 0) 
+	    conn->bytecount    += bytesent;
+	  if (conn->bytecount == conn->bytes_to_send) 
+	    {
+	      ++conn->pass;
+	      conn->state         = CONN_PAUSE;
+	      /* ------  HERE CALL check_protocol(conn) -------  */
+	      check_protocol(conn, SH_DO_WRITE);
+	    }
+	}
+      else
+	{
+	  goto conn_reset_w;
+	}
+    }
+      
+  else if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_send == 0)
+    {
+      ++conn->pass;
+      conn->state     = CONN_PAUSE;
+      /* fprintf(stderr, "\n**** FIXME null write ****\n\n"); */
+      /* ------  HERE CALL check_protocol(conn) -------  */
+      check_protocol(conn, SH_DO_WRITE);
+    }
+
+  if (conn->fd >= 0)
+    retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags);
+  SL_RETURN( (0), _("sh_forward_do_write"));
+
+ conn_reset_w:
+  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_RESET,
+		  conn->peer);
+  sh_forward_do_free ( conn );
+  SL_RETURN( (-1), _("sh_forward_do_write"));
+}
+
+/* accept a connection from a client
+ */ 
+#include <syslog.h>
+#ifdef SH_USE_LIBWRAP
+#include <tcpd.h>
+
+#ifndef ALLOW_SEVERITY 
+#define ALLOW_SEVERITY LOG_INFO
+#define DENY_SEVERITY  LOG_WARNING
+#endif
+
+int allow_severity;
+int deny_severity;
+#endif
+
+int sh_forward_accept (int sock, sh_conn_t * newconn)
+{
+  int                errflag;
+  int                rc;
+  struct sockaddr_in addr;
+#ifdef SH_USE_LIBWRAP
+  struct request_info request;
+  char                errbuf[128];
+  char                daemon[128];
+#endif
+  
+  /* handle AIX (size_t addrlen) in wrapper
+   */
+  int                addrlen = sizeof(addr);
+
+  SL_ENTER(_("sh_forward_accept"));
+
+  rc = retry_accept(FIL__, __LINE__, sock, 
+		    (struct sockaddr *) &addr, &addrlen);
+
+  if (rc >= 0)
+    {
+
+      if (addrlen == 0)
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			  _("Connecting entity unknown"), _("accept"));
+	  newconn->fd    = -1;
+	  newconn->state = CONN_FREE;
+	  close(rc);
+	  SL_RETURN( (-1), _("sh_forward_accept"));
+	}
+
+#ifdef SH_USE_LIBWRAP
+      sl_strlcpy(daemon, SH_INSTALL_NAME, 128);
+      request_init(&request, RQ_DAEMON, daemon, RQ_FILE, rc, 0);
+      fromhost(&request);
+      if (!hosts_access(&request)) 
+	{
+	  sl_strlcpy(errbuf, _("Refused connection from "), 128);
+	  sl_strlcat(errbuf,   eval_client(&request), 128);
+
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			  errbuf, _("libwrap"));
+	  newconn->fd    = -1;
+	  newconn->state = CONN_FREE;
+	  close(rc);
+	  SL_RETURN( (-1), _("sh_forward_accept"));
+	}
+#endif
+
+      memcpy (&(newconn->addr_peer), &addr, sizeof(struct sockaddr_in));
+
+      /* prepare for usage of connection
+       */
+      (void) retry_fcntl( FIL__, __LINE__, rc, F_SETFD, 1 );
+      newconn->fd           = rc;
+      newconn->state        = CONN_READING;
+      newconn->timer        = (unsigned long) time (NULL);
+
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_CNEW, newconn->fd);
+
+      SL_RETURN( (0), _("sh_forward_accept"));
+    }
+  else
+    {
+      errflag = errno;
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		      sh_error_message(errflag), _("accept"));
+      newconn->fd    = -1;
+      newconn->state = CONN_FREE;
+      SL_RETURN( (-1), _("sh_forward_accept"));
+    }
+}
+
+extern char sh_sig_msg[64];  /* defined in sh_unix.c */
+
+/* ------------  port and interface -------
+ */
+static unsigned int server_port = SH_DEFAULT_PORT;
+
+int sh_forward_set_port (char * str)
+{
+  int retval = 0;
+  unsigned long   i;
+  char * endptr = str;
+  
+  SL_ENTER(_("sh_forward_set_port"));
+  i = strtoul (str, &endptr, 0);
+  if (endptr == str) {
+    retval = -1;
+  } else if (i > 65535) {
+    retval = -1;
+  } else {
+    server_port = i;
+  }
+  SL_RETURN( (retval), _("sh_forward_set_port"));
+}
+
+static struct in_addr server_interface;
+static int            use_server_interface = 0;
+
+int sh_forward_set_interface (char * str)
+{
+  if (0 == strcmp(str, _("INADDR_ANY")))
+    {
+      use_server_interface = 0;
+      return 0;
+    }
+  if (0 == /*@-unrecog@*/inet_aton(str, &server_interface)/*@+unrecog@*/) 
+    {
+      use_server_interface = 0;
+      return -1;
+    }
+  use_server_interface = 1;
+  return 0;
+}
+
+/* ------------  print error --------------
+ */
+struct sock_err_st {
+  char msg[128];
+  int  errnum;
+  int  port;
+  int  line;
+  int  euid;
+};
+
+static struct sock_err_st sock_err[2];
+
+void sh_forward_printerr(char * str, int errnum, unsigned int port, int line)
+{
+  int slot = 0;
+
+  if (port != server_port)
+    slot = 1;
+  if (str == NULL)
+    sock_err[slot].msg[0] = '\0';
+  else
+    sl_strlcpy(sock_err[slot].msg, str, 128);
+  sock_err[slot].errnum = errnum;
+  sock_err[slot].port   = port;
+  sock_err[slot].line   = line;
+  sock_err[slot].euid   = (int) geteuid();
+}
+
+int sh_forward_printerr_final(int slot)
+{
+  SL_ENTER(_("sh_forward_printerr_final"));
+  if (sock_err[slot].msg[0] != '\0')
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("Could not set up the listening socket for the server because of the\nfollowing error: %s\nPossible reasons include:\n - insufficient privilege for UID %d, or\n - the port %d is already used by another program.\n"),
+	   sh_error_message(sock_err[slot].errnum), sock_err[slot].euid, 
+	   sock_err[slot].port);
+      sh_error_handle((-1), FIL__, sock_err[slot].line, 
+		      sock_err[slot].errnum, MSG_EXIT_ABORTS,
+		      sh_error_message(sock_err[slot].errnum),
+		      sh.prg_name,
+		      sock_err[slot].msg);
+      SL_RETURN((-1), _("sh_forward_printerr_final"));
+    }
+  SL_RETURN(0, _("sh_forward_printerr_final"));
+}
+
+static   sh_conn_t        * conns = NULL;
+#define  TIME_OUT_DEF 300
+static   int  maxconn = 0;  /* maximum number of simultaneous connections */
+
+
+#ifdef INET_SYSLOG
+#define INET_SUSPEND_TIME 180		/* equal to 3 minutes */
+#define SH_MINSOCK 3
+int create_syslog_socket (int flag);
+static int recv_syslog_socket   (int fd);
+static int syslog_sock = -1;
+#else
+#define SH_MINSOCK 2
+#endif
+
+extern int pf_unix_fd;
+
+/* the tcp socket, and the function to establish it
+ */
+static int sh_tcp_sock = -1;
+
+int sh_create_tcp_socket ()
+{
+  struct sockaddr_in addr;
+  int addrlen      = sizeof(addr);
+
+  int sock   = -1;
+  int errnum = 0;
+  int flag   = 1; /* non-zero to enable an option */
+
+  SL_ENTER(_("sh_create_tcp_socket"));
+
+  sh_forward_printerr (NULL, 0, server_port, __LINE__);
+
+  /* create the socket, bind() it and listen()
+   */
+  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0 )
+    {
+      errnum = errno; 
+      sh_forward_printerr (_("socket"), errnum, server_port, __LINE__);
+      SL_RETURN((-1), _("sl_create_tcp_socket"));
+    }
+  (void) retry_fcntl( FIL__, __LINE__, sock, F_SETFD, 1 );
+  
+  if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+		  (void *) &flag, sizeof(flag)) < 0 )
+    {
+      errnum = errno;
+      sh_forward_printerr (_("setsockopt"), errnum, server_port, __LINE__);
+      SL_RETURN((-1), _("sl_create_tcp_socket"));
+    }
+  
+  addr.sin_family      = AF_INET;
+  addr.sin_port        = htons(server_port);
+  if (use_server_interface == 0)
+    addr.sin_addr.s_addr = INADDR_ANY;
+  else
+    memcpy(&addr.sin_addr, &server_interface, sizeof(struct in_addr));
+  
+  if ( bind(sock, (struct sockaddr *) &addr, addrlen) < 0) 
+    {
+      errnum = errno;
+      sh_forward_printerr (_("bind"), errnum, server_port, __LINE__);
+      SL_RETURN((-1), _("sl_create_tcp_socket"));
+    }
+  
+  if ( retry_fcntl( FIL__, __LINE__, sock, F_SETFL, O_NONBLOCK ) < 0 )
+    {
+      errnum = errno;
+      sh_forward_printerr (_("fcntl"), errnum, server_port, __LINE__);
+      SL_RETURN((-1), _("sl_create_tcp_socket"));
+    }
+  
+  if ( listen(sock, 5) < 0)
+    {
+      errnum = errno;
+      sh_forward_printerr (_("listen"), errnum, server_port, __LINE__);
+      SL_RETURN((-1), _("sl_create_tcp_socket"));
+    }
+
+  sh_tcp_sock = sock;
+
+  SL_RETURN((sock), _("sl_create_tcp_socket"));
+}
+
+/*****************************************
+ *
+ * This is the server main loop.
+ *
+ * The server is set up for listening, and
+ * and starts a select() loop.
+ *
+ *****************************************/
+
+void sh_receive()
+{
+#ifdef SH_USE_XML
+  extern int  sh_log_file    (char * message, char * inet_peer);
+#endif
+
+  int                sock = -1;
+  sh_conn_t        * cx;
+  fd_set             readset;
+  fd_set             writeset;
+  struct timeval     tv;
+  int                num_sel;
+  int                errnum;
+  int                nowconn;
+  int                status;
+  int                high_fd;
+  register int       i;
+  long               dummy = 0;
+  unsigned long      time_now;
+  unsigned long      time_last = 0;
+  unsigned long      time_out = TIME_OUT_DEF;  
+  
+  time_t told;
+  time_t tcurrent;
+
+  unsigned long tchkold;
+
+  struct  sigaction  new_act;
+  struct  sigaction  old_act;
+  
+  SL_ENTER(_("sh_receive"));
+
+  /* ignore SIGPIPE (instead get EPIPE if connection is closed)
+   *      --- we have called sh_unix_init() already ---
+   */
+  new_act.sa_handler = SIG_IGN;
+  retry_sigaction (FIL__, __LINE__, SIGPIPE, &new_act, &old_act);
+
+  if ( sh_forward_printerr_final(0) < 0)
+    {
+      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+  sock = sh_tcp_sock;
+
+  /* ****************************************************************
+   *
+   * This is a non-forking server. We use select() on the listen()
+   * socket to watch for new connections. For new connections, accept()
+   * will return a new socket that is put in the read/write filesets.
+   * Data about active connections are kept in the 'conns' table. 
+   *
+   ******************************************************************/
+  
+  /* The table to hold info on sockets.
+   * We reserve 6 file descriptors for misc. use.
+   * The POSIX lower limit on open files seems to be eight. 
+   */
+  maxconn = get_open_max() - 6;
+  maxconn = (((int)FD_SETSIZE) < maxconn) ? FD_SETSIZE : maxconn;
+
+  conns   = SH_ALLOC (sizeof(sh_conn_t) * maxconn);
+
+  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_START_SRV,
+		  (maxconn-1), sock);
+
+  /* timer
+   */
+  tcurrent                   = (unsigned long) time (NULL);
+  told                       = tcurrent;
+
+  tchkold                    = tcurrent;
+  
+  for (i = SH_MINSOCK; i < maxconn; ++i)
+    {
+      conns[i].buf         = NULL;
+      conns[i].K           = NULL;
+      conns[i].A           = NULL;
+      conns[i].M1          = NULL;
+      conns[i].FileName    = NULL;
+      conns[i].fd          = -1;
+      sh_forward_do_free ( &conns[i]);
+    }
+  
+  /* status init
+   */
+  server_status.conn_open  = 0;
+  server_status.conn_total = 0;
+  server_status.conn_max   = maxconn-1;
+  server_status.start      = time (NULL);
+  server_status.last       = (time_t) 0;
+
+  nowconn    = 1;
+  tv.tv_sec  = 5;
+  tv.tv_usec = 0;
+  
+  /* conns[0] is the listen() socket. Always in read mode.
+   */
+  conns[0].fd    = sock;
+  conns[0].state = CONN_READING;
+  high_fd = sock;
+  
+  conns[1].fd    = pf_unix_fd;
+  conns[1].state = CONN_READING;
+  high_fd = (pf_unix_fd > high_fd) ? pf_unix_fd : high_fd;
+  
+#ifdef INET_SYSLOG
+  conns[2].fd = -1;
+  if ( sh_forward_printerr_final(1) < 0)
+    {
+      SH_FREE(conns);
+      conns = NULL;
+      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+  sock = syslog_sock;
+
+  if (sock >= 0)
+    {
+      conns[2].fd    = sock;
+      conns[2].state = CONN_READING;
+      high_fd = (high_fd > conns[2].fd) ? high_fd : conns[2].fd;
+    }
+#endif
+  
+  sh_html_write(all_clients);
+  
+  /* This is the select() loop.
+   */
+  while (1 == 1)
+    {
+
+    if (sig_raised > 0)
+      {
+	TPT((0, FIL__, __LINE__, _("msg=<Process a signal.>\n")))
+
+	if (sig_termfast == 1)  /* SIGTERM */
+	  {
+	    TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	    strncpy (sh_sig_msg, _("SIGTERM"), 20);
+	    --sig_raised; --sig_urgent;
+	    aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	  }
+	  
+	if (sig_config_read_again == 1)
+	  {
+	    TPT((0, FIL__, __LINE__, _("msg=<Re-read configuration.>\n")));
+	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_RECONF);
+
+
+	    /* -- Delete the name server cache. --
+	     */
+
+	    delete_cache();
+#if defined(WITH_EXTERNAL)
+	    /* -- Delete list of external tasks. --
+	     */
+	    (void) sh_ext_cleanup();
+#endif
+	    /* - mark all clients dead
+	     * - read configuration file
+	     * - remove clients still dead
+	     */
+	    sh_forward_mark_dead ();
+
+#if defined(SH_WITH_MAIL)
+	    reset_count_dev_mail();
+#endif
+	    reset_count_dev_console();
+	    reset_count_dev_time();
+	    sl_trust_purge_user();
+
+	    (void) sh_readconf_read ();
+	    for (i = SH_MINSOCK; i < maxconn; ++i)
+	      if (conns[i].state != CONN_FREE   && 
+		  conns[i].client_entry != NULL &&
+		  conns[i].client_entry->dead_flag == 1)
+		sh_forward_do_free ( &conns[i]);
+	    sh_forward_clean_tree ();
+
+	    sig_config_read_again = 0;
+	    --sig_raised;
+	  }
+
+	if (sig_fresh_trail == 1) /* SIGIOT */
+	  {
+	    /* Logfile access 
+	     */
+#ifdef SH_USE_XML
+	    sh_log_file (NULL, NULL);
+#endif
+	    TPT((0, FIL__, __LINE__, _("msg=<Logfile stop/restart.>\n")));
+	    sh_error_only_stderr (S_TRUE);
+	    sh_unix_rm_lock_file(sh.srvlog.name);
+	    retry_msleep(3, 0);
+	    sh.flag.log_start = S_TRUE;
+	    sh_error_only_stderr (S_FALSE);
+	    sig_fresh_trail       = 0;
+	    --sig_raised;
+	  }
+	
+	  
+	if (sig_terminate == 1 && nowconn < 2)  /* SIGQUIT */
+	  {
+	    TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	    strncpy (sh_sig_msg, _("SIGQUIT"), 20);
+	    --sig_raised; --sig_urgent;
+	    aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	  }
+	
+	  
+	if (sig_debug_switch == 1)  /* SIGUSR1 */
+	  {
+	    TPT((0, FIL__, __LINE__, _("msg=<Debug switch.>\n")));
+	    sh_error_dbg_switch();
+	    sig_debug_switch = 0;
+	    --sig_raised;
+	  }
+	
+	if (sig_suspend_switch == 1)  /* SIGUSR2 */
+	  {
+	    TPT((0, FIL__, __LINE__, _("msg=<Suspend switch.>\n")));
+	    if (sh_global_suspend_flag == 1) {
+	      sh_global_suspend_flag = 0;
+	    } else {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_SUSPEND, 
+			      sh.prg_name);
+	      sh_global_suspend_flag = 1;
+	    }
+	    sig_suspend_switch = 0;
+	    --sig_raised; --sig_urgent;
+	  }
+
+	sig_raised = (sig_raised < 0) ? 0 : sig_raised;
+	sig_urgent = (sig_urgent < 0) ? 0 : sig_urgent;
+	TPT((0, FIL__, __LINE__, _("msg=<End signal processing.>\n")));
+      }
+      
+      if (sh_global_suspend_flag == 1)
+	{
+	  (void) retry_msleep (1, 0);
+	  continue;
+	}
+
+      /* Recompute the descriptor set. select() modifies it,
+       * thus we update it using the info from the connection table.
+       * Also recompute the number of open connections.
+       */
+      FD_ZERO( &readset );
+      FD_ZERO( &writeset );
+      FD_SET(conns[0].fd, &readset );
+      high_fd   = conns[0].fd;
+
+      if (conns[1].fd > -1)
+	{
+	  FD_SET(conns[1].fd, &readset );
+	  high_fd   = (high_fd > conns[1].fd) ? high_fd : conns[1].fd;
+	}
+
+#ifdef INET_SYSLOG
+      if (conns[2].fd > -1)
+	{
+	  FD_SET(conns[2].fd, &readset );
+	  high_fd   = (high_fd > conns[2].fd) ? high_fd : conns[2].fd;
+	}
+#endif
+
+      time_now  = (unsigned long) time (NULL);
+      nowconn   = 1;
+      
+      for (i = SH_MINSOCK; i < maxconn; ++i)
+	{
+	  /* eliminate timed out connections
+	   */
+	  if (conns[i].state != CONN_FREE) 
+	    {
+	      if (time_now-conns[i].timer > time_out)
+		{
+		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_TIMOUT,
+				  conns[i].peer);
+		  sh_forward_do_free ( &conns[i]);
+		}
+	      else
+		++nowconn;
+	    }
+	  
+	  
+	  if       (conns[i].state   == CONN_READING)
+	    { 
+	      FD_SET(conns[i].fd, &readset);
+	      high_fd = (high_fd < conns[i].fd ? conns[i].fd : high_fd);
+	    }
+	  else if  (conns[i].state   == CONN_SENDING)
+	    {
+	      FD_SET(conns[i].fd, &writeset);
+	      high_fd = (high_fd < conns[i].fd ? conns[i].fd : high_fd);
+	    }
+	}
+
+      /* -- Exponentially reduce timeout limit if more than 1/2 full. --
+       */
+      if (nowconn > (maxconn/2))
+	time_out = ( (time_out/2) > 1) ? (time_out/2) : 1;
+      else
+	time_out = TIME_OUT_DEF;
+      
+      
+      
+      /* -- Do the select(). --
+       */
+      num_sel = select(high_fd+1, &readset, &writeset, NULL, &tv);
+      errnum  = errno;
+      
+      /* reset timeout - modified by select() on some systems
+       */
+      tv.tv_sec  = 5;
+      tv.tv_usec = 0;
+      
+
+      if ( (time_now - time_last) > 2L)
+	{
+	  time_last = time_now;
+	  if (sh_html_write(all_clients) < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_HTML);
+	}
+      
+      
+      /* Error handling.
+       */
+      if ( num_sel < 0 )        /* some error             */
+	{
+	  if (sig_raised == 1)
+	    {
+	      sig_raised = 2;
+	      continue;
+	    }
+
+	  if ( errnum == EINTR)
+	    continue;	  /* try again              */
+
+	  if ( errnum == EBADF)
+	    {
+	      /* seek and destroy the bad fd
+	       */
+	      for (i = SH_MINSOCK; i < high_fd; ++i)
+		{
+		  if ((conns[i].state == CONN_READING) ||
+		      (conns[i].state == CONN_SENDING))
+		    {
+		      if (-1 == retry_fcntl(FIL__, __LINE__, 
+					    conns[i].fd, F_GETFL, dummy))
+			sh_forward_do_free ( &conns[i]);
+		    }
+		}
+	      continue;
+	    }
+
+	  sh_error_handle((-1), FIL__, __LINE__, errnum, MSG_EXIT_ABORTS,
+			  sh_error_message(errnum), 
+			  sh.prg_name,
+			  _("select"));
+	  aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
+	}
+      
+
+      /* log the timestamp
+       */
+      if ((tcurrent - told) > sh.looptime )
+	{
+	  told = tcurrent;
+#ifdef MEM_DEBUG
+	  sh_mem_check();
+	  sh_unix_count_mlock();
+#else
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_STAMP);
+#endif
+	}
+
+#if defined(SH_WITH_MAIL)
+      /* 
+       * flush the mail queue
+       */
+      if (tcurrent - sh.mailTime.alarm_last > sh.mailTime.alarm_interval) 
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Flush mail queue.>\n")))
+	  (void) sh_mail_msg (NULL);
+	  sh.mailTime.alarm_last = tcurrent;
+	}
+#endif
+#ifdef MEM_DEBUG
+      sh_mem_dump();
+#endif
+
+      tcurrent = (unsigned long) time (NULL);
+
+      /* select() timeout handling.
+       */
+      if ( num_sel == 0 )       /* timeout - no connection */ 
+	{
+	  if (sh_html_write(all_clients) < 0)
+	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_HTML);
+	  continue;
+	}
+
+      /* New connection.
+       */
+      if ( FD_ISSET(conns[0].fd , &readset )) /* a new connection   */
+	{
+	  --num_sel;
+	  status = 0;
+	  if (nowconn < maxconn && sig_terminate == 0 && sig_termfast == 0)
+	    {
+	      i = SH_MINSOCK;
+	      while (i < maxconn)
+		{
+		  if (conns[i].state == CONN_FREE)
+		    {
+		      status = sh_forward_accept (conns[0].fd, &conns[i]);
+		      if (status == 0)
+			{
+			  high_fd = 
+			    (high_fd > conns[i].fd ? high_fd : conns[i].fd);
+			  ++server_status.conn_open;
+			  ++server_status.conn_total;
+			  server_status.last = time (NULL);
+			}
+		      break;
+		    }
+		  ++i;
+		}
+	    }
+	  if (status == 0) 
+	    continue;
+	}
+      
+      /* check for commands on the socket
+       */
+      if (conns[1].fd > (-1) && FD_ISSET(conns[1].fd , &readset ))
+	{
+	  sh_socket_poll();
+	}
+
+#ifdef INET_SYSLOG
+      if (conns[2].fd > (-1) && FD_ISSET(conns[2].fd , &readset ))
+	{
+	  recv_syslog_socket (conns[2].fd);
+	}
+#endif
+
+      /* Check for pending read/write on the rest of the sockets.
+       */
+      for ( i = SH_MINSOCK; num_sel > 0 && i < maxconn; ++i )
+	{
+	  if (sig_termfast == 1)
+	    break;
+
+	  cx = &conns[i];
+	  if ( cx->state == CONN_READING &&
+	       FD_ISSET( cx->fd, &readset ) )
+	    {
+	      --num_sel;
+	      sh_forward_do_read ( cx );
+	    }
+	  else if ( cx->state == CONN_SENDING &&
+		    FD_ISSET( cx->fd, &writeset ) )
+	    {
+	      --num_sel;
+	      sh_forward_do_write ( cx );
+	    }
+	}
+
+      /* check for time limit exceeded
+       */
+      if ((tcurrent - tchkold) > (unsigned int) 3 )
+	{
+	  tchkold = tcurrent;
+	  client_time_check(/* all_clients */);
+	}
+      tcurrent = tcurrent;
+      
+      /* seed / re-seed the PRNG if required
+       */
+      (void) taus_seed();
+      
+    }
+  /* notreached */
+}
+
+void  free_client_tree ()
+{
+  SL_ENTER(_("free_client_tree"));
+  zAVLFreeTree (all_clients, free_client);
+  SL_RET0(_("free_client_tree"));
+}
+
+void sh_forward_free_all ()
+{
+  register int i;
+  
+  SL_ENTER(_("sh_forward_free_all"));
+
+  if (conns != NULL)
+    for (i = SH_MINSOCK; i < maxconn; ++i)
+      {
+	sh_forward_do_free ( &conns[i]);
+      }
+
+
+  free_client_tree ();
+
+  if (conns != NULL)
+    SH_FREE (conns);
+
+  SL_RET0(_("sh_forward_free_all"));
+}
+
+#ifdef INET_SYSLOG
+
+#ifdef HAVE_INET_ATON
+static char * my_inet_ntoa(struct in_addr in)
+{
+  return inet_ntoa(in);
+}
+#else
+static char * my_inet_ntoa(struct in_addr in)
+{
+  unsigned char a, b, c, d;
+  static char   foo[16];
+  char          bar[4];
+  memcpy (bar, &(in.s_addr), 4); /* memory alignment (?) */
+  memcpy (&a, &bar[0], 1);
+  memcpy (&b, &bar[1], 1);
+  memcpy (&c, &bar[2], 1);
+  memcpy (&d, &bar[3], 1);
+  sprintf(foo, "%d.%d.%d.%d",                       /* known to fit  */
+	  (int) a, (int) b, (int) c, (int) d);
+  return foo;
+}
+#endif
+
+
+/* Unlike Linux / FreeBSD, most systems don't define the stuff below
+ * in syslog.h
+ */
+
+#ifndef LOG_FAC
+#define LOG_FAC(p)      (((p) & LOG_FACMASK) >> 3)
+#endif
+
+#ifndef LOG_PRI
+#define LOG_PRI(p)      ((p) & LOG_PRIMASK)
+#endif
+
+typedef struct sh_code {
+        char    *c_name;
+        int     c_val;
+} SH_CODE;
+
+SH_CODE sh_facilitynames[] =
+{
+#ifdef LOG_AUTH
+  { N_("auth"), LOG_AUTH },
+#endif
+#ifdef LOG_AUTHPRIV 
+  { N_("authpriv"), LOG_AUTHPRIV },
+#endif
+#ifdef LOG_CRON
+  { N_("cron"), LOG_CRON },
+#endif
+#ifdef LOG_DAEMON
+  { N_("daemon"), LOG_DAEMON },
+#endif
+#ifdef LOG_FTP
+  { N_("ftp"), LOG_FTP },
+#endif
+#ifdef LOG_KERN
+  { N_("kern"), LOG_KERN },
+#endif
+#ifdef LOG_LPR
+  { N_("lpr"), LOG_LPR },
+#endif
+#ifdef LOG_MAIL
+  { N_("mail"), LOG_MAIL },
+#endif
+#ifdef INTERNAL_MARK
+  { N_("mark"), INTERNAL_MARK },          /* INTERNAL */
+#endif
+#ifdef LOG_NEWS
+  { N_("news"), LOG_NEWS },
+#endif
+#ifdef LOG_AUTH
+  { N_("security"), LOG_AUTH },           /* DEPRECATED */
+#endif
+#ifdef LOG_SYSLOG
+  { N_("syslog"), LOG_SYSLOG },
+#endif
+#ifdef LOG_USER
+  { N_("user"), LOG_USER },
+#endif
+#ifdef LOG_UUCP
+  { N_("uucp"), LOG_UUCP },
+#endif
+#ifdef LOG_LOCAL0
+  { N_("local0"), LOG_LOCAL0 },
+#endif
+#ifdef LOG_LOCAL1
+  { N_("local1"), LOG_LOCAL1 },
+#endif
+#ifdef LOG_LOCAL2 
+  { N_("local2"), LOG_LOCAL2 },
+#endif
+#ifdef LOG_LOCAL3
+  { N_("local3"), LOG_LOCAL3 },
+#endif
+#ifdef LOG_LOCAL4
+  { N_("local4"), LOG_LOCAL4 },
+#endif
+#ifdef LOG_LOCAL5
+  { N_("local5"), LOG_LOCAL5 },
+#endif
+#ifdef LOG_LOCAL6
+  { N_("local6"), LOG_LOCAL6 },
+#endif
+#ifdef LOG_LOCAL7
+  { N_("local7"), LOG_LOCAL7 },
+#endif
+  { NULL, -1 }
+};
+ 
+
+SH_CODE sh_prioritynames[] =
+{  
+#ifdef LOG_ALERT
+  { N_("alert"), LOG_ALERT },
+#endif
+#ifdef LOG_CRIT
+  { N_("crit"), LOG_CRIT },
+#endif
+#ifdef LOG_DEBUG
+  { N_("debug"), LOG_DEBUG },
+#endif
+#ifdef LOG_EMERG
+  { N_("emerg"), LOG_EMERG },
+#endif
+#ifdef LOG_ERR
+  { N_("err"), LOG_ERR },
+#endif
+#ifdef LOG_ERR
+  { N_("error"), LOG_ERR },               /* DEPRECATED */
+#endif
+#ifdef LOG_INFO
+  { N_("info"), LOG_INFO },
+#endif
+#ifdef INTERNAL_NOPRI
+  { N_("none"), INTERNAL_NOPRI },         /* INTERNAL */
+#endif
+#ifdef LOG_NOTICE
+  { N_("notice"), LOG_NOTICE },
+#endif
+#ifdef LOG_EMERG
+  { N_("panic"), LOG_EMERG },             /* DEPRECATED */
+#endif
+#ifdef LOG_WARNING
+  { N_("warn"), LOG_WARNING },            /* DEPRECATED */
+#endif
+#ifdef LOG_WARNING
+  { N_("warning"), LOG_WARNING },
+#endif
+  { NULL, -1 }
+};
+
+static int enable_syslog_socket = S_FALSE;
+
+static int recv_syslog_socket (int fd)
+{
+  static time_t      return_next = 0;
+  int                priority = 0;
+  int                fac, pri;
+  int                i;
+  char             * cfac = NULL;
+  char             * cpri = NULL;
+  int                res;
+  char             * tmp;
+  char             * bptr;
+  char             * ptr = NULL;
+  char               buf[1048];
+  struct sockaddr_in from;
+
+  /* The 6th argument in recvfrom is *socklen_t in Linux and *BSD, 
+   * but *int everywhere else. Because socklen_t is unsigned int, there
+   * should be no problem as long as  sizeof(struct sockaddr_in) < INT_MAX ...
+   */
+  int                fromlen = sizeof(from);
+
+  if (enable_syslog_socket == S_FALSE)
+    return 0;
+
+  SL_ENTER(_("recv_syslog_socket"));
+
+  if (return_next > 0)
+    {
+      if ( (time(NULL) - return_next) < 2)
+	SL_RETURN( 0, _("recv_syslog_socket"));
+      else
+	return_next = 0;
+    }
+
+  res = recvfrom(fd,  buf,  1047, 0, (struct sockaddr *) &from, &fromlen);
+
+  if (res > 0)
+    {
+      res = (res < 1047) ? res : 1047; 
+      buf[res] = '\0';
+      if (res > 1 && buf[res-1] == '\n')
+	buf[res-1] = '\0';
+
+      /* here we expect an xml formatted message, thus we don't
+	 escape xml special chars (flag == 0) */
+      /* commented out to not escape twice    */
+      /* bptr = sh_tools_safe_name(buf, 0);   */
+      bptr = buf;
+
+      if (!bptr || !(*bptr))
+	{
+	  res = errno;
+	  TPT(( 0, FIL__, __LINE__, _("msg=<UDP error: %d>\n"), res));
+	  sh_error_handle((-1), FIL__, __LINE__, res, MSG_ERR_SYSLOG,
+			  sh_error_message(res), my_inet_ntoa(from.sin_addr));
+	  SL_RETURN( (-1), _("recv_syslog_socket"));
+	}      
+
+      TPT(( 0, FIL__, __LINE__, _("msg=<UDP message from %s>\n"),
+	    my_inet_ntoa(from.sin_addr)));
+      ptr = bptr;
+      i = 0;
+      if (*ptr == '<') 
+	{
+	  ++ptr; ++i;
+	  while (i < res &&
+		 (unsigned char) *ptr > 47 && (unsigned char) *ptr < 58)
+	    {
+	      priority = 10 * priority + (*ptr - '0');
+	      ++ptr;
+	      ++i;
+	    }
+	  if (*ptr == '>')
+	    ++ptr;
+	}
+      fac = LOG_FAC(priority);
+      i = 0; 
+      while (sh_facilitynames[i].c_name != NULL)
+	{
+	  if (sh_facilitynames[i].c_val == (fac<<3))
+	    { cfac = sh_util_strdup(_(sh_facilitynames[i].c_name)); break; }
+	  ++i;
+	}
+      pri = LOG_PRI(priority);
+      i = 0; 
+      while (sh_prioritynames[i].c_name != NULL)
+	{
+	  if (sh_prioritynames[i].c_val == pri)
+	    { cpri = sh_util_strdup(_(sh_prioritynames[i].c_name)); break; }
+	  ++i;
+	}
+
+      /* here we do not expect an xml formatted message, thus we escape
+	 xml special chars (flag == 1) */
+      tmp = sh_tools_safe_name (ptr, 1);
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_INET_SYSLOG,
+		      my_inet_ntoa(from.sin_addr), 
+		      (cfac == NULL) ? _("none") : cfac, 
+		      (cpri == NULL) ? _("none") : cpri, 
+		      (ptr  == NULL) ? _("none") : ptr);
+      if (cfac != NULL)
+	SH_FREE(cfac);
+      if (cpri != NULL)
+	SH_FREE(cpri);
+      SH_FREE(tmp);
+      /* SH_FREE(bptr); */
+    }
+
+  else if (res < 0 && errno != EINTR)
+    {
+      res = errno;
+      TPT(( 0, FIL__, __LINE__, _("msg=<UDP error: %d>\n"), res));
+      sh_error_handle((-1), FIL__, __LINE__, res, MSG_ERR_SYSLOG,
+		      sh_error_message(res), my_inet_ntoa(from.sin_addr));
+
+      /* don't accept anything the next 2 seconds
+       */
+      return_next = time(NULL);
+      SL_RETURN( (-1), _("recv_syslog_socket"));
+    }      
+  SL_RETURN( (0), _("recv_syslog_socket"));
+}
+
+int set_syslog_active(char * c)
+{
+  return sh_util_flagval(c, &enable_syslog_socket);
+}
+
+/* callerFlag == S_TRUE means override the enable_syslog_socket flag
+ */
+int create_syslog_socket (int callerFlag)
+{
+  int                flag = 1;  /* non-zero to enable an option */
+  int sock;
+  int errnum;
+  int res;
+  struct sockaddr_in addr;
+  int addrlen      = sizeof(addr);
+
+  SL_ENTER(_("create_syslog_socket"));
+
+  if (callerFlag == S_FALSE)
+    {
+      if (enable_syslog_socket == S_FALSE && syslog_sock >= 0)
+	{
+	  /* user does not wish to use this facility
+	   */
+	  TPT(( 0, FIL__, __LINE__, _("msg=<close syslog socket>\n")));
+	  close(syslog_sock);
+	  syslog_sock = -1;
+	}
+      SL_RETURN((-1), _("create_syslog_socket"));
+    }
+
+  sh_forward_printerr (NULL, 0, 514, __LINE__);
+
+  /* create the socket, bind() it and listen()
+   */
+  sock = socket(AF_INET, SOCK_DGRAM, 0);
+
+  if (sock < 0)
+    {
+      errnum = errno; 
+      sh_forward_printerr (_("syslog socket"), errnum, 514, __LINE__);
+      SL_RETURN((-1), _("create_syslog_socket"));
+    }
+  (void) retry_fcntl( FIL__, __LINE__, sock, F_SETFD, 1 );
+  
+  if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+		  (void *) &flag, sizeof(flag)) < 0 )
+    {
+      errnum = errno;
+      sh_forward_printerr (_("syslog setsockopt SO_REUSEADDR"), 
+			   errnum, 514, __LINE__);
+      SL_RETURN((-1), _("create_syslog_socket"));
+    }
+
+#if defined(SO_BSDCOMPAT)
+  if ( setsockopt(sock, SOL_SOCKET, SO_BSDCOMPAT,
+		  (void *) &flag, sizeof(flag)) < 0 )
+    {
+      errnum = errno;
+      sh_forward_printerr (_("syslog setsockopt SO_BSDCOMPAT"), 
+			   errnum, 514, __LINE__);
+      SL_RETURN((-1), _("create_syslog_socket"));
+    }
+#endif
+  
+  memset(&addr, 0, sizeof(addr));
+  addr.sin_family      = AF_INET;
+  addr.sin_port        = htons(514);
+  
+  res = bind(sock, (struct sockaddr *) &addr, addrlen);
+
+  if ( res < 0) 
+    {
+      errnum = errno;
+      sh_forward_printerr (_("syslog bind"), errnum, 514, __LINE__);
+      close(sock);
+      SL_RETURN((-1), _("create_syslog_socket"));
+    }
+
+  syslog_sock = sock;
+
+  SL_RETURN((sock), _("create_syslog_socket"));
+}
+/* #ifdef INET_SYSLOG */
+#endif
+
+
+
+/* #ifdef SH_WITH_SERVER */
+#endif
+
+
+  
+
+
+
Index: trunk/src/sh_getopt.c
===================================================================
--- trunk/src/sh_getopt.c	(revision 591)
+++ trunk/src/sh_getopt.c	(revision 1)
@@ -30,14 +30,9 @@
 #include "sh_error.h"
 #include "sh_getopt.h"
-#include "sh_unix.h"
 #include "sh_files.h"
 #include "sh_utils.h"
 #include "sh_mail.h"
-#include "sh_xfer.h"
+#include "sh_forward.h"
 #include "sh_hash.h"
-#include "sh_dbIO.h"
-#include "sh_dbCheck.h"
-#include "sh_dbCreate.h"
-#include "sh_sem.h"
 
 #if defined(WITH_EXTERNAL)
@@ -45,5 +40,5 @@
 #endif
 
-extern int      sh_calls_set_bind_addr (const char *);
+extern int      sh_calls_set_bind_addr (char *);
 
 #undef  FIL__
@@ -57,19 +52,17 @@
 
 typedef struct options {
-  const char * longopt;
+  char * longopt;
   const char   shortopt;
-  const char * usage;
+  char * usage;
   int          hasArg;
-  int (*func)(const char * opt);
+  int (*func)(char * opt);
 } opttable_t;
 
 /*@noreturn@*/
-static int sh_getopt_usage (const char * dummy);
+static int sh_getopt_usage (char * dummy);
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
-static int sh_getopt_forever (const char * dummy);
-static int sh_getopt_outpath (const char * dummy);
-#endif
-static int sh_getopt_copyright (const char * dummy);
-static int sh_getopt_version (const char * dummy);
+static int sh_getopt_forever (char * dummy);
+#endif
+static int sh_getopt_copyright (char * dummy);
 
 static opttable_t op_table[] = {
@@ -86,21 +79,4 @@
     HAS_ARG_NO, 
     sh_util_set_interactive },
-  { N_("listfile"),  
-    '-', 
-    N_("Run update with listfile"),  
-    HAS_ARG_YES, 
-    sh_util_update_file },
-#endif
-#if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT)
-  { N_("server-port"),  
-    '-', 
-    N_("Set the server port to connect to"),  
-    HAS_ARG_YES, 
-    sh_xfer_server_port },
-  { N_("server-host"),  
-    '-', 
-    N_("Set the server host to connect to"),  
-    HAS_ARG_YES, 
-    sh_xfer_set_logserver },
 #endif
 #ifdef SH_WITH_SERVER
@@ -114,5 +90,5 @@
     N_("Log fully qualified name of client host"),  
     HAS_ARG_NO, 
-    sh_xfer_set_strip },
+    sh_forward_set_strip },
   { N_("chroot"),  
     '-', 
@@ -136,5 +112,5 @@
     HAS_ARG_YES, 
     sh_calls_set_bind_addr },
-#if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT)
+#ifdef SH_WITH_CLIENT
   { N_("set-export-severity"),  
     'e', 
@@ -227,10 +203,10 @@
     N_("Compute a client registry entry for password"),  
     HAS_ARG_YES, 
-    sh_xfer_make_client },
+    sh_forward_make_client },
   { N_("gen-password"),  
     'G', 
     N_("Generate a random password"),  
     HAS_ARG_NO, 
-    sh_xfer_create_password },
+    sh_forward_create_password },
 #endif
 
@@ -241,64 +217,24 @@
     HAS_ARG_NO, 
     sh_getopt_forever},
-  { N_("outfile"),  
-    'o', 
-    N_("Pathname for output file"),  
-    HAS_ARG_YES, 
-    sh_getopt_outpath},
-  { N_("list-file"),  
-    '-', 
-    N_("Modify -d to show content of a single file"),  
-    HAS_ARG_YES, 
-    set_list_file},
-  { N_("list-filter"),  
-    '-', 
-    N_("Modify -d to filter by file list given in text file"),  
-    HAS_ARG_YES, 
-    sh_dbIO_list_filter},
   { N_("full-detail"),  
     'a', 
-    N_("Modify -d to show full details"),  
+    N_("Modify -d to list full details"),  
     HAS_ARG_NO, 
     set_full_detail},
   { N_("delimited"),  
     '-', 
-    N_("Modify -d to show full details, comma delimited"),  
+    N_("Modify -d to list full details, comma delimited"),  
     HAS_ARG_NO, 
     set_list_delimited},
-  { N_("binary"),  
-    '-', 
-    N_("Modify -d to output in binary database format"),  
-    HAS_ARG_NO, 
-    sh_dbIO_list_binary},
   { N_("list-database"),  
     'd', 
     N_("List database content (like ls -l)"),  
     HAS_ARG_YES, 
-    sh_dbIO_list_db},
+    sh_hash_list_db},
   { N_("init2stdout"),  
     '-', 
     N_("Write database to stdout on init"),  
     HAS_ARG_NO, 
-    sh_dbIO_writeout_stdout},
-  { N_("verify-database"),  
-    '-', 
-    N_("Verify the given database"),  
-    HAS_ARG_YES, 
-    sh_dbCheck_verify},
-  { N_("create-database"),  
-    '-', 
-    N_("Create database from file list"),  
-    HAS_ARG_YES, 
-    sh_dbCreate},
-  { N_("init-rootfs"),  
-    '-', 
-    N_("Build database based on another rootfs"),  
-    HAS_ARG_YES, 
-    sh_dbIO_init_rootfs},
-  { N_("wait-on-check"),  
-    'w', 
-    N_("Timed wait for end of filecheck (0 for no timeout)"),  
-    HAS_ARG_YES, 
-    sh_sem_wait},
+    sh_hash_pushdata_stdout},
 #endif
   { N_("trace-logfile"),  
@@ -322,37 +258,4 @@
     HAS_ARG_NO, 
     sh_getopt_usage },
-  { N_("version"),  
-    'v', 
-    N_("Show version and compiled-in options"),  
-    HAS_ARG_NO, 
-    sh_getopt_version },
-#if defined(HAVE_LIBPRELUDE)
-  /* need to skip over these */
-  { N_("prelude"),  
-    '-', 
-    N_("Prelude generic options"),  
-    HAS_ARG_NO, 
-    NULL },
-  { N_("profile"),  
-    '-', 
-    N_("Profile to use for this analyzer"),  
-    HAS_ARG_YES, 
-    NULL },
-  { N_("heartbeat-interval"),  
-    '-', 
-    N_("Number of seconds between two heartbeats"),  
-    HAS_ARG_YES, 
-    NULL },
-  { N_("server-addr"),  
-    '-', 
-    N_("Address where this sensor should report to"),  
-    HAS_ARG_YES, 
-    NULL },
-  { N_("analyzer-name"),  
-    '-', 
-    N_("Name for this analyzer"),  
-    HAS_ARG_YES, 
-    NULL },
-#endif
   /* last entry -- required !! -- */
   { NULL, 
@@ -363,332 +266,58 @@
 };
 
-
-static void sh_getopt_print_log_facilities (void)
+static int sh_getopt_copyright (char * dummy)
 {
-  int num = 0;
-
-  fputs (_("Compiled-in log facilities:\n"), stdout);
-
-#ifndef DEFAULT_CONSOLE
-  if (num > 0) fputc ('\n', stdout);
-  printf ("%s", _(" console (/dev/console)")); ++num;
-#else
-  if (num > 0) fputc ('\n', stdout);
-  if (0 == strcmp (DEFAULT_CONSOLE, _("NULL")))
-    { printf ("%s", _("console (/dev/console)"));  ++num; }
-  else
-    { printf (_("console (%s)"), DEFAULT_CONSOLE);  ++num; }
-#endif
-  if (num > 0) fputc ('\n', stdout);
-  fputs  (_(" syslog"), stdout); ++num;
-  if (num > 0) fputc ('\n', stdout);
-  printf (_(" logfile (%s)"), DEFAULT_ERRFILE); ++num;
-
-#if defined(WITH_EXTERNAL)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" external program"), stdout); ++num;
-#endif
-
-#if defined(WITH_MESSAGE_QUEUE)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" message queue"), stdout); ++num;
-#endif
- 
-#if defined(WITH_DATABASE)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" database"), stdout); ++num;
-#ifdef WITH_ODBC
-  fputs (_(" (odbc)"), stdout);
-#endif
-#ifdef WITH_ORACLE
-  fputs (_(" (Oracle)"), stdout);
-#endif
-#ifdef WITH_POSTGRES
-  fputs (_(" (PostgreSQL)"), stdout);
-#endif
-#ifdef WITH_MYSQL 
-  fputs (_(" (MySQL)"), stdout);
-#endif
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" server"), stdout); ++num;
-#endif
-
-#if defined(SH_WITH_MAIL)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" email"), stdout); ++num;
-#endif
-
-#ifdef HAVE_LIBPRELUDE
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" prelude (0.9.6+)"), stdout); ++num;
-#endif
-
-  if (num == 0)
-    fputs (_(" none"), stdout);
-  fputc ('\n', stdout);
-  return;
-}
-
-static void sh_getopt_print_options (void)
-{
-  int num = 0;
-
-
-#if defined(SH_STANDALONE)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_("Standalone executable"), stdout); ++num;
-#endif
-#if defined(SH_WITH_CLIENT)
-  if (num > 0) fputc ('\n', stdout);
-  printf (_("Client executable (port %d)"), SH_DEFAULT_PORT); ++num;
-#endif
-#if defined(SH_WITH_SERVER)
-  if (num > 0) fputc ('\n', stdout);
-  printf (_("Server executable (port %d, user %s)"), 
-	  SH_DEFAULT_PORT, DEFAULT_IDENT); 
-  ++num;
-#endif
-#if defined(USE_IPVX)
-  fputs (_(", IPv6 supported"), stdout);
-#endif
-
-  fputs (_(", compiled-in options:"), stdout);
-
-#if defined(USE_SYSTEM_MALLOC)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" using system malloc"), stdout); ++num;
-#else
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" using dnmalloc"), stdout); ++num;
-#endif
-
-#if defined(HAVE_EGD_RANDOM)
-  if (num > 0) fputc ('\n', stdout);
-  printf (_(" using entropy gathering daemon (%s)"), EGD_SOCKET_NAME); ++num;
-#endif
-#if defined(HAVE_UNIX_RANDOM)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" using unix entropy gatherer"), stdout); ++num;
-#endif
-#if defined(HAVE_URANDOM)
-  if (num > 0) fputc ('\n', stdout);
-  printf (_(" using entropy device (%s)"), NAME_OF_DEV_RANDOM); ++num;
-#endif
-
-#ifdef WITH_GPG
-  if (num > 0) fputc ('\n', stdout);
-  printf (_(" GnuPG signatures (%s)"), DEFAULT_SIG_PATH); ++num;
-#ifdef HAVE_SIG_CHECKSUM
-  if (num > 0) fputc ('\n', stdout);
-  printf (_("   -- GnuPG checksum:  %s"), SIG_HASH); ++num;
-#endif
-#ifdef USE_FINGERPRINT
-  if (num > 0) fputc ('\n', stdout);
-  printf (_("   -- Key fingerprint: %s"), SH_GPG_FP); ++num;
-#endif
-#endif
-
-#if defined(SH_EVAL_SHELL)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" shell expansion in configuration file supported"), stdout); ++num;
-#endif
-
-#if defined(SL_DEBUG)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" debug build (do not use for production)"), stdout); ++num;
-#endif
-#if defined(SCREW_IT_UP)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" anti-debugger"), stdout); ++num;
-#endif
-#if defined(SH_USE_XML)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" xml log format"), stdout); ++num;
-#endif
-#if defined(HAVE_NTIME)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" using time server"), stdout); ++num;
-#endif
-#if defined(HAVE_REGEX_H)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" posix regex support"), stdout); ++num;
-#endif
-
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-#if defined(HAVE_LIBZ)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" optionally store full text for files"), stdout); ++num;
-#endif
-#if !defined(SH_COMPILE_STATIC) && defined(__linux__) && defined(HAVE_AUPARSE_H) && defined(HAVE_AUPARSE_LIB)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" optionally report auditd record of changed file"), stdout); ++num;
-#endif
-#if defined(USE_XATTR)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" check SELinux attributes"), stdout); ++num;
-#endif
-#if defined(USE_ACL)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" check Posix ACLs"), stdout); ++num;
-#endif
-#if defined(RELOAD_DATABASE)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" fetch database on reload"), stdout); ++num;
-#endif
-#endif
-
-#if defined(SH_WITH_SERVER)
-
-#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && !defined(HAVE_STRUCT_CMSGCRED) && !defined(HAVE_STRUCT_FCRED) && !(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" command socket authentication: use SetSocketPassword"), stdout); 
-  ++num;
-#else
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" command socket authentication: use SetSocketAllowUID"), stdout); 
-  ++num;
-#endif
-
-#if defined(SH_USE_LIBWRAP)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" support tcp wrapper"), stdout); ++num;
-#endif
-#if defined(INET_SYSLOG)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" support listening on 514/udp (syslog)"), stdout); ++num;
-#endif
-#endif
-
-  if (num == 0)
-    fputs (_(" none"), stdout);
-  fputc ('\n', stdout);
-  return;
-}
-
-static void sh_getopt_print_modules (void)
-{
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
-  int num = 0;
-  
-  fputs (_("Compiled-in modules:\n"), stdout);
-#ifdef SH_USE_UTMP
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" login/logout"), stdout); ++num;
-#endif
-#ifdef SH_USE_MOUNTS
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" mount options"), stdout); ++num;
-#endif
-#ifdef SH_USE_USERFILES
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" userfiles"), stdout); ++num;
-#endif
-#ifdef SH_USE_KERN
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" kernel"), stdout); ++num;
-#endif
-#ifdef SH_USE_SUIDCHK
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" suid"), stdout); ++num;
-#endif
-#ifdef SH_USE_PROCESSCHECK
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" processes"), stdout); ++num;
-#endif
-#ifdef SH_USE_PORTCHECK
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" ports"), stdout); ++num;
-#endif
-#ifdef USE_LOGFILE_MONITOR
-  if (num > 0) fputc (',', stdout);
-  fputs (_(" logfile monitor"), stdout); ++num;
-#endif
-#if defined(USE_REGISTRY_CHECK)
-  if (num > 0) fputc ('\n', stdout);
-  fputs (_(" Windows registry"), stdout); ++num;
-#endif
-  if (num == 0)
-    fputs (_(" none"), stdout);
-  fputc ('\n', stdout);
-#endif
-  return;
-}
-
-static int sh_getopt_version (const char * dummy)
-{
-  (void) dummy;
-  fprintf (stdout,
-	   _("This is samhain (%s), "\
-	     "(c) 1999-2024 Rainer Wichmann (http://la-samhna.de).\n"),
-	   VERSION);
-  fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
-  fprintf (stdout, "%s",_("Use at own risk.\n\n"));
-
-  sh_getopt_print_log_facilities ();
-  sh_getopt_print_modules ();
-  sh_getopt_print_options ();
-
-  _exit (EXIT_SUCCESS);
-  /*@notreached@*/
-  return 0; /* make compilers happy */
-}
-static int sh_getopt_copyright (const char * dummy)
-{
-  fprintf (stdout, "%s",
-	   _("Copyright (C) 1999-2019 Rainer Wichmann"\
+  fprintf (stdout, 
+	   _("Copyright (C) 1999-2005 Rainer Wichmann"\
 	     " (http://la-samhna.de).\n\n"));
 
-  fprintf (stdout, "%s",
+  fprintf (stdout, 
 	   _("This program is free software; "\
 	     "you can redistribute it and/or modify\n"));
-  fprintf (stdout, "%s",_("it under the terms of the GNU General "\
+  fprintf (stdout, _("it under the terms of the GNU General "\
 		     "Public License as published by\n"));
-  fprintf (stdout, "%s",_("the Free Software Foundation; either version 2 "\
+  fprintf (stdout, _("the Free Software Foundation; either version 2 "\
 		     "of the License, or\n"));
-  fprintf (stdout, "%s",_("(at your option) any later version.\n\n"));
-
-  fprintf (stdout, "%s",_("This program is distributed in the hope "\
+  fprintf (stdout, _("(at your option) any later version.\n\n"));
+
+  fprintf (stdout, _("This program is distributed in the hope "\
 		     "that it will be useful,\n"));
-  fprintf (stdout, "%s",_("but WITHOUT ANY WARRANTY; "\
+  fprintf (stdout, _("but WITHOUT ANY WARRANTY; "\
 		     "without even the implied warranty of\n"));
-  fprintf (stdout, "%s",_("MERCHANTABILITY or FITNESS FOR A PARTICULAR "\
-		     "PURPOSE. See the\n"));
-  fprintf (stdout, "%s",_("GNU General Public License for more details.\n\n"));
-
-  fprintf (stdout, "%s",_("You should have received a copy of the "\
+  fprintf (stdout, _("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\
+		     " See the\n"));
+  fprintf (stdout, _("GNU General Public License for more details.\n\n"));
+
+  fprintf (stdout, _("You should have received a copy of the "\
 		     "GNU General Public License\n"));
-  fprintf (stdout, "%s",_("along with this program; "\
+  fprintf (stdout, _("along with this program; "\
 		     "if not, write to the Free Software\n"));
-  fprintf (stdout, "%s",_("Foundation, Inc., 59 Temple Place - Suite 330, "\
+  fprintf (stdout, _("Foundation, Inc., 59 Temple Place - Suite 330, "\
 		     "Boston, MA  02111-1307, USA.\n\n"));
 
-  fprintf (stdout, "%s",_("This product makes use of the reference "\
-		     "implementation of the TIGER message\n"));
-  fprintf (stdout, "%s",_("digest algorithm. This code is copyright Eli Biham "\
+  fprintf (stdout, _("This product makes use of the reference implementation "\
+		     "of the TIGER message\n"));
+  fprintf (stdout, _("digest algorithm. This code is copyright Eli Biham "\
 		     "(biham@cs.technion.ac.il)\n"));
-  fprintf (stdout, "%s",_("and Ross Anderson (rja14@cl.cam.ac.uk). It can be used "\
+  fprintf (stdout, _("and Ross Anderson (rja14@cl.cam.ac.uk). It can be used "\
 		     "freely without any\n"));
-  fprintf (stdout, "%s",_("restrictions.\n"));
+  fprintf (stdout, _("restrictions.\n"));
 #if defined(USE_SRP_PROTOCOL) && !defined(SH_STANDALONE)
 #if (!defined(HAVE_LIBGMP) || !defined(HAVE_GMP_H))
-  fprintf (stdout, "%s",_("This product makes use of the 'bignum' library by "\
+  fprintf (stdout, _("This product makes use of the 'bignum' library by "\
 		     "Henrik Johansson\n"));
-  fprintf (stdout, "%s",_("(Henrik.Johansson@Nexus.Comm.SE). If you are "\
-		     "including this library in a\n"));
-  fprintf (stdout, "%s",_("commercial product, be sure to distribute ALL of"\
+  fprintf (stdout, _("(Henrik.Johansson@Nexus.Comm.SE). If you are including "\
+		     "this library in a\n"));
+  fprintf (stdout, _("commercial product, be sure to distribute ALL of"\
 		     " it with the product.\n"));
 #endif
-  fprintf (stdout, "%s",_("This product uses the 'Secure Remote Password' "\
+  fprintf (stdout, _("This product uses the 'Secure Remote Password' "\
 		     "cryptographic\n"));
-  fprintf (stdout, "%s",_("authentication system developed by Tom Wu "\
+  fprintf (stdout, _("authentication system developed by Tom Wu "\
 		     "(tjw@CS.Stanford.EDU).\n"));
 #endif
-  fprintf (stdout, "%s",_("\nPlease refer to the file COPYING in the source "\
+  fprintf (stdout, _("\nPlease refer to the file COPYING in the source "\
 		     "distribution for a"));
-  fprintf (stdout, "%s",_("\nfull list of incorporated code and associated "\
+  fprintf (stdout, _("\nfull list of incorporated code and associated "\
 		     "licenses.\n"));
 
@@ -702,5 +331,5 @@
 
 /*@noreturn@*/
-static int sh_getopt_usage (const char * dummy)
+static int sh_getopt_usage (char * dummy)
 {
   int  i;
@@ -714,10 +343,10 @@
   fprintf (stdout,
 	   _("This is samhain (%s), "\
-	     "(c) 1999-2024 Rainer Wichmann (http://la-samhna.de).\n"),
+	     "(c) 1999-2005 Rainer Wichmann (http://la-samhna.de).\n"),
 	   VERSION);
-  fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
-  fprintf (stdout, "%s",_("Use at own risk.\n"));
-
-  fprintf (stdout, "%s",_("Usage:\n\n"));
+  fprintf (stdout, _("This software comes with ABSOLUTELY NO WARRANTY. "));
+  fprintf (stdout, _("Use at own risk.\n"));
+
+  fprintf (stdout, _("Usage:\n\n"));
 
   for (i = 0; op_table[i].longopt != NULL; ++i) {
@@ -728,5 +357,5 @@
     if (op_table[i].shortopt != '-' && 
 	strchr(opts, op_table[i].shortopt) != NULL)
-      fprintf (stdout, "%s",_("Short option char collision !\n"));
+      fprintf (stdout, _("Short option char collision !\n"));
     opts[i] = op_table[i].shortopt;
 
@@ -734,11 +363,12 @@
     if (op_table[i].hasArg == HAS_ARG_NO) {
       if (sl_strlen(op_table[i].longopt) < 10) 
-	sl_strlcpy(fmt,_("%c%c%c        --%-s,\t\t\t %s\n"), sizeof(fmt));
+	strcpy(fmt,_("%c%c%c        --%-s,\t\t\t %s\n"));/* known to fit  */
       else if (sl_strlen(op_table[i].longopt) < 17)
-	sl_strlcpy(fmt, _("%c%c%c        --%-s,\t\t %s\n"), sizeof(fmt));
+	strcpy(fmt, _("%c%c%c        --%-s,\t\t %s\n")); /* known to fit  */
       else 
-	sl_strlcpy(fmt, _("%c%c%c        --%-s,\t %s\n"), sizeof(fmt));
-      /* flawfinder: ignore */
-      fprintf (stdout, fmt,
+	strcpy(fmt, _("%c%c%c        --%-s,\t %s\n"));   /* known to fit  */
+      /*@-formatconst@*/
+      fprintf (stdout,
+	       fmt,
 	       (op_table[i].shortopt == '-') ? ' ' : '-',
 	       (op_table[i].shortopt == '-') ? ' ' : op_table[i].shortopt,
@@ -746,11 +376,15 @@
 	       _(op_table[i].longopt),
 	       _(op_table[i].usage));
+      /*@+formatconst@*/
     } else {
       if (sl_strlen(op_table[i].longopt) < 12) 
-	sl_strlcpy(fmt, _("%c%c %s  --%-s=<arg>,\t\t %s\n"), sizeof(fmt));  
+	strcpy(fmt,                                      /* known to fit  */
+	       _("%c%c %s  --%-s=<arg>,\t\t %s\n"));  
       else 
-	sl_strlcpy(fmt, _("%c%c %s  --%-s=<arg>,\t %s\n"), sizeof(fmt));   
-      /* flawfinder: ignore */
-      fprintf (stdout, fmt,
+	strcpy(fmt,                                      /* known to fit  */ 
+	       _("%c%c %s  --%-s=<arg>,\t %s\n"));   
+      /*@-formatconst@*/
+      fprintf (stdout,
+	       fmt,
 	       (op_table[i].shortopt == '-') ? ' ' : '-',
 	       (op_table[i].shortopt == '-') ? ' ' : op_table[i].shortopt,
@@ -758,8 +392,9 @@
 	       _(op_table[i].longopt),
 	       _(op_table[i].usage));
+      /*@+formatconst@*/
     }
   }
 
-  fprintf (stdout, "%s",
+  fprintf (stdout, 
 	   _("\nPlease report bugs to support@la-samhna.de.\n"));
 
@@ -778,22 +413,10 @@
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
-static int sh_getopt_forever (const char * dummy)
+static int sh_getopt_forever (char * dummy)
 {
-  (void) dummy;
+  dummy = (void *) dummy;
   SL_ENTER(_("sh_getopt_forever"));
   sh.flag.loop = S_TRUE;
   SL_RETURN(0, _("sh_getopt_forever"));
-}
-
-static int sh_getopt_outpath (const char * str)
-{
-  if (str)
-    {
-      if (sh.outpath)
-	SH_FREE(sh.outpath);
-      sh.outpath = sh_util_strdup(str);
-      return 0;
-    }
-  return -1;
 }
 #endif  
@@ -851,5 +474,5 @@
 			      /* not last option
 			       */
-			      fprintf (stderr, "%s",
+			      fprintf (stderr, 
 				       _("Error: short option with argument is not last in option string\n"));
 			      (void) sh_getopt_usage(_("fail"));
@@ -859,6 +482,5 @@
 			      /* argument required, but no avail 
 			       */
-			      fprintf (stderr, "%s",
-				       _("Error: missing argument\n"));
+			      fprintf (stderr, _("Error: missing argument\n"));
 			      (void) sh_getopt_usage(_("fail"));
 			    } 
@@ -867,8 +489,7 @@
 			      /* call function with argument */
 			      --argc; ++argv;
-			      if (NULL != op_table[i].func &&
-				  0 != (* op_table[i].func )(argv[1]))
+			      if (0 != (* op_table[i].func )(argv[1]))
 				fprintf (stderr, 
-					 _("Error processing option -%c\n"),
+					 _("Error processing option -%c"),
 					 op_table[i].shortopt);
 			      break;
@@ -877,8 +498,7 @@
 		      else 
 			{
-			  if (NULL != op_table[i].func &&
-			      0 != (* op_table[i].func )(NULL))
+			  if (0 != (* op_table[i].func )(NULL))
 			    fprintf (stderr, 
-				     _("Error processing option -%c\n"),
+				     _("Error processing option -%c"),
 				     op_table[i].shortopt);
 			  break;
@@ -898,5 +518,5 @@
 	    {
 	      /* unrecognized short option */
-	      fprintf (stderr, "%s",_("Error: unrecognized short option\n"));
+	      fprintf (stderr, _("Error: unrecognized short option\n"));
 	      (void) sh_getopt_usage(_("fail"));
 	    }
@@ -910,5 +530,5 @@
 	  for (i = 0; op_table[i].longopt != NULL; ++i) 
 	    {
-
+      
 	      if (sl_strncmp(_(op_table[i].longopt), 
 			     &argv[1][2], 
@@ -918,26 +538,9 @@
 		  if ( op_table[i].hasArg == HAS_ARG_YES ) 
 		    {
-		      theequal = strchr(argv[1], '=');
-		      if (theequal == NULL) 
+		      if ( (theequal = strchr(argv[1], '=')) == NULL) 
 			{ 
-			  if (argc < 3) 
-			    { 
-			      /* argument required, but no avail 
-			       */
-			      fprintf (stderr, "%s",
-				       _("Error: missing argument\n"));
-			      (void) sh_getopt_usage(_("fail"));
-			    } 
-			  else 
-			    {
-			      /* call function with argument */
-			      --argc; ++argv;
-			      if (NULL != op_table[i].func &&
-				  0 != (* op_table[i].func )(argv[1]))
-				fprintf (stderr, 
-					 _("Error processing option -%s\n"),
-					 op_table[i].longopt);
-			      break;
-			    }
+			  fprintf (stderr, _("Error: missing argument\n"));
+			  /* argument required, but no avail */
+			  (void) sh_getopt_usage(_("fail"));
 			} 
 		      else 
@@ -947,8 +550,7 @@
 			      ++theequal;
 			      /* call function with argument */
-			      if (NULL != op_table[i].func &&
-				  0 != (* op_table[i].func )(theequal))
+			      if (0 != (* op_table[i].func )(theequal))
 				fprintf (stderr, 
-					 _("Error processing option -%s\n"),
+					 _("Error processing option -%s"),
 					 op_table[i].longopt);
 			      break;
@@ -956,6 +558,5 @@
 			  else 
 			    {
-			      fprintf (stderr, "%s",
-				       _("Error: invalid argument\n"));
+			      fprintf (stderr, _("Error: invalid argument\n"));
 			      /* argument required, but no avail */
 			      (void) sh_getopt_usage(_("fail"));
@@ -965,8 +566,7 @@
 		  else 
 		    {
-		      if (NULL != op_table[i].func && 
-			  0 != (* op_table[i].func )(NULL))
+		      if (0 != (* op_table[i].func )(NULL))
 			fprintf (stderr, 
-				 _("Error processing option -%s\n"),
+				 _("Error processing option -%s"),
 				 op_table[i].longopt);
 		      break;
@@ -986,5 +586,5 @@
 	    {
 	      /* unrecognized long option */
-	      fprintf (stderr, "%s",_("Error: unrecognized long option\n"));
+	      fprintf (stderr, _("Error: unrecognized long option\n"));
 	      (void) sh_getopt_usage(_("fail"));
 	    }
Index: trunk/src/sh_gpg.c
===================================================================
--- trunk/src/sh_gpg.c	(revision 1)
+++ trunk/src/sh_gpg.c	(revision 1)
@@ -0,0 +1,1078 @@
+/* SAMHAIN file system integrity testing                                   */
+/* Copyright (C) 1999, 2000 Rainer Wichmann                                */
+/*                                                                         */
+/*  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.              */
+
+#include "config_xor.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#if defined(WITH_GPG) || defined(WITH_PGP)
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#if defined(SH_WITH_SERVER)
+#include <pwd.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <sys/wait.h>
+
+#include <string.h>
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
+
+#if !defined(O_NONBLOCK)
+#if defined(O_NDELAY)
+#define O_NONBLOCK  O_NDELAY
+#else
+#define O_NONBLOCK  0
+#endif
+#endif
+
+
+#include "samhain.h"
+#include "sh_utils.h"
+#include "sh_error.h"
+#include "sh_tiger.h"
+#if defined(SH_WITH_SERVER)
+#define SH_NEED_PWD_GRP 1
+#include "sh_static.h"
+#endif
+
+static struct {
+  char     conf_id[SH_MINIBUF+1];
+  char     conf_fp[SH_MINIBUF+1];
+  char     data_id[SH_MINIBUF+1];
+  char     data_fp[SH_MINIBUF+1];
+} gp;
+
+typedef struct {
+  pid_t    pid;
+  FILE   * pipe;
+} sh_gpg_popen_t;
+
+#define SH_GPG_OK      0
+#define SH_GPG_BAD     1
+#define SH_GPG_BADSIGN 2
+
+/* replace #if 0 by #if 1 and set an appropriate path in front of '/pdbg.'
+ * for debugging
+ */
+#if 0
+#define PDGBFILE "/pdbg."
+#endif
+
+#if defined(PDGBFILE)
+FILE * pdbg;
+FILE * pdbgc;
+#define PDBG_OPEN    pdbg = fopen(PDGBFILE"main",  "a")  
+#define PDBG_CLOSE   fclose (pdbg)
+#define PDBG(arg)    fprintf(pdbg,  "PDBG: step %d\n", arg); fflush(pdbg)
+#define PDBG_D(arg)  fprintf(pdbg,  "PDBG: %d\n", arg); fflush(pdbg)
+#define PDBG_S(arg)  fprintf(pdbg,  "PDBG: %s\n", arg); fflush(pdbg)
+
+#define PDBGC_OPEN   pdbgc = fopen(PDGBFILE"child", "a")  
+#define PDBGC_CLOSE  fclose (pdbgc)
+#define PDBGC(arg)   fprintf(pdbgc, "PDBG: step %d\n", arg); fflush(pdbgc)
+#define PDBGC_D(arg) fprintf(pdbgc, "PDBG: %d\n", arg); fflush(pdbgc)
+#define PDBGC_S(arg) fprintf(pdbgc, "PDBG: %s\n", arg); fflush(pdbgc)
+#else
+#define PDBG_OPEN    
+#define PDBG_CLOSE   
+#define PDBG(arg)    
+#define PDBG_D(arg)  
+#define PDBG_S(arg)  
+#define PDBGC_OPEN    
+#define PDBGC_CLOSE   
+#define PDBGC(arg)    
+#define PDBGC_D(arg)  
+#define PDBGC_S(arg)  
+#endif
+
+#undef  FIL__
+#define FIL__  _("sh_gpg.c")
+
+#ifdef GPG_HASH
+static int sh_gpg_checksum (SL_TICKET checkfd, int flag)
+{
+  char * test_gpg;
+  char * test_ptr1 = NULL;
+  char * test_ptr2 = NULL;
+  char   wstrip1[128];
+  char   wstrip2[128];
+  int    i, k;
+#include "sh_gpg_chksum.h"
+
+  SL_ENTER(_("sh_gpg_checksum"));
+
+  tiger_fd = checkfd;
+#if defined(WITH_PGP)
+  test_gpg = sh_tiger_hash_gpg (DEFAULT_PGP_PATH, TIGER_FD, 0);
+#else
+  test_gpg = sh_tiger_hash_gpg (DEFAULT_GPG_PATH, TIGER_FD, 0);
+#endif
+  
+  test_ptr1 = strchr(GPG_HASH, ':');
+  if (test_gpg != NULL)
+    test_ptr2 = strchr(test_gpg, ':');
+  
+  if (test_ptr2 != NULL)
+    test_ptr2 += 2;
+  else
+    test_ptr2 = test_gpg;
+  if (test_ptr1 != NULL)
+    test_ptr1 += 2;
+  else
+    test_ptr1 = GPG_HASH;
+
+  /* Tue Jun 24 23:11:54 CEST 2003 (1.7.9) -- strip whitespace
+   */
+  k = 0;
+  for (i = 0; i < 127; ++i)
+    {
+      if (test_ptr1[i] == '\0')
+	break;
+      if (test_ptr1[i] != ' ')
+	{
+	  wstrip1[k] = test_ptr1[i];
+	  ++k;
+	}
+    }
+  wstrip1[k] = '\0';
+
+  for(i = 0; i < KEY_LEN; ++i)
+    {
+      if (gpgchk[i] != wstrip1[i]) 
+	{
+	  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, MSG_E_GPG_CHK, 
+			  gpgchk, wstrip1);
+	  break;
+	}
+    }
+
+  k = 0;
+  for (i = 0; i < 127; ++i)
+    {
+      if (test_ptr2[i] == '\0')
+	break;
+      if (test_ptr2[i] != ' ')
+	{
+	  wstrip2[k] = test_ptr2[i];
+	  ++k;
+	}
+    }
+  wstrip2[k] = '\0';
+
+  if (0 != sl_strncmp(wstrip1, wstrip2, 127))
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<pgp checksum: %s>\n"), test_gpg));
+      TPT(((0), FIL__, __LINE__, _("msg=<Compiled-in : %s>\n"), GPG_HASH));
+      TPT(((0), FIL__, __LINE__, _("msg=<wstrip1     : %s>\n"), wstrip1));
+      TPT(((0), FIL__, __LINE__, _("msg=<wstrip2     : %s>\n"), wstrip2));
+      if (flag == 1)
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_GPG, 
+			GPG_HASH, test_gpg);
+      dlog(1, FIL__, __LINE__, _("The compiled-in checksum of the gpg binary\n(%s)\ndoes not match the actual checksum\n(%s).\nYou need to recompile with the correct checksum."), wstrip1, wstrip2);
+      SH_FREE(test_gpg);
+      SL_RETURN((-1), _("sh_gpg_checksum"));
+    }
+  SH_FREE(test_gpg);
+  SL_RETURN( (0), _("sh_gpg_checksum"));
+}
+#endif
+
+static FILE * sh_gpg_popen (sh_gpg_popen_t  *source, int fd, 
+			    int mode, char * id, char * homedir)
+{
+  int pipedes[2];
+  FILE * outf = NULL;
+  char * envp[2];
+  char   path[256];
+  char   cc1[32];
+  char   cc2[32];
+#if defined(WITH_PGP)
+  char   cc3[32];
+  char   cc0[3] = "-f";
+#endif
+#if defined(WITH_GPG)
+  char   cc0[2] = "-";
+  char   cc3[32];
+  char   cc4[SH_PATHBUF+32];
+  char   cc5[32] = "--no-tty";
+#endif
+
+  char * arg[9];
+
+#if defined(HAVE_GPG_CHECKSUM)
+  SL_TICKET   checkfd;
+  int         myrand;
+  int         i;
+#if defined(__linux__)
+  int         get_the_fd(SL_TICKET);
+  char        pname[128];
+  int         pfd;
+#endif
+#endif
+
+  SL_ENTER(_("sh_gpg_popen"));
+
+#if defined(WITH_GPG)
+  /* -- GnuPG -- */
+  sl_strlcpy (path,  DEFAULT_GPG_PATH,  256);
+  sl_strlcpy (cc1,   _("--status-fd"),  32);
+  sl_strlcpy (cc2,   _("--verify"),     32);
+  sl_strlcpy (cc3,   _("--homedir"),    32);
+  /* sl_strlcpy (cc4,   sh.effective.home, SH_PATHBUF+32); */
+  sl_strlcpy (cc4,   homedir,           SH_PATHBUF+32);
+  sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32); 
+
+  /* fprintf(stderr, "YULE: homedir=%s\n", homedir); */
+
+#if defined(SH_WITH_SERVER)
+  if (0 == sl_ret_euid())   /* privileges not dropped yet */
+    {
+      struct stat lbuf;
+      int         status_stat = 0;
+      struct passwd * tempres = getpwnam(DEFAULT_IDENT);
+      if (!tempres)
+	tempres = sh_getpwnam(DEFAULT_IDENT);
+      if (!tempres)
+	{
+	  dlog(1, FIL__, __LINE__, 
+	       _("User %s does not exist. Please add the user to your system.\n"), 
+	       DEFAULT_IDENT);
+	  status_stat = -1;
+	}
+      if (!tempres->pw_dir || tempres->pw_dir[0] == '\0')
+	{
+	  dlog(1, FIL__, __LINE__, 
+	       _("User %s does not have a home directory.\nPlease add the home directory for this user to your system.\n"), 
+	       DEFAULT_IDENT);
+	  status_stat = -2;
+	}
+      if (status_stat == 0)
+	{
+	  sl_strlcpy (cc4, tempres->pw_dir, SH_PATHBUF+32); 
+	  sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32); 
+	  status_stat =  retry_lstat(FIL__, __LINE__, cc4, &lbuf);
+	  if (status_stat == -1)
+	    {
+	      dlog(1, FIL__, __LINE__, 
+		   _("Gnupg directory %s for user %s\ndoes not exist or is not accessible.\nPlease add the directory and put the keyring (pubring.gpg) there\nto verify the configuration file.\n"),
+		   cc4, DEFAULT_IDENT);
+	      status_stat = -3;
+	    }
+	}
+      if (status_stat == 0 && lbuf.st_uid != tempres->pw_uid)
+	{
+	  dlog(1, FIL__, __LINE__, 
+	       _("Gnupg directory %s\nis not owned by user %s.\n"), 
+	       cc4, DEFAULT_IDENT);
+	  status_stat = -4;
+	}
+      if (status_stat == 0)
+	{
+	  sl_strlcat (cc4,   _("/pubring.gpg"),      SH_PATHBUF+32); 
+	  status_stat =  retry_lstat(FIL__, __LINE__, cc4, &lbuf);
+	  if (status_stat == -1)
+	    {
+	      dlog(1, FIL__, __LINE__, 
+		   _("Gnupg public keyring %s for user %s\ndoes not exist or is not accessible.\nPlease add the directory and put the keyring (pubring.gpg) there\nto verify the configuration file.\n"),
+		   cc4, DEFAULT_IDENT);
+	      status_stat = -5;
+	    }
+	}
+      if (status_stat == 0 && lbuf.st_uid != tempres->pw_uid)
+	{
+	  dlog(1, FIL__, __LINE__, 
+	       _("Gnupg public keyring %s\nis not owned by user %s.\n"), 
+	       cc4, DEFAULT_IDENT);
+	  status_stat = -6;
+	}
+      if (status_stat != 0)
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, status_stat, MSG_EXIT_ABORT1, 
+			  sh.prg_name);
+	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	}
+      sl_strlcpy (cc4, tempres->pw_dir, SH_PATHBUF+32); 
+      sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32); 
+    }
+#endif
+
+  arg[0] = path; 
+  arg[1] = cc1;
+  arg[2] = "1";
+  arg[3] = cc2;
+  arg[4] = cc3;
+  arg[5] = cc4;
+  arg[6] = cc5;
+  arg[7] = cc0;
+  arg[8] = NULL;
+
+  /* catch 'unused parameter' compiler warning
+   */
+  (void) mode;
+  (void) id;
+#elif defined(WITH_PGP)
+  /* -- PGP -- */
+  sl_strlcpy (path,  DEFAULT_PGP_PATH, 256);
+  if (mode == 0)
+    {
+      sl_strlcpy (cc1,   _("+language=en"),  32);
+      sl_strlcpy (cc2,   _("-o"),     32);
+      sl_strlcpy (cc3,   _("/dev/null"),     32);
+      
+      arg[0] = path; 
+      arg[1] = cc1;
+      arg[2] = cc2; 
+      arg[3] = cc3; 
+      arg[4] = cc0;
+      arg[5] = NULL;
+    }
+  else
+    {
+      sl_strlcpy (cc1,   _("+language=en"),  32);
+      sl_strlcpy (cc2,   _("-kvc"),     32);       
+      
+      arg[0] = path; 
+      arg[1] = cc1;
+      arg[2] = cc2;
+      arg[3] = id;
+      arg[4] = NULL;
+      arg[5] = NULL;
+    }
+#endif
+
+  /* use homedir of effective user
+   */
+  if (sh.effective.home != NULL)
+    {
+      envp[0] = malloc (sl_strlen(sh.effective.home) + 6); /* free() ok   */
+      if (envp[0] != NULL)
+	sprintf (envp[0], "HOME=%s",                     /* known to fit  */
+		 sh.effective.home); 
+      envp[1] = NULL;
+    }
+  else
+    {
+      envp[0] = NULL;
+    }
+
+  /* Create the pipe 
+   */
+  if (aud_pipe(FIL__, __LINE__, pipedes) < 0) 
+    {
+      if (envp[0] != NULL) 
+	free(envp[0]);
+      SL_RETURN( (NULL), _("sh_gpg_popen"));
+    }
+  
+  source->pid = aud_fork(FIL__, __LINE__);
+  
+  /* Failure
+   */
+  if (source->pid == (pid_t) - 1) 
+    {
+      close(pipedes[0]);
+      close(pipedes[1]);
+      if (envp[0] != NULL) 
+	free(envp[0]);
+      SL_RETURN( (NULL), _("sh_gpg_popen"));
+    }
+
+  if (source->pid == (pid_t) 0) 
+    {
+
+      /* child - make read side of the pipe stdout 
+       */
+      if (retry_aud_dup2(FIL__, __LINE__,
+			pipedes[STDOUT_FILENO], STDOUT_FILENO) < 0)
+	{
+	  TPT(((0), FIL__, __LINE__, _("msg=<dup2 on pipe failed>\n")));
+	  dlog(1, FIL__, __LINE__, _("Internal error: dup2 failed\n"));
+	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	}
+      
+      /* close the pipe descriptors 
+       */
+      close (pipedes[STDIN_FILENO]);
+      close (pipedes[STDOUT_FILENO]);
+      
+
+#if defined(WITH_PGP)
+      if (mode == 0) 
+	{
+	  if (retry_aud_dup2(FIL__, __LINE__, fd, STDIN_FILENO) < 0)
+	    {
+	      TPT(((0), FIL__, __LINE__, _("msg=<dup2 on fd failed>\n")));
+	      dlog(1, FIL__, __LINE__, _("Internal error: dup2 failed\n"));
+	      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	    }
+	}
+#else
+      if (retry_aud_dup2(FIL__, __LINE__, fd, STDIN_FILENO) < 0)
+	{
+	  TPT(((0), FIL__, __LINE__, _("msg=<dup2 on fd failed>\n")));
+	  dlog(1, FIL__, __LINE__, _("Internal error: dup2 failed\n"));
+	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	}
+#endif
+ 
+      /* don't leak file descriptors
+       */
+      sh_unix_closeall (3, -1); /* in child process */
+
+      freopen(_("/dev/null"), "r+", stderr); 
+
+      /* We should become privileged if SUID,
+       * to be able to read the keyring.
+       * We have checked that gpg is OK,
+       * AND that only a trusted user could overwrite
+       * gpg.
+       */
+      memset (skey, '\0', sizeof(sh_key_t));
+      aud_setuid(FIL__, __LINE__, geteuid());
+      
+      PDBGC_OPEN;
+      PDBGC_D((int)getuid());
+      PDBGC_D((int)geteuid());
+
+      {
+	int i = 0;
+	while (arg[i] != NULL)
+	  {
+	    PDBGC_S(arg[i]);
+	    ++i;
+	  }
+      }
+      PDBGC_CLOSE;
+
+      /* exec the program */
+
+#if defined(__linux__) && defined(HAVE_GPG_CHECKSUM)
+      /* 
+       * --  emulate an fexecve with checksum testing
+       */
+#if defined(WITH_PGP)
+      checkfd = sl_open_read(DEFAULT_PGP_PATH, SL_NOPRIV);
+#else
+      checkfd = sl_open_read(DEFAULT_GPG_PATH, SL_NOPRIV);
+#endif
+
+      if (0 != sh_gpg_checksum(checkfd, 0))
+	aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+
+      pfd = get_the_fd(checkfd);
+      sprintf(pname, _("/proc/self/fd/%d"),             /* known to fit  */
+		   pfd);
+      if (0 == access(pname, R_OK|X_OK))
+	{
+	  fcntl  (pfd, F_SETFD, FD_CLOEXEC);
+	  retry_aud_execve (FIL__, __LINE__,  pname, arg, envp);
+	      
+	  dlog(1, FIL__, __LINE__, _("Unexpected error: execve %s failed\n"),
+	       pname);
+	  /* failed 
+	   */
+	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	}
+	  
+      /* procfs not working, go ahead 
+       */
+      sl_close(checkfd);
+#endif
+
+#if defined(HAVE_GPG_CHECKSUM)
+      /* This is an incredibly ugly kludge to prevent an attacker
+       * from knowing when it is safe to slip in a fake executable
+       * between the integrity check and the execve
+       */
+      myrand = (int) taus_get (&(skey->rng0[0]), &(skey->rng1[0]), 
+			       &(skey->rng2[0]));
+      myrand = (myrand < 0) ? (-myrand) : myrand;
+      myrand = (myrand % 32) + 2;
+
+      for (i = 0; i < myrand; ++i)
+	{
+#if defined(WITH_PGP)
+	  checkfd = sl_open_fastread(DEFAULT_PGP_PATH, SL_NOPRIV);
+#else
+	  checkfd = sl_open_fastread(DEFAULT_GPG_PATH, SL_NOPRIV);
+#endif
+	  if (0 != sh_gpg_checksum(checkfd, 0)) {
+	    aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+	  }
+	  sl_close(checkfd);
+	}
+#endif
+			       
+
+#if defined(WITH_GPG)
+      retry_aud_execve (FIL__, __LINE__, DEFAULT_GPG_PATH, arg, envp);
+      dlog(1, FIL__, __LINE__, _("Unexpected error: execve %s failed\n"),
+	   DEFAULT_GPG_PATH);
+#elif defined(WITH_PGP)
+      retry_aud_execve (FIL__, __LINE__, DEFAULT_PGP_PATH, arg, envp);
+#endif
+      
+      /* failed 
+       */
+      TPT(((0), FIL__, __LINE__, _("msg=<execve failed>\n")));
+      dlog(1, FIL__, __LINE__, _("Unexpected error: execve failed\n"));
+      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+  /* parent
+   */
+
+  if (envp[0] != NULL) 
+    free(envp[0]);
+
+  close (pipedes[STDOUT_FILENO]);
+  retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFD, FD_CLOEXEC);
+  retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFL,  O_NONBLOCK);
+
+  outf = fdopen (pipedes[STDIN_FILENO], "r");
+  
+  if (outf == NULL) 
+    {
+      aud_kill (FIL__, __LINE__, source->pid, SIGKILL);
+      close (pipedes[STDOUT_FILENO]);
+      waitpid (source->pid, NULL, 0);
+      source->pid = 0;
+      SL_RETURN( (NULL), _("sh_gpg_popen"));
+    }
+  
+  SL_RETURN( (outf), _("sh_gpg_popen"));
+}
+
+
+static int sh_gpg_pclose (sh_gpg_popen_t *source)
+{
+  int status = 0;
+  
+  SL_ENTER(_("sh_gpg_pclose"));
+
+  status = fclose(source->pipe);
+  if (status)
+    SL_RETURN( (-1), _("sh_gpg_pclose"));
+  
+  if (waitpid(source->pid, NULL, 0) != source->pid)
+    status = -1;
+  
+  source->pipe = NULL;
+  source->pid = 0;
+  SL_RETURN( (status), _("sh_gpg_pclose"));
+}
+ 
+static
+int sh_gpg_check_file_sign(int fd, char * sign_id, char * sign_fp, 
+			   char * homedir, int whichfile)
+{
+  struct stat buf;
+  char line[256];
+  sh_gpg_popen_t  source;
+  int have_id = BAD, have_fp = BAD, status = 0;
+#ifdef WITH_PGP
+  char *ptr;
+#endif
+
+#ifdef HAVE_GPG_CHECKSUM
+  SL_TICKET checkfd;
+#endif
+
+  SL_ENTER(_("sh_gpg_check_file_sign"));
+
+  /* check whether GnuPG exists and has the correct checksum
+   */
+#if defined(WITH_GPG)
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Check signature>\n")));
+  TPT(((0), FIL__, __LINE__, _("msg=<gpg is %s>\n"), DEFAULT_GPG_PATH));
+
+  if (0 != retry_lstat(FIL__, __LINE__, DEFAULT_GPG_PATH, &buf))
+    {
+      status = errno;
+      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_ERR_LSTAT,
+		      sh_error_message(status), DEFAULT_GPG_PATH);
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+
+  if (0 != tf_trust_check (DEFAULT_GPG_PATH, SL_YESPRIV))
+    SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+
+#ifdef HAVE_GPG_CHECKSUM
+  checkfd = sl_open_read(DEFAULT_GPG_PATH, SL_YESPRIV);
+
+  if (0 != sh_gpg_checksum(checkfd, 1))
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      _("Checksum mismatch"), 
+		      _("gpg_check_file_sign"));
+      sl_close(checkfd);
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+  sl_close(checkfd);
+#endif
+
+#elif defined(WITH_PGP)
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Check signature>\n")));
+  TPT(((0), FIL__, __LINE__, _("msg=<pgp is %s>\n"), DEFAULT_PGP_PATH));
+
+  if (0 != retry_lstat(FIL__, __LINE__, DEFAULT_PGP_PATH, &buf))
+    {
+      status = errno;
+      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_ERR_LSTAT,
+		      sh_error_message(status), DEFAULT_PGP_PATH);
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+  if (0 != tf_trust_check (DEFAULT_PGP_PATH, SL_YESPRIV))
+    SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+
+#ifdef HAVE_GPG_CHECKSUM
+  checkfd = sl_open_read(DEFAULT_PGP_PATH, SL_YESPRIV);
+
+  if (0 != sh_gpg_checksum(checkfd, 1))
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      _("Checksum mismatch"), 
+		      _("gpg_check_file_sign"));
+      sl_close(checkfd);
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+  sl_close(checkfd);
+#endif
+
+#endif
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe to check signature>\n")));
+
+  fflush(NULL);
+ 
+  source.pipe   = sh_gpg_popen  ( &source, fd, 0, NULL, homedir );
+
+  if (NULL == source.pipe)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      _("Could not open pipe"), 
+		      _("gpg_check_file_sign"));
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe success>\n")));
+
+ xagain:
+
+  errno = 0;
+
+  while (NULL != fgets(line, 255, source.pipe))
+    {
+
+      TPT(((0), FIL__, __LINE__, _("msg=<gpg out: %s>\n"), line));
+      if (line[strlen(line)-1] == '\n')
+	line[strlen(line)-1] = ' ';
+      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      line, 
+		      _("gpg_check_file_sign"));
+
+      if (sl_strlen(line) < 18) 
+	continue;
+#if defined(WITH_GPG)
+      /* Sun May 27 18:40:05 CEST 2001
+       */
+      if (0 == sl_strncmp(_("BADSIG"), &line[9], 6) ||
+	  0 == sl_strncmp(_("ERRSIG"), &line[9], 6) ||
+	  0 == sl_strncmp(_("NO_PUBKEY"), &line[9], 6) ||
+	  0 == sl_strncmp(_("NODATA"), &line[9], 6) ||
+	  0 == sl_strncmp(_("SIGEXPIRED"), &line[9], 6))
+	{
+	  if      (0 == sl_strncmp(_("BADSIG"), &line[9], 6)) {
+	    dlog(1, FIL__, __LINE__, 
+		 _("%s file is signed, but the signature is invalid."),
+		 ((whichfile == 1) ? _("Configuration") : _("Database")));
+	  } 
+	  else if (0 == sl_strncmp(_("NO_PUBKEY"), &line[9], 6)) {
+	    dlog(1, FIL__, __LINE__, 
+		 _("%s file is signed, but the public key to verify the signature is not in my keyring %s/.gnupg/pubring.asc."), 
+		 ((whichfile == 1) ? _("Configuration") : _("Database")),
+		 homedir);
+	  }
+	  else if (0 == sl_strncmp(_("ERRSIG"), &line[9], 6)) {
+	    dlog(1, FIL__, __LINE__, 
+		 _("%s file is signed, but the public key to verify the signature is not in my keyring %s/.gnupg/pubring.asc."), 
+		 ((whichfile == 1) ? _("Configuration") : _("Database")),
+		 homedir);
+	  }
+	  else if (0 == sl_strncmp(_("SIGEXPIRED"), &line[9], 6)) {
+	    dlog(1, FIL__, __LINE__, 
+		 _("%s file is signed, but the public key to verify the signature has expired."), 
+		 ((whichfile == 1) ? _("Configuration") : _("Database")));
+	  }
+	  else if (0 == sl_strncmp(_("NODATA"), &line[9], 6)) {
+	    dlog(1, FIL__, __LINE__, 
+		 _("%s file is not signed."), 
+		 ((whichfile == 1) ? _("Configuration") : _("Database")));
+	  }
+
+	  have_fp = BAD; have_id = BAD;
+	  break;
+	}
+      if (0 == sl_strncmp(_("GOODSIG"), &line[9], 7))
+	{
+	  sl_strlcpy (sign_id, &line[25], SH_MINIBUF+1);
+	  sign_id[sl_strlen(sign_id)-1] = '\0';  /* remove trailing '"' */
+	  have_id = GOOD;
+	} 
+      if (0 == sl_strncmp(_("VALIDSIG"), &line[9], 8))
+	{
+	  strncpy (sign_fp, &line[18], 40);
+	  sign_fp[40] = '\0';
+	  have_fp = GOOD;
+	}
+#elif defined(WITH_PGP)
+      if (0 == sl_strncmp(_("Bad signature"), line, 13) ||
+	  0 == sl_strncmp(_("Error"), line, 5) ||
+	  0 == sl_strncmp(_("Malformed"), line, 9) ||
+	  0 == sl_strncmp(_("WARNING"), line, 7) ||
+	  0 == sl_strncmp(_("ERROR"), line, 5) 
+	  )
+	{
+	  have_fp = BAD; have_id = BAD;
+	  break;
+	}
+      if (0 == sl_strncmp(_("Good signature"), line, 14))
+	{
+	  ptr = strchr ( line, '"');
+	  ++ptr;
+	  sl_strlcpy (sign_id, ptr, SH_MINIBUF+1);
+	  sign_id[sl_strlen(sign_id)-1] = '\0'; /* remove trailing dot */
+	  sign_id[sl_strlen(sign_id)-2] = '\0'; /* remove trailing '"' */
+	  have_id = GOOD;
+	}
+#endif
+    }
+
+  if (ferror(source.pipe) && errno == EAGAIN) 
+    {
+      clearerr(source.pipe);
+      goto xagain;
+    }
+ 
+  sh_gpg_pclose (&source);
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Close pipe>\n")));
+
+#ifdef WITH_PGP
+  /* get the fingerprint */
+
+  source.pipe   = sh_gpg_popen  ( &source, fd, 1,  sign_id, homedir);
+  if (NULL == source.pipe)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      _("Could not open pipe for fp"), 
+		      _("gpg_check_file_sign"));
+      SL_RETURN( SH_GPG_BAD, _("sh_gpg_check_file_sign"));
+    }
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe success>\n")));
+
+ yagain:
+
+  errno = 0;
+
+  while (NULL != fgets(line, 255, source.pipe))
+    {
+      if (line[strlen(line)-1] == '\n')
+	line[strlen(line)-1] = ' ';
+      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      line, 
+		      _("gpg_check_file_sign"));
+
+      if (sl_strlen(line) < 18) 
+	continue;
+      ptr = strtok (line, " ");
+      while (ptr)
+	{
+	  ptr = strtok (NULL, " ");
+	  if (ptr && 0 == sl_strncmp (ptr, _("fingerprint"), 11))
+	    {
+	      ptr = strtok (NULL, " "); /* to '=' */
+	      sign_fp[0] = '\0';
+	      while (ptr)
+		{
+		  ptr = strtok (NULL, " "); /* part of fingerprint */
+		  sl_strlcat (sign_fp, ptr, SH_MINIBUF+1);
+		}
+	      /* sign_fp[sl_strlen(sign_fp)-1] = '\0'; remove trailing '\n' */
+	      if (sl_strlen(sign_fp) > 0) 
+		have_fp = GOOD;
+	      break;
+	    } 
+	} 
+    }
+
+  if (ferror(source.pipe) && errno == EAGAIN) 
+    {
+      clearerr(source.pipe);
+      goto yagain;
+    }
+ 
+  sh_gpg_pclose (&source);
+#endif
+
+  if (have_id == GOOD)
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<Got signator ID>\n")));
+      ;
+    }
+  if (have_fp == GOOD)
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<Got fingerprint>\n")));
+      ;
+    }
+
+  if (have_id == GOOD && have_fp == GOOD)
+    SL_RETURN( SH_GPG_OK, _("sh_gpg_check_file_sign"));
+  else
+    {
+      if (have_id == BAD)
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+			_("No good signature"), 
+			_("gpg_check_file_sign"));
+      else
+	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+			_("No fingerprint for key"), 
+			_("gpg_check_file_sign"));
+      SL_RETURN( SH_GPG_BADSIGN, _("sh_gpg_check_file_sign"));
+    }
+}
+
+int get_the_fd(SL_TICKET file_1);
+
+int sh_gpg_check_sign (long file_1, long file_2, int what)
+{
+  int status = SH_GPG_BAD;
+  int fd1 = 0;
+  int fd2 = 0;
+  static int smsg = S_FALSE;
+  char  * tmp;
+  char  * tmp2;
+
+  char  * homedir = sh.effective.home;
+#if defined(SH_WITH_SERVER)
+  struct passwd * tempres;
+#endif
+#ifdef USE_FINGERPRINT
+#include "sh_gpg_fp.h"
+#endif
+
+  SL_ENTER(_("sh_gpg_check_sign"));
+
+
+  if (what == 0 || what == 1)
+    fd1 = get_the_fd(file_1);
+  if (what == 0 || what == 2)
+    fd2 = get_the_fd(file_2);
+
+
+  if (fd1 < 0 || fd2 < 0)
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD1 = %d>\n"), fd1));
+      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD2 = %d>\n"), fd2));
+      dlog(1, FIL__, __LINE__, 
+	   _("This looks like an unexpected internal error.\n"));
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1, sh.prg_name);
+      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+      SL_RETURN( (-1), _("sh_gpg_check_sign"));
+    }
+  
+  if (what == 0 || what == 1)
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD1 = %d>\n"), fd1));
+#if defined(SH_WITH_SERVER)
+      tempres = getpwnam(DEFAULT_IDENT);
+      if (!tempres)
+	tempres = sh_getpwnam(DEFAULT_IDENT);
+      if ((tempres != NULL) && (0 == sl_ret_euid()))
+	{
+	  /* privileges not dropped yet*/
+	  homedir = tempres->pw_dir;
+	}
+#endif
+      status = sh_gpg_check_file_sign(fd1, gp.conf_id, gp.conf_fp, homedir, 1);
+      TPT(((0), FIL__, __LINE__, _("msg=<CONF SIGUSR: |%s|>\n"), gp.conf_id));
+      TPT(((0), FIL__, __LINE__, _("msg=<CONF SIGFP:  |%s|>\n"), gp.conf_fp));
+    }
+
+  if ((what == 0 && SH_GPG_OK == status) || what == 2)
+    {
+      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD2 = %d>\n"), fd2));
+#if defined(SH_WITH_SERVER)
+      tempres = getpwnam(DEFAULT_IDENT);
+      if (!tempres)
+	tempres = sh_getpwnam(DEFAULT_IDENT);
+      if ((tempres != NULL) && (0 == sl_ret_euid()))
+	{
+	  /* privileges not dropped yet*/
+	  homedir = tempres->pw_dir;
+	}
+#endif
+      status = sh_gpg_check_file_sign(fd2, gp.data_id, gp.data_fp, homedir, 2);
+      TPT(((0), FIL__, __LINE__, _("msg=<DATA SIGUSR: |%s|>\n"), gp.data_id));
+      TPT(((0), FIL__, __LINE__, _("msg=<DATA SIGFP:  |%s|>\n"), gp.data_fp));
+    }
+  
+  if (SH_GPG_OK == status && what == 1)
+    {
+#ifdef USE_FINGERPRINT
+      if ((sl_strcmp(SH_GPG_FP, gp.conf_fp) == 0))
+	{
+	  int i;
+
+	  for(i = 0; i < (int) sl_strlen(gp.conf_fp); ++i)
+	    {
+	      if (gpgfp[i] != gp.conf_fp[i]) 
+		{
+		  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
+				  MSG_E_GPG_FP, 
+				  gpgfp, gp.conf_fp);
+		  break;
+		}
+	    }
+
+	  if (smsg == S_FALSE)
+	    {
+	      tmp  = sh_util_safe_name(gp.conf_id);
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH,
+			       sh.prg_name, sh.real.uid,
+			       (sh.flag.hidefile == S_TRUE) ? 
+			       _("(hidden)") : file_path('C', 'R'), 
+			       tmp, 
+			       gp.conf_fp);
+	      SH_FREE(tmp);
+	    }
+	  smsg = S_TRUE;
+	  SL_RETURN(0, _("sh_gpg_check_sign"));
+	}
+      else
+	{
+	  /* fp mismatch
+	   */
+	  dlog(1, FIL__, __LINE__, 
+	       _("The fingerprint of the signing key: %s\ndoes not match the compiled-in fingerprint: %s.\nTherefore the signature could not be verified.\n"), 
+	       gp.conf_fp, SH_GPG_FP);
+	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
+		      _("Fingerprint mismatch"), 
+		      _("gpg_check_sign"));
+	  status = SH_GPG_BADSIGN;
+	}
+#else
+      if (smsg == S_FALSE)
+	{
+	  tmp = sh_util_safe_name(gp.conf_id);
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH,
+			   sh.prg_name, sh.real.uid,
+			   (sh.flag.hidefile == S_TRUE) ? 
+			   _("(hidden)") : file_path('C', 'R'), 
+			   tmp, 
+			   gp.conf_fp);
+	  SH_FREE(tmp);
+	}
+      smsg = S_TRUE;
+      SL_RETURN(0, _("sh_gpg_check_sign"));
+#endif
+    }
+  
+  else if (SH_GPG_OK == status && (what == 2 || what == 0))
+    {
+      if ((sl_strcmp(gp.data_id, gp.conf_id) == 0) &&
+	  (sl_strcmp(gp.data_fp, gp.conf_fp) == 0))
+	{
+	  SL_RETURN(0, _("sh_gpg_check_sign"));
+	}
+      else
+	{
+	  /* ID or fp not equal 
+	   */
+	  dlog(1, FIL__, __LINE__, 
+	       _("The fingerprint or ID of the signing key is not the same for the\nconfiguration file and the file signature database.\nTherefore the signature could not be verified.\n"));
+	  tmp  = sh_util_safe_name (gp.conf_id);
+	  tmp2 = sh_util_safe_name (gp.data_id);
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH2,
+			   sh.prg_name, sh.real.uid,
+			   (sh.flag.hidefile == S_TRUE) ? _("(hidden)") : file_path('C', 'R'),
+			   tmp,  gp.conf_fp,
+			   (sh.flag.hidefile == S_TRUE) ? _("(hidden)") : file_path('D', 'R'),
+			   tmp2, gp.data_fp);
+	  SH_FREE(tmp);
+	  SH_FREE(tmp2);
+	}
+    }
+
+  if (status != SH_GPG_OK) 
+    {
+      uid_t   e_uid  = sl_ret_euid();
+      char  * e_home = sh.effective.home;
+
+#if defined(SH_WITH_SERVER)
+      struct passwd * e_tempres = getpwnam(DEFAULT_IDENT);
+      if (!e_tempres)
+	e_tempres = sh_getpwnam(DEFAULT_IDENT);
+      if ((e_tempres != NULL) && (0 == sl_ret_euid()))   
+	{
+	  /* privileges not dropped yet */
+	  e_uid  = e_tempres->pw_uid;
+	  e_home = e_tempres->pw_dir;
+	}
+#endif
+      dlog(1, FIL__, __LINE__, 
+	   _("The signature of the configuration file or the file signature database\ncould not be verified. Possible reasons are:\n - gpg binary (%s) not found\n - invalid signature\n - the signature key is not in the private keyring of UID %d,\n - there is no keyring in %s/.gnupg, or\n - the file is not signed - did you move /filename.asc to /filename ?\nTo create a signed file, use (remove old signatures before):\n   gpg -a --clearsign --not-dash-escaped FILE\n   mv FILE.asc FILE\n"),
+#if defined(WITH_GPG) 
+	   DEFAULT_GPG_PATH,
+#else
+	   DEFAULT_PGP_PATH,
+#endif
+	   (int) e_uid, e_home);
+    }
+
+  TPT(((0), FIL__, __LINE__, _("msg=<Status = %d>\n"), status));
+
+  sh_error_handle((-1), FIL__, __LINE__, status, MSG_EXIT_ABORT1, sh.prg_name);
+  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+
+  return (-1); /* make compiler happy */
+}  
+
+/* #ifdef WITH_GPG */
+#endif
+
+
+
+
+
+
+
+
Index: trunk/src/sh_guid.c
===================================================================
--- trunk/src/sh_guid.c	(revision 591)
+++ 	(revision )
@@ -1,376 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2015 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-#include "samhain.h"
-#include "sh_utils.h"
-
-#include <stdio.h>
-#include <string.h>
-
-/*
- * gen_uuid.c --- generate a DCE-compatible uuid
- *
- * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o.
- *
- * %Begin-Header%
- * 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, and the entire permission notice in its entirety,
- *    including the disclaimer of warranties.
- * 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. The name of the author may not be used to endorse or promote
- *    products derived from this software without specific prior
- *    written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
- * WHICH ARE HEREBY 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 NOT ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- * %End-Header%
- */
-
-#define UUID_SIZE 36
-
-struct uuid {
-        UINT32        time_low;
-        UINT16        time_mid;
-        UINT16        time_hi_and_version;
-        UINT16        clock_seq;
-        UBYTE node[6];
-};
-
-typedef unsigned char uuid_t[16];
-
-
-static void uuid_pack(const struct uuid *uu, uuid_t ptr)
-{
-  UINT32          tmp;
-  unsigned char   *out = ptr;
-  
-  tmp = uu->time_low;
-  out[3] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[2] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[1] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[0] = (unsigned char) tmp;
-  
-  tmp = uu->time_mid;
-  out[5] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[4] = (unsigned char) tmp;
-  
-  tmp = uu->time_hi_and_version;
-  out[7] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[6] = (unsigned char) tmp;
-  
-  tmp = uu->clock_seq;
-  out[9] = (unsigned char) tmp;
-  tmp >>= 8;
-  out[8] = (unsigned char) tmp;
-  
-  memcpy(out+10, uu->node, 6);
-  return;
-}
-
-static void uuid_unpack(const uuid_t in, struct uuid *uu)
-{
-  const uint8_t	*ptr = in;
-  uint32_t		tmp;
-  
-  tmp = *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  uu->time_low = tmp;
-  
-  tmp = *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  uu->time_mid = tmp;
-  
-  tmp = *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  uu->time_hi_and_version = tmp;
-  
-  tmp = *ptr++;
-  tmp = (tmp << 8) | *ptr++;
-  uu->clock_seq = tmp;
-  
-  memcpy(uu->node, ptr, 6);
-  return;
-}
-
-static void get_random_bytes(unsigned char * buf, size_t len)
-{
-  unsigned int j;
-
-  union {
-    UINT32 i;
-    char c[sizeof(UINT32)];
-  } u;
-
-  do {
-    u.i = taus_get();
-
-    for (j= 0; j < sizeof(UINT32); j++)
-      {
-	if (len) {
-	  --len;
-	  *buf = u.c[j];
-	  ++buf;
-	}
-      }
-  } while (len);
-
-  return;
-}
-
-static void uuid_generate_random(uuid_t out)
-{
-  uuid_t  buf;
-  struct uuid uu;
-
-  get_random_bytes(buf, sizeof(buf));
-  uuid_unpack(buf, &uu);
-
-  /* Version and variant 
-   */
-  uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000;
-  uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF)
-    | 0x4000;
-  uuid_pack(&uu, out);
-  return;
-}
-
-static const char *fmt_lower =	N_("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x");
-
-static void uuid_unparse(const uuid_t uu, char *out, size_t len)
-{
-  struct uuid uuid;
-  char fmt[80];
-  
-
-  sl_strlcpy(fmt, _(fmt_lower), sizeof(fmt));
-
-  uuid_unpack(uu, &uuid);
-
-  sl_snprintf (out, len, fmt,
-	       uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
-	       uuid.clock_seq >> 8, uuid.clock_seq & 0xFF,
-	       uuid.node[0], uuid.node[1], uuid.node[2],
-	       uuid.node[3], uuid.node[4], uuid.node[5]);
-
-  return;
-}
-
-#if defined(__linux__)
-static char * uuid_generate_random_linux(char * out, size_t len)
-{
-  FILE * fd = fopen(_("/proc/sys/kernel/random/uuid"), "r");
-
-  if (fd)
-    {
-      if (NULL != fgets(out, len, fd))
-	{
-	  size_t ll = strlen(out);
-	  if (ll > 0 && out[ll-1] == '\n') {
-	    --ll;
-	    out[ll] = '\0';
-	  }
-	}
-      fclose(fd);
-    }
-  return out;
-}
-#endif
-
-static char * uuid_generate_random_gen(char * out, size_t len)
-{
-  uuid_t u;
-
-  uuid_generate_random(u);
-  uuid_unparse(u, out, len);
-
-  return out;
-}
-
-char * sh_uuid_generate_random(char * out, size_t len)
-{
-  *out = '\0';
-
-#if defined(__linux__)
-  uuid_generate_random_linux(out, len);
-  if (UUID_SIZE == strlen(out))
-    return out;
-#endif
-
-  uuid_generate_random_gen(out, len);
-  return out;
-}
-
-#include <ctype.h>
-int sh_uuid_check(const char * in)
-{
-  int 		i;
-  const char	*cp;
-
-  if (strlen(in) != UUID_SIZE)
-    return -1;
-  for (i=0, cp = in; i <= UUID_SIZE; i++,cp++) {
-    if ((i == 8) || (i == 13) || (i == 18) ||
-	(i == 23)) {
-      if (*cp == '-')
-	continue;
-      else
-	return -1;
-    }
-    if (i== UUID_SIZE)
-      if (*cp == 0)
-	continue;
-    if (!isxdigit(*cp))
-      return -1;
-  }
-  return 0;
-}
-
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-#include <stdlib.h>
-
-static int uuid_type(const uuid_t uu)
-{
-  struct uuid		uuid;
-  
-  uuid_unpack(uu, &uuid);
-  return ((uuid.time_hi_and_version >> 12) & 0xF);
-}
-
-#define UUID_VARIANT_NCS	0
-#define UUID_VARIANT_DCE	1
-#define UUID_VARIANT_MICROSOFT	2
-#define UUID_VARIANT_OTHER	3
-
-#define UUID_TYPE_DCE_TIME   1
-#define UUID_TYPE_DCE_RANDOM 4
-
-static int uuid_variant(const uuid_t uu)
-{
-  struct uuid		uuid;
-  int			var;
-  
-  uuid_unpack(uu, &uuid);
-  var = uuid.clock_seq;
-  
-  if ((var & 0x8000) == 0)
-    return UUID_VARIANT_NCS;
-  if ((var & 0x4000) == 0)
-    return UUID_VARIANT_DCE;
-  if ((var & 0x2000) == 0)
-    return UUID_VARIANT_MICROSOFT;
-  return UUID_VARIANT_OTHER;
-}
-
-static int uuid_parse(const char *in, uuid_t uu)
-{
-  struct uuid	uuid;
-  int 		i;
-  const char	*cp;
-  char		buf[3];
-  
-  if (sh_uuid_check(in) < 0)
-    return -1;
-    
-  uuid.time_low = strtoul(in, NULL, 16);
-  uuid.time_mid = strtoul(in+9, NULL, 16);
-  uuid.time_hi_and_version = strtoul(in+14, NULL, 16);
-  uuid.clock_seq = strtoul(in+19, NULL, 16);
-  cp = in+24;
-  buf[2] = 0;
-  for (i=0; i < 6; i++) {
-    buf[0] = *cp++;
-    buf[1] = *cp++;
-    uuid.node[i] = strtoul(buf, NULL, 16);
-  }
-  
-  uuid_pack(&uuid, uu);
-  return 0;
-}
-
-void Test_uuid (CuTest *tc) {
-
-  char * p; int res;
-  char out[80];
-  size_t len = sizeof(out);
-  uuid_t uu;
-  int type, variant;
-
-  p = uuid_generate_random_gen(out, len);
-  CuAssertPtrNotNull(tc, p);
-  res = strlen(p);
-  CuAssertIntEquals(tc,UUID_SIZE,res);
-  res = uuid_parse(p, uu);
-  CuAssertIntEquals(tc,0,res);
-  type = uuid_type(uu); 
-  CuAssertIntEquals(tc,UUID_TYPE_DCE_RANDOM,type);
-  variant = uuid_variant(uu);
-  CuAssertIntEquals(tc,UUID_VARIANT_DCE,variant);
-
-#if defined(__linux__)
-  p = uuid_generate_random_linux(out, len);
-  CuAssertPtrNotNull(tc, p);
-  res = strlen(p);
-  CuAssertIntEquals(tc,UUID_SIZE,res);
-  res = uuid_parse(p, uu);
-  CuAssertIntEquals(tc,0,res);
-  type = uuid_type(uu); 
-  CuAssertIntEquals(tc,UUID_TYPE_DCE_RANDOM,type);
-  variant = uuid_variant(uu);
-  CuAssertIntEquals(tc,UUID_VARIANT_DCE,variant);
-#endif
-
-  p = sh_uuid_generate_random(out, len);
-  CuAssertPtrNotNull(tc, p);
-  res = strlen(p);
-  CuAssertIntEquals(tc,UUID_SIZE,res);
-  res = uuid_parse(p, uu);
-  CuAssertIntEquals(tc,0,res);
-  type = uuid_type(uu); 
-  CuAssertIntEquals(tc,UUID_TYPE_DCE_RANDOM,type);
-  variant = uuid_variant(uu);
-  CuAssertIntEquals(tc,UUID_VARIANT_DCE,variant);
-
-}
-#endif
Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 591)
+++ trunk/src/sh_hash.c	(revision 1)
@@ -20,14 +20,18 @@
 #include "config_xor.h"
 
+/* define this if you want version 1.3 style database file */
+/* #define OLD_BUG */
+
+/* make sure state changes of a file are always reported, even
+ *  with reportonlyonce=true
+ */
+/* #define REPLACE_OLD *//* moved to samhain.h */
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
-#ifdef HAVE_SYS_SYSMACROS_H
-#include <sys/sysmacros.h>
-#endif
 #include <sys/stat.h>
 #include <unistd.h>
-#include <ctype.h>
 
 #ifdef MAJOR_IN_MKDEV
@@ -43,71 +47,252 @@
 #endif
 
-
 #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
 
-#include "samhain.h"
+#include "sh_hash.h"
 #include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_dbIO_int.h"
-#include "sh_dbIO.h"
-#include "sh_hash.h"
 #include "sh_error.h"
 #include "sh_tiger.h"
-#include "sh_sig.h"
+#include "sh_gpg.h"
 #include "sh_unix.h"
 #include "sh_files.h"
 #include "sh_ignore.h"
-#include "sh_pthread.h"
 
 #if defined(SH_WITH_CLIENT)
-#include "sh_xfer.h"
-#endif
-
-
-#define SH_KEY_NULL _("000000000000000000000000000000000000000000000000")
-
+#include "sh_forward.h"
+#endif
 
 #undef  FIL__
 #define FIL__  _("sh_hash.c")
 
-SH_MUTEX_INIT(mutex_hash,PTHREAD_MUTEX_INITIALIZER);
-
 static char * all_items (file_type * theFile, char * fileHash, int is_new);
 
-static const char  *policy[] = {
-  N_("[]"),
-  N_("[ReadOnly]"),
-  N_("[LogFiles]"),
-  N_("[GrowingLogs]"),
-  N_("[IgnoreNone]"),
-  N_("[IgnoreAll]"),
-  N_("[Attributes]"),
-  N_("[User0]"),
-  N_("[User1]"),
-  N_("[User2]"),
-  N_("[User3]"),
-  N_("[User4]"),
-  N_("[Prelink]"),
-  NULL
-};
-
-static int report_checkflags = S_FALSE;
-int set_report_checkflags(const char * c)
-{
-  return sh_util_flagval(c, &report_checkflags);
-}
-int get_report_checkflags()
-{
-  return report_checkflags;
-}
-
-
-
-const char * sh_hash_getpolicy(int class)
-{
-  if (class > 0 && class < SH_ERR_T_DIR)
-    return _(policy[class]);
-  return _("[indef]");
-}
+#define QUOTE_CHAR '='
+
+static char * unquote_string (char * str)
+{
+  int    i = 0, j, k = 0, len;
+  char * tmp;
+
+  SL_ENTER(_("unquote_string"));
+
+  if (str == NULL)
+    {
+      SL_RETURN(NULL, _("unquote_string"));
+    }
+
+  len = sl_strlen(str);
+
+  tmp = SH_ALLOC(len + 1);
+  for (j = 0; j <= len; ++j)
+    {
+      if (str[j] == QUOTE_CHAR && j < (len-2))
+	{
+	  if (sh_util_hexchar(str[j+1]) >= 0 && sh_util_hexchar(str[j+2]) >= 0)
+	    {
+	      i = 16 * sh_util_hexchar(str[j+1]) + sh_util_hexchar(str[j+2]);
+	      tmp[k] = i; j += 2;
+	    }
+	  else
+	    {
+	      tmp[k] = str[j];
+	    }
+	}
+      else
+	tmp[k] = str[j];
+      ++k;
+    }
+  SL_RETURN(tmp, _("unquote_string"));
+}
+
+static char i2h[2];
+
+char * int2hex (unsigned char i)
+{
+  int j, k;
+
+  j = i / 16;
+  k = i - (j*16);
+  if (j < 10) 
+    i2h[0] = '0'+j;
+  else
+    i2h[0] = 'A'+(j-10);
+  
+  if (k < 10) 
+    i2h[1] = '0'+k;
+  else
+    i2h[1] = 'A'+(k-10);
+
+  return i2h;
+}
+
+static char * quote_string (char * str)
+{
+  int    i = 0, j, k = 0, len;
+  char * tmp;
+  char * tmp2;
+
+  SL_ENTER(_("quote_string"));
+
+  if (str == NULL)
+    {
+      SL_RETURN(NULL, _("quote_string"));
+    }
+
+  len = sl_strlen(str);
+
+  for (j = 0; j < len; ++j)
+    if (str[j] == '\n' || str[j] == QUOTE_CHAR) ++i;
+
+  tmp = SH_ALLOC(len + 1 + 3*i);
+  for (j = 0; j <= len; ++j)
+    {
+      if (str[j] == '\n')
+	{
+	  tmp2 = int2hex((unsigned char) '\n'); /* was 'n', fixed in 1.5.4 */
+	  tmp[k] = QUOTE_CHAR; ++k;
+	  tmp[k] = tmp2[0];    ++k;
+	  tmp[k] = tmp2[1];
+	}
+      else if (str[j] == QUOTE_CHAR)
+	{
+	  tmp2 = int2hex((unsigned char) QUOTE_CHAR);
+	  tmp[k] = QUOTE_CHAR; ++k;
+	  tmp[k] = tmp2[0];    ++k;
+	  tmp[k] = tmp2[1];
+	}
+      else
+	{
+	  tmp[k] = str[j];
+	}
+      ++k;
+    }
+  SL_RETURN(tmp, _("quote_string"));
+}
+
+static UINT32 * swap_32 (UINT32 * iptr)
+{
+#ifdef WORDS_BIGENDIAN
+  unsigned char swap;
+  unsigned char * ii = (unsigned char *) iptr;
+  swap = ii[0]; ii[0] = ii[3]; ii[3] = swap;
+  swap = ii[1]; ii[1] = ii[2]; ii[2] = swap;
+  return iptr;
+#else
+  return iptr;
+#endif
+}
+
+static UINT64 *  swap_64 (UINT64 * iptr)
+{
+#ifdef WORDS_BIGENDIAN
+#ifdef UINT64_IS_32
+  swap_32 ((UINT32*) iptr);
+#else
+  unsigned char swap;
+  unsigned char * ii = (unsigned char *) iptr;
+  swap = ii[0]; ii[0] = ii[7]; ii[7] = swap;
+  swap = ii[1]; ii[1] = ii[6]; ii[6] = swap;
+  swap = ii[2]; ii[2] = ii[5]; ii[5] = swap;
+  swap = ii[3]; ii[3] = ii[4]; ii[4] = swap;
+#endif
+  return iptr;
+#else
+  return iptr;
+#endif
+}
+
+static unsigned short *  swap_short (unsigned short * iptr)
+{
+#ifdef WORDS_BIGENDIAN
+  if (sizeof(short) == 4)
+    swap_32 ((UINT32*) iptr);
+  else
+    {
+      /* alignment problem */
+      unsigned char swap;
+      static unsigned short ooop;
+      unsigned char * ii;
+      ooop = *iptr;
+      ii = (unsigned char *) &ooop;
+      /* printf("SWAP0: %hd  %d\n", *iptr, sizeof(unsigned short)); */
+      swap = ii[0]; ii[0] = ii[1]; ii[1] = swap;
+      /* printf("SWAP1: %hd\n", (unsigned short) ooop); */
+#ifndef OLD_BUG
+      return &ooop;
+#endif
+    }
+  return iptr;
+#else
+  return iptr;
+#endif
+}
+
+
+/* MAX_PATH_STORE must be >= KEY_LEN
+ */
+#define MAX_PATH_STORE 12287
+
+typedef struct store_info {
+  /*
+  char             fullpath[MAX_PATH_STORE+2];
+  char             linkpath[MAX_PATH_STORE+2];
+  */
+  UINT32           mode;
+  UINT32           linkmode;
+
+  UINT64           dev;
+  UINT64           rdev;
+  UINT32           hardlinks;
+  UINT32           ino;
+  UINT64           size;
+  UINT64           atime;
+  UINT64           mtime;
+  UINT64           ctime;
+  UINT32           owner;
+  UINT32           group;
+
+#ifdef OLD_BUG
+#if defined(__linux__)
+  UINT32           attributes;
+  char             c_attributes[16];
+#endif
+#else
+  /* #if defined(__linux__) */
+  UINT32           attributes;
+  char             c_attributes[16];
+  /* endif                  */
+#endif
+  unsigned short   mark;
+  char             c_owner[USER_MAX+2];
+  char             c_group[GROUP_MAX+2];
+  char             c_mode[11];
+  char             checksum[KEY_LEN+1];
+} sh_filestore_t;
+  
+typedef struct file_info {
+  sh_filestore_t   theFile;
+  char           * fullpath;
+  char           * linkpath;
+  int              visited;
+  int              reported;
+  int              allignore;
+  unsigned long    modi_mask;
+  struct           file_info * next;
+} sh_file_t;
+
+  static char  *policy[] = {
+    N_("[]"),
+    N_("[ReadOnly]"),
+    N_("[LogFiles]"),
+    N_("[GrowingLogs]"),
+    N_("[IgnoreNone]"),
+    N_("[IgnoreAll]"),
+    N_("[Attributes]"),
+    N_("[User0]"),
+    N_("[User1]"),
+    N_("[Prelink]"),
+    NULL
+  };
+
 
 /**********************************
@@ -120,4 +305,21 @@
 #include "sh_hash.h"
 
+/* must fit an int              */
+#define TABSIZE 2048  
+
+/* must fit an unsigned short   */
+/* changed for V0.8, as the     */
+/* database format has changed  */
+
+/* changed again for V0.9       */
+/* #define REC_MAGIC 19         */
+/* changed again for V1.3       */
+#ifdef OLD_BUG
+#define REC_MAGIC 20
+#else
+/* changed again for V1.4       */
+#define REC_MAGIC 21
+#endif
+
 
 /**************************************************************
@@ -126,7 +328,10 @@
  *
  **************************************************************/
-file_type * sh_hash_create_ft (const sh_file_t * p, char * fileHash)
+static file_type * sh_hash_create_ft (const sh_file_t * p, char * fileHash)
 {
   file_type * theFile;
+#if defined(__linux__)
+  int i = 16;
+#endif
 
   SL_ENTER(_("sh_hash_create_ft"));
@@ -136,17 +341,18 @@
   sl_strlcpy(theFile->c_mode, p->theFile.c_mode, 11);
   theFile->mode  =  p->theFile.mode;
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  sl_strlcpy(theFile->c_attributes, p->theFile.c_attributes, ATTRBUF_SIZE);
+#if defined(__linux__)
+  sl_strlcpy(theFile->c_attributes, p->theFile.c_attributes, i /* 16 */);
   theFile->attributes =  p->theFile.attributes;
 #endif
 
   sl_strlcpy(theFile->fullpath, p->fullpath, PATH_MAX);
-  if (p->linkpath != NULL /* && theFile->c_mode[0] == 'l' */)
-    {
-      theFile->link_path = sh_util_strdup(p->linkpath);
-    }
-  else
-    {
-      theFile->link_path = NULL;
+  if (p->linkpath != NULL && theFile->c_mode[0] == 'l')
+    {
+      sl_strlcpy(theFile->linkpath, p->linkpath, PATH_MAX);
+    }
+  else
+    {
+      theFile->linkpath[0] = '-';
+      theFile->linkpath[1] = '\0';
     }
   sl_strlcpy(fileHash, p->theFile.checksum, KEY_LEN+1);
@@ -167,52 +373,25 @@
   theFile->dev   =  p->theFile.dev;
   theFile->hardlinks = p->theFile.hardlinks;
-  theFile->check_flags = p->theFile.checkflags;
-
-  if (p->attr_string)
-    theFile->attr_string = sh_util_strdup(p->attr_string);
-  else
-    theFile->attr_string = NULL;
 
   SL_RETURN((theFile), _("sh_hash_create_ft"));
 }
 
-struct two_sh_file_t {
-  sh_file_t * prev;
-  sh_file_t * this;
-};
-
-static sh_file_t * hashsearch (const char * s);
-static int hashsearch_prev (const char * s, struct two_sh_file_t * a, int * index); 
-
+static sh_file_t * hashsearch (char * s);
+
+static sh_file_t * tab[TABSIZE];
 
 /**************************************************************
  *
- * >>>> The internal database <<<
+ * compute hash function
  *
  **************************************************************/
-
-static sh_file_t * tab[TABSIZE];
-
-sh_file_t ** get_default_data_table()
-{
-  return tab;
-}
-
-/**************************************************************
- *
- * compute hash function
- *
- **************************************************************/
-
-static int hashfunc(const char *s) 
-{
-  unsigned int n = 0; 
+static int hashfunc(char *s) 
+{
+  unsigned n = 0; 
 
   for ( ; *s; s++) 
     n = 31 * n + *s; 
-
-  return n & (TABSIZE - 1); /* % TABSIZE */; 
+  return n % TABSIZE; 
 } 
-
 
 int hashreport_missing( char *fullpath, int level)
@@ -223,12 +402,6 @@
   file_type * theFile;
   char * str;
-  char hashbuf[KEYBUF_SIZE];
-  volatile int  retval;
 
   /* --------  find the entry for the file ----------------       */
-
-  SH_MUTEX_LOCK(mutex_hash);
-
-  retval = 0;
 
   if (sl_strlen(fullpath) <= MAX_PATH_STORE) 
@@ -237,39 +410,18 @@
     p = hashsearch( sh_tiger_hash(fullpath, 
 				  TIGER_DATA, 
-				  sl_strlen(fullpath),
-				  hashbuf, sizeof(hashbuf))
+				  sl_strlen(fullpath))
 		    );
   if (p == NULL)
-    {
-      retval = -1;
-      goto unlock_and_return;
-    }
+    return -1;
 
   theFile = sh_hash_create_ft (p, fileHash);
   str = all_items(theFile, fileHash, 0);
   tmp = sh_util_safe_name(fullpath);
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  if (!sh_global_check_silent)
-    sh_error_handle (level, FIL__, __LINE__, 0, 
-		     MSG_FI_MISS2, tmp, str);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  ++sh.statistics.files_report;
-
+  sh_error_handle (level, FIL__, __LINE__, 0, 
+		   MSG_FI_MISS2, tmp, str);
   SH_FREE(tmp);
   SH_FREE(str);
-  if (theFile->attr_string) SH_FREE(theFile->attr_string);
-  if (theFile->link_path)   SH_FREE(theFile->link_path);
   SH_FREE(theFile);
-
- unlock_and_return:
-  ; /* 'label at end of compound statement */
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  /* remove here to avoid second message from hash_unvisited */
-  if (retval == 0)
-    sh_hash_remove (fullpath);
-
-  return retval;
+  return 0;
 }
 
@@ -280,25 +432,4 @@
  *
  **************************************************************/
-static sh_file_t * delete_db_entry(sh_file_t *p)
-{
-  if (p->fullpath)
-    {
-      SH_FREE(p->fullpath);
-      p->fullpath = NULL;
-    }
-  if (p->linkpath)
-    {
-      SH_FREE(p->linkpath);
-      p->linkpath = NULL;
-    }
-  if (p->attr_string)
-    {
-      SH_FREE(p->attr_string);
-      p->attr_string = NULL;
-    }
-  SH_FREE(p);
-  return NULL;
-}
-
 static void hash_unvisited (int j, 
 			    sh_file_t *prev, sh_file_t *p, ShErrLevel level)
@@ -310,5 +441,7 @@
   char   fileHash[KEY_LEN + 1];
   file_type * theFile;
+
   char * str;
+
 
   SL_ENTER(_("hash_unvisited"));
@@ -322,42 +455,38 @@
     }
 
-  /* Not a fully qualified path, i.e. some info stored by some module
+  /* Kernel info
    */
-  if (p->fullpath[0] != '/')
+  if (p->fullpath[0] == 'K')
     {
       SL_RET0(_("hash_unvisited"));
     }
 
-  /* visited   flag not set: not seen; 
-   * checked   flag     set: not seen (i.e. missing), and already checked 
-   * reported  flag not set: not reported yet
-   * allignore flag not set: not under IgnoreAll
+  /* visited   = FALSE: not seen; 
+   * visited   = 99:    not seen, and already checked 
+   * reported  = FALSE: not reported yet
+   * allignore = FALSE: not under IgnoreAll
    *
    * Files/directories under IgnoreAll are noticed as missing already
    * during the file check.
    */
-  if (((!SH_FFLAG_VISITED_SET(p->fflags)) || SH_FFLAG_CHECKED_SET(p->fflags)) 
-      && (!SH_FFLAG_REPORTED_SET(p->fflags))
-      /* && (!SH_FFLAG_ALLIGNORE_SET(p->fflags)) */)
+  if ((p->visited == S_FALSE || p->visited == 99) && p->reported == S_FALSE 
+      && p->allignore == S_FALSE)
     {
       i = retry_lstat(FIL__, __LINE__, p->fullpath, &buf);
 
-     /* if file does not exist
+      /* if file does not exist
        */
       if (0 != i)
 	{
-	  ptr = sh_util_dirname (p->fullpath);
+	  ptr = sh_util_basename (p->fullpath);
 	  if (ptr)
 	    {
 	      /* If any of the parent directories is under IgnoreAll
 	       */
-	      if ((0 != sh_files_is_allignore(ptr)) || SH_FFLAG_ALLIGNORE_SET(p->fflags))
+	      if (0 != sh_files_is_allignore(ptr))
 		level = ShDFLevel[SH_LEVEL_ALLIGNORE];
 	      SH_FREE(ptr);
 	    }
-
-	  /* Only report if !SH_FFLAG_CHECKED_SET
-	   */
-	  if (!SH_FFLAG_CHECKED_SET(p->fflags))
+	  if (p->visited != 99)
 	    {
 	      if (S_FALSE == sh_ignore_chk_del(p->fullpath))
@@ -367,11 +496,7 @@
 		  theFile = sh_hash_create_ft (p, fileHash);
 		  str = all_items(theFile, fileHash, 0);
-		  if (!sh_global_check_silent)
-		    sh_error_handle (level, FIL__, __LINE__, 0, 
-				     MSG_FI_MISS2, tmp, str);
-		  ++sh.statistics.files_report;
+		  sh_error_handle (level, FIL__, __LINE__, 0, 
+				   MSG_FI_MISS2, tmp, str);
 		  SH_FREE(str);
-		  if (theFile->attr_string) SH_FREE(theFile->attr_string);
-		  if (theFile->link_path)   SH_FREE(theFile->link_path);
 		  SH_FREE(theFile);
 
@@ -380,11 +505,19 @@
 	    }
 
-	  /* We rewrite the db on update, thus we need to keep this
+	  /* We rewrite the db on update, thus we need to push this out
 	   * if the user does not want to purge it from the db.
 	   */
-
-	  if ((sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) || 
-	      (S_TRUE == sh.flag.update && S_TRUE == sh_util_ask_update(p->fullpath)))
+	  if (sh.flag.checkSum == SH_CHECK_INIT && 
+	      sh.flag.update   == S_TRUE &&
+	      S_FALSE          == sh_util_ask_update(p->fullpath))
 	    {
+	      theFile = sh_hash_create_ft (p, fileHash);
+	      sh_hash_pushdata (theFile, fileHash);
+	      SH_FREE(theFile);
+	    }
+
+	  if (sh.flag.reportonce == S_TRUE)
+	    {
+#ifdef REPLACE_OLD
 	      /* Remove the old entry
 	       */
@@ -393,14 +526,26 @@
 	      else
 		prev->next = p->next;
-
-	      delete_db_entry(p);
-
+	      if (p->fullpath)
+		{
+		  SH_FREE(p->fullpath);
+		  p->fullpath = NULL;
+		}
+	      if (p->linkpath)
+		{
+		  SH_FREE(p->linkpath);
+		  p->linkpath = NULL;
+		}
+	      SH_FREE(p);
+	      p = NULL;
 	      SL_RET0(_("hash_unvisited"));
+#else
+	      p->reported = S_TRUE; 
+#endif
 	    }
 	}
     }
 
-  else if (SH_FFLAG_VISITED_SET(p->fflags) && SH_FFLAG_REPORTED_SET(p->fflags) 
-	   && (!SH_FFLAG_ALLIGNORE_SET(p->fflags)))
+  else if (p->visited == S_TRUE && p->reported == S_TRUE 
+	   && p->allignore == S_FALSE)
     {
       if (S_FALSE == sh_ignore_chk_new(p->fullpath))
@@ -410,11 +555,7 @@
 	  theFile = sh_hash_create_ft (p, fileHash);
 	  str = all_items(theFile, fileHash, 0);
-	  if (!sh_global_check_silent)
-	    sh_error_handle (level, FIL__, __LINE__, 0, 
-			     MSG_FI_MISS2, tmp, str);
-	  ++sh.statistics.files_report;
+	  sh_error_handle (level, FIL__, __LINE__, 0, 
+			   MSG_FI_MISS2, tmp, str);
 	  SH_FREE(str);
-	  if (theFile->attr_string)
-	    SH_FREE(theFile->attr_string);
 	  SH_FREE(theFile);
 
@@ -422,17 +563,13 @@
 	}
 
-      CLEAR_SH_FFLAG_REPORTED(p->fflags);
+      p->reported = S_FALSE;
     }
 
   if (sh.flag.reportonce == S_FALSE)
-    CLEAR_SH_FFLAG_REPORTED(p->fflags);
-
-  CLEAR_SH_FFLAG_VISITED(p->fflags);
-  CLEAR_SH_FFLAG_CHECKED(p->fflags);
-  SET_SH_FFLAG_ENOENT(p->fflags);
-
+    p->reported = S_FALSE;
+
+  p->visited = S_FALSE;
   SL_RET0(_("hash_unvisited"));
 }
-
 
 
@@ -447,6 +584,4 @@
 
   SL_ENTER(_("sh_hash_unvisited"));
-
-  SH_MUTEX_LOCK(mutex_hash);
   for (i = 0; i < TABSIZE; ++i)
     {
@@ -454,120 +589,5 @@
 	hash_unvisited (i, tab[i], tab[i], level);
     }
-  SH_MUTEX_UNLOCK(mutex_hash);
-
   SL_RET0(_("hash_unvisited"));
-}
-
-/*********************************************************************
- *
- * Remove a single file from the database.
- *
- *********************************************************************/
-void sh_hash_remove_unconditional (const char * path)
-{
-  struct two_sh_file_t entries;
-  int index;
-
-  SL_ENTER(_("sh_hash_remove_unconditional"));
-
-  SH_MUTEX_LOCK(mutex_hash);
-  if (0 == hashsearch_prev (path, &entries, &index))
-    {
-      sh_file_t * p = entries.this;
-      
-      /* Remove the old entry
-       */
-      if (entries.prev == p)
-	tab[index] = p->next;
-      else
-	entries.prev->next = p->next;
-      
-      delete_db_entry(p);
-    }
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  SL_RET0(_("sh_hash_remove_unconditional"));
-}
-
-void sh_hash_remove (const char * path)
-{
-  SL_ENTER(_("sh_hash_remove"));
-
-  if ((sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE) || 
-      (S_TRUE == sh.flag.update && S_TRUE == sh_util_ask_update(path)))
-    {
-      sh_hash_remove_unconditional (path);
-    }
-  SL_RET0(_("sh_hash_remove"));
-}
-
-
-/*********************************************************************
- *
- * Search for unvisited entries in the database, custom error handler.
- *
- *********************************************************************/
-void sh_hash_unvisited_custom (char prefix, void(*handler)(const char * key))
-{
-  int i;
-  sh_file_t *p    = NULL;
-  sh_file_t *prev = NULL;
-  sh_file_t *next = NULL;
-
-  SL_ENTER(_("sh_hash_unvisited_custom"));
-
-  SH_MUTEX_LOCK(mutex_hash);
-  for (i = 0; i < TABSIZE; ++i)
-    {
-      if (tab[i] != NULL)
-	{
-	  p = tab[i]; prev = p;
-
-	  do 
-	    {
-	      next = p->next;
-
-	      if (p->fullpath && 
-		  prefix == p->fullpath[0])
-		{
-		  if ((!SH_FFLAG_VISITED_SET(p->fflags)) 
-		      && (!SH_FFLAG_REPORTED_SET(p->fflags)))
-		    {
-		      handler(p->fullpath);
-
-		      if (!SH_FFLAG_CHECKED_SET(p->fflags))
-			{
-			  /* delete */
-			  if (tab[i] == p)
-			    {
-			      tab[i] = p->next;
-			      prev   = tab[i];
-			      next   = prev;
-			    }
-			  else
-			    {
-			      prev->next = p->next;
-			      next       = prev->next;
-			    }
-
-			  p = delete_db_entry(p);
-			}
-		    }
-		  if (p)
-		    {
-		      CLEAR_SH_FFLAG_VISITED(p->fflags);
-		      CLEAR_SH_FFLAG_CHECKED(p->fflags);
-		    }
-		}
-	      if (p)
-		prev = p;
-	      p    = next;
-	    } 
-	  while (p);
-	}
-    }
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  SL_RET0(_("hash_unvisited_custom"));
 }
 
@@ -597,9 +617,4 @@
       SH_FREE(p->linkpath);
       p->linkpath = NULL;
-    }
-  if (p->attr_string)
-    {
-      SH_FREE(p->attr_string);
-      p->attr_string = NULL;
     }
   SH_FREE(p);
@@ -614,5 +629,5 @@
  *
  ***********************************************************************/
-static sh_file_t * hashsearch (const char * s) 
+static sh_file_t * hashsearch (char * s) 
 {
   sh_file_t * p;
@@ -620,43 +635,13 @@
   SL_ENTER(_("hashsearch"));
 
-  if (s)
-    {
-      for (p = tab[hashfunc(s)]; p; p = p->next)
-	if ((p->fullpath != NULL) && (0 == strcmp(s, p->fullpath))) 
-	  SL_RETURN( p, _("hashsearch"));
-    } 
+  if (!s)
+    SL_RETURN( NULL, _("hashsearch"));
+
+  for (p = tab[hashfunc(s)]; p; p = p->next) 
+    if ((p->fullpath != NULL) && (0 == strcmp(s, p->fullpath))) 
+      SL_RETURN( p, _("hashsearch")); 
   SL_RETURN( NULL, _("hashsearch"));
 } 
 
-static int hashsearch_prev (const char * s, struct two_sh_file_t * a, int * index) 
-{
-  sh_file_t * this;
-  sh_file_t * prev = NULL;
-
-  SL_ENTER(_("hashsearch_prev"));
-
-  if (s)
-    {
-      *index = hashfunc(s);
-      this   = tab[*index];
-      prev   = this;
-
-      if (this)
-	{
-	  do {
-	    if ((this->fullpath != NULL) && (0 == strcmp(s, this->fullpath)))
-	      {
-		a->prev = prev;
-		a->this = this;	
-		SL_RETURN( 0, _("hashsearch_prev"));
-	      }
-	    prev = this;
-	    this = this->next;
-	  } while(this);
-	} 
-    }
-  SL_RETURN( -1, _("hashsearch"));
-} 
-
 
 /***********************************************************************
@@ -665,8 +650,7 @@
  *
  ***********************************************************************/
-void hashinsert (sh_file_t * mtab[TABSIZE], sh_file_t * s) 
+static void hashinsert (sh_file_t * s) 
 {
   sh_file_t * p;
-  sh_file_t * q;
   int key;
 
@@ -675,36 +659,34 @@
   key = hashfunc(s->fullpath);
 
-  if (mtab[key] == NULL) 
-    {
-      mtab[key] = s;
-      mtab[key]->next = NULL;
+  if (tab[key] == NULL) 
+    {
+      tab[key] = s;
+      tab[key]->next = NULL;
       SL_RET0(_("hashinsert"));
     } 
   else 
     {
-      p = mtab[key];
+      p = tab[key];
       while (1) 
 	{
-	  if (p && p->fullpath && 0 == strcmp(s->fullpath, p->fullpath))
+	  if (p && p->fullpath && 
+	      0 == strcmp(s->fullpath, p->fullpath) &&
+	      strlen(s->fullpath) == strlen(p->fullpath))
 	    {
-	      q = p->next;
-	      SH_FREE(p->fullpath);
-	      if(p->linkpath)    SH_FREE(p->linkpath);
-	      if(p->attr_string) SH_FREE(p->attr_string);
-	      memcpy(p, s, sizeof(sh_file_t));
-	      p->next = q;
-	      SH_FREE(s); s = NULL;
+	      SH_FREE(s->fullpath);
+	      if(s->linkpath)
+		SH_FREE(s->linkpath);
+	      SH_FREE(s);
+	      s = NULL;
 	      SL_RET0(_("hashinsert"));
 	    }
-	  else if (p && p->next == NULL) 
-	    {
-	      p->next = s;
-	      p->next->next = NULL;
-	      SL_RET0(_("hashinsert"));
-	    }
-	  if (p)
-	    p = p->next;
-	  else /* cannot really happen, but llvm/clang does not know */
-	    break;
+	  else 
+	    if (p->next == NULL) 
+	      {
+		p->next = s;
+		p->next->next = NULL;
+		SL_RET0(_("hashinsert"));
+	      }
+	  p = p->next;
 	}
     }
@@ -713,7 +695,43 @@
 
 
-
 /******************************************************************
  *
+ * Get a single line
+ *
+ ******************************************************************/
+static FILE * sh_fin_fd = NULL;
+
+static int sh_hash_getline (FILE * fd, char * line, int sizeofline)
+{
+  register int  n = 0;
+  char        * res;
+
+  if (sizeofline < 2) {
+    line[0] = '\0';
+    return 0;
+  }
+  res = fgets(line, sizeofline, fd);
+  if (res == NULL)
+    {
+      line[0] = '\0';
+      return -1;
+    }
+  n = strlen(line);
+  if (n > 1) {
+    --n;
+    line[n] = '\0';
+  }
+  return n;
+}
+
+static void sh_hash_getline_end ()
+{
+  fclose (sh_fin_fd);
+  sh_fin_fd = NULL;
+  return;
+}
+
+/******************************************************************
+ *
  * ------- Check functions -------
  *
@@ -722,15 +740,244 @@
 static int IsInit = 0;
 
-void sh_hash_set_initialized()
-{
-  IsInit = 1;
-  return;
-}
-
-int sh_hash_get_initialized()
-{
-  return IsInit;
-}
-
+
+/******************************************************************
+ *
+ * Fast forward to start of data
+ *
+ ******************************************************************/
+int sh_hash_setdataent (SL_TICKET fd, char * line, int size, char * file)
+{
+  long i;
+  extern int get_the_fd (SL_TICKET ticket);
+
+  SL_ENTER(_("sh_hash_setdataent"));
+
+  sl_rewind (fd);
+
+  if (sh_fin_fd != NULL)
+    {
+      fclose (sh_fin_fd);
+      sh_fin_fd = NULL;
+    }
+
+  sh_fin_fd = fdopen(get_the_fd(fd), "rb");
+  if (!sh_fin_fd)
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("The file signature database: %s is not readable.\n"),
+	   (NULL == file) ? _("(null)") : file);
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
+		       ( (NULL == file) ? _("(null)") : file)
+		       );
+      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+  while (1) 
+    {
+      i =  sh_hash_getline (sh_fin_fd, line, size-1);
+      if (i < 0 ) 
+	{
+	  SH_FREE(line);
+	  dlog(1, FIL__, __LINE__, 
+	       _("The file signature database: %s does not\ncontain any data, or the start-of-file marker is missing (unlikely,\nunless modified by hand).\n"),
+	       (NULL == file) ? _("(null)") : file);
+	       
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
+			   ( (NULL == file) ? _("(null)") : file)
+			   );
+	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	}
+
+#if defined(SH_STEALTH)
+      if (0 == sl_strncmp (line, N_("[SOF]"), 5)) 
+#else
+      if (0 == sl_strncmp (line, _("[SOF]"),  5)) 
+#endif
+	break;
+    }
+  SL_RETURN( 1, _("sh_hash_setdataent"));
+}
+
+static int sh_hash_setdataent_old (SL_TICKET fd, char * line, int size, 
+				   char * file)
+{
+  long i;
+
+  SL_ENTER(_("sh_hash_setdataent_old"));
+
+  sl_rewind (fd);
+
+  while (1) 
+    {
+      i =  sh_unix_getline (fd, line, size-1);
+      if (i < 0 ) 
+	{
+	  SH_FREE(line);
+	  dlog(1, FIL__, __LINE__, 
+	       _("The file signature database: %s does not\ncontain any data, or the start-of-file marker is missing (unlikely,\nunless modified by hand).\n"),
+	       (NULL == file) ? _("(null)") : file);
+	       
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
+			   ( (NULL == file) ? _("(null)") : file)
+			   );
+	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	}
+
+#if defined(SH_STEALTH)
+      if (0 == sl_strncmp (line, N_("[SOF]"), 5)) 
+#else
+      if (0 == sl_strncmp (line, _("[SOF]"),  5)) 
+#endif
+	break;
+    }
+  SL_RETURN( 1, _("sh_hash_setdataent_old"));
+}
+
+/******************************************************************
+ *
+ * Read next record
+ *
+ ******************************************************************/
+sh_file_t *  sh_hash_getdataent (SL_TICKET fd, char * line, int size)
+{
+  sh_file_t * p;
+  sh_filestore_t ft;
+  long i;
+  char * fullpath;
+  char * linkpath;
+  char * tmp;
+
+  SL_ENTER(_("sh_hash_getdataent"));
+
+  (void) fd;
+
+  /* Read next record -- Part One 
+   */
+  p = SH_ALLOC(sizeof(sh_file_t));
+
+  i = fread (&ft, sizeof(sh_filestore_t), 1, sh_fin_fd);
+  /* i = sl_read(fd, &ft, sizeof(sh_filestore_t)); */
+  /* if ( SL_ISERROR(i) || i == 0) */
+  if (i < 1)
+    {
+      SH_FREE(p);
+      SL_RETURN( NULL, _("sh_hash_getdataent"));
+    }
+
+  swap_32(&(ft.mode));
+  swap_32(&(ft.linkmode));
+  swap_64(&(ft.dev));
+  swap_64(&(ft.rdev));
+  swap_32(&(ft.hardlinks));
+  swap_32(&(ft.ino));
+  swap_64(&(ft.size));
+  swap_64(&(ft.atime));
+  swap_64(&(ft.mtime));
+  swap_64(&(ft.ctime));
+  swap_32(&(ft.owner));
+  swap_32(&(ft.group));
+#if defined(__linux__)
+  swap_32(&(ft.attributes));
+#endif
+#ifdef OLD_BUG
+  swap_short(&(ft.mark));
+#else
+  ft.mark = *(swap_short(&(ft.mark)));
+#endif
+
+  if (ft.mark != REC_MAGIC)
+    {
+      SH_FREE(p);
+      SL_RETURN( NULL, _("sh_hash_getdataent"));
+    }
+
+  /* Read next record -- Part Two -- Fullpath
+   */
+  i =  sh_hash_getline (sh_fin_fd, line, size-1);
+  if (i < 0 ) 
+    {
+      SH_FREE(line);
+      SH_FREE(p);
+      dlog(1, FIL__, __LINE__, 
+	   _("There is a corrupt record in the file signature database: %s\nThe file path is missing.\n"),
+	   (NULL == file_path('D', 'R'))? _("(null)"):file_path('D', 'R'));
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
+			   ( (NULL == file_path('D', 'R')) ? _("(null)") :
+			     file_path('D', 'R'))
+			    );
+      aud_exit (FIL__, __LINE__,EXIT_FAILURE);
+    }
+
+  tmp = unquote_string (line);
+  i = sl_strlen(tmp)+1;
+  fullpath = SH_ALLOC(i);
+  sl_strlcpy (fullpath, tmp, i);
+  if (tmp)
+    SH_FREE(tmp);
+  if (fullpath[i-2] == '\n')
+    fullpath[i-2] = '\0';
+
+  /* Read next record -- Part Three -- Linkpath
+   */
+  i =  sh_hash_getline (sh_fin_fd, line, size-1);
+  if (i < 0 ) 
+    {
+      SH_FREE(line);
+      SH_FREE(fullpath);
+      SH_FREE(p);
+      dlog(1, FIL__, __LINE__, 
+	   _("There is a corrupt record in the file signature database: %s\nThe link path (or its placeholder) is missing.\n"),
+	   (NULL == file_path('D', 'R'))? _("(null)"):file_path('D', 'R'));
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_P_NODATA,
+		       ( (NULL == file_path('D', 'R')) ? _("(null)") :
+			 file_path('D', 'R'))
+		       );
+      aud_exit (FIL__, __LINE__,EXIT_FAILURE);
+    }
+
+  tmp = unquote_string (line);
+  i = sl_strlen(tmp)+1;
+  linkpath = SH_ALLOC(i);
+  sl_strlcpy (linkpath, tmp, i);
+  if (tmp)
+    SH_FREE(tmp);
+  if (linkpath[i-2] == '\n')
+    linkpath[i-2] = '\0';
+
+  /* Read next record -- Part Four -- Decode
+   */
+#if defined(SH_STEALTH)
+  sh_do_decode(fullpath,    sl_strlen(fullpath));
+  
+#if defined(__linux__)
+  sh_do_decode(ft.c_attributes,   sl_strlen(ft.c_attributes));
+#endif
+  
+  sh_do_decode(ft.c_mode,   sl_strlen(ft.c_mode));
+  sh_do_decode(ft.c_owner,  sl_strlen(ft.c_owner));
+  sh_do_decode(ft.c_group,  sl_strlen(ft.c_group));
+  sh_do_decode(ft.checksum, sl_strlen(ft.checksum));
+  
+  
+  if (ft.c_mode[0] == 'l') 
+    {  
+      sh_do_decode(linkpath, sl_strlen(linkpath));
+    }
+#endif
+
+  memcpy( &(*p).theFile, &ft, sizeof(sh_filestore_t) );
+  p->visited   = S_FALSE;
+  p->reported  = S_FALSE;
+  p->allignore = S_FALSE;
+  p->modi_mask = 0L;
+  p->fullpath  = fullpath;
+  p->linkpath  = linkpath;
+
+  /* set to an invalid value 
+   */
+  ft.mark = (REC_MAGIC + 5);
+
+  SL_RETURN( p, _("sh_hash_getdataent"));
+}
 
 /******************************************************************
@@ -741,64 +988,227 @@
 void sh_hash_init ()
 {
-  volatile int  retval  = 0;
-  volatile int  exitval = EXIT_SUCCESS;
+  sh_file_t * p;
+  SL_TICKET fd    = (-1);
+  long i;
+  int count = 0;
+  char * line = NULL;
+
+#if defined(WITH_GPG) || defined(WITH_PGP)
+  extern int get_the_fd (SL_TICKET ticket);
+  FILE *   fin_cp;
+
+  char * buf  = NULL;
+  int    bufc;
+  int    flag_pgp = S_FALSE;
+  int    flag_nohead = S_FALSE;
+  SL_TICKET fdTmp = (-1);
+  SL_TICKET open_tmp (void);
+#endif
 
   SL_ENTER(_("sh_hash_init"));
 
-  if ( sh.flag.checkSum == SH_CHECK_INIT )
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("Attempt to load the baseline database during initialisation. This is an internal error, please report it to the developer.\n"));
-      SH_ABORT;
+  if (IsInit == 1) 
+    SL_RET0(_("sh_hash_init"));
+
+  for (i = 0; i < TABSIZE; ++i) 
+    tab[i] = NULL;
+
+#if defined(SH_WITH_CLIENT)
+
+  /* Data file from Server
+   */
+
+  if (fd == (-1) && 0 == sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_D_DSTART);
+      fd = sh_forward_req_file(_("DATA"));
+      if (SL_ISERROR(fd))
+	{
+	  dlog(1, FIL__, __LINE__, 
+	       _("Could not retrieve the file signature database from the server(errnum = %ld).\nPossible reasons include:\n - the server is not running,\n - session key negotiation failed (see the manual for proper setup), or\n - the server cannot access the file.\n"), fd); 
+	  sh_error_handle ((-1), FIL__, __LINE__, fd, MSG_EXIT_ABORT1, 
+			   sh.prg_name);
+	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	}
+      sl_rewind (fd);
+
+      tiger_fd = fd;
+      sl_strlcpy (sh.data.hash, 
+		  sh_tiger_hash (file_path('C', 'R'), /*irrelevant, TIGER_FD*/ 
+				 TIGER_FD, 0),
+		  KEY_LEN+1);
+      sl_rewind (fd);
+    }
+  else 
+#endif
+    /* Local data file
+     */
+
+    if (fd == (-1))
+      {
+	if ( SL_ISERROR(fd = sl_open_read(file_path('D', 'R'), SL_YESPRIV))) 
+	  {
+	    TPT(( 0, FIL__, __LINE__, _("msg=<Error opening: %s>\n"), 
+		  file_path('D', 'R')));
+	    dlog(1, FIL__, __LINE__, 
+		 _("Could not open the local file signature database for reading because\nof the following error: %s (errnum = %ld)\nIf this is a permission problem, you need to change file permissions\nto make the file readable for the effective UID: %d\n"), 
+		 sl_get_errmsg(), fd, (int) sl_ret_euid());
+	    sh_error_handle ((-1), FIL__, __LINE__, fd, MSG_EXIT_ABORT1, 
+			     sh.prg_name);
+	    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	  }
+	
+	TPT(( 0, FIL__, __LINE__, _("msg=<Opened database: %s>\n"), 
+	      file_path('D', 'R')));
+
+	tiger_fd = fd;
+	if (0 != sl_strncmp(sh.data.hash, 
+			    sh_tiger_hash (file_path('D', 'R'), TIGER_FD, 0),
+			    KEY_LEN)
+	    && sh.flag.checkSum != SH_CHECK_INIT) 
+	  {
+	    dlog(1, FIL__, __LINE__, 
+		 _("The checksum of the file signature database has changed since startup.\n"));
+	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_AUTH,
+			     ( (NULL == file_path('D', 'R')) ? _("(null)") :
+			       file_path('D', 'R') )
+			     );
+	    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+	  }
+	sl_rewind (fd);
+
+      } /* new 1.4.8 */
+
+  if (sig_termfast == 1)  /* SIGTERM */
+    {
+      TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+      --sig_raised; --sig_urgent;
+      aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+    }
+
+#if defined(WITH_GPG) || defined(WITH_PGP)
+  /* new 1.4.8: also checked for server data */
+
+  /* extract the data and copy to temporary file
+   */
+  fdTmp = open_tmp();
+
+  fin_cp = fdopen(get_the_fd(fd), "rb");
+  buf = (char *) SH_ALLOC(8192);
+
+
+  /* while ( (bufc = sh_unix_getline (fd, buf, 8191)) > 0) */
+  while (NULL != fgets(buf, 8192, fin_cp))
+    {
+      bufc = 0; 
+      while (bufc < 8192) { 
+	if (buf[bufc] == '\n') { ++bufc; break; }
+	++bufc;
+      }
+
+      if (sig_termfast == 1)  /* SIGTERM */
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	  --sig_raised; --sig_urgent;
+	  aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	}
+
+      if (flag_pgp == S_FALSE &&
+	  (0 == sl_strcmp(buf, _("-----BEGIN PGP SIGNED MESSAGE-----\n"))||
+	   0 == sl_strcmp(buf, _("-----BEGIN PGP MESSAGE-----\n")))
+	  )
+	{
+	  flag_pgp = S_TRUE;
+	  sl_write(fdTmp, buf, bufc);
+	  continue;
+	}
+      
+      if (flag_pgp == S_TRUE && flag_nohead == S_FALSE)
+	{
+	  if (buf[0] == '\n')
+	    {
+	      flag_nohead = S_TRUE;
+	      sl_write(fdTmp, buf, 1);
+	      continue;
+	    }
+	  else if (0 == sl_strncmp(buf, _("Hash:"), 5) ||
+		   0 == sl_strncmp(buf, _("NotDashEscaped:"), 15))
+	    {
+	      sl_write(fdTmp, buf, bufc);
+	      continue;
+	    }
+	  else
+	    continue;
+	}
+    
+      if (flag_pgp == S_TRUE && buf[0] == '\n')
+	{
+	  sl_write(fdTmp, buf, 1);
+	}
+      else if (flag_pgp == S_TRUE)
+	{
+	  /* sl_write_line(fdTmp, buf, bufc); */
+	  sl_write(fdTmp, buf, bufc);
+	}
+      
+      if (flag_pgp == S_TRUE && 
+	  0 == sl_strcmp(buf, _("-----END PGP SIGNATURE-----\n")))
+	break;
+    }
+  SH_FREE(buf);
+  sl_close(fd);
+  fclose(fin_cp);
+
+  fd = fdTmp;
+  sl_rewind (fd);
+
+  /* Validate signature of open file.
+   */
+  if (0 != sh_gpg_check_sign (0, fd, 2))
+    {
       aud_exit (FIL__, __LINE__, EXIT_FAILURE);
     }
-
-  SH_MUTEX_LOCK(mutex_hash);
-
-  if (IsInit == 1)
-    { 
-      goto unlock_and_return;
-    }
-
-  /* Initialization completed.
+  sl_rewind (fd);
+#endif
+  /* } new 1.4.8 check sig also for files downloaded from server */
+
+  line = SH_ALLOC(MAX_PATH_STORE+1);
+
+  /* fast forward to start of data
    */
-  retval = sh_dbIO_load_db(tab);
-
-  if (0 == retval)
-    IsInit = 1;
-  else
-    exitval = EXIT_FAILURE;
-
- unlock_and_return:
-  ; /* 'label at end of compound statement */
-  SH_MUTEX_UNLOCK(mutex_hash);
-  if (retval == 0)
-    {
-      SL_RET0(_("sh_hash_init"));
-    }
-  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1, sh.prg_name);
-  aud_exit (FIL__, __LINE__, exitval);
-}
-
-void sh_hash_init_and_checksum()
-{
-  TPT((0, FIL__, __LINE__, _("msg=<Get checksum of the database.>\n")))
-  if (sh.flag.checkSum == SH_CHECK_CHECK) 
-    {
-      if (0 != sl_strcmp(file_path('D', 'R'), _("REQ_FROM_SERVER")))
-	{
-	  char hashbuf[KEYBUF_SIZE];
-	  (void) sl_strlcpy(sh.data.hash,
-			    sh_tiger_hash (file_path('D', 'R'), 
-					   TIGER_FILE, TIGER_NOLIM, 
-					   hashbuf, sizeof(hashbuf)), 
-			    KEY_LEN+1);
-	}
-
-      /* this eventually fetches the file from server to get checksum
-       */
-      sh_hash_init ();
-    }
-  return;
+  sh_hash_setdataent(fd, line, MAX_PATH_STORE, file_path('D', 'R'));
+
+  while (1) 
+    {
+      if (sig_termfast == 1)  /* SIGTERM */
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
+	  --sig_raised; --sig_urgent;
+	  aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
+	}
+
+      p = sh_hash_getdataent (fd, line, MAX_PATH_STORE);
+      if (p != NULL)
+	{
+	  hashinsert (p); 
+	  ++count;
+	}
+      else
+	break;
+    }
+
+  if (line != NULL)
+    SH_FREE(line);
+
+  /* Always keep db in memory, so we have no open file
+   */
+  sl_close (fd);
+  sh_hash_getline_end();
+  fd = -1;
+
+  /* --- Initialization done successfully. ---
+   */
+  IsInit = 1;
+  SL_RET0(_("sh_hash_init"));
 }
   
@@ -814,11 +1224,6 @@
   SL_ENTER(_("sh_hash_hashdelete"));
 
-  /* need deadlock detection here if called from exit handler 
-   */
-  SH_MUTEX_TRYLOCK(mutex_hash);
-
   if (IsInit == 0) 
-    goto unlock_and_exit;
-
+    SL_RET0(_("sh_hash_hashdelete"));
   for (i = 0; i < TABSIZE; ++i) 
     if (tab[i] != NULL)
@@ -828,20 +1233,459 @@
       }
   IsInit = 0;
-
- unlock_and_exit:
-  ; /* 'label at end of compound statement */
-  SH_MUTEX_TRYLOCK_UNLOCK(mutex_hash);
-
   SL_RET0(_("sh_hash_hashdelete"));
 }
 
-static int sh_loosedircheck = S_FALSE;
-
-int sh_hash_loosedircheck(const char * str)
-{
-  return sh_util_flagval(str, &sh_loosedircheck);
-}
-
-
+/******************************************************************
+ *
+ * Insert a file into the database.
+ *
+ ******************************************************************/ 
+static int       pushdata_isfirst =  1;
+static SL_TICKET pushdata_fd      = -1;
+
+static int       pushdata_stdout  =  S_FALSE;
+
+static char * sh_db_version_string = NULL;
+
+int sh_hash_pushdata_stdout (char * str)
+{
+  if (!str)
+    { pushdata_stdout  =  S_TRUE; return 0; }
+  return -1;
+}
+
+int sh_hash_version_string(char * str)
+{
+  int i;
+  if (str)
+    {
+      i = sl_strlen(str);
+      if (sh_db_version_string != NULL) {
+	SH_FREE(sh_db_version_string);
+      }
+      if (0 == sl_strncmp(str, _("NULL"), 4))
+	{
+	  sh_db_version_string = NULL;
+	  return 0;
+	}
+      sh_db_version_string = SH_ALLOC(i+1);
+      sl_strlcpy(sh_db_version_string, str, i+1);
+      return 0;
+    }
+  return -1;
+}
+
+#if 0
+void sh_hash_pushdata_reset ()
+{
+  if (!SL_ISERROR(pushdata_fd))
+    {
+      sl_close(pushdata_fd);
+      pushdata_fd = -1;
+    }
+  pushdata_isfirst =  1;
+}
+#endif
+
+void sh_hash_pushdata (file_type * buf, char * fileHash)
+{
+  static long p_count = 0;
+
+  int         status = 0;
+
+  char      * tmp;
+  size_t      tmp_len = 0;
+  size_t      old_len = 0;
+
+  sh_filestore_t p;
+
+  struct stat sbuf;
+
+  char *  fullpath = NULL;
+  char *  linkpath = NULL;
+
+  char * line = NULL;
+
+  char   timestring[81];
+  char * timep;
+
+#if !defined(__linux__)
+  int    i;
+#endif
+
+  SL_ENTER(_("sh_hash_pushdata"));
+
+  fullpath = SH_ALLOC(MAX_PATH_STORE+1);
+  linkpath = SH_ALLOC(MAX_PATH_STORE+1);
+
+  linkpath[0] =  '-'; 
+  linkpath[1] = '\0'; 
+  fullpath[0] =  '-'; 
+  fullpath[1] = '\0';
+
+  if (!buf) {
+    memset(&p, '\0', sizeof(sh_filestore_t));
+  }
+
+  if ((pushdata_stdout == S_TRUE) && (sh.flag.update == S_TRUE))
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("You cannot write the database to stdout when you use update rather than init.\n"));
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
+		      _("Writing database to stdout with update"), 
+		      sh.prg_name, 
+		      _("sh_hash_pushdata"));
+      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+  if ((pushdata_stdout == S_TRUE) && (sl_is_suid()))
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("You cannot write the database to stdout when running with suid privileges.\n"));
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
+		      _("Writing database to stdout when suid"), 
+		      sh.prg_name, 
+		      _("sh_hash_pushdata"));
+      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+
+  if ((pushdata_stdout == S_FALSE) && 
+      ( (NULL == file_path('D', 'W')) || 
+	(0 == sl_strcmp(file_path('D', 'W'), _("REQ_FROM_SERVER"))) ))
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("You need to configure a local path for initializing the database\nlike ./configure --with-data-file=REQ_FROM_SERVER/some/local/path\n"));
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORTS,
+		      _("No local path for database specified"), 
+		      sh.prg_name, 
+		      _("sh_hash_pushdata"));
+      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
+    }
+
+
+  if ((pushdata_stdout == S_FALSE) && (pushdata_isfirst == 1))  
+    {
+      /* Warn that file already exists; file_path != NULL here because
+       * checked above
+       */
+      if (0 == retry_lstat(FIL__, __LINE__, file_path('D', 'W'), &sbuf))
+	{
+	  if (sh.flag.update == S_FALSE)
+	    {
+	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_FI_DBEX,
+			      file_path('D', 'W'));
+	    }
+	}
+    }
+
+
+  if (sh.flag.update == S_FALSE)
+    {
+      if (pushdata_stdout == S_FALSE)
+	{
+	  pushdata_fd = -1;
+	  if ( SL_ISERROR(pushdata_fd = sl_open_write(file_path('D', 'W'), SL_YESPRIV))) {
+	    SH_FREE(fullpath);
+	    SH_FREE(linkpath);
+	    sh_error_handle((-1), FIL__, __LINE__, pushdata_fd, MSG_E_ACCESS,
+			    geteuid(), file_path('D', 'W'));
+	    SL_RET0(_("sh_hash_pushdata"));
+	  }
+	  if ( SL_ISERROR(status = sl_forward(pushdata_fd))) {
+	    SH_FREE(fullpath);
+	    SH_FREE(linkpath);
+	    sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
+			    _("Fast forward failed"), _("sh_hash_pushdata"),
+			    file_path('D', 'W'));
+	    SL_RET0(_("sh_hash_pushdata"));
+	  }
+	}
+    }
+  else /* update == TRUE */
+    {
+      if (pushdata_isfirst == 1)
+	{
+	  TPT((0, FIL__, __LINE__, _("msg=<Update.>\n")))
+	  if ( SL_ISERROR(pushdata_fd = sl_open_rdwr(file_path('D', 'W'), SL_YESPRIV))){
+	    SH_FREE(fullpath);
+	    SH_FREE(linkpath);
+	    sh_error_handle((-1), FIL__, __LINE__, pushdata_fd, MSG_E_ACCESS,
+			    geteuid(), file_path('D', 'W'));
+	    SL_RET0(_("sh_hash_pushdata"));
+	  }
+	  line = SH_ALLOC(MAX_PATH_STORE+1);
+	  if (SL_ISERROR(sh_hash_setdataent_old (pushdata_fd, line, 
+						 MAX_PATH_STORE, 
+						 file_path('D', 'W'))))
+	    {
+	      SH_FREE(fullpath);
+	      SH_FREE(linkpath);
+	      SH_FREE(line);
+	      SL_RET0(_("sh_hash_pushdata"));
+	    }
+	  SH_FREE(line);
+	}
+    }
+	 
+  if (buf != NULL && buf->fullpath != NULL) {
+
+    old_len = sl_strlen(buf->fullpath);
+#if defined(SH_STEALTH)
+    sh_do_encode(buf->fullpath, old_len);
+#endif
+    tmp = quote_string(buf->fullpath);
+    tmp_len = sl_strlen(tmp);
+#if defined(SH_STEALTH)
+    sh_do_decode(buf->fullpath, old_len);
+#endif
+
+    if (tmp_len <= MAX_PATH_STORE) 
+      {
+	sl_strlcpy(fullpath, buf->fullpath, MAX_PATH_STORE+1);
+	/*
+	if (sl_strlen(buf->fullpath) < (MAX_PATH_STORE-3))
+	  {
+	    fullpath[MAX_PATH_STORE-2] = '\0';
+	    fullpath[MAX_PATH_STORE-1] = '\n';
+	  }
+	*/
+      } 
+    else 
+      {
+	sl_strlcpy(fullpath, 
+		   sh_tiger_hash (buf->fullpath,
+				  TIGER_DATA, old_len), 
+		   KEY_LEN+1);
+      }
+    SH_FREE(tmp);
+  }
+
+#if defined(SH_STEALTH)
+  sh_do_encode(fullpath, sl_strlen(fullpath));
+#endif
+
+  tmp = quote_string(fullpath);
+  sl_strlcpy(fullpath, tmp, MAX_PATH_STORE+1);
+  SH_FREE(tmp);
+
+  if (buf != NULL && buf->c_mode[0] == 'l' && buf->linkpath != NULL) 
+    {  
+
+      old_len = sl_strlen(buf->linkpath);
+#if defined(SH_STEALTH)
+      sh_do_encode(buf->linkpath, old_len);
+#endif
+      tmp = quote_string(buf->linkpath);
+      tmp_len = sl_strlen(tmp);
+#if defined(SH_STEALTH)
+      sh_do_decode(buf->linkpath, old_len);
+#endif
+
+      if (tmp_len <= MAX_PATH_STORE) 
+	{
+	  sl_strlcpy(linkpath, buf->linkpath, MAX_PATH_STORE+1);  
+	} 
+      else 
+	{
+	  sl_strlcpy(linkpath, 
+		     sh_tiger_hash (buf->linkpath,
+				    TIGER_DATA, old_len),
+		     KEY_LEN+1);
+	}
+      SH_FREE(tmp);
+
+#if defined(SH_STEALTH)
+      sh_do_encode(linkpath, sl_strlen(linkpath));
+#endif
+      tmp = quote_string(linkpath);
+      sl_strlcpy(linkpath, tmp, MAX_PATH_STORE+1);
+      SH_FREE(tmp);
+    }
+
+  if (buf != NULL) {
+    p.mark = REC_MAGIC;
+    sl_strlcpy(p.c_mode,   buf->c_mode,   11);
+    sl_strlcpy(p.c_group,  buf->c_group,  GROUP_MAX+1);
+    sl_strlcpy(p.c_owner,  buf->c_owner,  USER_MAX+1);
+    if (fileHash) {
+      sl_strlcpy(p.checksum, fileHash,      KEY_LEN+1);
+    }
+#if defined(__linux__)
+    sl_strlcpy(p.c_attributes, buf->c_attributes, 13);
+#else
+    for (i = 0; i < 12; ++i) p.c_attributes[i] = '-';
+    p.c_attributes[12] = '\0';
+#endif
+    
+#if defined(SH_STEALTH)
+    sh_do_encode(p.c_mode,   sl_strlen(p.c_mode));
+    sh_do_encode(p.c_owner,  sl_strlen(p.c_owner));
+    sh_do_encode(p.c_group,  sl_strlen(p.c_group));
+    sh_do_encode(p.checksum, sl_strlen(p.checksum));
+
+    sh_do_encode(p.c_attributes,   sl_strlen(p.c_attributes));
+#endif
+    
+#if defined(__linux__)
+    p.attributes  = (UINT32) buf->attributes;
+#else
+    p.attributes  = 0;
+#endif
+    p.linkmode    = (UINT32) buf->linkmode;
+    p.hardlinks   = (UINT32) buf->hardlinks;
+    p.dev   = (UINT64) buf->dev;
+    p.rdev  = (UINT64) buf->rdev;
+    p.mode  = (UINT32) buf->mode;
+    p.ino   = (UINT32) buf->ino;
+    p.size  = (UINT64) buf->size;
+    p.mtime = (UINT64) buf->mtime;
+    p.atime = (UINT64) buf->atime;
+    p.ctime = (UINT64) buf->ctime;
+    p.owner = (UINT32) buf->owner;
+    p.group = (UINT32) buf->group;
+    
+    swap_32(&(p.mode));
+    swap_32(&(p.linkmode));
+    swap_64(&(p.dev));
+    swap_64(&(p.rdev));
+    swap_32(&(p.hardlinks));
+    swap_32(&(p.ino));
+    swap_64(&(p.size));
+    swap_64(&(p.atime));
+    swap_64(&(p.mtime));
+    swap_64(&(p.ctime));
+    swap_32(&(p.owner));
+    swap_32(&(p.group));
+    swap_32(&(p.attributes));
+
+#ifdef OLD_BUG
+    swap_short(&(p.mark));
+#else
+    p.mark = *(swap_short(&(p.mark)));
+#endif
+  }
+
+  /* write the start marker 
+   */
+  if (pushdata_isfirst == 1) 
+    {
+      if (sh.flag.update == S_FALSE)
+	{
+	  if (sh_db_version_string != NULL)
+	    {
+	      if (pushdata_stdout == S_FALSE)
+		{
+		  sl_write (pushdata_fd, _("\n#Host "), 7);
+		  sl_write (pushdata_fd, sh.host.name, 
+			    sl_strlen(sh.host.name));
+		  sl_write (pushdata_fd, _(" Version "), 9);
+		  sl_write (pushdata_fd, sh_db_version_string, 
+			    sl_strlen(sh_db_version_string));
+		  sl_write (pushdata_fd, _(" Date "), 6);
+		  timep = sh_unix_time(0);
+		  sl_strlcpy(timestring, timep, sizeof(timestring));
+		  sl_write (pushdata_fd, timestring, sl_strlen(timestring));
+		  sl_write (pushdata_fd,        "\n", 1);
+		} else {
+		  printf (_("\n#Host "));
+		  printf ("%s", sh.host.name);
+		  printf (_(" Version "));
+		  printf ("%s", sh_db_version_string);
+		  printf (_(" Date "));
+		  timep = sh_unix_time(0);
+		  sl_strlcpy(timestring, timep, sizeof(timestring));
+		  printf ("%s\n", timestring);
+		}
+	    }
+
+	  if (pushdata_stdout == S_FALSE)
+	    {
+#if defined(SH_STEALTH)
+	      sl_write      (pushdata_fd,        "\n", 1);
+	      sl_write_line (pushdata_fd, N_("[SOF]"), 5);
+#else
+	      sl_write_line (pushdata_fd, _("\n[SOF]"),  6);
+#endif
+	    }
+	  else 
+	    {
+#if defined(SH_STEALTH)
+	      printf ("\n%s\n", N_("[SOF]"));
+#else
+	      printf ("%s\n", _("\n[SOF]"));
+#endif
+	    }
+	}
+      pushdata_isfirst = 0;
+    }
+      
+  if (pushdata_stdout == S_FALSE)
+    {
+      sl_write      (pushdata_fd,       &p, sizeof(sh_filestore_t));
+      sl_write_line (pushdata_fd, fullpath,    sl_strlen(fullpath));
+      sl_write_line (pushdata_fd, linkpath,    sl_strlen(linkpath));
+    } else {
+      fwrite (&p, sizeof(sh_filestore_t), 1, stdout);
+      printf ("%s\n", fullpath);
+      printf ("%s\n", linkpath);
+    }
+
+  ++p_count;
+
+  if ((sh.flag.update != S_TRUE) && (pushdata_stdout == S_FALSE))
+    {
+      sl_close (pushdata_fd);
+      pushdata_fd = -1;
+    }
+
+  SH_FREE(fullpath);
+  SH_FREE(linkpath);
+
+  SL_RET0(_("sh_hash_pushdata"));
+}
+
+int sh_hash_writeout()
+{
+  sh_file_t * p;
+  int         i;
+  file_type * f;
+  char   fileHash[KEY_LEN + 1];
+
+  SL_ENTER(_("sh_hash_writeout"));
+
+  if (S_TRUE == file_is_remote())
+    {
+      sh_error_handle((-1), FIL__, __LINE__, S_FALSE, MSG_E_SUBGEN, 
+		      _("Baseline database is remote"), _("sh_hash_writeout"));
+      SL_RETURN (1, _("sh_hash_writeout"));
+    }
+
+  if (!SL_ISERROR(pushdata_fd))
+    {
+      sl_close(pushdata_fd);
+      pushdata_fd = -1;
+    }
+  pushdata_isfirst =  1;
+
+  for (i = 0; i < TABSIZE; ++i)
+    {
+      for (p = tab[i]; p; p = p->next)
+	{
+	  f = sh_hash_create_ft (p, fileHash);
+	  sh_hash_pushdata (f, fileHash);
+	  SH_FREE(f);
+	}
+    }
+
+  if (!SL_ISERROR(pushdata_fd))
+    {
+      sl_close(pushdata_fd);
+      pushdata_fd = -1;
+    }
+  pushdata_isfirst =  1;
+
+  SL_RETURN (0, _("sh_hash_writeout"));
+}
 
 
@@ -851,176 +1695,55 @@
  *
  *********************************************************************/
-static sh_file_t *  sh_hash_have_it_int (const char * newname)
+static sh_file_t *  sh_hash_have_it_int (char * newname)
 {
   sh_file_t * p;
-  char hashbuf[KEYBUF_SIZE];
-
-  SL_ENTER(_("sh_hash_have_it_int"));
+
+  SL_ENTER(_("sh_hash_have_it"));
 
   if (newname == NULL)
-    SL_RETURN( (NULL), _("sh_hash_have_it_int"));
-
+    SL_RETURN( (NULL), _("sh_hash_have_it"));
+
+  if (IsInit != 1) 
+    sh_hash_init();
   if (sl_strlen(newname) <= MAX_PATH_STORE) 
     p = hashsearch(newname);
   else 
-    p = hashsearch ( sh_tiger_hash(newname, TIGER_DATA, sl_strlen(newname),
-				   hashbuf, sizeof(hashbuf)) );
+    p = hashsearch ( sh_tiger_hash(newname, TIGER_DATA, sl_strlen(newname)) );
   if (p == NULL) 
-     SL_RETURN( (NULL), _("sh_hash_have_it_int"));
-
-  SL_RETURN( (p), _("sh_hash_have_it_int"));
-}
-
-int sh_hash_have_it (const char * newname)
-{
-  sh_file_t * p;
-  int retval;
-
-  if (IsInit != 1) 
-    sh_hash_init();
-
-  SH_MUTEX_LOCK(mutex_hash);
-
-  retval = 0;
-
-  p = sh_hash_have_it_int (newname);
-
-  if (!p) 
-    retval = (-1);
-  else if ((!SH_FFLAG_ALLIGNORE_SET(p->fflags)) && 
-	   (p->modi_mask & MODI_CHK) != 0 &&
-	   (p->modi_mask & MODI_MOD) != 0)
-    retval = 1;
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  return retval;
-}
-
-int sh_hash_get_it (const char * newname, file_type * tmpFile, char * fileHash)
-{
-  sh_file_t * p;
-  int retval;
-
-  if (IsInit != 1) 
-    sh_hash_init();
-
-  tmpFile->link_path   = NULL;
-  tmpFile->attr_string = NULL;
-
-  SH_MUTEX_LOCK(mutex_hash);
-
-  retval = (-1);
-
-  p = sh_hash_have_it_int (newname);
-  if (p)
-    {
-      sl_strlcpy(tmpFile->fullpath,  p->fullpath, PATH_MAX);
-      if (p->linkpath)
-	tmpFile->link_path = sh_util_strdup (p->linkpath);
-      tmpFile->size  = p->theFile.size;
-      tmpFile->mtime = p->theFile.mtime;
-      tmpFile->ctime = p->theFile.ctime;
-      tmpFile->atime = p->theFile.atime;
-
-      if (NULL != fileHash)
-	sl_strlcpy(fileHash, p->theFile.checksum, KEY_LEN+1);
-
-      tmpFile->attr_string = NULL;
-      retval = 0;
-    }
-  SH_MUTEX_UNLOCK(mutex_hash);
-
-  return retval;
-}
-
-int sh_hash_getflags (char * filename)
-{
-  sh_file_t * p;
-  int retval = 0;
-
-  if ( sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      if (IsInit != 1) 
-	sh_hash_init();
-      
-      SH_MUTEX_LOCK(mutex_hash);
-      p = sh_hash_have_it_int (filename);
-      if (p)
-	retval = p->fflags;
-      else
-	retval = -1;
-      SH_MUTEX_UNLOCK(mutex_hash);
-    }
-  return retval;
-}
-
-int sh_hash_setflags (char * filename, int flags)
-{
-  sh_file_t * p;
-  int retval = 0;
-
-  if ( sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      if (IsInit != 1) 
-	sh_hash_init();
-      
-      SH_MUTEX_LOCK(mutex_hash);
-      p = sh_hash_have_it_int (filename);
-      if (p)
-	{
-	  p->fflags = flags;
-	  retval = 0;
-	}
-      else
-	retval = -1;
-      SH_MUTEX_UNLOCK(mutex_hash);
-    }
-  return retval;
-}
-
-/* needs lock to be threadsafe
- */
-void sh_hash_set_flag (char * filename, int flag_to_set)
-{
-  sh_file_t * p;
-
-  if ( sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      if (IsInit != 1) 
-	sh_hash_init();
-      
-      SH_MUTEX_LOCK(mutex_hash);
-      p = sh_hash_have_it_int (filename);
-      if (p)
-	{
-	  p->fflags |= flag_to_set;
-	}
-      SH_MUTEX_UNLOCK(mutex_hash);
-    }
-  return;
-}
-
-/* needs lock to be threadsafe
- */
-void sh_hash_clear_flag (char * filename, int flag_to_clear)
-{
-  sh_file_t * p;
-
-  if ( sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      if (IsInit != 1) 
-	sh_hash_init();
-      
-      SH_MUTEX_LOCK(mutex_hash);
-      p = sh_hash_have_it_int (filename);
-      if (p)
-	{
-	  p->fflags &= ~flag_to_clear;
-	}
-      SH_MUTEX_UNLOCK(mutex_hash);
-    }
-  return;
-}
-
+     SL_RETURN( (NULL), _("sh_hash_have_it"));
+  /*
+  if (p->allignore == S_FALSE && 
+      (p->modi_mask & MODI_CHK) != 0 &&
+      (p->modi_mask & MODI_MOD) != 0)
+    SL_RETURN( (1), _("sh_hash_have_it"));
+  */
+  SL_RETURN( (p), _("sh_hash_have_it"));
+}
+
+int sh_hash_have_it (char * newname)
+{
+  sh_file_t * p = sh_hash_have_it_int (newname);
+
+  if (!p) return (-1);
+  if (p->allignore == S_FALSE && 
+      (p->modi_mask & MODI_CHK) != 0 &&
+      (p->modi_mask & MODI_MOD) != 0)
+    return 1;
+  return 0;
+}
+
+int sh_hash_get_it (char * newname, file_type * tmpFile)
+{
+  sh_file_t * p = sh_hash_have_it_int (newname);
+  if (!p)
+    return (-1);
+  sl_strlcpy(tmpFile->fullpath, p->fullpath, PATH_MAX);
+  sl_strlcpy(tmpFile->linkpath, p->linkpath, PATH_MAX);
+  tmpFile->size  = p->theFile.size;
+  tmpFile->mtime = p->theFile.mtime;
+  tmpFile->ctime = p->theFile.ctime;
+  return 0;
+}
+ 
 
 /*****************************************************************
@@ -1034,6 +1757,4 @@
 {
   sh_file_t * p;
-  char hashbuf[KEYBUF_SIZE];
-  int  retval;
 
   SL_ENTER(_("sh_hash_set_visited_int"));
@@ -1041,40 +1762,25 @@
   if (newname == NULL)
     SL_RETURN((-1), _("sh_hash_set_visited_int"));
-
   if (IsInit != 1) 
     sh_hash_init();
-
-  SH_MUTEX_LOCK(mutex_hash);
 
   if (sl_strlen(newname) <= MAX_PATH_STORE) 
     p = hashsearch(newname);
   else 
-    p = hashsearch (sh_tiger_hash(newname, TIGER_DATA, sl_strlen(newname),
-				  hashbuf, sizeof(hashbuf)));
+    p = hashsearch (sh_tiger_hash(newname, TIGER_DATA, sl_strlen(newname)));
   
-  if (p)
-    {
-      if (flag == SH_FFLAG_CHECKED)
-	{
-	  CLEAR_SH_FFLAG_REPORTED(p->fflags);
-	  CLEAR_SH_FFLAG_VISITED(p->fflags);
-	  SET_SH_FFLAG_CHECKED(p->fflags);
-	}
-      else
-	{
-	  SET_SH_FFLAG_VISITED(p->fflags);
-	  CLEAR_SH_FFLAG_CHECKED(p->fflags);
-	  if (flag == SH_FFLAG_REPORTED)
-	    SET_SH_FFLAG_REPORTED(p->fflags);
-	  else
-	    CLEAR_SH_FFLAG_REPORTED(p->fflags);
-	}
-      retval = 0;
-    }
-  else
-    retval = -1;
-
-  SH_MUTEX_UNLOCK(mutex_hash);
-  SL_RETURN((retval), _("sh_hash_set_visited_int"));
+  if (p == NULL) 
+    SL_RETURN((-1), _("sh_hash_set_visited_int"));
+  if (flag == 99)
+    {
+      p->visited  = 99;
+      p->reported = S_FALSE;
+    }
+  else
+    {
+      p->visited  = S_TRUE;
+      p->reported = flag;
+    }
+  SL_RETURN((0), _("sh_hash_set_visited_int"));
 }
 
@@ -1085,33 +1791,22 @@
 {
   int i;
-  SL_ENTER(_("sh_hash_set_missing"));
-
-  i = sh_hash_set_visited_int(newname, SH_FFLAG_CHECKED);
-
-  if (sh.flag.checkSum != SH_CHECK_INIT) {
-    sh_hash_remove(newname);
-  }
-
-  SL_RETURN(i, _("sh_hash_set_missing"));
-}
-
-/* mark the file as visited and reported
- */
+  SL_ENTER(_("sh_hash_set_visited"));
+  i = sh_hash_set_visited_int(newname, 99);
+  SL_RETURN(i, _("sh_hash_set_visited"));
+}
+
 int sh_hash_set_visited (char * newname)
 {
   int i;
   SL_ENTER(_("sh_hash_set_visited"));
-  i = sh_hash_set_visited_int(newname, SH_FFLAG_REPORTED);
+  i = sh_hash_set_visited_int(newname, S_TRUE);
   SL_RETURN(i, _("sh_hash_set_visited"));
 }
 
-/* mark the file as visited and NOT reported
- * used to avoid deletion of file from internal database
- */
 int sh_hash_set_visited_true (char * newname)
 {
   int i;
   SL_ENTER(_("sh_hash_set_visited_true"));
-  i = sh_hash_set_visited_int(newname, 0);
+  i = sh_hash_set_visited_int(newname, S_FALSE);
   SL_RETURN(i, _("sh_hash_set_visited_true"));
 }
@@ -1124,66 +1819,76 @@
  ******************************************************************/
 
-void sh_hash_push2db (const char * key, struct store2db * save)
-{
+static char * sh_hash_charhex( unsigned char i )
+{
+  static char i2h[2];
+  int j, k;
+
+  j = i / 16;
+  k = i - (j*16);
+
+  if (j < 10) i2h[0] = '0'+j;
+  else        i2h[0] = 'A'+(j-10);
+  
+  if (k < 10) i2h[1] = '0'+k;
+  else        i2h[1] = 'A'+(k-10);
+
+  return i2h;
+}
+
+void sh_hash_push2db (char * key, unsigned long val1, 
+		      unsigned long val2, unsigned long val3,
+		      unsigned char * str, int size)
+{
+  file_type   tmpFile;
   int         i = 0;
   char      * p;
-  char        i2h[2];
-  file_type * tmpFile = SH_ALLOC(sizeof(file_type));
-
-  int size            = save->size;
-  unsigned char * str = save->str;
-
-
-  tmpFile->attr_string = NULL;
-  tmpFile->link_path   = NULL;
-
-  sl_strlcpy(tmpFile->fullpath, key, PATH_MAX);
-  tmpFile->size  = save->val0;
-  tmpFile->mtime = save->val1;
-  tmpFile->ctime = save->val2;
-  tmpFile->atime = save->val3;
-
-  tmpFile->mode  = 0;
-  tmpFile->owner = 0;
-  tmpFile->group = 0;
-  sl_strlcpy(tmpFile->c_owner, _("root"), 5);
-  sl_strlcpy(tmpFile->c_group, _("root"), 5);
-
-  tmpFile->check_flags = 0;
+
+  sl_strlcpy(tmpFile.fullpath, key, PATH_MAX);
+  tmpFile.size  = val1;
+  tmpFile.mtime = val2;
+  tmpFile.ctime = val3;
+
+  tmpFile.atime = 0;
+  tmpFile.mode  = 0;
+  tmpFile.owner = 0;
+  tmpFile.group = 0;
+  sl_strlcpy(tmpFile.c_owner, _("root"), 5);
+  sl_strlcpy(tmpFile.c_group, _("root"), 5);
 
   if ((str != NULL) && (size < (PATH_MAX/2)-1))
     {
-      tmpFile->c_mode[0] = 'l';  
-      tmpFile->c_mode[1] = 'r'; tmpFile->c_mode[2]  = 'w';
-      tmpFile->c_mode[3] = 'x'; tmpFile->c_mode[4]  = 'r'; 
-      tmpFile->c_mode[5] = 'w'; tmpFile->c_mode[6]  = 'x'; 
-      tmpFile->c_mode[7] = 'r'; tmpFile->c_mode[8]  = 'w'; 
-      tmpFile->c_mode[9] = 'x'; tmpFile->c_mode[10] = '\0';
-      tmpFile->link_path = SH_ALLOC((size * 2) + 2);
+      tmpFile.c_mode[0] = 'l';  
+      tmpFile.c_mode[1] = 'r'; tmpFile.c_mode[2]  = 'w';
+      tmpFile.c_mode[3] = 'x'; tmpFile.c_mode[4]  = 'r'; 
+      tmpFile.c_mode[5] = 'w'; tmpFile.c_mode[6]  = 'x'; 
+      tmpFile.c_mode[7] = 'r'; tmpFile.c_mode[8]  = 'w'; 
+      tmpFile.c_mode[9] = 'x'; tmpFile.c_mode[10] = '\0'; 
       for (i = 0; i < size; ++i)
 	{
-	  p = sh_util_charhex (str[i],i2h);
-	  tmpFile->link_path[2*i]   = p[0];
-	  tmpFile->link_path[2*i+1] = p[1];
-	  tmpFile->link_path[2*i+2] = '\0';
-	}
-    }
-  else
-    {
-      for (i = 0; i < 10; ++i) 
-	tmpFile->c_mode[i] = '-';
-      tmpFile->c_mode[10] = '\0';
-      tmpFile->link_path = sh_util_strdup("-");
-    }
-
-  if (sh.flag.checkSum == SH_CHECK_INIT)
-    sh_dbIO_data_write (tmpFile, 
-			(save->checksum[0] == '\0') ? SH_KEY_NULL : save->checksum);
-  else
-    sh_hash_pushdata_memory (tmpFile, 
-			     (save->checksum[0] == '\0') ? SH_KEY_NULL : save->checksum);
-
-  if (tmpFile->link_path) SH_FREE(tmpFile->link_path);
-  SH_FREE(tmpFile);
+	  p = sh_hash_charhex (str[i]);
+	  tmpFile.linkpath[2*i]   = p[0];
+	  tmpFile.linkpath[2*i+1] = p[1];
+	  tmpFile.linkpath[2*i+2] = '\0';
+	}
+    }
+  else
+    {
+      tmpFile.c_mode[0] = '-';  
+      tmpFile.c_mode[1] = '-'; tmpFile.c_mode[2]  = '-';
+      tmpFile.c_mode[3] = '-'; tmpFile.c_mode[4]  = '-'; 
+      tmpFile.c_mode[5] = '-'; tmpFile.c_mode[6]  = '-'; 
+      tmpFile.c_mode[7] = '-'; tmpFile.c_mode[8]  = '-'; 
+      tmpFile.c_mode[9] = '-'; tmpFile.c_mode[10] = '\0'; 
+      tmpFile.linkpath[0] = '-'; tmpFile.linkpath[1] = '\0';
+    }
+
+  if (sh.flag.checkSum == SH_CHECK_CHECK && 
+      sh.flag.update == S_TRUE)
+    sh_hash_pushdata_memory (&tmpFile, 
+			     _("000000000000000000000000000000000000000000000000"));
+  else
+    sh_hash_pushdata (&tmpFile, 
+		      _("000000000000000000000000000000000000000000000000"));
+
   return;
 }
@@ -1191,59 +1896,55 @@
 extern int sh_util_hextobinary (char * binary, char * hex, int bytes);
 
-char * sh_hash_db2pop (const char * key, struct store2db * save)
-{
+char * sh_hash_db2pop (char * key, unsigned long * val1, 
+		       unsigned long * val2, unsigned long * val3,
+		       int * size)
+{
+  file_type   tmpFile;
   size_t      len;
   char      * p;
   int         i;
-  char      * retval = NULL;
-  char        fileHash[KEY_LEN+1];
-  file_type * tmpFile = SH_ALLOC(sizeof(file_type));
-  
-  save->size = 0;
-
-  if (0 == sh_hash_get_it (key, tmpFile, fileHash))
-    {
-      save->val0 = tmpFile->size;
-      save->val1 = tmpFile->mtime;
-      save->val2 = tmpFile->ctime;
-      save->val3 = tmpFile->atime;
-
-      sl_strlcpy(save->checksum, fileHash, KEY_LEN+1);
-
-      if (tmpFile->link_path && tmpFile->link_path[0] != '-')
-	{
-	  len = strlen(tmpFile->link_path);
+
+  *size = 0;
+
+  if (0 == sh_hash_get_it (key, &tmpFile))
+    {
+      *val1  = tmpFile.size;
+      *val2 = tmpFile.mtime;
+      *val3 = tmpFile.ctime;
+
+      if (tmpFile.linkpath[0] != '-')
+	{
+	  len = strlen(tmpFile.linkpath);
 
 	  p = SH_ALLOC((len/2)+1);
-	  i = sh_util_hextobinary (p, tmpFile->link_path, len);
+	  i = sh_util_hextobinary (p, tmpFile.linkpath, len);
 
 	  if (i == 0)
 	    {
-	      save->size = (len/2);
-	      p[save->size] = '\0';
-	      retval = p;
+	      *size = (len/2);
+	      p[*size] = '\0';
+	      return p;
 	    }
 	  else
 	    {
 	      SH_FREE(p);
-	      save->size = 0;
+	      *size = 0;
+	      return NULL;
 	    }
 	}
       else
 	{
-	  save->size = 0;
-	}
-    }
-  else
-    {
-      save->size = -1;
-      save->val0 = 0;
-      save->val1 = 0;
-      save->val2 = 0;
-      save->val3 = 0;
-    }
-  if (tmpFile->link_path) SH_FREE(tmpFile->link_path);
-  SH_FREE(tmpFile);
-  return retval;
+	  *size = 0;
+	  return NULL;
+	}
+    }
+  else
+    {
+      *size = -1;
+      *val1 =  0;
+      *val2 =  0;
+      *val3 =  0;
+      return NULL;
+    }
 }
 
@@ -1258,40 +1959,28 @@
 sh_file_t * sh_hash_push_int (file_type * buf, char * fileHash)
 {
-  sh_file_t    * fp = NULL;
+  sh_file_t    * fp;
   sh_filestore_t p;
-
-  size_t len;
+  long i;
   char * fullpath;
   char * linkpath;
-  char * attr_string = NULL;
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_hash_push_int"));
 
-  if (!buf)
-    SL_RETURN(NULL, _("sh_hash_push_int"));
-    
   fp = SH_ALLOC(sizeof(sh_file_t));
 
   p.mark = REC_MAGIC;
-  if (buf->attr_string)
-    p.mark |= REC_FLAGS_ATTR;
   sl_strlcpy(p.c_mode,   buf->c_mode,   11);
   sl_strlcpy(p.c_group,  buf->c_group,  GROUP_MAX+1);
   sl_strlcpy(p.c_owner,  buf->c_owner,  USER_MAX+1);
   sl_strlcpy(p.checksum, fileHash,      KEY_LEN+1);
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
   sl_strlcpy(p.c_attributes, buf->c_attributes, 13);
 #endif
 
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
   p.attributes  = (UINT32) buf->attributes;
-#else
-  p.attributes  = (UINT32) 0;
 #endif
   p.linkmode    = (UINT32) buf->linkmode;
   p.hardlinks   = (UINT32) buf->hardlinks;
-  p.dev   = (UINT64) buf->dev;
-  p.rdev  = (UINT64) buf->rdev;
   p.mode  = (UINT32) buf->mode;
   p.ino   = (UINT32) buf->ino;
@@ -1303,19 +1992,15 @@
   p.group = (UINT32) buf->group;
 
-  p.checkflags = (UINT32) buf->check_flags;
-
   memcpy( &(*fp).theFile, &p, sizeof(sh_filestore_t) );
-  fp->fflags    = 0;  /* init fflags */
+  fp->visited   = S_FALSE;
+  fp->reported  = S_FALSE;
+  fp->allignore = S_FALSE;
   fp->modi_mask = 0L;
 
-  if (buf->attr_string)
-    attr_string = sh_util_strdup(buf->attr_string);
-  fp->attr_string = attr_string;
-
-  len = sl_strlen(buf->fullpath);
-  if (len <= MAX_PATH_STORE) 
-    {
-      fullpath = SH_ALLOC(len+1);
-      sl_strlcpy(fullpath, buf->fullpath, len+1);
+  i = sl_strlen(buf->fullpath);
+  if (i <= MAX_PATH_STORE) 
+    {
+      fullpath = SH_ALLOC(i+ 1);
+      sl_strlcpy(fullpath, buf->fullpath, i+1);
     } 
   else 
@@ -1323,17 +2008,16 @@
       fullpath = SH_ALLOC(KEY_LEN + 1);
       sl_strlcpy(fullpath, 
-		 sh_tiger_hash (buf->fullpath, TIGER_DATA, len,
-				hashbuf, sizeof(hashbuf)), 
+		 sh_tiger_hash (buf->fullpath, TIGER_DATA, i), 
 		 KEY_LEN+1);
     }
   fp->fullpath  = fullpath;
 
-  if (buf->link_path)
+  if (buf->c_mode[0] == 'l')
     {  
-      len = sl_strlen(buf->link_path);
-      if (len <= MAX_PATH_STORE) 
-	{
-	  linkpath = SH_ALLOC(len+1);
-	  sl_strlcpy(linkpath, buf->link_path, len+1);
+      i = sl_strlen(buf->linkpath);
+      if (i <= MAX_PATH_STORE) 
+	{
+	  linkpath = SH_ALLOC(i+ 1);
+	  sl_strlcpy(linkpath, buf->linkpath, i+1);
 	} 
       else 
@@ -1341,6 +2025,5 @@
 	  linkpath = SH_ALLOC(KEY_LEN + 1);
 	  sl_strlcpy(linkpath, 
-		     sh_tiger_hash (buf->link_path, TIGER_DATA, len,
-				    hashbuf, sizeof(hashbuf)), 
+		     sh_tiger_hash (buf->linkpath, TIGER_DATA, i), 
 		     KEY_LEN+1);
 	}
@@ -1361,10 +2044,6 @@
 #endif
 
-#ifndef PRIu64
-#ifdef  HAVE_LONG_32
-#define PRIu64 "llu"
-#else
-#define PRIu64 "lu"
-#endif
+#ifndef PRIi64
+#define PRIi64 "lld"
 #endif
 
@@ -1378,8 +2057,8 @@
 #ifdef SH_USE_XML
   sl_snprintf(form_rval, 80, _("%s%s%s%s%s"), 
-	      _("size_old=\"%"), PRIu64, _("\" size_new=\"%"), PRIu64, "\" ");
+	      _("size_old=\"%"), PRIi64, _("\" size_new=\"%"), PRIi64, "\" ");
 #else
   sl_snprintf(form_rval, 80, _("%s%s%s%s%s"), 
-	      _("size_old=<%"), PRIu64, _(">, size_new=<%"), PRIu64, ">, ");
+	      _("size_old=<%"), PRIi64, _(">, size_new=<%"), PRIi64, ">, ");
 #endif
 
@@ -1398,27 +2077,17 @@
   char * format;
 
-  char * tmp = SH_ALLOC(SH_MSG_BUF);
-  char * msg = SH_ALLOC(SH_MSG_BUF);
+  char * tmp = SH_ALLOC(SH_BUFSIZE);
+  char * msg = SH_ALLOC(SH_BUFSIZE);
 
   tmp[0] = '\0';
   msg[0] = '\0';
 
-  if (report_checkflags != S_FALSE)
-    {
-      if (is_new)
-	format = _("checkflags_new=\"0%lo\" ");
-      else
-	format = _("checkflags_old=\"0%lo\" ");
-      sl_snprintf(tmp, SH_MSG_BUF, format,
-		  (unsigned long) theFile->check_flags);
-      sl_strlcat(msg, tmp, SH_MSG_BUF); 
-    }
-
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+
+#if defined(__linux__)
   if (is_new)
     format = _("mode_new=\"%s\" attr_new=\"%s\" imode_new=\"%ld\" iattr_new=\"%ld\" ");
   else 
     format = _("mode_old=\"%s\" attr_old=\"%s\" imode_old=\"%ld\" iattr_old=\"%ld\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_mode,
 	      theFile->c_attributes,
@@ -1432,48 +2101,34 @@
     format = _("mode_old=\"%s\" imode_old=\"%ld\" ");
 
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_mode,
 	      (long) theFile->mode
 	      );
 #endif
-  sl_strlcat(msg, tmp, SH_MSG_BUF);
+  sl_strlcat(msg, tmp, SH_BUFSIZE);
 
   if (is_new)
-    format = _("hardlinks_new=\"%lu\" ");
-  else
-    format = _("hardlinks_old=\"%lu\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+    format = _("hardlinks_new=\"%ld\" ");
+  else
+    format = _("hardlinks_old=\"%ld\" ");
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      (unsigned long) theFile->hardlinks);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    format = _("idevice_new=\"%lu\" ");
-  else
-    format = _("idevice_old=\"%lu\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+    format = _("idevice_new=\"%ld\" ");
+  else
+    format = _("idevice_old=\"%ld\" ");
+  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    format = _("inode_new=\"%lu\" ");
-  else
-    format = _("inode_old=\"%lu\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  /* 
-   * also report device for prelude
-   */
-#if defined(HAVE_LIBPRELUDE)
-  if (is_new)
-    format = _("dev_new=\"%lu,%lu\" ");
-  else
-    format = _("dev_old=\"%lu,%lu\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,		      
-	      (unsigned long) major(theFile->dev),
-	      (unsigned long) minor(theFile->dev));
-  sl_strlcat(msg, tmp, SH_MSG_BUF);
-#endif
+    format = _("inode_new=\"%ld\" ");
+  else
+    format = _("inode_old=\"%ld\" ");
+  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
@@ -1482,7 +2137,7 @@
   else
     format = _("owner_old=\"%s\" iowner_old=\"%ld\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_owner, (long) theFile->owner);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
@@ -1491,74 +2146,58 @@
   else
     format = _("group_old=\"%s\" igroup_old=\"%ld\" ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_group, (long) theFile->group);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
+    sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
 		(UINT64) 0, (UINT64) theFile->size);
   else
-    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
+    sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
 		(UINT64) theFile->size, (UINT64) 0);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-
-  (void) sh_unix_gmttime (theFile->ctime, timstr1c,  sizeof(timstr1c));
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+
+  sl_strlcpy (timstr1c, sh_unix_gmttime (theFile->ctime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=\"%s\" "), timstr1c);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" "), timstr1c);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  (void) sh_unix_gmttime (theFile->atime, timstr1a,  sizeof(timstr1a));
+    sl_snprintf(tmp, SH_BUFSIZE, _("ctime_new=\"%s\" "), timstr1c);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=\"%s\" "), timstr1c);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  sl_strlcpy (timstr1a, sh_unix_gmttime (theFile->atime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=\"%s\" "), timstr1a);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" "), timstr1a);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  (void) sh_unix_gmttime (theFile->mtime, timstr1m,  sizeof(timstr1m));
+    sl_snprintf(tmp, SH_BUFSIZE, _("atime_new=\"%s\" "), timstr1a);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=\"%s\" "), timstr1a);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  sl_strlcpy (timstr1m, sh_unix_gmttime (theFile->mtime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=\"%s\" "), timstr1m);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" "), timstr1m);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+    sl_snprintf(tmp, SH_BUFSIZE, _("mtime_new=\"%s\" "), timstr1m);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=\"%s\" "), timstr1m);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=\"%s\" "), fileHash);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=\"%s\" "), fileHash);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  if (theFile->c_mode[0] == 'l' || 
-      (theFile->link_path != NULL && theFile->link_path[0] != '-'))
-    {
-      tmp_lnk     = sh_util_safe_name(theFile->link_path);
+    sl_snprintf(tmp, SH_BUFSIZE, _("chksum_new=\"%s\" "), fileHash);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("chksum_old=\"%s\" "), fileHash);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  if (theFile->c_mode[0] == 'l')
+    {
+      tmp_lnk     = sh_util_safe_name(theFile->linkpath);
       if (tmp_lnk)
 	{
 	  if (is_new)
-	    sl_snprintf(tmp, SH_MSG_BUF, _("link_new=\"%s\" "), tmp_lnk);
+	    sl_snprintf(tmp, SH_BUFSIZE, _("link_new=\"%s\" "), tmp_lnk);
 	  else
-	    sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" "), tmp_lnk);
+	    sl_snprintf(tmp, SH_BUFSIZE, _("link_old=\"%s\" "), tmp_lnk);
 	  SH_FREE(tmp_lnk);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF);
+	  sl_strlcat(msg, tmp, SH_BUFSIZE);
 	} 
     }
-
-  if (theFile->attr_string)
-    {
-      tmp_lnk     = sh_util_safe_name(theFile->attr_string);
-      if (tmp_lnk)
-	{
-	  if (is_new)
-	    sl_snprintf(tmp, SH_MSG_BUF, _("acl_new=\"%s\" "), tmp_lnk);
-	  else
-	    sl_snprintf(tmp, SH_MSG_BUF, _("acl_old=\"%s\" "), tmp_lnk);
-	  SH_FREE(tmp_lnk);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF);
-	} 
-    }
-
   
   SH_FREE(tmp);
@@ -1575,28 +2214,17 @@
   char * format;
 
-  char * tmp = SH_ALLOC(SH_MSG_BUF);
-  char * msg = SH_ALLOC(SH_MSG_BUF);
+  char * tmp = SH_ALLOC(SH_BUFSIZE);
+  char * msg = SH_ALLOC(SH_BUFSIZE);
 
   tmp[0] = '\0';
   msg[0] = '\0';
 
-  if (report_checkflags == S_TRUE)
-    {
-      if (is_new)
-	format = _("checkflags_new=<0%lo> ");
-      else
-	format = _("checkflags_old=<0%lo> ");
-      sl_snprintf(tmp, SH_MSG_BUF, format,
-		  (unsigned long) theFile->check_flags);
-      sl_strlcat(msg, tmp, SH_MSG_BUF); 
-    }
-
-
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+
+#if defined(__linux__)
   if (is_new)
     format = _("mode_new=<%s>, attr_new=<%s>, imode_new=<%ld>, iattr_new=<%ld>, ");
   else 
     format = _("mode_old=<%s>, attr_old=<%s>, imode_old=<%ld>, iattr_old=<%ld>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_mode,
 	      theFile->c_attributes,
@@ -1610,49 +2238,35 @@
     format = _("mode_old=<%s>, imode_old=<%ld>, ");
 
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_mode,
 	      (long) theFile->mode
 	      );
 #endif
-  sl_strlcat(msg, tmp, SH_MSG_BUF);
+  sl_strlcat(msg, tmp, SH_BUFSIZE);
 
   if (is_new)
-    format = _("hardlinks_new=<%lu>, ");
-  else
-    format = _("hardlinks_old=<%lu>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+    format = _("hardlinks_new=<%ld>, ");
+  else
+    format = _("hardlinks_old=<%ld>, ");
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      (unsigned long) theFile->hardlinks);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    format = _("idevice_new=<%lu>, ");
-  else
-    format = _("idevice_old=<%lu>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->rdev);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+    format = _("idevice_new=<%ld>, ");
+  else
+    format = _("idevice_old=<%ld>, ");
+  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->rdev);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    format = _("inode_new=<%lu>, ");
-  else
-    format = _("inode_old=<%lu>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format, (unsigned long) theFile->ino);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-
-  /* 
-   * also report device for prelude
-   */
-#if defined(HAVE_LIBPRELUDE)
-  if (is_new)
-    format = _("dev_new=<%lu,%lu>, ");
-  else
-    format = _("dev_old=<%lu,%lu>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,		      
-	      (unsigned long) major(theFile->dev),
-	      (unsigned long) minor(theFile->dev));
-  sl_strlcat(msg, tmp, SH_MSG_BUF);
-#endif
+    format = _("inode_new=<%ld>, ");
+  else
+    format = _("inode_old=<%ld>, ");
+  sl_snprintf(tmp, SH_BUFSIZE, format, (unsigned long) theFile->ino);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
 
   if (is_new)
@@ -1660,7 +2274,7 @@
   else
     format = _("owner_old=<%s>, iowner_old=<%ld>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_owner, (long) theFile->owner);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
@@ -1669,74 +2283,59 @@
   else
     format = _("group_old=<%s>, igroup_old=<%ld>, ");
-  sl_snprintf(tmp, SH_MSG_BUF, format,
+  sl_snprintf(tmp, SH_BUFSIZE, format,
 	      theFile->c_group, (long) theFile->group);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
 
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
+    sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
 		(UINT64) 0, (UINT64) theFile->size);
   else
-    sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
+    sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
 		(UINT64) theFile->size, (UINT64) 0);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-
-  (void) sh_unix_gmttime (theFile->ctime, timstr1c,  sizeof(timstr1c));
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+
+  sl_strlcpy (timstr1c, sh_unix_gmttime (theFile->ctime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_new=<%s>, "), timstr1c);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, "), timstr1c);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  (void) sh_unix_gmttime (theFile->atime, timstr1a,  sizeof(timstr1a));
+    sl_snprintf(tmp, SH_BUFSIZE, _("ctime_new=<%s>, "), timstr1c);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=<%s>, "), timstr1c);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  sl_strlcpy (timstr1a, sh_unix_gmttime (theFile->atime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("atime_new=<%s>, "), timstr1a);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, "), timstr1a);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  (void) sh_unix_gmttime (theFile->mtime, timstr1m,  sizeof(timstr1m));
+    sl_snprintf(tmp, SH_BUFSIZE, _("atime_new=<%s>, "), timstr1a);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=<%s>, "), timstr1a);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  sl_strlcpy (timstr1m, sh_unix_gmttime (theFile->mtime),   32);
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_new=<%s>, "), timstr1m);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, "), timstr1m);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
+    sl_snprintf(tmp, SH_BUFSIZE, _("mtime_new=<%s>, "), timstr1m);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=<%s>, "), timstr1m);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
 
   if (is_new)
-    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_new=<%s>"), fileHash);
-  else
-    sl_snprintf(tmp, SH_MSG_BUF, _("chksum_old=<%s>"), fileHash);
-  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-  if (theFile->c_mode[0] == 'l' || 
-      (theFile->link_path != NULL && theFile->link_path[0] != '-'))
-    {
-      tmp_lnk     = sh_util_safe_name(theFile->link_path);
+    sl_snprintf(tmp, SH_BUFSIZE, _("chksum_new=<%s>"), fileHash);
+  else
+    sl_snprintf(tmp, SH_BUFSIZE, _("chksum_old=<%s>"), fileHash);
+  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+  if (theFile->c_mode[0] == 'l')
+    {
+      tmp_lnk     = sh_util_safe_name(theFile->linkpath);
       if (tmp_lnk)
 	{
 	  if (is_new)
-	    sl_snprintf(tmp, SH_MSG_BUF, _(", link_new=<%s> "), tmp_lnk);
+	    sl_snprintf(tmp, SH_BUFSIZE, _(", link_new=<%s> "), tmp_lnk);
 	  else
-	    sl_snprintf(tmp, SH_MSG_BUF, _(", link_old=<%s> "), tmp_lnk);
+	    sl_snprintf(tmp, SH_BUFSIZE, _(", link_old=<%s> "), tmp_lnk);
 	  SH_FREE(tmp_lnk);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF);
+	  sl_strlcat(msg, tmp, SH_BUFSIZE);
 	} 
     }
   
-  if (theFile->attr_string)
-    {
-      tmp_lnk     = sh_util_safe_name(theFile->attr_string);
-      if (tmp_lnk)
-	{
-	  if (is_new)
-	    sl_snprintf(tmp, SH_MSG_BUF, _(", acl_new=<%s> "), tmp_lnk);
-	  else
-	    sl_snprintf(tmp, SH_MSG_BUF, _(", acl_old=<%s> "), tmp_lnk);
-	  SH_FREE(tmp_lnk);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF);
-	} 
-    }
-
   SH_FREE(tmp);
   return (msg);
@@ -1753,8 +2352,6 @@
   if (p) 
     {
-      SH_MUTEX_LOCK(mutex_hash);
-      hashinsert (tab, p);
-      p->modi_mask = theFile->check_flags;
-      SH_MUTEX_UNLOCK(mutex_hash);
+      hashinsert (p);
+      p->modi_mask = theFile->check_mask;
     }
 
@@ -1762,108 +2359,4 @@
 }
 
-int sh_hash_is_null_file(file_type * theFile)
-{
-  if (theFile->hardlinks == SH_DEADFILE && theFile->mode  == 0 &&
-      theFile->ino == 0                 && theFile->ctime == 0)
-    {
-      return S_TRUE;
-    }
-  return S_FALSE;
-}
-
-int sh_hash_is_null_record(sh_filestore_t * theFile)
-{
-  if (theFile->hardlinks == SH_DEADFILE && theFile->mode  == 0 &&
-      theFile->ino == 0                 && theFile->ctime == 0)
-    {
-      return S_TRUE;
-    }
-  return S_FALSE;
-}
-
-void sh_hash_insert_null(char * str)
-{
-  file_type theFile = { 0, 0, {'\0'}, 0, 0, 0, 0, 0, 
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-			0, {'\0'},
-#endif
-			{'\0'}, 0, {'\0'}, 0, {'\0'}, 
-			0, 0, 0, 0, 0, 0, 0, NULL,  0, {'\0'}, 0, NULL
-  }; /* clang compiler bails out on standard conforming init with just {0} */
-  char      fileHash[KEY_LEN+1];
-  char      hashbuf[KEYBUF_SIZE];
-
-  sl_strlcpy(fileHash, SH_KEY_NULL, sizeof(fileHash));
-  theFile.hardlinks = SH_DEADFILE;
-
-  if (sl_strlen(str) < PATH_MAX)
-    sl_strlcpy(theFile.fullpath, str, PATH_MAX);
-  else 
-     sl_strlcpy(theFile.fullpath, 
-		sh_tiger_hash(str, TIGER_DATA, sl_strlen(str),
-			      hashbuf, sizeof(hashbuf)),
-		PATH_MAX);
-
-  sh_hash_pushdata_memory(&theFile, fileHash);
-  return;
-}
-
-static int handle_notfound(int  log_severity, int class,
-			   file_type * theFile, char * fileHash)
-{
-  sh_file_t * p;
-  int         retval = 0;
-
-  if (!theFile)
-    return retval;
-  
-  if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
-    {
-      char * tmp = sh_util_safe_name(theFile->fullpath);
-      char * str;
-
-      sh_files_fixup_mask(class, &(theFile->check_flags));
-      str = all_items (theFile, fileHash, 1);
-      
-      if (!sh_global_check_silent)
-	sh_error_handle (log_severity, FIL__, __LINE__, 0, 
-			 MSG_FI_ADD2, 
-			 tmp, str);
-      ++sh.statistics.files_report;
-      SH_FREE(str);
-      SH_FREE(tmp);
-    }
-  
-  if (sh.flag.reportonce == S_TRUE)
-    SET_SH_FFLAG_REPORTED(theFile->file_reported);
-  
-  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
-    {
-      p = sh_hash_push_int(theFile, fileHash);
-      if (p)
-	{
-	  hashinsert (tab, p);
-	  p->modi_mask = theFile->check_flags;
-	  p->theFile.checkflags = p->modi_mask;
-	}
-    }
-  
-  else if (S_TRUE == sh.flag.update)
-    {
-      if (S_TRUE == sh_util_ask_update (theFile->fullpath))
-	{
-	  p = sh_hash_push_int(theFile, fileHash);
-	  if (p)
-	    {
-	      hashinsert (tab, p);
-	      p->modi_mask = theFile->check_flags;
-	      p->theFile.checkflags = p->modi_mask;
-	    }
-	}
-      else
-	retval = 1;
-    }
-  return retval;
-}
 
 /*****************************************************************
@@ -1881,4 +2374,6 @@
   char * tmp_lnk;
   char * tmp_lnk_old;
+
+  char * str;
 
   char timstr1c[32];
@@ -1889,29 +2384,17 @@
   char timstr2m[32];
   char linkHash[KEY_LEN+1];
-  char * linkComp;
   int  maxcomp;
-  volatile int  checksum_flag = 0;
 
   char change_code[16];
   int  i;
 
-  unsigned long modi_mask;
+  unsigned long modi_mask = 0;
 
   char log_policy[32];
-  volatile int  log_severity;
-  char hashbuf[KEYBUF_SIZE];
-  struct {
-    unsigned long oldflags;
-    unsigned long newflags;
-  } cf_report;
-
-  int  retval;
+  int  log_severity;
 
   SL_ENTER(_("sh_hash_compdata"));
 
-  if (!theFile)
-    SL_RETURN(0, _("sh_hash_compdata"));
-
- if (IsInit != 1) sh_hash_init();
+  if (IsInit != 1) sh_hash_init();
 
   if (severity_override < 0)
@@ -1924,9 +2407,4 @@
 
   /* --------  find the entry for the file ----------------       */
-
-  SH_MUTEX_LOCK(mutex_hash);
-
-  modi_mask = 0;
-  retval    = 0;
 
   if (sl_strlen(theFile->fullpath) <= MAX_PATH_STORE) 
@@ -1935,6 +2413,5 @@
     p = hashsearch( sh_tiger_hash(theFile->fullpath, 
 				  TIGER_DATA, 
-				  sl_strlen(theFile->fullpath),
-				  hashbuf, sizeof(hashbuf))
+				  sl_strlen(theFile->fullpath))
 		    );
 
@@ -1945,24 +2422,44 @@
   if (p == NULL) 
     {
-      retval = handle_notfound(log_severity, class, theFile, fileHash);
-      goto unlock_and_return;
-    }
-
-  /* ---------  Skip if we don't want to report changes. ------------
-   */
-  
-  if (S_TRUE == sh_ignore_chk_mod(theFile->fullpath))
-    {
-      MODI_SET(theFile->check_flags, MODI_NOCHECK);
-      p->modi_mask = theFile->check_flags;
-      p->theFile.checkflags = p->modi_mask;
-      goto unlock_and_return;
-    }
-
-  cf_report.oldflags = p->theFile.checkflags;
-  cf_report.newflags = theFile->check_flags;
-
-  p->modi_mask = theFile->check_flags;
-  p->theFile.checkflags = p->modi_mask;
+      if (sh.flag.reportonce == S_TRUE)
+	{
+	  p = sh_hash_push_int(theFile, fileHash);
+	  hashinsert (p);
+	  if (p)
+	    p->modi_mask = theFile->check_mask;
+
+	}
+
+      if (S_FALSE == sh_ignore_chk_new(theFile->fullpath))
+	{
+	  tmp = sh_util_safe_name(theFile->fullpath);
+
+	  str = all_items (theFile, fileHash, 1);
+	  sh_error_handle (log_severity, FIL__, __LINE__, 0, 
+			   MSG_FI_ADD2, 
+			   tmp, str);
+	  SH_FREE(str);
+
+	  SH_FREE(tmp);
+	}
+
+      if (p)
+	p->visited   = S_TRUE;
+      if (sh.flag.reportonce == S_TRUE)
+	theFile->reported = S_TRUE;
+	
+      if (sh.flag.isdaemon == S_FALSE && sh.flag.update == S_TRUE )
+	{
+	  if (S_FALSE == sh_util_ask_update (theFile->fullpath))
+	    {
+	      SL_RETURN(1, _("sh_hash_compdata"));
+	    } 
+	}
+      SL_RETURN(0, _("sh_hash_compdata"));
+    }
+  else
+    {
+      p->modi_mask = theFile->check_mask;
+    }
 
   /* initialize change_code */
@@ -1974,81 +2471,37 @@
 	theFile->fullpath, fileHash, p->theFile.checksum));
 
-  if ( (fileHash != NULL) &&
-       (strncmp (fileHash, p->theFile.checksum, KEY_LEN) != 0) && 
-       (theFile->check_flags & MODI_CHK) != 0)
-    {
-      checksum_flag = 1;
-      
-      if ((theFile->check_flags & MODI_SGROW) == 0)
-	{
-	  modi_mask |= MODI_CHK;
-	  change_code[0] = 'C';
-	  TPT ((0, FIL__, __LINE__, _("mod=<checksum>")));
-	}
-      else
-	{
-	  if (0 != strncmp (&fileHash[KEY_LEN + 1], p->theFile.checksum, KEY_LEN))
-	    {
-	      if (S_FALSE == sh_check_rotated_log (theFile->fullpath, (UINT64) p->theFile.size, 
-						   (UINT64) p->theFile.ino, p->theFile.checksum,
-						   p->theFile.checkflags))
-		{
-		  modi_mask |= MODI_CHK;
-		  change_code[0] = 'C';
-		  TPT ((0, FIL__, __LINE__, _("mod=<checksum>")));
-		}
-	      else
-		{
-		  /* logfile has been rotated */
-		  p->theFile.size  = theFile->size;
-		  p->theFile.ino   = theFile->ino;
-		  sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
-		}
-	    }
-	  else
-	    {
-	      p->theFile.size  = theFile->size;
-	      sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
-	    }
-	}
+  if ( (fileHash != NULL) && (p->theFile.checksum != NULL)   && 
+       (strncmp (fileHash, p->theFile.checksum, 50) != 0) && 
+       (theFile->check_mask & MODI_CHK) != 0)
+    {
+      modi_mask |= MODI_CHK;
+      change_code[0] = 'C';
+      TPT ((0, FIL__, __LINE__, _("mod=<checksum>")));
     } 
 
   if (p->theFile.c_mode[0] == 'l') 
     {
-      if (!(theFile->link_path) &&
-	  (theFile->check_flags & MODI_LNK) != 0)
-	{
-	  linkComp = NULL;
-	  modi_mask |= MODI_LNK;
-	  change_code[1] = 'L';
-	  TPT ((0, FIL__, __LINE__, _("mod=<link>")));
-	}
-      else
-	{
-	  if (sl_strlen(theFile->link_path) >= MAX_PATH_STORE) 
-	    {
-	      sl_strlcpy(linkHash, 
-			 sh_tiger_hash(theFile->link_path, 
-				       TIGER_DATA,
-				       sl_strlen(theFile->link_path),
-				       hashbuf, sizeof(hashbuf)), 
-			 sizeof(linkHash));
-	      linkComp = linkHash;
-	      maxcomp  = KEY_LEN;
-	    } 
-	  else 
-	    {
-	      linkComp = theFile->link_path;
-	      maxcomp  = MAX_PATH_STORE;
-	    }
-	  
-	  if ( sl_strncmp (linkComp, p->linkpath, maxcomp) != 0 &&
-	       (theFile->check_flags & MODI_LNK) != 0)
-	    {
-	      modi_mask |= MODI_LNK;
-	      change_code[1] = 'L';
-	      TPT ((0, FIL__, __LINE__, _("mod=<link>")));
-	    } 
-	}
+      if (sl_strlen(theFile->linkpath) >= MAX_PATH_STORE) 
+	{
+	  sl_strlcpy(linkHash, 
+		     sh_tiger_hash(theFile->linkpath, 
+				   TIGER_DATA,
+				   sl_strlen(theFile->linkpath)), 
+		     MAX_PATH_STORE+1);
+	  maxcomp = MAX_PATH_STORE;
+	} 
+      else 
+	{
+	  sl_strlcpy(linkHash, theFile->linkpath, KEY_LEN + 1);
+	  maxcomp = KEY_LEN;
+	}
+
+    if ( sl_strncmp (linkHash, p->linkpath, maxcomp) != 0 &&
+	 (theFile->check_mask & MODI_LNK) != 0)
+      {
+	modi_mask |= MODI_LNK;
+	change_code[1] = 'L';
+	TPT ((0, FIL__, __LINE__, _("mod=<link>")));
+      } 
     }
 
@@ -2057,5 +2510,5 @@
       if ( ( major(theFile->rdev) != major((dev_t)p->theFile.rdev) || 
 	     minor(theFile->rdev) != minor((dev_t)p->theFile.rdev) ) &&
-	   (theFile->check_flags & MODI_RDEV) != 0)
+	   (theFile->check_mask & MODI_RDEV) != 0)
 	{
 	  modi_mask |= MODI_RDEV;
@@ -2068,45 +2521,13 @@
    */
   if ( (UINT32) theFile->ino != (UINT32) p->theFile.ino  &&
-       (theFile->check_flags & MODI_INO) != 0)
-    {
-      if ((theFile->check_flags & MODI_SGROW) == 0)
-	{
-	  modi_mask |= MODI_INO;
-	  change_code[3] = 'I';
-	  TPT ((0, FIL__, __LINE__, _("mod=<inode>")));
-	}
-      else
-	{
-	  /* growing log, checksum ok but inode changed 
-	   */
-	  if (checksum_flag == 0)
-	    {
-	      if (S_FALSE == sh_check_rotated_log (theFile->fullpath, (UINT64) p->theFile.size, 
-						   (UINT64) p->theFile.ino, p->theFile.checksum,
-						   p->theFile.checkflags))
-		{
-		  modi_mask |= MODI_INO;
-		  change_code[3] = 'I';
-		  TPT ((0, FIL__, __LINE__, _("mod=<inode>")));
-		}
-	      else
-		{
-		  /* logfile has been rotated */
-		  p->theFile.size  = theFile->size;
-		  p->theFile.ino   = theFile->ino;
-		  sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
-		}
-	    }
-	  else
-	    {
-	      modi_mask |= MODI_INO;
-	      change_code[3] = 'I';
-	      TPT ((0, FIL__, __LINE__, _("mod=<inode>")));
-	    }
-	}
+       (theFile->check_mask & MODI_INO) != 0)
+    {
+      modi_mask |= MODI_INO;
+      change_code[3] = 'I';
+      TPT ((0, FIL__, __LINE__, _("mod=<inode>")));
     } 
     
   if ( theFile->hardlinks != (nlink_t) p->theFile.hardlinks &&
-       (theFile->check_flags & MODI_HLN) != 0)
+       (theFile->check_mask & MODI_HLN) != 0)
     {
       modi_mask |= MODI_HLN;
@@ -2117,18 +2538,9 @@
 
   if ( (  (theFile->mode != p->theFile.mode)
-#if defined(USE_ACL) || defined(USE_XATTR)
-	  || ( (sh_unix_check_selinux|sh_unix_check_acl) &&
-	       ( 
-		(theFile->attr_string == NULL && p->attr_string != NULL) ||
-		(theFile->attr_string != NULL && p->attr_string == NULL) ||
-		(theFile->attr_string != NULL && 0 != strcmp(theFile->attr_string, p->attr_string))
-		)
-	       )
-#endif
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
           || (theFile->attributes != p->theFile.attributes)
 #endif
-	  )
-       && (theFile->check_flags & MODI_MOD) != 0)
+        )
+       && (theFile->check_mask & MODI_MOD) != 0)
     {
       modi_mask |= MODI_MOD;
@@ -2138,5 +2550,5 @@
        * report link path if switch link/no link 
        */
-      if ((theFile->check_flags & MODI_LNK) != 0 &&
+      if ((theFile->check_mask & MODI_LNK) != 0 &&
 	  (theFile->c_mode[0] != p->theFile.c_mode[0]) &&
 	  (theFile->c_mode[0] == 'l' || p->theFile.c_mode[0] == 'l'))
@@ -2149,5 +2561,5 @@
 
   if ( theFile->owner != (uid_t) p->theFile.owner &&
-       (theFile->check_flags & MODI_USR) != 0)
+       (theFile->check_mask & MODI_USR) != 0)
     {
       modi_mask |= MODI_USR;
@@ -2157,5 +2569,5 @@
 
   if ( theFile->group != (gid_t) p->theFile.group &&
-       (theFile->check_flags & MODI_GRP) != 0)
+       (theFile->check_mask & MODI_GRP) != 0)
     {
       modi_mask |= MODI_GRP;
@@ -2166,5 +2578,5 @@
   
   if ( theFile->mtime != (time_t) p->theFile.mtime &&
-       (theFile->check_flags & MODI_MTM) != 0)
+       (theFile->check_mask & MODI_MTM) != 0)
     {
       modi_mask |= MODI_MTM;
@@ -2173,6 +2585,6 @@
     } 
   
-  if ( (theFile->check_flags & MODI_ATM) != 0 &&
-       theFile->atime != (time_t) p->theFile.atime)
+  if ( theFile->atime != (time_t) p->theFile.atime &&
+       (theFile->check_mask & MODI_ATM) != 0)
     {
       modi_mask |= MODI_ATM;
@@ -2186,5 +2598,5 @@
    */
   if ( theFile->ctime != (time_t) p->theFile.ctime &&
-       (theFile->check_flags & MODI_CTM) != 0)
+       (theFile->check_mask & MODI_CTM) != 0)
     {
       modi_mask |= MODI_CTM;
@@ -2194,24 +2606,20 @@
 
   if ( theFile->size != (off_t) p->theFile.size &&
-       (theFile->check_flags & MODI_SIZ) != 0)
-    {
-      if ((theFile->check_flags & MODI_SGROW) == 0 || 
-	  theFile->size < (off_t) p->theFile.size)
+       (theFile->check_mask & MODI_SIZ) != 0)
+    {
+      if (class == SH_LEVEL_LOGGROW && theFile->size < (off_t) p->theFile.size)
 	{
 	  modi_mask |= MODI_SIZ;
 	  change_code[9] = 'S';
 	  TPT ((0, FIL__, __LINE__, _("mod=<size>")));
-	}
+	} 
+      else if (class != SH_LEVEL_LOGGROW)
+	{ 
+	  modi_mask |= MODI_SIZ;
+	  change_code[9] = 'S';
+	  TPT ((0, FIL__, __LINE__, _("mod=<size>")));
+	} 
     }
   change_code[10] = '\0';
-
-  /* --- Directories special case ---
-   */
-  if (p->theFile.c_mode[0] == 'd'                               &&
-      0 == (modi_mask & ~(MODI_SIZ|MODI_ATM|MODI_CTM|MODI_MTM)) && 
-      sh_loosedircheck == S_TRUE)
-    {
-      modi_mask = 0;
-    }
 
   /* --- Report full details. ---
@@ -2219,5 +2627,5 @@
   if (modi_mask != 0 && sh.flag.fulldetail == S_TRUE)
     {
-      if ((theFile->check_flags & MODI_ATM) == 0)
+      if ((theFile->check_mask & MODI_ATM) == 0)
 	modi_mask = MASK_READONLY_;
       else
@@ -2227,74 +2635,47 @@
   /* --- Report on modified files. ---
    */
-  if (modi_mask != 0 && (!SH_FFLAG_REPORTED_SET(p->fflags)))
+  if (modi_mask != 0 && p->reported == S_FALSE)
     { 
-      tmp = SH_ALLOC(SH_MSG_BUF);
-      msg = SH_ALLOC(SH_MSG_BUF);
+      tmp = SH_ALLOC(SH_BUFSIZE);
+      msg = SH_ALLOC(SH_BUFSIZE);
       msg[0] = '\0';
 
-      sh_files_fixup_mask(class, &(cf_report.newflags));
-
-      if ( (report_checkflags != S_FALSE) && (cf_report.oldflags != cf_report.newflags))
-	{
-	  sl_snprintf(tmp, SH_MSG_BUF,
-#ifdef SH_USE_XML
-		      _("checkflags_old=\"0%lo\" checkflags_new=\"0%lo\" "),
-#else
-		      _("checkflags_old=<0%lo>, checkflags_new=<0%lo>, "),
-#endif
-		      cf_report.oldflags,  cf_report.newflags);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-	}
-
       if (   ((modi_mask & MODI_MOD) != 0)
-#if defined(HAVE_LIBPRELUDE)
-	     || ((modi_mask & MODI_USR) != 0)
-	     || ((modi_mask & MODI_GRP) != 0)
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
+	  || ((modi_mask & MODI_USR) != 0)
+	  || ((modi_mask & MODI_GRP) != 0)
 #endif
 	     )
 	{
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-	  sl_snprintf(tmp, SH_MSG_BUF, 
+#if defined(__linux__)
+	  sl_snprintf(tmp, SH_BUFSIZE, 
 #ifdef SH_USE_XML
 		      _("mode_old=\"%s\" mode_new=\"%s\" attr_old=\"%s\" attr_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" iattr_old=\"%ld\" iattr_new=\"%ld\" "),
 #else
-		      _("mode_old=<%s>, mode_new=<%s>, attr_old=<%s>, attr_new=<%s>, imode_old=<%ld>, imode_new=<%ld>, iattr_old=<%ld>, iattr_new=<%ld>, "),
+		      _("mode_old=<%s>, mode_new=<%s>, attr_old=<%s>, attr_new=<%s>, "),
 #endif
 		      p->theFile.c_mode, theFile->c_mode,
-		      p->theFile.c_attributes, theFile->c_attributes,
-
-		      (long) p->theFile.mode, (long) theFile->mode,
+		      p->theFile.c_attributes, theFile->c_attributes
+#ifdef SH_USE_XML
+		      , (long) p->theFile.mode, (long) theFile->mode,
 		      (long) p->theFile.attributes, 
 		      (long) theFile->attributes
+#endif
 		      );
 #else
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, 
+	  sl_snprintf(tmp, SH_BUFSIZE, 
 		      _("mode_old=\"%s\" mode_new=\"%s\" imode_old=\"%ld\" imode_new=\"%ld\" "),
-		      p->theFile.c_mode, theFile->c_mode,
-		      (long) p->theFile.mode, (long) theFile->mode);
-#else
-	  sl_snprintf(tmp, SH_MSG_BUF, _("mode_old=<%s>, mode_new=<%s>, "),
-		      p->theFile.c_mode, theFile->c_mode);
-#endif
-#endif
-	  sl_strlcat(msg, tmp, SH_MSG_BUF);
-
-#if defined(USE_ACL) || defined(USE_XATTR)
-	  if (theFile->attr_string != NULL || p->attr_string != NULL)
-	    {
-	      sl_snprintf(tmp, SH_MSG_BUF, 
+#else
+		      sl_snprintf(tmp, SH_BUFSIZE, _("mode_old=<%s>, mode_new=<%s>, "),
+#endif
+		      p->theFile.c_mode, theFile->c_mode
 #ifdef SH_USE_XML
-			  _("acl_old=\"%s\" acl_new=\"%s\" "),
-#else
-			  _("acl_old=<%s>, acl_new=<%s>, "),
-#endif
-			  (p->attr_string)       ? p->attr_string       : _("none"), 
-			  (theFile->attr_string) ? theFile->attr_string : _("none"));
-	      
-	      sl_strlcat(msg, tmp, SH_MSG_BUF);
-	    }
-#endif
-
+		      , (long) p->theFile.mode, (long) theFile->mode
+#endif
+		      );
+#endif
+	  sl_strlcat(msg, tmp, SH_BUFSIZE);
+#ifdef REPLACE_OLD
 	  if ((modi_mask & MODI_MOD) != 0)
 	    {
@@ -2307,50 +2688,37 @@
 		  sl_strlcpy(p->theFile.c_mode, theFile->c_mode, 11);
 		  p->theFile.mode = theFile->mode;
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
 		  sl_strlcpy(p->theFile.c_attributes,theFile->c_attributes,16);
 		  p->theFile.attributes = theFile->attributes;
 #endif
-#if defined(USE_ACL) || defined(USE_XATTR)
-		  if      (p->attr_string == NULL && theFile->attr_string != NULL)
-		    { p->attr_string = sh_util_strdup (theFile->attr_string); }
-		  else if (p->attr_string != NULL && theFile->attr_string == NULL)
-		    { SH_FREE(p->attr_string); p->attr_string = NULL; }
-		  else if (theFile->attr_string != NULL && p->attr_string != NULL)
-		    { 
-		      if (0 != strcmp(theFile->attr_string, p->attr_string))
-			{
-			  SH_FREE(p->attr_string);
-			  p->attr_string = sh_util_strdup (theFile->attr_string);
-			}
-		    }
-#endif
 		}
 	    }
-
+#endif
 	}
 
       if ((modi_mask & MODI_HLN) != 0)
 	{
-	  sl_snprintf(tmp, SH_MSG_BUF, 
+	  sl_snprintf(tmp, SH_BUFSIZE, 
 #ifdef SH_USE_XML
-		      _("hardlinks_old=\"%lu\" hardlinks_new=\"%lu\" "),
-#else
-		      _("hardlinks_old=<%lu>, hardlinks_new=<%lu>, "),
+		      _("hardlinks_old=\"%ld\" hardlinks_new=\"%ld\" "),
+#else
+		      _("hardlinks_old=<%ld>, hardlinks_new=<%ld>, "),
 #endif
 		      (unsigned long) p->theFile.hardlinks, 
 		      (unsigned long) theFile->hardlinks);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.hardlinks = theFile->hardlinks;
+#endif
 	}
 
       if ((modi_mask & MODI_RDEV) != 0)
 	{
-	  sl_snprintf(tmp, SH_MSG_BUF,
+	  sl_snprintf(tmp, SH_BUFSIZE,
 #ifdef SH_USE_XML 
-		      _("device_old=\"%lu,%lu\" device_new=\"%lu,%lu\" idevice_old=\"%lu\" idevice_new=\"%lu\" "),
-#else
-		      _("device_old=<%lu,%lu>, device_new=<%lu,%lu>, "),
+		      _("device_old=\"%ld,%ld\" device_new=\"%ld,%ld\" idevice_old=\"%ld\" idevice_new=\"%ld\" "),
+#else
+		      _("device_old=<%ld,%ld>, device_new=<%ld,%ld>, "),
 #endif
 		      (unsigned long) major(p->theFile.rdev), 
@@ -2363,72 +2731,46 @@
 #endif
 		      );
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.rdev = theFile->rdev;
+#endif
 	}
 
       if ((modi_mask & MODI_INO) != 0)
 	{
-	  sl_snprintf(tmp, SH_MSG_BUF,
+	  sl_snprintf(tmp, SH_BUFSIZE,
 #ifdef SH_USE_XML 
-		      _("inode_old=\"%lu\" inode_new=\"%lu\" "),
-#else
-		      _("inode_old=<%lu>, inode_new=<%lu>, "),
+		      _("inode_old=\"%ld\" inode_new=\"%ld\" "),
+#else
+		      _("inode_old=<%ld>, inode_new=<%ld>, "),
 #endif
 		      (unsigned long) p->theFile.ino, 
 		      (unsigned long) theFile->ino);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
-	    {
-	      p->theFile.ino = theFile->ino;
-	      p->theFile.dev = theFile->dev;
-	    }
-	}
-
-
-      /* 
-       * also report device for prelude
-       */
-#if defined(HAVE_LIBPRELUDE)
-      if ((modi_mask & MODI_INO) != 0)
-	{
-	  sl_snprintf(tmp, SH_MSG_BUF,
-#ifdef SH_USE_XML 
-		      _("dev_old=\"%lu,%lu\" dev_new=\"%lu,%lu\" "),
-#else
-		      _("dev_old=<%lu,%lu>, dev_new=<%lu,%lu>, "),
-#endif
-		      (unsigned long) major(p->theFile.dev),
-		      (unsigned long) minor(p->theFile.dev),
-		      (unsigned long) major(theFile->dev),
-		      (unsigned long) minor(theFile->dev)
+	    p->theFile.ino = theFile->ino;
+#endif
+	}
+
+      if (   ((modi_mask & MODI_USR) != 0)
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
+	  || ((modi_mask & MODI_MOD) != 0)
+#endif
+	  )
+	{
+#ifdef SH_USE_XML
+	  sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
+#else
+	  sl_snprintf(tmp, SH_BUFSIZE, _("owner_old=<%s>, owner_new=<%s>, "),
+#endif
+		      p->theFile.c_owner, theFile->c_owner
+#ifdef SH_USE_XML
+		      , (long) p->theFile.owner, (long) theFile->owner
+#endif
 		      );
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
-	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
-	    p->theFile.dev = theFile->dev;
-	}
-#endif
-
-      if (   ((modi_mask & MODI_USR) != 0)
-#if defined(HAVE_LIBPRELUDE)
-	  || ((modi_mask & MODI_MOD) != 0)
-#endif
-	  )
-	{
-#ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, 
-		      _("owner_old=\"%s\" owner_new=\"%s\" iowner_old=\"%ld\" iowner_new=\"%ld\" "),
-#else
-	  sl_snprintf(tmp, SH_MSG_BUF, 
-		      _("owner_old=<%s>, owner_new=<%s>, iowner_old=<%ld>, iowner_new=<%ld>, "),
-#endif
-		      p->theFile.c_owner, theFile->c_owner, 
-		      (long) p->theFile.owner, (long) theFile->owner
-		      );
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if ((modi_mask & MODI_USR) != 0) {
 	    if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
@@ -2438,8 +2780,9 @@
 	      }
 	  }
+#endif
 	}
 
       if (   ((modi_mask & MODI_GRP) != 0)
-#if defined(HAVE_LIBPRELUDE)
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
 	  || ((modi_mask & MODI_MOD) != 0)
 #endif
@@ -2447,17 +2790,14 @@
 	{
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, 
-		      _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("group_old=\"%s\" group_new=\"%s\" igroup_old=\"%ld\" igroup_new=\"%ld\" "),
 		      p->theFile.c_group, theFile->c_group,
 		      (long) p->theFile.group, (long) theFile->group);
 #else
-	  sl_snprintf(tmp, SH_MSG_BUF, 
-		      _("group_old=<%s>, group_new=<%s>, igroup_old=<%ld>, igroup_new=<%ld>, "),
-		      p->theFile.c_group, theFile->c_group,
-		      (long) p->theFile.group, (long) theFile->group);
-#endif
-
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_snprintf(tmp, SH_BUFSIZE, _("group_old=<%s>, group_new=<%s>, "),
+		      p->theFile.c_group, theFile->c_group);
+#endif
+
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
           if ((modi_mask & MODI_GRP) != 0) {
 	    if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
@@ -2467,66 +2807,71 @@
 	      }
 	  }
+#endif
 	}
 
       if ((modi_mask & MODI_SIZ) != 0)
 	{
-	  sl_snprintf(tmp, SH_MSG_BUF, sh_hash_size_format(),
+	  sl_snprintf(tmp, SH_BUFSIZE, sh_hash_size_format(),
 		      (UINT64) p->theFile.size, 
 		      (UINT64) theFile->size);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.size = theFile->size;
+#endif
 	}
 
       if ((modi_mask & MODI_CTM) != 0)
 	{
-	  (void) sh_unix_gmttime (p->theFile.ctime, timstr1c, sizeof(timstr1c));
-	  (void) sh_unix_gmttime (theFile->ctime,   timstr2c, sizeof(timstr2c));
+	  sl_strlcpy (timstr1c, sh_unix_gmttime (p->theFile.ctime), 32);
+	  sl_strlcpy (timstr2c, sh_unix_gmttime (theFile->ctime),   32);
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=\"%s\" ctime_new=\"%s\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=\"%s\" ctime_new=\"%s\" "),
 		      timstr1c, timstr2c);
 #else
-	  sl_snprintf(tmp, SH_MSG_BUF, _("ctime_old=<%s>, ctime_new=<%s>, "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("ctime_old=<%s>, ctime_new=<%s>, "),
 		      timstr1c, timstr2c);
 #endif
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.ctime = theFile->ctime;
+#endif
 	}
 
       if ((modi_mask & MODI_ATM) != 0)
 	{
-	  (void) sh_unix_gmttime (p->theFile.atime, timstr1a, sizeof(timstr1a));
-	  (void) sh_unix_gmttime (theFile->atime,   timstr2a, sizeof(timstr2a));
+	  sl_strlcpy (timstr1a, sh_unix_gmttime (p->theFile.atime), 32);
+	  sl_strlcpy (timstr2a, sh_unix_gmttime (theFile->atime),   32);
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=\"%s\" atime_new=\"%s\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=\"%s\" atime_new=\"%s\" "),
 		      timstr1a, timstr2a);
 #else
-	  sl_snprintf(tmp, SH_MSG_BUF, _("atime_old=<%s>, atime_new=<%s>, "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("atime_old=<%s>, atime_new=<%s>, "),
 		      timstr1a, timstr2a);
 #endif
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.atime = theFile->atime;
+#endif
 	}
 
       if ((modi_mask & MODI_MTM) != 0)
 	{
-	  (void) sh_unix_gmttime (p->theFile.mtime, timstr1m, sizeof(timstr1m));
-	  (void) sh_unix_gmttime (theFile->mtime,   timstr2m, sizeof(timstr2m));
+	  sl_strlcpy (timstr1m, sh_unix_gmttime (p->theFile.mtime), 32);
+	  sl_strlcpy (timstr2m, sh_unix_gmttime (theFile->mtime),   32);
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=\"%s\" mtime_new=\"%s\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=\"%s\" mtime_new=\"%s\" "),
 		      timstr1m, timstr2m);
 #else
-	  sl_snprintf(tmp, SH_MSG_BUF, _("mtime_old=<%s>, mtime_new=<%s>, "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("mtime_old=<%s>, mtime_new=<%s>, "),
 		      timstr1m, timstr2m);
 #endif
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    p->theFile.mtime = theFile->mtime;
+#endif
 	}
 
@@ -2534,5 +2879,5 @@
       if ((modi_mask & MODI_CHK) != 0)
 	{
-	  sl_snprintf(tmp, SH_MSG_BUF, 
+	  sl_snprintf(tmp, SH_BUFSIZE, 
 #ifdef SH_USE_XML
 		      _("chksum_old=\"%s\" chksum_new=\"%s\" "),
@@ -2541,96 +2886,52 @@
 #endif
 		      p->theFile.checksum, fileHash);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
-	    {
-	      sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
-	      if ((theFile->check_flags & MODI_SGROW) != 0)	      
-		p->theFile.size  = theFile->size;
-	    }
-
-
-	  if (theFile->c_mode[0] != 'l' && theFile->link_path &&
-	      strlen(theFile->link_path) > 2)
-	    modi_mask |= MODI_LNK;
-	}
-
-
-      if ((modi_mask & MODI_LNK) != 0 /* && theFile->c_mode[0] == 'l' */)
-	{
-	  if (theFile->link_path)
-	    tmp_lnk     = sh_util_safe_name(theFile->link_path);
-	  else
-	    tmp_lnk     = sh_util_strdup("-");
-	  if (p->linkpath)
-	    tmp_lnk_old = sh_util_safe_name(p->linkpath);
-	  else
-	    tmp_lnk_old = sh_util_strdup("-");
+	    sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
+#endif
+	}
+
+
+      if ((modi_mask & MODI_LNK) != 0 && theFile->c_mode[0] == 'l')
+	{
+	  tmp_lnk     = sh_util_safe_name(theFile->linkpath);
+	  tmp_lnk_old = sh_util_safe_name(p->linkpath);
 #ifdef SH_USE_XML
-	  sl_snprintf(tmp, SH_MSG_BUF, _("link_old=\"%s\" link_new=\"%s\" "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("link_old=\"%s\" link_new=\"%s\" "),
 		      tmp_lnk_old, tmp_lnk);
 #else
-	  sl_snprintf(tmp, SH_MSG_BUF, _("link_old=<%s>, link_new=<%s>, "),
+	  sl_snprintf(tmp, SH_BUFSIZE, _("link_old=<%s>, link_new=<%s>"),
 		      tmp_lnk_old, tmp_lnk);
 #endif
 	  SH_FREE(tmp_lnk);
 	  SH_FREE(tmp_lnk_old);
-	  sl_strlcat(msg, tmp, SH_MSG_BUF); 
-
+	  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+#ifdef REPLACE_OLD
 	  if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
 	    {
 	      if (p->linkpath != NULL)
 		SH_FREE(p->linkpath);
-	      if (!(theFile->link_path))
-		p->linkpath = sh_util_strdup("-");
-	      else
-		p->linkpath = sh_util_strdup(theFile->link_path);
+	      p->linkpath = (char*)SH_ALLOC (sl_strlen(theFile->linkpath) + 1);
+	      sl_strlcpy(p->linkpath, theFile->linkpath, 
+			 sl_strlen(theFile->linkpath) + 1);
 	    }
-	}
-
-      if (MODI_AUDIT_ENABLED(theFile->check_flags))
-	{
-	  char result[256];
-	  
-	  sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, 
-			   0, MSG_E_SUBGPATH,
-			   _("Fetching audit record"),
-			   _("sh_hash"),  theFile->fullpath );
-
-	  if (NULL != sh_audit_fetch (theFile->fullpath, theFile->mtime, theFile->ctime, theFile->atime,
-				      result, sizeof(result)))
-	    {
-#ifdef SH_USE_XML
-	      sl_strlcat(msg, _("obj=\""), SH_MSG_BUF);
-#else
-	      sl_strlcat(msg, _("obj=<"), SH_MSG_BUF);
-#endif
-
-	      sl_strlcat(msg, result, SH_MSG_BUF);
-
-#ifdef SH_USE_XML
-	      sl_strlcat(msg, _("\" "), SH_MSG_BUF);
-#else
-	      sl_strlcat(msg, _(">"), SH_MSG_BUF);
-#endif
-	    } 
-	}
-
-      /****************************************************
-       *
-       * REPORT on file change
-       *
-       ****************************************************/
+#endif
+	}
+
+
       tmp_path = sh_util_safe_name(theFile->fullpath);
-      if (!sh_global_check_silent)
-	sh_error_handle(log_severity, FIL__, __LINE__, 
-			(long) modi_mask, MSG_FI_CHAN,
-			(policy_override == NULL) ? _(policy[class]):log_policy,
-			change_code, tmp_path, msg);
-      ++sh.statistics.files_report;
+      sh_error_handle(log_severity, FIL__, __LINE__, 
+		      (long) modi_mask, MSG_FI_CHAN,
+		      (policy_override == NULL) ? _(policy[class]):log_policy,
+		      change_code, tmp_path, msg);
 
       SH_FREE(tmp_path);
       SH_FREE(tmp);
       SH_FREE(msg);
+
+#ifndef REPLACE_OLD
+      p->reported = S_TRUE;
+#endif
 
       if (S_TRUE  == sh.flag.update)
@@ -2643,40 +2944,17 @@
 	      sl_strlcpy(theFile->c_mode, p->theFile.c_mode, 11);
 	      theFile->mode  =  p->theFile.mode;
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
 	      sl_strlcpy(theFile->c_attributes, p->theFile.c_attributes, 16);
 	      theFile->attributes =  p->theFile.attributes;
-#endif
-#if defined(USE_ACL) || defined(USE_XATTR)
-	      if      (theFile->attr_string == NULL && p->attr_string != NULL)
-		{ theFile->attr_string = sh_util_strdup (p->attr_string); }
-	      else if (theFile->attr_string != NULL && p->attr_string == NULL)
-		{ SH_FREE(theFile->attr_string); theFile->attr_string = NULL; }
-	      else if (theFile->attr_string != NULL && p->attr_string != NULL)
-		{ 
-		  if (0 != strcmp(theFile->attr_string, p->attr_string))
-		    {
-		      SH_FREE(theFile->attr_string);
-		      theFile->attr_string = sh_util_strdup (p->attr_string);
-		    }
-		}
 #endif
 	      
 	      if (theFile->c_mode[0] == 'l') /* c_mode is already copied */
 		{
-		  if (theFile->link_path)
-		    SH_FREE(theFile->link_path);
-		  if (p->linkpath)
-		    theFile->link_path = sh_util_strdup(p->linkpath);
-		  else
-		    theFile->link_path = sh_util_strdup("-");
+		  sl_strlcpy(theFile->linkpath, p->linkpath, PATH_MAX);
 		}
 	      else
 		{
-		  if (theFile->link_path)
-		    SH_FREE(theFile->link_path);
-		  if (p->linkpath)
-		    theFile->link_path = sh_util_strdup(p->linkpath);
-		  else
-		    theFile->link_path = NULL;
+		  theFile->linkpath[0] = '-';
+		  theFile->linkpath[1] = '\0';
 		}
 	      
@@ -2699,10 +2977,8 @@
 	      theFile->hardlinks = p->theFile.hardlinks;
 	      
-	      SET_SH_FFLAG_VISITED(p->fflags);
-	      CLEAR_SH_FFLAG_CHECKED(p->fflags);
-	      retval = 1;
-	      goto unlock_and_return;
+	      p->visited = S_TRUE;
+	      SL_RETURN(1, _("sh_hash_compdata"));
 	    }
-	  else /* if (sh.flag.reportonce == S_TRUE) */
+	  else if (sh.flag.reportonce == S_TRUE)
 	    {
 	      /* we replace the data in the in-memory copy of the
@@ -2712,34 +2988,27 @@
 	      sl_strlcpy(p->theFile.c_mode, theFile->c_mode, 11);
 	      p->theFile.mode  =  theFile->mode;
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
 	      sl_strlcpy(p->theFile.c_attributes, theFile->c_attributes, 16);
 	      p->theFile.attributes = theFile->attributes;
 #endif
-#if defined(USE_ACL) || defined(USE_XATTR)
-	      if      (p->attr_string == NULL && theFile->attr_string != NULL)
-		{ p->attr_string = sh_util_strdup (theFile->attr_string); }
-	      else if (p->attr_string != NULL && theFile->attr_string == NULL)
-		{ SH_FREE(p->attr_string); p->attr_string = NULL; }
-	      else if (theFile->attr_string != NULL && p->attr_string != NULL)
-		{ 
-		  if (0 != strcmp(theFile->attr_string, p->attr_string))
-		    {
-		      SH_FREE(p->attr_string);
-		      p->attr_string = sh_util_strdup (theFile->attr_string);
-		    }
-		}
-#endif
 	      
-	      if (theFile->c_mode[0] == 'l' || theFile->link_path)
+	      if (theFile->c_mode[0] == 'l')
 		{
                   if (p->linkpath != NULL)
 		    SH_FREE(p->linkpath);
-		  p->linkpath = sh_util_strdup(theFile->link_path);
+		  p->linkpath = SH_ALLOC(1 + strlen(theFile->linkpath));
+		  sl_strlcpy(p->linkpath, theFile->linkpath, 
+			     1 + strlen(theFile->linkpath));
 		}
 	      else
 		{
-	          if (p->linkpath != NULL)
-		    SH_FREE(p->linkpath);
-		  p->linkpath = sh_util_strdup("-");
+	          if (p->linkpath != NULL) {
+		    p->linkpath[0] = '-';
+		    p->linkpath[1] = '\0';
+                  } else {
+		    p->linkpath = SH_ALLOC(2);
+		    p->linkpath[0] = '-';
+                    p->linkpath[1] = '\0';
+                  }
 		}
 	      
@@ -2765,11 +3034,7 @@
     }
 
-  SET_SH_FFLAG_VISITED(p->fflags);
-  CLEAR_SH_FFLAG_CHECKED(p->fflags);
-
- unlock_and_return:
-  ; /* 'label at end of compound statement */
-  SH_MUTEX_UNLOCK(mutex_hash);
-  SL_RETURN(retval, _("sh_hash_compdata"));
+  p->visited = S_TRUE;
+
+  SL_RETURN(0, _("sh_hash_compdata"));
 }
 
@@ -2779,266 +3044,91 @@
   int         i;
 
-  SL_ENTER(_("hash_full_tree"));
+  SL_ENTER(_("sh_hash_compdata"));
 
   if (IsInit != 1) 
-    SL_RETURN(0, _("hash_full_tree"));
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_hash);
+    SL_RETURN(0, _("sh_hash_compdata"));
+
   for (i = 0; i < TABSIZE; ++i)
     {
       for (p = tab[i]; p; p = p->next)
-	CLEAR_SH_FFLAG_ALLIGNORE(p->fflags);
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_hash);
-  SL_RETURN (0, _("hash_full_tree"));
+	p->allignore  = S_FALSE;
+    }
+  SL_RETURN (0, _("sh_hash_compdata"));
 } 
 
-#if !defined(SH_CUTEST)
-static 
-#endif
-int hash_remove_tree_test(char * s, char * fullpath, size_t len_s)
-{
-  size_t       len_p;
-  char      *  test;
-
-  len_p = strlen(fullpath);
-  
-  if (len_p >= len_s)
-    {
-      if (0 == strncmp(s, fullpath, len_s)) 
-	{ 
-	  if (len_p > len_s)
-	    {
-	      /* continue if not inside directory;
-	       * len_s > 1 because everything is inside '/' 
-	       */
-	      if ((len_s > 1) && (fullpath[len_s] != '/'))
-		return S_FALSE;
-
-	      test = sh_files_find_mostspecific_dir(fullpath);
-	      
-	      if (test && 0 != strcmp(test, s)) {
-		/* There is a more specific directory, continue */
-		return S_FALSE;
-	      }
-	      
-	      if (NULL == sh_files_findfile(fullpath)) {
-		/* SET_SH_FFLAG_ALLIGNORE(p->fflags); */
-		return S_TRUE;
-	      }
-	    }
-	  else /* len_p == len */
-	    {
-	      /* it is 's' itself, mark and continue 
-	       * unless there is a policy for the inode itself
-	       */
-	      if (NULL == sh_files_findfile(fullpath)) {
-		/* SET_SH_FFLAG_ALLIGNORE(p->fflags); */
-		return S_TRUE;
-	      }
-	      else {
-		return S_FALSE;
-	      }
-	    }
-
-	} /* if path is in tree */
-    } /* if path is possibly in tree */
-  return S_FALSE;
-}
-
 
 int hash_remove_tree (char * s) 
 {
-  sh_file_t *  p;
-  size_t       len_s;
-  unsigned int i;
+  sh_file_t * p;
+  int         len;
+  int         i;
 
   SL_ENTER(_("hash_remove_tree"));
 
-  if (!s || *s == '\0')
+  if (!s)
     SL_RETURN ((-1), _("hash_remove_tree"));
-
-  len_s = sl_strlen(s);
+  else
+    len = sl_strlen(s);
 
   if (IsInit != 1) 
     sh_hash_init();
 
-  SH_MUTEX_LOCK_UNSAFE(mutex_hash);
   for (i = 0; i < TABSIZE; ++i)
     {
       for (p = tab[i]; p; p = p->next)
 	{
-	  if (p->fullpath)
-	    {
-	      /* if (0 == strncmp(s, p->fullpath, len_s)) *//* old */
-	      if (S_TRUE == hash_remove_tree_test(s, p->fullpath, len_s)) {
-		SET_SH_FFLAG_ALLIGNORE(p->fflags);
-		MODI_SET(p->theFile.checkflags, MODI_ALLIGNORE);
-	      }
-	    } /* if path is not null */
-
-	}
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_hash);
+	  if (sl_strncmp(s, p->fullpath, len) == 0)
+	    { 
+	      p->allignore  = S_TRUE;
+	    }
+	}
+    }
   SL_RETURN ((0), _("hash_remove_tree"));
 } 
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
-
-static int ListFullDetail    = S_FALSE;
+#endif
+#endif
+
+static int ListFullDetail = S_FALSE;
 static int ListWithDelimiter = S_FALSE;
-static char * ListFile       = NULL;
-
-int set_list_file (const char * c)
-{
-  ListFile = sh_util_strdup(c);
-  return 0;
-}
-char * get_list_file()
-{
-  return ListFile;
-}
-
-int set_full_detail (const char * c)
-{
-  (void) c;
+
+int set_full_detail (char * c)
+{
   ListFullDetail = S_TRUE;
-  return 0;
+  /* warning: unused parameter `c' */
+  if (c)
+    return 0;
+  else
+    return 0;
 }
  
-int set_list_delimited (const char * c)
-{
-  (void) c;
+int set_list_delimited (char * c)
+{
   ListFullDetail = S_TRUE;
   ListWithDelimiter = S_TRUE;
-  return 0;
-}
-
-/* Always quote the string, except if it is empty. Quote quotes by
- * doubling them.
- */
-char * csv_escape(const char * str)
-{
-  const  char * p = str;
-  const  char * q;
-
-  size_t size       = 0;
-  size_t flag_quote = 0;
-
-  char * new;
-  char * pnew;
-
-  if (p)
-    {
-
-      while (*p) 
-	{
-	  if (*p == '"')
-	    ++flag_quote;
-	  
-	  ++size; ++p;
-	}
-
-      if (sl_ok_adds(size, flag_quote))
-	size += flag_quote;      /* double each quote */
-      else
-	return NULL;
-
-      if (sl_ok_adds(size, 3))
-	size += 3; /* two quotes and terminating null */
-      else
-	return NULL;
-      
-      new = SH_ALLOC(size);
-      
-      if (flag_quote != 0)
-	{
-	  new[0] = '"';
-	  pnew = &new[1];
-	  q    = str;
-	  while (*q)
-	    {
-	      *pnew = *q;
-	      if (*pnew == '"')
-		{
-		  ++pnew; *pnew = '"';
-		}
-	      ++pnew; ++q;
-	    }
-	  *pnew = '"'; ++pnew;
-	  *pnew = '\0';
-	}
-      else
-	{
-	  if (size > 3) 
-	    {
-	      new[0] = '"';
-	      sl_strlcpy (&new[1], str, size-1);
-	      new[size-2] = '"';
-	      new[size-1] = '\0';
-	    }
-	  else
-	    {
-	      new[0] = '\0';
-	    }
-	}
-
-      return new;
-    }
-  return NULL;
-}
-
-int isHexKey(char * s)
-{
-  int i;
-  
-  for (i = 0; i < KEY_LEN; ++i)
-    {
-      if (*s)
-	{
-	  if ((*s >= '0' && *s <= '9') ||
-	      (*s >= 'A' && *s <= 'F') ||
-	      (*s >= 'a' && *s <= 'f'))
-	    {
-	      ++s;
-	      continue;
-	    }
-	}
-      return S_FALSE;
-    }
-  return S_TRUE;
+  /* warning: unused parameter `c' */
+  if (c)
+    return 0;
+  else
+    return 0;
 }
  
-#include "sh_checksum.h"
-
-static char * KEYBUFtolower (char * s, char * result)
-{
-  char * r = result;
-  if (s)
-    {
-      for (; *s; ++s)
-	{ 
-	  *r = tolower((unsigned char) *s); ++r;
-	}
-      *r = '\0';
-    }
-  return result;
-}
-
 void sh_hash_list_db_entry_full_detail (sh_file_t * p)
 {
   char * tmp;
-  char * esc;
   char   str[81];
-  char   hexdigest[SHA256_DIGEST_STRING_LENGTH];
-  char   keybuffer[KEYBUF_SIZE];
 
   if (ListWithDelimiter == S_TRUE)
     {
-      printf(_("%7ld, %7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
-	     (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
+      printf(_("%7ld, %10s, %5d, %12s, %5d, %3d, %-8s, %5d, %-8s, %5d, "),
+	     (unsigned long) p->theFile.ino,
 	     p->theFile.c_mode, (int) p->theFile.mode,
 	     p->theFile.c_attributes, (int) p->theFile.attributes,
@@ -3049,6 +3139,6 @@
   else
     {
-      printf(_("%7ld %7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
-	     (unsigned long) p->theFile.ino, (unsigned long) p->theFile.dev,
+      printf(_("%7ld %10s %5d %12s %5d %3d %-8s %5d %-8s %5d "),
+	     (unsigned long) p->theFile.ino,
 	     p->theFile.c_mode, (int) p->theFile.mode,
 	     p->theFile.c_attributes, (int) p->theFile.attributes,
@@ -3059,7 +3149,7 @@
 
   if ('c' == p->theFile.c_mode[0] || 'b' == p->theFile.c_mode[0])
-    sl_snprintf(str, sizeof(str), "%"PRIu64, p->theFile.rdev);
-  else
-    sl_snprintf(str, sizeof(str), "%"PRIu64, p->theFile.size);
+    sl_snprintf(str, 80, "%"PRIi64, p->theFile.rdev);
+  else
+    sl_snprintf(str, 80, "%"PRIi64, p->theFile.size);
 
   printf( _(" %8s"), str);
@@ -3067,74 +3157,34 @@
     putchar(',');
 
-  printf( _(" %s"), sh_unix_gmttime (p->theFile.ctime, str, sizeof(str)));
+  printf( _(" %s"), sh_unix_gmttime (p->theFile.ctime));
   if (ListWithDelimiter == S_TRUE)
     putchar(',');
-  printf( _(" %s"), sh_unix_gmttime (p->theFile.mtime, str, sizeof(str)));
+  printf( _(" %s"), sh_unix_gmttime (p->theFile.mtime));
   if (ListWithDelimiter == S_TRUE)
     putchar(',');
-  printf( _(" %s"), sh_unix_gmttime (p->theFile.atime, str, sizeof(str)));
+  printf( _(" %s"), sh_unix_gmttime (p->theFile.atime));
   if (ListWithDelimiter == S_TRUE)
     putchar(',');
-
-  if (isHexKey(p->theFile.checksum))
-    printf( _(" %s"), KEYBUFtolower(p->theFile.checksum, keybuffer));
-  else
-    printf( _(" %s"), SHA256_Base2Hex(p->theFile.checksum, hexdigest));
+  printf( _(" %s"), p->theFile.checksum);
   if (ListWithDelimiter == S_TRUE)
     putchar(',');
 
   tmp = sh_util_safe_name(p->fullpath);
-  if (ListWithDelimiter != S_TRUE)
-    {
-      printf( _(" %s"), tmp);
-    }
-  else
-    {
-      esc = csv_escape(tmp);
-      printf( _(" %s,"), (esc != NULL) ? esc : _("(null)"));
-      if (esc)
-	SH_FREE(esc);
-    }
+  printf( _(" %s"), tmp);
   SH_FREE(tmp);
+  if (ListWithDelimiter == S_TRUE)
+    putchar(',');
 
   if ('l' == p->theFile.c_mode[0])
     {
       tmp = sh_util_safe_name(p->linkpath);
-      if (ListWithDelimiter != S_TRUE)
-	{
-	  printf(_(" -> %s"), tmp);
-	}
+      if (ListWithDelimiter == S_TRUE)
+	printf(_(" %s\n"), tmp);
       else
-	{
-	  esc = csv_escape(tmp);
-	  printf( _(" %s,"), (esc != NULL) ? esc : _("(null)"));
-	  if (esc)
-	    SH_FREE(esc);
-	}
+	printf(_(" -> %s\n"), tmp);
       SH_FREE(tmp);
     }
-
-  if (p->attr_string)
-    {
-      tmp = sh_util_safe_name(p->attr_string);
-      if (ListWithDelimiter != S_TRUE) 
-	{
-	  printf(_(" %s"), tmp);
-	}
-      else
-	{
-	  esc = csv_escape(tmp);
-	  printf( _(" %s"), (esc != NULL) ? esc : _("(null)"));
-	  if (esc)
-	    SH_FREE(esc);
-	}
-      SH_FREE(tmp);
-    }
-  else
-    {
-      if (ListWithDelimiter == S_TRUE)
-	printf("%s",_(" no_attr"));
-    }
-  putchar('\n');
+  else
+    printf("\n");
 
   return;
@@ -3148,49 +3198,9 @@
   time_t now  = time(NULL);
   time_t then = (time_t) p->theFile.mtime;
-  struct tm   * time_ptr;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
-  struct tm     time_tm;
-#endif
-
-  if (ListFullDetail != S_FALSE)
-    {
-      sh_hash_list_db_entry_full_detail (p);
-      return;
-    }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
-  time_ptr = gmtime_r(&then, &time_tm);
-  if (!time_ptr)
-    return;
-  strftime(thetime, 127, _("%b %d  %Y"), time_ptr);
-  time_ptr = gmtime_r(&now,  &time_tm);
-  if (!time_ptr)
-    return;
-  strftime(nowtime, 127, _("%b %d  %Y"), time_ptr);
+
+  strftime(thetime, 127, _("%b %d  %Y"), gmtime(&then));
+  strftime(nowtime, 127, _("%b %d  %Y"), gmtime(&now));
   if (0 == strncmp(&nowtime[7], &thetime[7], 4))
-    {
-      time_ptr = gmtime_r(&then, &time_tm);
-      if (!time_ptr)
-	return;
-      strftime(thetime, 127, _("%b %d %H:%M"), time_ptr);
-    }
-#else
-  time_ptr = gmtime(&then);
-  if (!time_ptr)
-    return;
-  strftime(thetime, 127, _("%b %d  %Y"), time_ptr);
-  time_ptr = gmtime(&now);
-  if (!time_ptr)
-    return;
-  strftime(nowtime, 127, _("%b %d  %Y"), time_ptr);
-  if (0 == strncmp(&nowtime[7], &thetime[7], 4))
-    {
-      time_ptr = gmtime(&then);
-      if (!time_ptr)
-	return;
-      strftime(thetime, 127, _("%b %d %H:%M"), time_ptr);
-    }
-#endif
+    strftime(thetime, 127, _("%b %d %H:%M"), gmtime(&then));
 
   tmp = sh_util_safe_name(p->fullpath);
@@ -3223,48 +3233,67 @@
 }
 
-#ifdef HAVE_LIBZ
-#include <zlib.h>
-#endif    
-
-int sh_hash_printcontent(char * linkpath)
-{
-#ifdef HAVE_LIBZ
-  unsigned char * decoded;
-  unsigned char * decompressed = NULL;
-  size_t dlen;
-  unsigned long clen;
-  unsigned long clen_o;
-  int    res;
-
-  if (linkpath && *linkpath != '-')
-    {
-      dlen = sh_util_base64_dec_alloc (&decoded, 
-				       (unsigned char *)linkpath, 
-				       strlen(linkpath));
-
-      clen = dlen * 2 + 1;
-
-      do {
-	if (decompressed)
-	  SH_FREE(decompressed);
-	clen += dlen; clen_o = clen;
-	decompressed = SH_ALLOC(clen);
-	res = uncompress(decompressed, &clen, decoded, dlen);
-	if (res == Z_MEM_ERROR)
-	  { fprintf(stderr, "%s",_("Error: Not enough memory\n")); return -1; }
-	if (res == Z_DATA_ERROR)
-	  { fprintf(stderr, "%s",_("Error: Data corrupt or incomplete\n")); return -1; }
-      } while (res == Z_BUF_ERROR || clen == clen_o);
-
-      decompressed[clen] = '\0';
-      fputs( (char*) decompressed, stdout);
-      SH_FREE(decompressed);
-      return 0;
-    }
-#else
-  (void) linkpath;
-#endif
-  fprintf(stderr, "%s",_("Error: No data available\n")); 
-  return -1;
+int sh_hash_list_db (char * db_file)
+{
+  sh_file_t * p;
+  SL_TICKET fd;
+  char * line;
+
+  if (!db_file)
+    {
+      _exit(EXIT_FAILURE);
+      return -1; 
+    }
+  if (sl_is_suid())
+    {
+      fprintf(stderr, _("ERROR: insufficient privilege\n"));
+      _exit (EXIT_FAILURE);
+      return -1; /* for Mac OSX compiler */
+    }
+  if (0 == strcmp(db_file, _("default")))
+    db_file = file_path('D', 'W');
+  if (!db_file)
+    {
+      _exit(EXIT_FAILURE);
+      return -1; 
+    }
+
+  line = SH_ALLOC(MAX_PATH_STORE+1);
+
+  if ( SL_ISERROR(fd = sl_open_read(db_file, SL_YESPRIV))) 
+    {
+      fprintf(stderr, _("ERROR: can't open %s for read (errnum = %ld)\n"), 
+	      db_file, fd);
+      _exit(EXIT_FAILURE);
+      return -1; 
+    }
+
+  /* fast forward to start of data
+   */
+  sh_hash_setdataent(fd, line, MAX_PATH_STORE, db_file);
+
+  while (1) 
+    {
+      p = sh_hash_getdataent (fd, line, MAX_PATH_STORE);
+      if ((p != NULL) && (p->fullpath[0] != 'K'))
+	{
+	  if (ListFullDetail == S_FALSE)
+	    sh_hash_list_db_entry (p); 
+	  else
+	    sh_hash_list_db_entry_full_detail (p); 
+	}
+      else if (p == NULL)
+	{
+	  break;
+	}
+    }
+
+  if (line != NULL)
+    SH_FREE(line);
+  sl_close (fd);
+
+  fflush(NULL);
+
+  _exit(EXIT_SUCCESS);
+  return 0; 
 }
 
Index: trunk/src/sh_html.c
===================================================================
--- trunk/src/sh_html.c	(revision 591)
+++ trunk/src/sh_html.c	(revision 1)
@@ -24,10 +24,14 @@
 #include <stdlib.h>
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
+#else
+#include <time.h>
 #endif
-#include <time.h>
-
-#include <unistd.h>
+#endif
 
 
@@ -36,5 +40,5 @@
 
 #include "samhain.h"
-#include "sh_xfer.h"
+#include "sh_forward.h"
 #include "sh_error.h"
 #include "sh_unix.h"
@@ -86,7 +90,4 @@
   time_t    now;
   struct tm   * time_ptr;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  struct tm    time_tm;
-#endif
 
   char    * formatted;
@@ -101,5 +102,5 @@
   if (p)
     {
-      fd = sl_open_read (FIL__, __LINE__, p, SL_YESPRIV);
+      fd = sl_open_read (p, SL_YESPRIV);
       SH_FREE(p);
     }
@@ -107,5 +108,5 @@
   if (!SL_ISERROR(fd))
     {
-      while (!SL_ISERROR(status) && sh_unix_getline (fd, line, sizeof(line)) > 0) 
+      while (!SL_ISERROR(status) && sh_unix_getline (fd, line, 511) > 0) 
 	{
 	  formatted = replace_stat (line);
@@ -120,5 +121,5 @@
   else
     {
-      qstr = sh_util_basename(DEFAULT_HTML_FILE);
+      qstr = sh_util_filename(DEFAULT_HTML_FILE);
       if (qstr != NULL)
 	{
@@ -147,23 +148,11 @@
       if (!SL_ISERROR(status))
 	{
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-	  time_ptr   = localtime_r (&(server_status.start), &time_tm);
-#else
 	  time_ptr   = localtime (&(server_status.start));
-#endif
 	  if (time_ptr != NULL) 
-	    strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
-	  else
-	    sl_strlcpy(ts1, _("01-01-1970 00:00:00"), sizeof(ts1));
+	    status = strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
 	  now = time(NULL);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-	  time_ptr   = localtime_r (&now, &time_tm);
-#else
 	  time_ptr   = localtime (&now);
-#endif
 	  if (time_ptr != NULL) 
-	    strftime (ts2, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
-	  else
-	    sl_strlcpy(ts2, _("01-01-1970 00:00:00"), sizeof(ts2));
+	    status = strftime (ts2, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
 
 	  sl_snprintf(outline, 1023, 
@@ -185,13 +174,7 @@
 	  if (server_status.last > (time_t) 0)
 	    {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-	      time_ptr   = localtime_r (&(server_status.last), &time_tm);
-#else
 	      time_ptr   = localtime (&(server_status.last));
-#endif
 	      if (time_ptr != NULL) 
-		strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
-	      else
-		sl_strlcpy(ts1, _("01-01-1970 00:00:00"), sizeof(ts1));
+		status = strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
 	      sl_snprintf(outline, 1023, 
 			  _("<p>Last connection at %s</p>"), 
@@ -228,5 +211,5 @@
   if (p)
     {
-      fd = sl_open_read (FIL__, __LINE__, p, SL_YESPRIV);
+      fd = sl_open_read (p, SL_YESPRIV);
       SH_FREE(p);
     }
@@ -234,5 +217,5 @@
   if (!SL_ISERROR(fd))
     {
-      while (!SL_ISERROR(status) && sh_unix_getline (fd, line, sizeof(line)) > 0) 
+      while (!SL_ISERROR(status) && sh_unix_getline (fd, line, 511) > 0) 
 	{
 	  status = sl_write_line (ticket, line, sl_strlen(line));
@@ -278,5 +261,5 @@
 
 static
-int sh_html_get_entry (void)
+int sh_html_get_entry ()
 {
   long      retval = SL_ENONE;
@@ -301,10 +284,10 @@
   if (p)
     {
-      fd = sl_open_read (FIL__, __LINE__, p, SL_YESPRIV);
+      fd = sl_open_read (p, SL_YESPRIV);
       SH_FREE(p);
     }
   if (!SL_ISERROR(fd))
     {
-      while (!SL_ISERROR(retval) && sh_unix_getline (fd, line, sizeof(line)) > 0) 
+      while (!SL_ISERROR(retval) && sh_unix_getline (fd, line, 511) > 0) 
 	{
 	  line_size = sl_strlen(line);
@@ -312,28 +295,22 @@
 	  if (entry_orig != NULL)
 	    {
-	      char * ptr = realloc(entry_orig,           /* free() ok     */
-				   entry_size + line_size + 1);
-	      if (ptr) {
-		entry_orig = ptr;
-		add_size = line_size; 
-	      } else {
-		{ free(entry_orig); entry_orig = NULL; }
-	      }
+	      entry_orig = realloc(entry_orig,           /* free() ok     */
+				   entry_size + line_size);
+	      if (entry_orig) { add_size = line_size; }
 	    }
 	  else
 	    {
-	      entry_orig = calloc(1, line_size + 1);        /* free() ok     */
-	      if (entry_orig) { entry_orig[0] = '\0'; add_size = line_size; }
+	      entry_orig = malloc(line_size + 1);        /* free() ok     */
+	      if (entry_orig) { entry_orig[0] = '\0'; add_size = line_size + 1; }
 	    }
 	  if (!entry_orig)
 	    {
 	      entry_size = 0;
-	      /* add_size   = 0; *//* never read */
+	      add_size   = 0;
 	      SL_RETURN( 0, _("sh_html_get_entry"));
 	    }
 
-	  sl_strlcat(&entry_orig[entry_size], line, line_size + 1);
+	  strcat(&entry_orig[entry_size], line);         /* known to fit  */
 	  entry_size += add_size;
-	  SH_VALIDATE_EQ(entry_orig[entry_size], '\0');
 	}
       sl_close(fd);
@@ -396,6 +373,6 @@
 int comp_arr (const void * ao, const void * bo)
 {
-  const sort_arr * a;
-  const sort_arr * b;
+  sort_arr * a;
+  sort_arr * b;
 
   if (ao == NULL && bo == NULL)
@@ -406,6 +383,6 @@
     return (1);
 
-  a = (const sort_arr *) ao;
-  b = (const sort_arr *) bo;
+  a = (sort_arr *) ao;
+  b = (sort_arr *) bo;
 
   return ((-1) * sl_strcmp(a->tim, b->tim));
@@ -417,5 +394,5 @@
   int status;
   int clt_status;
-  unsigned int i, n;
+  int i, n;
 
   SL_ENTER(_("sh_html_print_one"));
@@ -487,5 +464,5 @@
 
 
-  fd = sl_open_write_trunc (FIL__, __LINE__, DEFAULT_HTML_FILE, SL_YESPRIV);
+  fd = sl_open_write_trunc (DEFAULT_HTML_FILE, SL_YESPRIV);
 
   if (SL_ISERROR(fd))
@@ -509,30 +486,4 @@
 }
 
-int sh_html_zero()
-{
-  long fd;
-
-  SL_ENTER(_("sh_html_zero"));
-
-  if (0 != (fd = tf_trust_check (DEFAULT_HTML_FILE, SL_YESPRIV)))
-    {
-      SL_RETURN((-1), _("sh_html_zero"));
-    }
-
-  fd = sl_open_write_trunc (FIL__, __LINE__, DEFAULT_HTML_FILE, SL_YESPRIV);
-
-  if (SL_ISERROR(fd))
-    {
-     SL_RETURN((-1), _("sh_html_zero"));
-    }
-
-  sh_html_head(fd);
-  sh_html_foot(fd);
-
-  sl_close(fd);
-
-  SL_RETURN((0), _("sh_html_zero"));
-}
-
 /* SH_WITH_SERVER */
 #endif
Index: trunk/src/sh_ignore.c
===================================================================
--- trunk/src/sh_ignore.c	(revision 591)
+++ trunk/src/sh_ignore.c	(revision 1)
@@ -33,6 +33,4 @@
 #endif
 
-#include <string.h>
-
 #include "samhain.h"
 #include "sh_mem.h"
@@ -40,6 +38,4 @@
 
 #define FIL__ _("sh_ignore.c")
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
 
 struct sh_ignore_list {
@@ -55,13 +51,9 @@
 static struct sh_ignore_list * sh_del_ign = NULL;
 static struct sh_ignore_list * sh_new_ign = NULL;
-static struct sh_ignore_list * sh_mod_ign = NULL;
 
 static struct sh_ignore_list * sh_ignore_add_int(struct sh_ignore_list * list, 
-						 const char * addpath)
+						 char * addpath)
 {
   struct sh_ignore_list * new;
-  char                  * reg_expr;
-  size_t                  len;
-
 #ifdef HAVE_REGEX_H
   int                     status = -1;
@@ -73,18 +65,13 @@
   SL_ENTER(_("sh_ignore_add"));
 
-  if ( (addpath == NULL) || (sl_ok_adds(2, strlen(addpath)) == S_FALSE) )
+  if (addpath == NULL)
     {
       SL_RETURN(list, _("sh_ignore_add"));
     }
 
-  new      = SH_ALLOC(sizeof(struct sh_ignore_list));
-
-  len      = 2 + strlen(addpath);
-  reg_expr = SH_ALLOC(len);
-  sl_strlcpy(reg_expr,     "^", len);
-  sl_strlcat(reg_expr, addpath, len);
+  new  = SH_ALLOC(sizeof(struct sh_ignore_list));
 
 #ifdef HAVE_REGEX_H
-  status = regcomp(&(new->preg), reg_expr, REG_NOSUB|REG_EXTENDED);
+  status = regcomp(&(new->preg), addpath, REG_NOSUB|REG_EXTENDED);
   if (status != 0)  
     {
@@ -93,8 +80,7 @@
       errbuf[BUFSIZ] = '\0';
       sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_REGEX,
-                       errbuf, reg_expr);
+                       errbuf, addpath);
       SH_FREE(errbuf);
       SH_FREE(new);
-      SH_FREE(reg_expr);
       SL_RETURN(list, _("sh_ignore_add"));
     }
@@ -105,5 +91,4 @@
 #endif
 
-  SH_FREE(reg_expr);
   new->next = list;
 
@@ -111,5 +96,5 @@
 }
 
-int sh_ignore_add_del (const char * addpath)
+int sh_ignore_add_del (char * addpath)
 {
   if ((addpath == NULL) || (addpath[0] != '/'))
@@ -121,5 +106,5 @@
 }
 
-int sh_ignore_add_new (const char * addpath)
+int sh_ignore_add_new (char * addpath)
 {
   if ((addpath == NULL) || (addpath[0] != '/'))
@@ -128,14 +113,4 @@
     }
   sh_new_ign = sh_ignore_add_int (sh_new_ign, addpath);
-  return 0;
-}
-
-int sh_ignore_add_mod (const char * addpath)
-{
-  if ((addpath == NULL) || (addpath[0] != '/'))
-    {
-      return -1;
-    }
-  sh_mod_ign = sh_ignore_add_int (sh_mod_ign, addpath);
   return 0;
 }
@@ -182,10 +157,5 @@
 }
 
-int sh_ignore_chk_mod (const char * chkpath)
-{
-  return (sh_ignore_chk_int(sh_mod_ign, chkpath));
-}
-
-int sh_ignore_clean (void)
+int sh_ignore_clean ()
 {
   struct sh_ignore_list * new;
@@ -219,112 +189,10 @@
     }
 
-  new = sh_mod_ign;
-
-  while (new)
-    {
-      sh_mod_ign = new->next;
-#ifdef HAVE_REGEX_H
-      regfree (&(new->preg));
-#else
-      SH_FREE(new->path);
-#endif
-      SH_FREE(new);
-      new        = sh_mod_ign;
-    }
-
   return 0;
 }
-#endif
 
-#ifdef SH_CUTEST
-#include "CuTest.h"
 
-void Test_ignore_ok (CuTest *tc) {
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
 
-  int ret; 
 
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
- 
-  ret = sh_ignore_add_del ("/var/log/foo/.*");
-  CuAssertTrue(tc, 0 == ret);
 
-  CuAssertPtrNotNull(tc, sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
 
-  ret = sh_ignore_chk_del ("/var/log/foo/test");
-  CuAssertTrue(tc, S_TRUE == ret);
-  
-  ret = sh_ignore_chk_del ("/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_del ("/my/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_del ("/my/var/log/foo/test");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  sh_ignore_clean();
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
- 
-  ret = sh_ignore_add_new ("/var/log/foo/.*");
-  CuAssertTrue(tc, 0 == ret);
-
-  CuAssertPtrNotNull(tc, sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
-
-  ret = sh_ignore_chk_new ("/var/log/foo/test");
-  CuAssertTrue(tc, S_TRUE == ret);
-  
-  ret = sh_ignore_chk_new ("/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_new ("/my/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_new ("/my/var/log/foo/test");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  sh_ignore_clean();
-  CuAssertTrue(tc, NULL == sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
-
-  ret = sh_ignore_add_mod ("/var/log/foo/.*");
-  CuAssertTrue(tc, 0 == ret);
-
-  CuAssertPtrNotNull(tc, sh_mod_ign);
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_new_ign);
-
-  ret = sh_ignore_chk_mod ("/var/log/foo/test");
-  CuAssertTrue(tc, S_TRUE == ret);
-  
-  ret = sh_ignore_chk_mod ("/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_mod ("/my/var/log/footest");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  ret = sh_ignore_chk_mod ("/my/var/log/foo/test");
-  CuAssertTrue(tc, S_FALSE == ret);
-
-  sh_ignore_clean();
-  CuAssertTrue(tc, NULL == sh_new_ign);
-  CuAssertTrue(tc, NULL == sh_del_ign);
-  CuAssertTrue(tc, NULL == sh_mod_ign);
-
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-/* #ifdef SH_CUTEST */
-#endif
-
Index: trunk/src/sh_inotify.c
===================================================================
--- trunk/src/sh_inotify.c	(revision 591)
+++ 	(revision )
@@ -1,1052 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2009 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#if defined(HAVE_SYS_INOTIFY_H)
-
-#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
-#if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
-#pragma GCC diagnostic ignored "-Wclobbered"
-#endif
-#endif
-
-#undef  FIL__
-#define FIL__  _("sh_inotify.c")
-
-/* printf */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/inotify.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_calls.h"
-#include "sh_inotify.h"
-#include "sh_mem.h"
-#include "sh_utils.h"
-#include "slib.h"
-
-/**************************************************
- *
- * Make the inotify fd thread-specific by 
- * encapsulating it in get/set functions:
- * sh_get_inotify_fd() / sh_set_inotify_fd()
- *
- **************************************************/
-
-#if defined(HAVE_PTHREAD)
-
-SH_MUTEX_STATIC(mutex_list_dormant, PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_STATIC(mutex_watches,      PTHREAD_MUTEX_INITIALIZER);
-
-static pthread_key_t  inotify_key;
-static pthread_once_t inotify_key_once = PTHREAD_ONCE_INIT;
-
-static void make_inotify_key()
-{
-    (void) pthread_key_create(&inotify_key, free);
-}
-
-static int sh_get_inotify_fd()
-{
-  void * ptr;
-  int  * fp;
-
-  (void) pthread_once(&inotify_key_once, make_inotify_key);
- 
-  if ((ptr = pthread_getspecific(inotify_key)) == NULL) 
-    {
-      ptr = calloc(1,sizeof(int));
-      if (ptr)
-	{
-	  fp  = (int*) ptr;
-	  *fp = -1;
-	  (void) pthread_setspecific(inotify_key, ptr);
-	}
-      else
-	{
-	  return -1;
-	}
-    }
-  else 
-    {
-      fp  = (int*) ptr;
-    }
-  return *fp;
-}
-
-static void sh_set_inotify_fd(int fd)
-{
-  int  * fp;
-
-  fp = (int*) pthread_getspecific(inotify_key);
-  if (fp)
-    *fp = fd;
-  return;
-}
-
-/* !defined(HAVE_PTHREAD) */
-#else
-
-static int sh_inotify_fd = -1;
-
-static inline int sh_get_inotify_fd()
-{
-  return sh_inotify_fd;
-}
-
-static inline void sh_set_inotify_fd(int fd)
-{
-  sh_inotify_fd = fd;
-}
-
-#endif
-
-/*--- nothing thread-related below this point --- */
-
-#include "zAVLTree.h"
-
-typedef struct 
-{
-  int    watch;
-  short  flag;
-  short  type;
-  int    class;
-  int    rdepth;
-  unsigned long check_flags;
-  char * file;
-} sh_watch;
-
-/**************************************************
- *
- * Get inotify fd, initialize inotify if necessary
- *
- **************************************************/
-#define SH_INOTIFY_FAILED -2
-
-static int sh_inotify_getfd()
-{
-  int ifd = sh_get_inotify_fd();
-
-  if (ifd >= 0)
-    {
-      return ifd;
-    }
-
-  else if (ifd == SH_INOTIFY_FAILED)
-    {
-      return -1;
-    }
-
-  else /* if (ifd == -1) */
-    {
-#if defined(HAVE_INOTIFY_INIT1)
-      ifd = inotify_init1(IN_CLOEXEC);
-#else
-      ifd = inotify_init();
-      if (ifd >= 0)
-	{
-	  long sflags;
-
-	  sflags = retry_fcntl(FIL__, __LINE__, ifd, F_GETFD, 0);
-	  retry_fcntl(FIL__, __LINE__, ifd, F_SETFD, sflags|FD_CLOEXEC);
-	}
-#endif
-
-      if (ifd < 0)
-	{
-	  sh_set_inotify_fd(SH_INOTIFY_FAILED);
-	  return -1;
-	}
-
-      sh_set_inotify_fd(ifd);
-      return ifd;
-    }
-}
-
-/**************************************************
- *
- * Public function:
- *  int sh_inotify_wait_for_change(char * filename,
- *                                 int watch,
- *                                 int * errnum,
- *                                 int   waitsec);
- * Returns: watch, if nonnegative
- *          -1 on error or reopen required
- *             (check errnum != 0)
- *
- * Caller needs to keep track of watch descriptor
- *
- **************************************************/
-
-#define SH_INOTIFY_REOPEN 0
-#define SH_INOTIFY_MODIFY 1
-
-void sh_inotify_init(sh_watches * watches)
-{
-  SH_MUTEX_LOCK_UNSAFE(mutex_watches);
-  watches->list_of_watches = NULL;
-  watches->count           = 0;
-  watches->max_count       = 0;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_watches);
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_list_dormant);
-  watches->dormant_watches = NULL;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_list_dormant);
-
-  return;
-}
-
-ssize_t sh_inotify_read(char * buffer, size_t count)
-{
-  ssize_t len = -1;
-  int     ifd = sh_inotify_getfd();
-
-  do {
-    len = read (ifd, buffer, count);
-  } while (len < 0 && (errno == EINTR || errno == EAGAIN));
-
-  return len;
-}
-
-ssize_t sh_inotify_read_timeout(char * buffer, size_t count, int timeout)
-{
-  ssize_t len;
-  int     ifd = sh_inotify_getfd();
-
-  len = sl_read_timeout_fd_once (ifd, buffer, count, timeout, S_FALSE);
-
-  return len;
-}
-
-
-static void sh_inotify_free_watch(void * item)
-{
-  sh_watch * this = (sh_watch *) item;
-
-  if (this->file)
-    SH_FREE(this->file);
-  SH_FREE(this);
-  return;
-}
-
-static sh_watch * sh_inotify_create_watch(const char * file, 
-					  int nwatch, int flag)
-{
-  sh_watch * this = SH_ALLOC(sizeof(sh_watch));
-
-  this->file  = sh_util_strdup_track(file, __FILE__, __LINE__);
-  this->watch = nwatch;
-  this->flag  = flag;
-  return this;
-}
-
-/********** List Handling ******************/
-
-struct sh_inotify_litem
-{
-  sh_watch * watch;
-  struct sh_inotify_litem * next;
-};
-
-static void sh_inotify_listitem_destroy(struct sh_inotify_litem * this)
-{
-  if (this)
-    SH_FREE(this);
-  return;
-}
-
-/* No Mutex in the list cursor functions, must be in the caller
- * function...
- */
-typedef struct {
-  struct sh_inotify_litem *prenode;
-  struct sh_inotify_litem *curnode;
-} sh_inotify_listCursor;
-
-static sh_watch * sh_inotify_list_first(sh_inotify_listCursor * listcursor, 
-					sh_watches * watches)
-{
-  listcursor->prenode = watches->dormant_watches;
-  listcursor->curnode = watches->dormant_watches;
-
-  if (listcursor->curnode)
-    return listcursor->curnode->watch;
-  return NULL;
-}
-
-static sh_watch * sh_inotify_list_next(sh_inotify_listCursor * listcursor, 
-				       sh_watches * watches)
-{
-  (void) watches;
-
-  listcursor->prenode = listcursor->curnode;
-
-  if (listcursor->curnode)
-    {
-      listcursor->curnode = listcursor->curnode->next;
-      if (listcursor->curnode)
-	return listcursor->curnode->watch;
-      else
-	return NULL;
-    }
-
-  return NULL;
-}
-
-static sh_watch * sh_inotify_list_del_cur(sh_inotify_listCursor * listcursor, 
-					  sh_watches * watches)
-{
-  sh_watch * ret = NULL;
-
-  if (listcursor->curnode)
-    {
-      struct sh_inotify_litem * this = listcursor->curnode;
-
-      if (listcursor->prenode == this)
-	{
-	  watches->dormant_watches = this->next;
-
-	  listcursor->prenode = watches->dormant_watches;
-	  listcursor->curnode = watches->dormant_watches;
-	}
-      else
-	{
-	  listcursor->prenode->next = this->next;
-	  listcursor->curnode       = this->next;
-	}
-      if (listcursor->curnode)
-	ret = listcursor->curnode->watch;
-      else
-	ret = NULL;
-      sh_inotify_listitem_destroy(this);
-    }
-  return ret;
-}
-
-static int sh_inotify_add_dormant(sh_watches * watches, sh_watch * item)
-{
-  struct sh_inotify_litem * this;
-
-  SH_MUTEX_LOCK(mutex_list_dormant);
-  this = SH_ALLOC(sizeof(struct sh_inotify_litem));
-
-  this->watch = item;
-  this->next  = (struct sh_inotify_litem *) watches->dormant_watches;
-  
-  watches->dormant_watches = this;
-  SH_MUTEX_UNLOCK(mutex_list_dormant);
-  return 0;
-}
-
-static void * sh_dummy_popret = NULL;
-
-char * sh_inotify_pop_dormant(sh_watches * watches, 
-			      int * class, unsigned long * check_flags, 
-			      int * type, int * rdepth)
-{
-  char * popret = NULL;
-  struct sh_inotify_litem * this;
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_popret = (void *) &popret;
-
-  SH_MUTEX_LOCK(mutex_list_dormant);
-
-  this = (struct sh_inotify_litem *) watches->dormant_watches;
-
-  if (this)
-    {
-      *class  = this->watch->class;
-      *type   = this->watch->type;
-      *rdepth = this->watch->rdepth;
-      *check_flags = this->watch->check_flags;
-      popret  = sh_util_strdup_track(this->watch->file, __FILE__, __LINE__);
-
-      watches->dormant_watches = this->next;
-
-      sh_inotify_free_watch(this->watch);
-      SH_FREE(this);
-    }
-  SH_MUTEX_UNLOCK(mutex_list_dormant);
-
-  sh_dummy_popret = NULL;
-  return popret;
-}
-
-void sh_inotify_purge_dormant(sh_watches * watches)
-{
-  struct sh_inotify_litem * this;
-
-  SH_MUTEX_LOCK(mutex_list_dormant);
-  this = (struct sh_inotify_litem *) watches->dormant_watches;
-
-  watches->dormant_watches = NULL;
-
-  while (this)
-    {
-      struct sh_inotify_litem * cur = this;
-      
-      this = this->next;
-
-      sh_inotify_free_watch(cur->watch);
-      SH_FREE(cur);
-    }
-  SH_MUTEX_UNLOCK(mutex_list_dormant);
-  return;
-}
-
-/********** End List Handling **************/
-
-static zAVLKey sh_inotify_getkey(void const *item)
-{
-  return (&((const sh_watch *)item)->watch);
-}
-
-void sh_inotify_close()
-{
-  int     ifd = sh_inotify_getfd();
-
-  if (ifd >= 0)
-    close(ifd);
-  sh_set_inotify_fd(-1);
-
-  return;
-}
-
-  
-/* This function removes all watches from the list,
- * and closes the inode file descriptor in this thread.
- */
-void sh_inotify_remove(sh_watches * watches)
-{
-  zAVLTree   * all_watches;
-
-  SH_MUTEX_LOCK(mutex_watches);
-  all_watches = (zAVLTree *)(watches->list_of_watches);
-
-  if (all_watches)
-    zAVLFreeTree(all_watches, sh_inotify_free_watch);
-
-  watches->list_of_watches = NULL;
-  watches->count = 0;
-  SH_MUTEX_UNLOCK(mutex_watches);
-
-  sh_inotify_close();
-  return;
-}
-
-static int index_watched_file(char * filename, sh_watches * watches)
-{
-  sh_watch   * item;
-  zAVLCursor   avlcursor;
-  zAVLTree   * all_watches = (zAVLTree *)(watches->list_of_watches);
-
-  if (all_watches)
-    {
-      for (item = (sh_watch *) zAVLFirst(&avlcursor, all_watches); item;
-	   item = (sh_watch *) zAVLNext(&avlcursor))
-	{
-	  if (item->file)
-	    {
-	      if (0 == strcmp(filename, item->file))
-		return item->watch;
-	    }
-	}
-    }
-  return -1;
-}
-
-#if !defined(IN_DONT_FOLLOW)
-#define IN_DONT_FOLLOW 0
-#endif
-
-#define SH_INOTIFY_FILEFLAGS \
-  (IN_ATTRIB|IN_MODIFY|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_DONT_FOLLOW)
-#define SH_INOTIFY_DIRFLAGS \
-  (SH_INOTIFY_FILEFLAGS|IN_DELETE|IN_CREATE|IN_MOVED_FROM|IN_MOVED_TO)
-
-#define SH_INOTIFY_FLAGS (SH_INOTIFY_FILEFLAGS|SH_INOTIFY_DIRFLAGS)
-
-
-/* Create an item and put it on the 'dormant' list for later watch creation 
- */
-int sh_inotify_add_watch_later(const char * filename, sh_watches * watches, 
-			       int * errnum,
-			       int class, unsigned long check_flags, int type, 
-			       int rdepth)
-{
-  sh_watch   * item;
-
-  item = sh_inotify_create_watch(filename, -1, /* flag */ 0);
-
-  item->class      = class;
-  item->type       = (short) type;
-  item->rdepth     = (short) rdepth;
-  item->check_flags = check_flags;
-
-  sh_inotify_add_dormant(watches, item);
-  if (errnum)
-    *errnum = 0;
-
-  return 0;
-}
-	  
-int sh_inotify_rm_watch (sh_watches * watches, sh_watches * save, int wd)
-{
-  int ifd = sh_get_inotify_fd();
-
-  if (watches)
-    {
-      sh_watch   * item;
-  
-      SH_MUTEX_LOCK(mutex_watches);
-      item = zAVLSearch(watches->list_of_watches, &wd);
-      
-      if (item)
-	{
-	  zAVLDelete(watches->list_of_watches, &wd);
-	  if (save) /* optionally save the item */
-	    {
-	      item->watch = -1;
-	      sh_inotify_add_dormant(save, item);
-	    }
-	  else
-	    {
-	      sh_inotify_free_watch(item);
-	    }
-	}
-      SH_MUTEX_UNLOCK(mutex_watches);
-    }
-  return inotify_rm_watch(ifd, wd);
-}
-
-#if (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)) 
-static void * sh_dummy_litem;
-
-int sh_inotify_recheck_watches (sh_watches * watches, sh_watches * save)
-{
-  sh_watch   * litem;
-  sh_inotify_listCursor listcursor;
-  int ifd = sh_get_inotify_fd();
-
-  extern void sh_fInotify_report_add(char * path, 
-				     int class, unsigned long check_flags);
-
-  sh_dummy_litem = (void*) &litem;
-
-  /* -- Check dormant watches for reopening.
-   */
-  SH_MUTEX_LOCK(mutex_list_dormant);
-  
-  litem = sh_inotify_list_first(&listcursor, save);
-
-  while (litem)
-    {
-    have_next:
-
-      /* sh_inotify_list_del_cur may return NULL */
-      if (litem && litem->file && litem->watch == -1)
-	{
-	  litem->watch = inotify_add_watch (ifd, litem->file, 
-					    SH_INOTIFY_FLAGS);
-	  
-	  if (litem->watch >= 0)
-	    {
-	      SH_MUTEX_LOCK(mutex_watches);
-	      if (watches->list_of_watches)
-		zAVLInsert(watches->list_of_watches, litem);
-	      SH_MUTEX_UNLOCK(mutex_watches);
-
-	      sh_fInotify_report_add(litem->file, litem->class, litem->check_flags);
-
-	      litem = sh_inotify_list_del_cur(&listcursor, save);
-	      
-	      goto have_next;
-	    }
-	}
-      litem = sh_inotify_list_next(&listcursor, save);
-    }
-  SH_MUTEX_UNLOCK(mutex_list_dormant);
-  return 0;
-}
-#endif
-
-/* This function is idempotent; it will add the watch only once 
- */
-int sh_inotify_add_watch(char * filename, sh_watches * watches, int * errnum,
-			 int class, unsigned long check_flags, int type, int rdepth)
-{
-  volatile int retval = 0;
-
-  SH_MUTEX_LOCK(mutex_watches);
-
-  *errnum = 0;
-
-  if (filename)
-    {
-      int nwatch;
-      sh_watch   * item;
-      int index = index_watched_file(filename, watches);
-      
-      if (index < 0)
-	{
-	  int     ifd = sh_inotify_getfd();
-
-	  /*************************************
-
-	  if (watches->count == SH_INOTIFY_MAX)
-	    {
-#ifdef EMFILE
-	      *errnum = EMFILE;
-#else
-	      *errnum = 24;
-#endif
-	      return -1;
-	    }
-	  **************************************/
-
-	  nwatch = inotify_add_watch (ifd, filename, 
-				      SH_INOTIFY_FLAGS);
-	  if (nwatch < 0)
-	    {
-	      *errnum = errno;
-	      retval = -1;
-	      goto retpoint;
-	    }
-
-	  item = sh_inotify_create_watch(filename, nwatch, /* flag */ 0);
-
-	  item->class      = class;
-	  item->type       = type;
-	  item->rdepth     = rdepth;
-	  item->check_flags = check_flags;
-	  
-	  if (NULL == watches->list_of_watches)
-	    watches->list_of_watches = zAVLAllocTree (sh_inotify_getkey, 
-						      zAVL_KEY_INT);
- 
-	  if (watches->list_of_watches)
-	    {
-	      *errnum =  zAVLInsert((zAVLTree *)(watches->list_of_watches), 
-				    item);
-
-	      if (*errnum != 0)
-		{
-		  /* zAVLInsert returns -1 on malloc() error and 3 if
-		   * the node already exists. 
-		   */
-		  *errnum = (*errnum == -1) ? ENOMEM : EEXIST;
-		  sh_inotify_free_watch(item);
-		  retval = -1;
-		  goto retpoint;
-		}
-	    }
-	  else
-	    {
-	      *errnum = ENOMEM;
-	      sh_inotify_free_watch(item);
-	      retval = -1;
-	      goto retpoint;
-	    }
-
-	  ++(watches->count);
-	}
-      else if (type == SH_INOTIFY_DIR) /* watch exists */
-	{
-	  /* This covers the case that a directory has been added,
-	   * but is watched as file at first because it is also
-	   * specified as file in the config.
-	   */
-	  item = zAVLSearch(watches->list_of_watches, &index);
-
-	  if (item && item->type == SH_INOTIFY_FILE)
-	    {
-	      item->type = SH_INOTIFY_DIR;
-	    }
-	}
-    }
- retpoint:
-  ; /* 'label at end of compound statement' */
-  SH_MUTEX_UNLOCK(mutex_watches);
-  return retval;
-}
-
-static void * sh_dummy_sret = NULL;
-
-char * sh_inotify_search_item(sh_watches * watches, int watch, 
-			      int * class, unsigned long * check_flags, 
-			      int * type, int * rdepth)
-{
-  sh_watch * item;
-  char     * sret = NULL;
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_sret = (void *) &sret;
-
-  SH_MUTEX_LOCK(mutex_watches);
-  item = zAVLSearch(watches->list_of_watches, &watch);
-
-  if (item)
-    {
-      *class      = item->class;
-      *check_flags = item->check_flags;
-      *type       = item->type;
-      *rdepth     = item->rdepth;
-      sret = sh_util_strdup_track(item->file, __FILE__, __LINE__);
-    }
-  SH_MUTEX_UNLOCK(mutex_watches);
-  return sret;
-}
-
-static void * sh_dummy_litem = NULL;
-
-int sh_inotify_wait_for_change(char * filename, sh_watches * watches, 
-			       int  * errnum, int waitsec)
-{
-  sh_watch   * litem;
-  sh_watch   * zitem;
-  int          ifd = sh_inotify_getfd();
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_litem = (void*) &litem;
-
-  *errnum = 0;
-
- start_it:
-
-  if (ifd >= 0)
-    {
-      volatile ssize_t  i  = 0;
-      ssize_t len = -1;
-      int  flag = 0;
-      char buffer[1024];
-
-      sh_inotify_listCursor listcursor;
-
-      /* -- Add watch if required 
-       */
-      if (filename)
-	{
-	  if (sh_inotify_add_watch(filename, watches, errnum, 
-				   0, 0, SH_INOTIFY_FILE, 0) < 0)
-	    {
-	      retry_msleep(waitsec, 0);
-	      return -1;
-	    }
-	}
-
-      /* -- Check dormant watches for reopening.
-       */
-      SH_MUTEX_LOCK(mutex_list_dormant);
-
-      for (litem = sh_inotify_list_first(&listcursor, watches); litem;
-	   litem = sh_inotify_list_next(&listcursor, watches))
-	{
-	have_next:
-	  /* sh_inotify_list_del_cur may return NULL */
-	  if (litem && litem->file && litem->watch == -1)
-	    {
-	      litem->watch = inotify_add_watch (ifd, litem->file, 
-						SH_INOTIFY_FLAGS);
-
-	      if (litem->watch >= 0)
-		{
-		  SH_MUTEX_LOCK(mutex_watches);
-		  if (watches->list_of_watches)
-		    zAVLInsert(watches->list_of_watches, litem);
-		  SH_MUTEX_UNLOCK(mutex_watches);
-		  litem = sh_inotify_list_del_cur(&listcursor, watches);
-		  goto have_next;
-		}
-	    }
-	}
-      SH_MUTEX_UNLOCK(mutex_list_dormant);
-
-
-      /* -- Blocking read on inotify file descriptor
-       */
-      len = sh_inotify_read(buffer, sizeof(buffer));
-
-      if (len > 0)
-	{
-	  struct inotify_event *event;
-
-	  i = 0;
-	  
-	  while (i < len) {
-
-	    event = (struct inotify_event *) &buffer[i];
-
-	    SH_MUTEX_LOCK(mutex_watches);
-	    zitem = zAVLSearch(watches->list_of_watches, &(event->wd));
-
-	    if (zitem)
-	      {
-		if (event->mask & IN_MODIFY)
-		  {
-		    zitem->flag |= SH_INOTIFY_MODIFY;
-		    flag |= SH_INOTIFY_MODIFY;
-		  }
-		else if (event->mask & IN_DELETE_SELF || 
-			 event->mask & IN_UNMOUNT     || 
-			 event->mask & IN_MOVE_SELF   )
-		  {
-		    zitem->flag |= SH_INOTIFY_REOPEN;
-		    (void) inotify_rm_watch(ifd, zitem->watch);
-		    zAVLDelete(watches->list_of_watches, zitem);
-		    sh_inotify_add_dormant(watches, zitem);
-		    zitem->watch    = -1;
-		    flag |= SH_INOTIFY_REOPEN;
-		  }
-	      }
-	    SH_MUTEX_UNLOCK(mutex_watches);
-	    
-	    i += sizeof (struct inotify_event) + event->len;
-	  }
-	}
-      else if (len == -1)
-	{
-	  *errnum = errno;
-	  retry_msleep(waitsec, 0);
-
-	  return -1;
-	}
-
-      if (flag & SH_INOTIFY_REOPEN)
-	{
-	  if (flag & SH_INOTIFY_MODIFY)
-	    return 0;
-	  else
-	    goto start_it;
-	}
-
-      return 0;
-    }
-
-  /* Inotify not working, sleep
-   */
-  retry_msleep(waitsec, 0);
-
-  *errnum = 0;
-  return -1;
-}
-
-
-/* !defined(HAVE_SYS_INOTIFY_H) */
-#else
-
-#include "sh_calls.h"
-#include "sh_inotify.h"
-
-void sh_inotify_remove(sh_watches * watches)
-{
-  (void) watches;
-  return;
-}
-
-int sh_inotify_wait_for_change(char * filename, sh_watches * watches,
-			       int *  errnum, int waitsec)
-{
-  (void) filename;
-  (void) watches;
-
-  /* Inotify not working, sleep for waitsec seconds
-   */
-  retry_msleep(waitsec, 0);
-
-  if (errnum)
-    *errnum = 0;
-  return -1;
-}
-
-int sh_inotify_add_watch(char * filename, sh_watches * watches, int  * errnum,
-			 int class, unsigned long check_flags, int type, int rdepth)
-{
-  (void) filename;
-  (void) watches;
-  (void) class;
-  (void) check_flags;
-  (void) type;
-  (void) rdepth;
-
-  if (errnum)
-    *errnum = 0;
-  return 0;
-}
-
-int sh_inotify_add_watch_later(const char * filename, sh_watches * watches, 
-			       int  * errnum,
-			       int class, unsigned long check_flags, int type, int rdepth)
-{
-  (void) filename;
-  (void) watches;
-  (void) class;
-  (void) check_flags;
-  (void) type;
-  (void) rdepth;
-
-  if (errnum)
-    *errnum = 0;
-  return 0;
-}
-
-#endif
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-void Test_inotify(CuTest *tc) {
-#if defined(HAVE_SYS_INOTIFY_H) && (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE))
-
-  int          ret;
-  sh_watches   twatch = SH_INOTIFY_INITIALIZER;
-  sh_watch   * litem;
-  sh_inotify_listCursor listcursor;
-  char * p;
-  int class;
-  int type;
-  int rdepth;
-  unsigned long check_flags;
-  int           nrun = 0;
-
-  sh_watch aw1 = { -1, 0, 0, 1, 99, 1, "a1" };
-  sh_watch aw2 = { -1, 0, 0, 2, 99, 1, "a2" };
-  sh_watch aw3 = {  2, 0, 0, 3, 99, 1, "a3" };
-  sh_watch aw4 = { -1, 0, 0, 4, 99, 1, "a4" };
-  sh_watch aw5 = {  5, 0, 0, 5, 99, 1, "a5" };
-
-  do {
-
-    int          count = 0;
-
-    sh_watch * w1 = SH_ALLOC(sizeof(sh_watch));
-    sh_watch * w2 = SH_ALLOC(sizeof(sh_watch));
-    sh_watch * w3 = SH_ALLOC(sizeof(sh_watch));
-    sh_watch * w4 = SH_ALLOC(sizeof(sh_watch));
-    sh_watch * w5 = SH_ALLOC(sizeof(sh_watch));
-
-    memcpy(w1, &aw1, sizeof(sh_watch));
-    w1->file = sh_util_strdup(aw1.file);
-    memcpy(w2, &aw2, sizeof(sh_watch));
-    w2->file = sh_util_strdup(aw2.file);
-    memcpy(w3, &aw3, sizeof(sh_watch));
-    w3->file = sh_util_strdup(aw3.file);
-    memcpy(w4, &aw4, sizeof(sh_watch));
-    w4->file = sh_util_strdup(aw4.file);
-    memcpy(w5, &aw5, sizeof(sh_watch));
-    w5->file = sh_util_strdup(aw5.file);
-    
-    ret = sh_inotify_add_dormant(&twatch, w1);
-    CuAssertIntEquals(tc, ret, 0);
-    ret = sh_inotify_add_dormant(&twatch, w2);
-    CuAssertIntEquals(tc, ret, 0);
-    ret = sh_inotify_add_dormant(&twatch, w3);
-    CuAssertIntEquals(tc, ret, 0);
-    ret = sh_inotify_add_dormant(&twatch, w4);
-    CuAssertIntEquals(tc, ret, 0);
-    ret = sh_inotify_add_dormant(&twatch, w5);
-    CuAssertIntEquals(tc, ret, 0);
-    
-    /* -- Check dormant watches for reopening.
-     */
-    for (litem = sh_inotify_list_first(&listcursor, &twatch); litem;
-	 litem = sh_inotify_list_next(&listcursor, &twatch))
-      {
-      have_next:
-	
-	/* sh_inotify_list_del_cur may return NULL */
-	if (litem)
-	  {
-	    ++count;
-	    
-	    if (litem->file && litem->watch == -1)
-	      {
-		
-		switch (litem->class)
-		  {
-		  case 1:
-		    CuAssertStrEquals(tc, litem->file, "a1");
-		    break;
-		  case 2:
-		    CuAssertStrEquals(tc, litem->file, "a2");
-		    break;
-		  case 3:
-		    CuAssertStrEquals(tc, litem->file, "deadbeef");
-		    break;
-		  case 4:
-		    CuAssertStrEquals(tc, litem->file, "a4");
-		    break;
-		  case 5:
-		    CuAssertStrEquals(tc, litem->file, "deadbeef");
-		    break;
-		  default:
-		    CuAssertStrEquals(tc, litem->file, "deadbeef");
-		  }
-		litem = sh_inotify_list_del_cur(&listcursor, &twatch);
-		goto have_next;
-	      }
-	    switch (litem->class)
-	      {
-	      case 3:
-		CuAssertStrEquals(tc, litem->file, "a3");
-		break;
-	      case 5:
-		CuAssertStrEquals(tc, litem->file, "a5");
-		break;
-	      default:
-		CuAssertStrEquals(tc, litem->file, "foobar");
-	      }      
-	  }
-      }
-    
-    CuAssertIntEquals(tc, count, 5);
-    
-    p = sh_inotify_pop_dormant(&twatch, &class, &check_flags, &type, &rdepth);
-    CuAssertStrEquals(tc, p, "a5");
-    
-    p = sh_inotify_pop_dormant(&twatch, &class, &check_flags, &type, &rdepth);
-    CuAssertStrEquals(tc, p, "a3");
-    CuAssertIntEquals(tc, class, 3);
-    
-    p = sh_inotify_pop_dormant(&twatch, &class, &check_flags, &type, &rdepth);
-    CuAssertTrue(tc, NULL == p);
-    CuAssertTrue(tc, NULL == twatch.dormant_watches);
-
-    ++nrun;
-
-  } while (nrun < 100);
-
-#else
-  (void) tc;
-#endif
-
-  return;
-}
-#endif
Index: trunk/src/sh_ipvx.c
===================================================================
--- trunk/src/sh_ipvx.c	(revision 591)
+++ 	(revision )
@@ -1,603 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2010 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <ctype.h>
-
-#undef  FIL__
-#define FIL__  _("sh_ipvx.c")
-
-#include "samhain.h"
-#define SH_NEED_GETHOSTBYXXX
-#include "sh_static.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_ipvx.h"
-
-static int sh_ipvx_is_ipv4 (const char * addr)
-{
-  int j;
-  int count = 0;
-  int len = sl_strlen(addr);
-  unsigned int a, b, c, d;
-  
-  if (len > 15) /* 3*4 + 3 dots */
-    return (1 == 0);
-
-  for (j = 0; j < len; ++j) {
-    if ( (addr[j] < '0' || addr[j] > '9') && addr[j] != '.')
-      return (1 == 0);
-    if (addr[j] == '.') ++count;
-  }
-
-  if (count != 3)
-    return (1 == 0);
-
-  if (sscanf(addr, "%3u.%3u.%3u.%3u", &a, &b, &c, &d) != 4)
-    return( 1 == 0 );
-
-  if ((a|b|c|d) > 255) 
-    return( 1 == 0 );
-
-  return (1 == 1);
-}
-
-#if defined(USE_IPVX)
-static int sh_ipvx_is_ipv6 (const char * addr)
-{
-  int j, k = 0;
-  char c;
-  int len = sl_strlen(addr);
-  
-  for (j = 0; j < len; ++j) {
-    c = addr[j];
-    if (( c < '0' || c > '9' ) &&
-	( c < 'a' || c > 'f' ) &&
-	( c < 'A' || c > 'F' ) &&
-	( c != ':') && ( c != '.'))
-      return (1 == 0);
-    else if (c == ':')
-      ++k;
-    else if (c == '.' && k < 2)
-      return (1 == 0); /* ::ffff:ipv4 */
-  }
-  if (k < 2 || k > 7)
-    return (1 == 0);
-
-  return (1 == 1);
-}
-#endif
-
-
-int sh_ipvx_is_numeric (const char * addr)
-{
-#if defined(USE_IPVX)
-  if (!sh_ipvx_is_ipv4(addr))
-    return sh_ipvx_is_ipv6(addr);
-  else
-    return (1 == 1);
-#else
-  return sh_ipvx_is_ipv4(addr);
-#endif
-}
-
-int sh_ipvx_isany (struct sh_sockaddr * a)
-{
-#if defined(HOST_IS_CYGWIN)
-  /* 
-   * Cygwin implementation gives 'missing braces around initializer'
-   * warning, thus replace it with correct version.
-   */
-#undef IN6ADDR_ANY_INIT
-#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
-#endif
-
-#if defined(USE_IPVX)
-  struct in6_addr anyaddr = IN6ADDR_ANY_INIT; 
-#endif
-
-  switch (a->ss_family)
-    {
-    case AF_INET:
-      if ((a->sin).sin_addr.s_addr == INADDR_ANY)
-	return 1;
-      break;
-#if defined(USE_IPVX)
-    case AF_INET6:
-      if (0 == memcmp(&((a->sin6).sin6_addr.s6_addr), &anyaddr, 16))
-	return 1;
-      break;
-#endif
-    }
-  return 0;
-}
-
-int sh_ipvx_cmp (struct sh_sockaddr * a, struct sh_sockaddr * b)
-{
-  if (a->ss_family != b->ss_family)
-    return 1;
-  
-  switch (a->ss_family)
-    {
-    case AF_INET:
-      return memcmp(&((a->sin).sin_addr.s_addr), &((b->sin).sin_addr.s_addr), 4);
-      break;
-#if defined(USE_IPVX)
-    case AF_INET6:
-      return memcmp(&((a->sin6).sin6_addr.s6_addr), &((b->sin6).sin6_addr.s6_addr), 16);
-      break;
-#endif
-    }
-  return 1;
-}
-
-int sh_ipvx_ntoa (char * name, size_t name_size, struct sh_sockaddr * ss)
-{
-#if defined(USE_IPVX)
-  int len = (ss->ss_family == AF_INET) ? 
-    sizeof(struct sockaddr_in) :
-    sizeof(struct sockaddr_in6);
-
-  int ret = getnameinfo(sh_ipvx_sockaddr_cast(ss), len,
-			name, name_size, NULL, 0, NI_NUMERICHOST);
-
-  if (ret != 0 && name_size > 0)
-    {
-      name[name_size-1] = '\0';
-
-      if (!sh_ipvx_is_numeric(name))
-	{
-	  if (name_size > 7) {
-	    name[0] = '0'; name[1] = '.'; name[2] = '0'; name[3] = '.'; 
-	    name[4] = '0'; name[5] = '.'; name[6] = '0'; name[7] = '\0';
-	  } else {
-	    name[0] = '\0';
-	  }
-	}
-    } 
-  return ret;
-#else
-  char * p = inet_ntoa((ss->sin).sin_addr);
-  sl_strlcpy(name, p, name_size);
-  return 0;
-#endif
-}
-
-struct sockaddr * sh_ipvx_sockaddr_cast (struct sh_sockaddr * ss)
-{
-#if defined(USE_IPVX)
-  if (ss->ss_family == AF_INET6)
-    return (struct sockaddr *) &(ss->sin6);
-#endif
-  return (struct sockaddr *) &(ss->sin);
-}
-
-char * sh_ipvx_print_sockaddr (struct sockaddr * sa, int sa_family)
-{
-  struct sh_sockaddr ss;
-  static char ipbuf[SH_IP_BUF];
-
-  memset(&ss, 0, sizeof(struct sh_sockaddr));
-  sh_ipvx_save(&ss, sa_family, sa);
-  sh_ipvx_ntoa (ipbuf, sizeof(ipbuf), &ss);
-  return ipbuf;
-}
-
-void sh_ipvx_save(struct sh_sockaddr * ss, int sa_family, struct sockaddr * sa)
-{
-  switch (sa_family)
-    {
-    case AF_INET:
-      ss->ss_family = AF_INET;
-      memcpy(&(ss->sin), (struct sockaddr_in*) sa, sizeof(struct sockaddr_in));
-      break;
-#if defined(USE_IPVX)
-    case AF_INET6:
-      ss->ss_family = AF_INET6;
-      memcpy(&(ss->sin6), (struct sockaddr_in6*) sa, sizeof(struct sockaddr_in6));
-      break;
-#endif
-    default:
-      break;
-    }
-  return;
-}
-
-int sh_ipvx_set_port(struct sh_sockaddr * ss, int port)
-{
-#if defined(USE_IPVX)
-
-  switch (ss->ss_family)
-    {
-    case AF_INET:
-      (ss->sin).sin_family = AF_INET;
-      (ss->sin).sin_port = htons (port);
-      break;
-    case AF_INET6:
-      (ss->sin6).sin6_family = AF_INET6;
-      (ss->sin6).sin6_port = htons (port);
-      break;
-    }
-  return 0;
-#else
-  (ss->sin).sin_family = AF_INET;
-  (ss->sin).sin_port = htons (port);
-  return 0;
-#endif
-}
-
-int sh_ipvx_get_port(struct sh_sockaddr * sa)
-{
-  int port = 0;
-#if defined(USE_IPVX)
-
-  switch (sa->ss_family)
-    {
-    case AF_INET:
-      port = ntohs((sa->sin).sin_port);
-      break;
-    case AF_INET6:
-      port = ntohs((sa->sin6).sin6_port);
-      break;
-    }
-#else
-  port = ntohs((sa->sin).sin_port);
-#endif
-  return port;
-}
-
-int sh_ipvx_aton (const char * name, struct sh_sockaddr * ss)
-{
-#if defined(USE_IPVX)
-  int             ret;
-  struct addrinfo hints;
-  struct addrinfo *res;
-
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = PF_UNSPEC;
-  hints.ai_flags  = AI_NUMERICHOST;
-  ret = getaddrinfo(name, NULL, &hints, &res);
-
-  if (ret)
-    return 0;
-
-  memset(ss, 0, sizeof(struct sh_sockaddr));
-  switch(res->ai_family)
-    {
-    case AF_INET:
-      memcpy(&(ss->sin), res->ai_addr, sizeof(struct sockaddr_in));
-      ss->ss_family = AF_INET;
-      break;
-    case AF_INET6:
-      memcpy(&(ss->sin6), res->ai_addr, sizeof(struct sockaddr_in6));
-      ss->ss_family = AF_INET6;
-      break;
-    default:
-      return 0;
-      break;
-    }
-  freeaddrinfo(res);
-  return 1;
-#else
-  int ret = inet_aton(name, &((ss->sin).sin_addr));
-  ss->ss_family = AF_INET;
-  return ret;
-#endif
-}
-
-#if !defined(USE_IPVX)
-static const char * sh_ipvx_h_name (struct hostent * host_entry)
-{
-  char ** p;
-  if (strchr(host_entry->h_name, '.')) {
-    return host_entry->h_name;
-  } else {
-    for (p = host_entry->h_aliases; (p && *p); ++p) {
-      if (strchr(*p, '.'))
-	return *p;
-    }
-  }
-  return host_entry->h_name;
-}
-#endif
-
-static char * sh_tolower (char * s)
-{
-  char * ret = s;
-  if (s)
-    {
-      for (; *s; ++s)
-	{ 
-	  *s = tolower((unsigned char) *s);
-	}
-    }
-  return ret;
-}
-
-void * sh_dummy_341_out;
-
-char * sh_ipvx_canonical(const char * hostname, char * numeric, size_t nlen)
-{
-  volatile int    flag = 0;
-  char            *out = NULL;
-#if defined(USE_IPVX)
-  struct addrinfo hints;
-  struct addrinfo *res;
-  struct sockaddr *sa;
-  int             salen;
-  int             err;
-  struct sh_sockaddr  ss;
-  const char * host;
-  char hostbuf[SH_BUFSIZE];
-
-  SL_ENTER(_("sh_ipvx_canonical"));
-  
-  numeric[0] = '\0';
-
-  sh_dummy_341_out = (void *) &out;
- 
-  if (sh_ipvx_is_numeric(hostname))
-    {
-      sh_ipvx_aton (hostname, &ss);
-      if (0 == getnameinfo(sh_ipvx_sockaddr_cast(&ss), SH_SS_LEN(ss),
-			   hostbuf, sizeof(hostbuf), NULL, 0, NI_NAMEREQD))
-	host = hostbuf;
-      else
-	host = hostname;
-    }
-  else
-    {
-      host = hostname;
-    }
- 
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = PF_UNSPEC;
-#if defined(AI_CANONNAME)
-  hints.ai_flags = AI_CANONNAME;
-#endif 
-
-  err = getaddrinfo(host, NULL, &hints, &res);
-  if (err == 0)
-    {
-      struct addrinfo * res_orig = res;
-
-#if defined(AI_CANONNAME)
-      if (res->ai_canonname && strlen(res->ai_canonname) > 0)
-	{
-	  out = sh_util_strdup(res->ai_canonname);
-	  sh_tolower (out);
-	  if (strchr(out, '.'))
-	    flag = 1;
-	}
-#endif
-
-      sa = res->ai_addr;
-      salen = res->ai_addrlen;
-      getnameinfo(sa, salen,
-		  numeric, nlen, NULL, 0, NI_NUMERICHOST);
-
-      if (!flag)
-	out = SH_ALLOC(SH_PATHBUF);
-
-      while (res && !flag) 
-	{
-	  sa = res->ai_addr;
-	  salen = res->ai_addrlen;
-
-	  getnameinfo(sa, salen,
-		      out, SH_PATHBUF, NULL, 0, 0);
-	  sh_tolower (out);
-	  if (strchr(out, '.'))
-	    flag = 1;
-	  
-	  res = res->ai_next;
-	}
-      
-      freeaddrinfo(res_orig);
-    }
-#else
-  struct hostent     *he;
-  struct sh_sockaddr  ss;
-  volatile int        isNum = 0;
-  struct sockaddr_in *sin;
-
-  SL_ENTER(_("sh_ipvx_canonical"));
-
-  numeric[0] = '\0';
-
-  sh_dummy_341_out = (void *) &out;
-
-  if (sh_ipvx_is_numeric(hostname))
-    {
-      sh_ipvx_aton (hostname, &ss);
-      isNum = 1;
-    }
- 
-
-  SH_MUTEX_LOCK(mutex_resolv);
-
-  if (isNum == 0)
-    {
-      he = sh_gethostbyname(hostname);
-    }
-  else
-    {
-      sin = (struct sockaddr_in *) sh_ipvx_sockaddr_cast(&ss);
-      he = sh_gethostbyaddr(&(sin->sin_addr), sizeof(sin->sin_addr), AF_INET);
-    }
-
-  if (he != NULL)
-    {
-      out = sh_util_strdup(sh_ipvx_h_name(he));
-      sh_tolower (out);
-      sl_strlcpy (numeric, 
-		  inet_ntoa (*(struct in_addr *) he->h_addr), 
-		  nlen);
-      flag = 1;
-    }
-  SH_MUTEX_UNLOCK(mutex_resolv);
-#endif
-
-  if (flag) {
-    SL_RETURN(out, _("sh_ipvx_canonical"));
-  }
-  
-  if (out)
-    SH_FREE(out);
-  if (numeric[0] == '\0')
-    sl_strlcpy (numeric, _("0.0.0.0"), nlen);
-  SL_RETURN(NULL, _("sh_ipvx_canonical"));
-}
-
-char * sh_ipvx_addrtoname(struct sh_sockaddr * ss)
-{
-#if defined(USE_IPVX)
-  char namebuf[SH_BUFSIZE];
-
-  if (getnameinfo(sh_ipvx_sockaddr_cast(ss), SH_SSP_LEN(ss),
-		  namebuf, sizeof(namebuf), NULL, 0, NI_NAMEREQD) != 0)
-    {
-      return NULL;
-    }
-  return sh_util_strdup(namebuf);
-#else
-  struct sockaddr_in *sin;
-  struct hostent *he;
-
-  sin = (struct sockaddr_in *) sh_ipvx_sockaddr_cast(ss);
-
-  he = sh_gethostbyaddr(&(sin->sin_addr), sizeof(sin->sin_addr), AF_INET);
-
-  if (he && he->h_name)
-    {
-      return sh_util_strdup(he->h_name);
-    }
-
-  return NULL;
-#endif
-}
-
-int sh_ipvx_reverse_check_ok (char * peer, int port, struct sh_sockaddr * ss)
-{
-#if defined(USE_IPVX)
-  struct addrinfo *res;
-  struct addrinfo hints;
-  char            sport[32];
-  struct addrinfo *p;
-
-  SL_ENTER(_("sh_ipvx_reverse_check_ok"));
-
-  sl_snprintf(sport, sizeof(sport), "%d", port);
-
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_socktype = SOCK_STREAM;
-  hints.ai_flags = AI_ADDRCONFIG;
-
-  if (getaddrinfo(peer, sport, &hints, &res) != 0)
-    {
-      SL_RETURN((0), _("sh_ipvx_reverse_check_ok")); 
-    }
-  
-  p = res;
-  while (p != NULL)
-    {
-      if (ss->ss_family == p->ai_family)
-	{
-	  struct sh_sockaddr pp;
-
-	  char dst1[SH_IP_BUF];
-	  char dst2[SH_IP_BUF];
-
-	  sh_ipvx_save(&pp, p->ai_family, p->ai_addr);
-
-	  sh_ipvx_ntoa (dst1, sizeof(dst1), &pp);
-	  sh_ipvx_ntoa (dst2, sizeof(dst2),  ss);
-
-	  if (0 == sl_strcmp(dst1, dst2))
-	    {
-	      SL_RETURN((1), _("sh_ipvx_reverse_check_ok")); 
-	    }
-	}
-      p = p->ai_next;
-    }
-  freeaddrinfo(res);
-#else
-  struct hostent * he;
-  char          ** p;
-  struct sockaddr_in * sin = (struct sockaddr_in *) sh_ipvx_sockaddr_cast(ss);
-
-  (void) port;
-
-  SL_ENTER(_("sh_ipvx_reverse_check_ok"));
-
-  he = sh_gethostbyname(peer);
-  if (he != NULL)
-    {
-      for (p = he->h_addr_list; *p; ++p)
-	{
-	  if (0 == memcmp (*p, &(sin->sin_addr), sizeof(in_addr_t)) ) {
-	    SL_RETURN((1), _("sh_ipvx_reverse_check_ok")); }
-	}
-    }
-#endif
-  SL_RETURN((0), _("sh_ipvx_reverse_check_ok"));
-}
-
-#ifdef SH_CUTEST
-#include <stdlib.h>
-#include "CuTest.h"
-
-void Test_ipvx (CuTest *tc) {
-
-  int result;
-
-  result = sh_ipvx_is_ipv4("123456789");
-  CuAssertTrue(tc, result == FALSE);
-
-  result = sh_ipvx_is_ipv4("123456789123...");
-  CuAssertTrue(tc, result == FALSE);
-
-  result = sh_ipvx_is_ipv4("123.456.789.123");
-  CuAssertTrue(tc, result == FALSE);
-
-  result = sh_ipvx_is_ipv4("123.156.189.254");
-  CuAssertTrue(tc, result == TRUE);
-
-  result = sh_ipvx_is_ipv4("255.255.255.255");
-  CuAssertTrue(tc, result == TRUE);
-
-  result = sh_ipvx_is_ipv4("0.0.0.0");
-  CuAssertTrue(tc, result == TRUE);
-
-  result = sh_ipvx_is_ipv4("0022.156.189.254");
-  CuAssertTrue(tc, result == FALSE);
-
-  result = sh_ipvx_is_ipv4("999999999.1.1.2");
-  CuAssertTrue(tc, result == FALSE);
-
-}
-#endif
-
Index: trunk/src/sh_kern.c
===================================================================
--- trunk/src/sh_kern.c	(revision 1)
+++ trunk/src/sh_kern.c	(revision 1)
@@ -0,0 +1,1897 @@
+/* SAMHAIN file system integrity testing                                   */
+/* Copyright (C) 2001 Rainer Wichmann                                      */
+/*                                                                         */
+/*  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.              */
+
+
+#include "config_xor.h"
+
+#define SH_SYSCALL_CODE
+
+#ifdef HOST_IS_I86LINUX
+#define SH_IDT_TABLE
+#define SH_PROC_CHECK
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <limits.h>
+#include <sys/wait.h>
+#include <signal.h>
+
+
+#ifdef SH_USE_KERN
+
+#undef  FIL__
+#define FIL__  _("sh_kern.c")
+
+#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+
+
+#include "samhain.h"
+#include "sh_utils.h"
+#include "sh_error.h"
+#include "sh_modules.h"
+#include "sh_kern.h"
+#include "sh_ks_xor.h"
+
+#include "sh_unix.h"
+#include "sh_hash.h"
+
+
+
+sh_rconf sh_kern_table[] = {
+  {
+    N_("severitykernel"),
+    sh_kern_set_severity
+  },
+  {
+    N_("kernelcheckactive"),
+    sh_kern_set_activate
+  },
+  {
+    N_("kernelcheckinterval"),
+    sh_kern_set_timer
+  },
+  {
+    N_("kernelcheckidt"),
+    sh_kern_set_idt
+  },
+  {
+    N_("kernelsystemcall"),
+    sh_kern_set_sc_addr
+  },
+  {
+    N_("kernelsyscalltable"),
+    sh_kern_set_sct_addr
+  },
+  {
+    N_("kernelprocrootlookup"),
+    sh_kern_set_proc_root_lookup
+  },
+ {
+    N_("kernelprocrootiops"),
+    sh_kern_set_proc_root_iops
+  },
+  {
+    N_("kernelprocroot"),
+    sh_kern_set_proc_root
+  },
+  {
+    NULL,
+    NULL
+  },
+};
+
+
+static time_t  lastcheck;
+static int     ShKernActive   = S_TRUE;
+static int     ShKernInterval = 300;
+static int     ShKernSeverity = SH_ERR_SEVERE;
+static int     ShKernDelay    = 100; /* milliseconds */
+static int     ShKernIDT      = S_TRUE;
+
+/* The address of system_call
+ */
+#ifdef SH_SYS_CALL_ADDR
+static unsigned long system_call_addr = SH_SYS_CALL_ADDR;
+#else
+static unsigned long system_call_addr = 0;
+#endif
+
+/* The address of the sys_call_table
+ */
+#ifdef SH_SYS_CALL_TABLE
+static unsigned int  kaddr = SH_SYS_CALL_TABLE;
+#else
+static unsigned int  kaddr = 0;
+#endif
+
+#ifdef PROC_ROOT_LOC
+static unsigned long proc_root = PROC_ROOT_LOC;
+#else
+static unsigned long proc_root = 0;
+#endif
+#ifdef PROC_ROOT_IOPS_LOC
+static unsigned long proc_root_iops = PROC_ROOT_IOPS_LOC;
+#else
+static unsigned long proc_root_iops = 0;
+#endif
+#ifdef PROC_ROOT_LOOKUP_LOC
+static unsigned long proc_root_lookup = PROC_ROOT_LOOKUP_LOC;
+#else
+static unsigned long proc_root_lookup = 0;
+#endif
+
+int sh_kern_null()
+{
+  return 0;
+}
+
+#ifdef SH_IDT_TABLE
+
+#include <asm/segment.h>
+
+#define SH_MAXIDT   256
+unsigned char sh_idt_table[SH_MAXIDT * 8];
+char * sh_strseg(unsigned short segment)
+{
+  switch (segment) {
+  case __KERNEL_CS:
+    return _("KERNEL_CS");
+  case __KERNEL_DS:
+    return _("KERNEL_DS");
+  case __USER_CS:
+    return _("USER_CS");
+  case __USER_DS:
+    return _("USER_DS");
+  default:
+    return _("unknown");
+  }
+}
+/* ifdef SH_IDT_TABLE */
+#endif
+
+static char * sh_kern_charhex( unsigned char i )
+{
+  static char i2h[2];
+  int j, k;
+
+  j = i / 16;
+  k = i - (j*16);
+
+  if (j < 10) i2h[0] = '0'+j;
+  else        i2h[0] = 'A'+(j-10);
+  
+  if (k < 10) i2h[1] = '0'+k;
+  else        i2h[1] = 'A'+(k-10);
+
+  return i2h;
+}
+
+static void sh_kern_push2db (char * name, unsigned long addr, 
+			     unsigned long code1, unsigned long code2,
+			     unsigned char * code, int size)
+{
+  file_type   tmpFile;
+  int         i = 0;
+  char      * p;
+
+  sl_strlcpy(tmpFile.fullpath, name, PATH_MAX);
+  tmpFile.size  = addr;
+  tmpFile.mtime = code1;
+  tmpFile.ctime = code2;
+
+  tmpFile.atime = 0;
+  tmpFile.mode  = 0;
+  tmpFile.owner = 0;
+  tmpFile.group = 0;
+  sl_strlcpy(tmpFile.c_owner, _("root"), 5);
+  sl_strlcpy(tmpFile.c_group, _("root"), 5);
+
+  if ((code != NULL) && (size < (PATH_MAX/2)-1))
+    {
+      tmpFile.c_mode[0] = 'l';  
+      tmpFile.c_mode[1] = 'r'; tmpFile.c_mode[2]  = 'w';
+      tmpFile.c_mode[3] = 'x'; tmpFile.c_mode[4]  = 'r'; 
+      tmpFile.c_mode[5] = 'w'; tmpFile.c_mode[6]  = 'x'; 
+      tmpFile.c_mode[7] = 'r'; tmpFile.c_mode[8]  = 'w'; 
+      tmpFile.c_mode[9] = 'x'; tmpFile.c_mode[10] = '\0'; 
+      for (i = 0; i < size; ++i)
+	{
+	  p = sh_kern_charhex (code[i]);
+	  tmpFile.linkpath[2*i]   = p[0];
+	  tmpFile.linkpath[2*i+1] = p[1];
+	  tmpFile.linkpath[2*i+2] = '\0';
+	}
+    }
+  else
+    {
+      tmpFile.c_mode[0] = '-';  
+      tmpFile.c_mode[1] = '-'; tmpFile.c_mode[2]  = '-';
+      tmpFile.c_mode[3] = '-'; tmpFile.c_mode[4]  = '-'; 
+      tmpFile.c_mode[5] = '-'; tmpFile.c_mode[6]  = '-'; 
+      tmpFile.c_mode[7] = '-'; tmpFile.c_mode[8]  = '-'; 
+      tmpFile.c_mode[9] = '-'; tmpFile.c_mode[10] = '\0'; 
+      tmpFile.linkpath[0] = '-'; tmpFile.linkpath[1] = '\0';
+    }
+
+  if (sh.flag.checkSum == SH_CHECK_CHECK && sh.flag.update == S_TRUE)
+    sh_hash_pushdata_memory (&tmpFile, 
+			     _("000000000000000000000000000000000000000000000000"));
+  else
+    sh_hash_pushdata (&tmpFile, 
+		      _("000000000000000000000000000000000000000000000000"));
+  return;
+}
+
+extern int sh_util_hextobinary (char * binary, char * hex, int bytes);
+
+static char * sh_kern_db2pop (char * name, unsigned long * addr, 
+			      unsigned long * code1, unsigned long * code2,
+			      int * size)
+{
+  file_type   tmpFile;
+  char      * p;
+  int         i;
+
+  if (0 == sh_hash_get_it (name, &tmpFile))
+    {
+      *addr  = tmpFile.size;
+      *code1 = tmpFile.mtime;
+      *code2 = tmpFile.ctime;
+
+      if (tmpFile.linkpath[0] != '-')
+	{
+	  p = SH_ALLOC(PATH_MAX);
+	  i = sh_util_hextobinary (p, tmpFile.linkpath, 
+				   strlen(tmpFile.linkpath));
+	  if (i == 0)
+	    {
+	      *size = (strlen(tmpFile.linkpath)/2);
+	      p[*size] = '\0';
+	      return p;
+	    }
+	  else
+	    {
+	      SH_FREE(p);
+	      *size = 0;
+	      return NULL;
+	    }
+	}
+      else
+	{
+	  *size = 0;
+	  return NULL;
+	}
+    }
+  else
+    {
+      *size = 0;
+      *addr = 0;
+      return NULL;
+    }
+}
+
+char * sh_kern_db_syscall (int num, char * prefix,
+			   void * in_name, unsigned long * addr,
+			   unsigned int * code1, unsigned int * code2,
+			   int * size, int direction)
+{
+  char          path[128];
+  char        * p = NULL;
+  unsigned long x1, x2;
+  char        * name = (char *) in_name;
+
+  sl_snprintf(path, 128, "K_%s_%04d", prefix, num);
+
+  if (direction == 0) 
+    {
+      x1 = *code1;
+      x2 = *code2;
+
+      sh_kern_push2db (path, *addr, x1, x2,
+		       name, (name == NULL) ? 0 : (*size));
+    }
+  else
+    {
+      p = sh_kern_db2pop (path, addr,  &x1, &x2, size);
+      *code1 = (unsigned int) x1;
+      *code2 = (unsigned int) x2;
+    }
+  return p;
+}
+ 
+#ifdef HOST_IS_LINUX
+
+int sh_kern_data_init ()
+{
+  unsigned long store0 = 0;
+  unsigned int  store1 = 0, store2 = 0;
+  int           datasize, i, j;
+  char        * databuf;
+
+#ifdef SH_SYSCALL_CODE
+  /* system_call code
+   */
+  databuf = sh_kern_db_syscall (0, _("system_call"), 
+				NULL, &store0, &store1, &store2,
+				&datasize, 1);
+  if (datasize == sizeof(system_call_code))
+    {
+      memcpy (system_call_code, databuf, sizeof(system_call_code));
+      SH_FREE(databuf);
+    }
+  else
+    {
+      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		      _("system_call_code not found in database"), 
+		      _("sh_kern_data_init"));
+      return -1;
+    }
+#endif
+
+  /* syscall address and code
+   */ 
+  for (i = 0; i < SH_MAXCALLS; ++i) 
+    {
+      databuf = sh_kern_db_syscall (i, _("syscall"), 
+				    NULL, &store0, &store1, &store2,
+				    &datasize, 1);
+      sh_syscalls[i].addr = store0;
+      if (store0 == 0) {
+	sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, i, MSG_E_SUBGEN,
+			_("syscall address not found in database"), 
+			_("sh_kern_data_init"));
+	return -1;
+      }
+#ifdef SH_SYSCALL_CODE
+      sh_syscalls[i].code[0] = (unsigned int) store1; 
+      sh_syscalls[i].code[1] = (unsigned int) store2;
+      if ((store1 == 0) || (store2 == 0)) {
+	sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, i, MSG_E_SUBGEN,
+			_("syscall code not found in database"), 
+			_("sh_kern_data_init"));
+	/* fprintf(stderr, "Syscall #%d\n", i); */
+	/* return -1; */
+      }
+#endif 
+      if (databuf != NULL) {
+	SH_FREE(databuf);
+      }
+      
+    }
+
+#ifdef SH_IDT_TABLE
+  if (ShKernIDT == S_TRUE)
+    {
+      for (j = 0; j < SH_MAXIDT; ++j) 
+	{
+	  databuf = sh_kern_db_syscall (j, _("idt_table"), 
+					NULL, 
+					&store0, &store1, &store2,
+					&datasize, 1);
+	  if (datasize == 8) {
+	    memcpy(&idt_table[j*8], databuf, 8);
+	    SH_FREE(databuf);
+	  } else {
+	    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, j, MSG_E_SUBGEN,
+			    _("idt table not found in database"), 
+			    _("sh_kern_data_init"));
+	    return -1;
+	  }
+	}
+    }
+#endif
+
+  return 0;
+}
+
+#ifdef SH_PROC_CHECK
+struct inode_operations {
+  int (*create) (int *,int *,int);
+  int * (*lookup) (int *,int *);
+  int (*link) (int *,int *,int *);
+  int (*unlink) (int *,int *);
+  int (*symlink) (int *,int *,const char *);
+  int (*mkdir) (int *,int *,int);
+  int (*rmdir) (int *,int *);
+  int (*mknod) (int *,int *,int,int);
+  int (*rename) (int *, int *,
+                 int *, int *);
+  int (*readlink) (int *, char *,int);
+  int (*follow_link) (int *, int *);
+  void (*truncate) (int *);
+  int (*permission) (int *, int);
+  int (*revalidate) (int *);
+  /*
+    int (*setattr) (int *, int *);
+    int (*getattr) (int *, int *);
+    int (*setxattr) (int *, const char *, void *, size_t, int);
+    ssize_t (*getxattr) (int *, const char *, void *, size_t);
+    ssize_t (*listxattr) (int *, char *, size_t);
+    int (*removexattr) (int *, const char *);
+  */
+};
+
+struct file_operations {
+  int (*create) (int *,int *,int);
+};
+
+struct proc_dir_entry {
+  unsigned short low_ino;
+  unsigned short namelen;
+  const char * name;
+  mode_t mode;
+  nlink_t nlink;
+  uid_t uid;
+  gid_t gid;
+  unsigned long size; 
+  struct inode_operations * proc_iops;
+  struct file_operations * proc_fops;
+  /*
+  get_info_t *get_info;
+  struct module *owner;
+  struct proc_dir_entry *next, *parent, *subdir;
+  void *data;
+  read_proc_t *read_proc;
+  write_proc_t *write_proc;
+  atomic_t count;         
+  int deleted;  
+  */          
+};
+#endif
+
+int sh_kern_check_internal ()
+{
+  static int is_init = 0;
+  int kd;
+  int res;
+  pid_t mpid;
+  int mpipe[2];
+  int i, j, status = 0;
+  /* unsigned int kaddr; */
+  unsigned long kmem_call_table[512];
+
+#ifdef SH_PROC_CHECK
+  struct inode_operations proc_root_inode;
+  struct proc_dir_entry proc_root_dir;
+#endif
+
+#ifdef SH_SYSCALL_CODE
+  unsigned int kmem_code_table[512][2];
+#endif
+#ifdef SH_IDT_TABLE
+  unsigned char  buf[6];
+  unsigned short idt_size;
+  unsigned long  idt_addr;
+  /* int            k, curr_keep = 0; */
+  unsigned short idt_offset_lo, idt_offset_hi, idt_selector;
+  unsigned char  idt_reserved, idt_flag;
+  unsigned short sh_idt_offset_lo, sh_idt_offset_hi, sh_idt_selector;
+  unsigned char  sh_idt_reserved, sh_idt_flag;
+  int            dpl;
+  unsigned long  idt_iaddr;
+  int            sh_dpl;
+  unsigned long  sh_idt_iaddr;
+  char           idt_type, sh_idt_type;
+#endif
+
+  unsigned char new_system_call_code[256];
+
+#ifdef SH_USE_LKM
+  static int check_getdents      = 0;
+  /* #ifdef __NR_getdents64 */
+  static int check_getdents64    = 0;
+  /* #endif */
+  static int copy_if_next        = -1;
+  static int copy_if_next_64     = -1;
+#endif
+
+  unsigned long store0;
+  unsigned int  store1, store2;
+  int           datasize;
+  int           mod_syscall_addr = 0;
+  int           mod_syscall_code = 0;
+  UINT64        size_old  = 0, size_new = 0;
+  UINT64        mtime_old = 0, mtime_new = 0;
+  UINT64        ctime_old = 0, ctime_new = 0;
+  char          tmp[128];
+  char          msg[2*SH_BUFSIZE];
+  char timstr_o[32];
+  char timstr_n[32];
+  char * p;
+  int    k;
+  char * linkpath_old;
+  char * linkpath_new;
+
+  int           max_system_call = (SYS_CALL_LOC < 128) ? 128 : SYS_CALL_LOC;
+
+  SL_ENTER(_("sh_kern_check_internal"));
+
+  
+  if (is_init == 0)
+    {
+      if (sh.flag.checkSum != SH_CHECK_INIT && sh.flag.update != S_TRUE)
+	{
+	  if (0 == sh_kern_data_init()) {
+	    is_init = 1;
+	  } else {
+	    sh_error_handle (ShKernSeverity, FIL__, __LINE__, status, 
+			     MSG_E_SUBGEN,
+			     _("could not initialize - switching off"),
+			     _("kern_check_internal") );
+	    ShKernActive = S_FALSE;
+	    SL_RETURN( (-1), _("sh_kern_check_internal"));
+	  }
+	}
+      else if ((sh.flag.checkSum == SH_CHECK_INIT || 
+		sh.flag.checkSum == SH_CHECK_CHECK) && 
+	       (sh.flag.update == S_TRUE))
+	{
+	  if (0 == sh_kern_data_init()) {
+	    is_init = 1;
+	  } else {
+	    sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, status, 
+			     MSG_E_SUBGEN,
+			     _("no or incomplete data in baseline database"),
+			     _("kern_check_internal") );
+	  }
+	}
+    }
+
+  /*
+   * kaddr is the address of the sys_call_table
+   */
+
+  if (kaddr == (unsigned int) -1)
+    {
+      sh_error_handle (ShKernSeverity, FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       _("no address for sys_call_table - switching off"),
+		       _("kern_check_internal") );
+      ShKernActive = S_FALSE;
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+  
+  kd = aud_open(FIL__, __LINE__, SL_YESPRIV, _("/dev/kmem"), O_RDONLY, 0);
+  
+  if (kd < 0)
+    {
+      status = errno;
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       _("error opening /dev/kmem"),
+		       _("kern_check_internal") );
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+
+  status = aud_pipe(FIL__, __LINE__, mpipe);
+
+  if (status == 0)
+    {
+      mpid = aud_fork(FIL__, __LINE__);
+
+      switch (mpid) 
+	{
+	case -1:
+	  status = -1;
+	  break;
+	case 0:                       /* child */
+	  status = close(mpipe[0]);
+	  setpgid(0, 0);
+	  
+	  /* Seek to the system call table (at kaddr) and read it into
+	   * the kmem_call_table array
+	   */
+	  if(status == 0)
+	    {
+	      if(lseek(kd, (off_t)kaddr, SEEK_SET) == -1)
+		{
+		  status = -2;
+		}
+	    }
+	  if(status == 0)
+	    {
+	      retry_msleep (0, ShKernDelay); /* milliseconds */
+	      if (sizeof(kmem_call_table) != 
+		  read(kd, &kmem_call_table, sizeof(kmem_call_table)))
+		{
+		  status = -3;
+		}
+	    }
+
+#ifdef SH_SYSCALL_CODE
+	  /* 
+	   * Seek to the system call address (at sh_syscalls[j].addr) and 
+	   * read first 8 bytes into kmem_code_table[j][] (2 * unsigned int)
+	   */
+	  if(status == 0)
+	    {
+	      memset(kmem_code_table, 0, sizeof(kmem_code_table));
+	      for (j = 0; j < SH_MAXCALLS; ++j) 
+		{
+
+		  if (sh_syscalls[j].addr == 0UL) {
+		    sh_syscalls[j].addr = kmem_call_table[j];
+		  }
+
+		  if (sh_syscalls[j].name == NULL || 
+		      sh_syscalls[j].addr == 0UL)
+		    break;
+
+		  if ((sh.flag.checkSum == SH_CHECK_INIT || 
+		       sh.flag.checkSum == SH_CHECK_CHECK) && 
+		      (sh.flag.update == S_TRUE))
+		    {
+		      lseek (kd, kmem_call_table[j], SEEK_SET);
+		    }
+		  else
+		    {
+		      lseek (kd, sh_syscalls[j].addr, SEEK_SET);
+		    }
+		  read  (kd, &(kmem_code_table[j][0]), 
+			 2 * sizeof(unsigned int));
+		}
+	    }
+#endif
+
+#ifdef SH_IDT_TABLE
+	  if(status == 0)
+	    {
+	      /* 
+	       * Get the address and size of Interrupt Descriptor Table,
+	       * and read the content into sh_idt_table[]
+	       */
+	      __asm__ volatile ("sidt %0": "=m" (buf));
+	      idt_size = *((unsigned short *) &buf[0]);
+	      idt_addr = *((unsigned long *)  &buf[2]);
+	      idt_size = (idt_size + 1)/8;
+
+	      if (idt_size > SH_MAXIDT)
+		idt_size = SH_MAXIDT;
+
+	      memset(sh_idt_table, '\0', SH_MAXIDT*8);
+	      lseek (kd, idt_addr, SEEK_SET);
+	      read  (kd, sh_idt_table, idt_size*8);
+	    }
+#endif
+
+	  /* 
+	   * Seek to the system_call address (at system_call_addr) and 
+	   * read first 256 bytes into new_system_call_code[]
+	   *
+	   * system_call_addr is defined in the include file.
+	   */
+	  if(status == 0)
+	    {
+	      lseek (kd, system_call_addr, SEEK_SET);
+	      read  (kd, new_system_call_code, 256);
+	    }
+
+
+	  /* 
+	   * Seek to proc_root and read the structure.
+	   * Seek to proc_root_inode_operations and get the structure.
+	   */
+#ifdef SH_PROC_CHECK
+	  if(status == 0)
+	    {
+	      lseek (kd, proc_root, SEEK_SET);
+	      read  (kd, &proc_root_dir, sizeof(proc_root_dir));
+	      lseek (kd, proc_root_iops, SEEK_SET);
+	      read  (kd, &proc_root_inode, sizeof(proc_root_inode));
+	    }
+#endif
+
+	  if(status == 0)
+	    {
+	      status = 
+		write(mpipe[1], &kmem_call_table, sizeof(kmem_call_table));
+#ifdef SH_SYSCALL_CODE
+	      if(status > 0)
+		{
+		  status = 
+		    write(mpipe[1], &kmem_code_table, sizeof(kmem_code_table));
+		}
+#endif
+#ifdef SH_IDT_TABLE
+	      if(status > 0)
+		{
+		  status = 
+		    write(mpipe[1], &sh_idt_table, sizeof(sh_idt_table));
+		}
+#endif
+	      if(status > 0)
+		{
+		  status = 
+		    write(mpipe[1], new_system_call_code, 256);
+		}
+#ifdef SH_PROC_CHECK
+	      if(status > 0)
+		{
+		  status = 
+		    write(mpipe[1], &proc_root_dir, sizeof(proc_root_dir));
+		}
+	      if(status > 0)
+		{
+		  status = 
+		    write(mpipe[1], &proc_root_inode, sizeof(proc_root_inode));
+		}
+#endif
+	    }
+	  _exit( (status >= 0) ? 0 : status);
+	  break;
+	  
+	default:
+	  close (mpipe[1]);
+	  close (kd);
+	  retry_msleep (0, ShKernDelay); /* milliseconds */
+	  if (sizeof(kmem_call_table) != 
+	      read(mpipe[0], &kmem_call_table, sizeof(kmem_call_table)))
+	    status = -4;
+	  else
+	    status = 0;
+
+#ifdef SH_SYSCALL_CODE
+	  if(status == 0)
+	    {
+	      if (sizeof(kmem_code_table) != 
+		  read(mpipe[0], &kmem_code_table, sizeof(kmem_code_table)))
+		status = -5;
+	      else
+		status = 0;
+	    }
+#endif	  
+
+#ifdef SH_IDT_TABLE
+	  if(status == 0)
+	    {
+	      memset(sh_idt_table, '\0', SH_MAXIDT*8);
+	      if (sizeof(sh_idt_table) != 
+		  read(mpipe[0], &sh_idt_table, sizeof(sh_idt_table)))
+		status = -5;
+	      else
+		status = 0;
+	    }
+#endif	  
+
+	  if(status == 0)
+	    {
+	      if (256 != read(mpipe[0], new_system_call_code, 256))
+		status = -6;
+	      else
+		status = 0;
+	    }
+
+#ifdef SH_PROC_CHECK
+	  if(status == 0)
+	    {
+	      if (sizeof(proc_root_dir) !=
+		  read(mpipe[0], &proc_root_dir, sizeof(proc_root_dir)))
+		status = -7;
+	      else
+		status = 0;
+	    }
+	  if(status == 0)
+	    {
+	      if (sizeof(proc_root_inode) !=
+		  read(mpipe[0], &proc_root_inode, sizeof(proc_root_inode)))
+		status = -8;
+	      else
+		status = 0;
+	    }
+#endif
+
+	  if (status < 0)
+	    res = waitpid(mpid, NULL,    WNOHANG|WUNTRACED);
+	  else 
+	    {
+	      res = waitpid(mpid, &status, WNOHANG|WUNTRACED);
+	      if (res == 0 && 0 != WIFEXITED(status))
+		status = WEXITSTATUS(status);
+	    }
+	  close (mpipe[0]);
+	  if (res <= 0)
+	    {
+	      aud_kill(FIL__, __LINE__, mpid, 9);
+	      waitpid(mpid, NULL, 0);
+	    }
+	  break;
+	}
+    }
+
+  if ( status < 0)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       _("error reading from /dev/kmem"),
+		       _("kern_check_internal") );
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+
+  /* Check the proc_root inode.
+   *
+   * This will detect adore-ng.
+   */
+  if ( (unsigned int) *proc_root_inode.lookup != proc_root_lookup)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_KERN_PROC,
+		       _("proc_root_inode_operations.lookup != proc_root_lookup"));
+    }
+  else if ( ( ((unsigned int) * &proc_root_dir.proc_iops) != proc_root_iops) &&
+       (proc_root_dir.size != proc_root_iops))
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_KERN_PROC,
+		       _("proc_root.proc_iops != proc_root_inode_operations"));
+    }
+
+  /* Check the system_call syscall gate.
+   *
+   * Stored(old) is system_call_code[]
+   */
+  if (sh.flag.checkSum == SH_CHECK_INIT)
+    {
+      store0 = 0; store1 = 0; store2 = 0;
+      datasize = sizeof(system_call_code);
+      sh_kern_db_syscall (0, _("system_call"), 
+			  new_system_call_code, &store0, &store1, &store2,
+			  &datasize, 0);
+    }
+
+  if ((sh.flag.checkSum != SH_CHECK_INIT) || 
+      (sh.flag.update == S_TRUE && is_init == 1))
+    {
+      for (i = 0; i < (max_system_call + 4); ++i) 
+	{
+	  if (system_call_code[i] != new_system_call_code[i])
+	    {
+#ifdef SH_USE_XML
+	      sl_snprintf(tmp, 128, "path=\"K_%s_%04d\" ", 
+			  _("system_call"), 0);
+#else
+	      sl_snprintf(tmp, 128, "path=<K_%s_%04d>, ", 
+			  _("system_call"), 0);
+#endif
+	      sl_strlcpy(msg, tmp, SH_BUFSIZE);
+
+	      linkpath_old = SH_ALLOC(520);
+	      linkpath_new = SH_ALLOC(520);
+	      for (k = 0; k < 256; ++k)
+		{
+		  p = sh_kern_charhex (system_call_code[k]);
+		  linkpath_old[2*k]   = p[0];
+		  linkpath_old[2*k+1] = p[1];
+		  linkpath_old[2*k+2] = '\0';
+		}
+	      for (k = 0; k < 256; ++k)
+		{
+		  p = sh_kern_charhex (new_system_call_code[k]);
+		  linkpath_new[2*k]   = p[0];
+		  linkpath_new[2*k+1] = p[1];
+		  linkpath_new[2*k+2] = '\0';
+		}
+#ifdef SH_USE_XML
+	      sl_strlcat(msg, _("link_old=\""),    2*SH_BUFSIZE);
+	      sl_strlcat(msg, linkpath_old,        2*SH_BUFSIZE);
+	      sl_strlcat(msg, _("\" link_new=\""), 2*SH_BUFSIZE);
+	      sl_strlcat(msg, linkpath_new,        2*SH_BUFSIZE);
+	      sl_strlcat(msg, _("\""),             2*SH_BUFSIZE);
+#else
+	      sl_strlcat(msg, _("link_old=<"),     2*SH_BUFSIZE);
+	      sl_strlcat(msg, linkpath_old,        2*SH_BUFSIZE);
+	      sl_strlcat(msg, _(">, link_new=<"),   2*SH_BUFSIZE);
+	      sl_strlcat(msg, linkpath_new,        2*SH_BUFSIZE);
+	      sl_strlcat(msg, _(">"),              2*SH_BUFSIZE);
+#endif
+
+	      sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+			       status, MSG_KERN_GATE,
+			       new_system_call_code[i], 0,
+			       system_call_code[i], 0,
+			       0, _("system_call (interrupt handler)"),
+			       msg);
+	      
+	      SH_FREE(linkpath_old);
+	      SH_FREE(linkpath_new);
+
+	      for (j = 0; j < (max_system_call + 4); ++j)
+		system_call_code[j] = new_system_call_code[j];
+	      break;
+	    }
+	}
+    }
+  
+  /* Check the individual syscalls
+   *
+   * Stored(old) is sh_syscalls[] array.
+   */
+  if (sh.flag.checkSum == SH_CHECK_INIT)
+    {
+      for (i = 0; i < SH_MAXCALLS; ++i) 
+	{
+	  store0 = kmem_call_table[i]; 
+#ifdef SH_SYSCALL_CODE
+	  store1 = kmem_code_table[i][0]; store2 = kmem_code_table[i][1];
+#else
+	  store1 = 0; store2 = 0;
+#endif
+	  sh_kern_db_syscall (i, _("syscall"), 
+			      NULL, &store0, &store1, &store2,
+			      0, 0);
+	}
+    }
+
+  if ((sh.flag.checkSum != SH_CHECK_INIT) || 
+      (sh.flag.update == S_TRUE && is_init == 1))
+    {
+      for (i = 0; i < SH_MAXCALLS; ++i) 
+	{
+	  if (sh_syscalls[i].name == NULL /* || sh_syscalls[i].addr == 0UL */)
+	    break;
+
+#ifdef SH_USE_LKM
+	  if (sh_syscalls[i].addr != kmem_call_table[i])
+	    {
+	      if (check_getdents == 0 && 
+		  0 == strcmp(_(sh_syscalls[i].name), _("sys_getdents")))
+		{
+		  check_getdents = 1;
+		  sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 
+				   status, MSG_E_SUBGEN,
+				   _("Modified kernel syscall (expected)."),
+				   _(sh_syscalls[i].name) );
+		  copy_if_next = i;
+		  sh_syscalls[i].addr = kmem_call_table[i];
+		  continue;
+		}
+	      /* #ifdef __NR_getdents64 */
+	      else if  (check_getdents64 == 0 && 
+			0 == strcmp(_(sh_syscalls[i].name), 
+				    _("sys_getdents64")))
+		{
+		  check_getdents64 = 1;
+		  sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 
+				   status, MSG_E_SUBGEN,
+				   _("Modified kernel syscall (expected)."),
+				   _(sh_syscalls[i].name) );
+		  copy_if_next_64 = i;
+		  sh_syscalls[i].addr = kmem_call_table[i];
+		  continue;
+		}
+	      /* #endif */
+	      else
+		{
+		  size_old = sh_syscalls[i].addr;
+		  size_new = kmem_call_table[i];
+		  mod_syscall_addr = 1;
+		  /*
+		  sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+				   status, MSG_KERN_POLICY,
+				   kmem_call_table[i],
+				   sh_syscalls[i].addr,
+				   i, _(sh_syscalls[i].name)
+				   );
+		  */
+		}
+	      sh_syscalls[i].addr = kmem_call_table[i];
+	    }
+#else
+	  if (sh_syscalls[i].addr != kmem_call_table[i])
+	    {
+	      size_old = sh_syscalls[i].addr;
+	      size_new = kmem_call_table[i];
+	      mod_syscall_addr = 1;
+	      /*
+	      sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+			       status, MSG_KERN_POLICY,
+			       kmem_call_table[i],
+			       sh_syscalls[i].addr,
+			       i, _(sh_syscalls[i].name)
+			       );
+	      */
+	      sh_syscalls[i].addr = kmem_call_table[i];
+	    }
+#endif
+
+
+	  /* Check the code at syscall address
+	   *
+	   * Stored(old) is sh_syscalls[]
+	   */
+#ifdef SH_SYSCALL_CODE
+	  if ( (mod_syscall_addr == 0) && 
+	       ((sh_syscalls[i].code[0] != kmem_code_table[i][0]) || 
+		(sh_syscalls[i].code[1] != kmem_code_table[i][1]))
+	       )
+	    {
+	      mtime_old = sh_syscalls[i].code[0];
+	      mtime_new = kmem_code_table[i][0];
+	      ctime_old = sh_syscalls[i].code[1];
+	      ctime_new = kmem_code_table[i][1];
+	      mod_syscall_code = 1;
+
+#ifdef SH_USE_LKM
+	      if (i == copy_if_next)
+		{
+		  mod_syscall_code =  0;
+		  copy_if_next     = -1;
+		}
+	      if (i == copy_if_next_64)
+		{
+		  mod_syscall_code =  0;
+		  copy_if_next_64  = -1;
+		}
+#endif
+
+	      /*
+	      sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+			       status, MSG_KERN_POL_CO,
+			       kmem_code_table[i][0],  kmem_code_table[i][1],
+			       sh_syscalls[i].code[0], sh_syscalls[i].code[1],
+			       i, _(sh_syscalls[i].name)
+			       );
+	      */
+	      sh_syscalls[i].code[0] = kmem_code_table[i][0];
+	      sh_syscalls[i].code[1] = kmem_code_table[i][1];
+	    }
+#endif
+	  /*
+	   * Build the error message, if something has been
+	   * detected.
+	   */
+	  if ((mod_syscall_addr != 0) || (mod_syscall_code != 0))
+	    {
+#ifdef SH_USE_XML
+	      sl_snprintf(tmp, 128, "path=\"K_%s_%04d\" ", 
+			  _("syscall"), i);
+#else
+	      sl_snprintf(tmp, 128, "path=<K_%s_%04d>, ", 
+			  _("syscall"), i);
+#endif
+	      sl_strlcpy(msg, tmp, SH_BUFSIZE);
+
+	      if (mod_syscall_addr != 0)
+		{
+		  sl_snprintf(tmp, 128, sh_hash_size_format(),
+			      size_old, size_new);
+		  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+		}
+	      if (mod_syscall_code != 0)
+		{
+		  sl_strlcpy (timstr_o, sh_unix_gmttime (ctime_old), 32);
+		  sl_strlcpy (timstr_n, sh_unix_gmttime (ctime_new), 32);
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, 
+			      _("ctime_old=\"%s\" ctime_new=\"%s\" "), 
+			      timstr_o, timstr_n);
+#else
+		  sl_snprintf(tmp, 128, 
+			      _("ctime_old=<%s>, ctime_new=<%s>, "), 
+			      timstr_o, timstr_n);
+#endif
+		  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+		  sl_strlcpy (timstr_o, sh_unix_gmttime (mtime_old), 32);
+		  sl_strlcpy (timstr_n, sh_unix_gmttime (mtime_new), 32);
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, 
+			      _("mtime_old=\"%s\" mtime_new=\"%s\" "), 
+			      timstr_o, timstr_n);
+#else
+		  sl_snprintf(tmp, 128, 
+			      _("mtime_old=<%s>, mtime_new=<%s> "), 
+			      timstr_o, timstr_n);
+#endif
+		  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+		}
+	      sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+			       status, MSG_KERN_SYSCALL,
+			       i, _(sh_syscalls[i].name), msg);
+	      mod_syscall_addr = 0;
+	      mod_syscall_code = 0;
+	    }
+	}
+    }
+
+#ifdef SH_IDT_TABLE
+  if (ShKernIDT == S_TRUE)
+    {
+      if (sh.flag.checkSum == SH_CHECK_INIT)
+	{
+	  datasize = 8;
+	  for (j = 0; j < SH_MAXIDT; ++j) 
+	    {
+	      sh_kern_db_syscall (j, _("idt_table"), 
+				  &sh_idt_table[j*8], 
+				  &store0, &store1, &store2,
+				  &datasize, 0);
+	    }
+	}
+
+      if ((sh.flag.checkSum != SH_CHECK_INIT) || 
+	  (sh.flag.update == S_TRUE && is_init == 1))
+	{
+	  /* Check the Interrupt Descriptor Table
+	   *
+	   * Stored(old) is idt_table[]
+	   */
+	  for (j = 0; j < SH_MAXIDT; ++j)
+	    {
+	      i = j * 8;
+	  
+	      sh_idt_offset_lo = *((unsigned short *) &sh_idt_table[i]);
+	      sh_idt_selector  = *((unsigned short *) &sh_idt_table[i+2]);
+	      sh_idt_reserved  = (unsigned char) sh_idt_table[i+4];
+	      sh_idt_flag      = (unsigned char) sh_idt_table[i+5];
+	      sh_idt_offset_hi = *((unsigned short *) &sh_idt_table[i+6]);
+	      sh_idt_iaddr = (unsigned long)(sh_idt_offset_hi << 16) 
+		+ sh_idt_offset_lo;
+	      
+	      if (sh_idt_iaddr == 0)
+		{
+		  sh_idt_table[i+2] = '\0';
+		  sh_idt_table[i+3] = '\0';
+		  sh_idt_table[i+5] = '\0';
+
+		  idt_offset_lo = *((unsigned short *) &idt_table[i]);
+		  idt_offset_hi = *((unsigned short *) &idt_table[i+6]);
+		  idt_iaddr = (unsigned long)(idt_offset_hi << 16) 
+		    + idt_offset_lo;
+		  if (idt_iaddr == 0)
+		    {
+		      idt_table[i+2] = '\0';
+		      idt_table[i+3] = '\0';
+		      idt_table[i+5] = '\0';
+		    }
+		  
+		}
+	  
+	      if (memcmp(&sh_idt_table[i], &idt_table[i], 8) != 0)
+		{
+		  
+		  idt_offset_lo = *((unsigned short *) &idt_table[i]);
+		  idt_selector  = *((unsigned short *) &idt_table[i+2]);
+		  idt_reserved  = (unsigned char) idt_table[i+4];
+		  idt_flag      = (unsigned char) idt_table[i+5];
+		  idt_offset_hi = *((unsigned short *) &idt_table[i+6]);
+		  idt_iaddr = (unsigned long)(idt_offset_hi << 16) 
+		    + idt_offset_lo;
+	      
+		  if (idt_iaddr != 0)
+		    {
+		      if (idt_flag & 64) { dpl = 3; }
+		      else               { dpl = 0; }
+		      if (idt_flag & 1)  { 
+			if (dpl == 3) idt_type = 'S'; 
+			else idt_type = 'T'; }
+		      else               { idt_type = 'I'; }
+		    }
+		  else { dpl = -1; idt_type = 'U'; }
+		  
+		  if (sh_idt_iaddr != 0)
+		    {
+		      if (sh_idt_flag & 64) { sh_dpl = 3; }
+		      else               { sh_dpl = 0; }
+		      if (sh_idt_flag & 1)  { 
+			if (sh_dpl == 3) sh_idt_type = 'S'; 
+			else sh_idt_type = 'T'; }
+		      else               { sh_idt_type = 'I'; }
+		    }
+		  else { sh_dpl = -1; sh_idt_type = 'U'; }
+		  
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, "path=\"K_%s_%04d\" ", 
+			      _("idt_table"), j);
+#else
+		  sl_snprintf(tmp, 128, "path=<K_%s_%04d> ", 
+			      _("idt_table"), j);
+#endif
+		  sl_strlcpy(msg, tmp, SH_BUFSIZE);
+
+		  linkpath_old = SH_ALLOC(32);
+		  linkpath_new = SH_ALLOC(32);
+		  for (k = 0; k < 8; ++k)
+		    {
+		      p = sh_kern_charhex (idt_table[i+k]);
+		      linkpath_old[2*k]   = p[0];
+		      linkpath_old[2*k+1] = p[1];
+		      linkpath_old[2*k+2] = '\0';
+		    }
+		  for (k = 0; k < 8; ++k)
+		    {
+		      p = sh_kern_charhex (sh_idt_table[i+k]);
+		      linkpath_new[2*k]   = p[0];
+		      linkpath_new[2*k+1] = p[1];
+		      linkpath_new[2*k+2] = '\0';
+		    }
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128,
+			      _("link_old=\"%s\" link_new=\"%s\" "), 
+			      linkpath_old, linkpath_new);
+#else
+		  sl_snprintf(tmp, 128,
+			      _("link_old=<%s> link_new=<%s> "), 
+			      linkpath_old, linkpath_new);
+#endif
+		  sl_strlcat(msg, tmp, SH_BUFSIZE);
+
+		  sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+				   status, MSG_KERN_IDT,
+				   j, 
+				   sh_idt_iaddr, sh_strseg(sh_idt_selector), 
+				   (int) sh_dpl, sh_idt_type, 
+				   idt_iaddr, sh_strseg(idt_selector),
+				   (int) dpl, idt_type, msg);
+		  
+		  SH_FREE(linkpath_old);
+		  SH_FREE(linkpath_new);
+
+		  memcpy(&idt_table[i], &sh_idt_table[i], 8);
+		}
+	    }
+	}
+    }
+#endif
+
+  SL_RETURN( (0), _("sh_kern_check_internal"));
+}
+/* ifdef HOST_IS_LINUX */
+#else
+
+#include <err.h>
+#include <kvm.h>
+#include <nlist.h>
+
+/* not OpenBSD */
+#if defined(HOST_IS_FREEBSD)
+#include <sys/sysent.h>
+#endif
+
+#include <sys/syscall.h>
+#ifndef  SYS_MAXSYSCALL
+#define  SYS_MAXSYSCALL	512
+#endif
+
+#ifdef __OpenBSD__
+struct proc;
+struct sysent {
+	short sy_narg;
+	short sy_argsize;
+	int   (*sy_call)(struct proc *, void *, register_t *);
+};
+#endif
+
+int sh_kern_data_init ()
+{
+  unsigned long store0 = 0;
+  unsigned int  store1 = 0, store2 = 0;
+  int           datasize, i;
+  char        * databuf = NULL;
+
+  /* syscall address and code
+   */ 
+  for (i = 0; i < SH_MAXCALLS; ++i) 
+    {
+      databuf = sh_kern_db_syscall (i, _("syscall"), 
+				    NULL, &store0, &store1, &store2,
+				    &datasize, 1);
+      sh_syscalls[i].addr = store0;
+      if (databuf != NULL) { SH_FREE(databuf); }
+      if (store0 == 0) {
+	sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			_("syscall address not found in database"), 
+			_("sh_kern_data_init"));
+	return -1;
+      }
+
+      sh_syscalls[i].code[0] = (unsigned int) store1; 
+      sh_syscalls[i].code[1] = (unsigned int) store2;
+      if ((store1 == 0) || (store2 == 0)) {
+	sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			_("syscall code not found in database"), 
+			_("sh_kern_data_init"));
+	return -1;
+      }
+
+    }
+
+  return 0;
+}
+
+int sh_kern_check_internal ()
+{
+  struct sysent  sy;
+  kvm_t * kd;
+  int     i;
+  int     status = -1;
+  char    errbuf[_POSIX2_LINE_MAX+1];
+  struct  nlist * sys_list;
+  struct  nlist list[2];
+
+  unsigned long offset = 0L;
+  unsigned int  syscall_code[2];  /* 8 bytes */
+  unsigned long syscall_addr;
+
+  unsigned long store0 = 0;
+  unsigned int  store1 = 0, store2 = 0;
+
+  UINT64        size_old  = 0, size_new = 0;
+  UINT64        mtime_old = 0, mtime_new = 0;
+  UINT64        ctime_old = 0, ctime_new = 0;
+  char          tmp[128];
+  char          msg[2*SH_BUFSIZE];
+  char timstr_o[32];
+  char timstr_n[32];
+
+  static int is_init = 0;
+
+  SL_ENTER(_("sh_kern_check_internal"));
+
+  if (is_init == 0)
+    { 
+      if (sh.flag.checkSum != SH_CHECK_INIT && sh.flag.update != S_TRUE)
+	{
+	  if (0 == sh_kern_data_init()) {
+	    is_init = 1;
+	  } else {
+	    sh_error_handle (ShKernSeverity, FIL__, __LINE__, status, 
+			     MSG_E_SUBGEN,
+			     _("could not initialize - switching off"),
+			     _("kern_check_internal") );
+	    ShKernActive = S_FALSE;
+	    SL_RETURN( (-1), _("sh_kern_check_internal"));
+	  }
+	}
+      else if ((sh.flag.checkSum == SH_CHECK_INIT ||
+		sh.flag.checkSum == SH_CHECK_CHECK) && 
+	       (sh.flag.update == S_TRUE))
+	{	
+	  if (0 == sh_kern_data_init()) {
+	    is_init = 1;
+	  } else {
+	    sh_error_handle (ShKernSeverity, FIL__, __LINE__, status, 
+			     MSG_E_SUBGEN,
+			     _("no or incomplete data in baseline database"),
+			     _("kern_check_internal") );
+	  }
+	}
+    }
+
+  /* defined, but not used
+   */
+  ShKernDelay    = 0;
+   
+  list[0].n_name = "_sysent";
+  list[1].n_name = NULL;
+
+  kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
+  if (!kd)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       errbuf,
+		       _("kvm_openfiles") );
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+
+  i = kvm_nlist(kd, list);
+  if (i == -1)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       kvm_geterr(kd),
+		       _("kvm_nlist (_sysent)") );
+      kvm_close(kd);
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+
+  sys_list = SH_ALLOC((SYS_MAXSYSCALL+1) * sizeof(struct nlist));
+
+  for (i = 0; i < SH_MAXCALLS; ++i)
+    sys_list[i].n_name = sh_syscalls[i].name;
+  sys_list[SH_MAXCALLS].n_name = NULL;
+
+  i = kvm_nlist(kd, sys_list);
+  if (i == -1)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+		       kvm_geterr(kd),
+		       _("kvm_nlist (syscalls)") );
+      kvm_close(kd);
+      SH_FREE(sys_list);
+      SL_RETURN( (-1), _("sh_kern_check_internal"));
+    }
+  else if (i > 0)
+    {
+      sl_snprintf(tmp, 128,
+                  _("%d invalid syscalls"), i);
+      /*
+      for (i = 0; i < SH_MAXCALLS; ++i) {
+        if (sys_list[i].n_type == 0 && sys_list[i].n_value == 0)
+          fprintf(stderr, "invalid: [%3d] %s\n", i, sh_syscalls[i].name);
+      }
+      */
+      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN,
+                       tmp,
+                       _("kvm_nlist (syscalls)") );
+    }
+
+  /* Check the individual syscalls
+   *
+   * Stored(old) is sh_syscalls[] array.
+   */
+  if (sh.flag.checkSum == SH_CHECK_INIT)
+    {
+      for (i = 0; i < SH_MAXCALLS; ++i) 
+	{
+	  if (sh_syscalls[i].name == NULL)
+	    {
+	      sl_snprintf(tmp, 128, 
+			  _("too few entries in sh_syscalls[]: have %d, expect %d"), 
+			  i, SH_MAXCALLS);
+
+	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+			       tmp,
+			       _("sh_kern_check_internal") );
+	      break;
+	    }
+
+	  /* read address of syscall from sysent table
+	   */
+	  offset = list[0].n_value + (i*sizeof(struct sysent));
+	  if (kvm_read(kd, offset, &sy, sizeof(struct sysent)) < 0)
+	    {
+	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+			       kvm_geterr(kd),
+			       _("kvm_read (syscall table)") );
+	      kvm_close(kd);
+	      SH_FREE(sys_list);
+	      SL_RETURN( (-1), _("sh_kern_check_internal"));
+	    }
+	  syscall_addr = (unsigned long) sy.sy_call;
+	  store0 = syscall_addr;
+	  
+	  /* read the syscall code
+	   */
+	  if(kvm_read(kd, (unsigned int) sy.sy_call, &(syscall_code[0]), 
+		      2 * sizeof(unsigned int)) < 0)
+	    {
+	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+			       kvm_geterr(kd),
+			       _("kvm_read (syscall code)") );
+	      kvm_close(kd);
+	      SH_FREE(sys_list);
+	      SL_RETURN( (-1), _("sh_kern_check_internal"));
+	    }
+	  store1 = syscall_code[0]; store2 = syscall_code[1];
+	  
+	  sh_kern_db_syscall (i, _("syscall"), 
+			      NULL, &store0, &store1, &store2,
+			      0, 0);
+	}
+    }
+
+  if ((sh.flag.checkSum != SH_CHECK_INIT) || 
+      (sh.flag.update == S_TRUE && is_init == 1))
+    {
+      for (i = 0; i < SH_MAXCALLS; ++i)
+	{
+	  if (sh_syscalls[i].name == NULL)
+	    {
+	      sl_snprintf(tmp, 128, 
+			  _("too few entries in sh_syscalls[]: have %d, expect %d"), 
+			  i, SH_MAXCALLS);
+
+	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+			       tmp,
+			       _("sh_kern_check_internal") );
+	      break;
+	    }
+	  
+	  /* read address of syscall from sysent table
+	   */
+	  offset = list[0].n_value + (i*sizeof(struct sysent));
+	  if (kvm_read(kd, offset, &sy, sizeof(struct sysent)) < 0)
+	    {
+	      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+			       kvm_geterr(kd),
+			       _("kvm_read (syscall table)") );
+	      kvm_close(kd);
+	      SH_FREE(sys_list);
+	      SL_RETURN( (-1), _("sh_kern_check_internal"));
+	    }
+	  syscall_addr = (unsigned long) sy.sy_call;
+	  
+	  if (sh_syscalls[i].addr != syscall_addr)
+	    {
+#ifdef SH_USE_XML
+	      sl_snprintf(tmp, 128, "path=\"K_%s_%04d\" ", 
+			  _("syscall"), i);
+#else
+	      sl_snprintf(tmp, 128, "path=<K_%s_%04d>, ", 
+			  _("syscall"), i);
+#endif
+	      sl_strlcpy(msg, tmp, SH_BUFSIZE);
+
+	      size_old = sh_syscalls[i].addr; 
+	      size_new = syscall_addr;
+	      sl_snprintf(tmp, 128, sh_hash_size_format(),
+			  size_old, size_new);
+	      sl_strlcat(msg, tmp, SH_BUFSIZE);
+ 
+	      sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+			       status, MSG_KERN_SYSCALL,
+			       /*
+			       syscall_addr,
+			       sh_syscalls[i].addr,
+			       */
+			       i, _(sh_syscalls[i].name),
+			       msg);
+	      sh_syscalls[i].addr = syscall_addr;
+	    }
+	  else
+	    {    
+	      /* read the syscall code
+	       */
+	      if(kvm_read(kd, (unsigned int) sy.sy_call, &(syscall_code[0]), 
+			  2 * sizeof(unsigned int)) < 0)
+		{
+		  sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+				   kvm_geterr(kd),
+				   _("kvm_read (syscall code)") );
+		  kvm_close(kd);
+		  SH_FREE(sys_list);
+		  SL_RETURN( (-1), _("sh_kern_check_internal"));
+		}
+	      
+	      if (sh_syscalls[i].code[0] != syscall_code[0] || 
+		  sh_syscalls[i].code[1] != syscall_code[1])
+		{
+		  mtime_old = sh_syscalls[i].code[0];
+		  mtime_new = syscall_code[0];
+		  ctime_old = sh_syscalls[i].code[1];
+		  ctime_new = syscall_code[1];
+
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, "path=\"K_%s_%04d\" ", 
+			      _("syscall"), i);
+#else
+		  sl_snprintf(tmp, 128, "path=<K_%s_%04d>, ", 
+			      _("syscall"), i);
+#endif
+		  sl_strlcpy(msg, tmp, SH_BUFSIZE);
+
+		  sl_strlcpy (timstr_o, sh_unix_gmttime (ctime_old), 32);
+		  sl_strlcpy (timstr_n, sh_unix_gmttime (ctime_new), 32);
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, 
+			      _("ctime_old=\"%s\" ctime_new=\"%s\" "), 
+			      timstr_o, timstr_n);
+#else
+		  sl_snprintf(tmp, 128, 
+			      _("ctime_old=<%s>, ctime_new=<%s>, "), 
+			      timstr_o, timstr_n);
+#endif
+		  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+		  sl_strlcpy (timstr_o, sh_unix_gmttime (mtime_old), 32);
+		  sl_strlcpy (timstr_n, sh_unix_gmttime (mtime_new), 32);
+#ifdef SH_USE_XML
+		  sl_snprintf(tmp, 128, 
+			      _("mtime_old=\"%s\" mtime_new=\"%s\" "), 
+			      timstr_o, timstr_n);
+#else
+		  sl_snprintf(tmp, 128, 
+			      _("mtime_old=<%s>, mtime_new=<%s> "), 
+			      timstr_o, timstr_n);
+#endif
+		  sl_strlcat(msg, tmp, SH_BUFSIZE); 
+
+		  sh_error_handle (ShKernSeverity, FIL__, __LINE__, 
+				   status, MSG_KERN_SYSCALL,
+				   /*
+				   syscall_code[0],  syscall_code[1],
+				   sh_syscalls[i].code[0], sh_syscalls[i].code[1],
+				   */
+				   i, _(sh_syscalls[i].name),
+				   msg);
+		  sh_syscalls[i].code[0] = syscall_code[0];
+		  sh_syscalls[i].code[1] = syscall_code[1];
+		}
+	    }
+	}
+    }
+  SH_FREE(sys_list);
+  if(kvm_close(kd) < 0)
+    {
+      sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
+                       kvm_geterr(kd),
+                       _("kvm_close") );
+      exit(EXIT_FAILURE);
+    }
+
+  SL_RETURN( (0), _("sh_kern_check_internal"));
+}
+
+#endif
+
+/*************
+ *
+ * module init
+ *
+ *************/
+#if defined(HOST_IS_LINUX)
+#include <sys/utsname.h>
+#endif
+
+static int AddressReconf = 0;
+
+int sh_kern_init ()
+{
+#if defined(HOST_IS_LINUX)
+  struct utsname buf;
+  char         * str;
+#endif
+
+  SL_ENTER(_("sh_kern_init"));
+  if (ShKernActive == S_FALSE)
+    SL_RETURN( (-1), _("sh_kern_init"));
+
+#if defined(HOST_IS_LINUX)
+  uname(&buf);
+
+  if ((AddressReconf < 5) && (0 != strcmp(SH_KERNEL_VERSION, buf.release)))
+    {
+      str = SH_ALLOC(256);
+      sl_snprintf(str, 256, 
+		  "Compiled for kernel %s, but current kernel is %s, and kernel addresses have not been re-configured",
+		  SH_KERNEL_VERSION, buf.release);
+      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
+		       str,
+		       _("kern_check") );
+      SH_FREE(str);
+      ShKernActive = S_FALSE;
+      SL_RETURN( (-1), _("sh_kern_init"));
+    }
+#endif
+
+  lastcheck  = time (NULL);
+  if (sh.flag.checkSum != SH_CHECK_INIT)
+    {
+      sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		       _("Checking kernel syscalls"),
+		       _("kern_check") );
+    }
+  sh_kern_check_internal ();
+  SL_RETURN( (0), _("sh_kern_init"));
+}
+
+/*************
+ *
+ * module cleanup
+ *
+ *************/
+int sh_kern_end ()
+{
+  return (0);
+}
+
+
+/*************
+ *
+ * module timer
+ *
+ *************/
+int sh_kern_timer (time_t tcurrent)
+{
+  if (ShKernActive == S_FALSE)
+    return 0;
+
+  if ((int) (tcurrent - lastcheck) >= ShKernInterval)
+    {
+      lastcheck  = tcurrent;
+      return (-1);
+    }
+  return 0;
+}
+
+/*************
+ *
+ * module check
+ *
+ *************/
+int sh_kern_check ()
+{
+  sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
+		   _("Checking kernel syscalls"),
+		   _("kern_check") );
+  return (sh_kern_check_internal ());
+}
+
+/*************
+ *
+ * module setup
+ *
+ *************/
+
+int sh_kern_set_severity  (char * c)
+{
+  char tmp[32];
+  tmp[0] = '='; tmp[1] = '\0';
+  sl_strlcat (tmp, c, 32);
+  sh_error_set_level (tmp, &ShKernSeverity);
+  return 0;
+}
+
+int sh_kern_set_timer (char * c)
+{
+  long val;
+
+  SL_ENTER(_("sh_kern_set_timer"));
+
+  val = strtol (c, (char **)NULL, 10);
+  if (val <= 0)
+    sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
+                      _("kern timer"), c);
+
+  val = (val <= 0 ? 60 : val);
+
+  ShKernInterval = (time_t) val;
+  SL_RETURN( 0, _("sh_kern_set_timer"));
+}
+
+int sh_kern_set_activate (char * c)
+{
+  int i;
+  SL_ENTER(_("sh_kern_set_activate"));
+  i = sh_util_flagval(c, &ShKernActive);
+  SL_RETURN(i, _("sh_kern_set_activate"));
+}
+
+int sh_kern_set_idt (char * c)
+{
+  int i;
+  SL_ENTER(_("sh_kern_set_idt"));
+  i = sh_util_flagval(c, &ShKernIDT);
+  SL_RETURN(i, _("sh_kern_set_idt"));
+}
+
+int sh_kern_set_sc_addr (char * c)
+{
+  char * endptr;
+  unsigned long value;
+
+  SL_ENTER(_("sh_kern_set_sc_addr"));
+  errno = 0;
+  value = strtoul(c, &endptr, 16);
+  if ((ULONG_MAX == value) && (errno == ERANGE))
+    {
+      SL_RETURN((-1), _("sh_kern_set_sc_addr"));
+    }
+  if ((*c == '\0') || (*endptr != '\0'))
+    {
+      SL_RETURN((-1), _("sh_kern_set_sc_addr"));
+    }
+  system_call_addr = value;
+  ++AddressReconf;
+  SL_RETURN((0), _("sh_kern_set_sc_addr"));
+}
+
+int sh_kern_set_sct_addr (char * c)
+{
+  char * endptr;
+  unsigned long value;
+
+  SL_ENTER(_("sh_kern_set_sct_addr"));
+  errno = 0;
+  value = strtoul(c, &endptr, 16);
+  if ((ULONG_MAX == value) && (errno == ERANGE))
+    {
+      SL_RETURN((-1), _("sh_kern_set_sct_addr"));
+    }
+  if ((*c == '\0') || (*endptr != '\0'))
+    {
+      SL_RETURN((-1), _("sh_kern_set_sct_addr"));
+    }
+  kaddr = (unsigned int) value;
+  ++AddressReconf;
+  SL_RETURN((0), _("sh_kern_set_sct_addr"));
+}
+
+int sh_kern_set_proc_root (char * c)
+{
+  char * endptr;
+  unsigned long value;
+
+  SL_ENTER(_("sh_kern_set_proc_root"));
+  errno = 0;
+  value = strtoul(c, &endptr, 16);
+  if ((ULONG_MAX == value) && (errno == ERANGE))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root"));
+    }
+  if ((*c == '\0') || (*endptr != '\0'))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root"));
+    }
+  
+  proc_root = value;
+  ++AddressReconf;
+  SL_RETURN((0), _("sh_kern_set_proc_root"));
+}
+
+int sh_kern_set_proc_root_iops (char * c)
+{
+  char * endptr;
+  unsigned long value;
+
+  SL_ENTER(_("sh_kern_set_proc_root_iops"));
+  errno = 0;
+  value = strtoul(c, &endptr, 16);
+  if ((ULONG_MAX == value) && (errno == ERANGE))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root_iops"));
+    }
+  if ((*c == '\0') || (*endptr != '\0'))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root_iops"));
+    }
+  
+  proc_root_iops = value;
+  ++AddressReconf;
+  SL_RETURN((0), _("sh_kern_set_proc_root_iops"));
+}
+
+int sh_kern_set_proc_root_lookup (char * c)
+{
+  char * endptr;
+  unsigned long value;
+
+  SL_ENTER(_("sh_kern_set_proc_root_lookup"));
+  errno = 0;
+  value = strtoul(c, &endptr, 16);
+  if ((ULONG_MAX == value) && (errno == ERANGE))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root_lookup"));
+    }
+  if ((*c == '\0') || (*endptr != '\0'))
+    {
+      SL_RETURN((-1), _("sh_kern_set_proc_root_lookup"));
+    }
+  proc_root_lookup = value;
+  ++AddressReconf;
+  SL_RETURN((0), _("sh_kern_set_proc_root_lookup"));
+}
+
+#endif
+
+/* #ifdef SH_USE_UTMP */
+#endif
+
+
+
Index: trunk/src/sh_log_check.c
===================================================================
--- trunk/src/sh_log_check.c	(revision 591)
+++ 	(revision )
@@ -1,1523 +1,0 @@
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#define NAMLEN(dirent) sl_strlen((dirent)->d_name)
-#else
-#define dirent direct
-#define NAMLEN(dirent) (dirent)->d_namlen
-#ifdef HAVE_SYS_NDIR_H
-#include <sys/ndir.h>
-#endif
-#ifdef HAVE_SYS_DIR_H
-#include <sys/dir.h>
-#endif
-#ifdef HAVE_NDIR_H
-#include <ndir.h>
-#endif
-#endif
-
-#if !defined(O_NONBLOCK)
-#if defined(O_NDELAY)
-#define O_NONBLOCK  O_NDELAY
-#else
-#define O_NONBLOCK  0
-#endif
-#endif
-
-#ifdef USE_LOGFILE_MONITOR
-
-#undef  FIL__
-#define FIL__  _("sh_log_check.c")
-
-/* Debian/Ubuntu: libpcre2-dev */
-#define PCRE2_CODE_UNIT_WIDTH 8
-#ifdef HAVE_PCRE2_PCRE2_H
-#include <pcre2/pcre2.h>
-#else
-#include <pcre2.h>
-#endif
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_string.h"
-#include "sh_log_check.h"
-#include "sh_log_evalrule.h"
-#include "sh_log_correlate.h"
-#include "sh_log_mark.h"
-#include "sh_log_repeat.h"
-#include "sh_extern.h"
-
-/* List of supported logfile types, format is
- * { 
- *   "TYPE_CODE", 
- *   Reader_Callback_Function, 
- *   Parser_Callback_function,
- *   Evaluate_Callback_Function 
- * }
- * If Reader_Callback_Function is NULL, the default (line-oriented
- * text file) reader is used.
- */
-struct sh_logfile_type sh_logtypes_def[] = {
-    {  "SYSLOG", NULL,            sh_parse_syslog, NULL },
-    {  "SAMBA",  sh_read_samba,   sh_parse_samba,  NULL },
-    {  "APACHE", NULL,            sh_parse_apache, sh_eval_fileinfo_apache },
-#if defined(HAVE_SYS_ACCT_H)
-    {  "PACCT",  sh_read_pacct,   sh_parse_pacct,  NULL },
-#endif
-    {  "SHELL",  sh_read_shell,   sh_parse_shell,  NULL },
-};
-
-/* -------------------------- Internal Stuff -------------------------- */
-
-struct logfile_record {
-  dev_t  device_id;
-  ino_t  inode;
-  fpos_t offset;
-};
-
-static int    do_checkpoint_cleanup = S_FALSE;
-
-static char * save_dir = NULL;
-
-static const char * get_save_dir(void)
-{
-  int retval;
-
-  if (!save_dir)
-    {
-      save_dir = sh_util_strdup(DEFAULT_DATAROOT);
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      retval = tf_trust_check (save_dir, SL_YESPRIV);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      if (retval != 0)
-	{
-	  return(NULL);
-	}
-    }
-  return save_dir;
-}
-
-static void clean_dir()
-{
-  DIR * dir;
-  struct dirent * entry;
-
-  const char * dirpath;
-
-  if (S_FALSE == do_checkpoint_cleanup)
-    return;
-
-  dirpath = get_save_dir();
-
-  if (dirpath)
-    {
-      dir = opendir(dirpath);
-      if (dir)
-	{
-	  unsigned long a, b;
-	  int retval;
-	  char c;
-	  size_t dlen = strlen(dirpath) + 1;
-	  time_t now  = time(NULL);
-
-	  while (NULL != (entry = readdir(dir)))
-	    {
-	      retval = sscanf(entry->d_name, "%lu_%lu%c", &a, &b, &c);
-
-	      if (2 == retval)
-		{
-		  struct stat buf;
-		  char * path;
-		  size_t  plen = strlen(entry->d_name) + 1;
-
-		  if (S_TRUE == sl_ok_adds(plen, dlen))
-		    {
-		      plen += dlen;
-		      path = SH_ALLOC(plen);
-		      (void) sl_snprintf(path, plen, "%s/%s", 
-					 dirpath,entry->d_name);
-
-		      if (0 == retry_lstat(FIL__, __LINE__, path, &buf) &&
-			  S_ISREG(buf.st_mode))
-			{
-			  if (buf.st_mtime < now && 
-			      (now - buf.st_mtime) > 2592000) /* 30 days */
-			    {
-			      if (0 == tf_trust_check (path, SL_YESPRIV))
-				{
-				  unlink(path);
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	  closedir(dir);
-	}
-    }
-}
-
-static char * build_path (struct sh_logfile * record)
-{
-  size_t plen;
-  char * path = NULL;
-  const char * dir = get_save_dir();
-
-  if (dir)
-    {
-      plen = strlen(dir);
-
-      if (S_TRUE == sl_ok_adds(plen, 130))
-	{
-	  plen += 130; /* 64 + 64 + 2 */
-	  path = SH_ALLOC(plen);
-	  (void) sl_snprintf(path, plen, "%s/%lu_%lu", dir,
-			     (unsigned long) record->device_id, 
-			     (unsigned long) record->inode);
-	}
-    }
-
-  return path;
-}
-
-static void save_pos (struct sh_logfile * record)
-{
-  char * path;
-  FILE * fd;
-  mode_t mask;
-  struct logfile_record save_rec;
-
-  path = build_path(record);
-
-  if (path)
-    {
-      if (0 != sh_unix_check_piddir (path))
-	{
-	  SH_FREE(path);
-	  return;
-	}
-
-      mask = umask(S_IWGRP | S_IWOTH);
-      fd = fopen(path, "wb");
-      (void) umask(mask);
-
-      if (fd)
-	{
-	  save_rec.device_id = record->device_id;
-	  save_rec.inode     = record->inode;
-	  memcpy(&(save_rec.offset), &(record->offset), sizeof(fpos_t));
-	  if (1 != fwrite(&save_rec, sizeof(struct logfile_record), 1, fd))
-	    {
-	      (void) sl_fclose(FIL__, __LINE__, fd);
-	      (void) remove(path);
-	    }
-	  else
-	    {
-	      (void) sl_fclose(FIL__, __LINE__, fd);
-	    }
-	}
-      SH_FREE(path);
-    }
-  return;
-}
-
-static int read_pos (struct sh_logfile * record)
-{
-  int    retval = 0;
-  char * path;
-  FILE * fd;
-  struct logfile_record save_rec;
-
-  path = build_path(record);
-
-  if (path)
-    {
-      fd = fopen(path, "rb");
-      if (fd)
-	{
-	  if (1 == fread(&save_rec, sizeof(struct logfile_record), 1, fd))
-	    {
-	      if (save_rec.device_id == record->device_id &&
-		  save_rec.inode     == record->inode)
-		{
-		  memcpy(&(record->offset),&(save_rec.offset),sizeof(fpos_t));
-		  retval = 1;
-		}
-	    }
-	  (void) sl_fclose(FIL__, __LINE__, fd);
-	}
-      SH_FREE(path);
-    }
-  return retval;
-}
-
-/*@null@*/ static struct sh_logfile * sh_watched_logs = NULL;
-
-int sh_add_watch (const char * str)
-{
-  char * filename;
-
-  unsigned int    i;
-  unsigned int    defsize;
-  struct sh_logfile_type * log_type = NULL;
-  struct sh_logfile * thisfile;
-  struct stat buf;
-
-  unsigned int nfields = 3; /* logtype:path[:regex] */
-  size_t       lengths[3];
-  char *       new = sh_util_strdup(str);
-  char **      splits = split_array(new, &nfields, ':', lengths);
-
-  if (nfields < 2 || (lengths[0] == 0 || lengths[0] >= SH_MAX_LCODE_SIZE || lengths[1] == 0))
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Format error: "));
-      sh_string_add_from_char(msg, str);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_add_watch"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-
-      SH_FREE(new);
-      return -2;
-    }
-
-  defsize = 
-    (unsigned int) (sizeof(sh_logtypes_def)/sizeof(struct sh_logfile_type));
-
-  for (i = 0; i < defsize; ++i)
-    {
-      if (0 == strcmp(splits[0], sh_logtypes_def[i].code))
-	{
-	  log_type = &(sh_logtypes_def[i]);
-	  break;
-	}
-    }
-
-  if (log_type == NULL)
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Unsupported log type: "));
-      sh_string_add_from_char(msg, splits[0]);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_add_watch"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-
-      SH_FREE(new);
-      return -3;
-    }
-
-  if (splits[1][0] != '/' && 0 != strcmp(splits[0], _("SHELL")))
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Logfile path not absolute: "));
-      sh_string_add_from_char(msg, splits[1]);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_add_watch"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-
-      SH_FREE(new);
-      return -4;
-    }
-
-  filename = /*@i@*/sh_util_strdup(splits[1]);
-  thisfile = SH_ALLOC(sizeof(struct sh_logfile));
-
-  thisfile->filename     = filename;
-  if (0 == strcmp(splits[0], _("SHELL")))
-    thisfile->flags        = SH_LOGFILE_NOFILE;
-  else
-    thisfile->flags        = SH_LOGFILE_REWIND;
-  thisfile->inode        = 0;
-  thisfile->device_id    = 0;
-  thisfile->fp           = NULL;
-  if (log_type->get_record)
-    thisfile->get_record   = log_type->get_record;
-  else
-    thisfile->get_record   = sh_default_reader;
-  thisfile->parse_record = log_type->parse_record;
-
-  /* An optional regex for parsing the file. The result
-   * 'fileinfo' should contain info about host/time position.
-   */
-  if (log_type->eval_fileinfo)
-    {
-      if (nfields == 3 && lengths[2] > 0)
-	{
-	  thisfile->fileinfo     = log_type->eval_fileinfo(splits[2]);
-
-	  if (thisfile->fileinfo == NULL)
-	    {
-	      sh_string * msg =  sh_string_new(0);
-	      sh_string_add_from_char(msg, _("Logfile format description not recognized: "));
-	      sh_string_add_from_char(msg, splits[2]);
-	      
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			      sh_string_str(msg),
-			      _("sh_add_watch"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      sh_string_destroy(&msg);
-
-	      SH_FREE(filename);
-	      SH_FREE(thisfile);
-	      SH_FREE(new);
-	      return -1;
-	    }
-	}
-      else
-	{
-	  sh_string * msg =  sh_string_new(0);
-	  sh_string_add_from_char(msg, _("Logfile format description missing: "));
-	  sh_string_add_from_char(msg, splits[1]);
-	  
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  sh_string_str(msg),
-			  _("sh_add_watch"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_string_destroy(&msg);
-
-	  SH_FREE(filename);
-	  SH_FREE(thisfile);
-	  SH_FREE(new);
-	  return -1;
-	}
-    }
-  else
-    {
-      thisfile->fileinfo     = NULL;
-    }
-  thisfile->next         = sh_watched_logs;
-
-  /* Try reading saved offset. On success clear rewind flag.
-   */
-  if ((thisfile->flags & SH_LOGFILE_NOFILE) == 0)
-    {
-      if (0 == stat(thisfile->filename, &buf))
-	{
-	  if (S_ISREG(buf.st_mode)
-#ifdef S_ISLNK
-	      || S_ISLNK(buf.st_mode)
-#endif 
-	      )
-	    {
-	      thisfile->inode     = buf.st_ino;
-	      thisfile->device_id = buf.st_dev;
-	      
-	      if (0 != read_pos(thisfile))
-		{
-		  thisfile->flags &= ~SH_LOGFILE_REWIND;
-		}
-	    }
-	  else if (S_ISFIFO(buf.st_mode))
-	    {
-	      thisfile->inode      = buf.st_ino;
-	      thisfile->device_id  = buf.st_dev;
-	      thisfile->flags     |= SH_LOGFILE_PIPE;
-	    }
-	}
-      else
-	{
-	  sh_string * msg =  sh_string_new(0);
-	  sh_string_add_from_char(msg, _("Logfile is not a regular file, link, or named pipe: "));
-	  sh_string_add_from_char(msg, splits[1]);
-	  
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  sh_string_str(msg),
-			  _("sh_add_watch"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_string_destroy(&msg);
-	  
-	  SH_FREE(filename);
-	  SH_FREE(thisfile);
-	  SH_FREE(new);
-	  return -1;
-	}
-    }
-
-  sh_watched_logs        = thisfile;
-
-  SH_FREE(new);
-  return 0;
-}
-
-void sh_dump_watches()
-{
-  struct sh_logfile * thisfile;
-
-  while (sh_watched_logs)
-    {
-      thisfile        = sh_watched_logs;
-      sh_watched_logs = thisfile->next;
-
-      if ((thisfile->flags & SH_LOGFILE_NOFILE) == 0 &&
-	  (thisfile->flags & SH_LOGFILE_PIPE) == 0)
-	{
-	  save_pos(thisfile);
-	}
-
-      if ((thisfile->flags & SH_LOGFILE_NOFILE) == 0)
-	{
-	  if (thisfile->fp)
-	    sl_fclose(FIL__, __LINE__, thisfile->fp);
-	}
-
-      if (thisfile->filename)
-	SH_FREE(thisfile->filename);
-      SH_FREE(thisfile);
-    }
-  return;
-}
-
-/* This variable is not used anywhere. It only exist
- * to assign &new to them, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_502_thisfile = NULL;
-
-void sh_check_watches()
-{
-  struct sh_logrecord * logrecord;
-  struct sh_logfile * thisfile = sh_watched_logs;
-  sh_string * record = sh_string_new(0);
-  char * tmp;
-
-  /* Take the address to keep gcc from putting them into registers. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_502_thisfile = (void*) &thisfile;
-
-  while (thisfile)
-    {
-      volatile size_t count = 0;
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      tmp = sh_util_safe_name (thisfile->filename);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_CHKS,
-		      tmp);
-      SH_FREE(tmp);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      for (;;) {
-
-	record = thisfile->get_record(record, thisfile);
-
-	if (record)
-	  {
-	    logrecord = thisfile->parse_record(record, thisfile->fileinfo);
-	    ++count;
-
-	    if (logrecord)
-	      {
-		logrecord->filename = thisfile->filename;
-		
-		/* Don't report if 'init', just set file pointer
-		 */
-		if (sh.flag.checkSum != SH_CHECK_INIT)
-		  {
-		    sh_eval_process_msg(logrecord);
-		  }
-
-		if (logrecord->message) 
-		  sh_string_destroy(&(logrecord->message));
-		if (logrecord->host)
-		  sh_string_destroy(&(logrecord->host));
-		if (logrecord->timestr)
-		  sh_string_destroy(&(logrecord->timestr));
-		SH_FREE(logrecord);
-	      }
-	  }
-	else
-	  {
-	    record = sh_string_new(0);
-	    break;
-	  }
-      }
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      tmp = sh_util_safe_name (thisfile->filename);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_CHKE,
-		      tmp, (unsigned long)count);
-      SH_FREE(tmp);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      thisfile = thisfile->next;
-    }
-  sh_string_destroy(&record);
-  return;
-}
-
-/********************************************************
- * Search rotated logfile
- */
-extern char * sh_rotated_log_search(const char * path, struct stat * buf);
-
-
-/* Open file, position at stored offset
- */
-int sh_open_for_reader (struct sh_logfile * logfile)
-{
-  struct stat buf;
-  sh_string * filename;
-
-  /* check whether file exists, get inode to check for
-   * logfile rotation
-   */
-  if (0 != retry_stat(FIL__, __LINE__, logfile->filename, &buf))
-    {
-      char * tmp;
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      tmp = sh_util_safe_name (logfile->filename);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_MISS,
-		      tmp);
-      SH_FREE(tmp);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      memset (&(logfile->offset), 0, sizeof(fpos_t));
-      logfile->flags |= SH_LOGFILE_REWIND;
-      return 0;
-    }
-
-  filename = sh_string_new(0);
-  (void) sh_string_set_from_char (filename, logfile->filename);
-
-  /* detect and handle logfile rotation
-   */
-  if (logfile->inode != buf.st_ino && 
-      logfile->inode != 0 &&
-      !S_ISFIFO(buf.st_mode))
-    {
-      /* Case 1) We have dealt with the moved file already.
-       *         Clear the moved flag, set the rewind flag,
-       *         fix logfile->inode.
-       */
-      if ((logfile->flags & SH_LOGFILE_MOVED) != 0)
-	{
-	  /* done with rotated file, start with current file
-	   */
-	  memset (&(logfile->offset), 0, sizeof(fpos_t));
-	  logfile->flags    |= SH_LOGFILE_REWIND;
-	  logfile->flags    &= ~SH_LOGFILE_MOVED;
-	  logfile->inode     = buf.st_ino;
-	  logfile->device_id = buf.st_dev;
-	}
-
-      /* Case 2) Searching for rotated file. 
-       *         If found:     set the moved flag, fix path for fopen.
-       *         If not found: set the rewind flag, fix logfile->inode.
-       */
-      else
-	{
-	  char *oldfile = sh_rotated_log_search(logfile->filename, &buf);
-
-	  if (NULL != oldfile)
-	    {
-	      (void) sh_string_set_from_char (filename, oldfile);
-	      SH_FREE(oldfile);
-	      logfile->flags |= SH_LOGFILE_MOVED;
-	    }
-	  else
-	    {
-	      memset (&(logfile->offset), 0, sizeof(fpos_t));
-	      logfile->flags    |= SH_LOGFILE_REWIND;
-	      logfile->inode     = buf.st_ino;
-	      logfile->device_id = buf.st_dev;
-	    }
-	}
-    }
-
-  /* open file
-   */
-  if (!S_ISFIFO(buf.st_mode))
-    {
-      logfile->fp = fopen(filename->str, "r");
-    }
-  else
-    {
-      int fd_temp = open (filename->str, O_RDONLY|O_NONBLOCK);
-
-      if (fd_temp >= 0)
-	{
-	  logfile->fp = fdopen(fd_temp, "r");
-	}
-    }
-
-  if (!logfile->fp)
-    {
-      char * tmp;
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      tmp = sh_util_safe_name (logfile->filename);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_EOPEN,
-		      tmp);
-      SH_FREE(tmp);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      sh_string_destroy(&filename);
-      return 0;
-    }
-
-  sh_string_destroy(&filename);
-  
-  if ((logfile->flags & SH_LOGFILE_PIPE) == 0)
-    {
-      if ((logfile->flags & SH_LOGFILE_REWIND) != 0)
-	{
-	  rewind(logfile->fp);
-	  fgetpos(logfile->fp, &(logfile->offset));
-	  logfile->flags &= ~SH_LOGFILE_REWIND;
-	}
-      else
-	{
-	  /* file too short
-	   */
-	  if (0 != fsetpos(logfile->fp, &(logfile->offset)))
-	    {
-	      rewind(logfile->fp);
-	      fgetpos(logfile->fp, &(logfile->offset));
-	    }
-	}
-    }
-
-  return 1;
-}
-
-/******************************************************
- *  Default reader for ascii text files 
- */
-sh_string * sh_default_reader (sh_string * s, struct sh_logfile * logfile)
-{
-  volatile int         status;
-  char * tmp;
-
- start_read:
-
-  if (logfile->fp)
-    {
-      /* Result cannot be larger than 8192, thus cast is ok
-       */
-      status = (int) sh_string_read(s, logfile->fp, 8192);
-      if (status <= 0)
-	{
-	  fgetpos(logfile->fp, &(logfile->offset));
-	  sl_fclose(FIL__, __LINE__, logfile->fp);
-	  logfile->fp = NULL;
-	  sh_string_destroy(&s);
-	  if (status == 0 || (logfile->flags & SH_LOGFILE_PIPE) != 0)
-	    {
-	      return NULL;
-	    }
-
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  tmp = sh_util_safe_name (logfile->filename);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_EREAD,
-			  tmp);
-	  SH_FREE(tmp);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-	  return NULL;
-	}
-      return s;
-    }
-
-  if (0 != sh_open_for_reader(logfile))
-    goto start_read;
-
-  return NULL;
-}
-
-struct task_entry
-{
-  sh_tas_t task;
-  struct task_entry * next;
-};
-
-static struct task_entry * tasklist = NULL;
-
-static struct task_entry * task_find(FILE * fp)
-{
-  struct task_entry * entry = tasklist;
-  while (entry)
-    {
-      if (entry->task.pipe == fp)
-	return (entry);
-      entry = entry->next;
-    }
-  return NULL;
-}
- 
-static void task_remove(struct task_entry * task)
-{
-  struct task_entry * entry = tasklist;
-  struct task_entry * prev  = tasklist;
-
-  while (entry)
-    {
-      if (entry == task)
-	{
-	  if (entry == tasklist)
-	    {
-	      tasklist = entry->next;
-	      SH_FREE(entry);
-	      return;
-	    }
-	  else
-	    {
-	      prev->next = entry->next;
-	      SH_FREE(entry);
-	      return;
-	    }
-	}
-      prev  = entry;
-      entry = entry->next;
-    }
-  return;
-}
- 
-static void task_add(struct task_entry * entry)
-{
-  entry->next = tasklist;
-  tasklist    = entry;
-  return;
-}
- 
-sh_string * sh_command_reader (sh_string * s, struct sh_logfile * logfile)
-{
-  struct task_entry * entry;
-
-  volatile int        status;
-  char * tmp;
-
- start_read:
-
-  if (logfile->fp)
-    {
-      /* Result cannot be larger than 8192, thus cast is ok
-       */
-      status = (int) sh_string_read(s, logfile->fp, 8192);
-
-      if (status <= 0)
-	{
-	  entry = task_find(logfile->fp);
-	  sh_ext_pclose (&(entry->task));
-	  task_remove(entry);
-
-	  logfile->fp = NULL;
-	  sh_string_destroy(&s);
-
-	  if (status == 0)
-	    {
-	      return NULL;
-	    }
-
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  tmp = sh_util_safe_name (logfile->filename);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_EREAD,
-			  tmp);
-	  SH_FREE(tmp);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-	  return NULL;
-	}
-      return s;
-    }
-
-  entry = SH_ALLOC(sizeof(struct task_entry));
-
-  status = sh_ext_popen_init (&(entry->task), logfile->filename, NULL, NULL);
-  if (0 == status)
-    {
-      task_add(entry);
-      logfile->fp = entry->task.pipe;
-      goto start_read;
-    }
-  else
-    {
-      SH_FREE(entry);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-                      _("Could not open pipe"), _("sh_command reader"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  return NULL;
-}
-
-/******************************************************
- *  Reader for continued text files 
- */
-sh_string * sh_cont_reader (sh_string * s, struct sh_logfile * logfile, char*cont)
-{
-  int         status;
-  char      * tmp;
-  sh_string * str;
-  int         remain = 8192;
-  int         count  = 0;
-
-  if (!sh_string_truncate(s, 0))
-    return NULL;
-
- start_read:
-
-  if (logfile->fp)
-    {
-      str = sh_string_new(0);
-
-      /* Result cannot be larger than 8192, thus cast is ok
-       */
-      status = (int) sh_string_read(str, logfile->fp, 8192);
-
-      if (status > 0)
-	{
-	  
-	  do {
-	    s       = sh_string_add (s, str);
-	    count  += status;
-	    remain -= status;
-
-	    if (remain <= 0)
-	      {
-		return s;
-	      }
-
-	    status = (int) sh_string_read_cont(str, logfile->fp, count, cont);
-
-	    if (status == 0)
-	      {
-		return s;
-	      }
-	  }
-	  while (status > 0);
-	}
-
-      if (status <= 0)
-	{
-	  fgetpos(logfile->fp, &(logfile->offset));
-	  sl_fclose(FIL__, __LINE__, logfile->fp);
-	  logfile->fp = NULL;
-	  sh_string_destroy(&s);
-	  if (status == 0 || (logfile->flags & SH_LOGFILE_PIPE) != 0)
-	    {
-	      return NULL;
-	    }
-
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  tmp = sh_util_safe_name (logfile->filename);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_LOGMON_EREAD,
-			  tmp);
-	  SH_FREE(tmp);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-	  return NULL;
-	}
-
-      return s;
-    }
-
-  if (0 != sh_open_for_reader(logfile))
-    goto start_read;
-
-  return NULL;
-}
-
-/******************************************************
- *  Reader for binary files 
- */
-sh_string * sh_binary_reader (void * s, size_t size, 
-			      struct sh_logfile * logfile)
-{
-  size_t         status;
-
- start_read:
-
-  if (logfile->fp)
-    {
-
-      status = fread(s, size, 1, logfile->fp);
-
-      if (status != 1)
-	{
-	  memset(s, 0, size);
-	  if (ferror(logfile->fp) && (logfile->flags & SH_LOGFILE_PIPE) == 0)
-	    {
-	      char * tmp;
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      tmp = sh_util_safe_name (logfile->filename);
-	      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_LOGMON_EREAD,
-			      tmp);
-	      SH_FREE(tmp);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  fgetpos(logfile->fp, &(logfile->offset));
-	  sl_fclose(FIL__, __LINE__, logfile->fp);
-	  logfile->fp = NULL;
-	  return NULL;
-	}
-      return s;
-    }
-
-  if (0 != sh_open_for_reader(logfile))
-    goto start_read;
-
-  return NULL;
-}
-
-
-
-/**********************************************************
- *
- * Utilities
- *
- **********************************************************/
-
-/* Return current year, unless that would result
- * in a date far in the future. If that happens,
- * return last year.
- */
-static int year_guess (struct tm * btime)
-{
-  int           year;
-  struct tm     ts;
-  time_t        now    = time(NULL);
-  time_t        check;
-
-  memcpy(&ts, localtime(&now), sizeof(struct tm));
-  year = ts.tm_year;
-
-  /* Check result to detect year wrap
-   * (logfile entry from last year).
-   */
-  btime->tm_year = year;
-  check = mktime(btime);
-  if (check > (now + (86400*30)))
-    --year;
-
-  return year;
-}
-
-time_t conv_timestamp (struct tm * btime, 
-		       struct tm * old_tm, time_t * old_time)
-{
-  time_t timestamp;
-  long   offtime;
-
-  /* timestamp - mktime is slooow, thus cache result
-   */
-  if (btime->tm_isdst == old_tm->tm_isdst &&
-      btime->tm_year  == old_tm->tm_year  &&
-      btime->tm_mon   == old_tm->tm_mon   &&
-      btime->tm_mday  == old_tm->tm_mday)
-    {
-      offtime = 
-	(btime->tm_hour - old_tm->tm_hour) * 3600 +
-	(btime->tm_min  - old_tm->tm_min)  * 60   +
-	(btime->tm_sec  - old_tm->tm_sec);
-
-      *old_time += offtime;
-      memcpy(old_tm, btime, sizeof(struct tm));
-      timestamp = *old_time;
-    }
-  else
-    {
-      int year_btime = btime->tm_year;
-
-      if (btime->tm_year == 0)
-	btime->tm_year = year_guess(btime);
-      timestamp = mktime(btime);
-      btime->tm_year = year_btime;
-      *old_time  = timestamp;
-      memcpy(old_tm, btime, sizeof(struct tm));
-    }
-  return timestamp;
-}
-
-/*********************************************************
- *
- * MODULE STUFF
- *
- *********************************************************/
-#include "sh_modules.h"
-
-SH_MUTEX_STATIC(mutex_logmon_check, PTHREAD_MUTEX_INITIALIZER);
-
-static int ShLogmonActive        = S_FALSE;
-#define SH_LOGMON_INTERVAL 10
-static time_t sh_logmon_interval = SH_LOGMON_INTERVAL;
-
-int sh_log_check_init (struct mod_type * arg)
-{
-#if !defined(HAVE_PTHREAD)
-  (void) arg;
-#endif
-
-  if (ShLogmonActive == S_FALSE)
-    return SH_MOD_FAILED;
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      return SH_MOD_THREAD;
-    }
-#endif
-  if (sh_watched_logs != NULL)
-    return 0;
-
-  return -1;
-}
-
-int sh_log_check_timer(time_t tcurrent) 
-{
-  static time_t lastcheck = 0;
-
-  SL_ENTER(_("sh_log_check_timer"));
-  if ((time_t) (tcurrent - lastcheck) >= sh_logmon_interval)
-    {
-      lastcheck  = tcurrent;
-      SL_RETURN((-1), _("sh_log_check_timer"));
-    }
-  SL_RETURN(0, _("sh_log_check_timer"));
-}
-
-
-int sh_log_check_check(void) 
-{
-  int status = 0;
-
-  SL_ENTER(_("sh_log_check_check"));
-
-  SH_MUTEX_LOCK(mutex_logmon_check);
-
-  status = 0;
-
-  if( ShLogmonActive != S_FALSE )
-    {
-      sh_check_watches();
-      sh_keep_match();
-      sh_log_mark_check();
-      clean_dir();
-    }
-  SH_MUTEX_UNLOCK(mutex_logmon_check);
-
-  SL_RETURN(status, _("sh_log_check_check"));
-}
-
-int sh_log_check_reconf(void) 
-{
-  int status = 0;
-
-  SL_ENTER(_("sh_log_check_check"));
-
-  SH_MUTEX_LOCK(mutex_logmon_check);
-
-  ShLogmonActive     = S_FALSE;
-  sh_logmon_interval = SH_LOGMON_INTERVAL;
-  sh_dump_watches();
-  sh_eval_cleanup();
-
-  SH_MUTEX_UNLOCK(mutex_logmon_check);
-
-  SL_RETURN(status, _("sh_log_check_check"));
-}
-
-int sh_log_check_cleanup(void) 
-{
-  sh_log_mark_destroy();
-  return sh_log_check_reconf();
-}
-
-/*********************  OPTIONS **********************/
-
-static int sh_logmon_set_active  (const char *str);
-static int sh_logmon_set_clean  (const char *str);
-static int sh_logmon_set_interval(const char *str);
-static int sh_logmon_add_watch (const char * str);
-static int sh_logmon_add_group (const char * str);
-static int sh_logmon_end_group (const char * str);
-static int sh_logmon_add_host  (const char * str);
-static int sh_logmon_end_host  (const char * str);
-static int sh_logmon_add_queue (const char * str);
-static int sh_logmon_add_rule  (const char * str);
-extern int sh_set_hidepid(const char *s);
-static int sh_logmon_set_save_dir(const char *s);
-
-sh_rconf sh_log_check_table[] = {
-    {
-        N_("logmonactive"),
-        sh_logmon_set_active,
-    },
-    {
-        N_("logmoninterval"),
-        sh_logmon_set_interval,
-    },
-    {
-        N_("logmonclean"),
-        sh_logmon_set_clean,
-    },
-    {
-        N_("logmonwatch"),
-        sh_logmon_add_watch,
-    },
-    {
-        N_("logmonqueue"),
-        sh_logmon_add_queue,
-    },
-    {
-        N_("logmongroup"),
-        sh_logmon_add_group,
-    },
-    {
-        N_("logmonendgroup"),
-        sh_logmon_end_group,
-    },
-    {
-        N_("logmonhost"),
-        sh_logmon_add_host,
-    },
-    {
-        N_("logmonendhost"),
-        sh_logmon_end_host,
-    },
-    {
-        N_("logmonrule"),
-        sh_logmon_add_rule,
-    },
-    {
-        N_("logmonhidepid"),
-        sh_set_hidepid,
-    },
-    {
-        N_("logmonsavedir"),
-        sh_logmon_set_save_dir,
-    },
-    {
-        N_("logmonmarkseverity"),
-        sh_log_set_mark_severity,
-    },
-    {
-        N_("logmonburstthreshold"),
-        sh_repeat_set_trigger,
-    },
-    {
-        N_("logmonburstqueue"),
-        sh_repeat_set_queue,
-    },
-    {
-        N_("logmonburstcron"),
-        sh_repeat_set_cron,
-    },
-    {
-        N_("logmondeadtime"),
-        sh_keep_deadtime,
-    },
-    {
-        NULL,
-        NULL
-    }
-};
-
-/* Decide if we're active.
- */
-static int sh_logmon_set_active(const char *str) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_logmon_set_active"));
-
-  value = sh_util_flagval(str, &ShLogmonActive);
-
-  SL_RETURN((value), _("sh_logmon_set_active"));
-}
-
-/* Decide if we're active.
- */
-static int sh_logmon_set_clean(const char *str) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_logmon_set_active"));
-
-  value = sh_util_flagval(str, &do_checkpoint_cleanup);
-
-  SL_RETURN((value), _("sh_logmon_set_active"));
-}
-
-static int sh_logmon_set_save_dir(const char *str) 
-{
-  int retval = -1;
-    
-  SL_ENTER(_("sh_logmon_set_save_dir"));
-
-  if (str && str[0] == '/')
-    {
-      if (save_dir)
-	{
-	  SH_FREE(save_dir);
-	  save_dir = NULL;
-	}
-      save_dir = sh_util_strdup(str);
-      retval = 0;
-    }
-
-  SL_RETURN((retval), _("sh_logmon_set_save_dir"));
-}
-
-static int sh_logmon_set_interval (const char * c)
-{
-  int retval = 0;
-  long val;
-
-  SL_ENTER(_("sh_logmon_set_interval"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val <= 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("log monitoring interval"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      retval = -1;
-    }
-  else
-    {
-      sh_logmon_interval = (time_t) val;
-    }
-  SL_RETURN(retval, _("sh_logmon_set_interval"));
-}
-
-/* Add a watch on a logfile.
- * Format: TYPE : Filename [: File_Format]
- */
-static int sh_logmon_add_watch (const char * str)
-{
-  return sh_add_watch(str);
-}
-
-/* Add a host.
- * Format: Name_Regex
- */
-static int sh_logmon_add_host (const char * str)
-{
-  return sh_eval_hadd(str);
-}
-
-/* End a host.
- * Format: Name
- */
-static int sh_logmon_end_host (const char * str)
-{
-  (void) str;
-  return sh_eval_hend(NULL);
-}
-
-/* Add a group of rules. 
- * Groups can be under hosts, but not vice versa.
- * Format: Name : Prefix_Regex
- */
-static int sh_logmon_add_group (const char * str)
-{
-  return sh_eval_gadd(str);
-}
-
-/* End a group of rules.
- * Format: Name
- */
-static int sh_logmon_end_group (const char * str)
-{
-  (void) str;
-  return sh_eval_gend(NULL);
-}
-
-/* Define a reporting queue.
- * Format: Label : [Interval] : TYPE : Severity[:alias]
- * TYPE must be 'report' or 'sum'
- * Interval is ignored for TYPE='report'
- */
-static int sh_logmon_add_queue (const char * str)
-{
-  return sh_eval_qadd(str);
-}
-
-/* Define a check rule.
- * Format: [KEEP(seconds,label):]Queue_Label : Regex
- * KEEP indicates that we keep the label, to perform
- *      correlation matching
- */
-static int sh_logmon_add_rule (const char * str)
-{
-  return sh_eval_radd(str);
-}
-
-
-#if 0
-
-/* >>>>>>>>>>>  MAIN <<<<<<<<<<<<<<<<<<< */
-
-int main (int argc, char * argv[])
-{
-  int status, i;
-  FILE * fp;
-  sh_string * s = NULL;
-  static char template[] = "/tmp/xtest.XXXXXX";
-
-  /* pacct */
-  status = sh_add_watch("PACCT:/var/log/account/pacct");
-  sh_check_watches();
-  sh_dump_watches();
-  exit(0);
-
-  /* apache log */
-  sh_eval_gadd("four_o_four:404");
-  sh_eval_qadd("test:1:sum:7");
-  sh_eval_radd("test:^(\\d+.\\d+.\\d+.\\d+).*");
-  sh_eval_gend(NULL);
-  sh_eval_radd("trash:.*");
-  status = sh_add_watch("APACHE:/var/log/apache2/access.log:combined");
-  sh_check_watches();
-  sh_dump_watches();
-  exit(0);
-
-  /* logfile */
-  sh_set_hidepid(1);
-  sh_eval_hadd("hslxmsrv1");
-  sh_eval_gadd("postfix:postfix");
-  sh_eval_qadd("test::report:7");
-  sh_eval_radd("test:postfix/smtpd: disconnect from localhost.*");
-  sh_eval_radd("trash:postfix/smtpd: disconnect.*");
-  sh_eval_hadd("hspc05");
-  sh_eval_gadd("cron:CRON");
-  sh_eval_qadd("test:1:sum:7");
-  sh_eval_radd("test:CRON: PAM adding faulty module: (/lib/security/.*.so)");
-  sh_eval_radd("trash:.*");
-  status = sh_add_watch("SYSLOG:/var/log/messages");
-  sh_check_watches();
-
-  sh_dump_watches();
-  exit(0);
-
-  printf("%d types\n",
-	 (int) (sizeof(sh_logtypes_def)/sizeof(struct sh_logfile_type)));
-
-  /* test sh_add_watch 
-   */
-  status = sh_add_watch("");
-  printf("%2d: zero length, expect -1\n", status);
-  status = sh_add_watch(NULL);
-  printf("%2d: NULL, expect -2\n", status);
-  status = sh_add_watch("0123456789012345:/var/log/messages");
-  printf("%2d: long, expect -2\n", status);
-  status = sh_add_watch("012345678901234:/var/log/messages");
-  printf("%2d: exact length, expect -3\n", status);
-  status = sh_add_watch("01234567890123:56789");
-  printf("%2d: short length, expect -3\n", status);
-  status = sh_add_watch("SYSLOG:var/log/messages");
-  printf("%2d: short badpath, expect -4\n", status);
-  status = sh_add_watch("SYSLOG:/var/log/messages");
-  /* status = sh_add_watch("SYSLOG:/var/log/dpkg.log.1"); */
-  printf("%2d: short path ok, expect 0\n", status);
-
-  /* test sh_string_read 
-   */
-  s = sh_string_new();
-
-  status = /*@i@*/mkstemp(template);
-
-  if (status < 0) {
-    fprintf(stderr, "error in mkstemp!\n"); exit(EXIT_FAILURE); }
-
-  fp = fdopen(status, "r+");
-  if (!fp) {
-    fprintf(stderr, "error in fdopen!\n"); exit(EXIT_FAILURE); }
-
-  for (i = 0; i <  80; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 0 */
-  for (i = 0; i < 118; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 1 */
-  for (i = 0; i < 119; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 2 */
-  for (i = 0; i < 120; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 3 */
-  for (i = 0; i < 121; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 4 */
-  for (i = 0; i < 238; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 239; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 240; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 241; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-
-  rewind(fp);
-
-  for (i = 0; i < 9; ++i)
-    {
-      status = (int) sh_string_read(s, fp, 120);
-      printf("%d: status = %d, len = %d, size = %d\n",
-	     i, status, (int)s->len, (int)s->siz);
-      if (status == -2)
-	(void) sh_string_read(s, fp, 240);
-      else
-	printf("%s\n", s->str);
-    }
-
-  rewind(fp);
-
-  (void) sh_string_truncate(s, 0);
-
-  for (i = 0; i < 9; ++i)
-    {
-      status = (int) sh_string_read(s, fp, 240);
-      printf("%d: status = %d, len = %d, size = %d\n",
-	     i, status, (int)s->len, (int)s->siz);
-      if (status == -2)
-	(void) sh_string_read(s, fp, 240);
-      else
-	{
-	  for (status = 0; status < (int)s->len; ++status)
-	    {
-	      if (s->str[status] != 'a')
-		{
-		  break;
-		}
-	    }
-	  printf("%d %s\n", status, s->str);
-	}
-    }
-
-  sl_fclose(FIL__, __LINE__, fp); remove(template);
-
-
-
-  return 0;
-}
-#endif
-
-/* #ifdef USE_LOGFILE_MONITOR */
-#endif
-
Index: trunk/src/sh_log_correlate.c
===================================================================
--- trunk/src/sh_log_correlate.c	(revision 591)
+++ 	(revision )
@@ -1,329 +1,0 @@
-#include "config_xor.h"
-
-#ifdef USE_LOGFILE_MONITOR
-
-#undef  FIL__
-#define FIL__  _("sh_log_correlate.c")
-
-#include <string.h>
-#include <time.h>
-
-/* Debian/Ubuntu: libpcre2-dev */
-#define PCRE2_CODE_UNIT_WIDTH 8
-#ifdef HAVE_PCRE2_PCRE2_H
-#include <pcre2/pcre2.h>
-#else
-#include <pcre2.h>
-#endif
-
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-#include "sh_log_check.h"
-#include "sh_log_evalrule.h"
-
-extern int flag_err_debug;
-
-/*--------------------------------------------------------------
- *
- *   Event correlation
- *
- *--------------------------------------------------------------*/
-
-/* For each even to be correlated, we keep a label in a list. We
- * then build a string from the (time-sorted) list of labels, and
- * match this string against a regular expression.
- */
-
-/* -- The list of labels kept in memory ----------------------- */
-
-struct sh_keep
-{
-  sh_string       * label;           /* label of keep rule      */
-  unsigned long     delay;           /* valid delay             */
-  time_t            last;            /* seen at                 */
-  struct sh_keep *  next; 
-};
-
-static struct sh_keep * keeplist  = NULL;
-static struct sh_keep * keeplast  = NULL;
-static unsigned long    keepcount = 0;
-
-static void sh_keep_free(void * item)
-{
-  struct sh_keep * keep = (struct sh_keep *) item;
-
-  if (!keep)
-    return;
-  sh_string_destroy(&(keep->label));
-  SH_FREE(keep);
-}
-
-void sh_keep_destroy()
-{
-  struct sh_keep * keep;
-
-  while (keeplist)
-    {
-      keep = keeplist;
-      keeplist = keep->next;
-      sh_keep_free(keep);
-      --keepcount;
-    }
-  keeplist  = NULL;
-  keeplast  = NULL;
-  keepcount = 0;
-}
-
-int sh_keep_add(sh_string * label, unsigned long delay, time_t last)
-{
-  struct sh_keep * keep = SH_ALLOC(sizeof(struct sh_keep));
-
-  keep->label = sh_string_copy(label);
-  keep->delay = delay;
-  keep->last  = last;
-  keep->next  = NULL;
-
-  if (keeplast && keeplist)
-    {
-      keeplast->next = keep;
-      keeplast       = keep;
-    }
-  else
-    {
-      keeplist = keep;
-      keeplast = keeplist;
-    }
-  ++keepcount;
-  return 0;
-}
-
-int sh_keep_comp(const void * a, const void * b)
-{
-  return ( (int)(((const struct sh_keep *)a)->last) - 
-	   (int)(((const struct sh_keep *)b)->last) );
-}
-
-/* -- Sort the kept labels and build a string ----------------- */
-
-static sh_string * sh_keep_eval()
-{
-  unsigned long count   = 0;
-  sh_string * res       = NULL;
-  time_t now            = time(NULL);
-  struct sh_keep * keep = keeplist;
-  struct sh_keep * prev = keeplist;
-  struct sh_keep * arr;
-
-  if (keepcount > 0)
-    {
-      arr = SH_ALLOC (keepcount * sizeof(struct sh_keep));
-
-      while (count < keepcount && keep)
-	{
-	  if ((now >= keep->last) && 
-	      ((unsigned long)(now - keep->last) <= keep->delay))
-	    {
-	      memcpy(&(arr[count]), keep, sizeof(struct sh_keep));
-	      ++count;
-	      prev = keep;
-	      keep = keep->next;
-	    }
-	  else /* Too old or in future, delete it */
-	    {
-	      if (keep != keeplist)
-		{
-		  prev->next = keep->next;
-		  sh_keep_free(keep);
-		  keep = prev->next;
-		  --keepcount;
-		}
-	      else /* list head */
-		{
-		  keeplist = keep->next;
-		  prev     = keeplist;
-		  sh_keep_free(keep);
-		  keep     = keeplist;
-		  --keepcount;
-		}
-	    }
-	}
-
-      if (count > 0)
-	{
-	  unsigned long i;
-	  qsort(arr, count, sizeof(struct sh_keep), sh_keep_comp);
-	  res = sh_string_copy(arr[0].label);
-	  for (i = 1; i < count; ++i)
-	    res = sh_string_add(res, arr[i].label);
-	}
-      SH_FREE(arr);
-    }
-
-  return res;
-}
-
-/* -- Match the string against correlation rules -------------- */
-
-struct sh_mkeep
-{
-  sh_string       * label;           /* label of match rule     */
-  pcre2_code      * rule;            /* compiled regex for rule */
-  time_t            reported;        /* last reported           */
-  struct sh_qeval * queue;           /* assigned queue          */
-  struct sh_mkeep * next; 
-};
-
-struct sh_mkeep * mkeep_list = NULL;
-unsigned long     mkeep_deadtime = 60;
-
-int sh_keep_deadtime (const char * str)
-{
-  unsigned long  value;
-  char * foo;
-
-  value = (size_t) strtoul(str, &foo, 0);
-
-  if (*foo == '\0') {
-    mkeep_deadtime = value;
-    return 0;
-  }
-  return -1;
-}
-
-int sh_keep_match_add(const char * str, const char * queue, 
-		      const char * pattern)
-{
-  unsigned int nfields = 1; /* seconds:label */
-  size_t       lengths[1];
-  char *       new    = sh_util_strdup(str);
-  char **      splits = split_array_braced(new, _("CORRELATE"), 
-					   &nfields, lengths);
-
-  if (nfields == 1 && lengths[0] > 0)
-    {
-      struct sh_mkeep * mkeep = SH_ALLOC(sizeof(struct sh_mkeep));
-      int               error;
-      size_t            erroffset;
-      struct sh_qeval * rqueue = NULL;
-
-      mkeep->rule = pcre2_compile((PCRE2_SPTR8)pattern, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, 
-				  &error, &erroffset, NULL);
-      if (!(mkeep->rule))
-	{
-	  sh_string * msg =  sh_string_new(0);
-	  sh_string_add_from_char(msg, _("Bad regex: "));
-	  sh_string_add_from_char(msg, pattern);
-	  
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  sh_string_str(msg),
-			  _("sh_keep_match_add"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_string_destroy(&msg);
-	  
-	  SH_FREE(splits);
-	  SH_FREE(mkeep);
-	  SH_FREE(new);
-	  return -1;
-	}
-
-      if (0 != strcmp(queue, _("trash")))
-	{
-
-	  rqueue = sh_log_find_queue(queue);
-	  if (!rqueue)
-	    {
-	      pcre2_code_free(mkeep->rule);
-	      SH_FREE(splits);
-	      SH_FREE(mkeep);
-	      SH_FREE(new);
-	      return -1;
-	    }
-	}
-
-      mkeep->queue = rqueue;
-      mkeep->label = sh_string_new_from_lchar(splits[0], strlen(splits[0]));
-      mkeep->reported = 0;
-      mkeep->next  = mkeep_list;
-      mkeep_list   = mkeep;
-    }
-  SH_FREE(new);
-  return 0;
-}
-
-void sh_keep_match_del()
-{
-  struct sh_mkeep * mkeep = mkeep_list;
-  while (mkeep)
-    {
-      mkeep_list = mkeep->next;
-      sh_string_destroy(&(mkeep->label));
-      pcre2_code_free(mkeep->rule);
-      mkeep = mkeep_list;
-    }
-  mkeep_list = NULL;
-}
-
-static struct sh_mkeep ** dummy_mkeep;
-
-void sh_keep_match()
-{
-  if (mkeep_list)
-    {
-      sh_string       * res = sh_keep_eval();
-
-      if (res)
-	{
-	  struct sh_mkeep * mkeep = mkeep_list;
-
-	  dummy_mkeep = &mkeep;
-
-	  while (mkeep)
-	    {
-	      pcre2_match_data * match_data = pcre2_match_data_create_from_pattern(mkeep->rule, NULL);
-	      
-	      int val = pcre2_match(mkeep->rule, 
-				    (PCRE2_SPTR8) sh_string_str(res), (int)sh_string_len(res), 0,
-				    0, match_data, NULL);
-	      
-	      pcre2_match_data_free(match_data);
-	      
-	      if (val > 0)
-		{
-		  sh_string * alias;
-		  time_t      now = time(NULL);
-
-		  if ((mkeep->reported < now) &&
-		      (mkeep_deadtime < (unsigned int)(now - mkeep->reported)))
-		    {
-		      mkeep->reported = now;
-
-		      SH_MUTEX_LOCK(mutex_thread_nolog);
-		      sh_error_handle (mkeep->queue->severity, FIL__, __LINE__, 0, 
-				       MSG_LOGMON_COR, sh_string_str(mkeep->label),
-				       val);
-
-		      alias = mkeep->queue->alias;
-		      if (alias)
-			{
-			  sh_error_mail (sh_string_str(alias), 
-					 mkeep->queue->severity, FIL__, __LINE__, 0, 
-					 MSG_LOGMON_COR, sh_string_str(mkeep->label),
-					 val);
-			}
-		      
-		      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		    }
-		}
-	      mkeep = mkeep->next;
-	    }
-	  sh_string_destroy(&res);
-	}
-    }
-  return;
-}
-
-#endif
Index: trunk/src/sh_log_evalrule.c
===================================================================
--- trunk/src/sh_log_evalrule.c	(revision 591)
+++ 	(revision )
@@ -1,1280 +1,0 @@
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#include <limits.h>
-#include <sys/types.h>
-
-#ifdef USE_LOGFILE_MONITOR
-
-#undef  FIL__
-#define FIL__  _("sh_log_evalrule.c")
-
-/* Debian/Ubuntu: libpcre2-dev */
-#define PCRE2_CODE_UNIT_WIDTH 8
-#ifdef HAVE_PCRE2_PCRE2_H
-#include <pcre2/pcre2.h>
-#else
-#include <pcre2.h>
-#endif
-
-#ifndef PCRE2_NO_AUTO_CAPTURE
-#define PCRE2_NO_AUTO_CAPTURE 0
-#endif
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-#include "sh_log_check.h"
-#include "sh_log_evalrule.h"
-#include "sh_log_correlate.h"
-#include "sh_log_mark.h"
-#include "sh_log_repeat.h"
-#include "zAVLTree.h"
-
-extern int flag_err_debug;
-
-/* #define DEBUG_EVALRULES */
-
-#ifdef DEBUG_EVALRULES
-static void DEBUG(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap); /* flawfinder: ignore *//* we control fmt string */
-  va_end(ap);
-  return;
-}
-#else
-static void DEBUG(const char *fmt, ...)
-{
-  (void) fmt;
-  return;
-}
-#endif
-
-struct sh_ceval    /* Counter for summarizing    */
-{
-  sh_string   * hostname;
-  sh_string   * counted_str;
-  sh_string   * filename;
-  unsigned long count;
-  time_t        start;
-  time_t        interval;
-};
-
-void sh_ceval_free(void * item)
-{
-  struct sh_ceval * counter = (struct sh_ceval *) item;
-  if (!counter)
-    return;
-  sh_string_destroy(&(counter->hostname));
-  sh_string_destroy(&(counter->counted_str));
-  sh_string_destroy(&(counter->filename));
-  SH_FREE(counter);
-}
-
-enum {
-  RFL_ISRULE  = 1 << 0,
-  RFL_ISGROUP = 1 << 1,
-  RFL_KEEP    = 1 << 2,
-  RFL_MARK    = 1 << 3
-};
-
-
-/*--------------------------------------------------------------
- *
- *   Adding rules/groups/hosts
- *
- *--------------------------------------------------------------*/
-
-struct sh_geval  /* Group of rules (may be a single rule) */
-{
-  sh_string        * label;           /* label for this group    */
-  pcre2_code       * rule;            /* compiled regex for rule */
-
-  pcre2_match_data * match_data;      /* captured substrings     */
-  int                ovecnum;         /* how many captured       */
-  int                captures;        /* (captures+1)*3 required */
-  int                flags;           /* bit flags               */
-  unsigned long      delay;           /* delay for keep rules    */
-  zAVLTree         * counterlist;     /* counters if EVAL_SUM    */
-  struct sh_qeval  * queue;           /* queue for this rule     */
-  struct sh_geval  * nextrule;        /* next rule in this group */
-  struct sh_geval  * next;            /* next group of rules     */
-  struct sh_geval  * gnext;           /* grouplist next          */
-};
-
-struct sh_heval  /* host-specific rules */
-{
-  pcre2_code      * hostname;        /* compiled regex for hostname */
-  struct sh_geval * rulegroups;      /* list of group of rules      */
-  struct sh_heval * next;
-};
-
-static struct sh_heval * hostlist  = NULL;
-static struct sh_qeval * queuelist = NULL;
-static struct sh_geval * grouplist = NULL;
-
-/* These flags are set if we are within 
- * the define of a host/rule group.
- */
-static struct sh_heval * host_open  = NULL;
-static struct sh_geval * group_open = NULL;
-
-int sh_eval_gend (const char * str)
-{
-  (void) str;
-  if (group_open) {
-    group_open = NULL;
-    return 0;
-  }
-  return -1;
-}
-
-int sh_eval_gadd (const char * str)
-{
-  struct sh_geval * ng;
-  struct sh_geval * tmp;
-  pcre2_code * group;
-
-  int          error;
-  PCRE2_SIZE   erroffset;
-  unsigned int nfields = 2;
-  size_t       lengths[2];
-  
-  char *       new = sh_util_strdup(str);
-  char **      splits = split_array(new, &nfields, ':', lengths);
-
-  /* group is label:regex
-   */
-
-  if (group_open)
-    group_open = NULL;
-
-  if (nfields != 2)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  group = pcre2_compile((PCRE2_SPTR8)splits[1], lengths[1], PCRE2_NO_AUTO_CAPTURE, 
-		       &error, &erroffset, NULL);
-  if (!group)
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Bad regex: "));
-      sh_string_add_from_char(msg, splits[1]);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_eval_gadd"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-      
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  ng = SH_ALLOC(sizeof(struct sh_geval));
-  memset(ng, 0, sizeof(struct sh_geval));
-
-  ng->label       = sh_string_new_from_lchar(splits[0], lengths[0]);
-  ng->flags       = RFL_ISGROUP;
-
-  ng->rule        = group;
-
-  ng->match_data  = pcre2_match_data_create_from_pattern(group, NULL);
-  ng->ovecnum     = 0;
-  ng->captures    = 0;
-  ng->counterlist = NULL;
-  ng->queue       = NULL;
-  ng->nextrule    = NULL;
-  ng->next        = NULL;
-  ng->gnext       = NULL;
-
-  if (!host_open)
-    {
-      if (0 != sh_eval_hadd("^.*"))
-	{
-	  pcre2_code_free(group);
-	  pcre2_match_data_free(ng->match_data);
-	  sh_string_destroy(&(ng->label));
-	  SH_FREE(splits);
-	  SH_FREE(new);
-	  SH_FREE(ng);
-	  return -1;
-	}
-    }
-
-  /* 
-   * Insert at end, to keep user-defined order 
-   */ 
-
-  if (host_open)
-    {
-      if (grouplist) 
-	{
-	  tmp = grouplist; 
-	  while (tmp->gnext != NULL) { tmp = tmp->gnext; }
-	  tmp->gnext = ng;
-	} else {
-	  grouplist = ng;
-        }
-
-
-      /* 
-       * If there is an open host group, add it to its
-       * rulegroups
-       */
-
-      if (host_open->rulegroups) 
-	{
-	  tmp = host_open->rulegroups; 
-	  while (tmp->next != NULL) { tmp = tmp->next; }
-	  tmp->next = ng;
-	} else {
-	  host_open->rulegroups = ng;
-        }
-    }
-
-  group_open = ng;
-  SH_FREE(splits);
-  SH_FREE(new);
-  return 0;
-}
-
-int sh_eval_hend (const char * str)
-{
-  (void) str;
-  if (host_open) {
-    host_open = NULL;
-    return 0;
-  }
-  return -1;
-}
-
-int sh_eval_hadd (const char * str)
-{
-  struct sh_heval * nh;
-  struct sh_heval * tmp;
-  pcre2_code     *  host;
-
-  int               error;
-  PCRE2_SIZE        erroffset;
-
-  if (host_open)
-    host_open = NULL;
-
-  host = pcre2_compile((PCRE2_SPTR8)str, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, 
-		       &error, &erroffset, NULL);
-  if (!host)
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Bad regex: "));
-      sh_string_add_from_char(msg, str);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_eval_hadd"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-
-      return -1;
-    }
-
-  nh = SH_ALLOC(sizeof(struct sh_heval));
-  memset(nh, 0, sizeof(struct sh_heval));
-
-  nh->hostname = host;
-  nh->rulegroups = NULL;
-
-  /* 
-   * Insert at end, to keep user-defined order 
-   */ 
-  nh->next = NULL;
-  if (hostlist) {
-    tmp = hostlist; 
-    while (tmp->next != NULL) { tmp = tmp->next; }
-    tmp->next = nh;
-  } else {
-    hostlist = nh;
-  }
-  host_open = nh;
-
-  return 0;
-}
-
-int sh_eval_qadd (const char * str)
-{
-  struct sh_qeval * nq;
-  int     severity;
-  unsigned int nfields = 5; /* label:interval:(report|sum):severity[:alias] */
-  size_t  lengths[5];
-  char *  new = sh_util_strdup(str);
-  char ** splits = split_array(new, &nfields, ':', lengths);
-
-  if (nfields < 4)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  if (strcmp(splits[2], _("sum")) && strcmp(splits[2], _("report")))
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  if (!strcmp(splits[2], _("sum")) && atoi(splits[1]) < 0)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-  
-  if (!strcmp(splits[1], _("trash"))) /* predefined, reserved */
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-  
-  severity = sh_error_convert_level (splits[3]);
-  if (severity < 0)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  nq = SH_ALLOC(sizeof(struct sh_qeval));
-  memset(nq, 0, sizeof(struct sh_qeval));
-
-  nq->label = sh_string_new_from_lchar(splits[0], lengths[0]);
-  nq->alias = NULL;
-
-  DEBUG("debug: splits[2] = %s, policy = %d\n",splits[2],nq->policy); 
-  if (0 == strcmp(splits[2], _("report"))) {
-    nq->policy   = EVAL_REPORT;
-    nq->interval = 0;
-  }
-  else {
-    nq->policy   = EVAL_SUM;
-    nq->interval = (time_t) atoi(splits[1]);
-  }
-
-  nq->severity = severity;
-
-  if (nfields == 5)
-    {
-      nq->alias = sh_string_new_from_lchar(splits[4], lengths[4]);
-    }
-
-  nq->next     = queuelist;
-  queuelist    = nq;
-
-  SH_FREE(splits);
-  SH_FREE(new);
-  return 0;
-}
-
-struct sh_qeval * sh_log_find_queue(const char * str)
-{
-  struct sh_qeval * retval = queuelist;
-
-  if (!str)
-    return NULL;
-
-  while (retval)
-    {
-      if (0 == strcmp(str, sh_string_str(retval->label)))
-	break;
-      retval = retval->next;
-    }
-  return retval;
-}
-
-int sh_log_lookup_severity(const char * str)
-{
-  struct sh_qeval * queue;
-
-  if (str)
-    {
-      if (0 != strcmp(str, _("trash")))
-	{
-	  queue = sh_log_find_queue(str);
-	  
-	  if (queue)
-	    return queue->severity;
-	}
-    }
-  return SH_ERR_SEVERE;
-}
-
-sh_string * sh_log_lookup_alias(const char * str)
-{
-  struct sh_qeval * queue;
-
-  if (str)
-    {
-      if (0 != strcmp(str, _("trash")))
-	{
-	  queue = sh_log_find_queue(str);
-	  
-	  if (queue)
-	    return queue->alias;
-	}
-    }
-  return NULL;
-}
-
-
-static char * get_label_and_time(const char * inprefix, char * str, 
-				 unsigned long * seconds)
-{
-  char       * res    = NULL;
-  char       * endptr = NULL;
-
-  unsigned int nfields = 2; /* seconds:label */
-  size_t       lengths[2];
-  char *       prefix = sh_util_strdup(inprefix);
-  char *       new    = sh_util_strdup(str);
-  char **      splits = split_array_braced(new, prefix, &nfields, lengths);
-
-  if (splits && nfields == 2 && lengths[0] > 0 && lengths[1] > 0)
-    {
-      *seconds = strtoul(splits[0], &endptr, 10);
-      if ((*endptr == '\0') && (endptr != splits[0]) && (*seconds != ULONG_MAX))
-	{
-	  res = sh_util_strdup(splits[1]);
-	}
-    }
-  if (splits)
-    SH_FREE(splits);
-  SH_FREE(new);
-  SH_FREE(prefix);
-  return res;
-}
-
-struct sh_qeval ** sh_dummy_472_queue;
-char            ** sh_dummy_473_dstr;
-
-int sh_eval_radd (const char * str)
-{
-  struct sh_geval * nr;
-  struct sh_geval * tmp;
-  struct sh_qeval * queue;
-  pcre2_code    *  rule;
-
-  int          error;
-  PCRE2_SIZE   erroffset;
-  unsigned int captures = 0;
-  unsigned int nfields = 2; /* queue:regex */
-  size_t       lengths[3];
-  char *       new    = sh_util_strdup(str);
-  char **      splits;
-
-  int           qpos  = 0;
-  volatile int  rpos  = 1;
-  unsigned long dsec  = 0;
-  char *        dstr  = NULL;
-  char *        s     = new;
-  volatile char pflag = '-';
-
-  if (s == NULL)
-    return -1;
-  /* cppcheck-suppress uninitdata */
-  while ( *s && isspace((int)*s) ) ++s;
-  if (0 == strncmp(s, _("KEEP"), 4)      || 
-      0 == strncmp(s, _("CORRELATE"), 9) ||
-      0 == strncmp(s, _("MARK"), 4))
-    {
-      pflag   = s[0];
-      nfields = 3;
-    }
-
-  splits = split_array(new, &nfields, ':', lengths);
-
-  sh_dummy_472_queue = &queue;
-  sh_dummy_473_dstr  = &dstr;
-
-  queue = NULL;
-
-  if (nfields < 2 || nfields > 3)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  if (nfields == 3)
-    {
-      if (pflag == 'K')
-	{
-	  /* KEEP(nsec,label):queue:regex
-	   */
-	  dstr = get_label_and_time(_("KEEP"), splits[0], &dsec);
-	  if (!dstr)
-	    {
-	      SH_FREE(splits);
-	      SH_FREE(new);
-	      return -1;
-	    }
-	}
-      else if (pflag == 'C')
-	{
-	  /* CORRELATE(description):queue:regex 
-	   */
-	  int retval = sh_keep_match_add(splits[0], splits[1], splits[2]);
-	  SH_FREE(splits);
-	  SH_FREE(new);
-	  return retval;
-	}
-      else if (pflag == 'M')
-	{
-	  /* MARK(description, interval):queue:regex 
-	   */
-	  int retval = -1;
-
-	  dstr = get_label_and_time(_("MARK"), splits[0], &dsec);
-	  if (dstr)
-	    {
-	      retval = sh_log_mark_add(dstr, dsec, splits[1]);
-	    }
-	  if (retval != 0)
-	    {
-	      SH_FREE(splits);
-	      SH_FREE(new);
-	      return retval;
-	    }
-	}
-      ++qpos; ++rpos;
-    }
-
-  if (0 != strcmp(splits[qpos], _("trash")))
-    {
-      queue = sh_log_find_queue(splits[qpos]);
-      if (!queue)
-	{
-	  SH_FREE(splits);
-	  SH_FREE(new);
-	  return -1;
-	}
-    }
-
-  rule = pcre2_compile((PCRE2_SPTR8)splits[rpos], lengths[rpos], 0, 
-		       &error, &erroffset, NULL);
-  if (!rule)
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Bad regex: "));
-      sh_string_add_from_char(msg, splits[rpos]);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("sh_eval_radd"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_string_destroy(&msg);
-
-      SH_FREE(splits);
-      SH_FREE(new);
-      return -1;
-    }
-
-  pcre2_pattern_info(rule, PCRE2_INFO_CAPTURECOUNT, &captures);
-
-  if (flag_err_debug == S_TRUE)
-    {
-      char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-      if (dstr)
-	sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Adding rule: |%s| with %u captures, keep(%lu,%s)"), 
-		    splits[rpos], captures, dsec, dstr);
-      else
-	sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Adding rule: |%s| with %u captures"), 
-		    splits[rpos], captures);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      emsg, _("sh_eval_radd"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(emsg);
-    }
-
-  DEBUG("adding rule: |%s| with %u captures\n", splits[rpos], captures);
-
-  SH_FREE(splits);
-  SH_FREE(new);
-
-  nr = SH_ALLOC(sizeof(struct sh_geval));
-  memset(nr, 0, sizeof(struct sh_geval));
-
-  nr->label       = NULL;
-  nr->flags       = RFL_ISRULE;
-  nr->delay       = 0;
-
-  nr->rule        = rule;
-
-  nr->captures    = captures;
-  nr->match_data  = pcre2_match_data_create_from_pattern(rule, NULL);
-  nr->ovecnum     = 0;
-  nr->counterlist = NULL;
-  nr->queue       = queue;
-  nr->nextrule    = NULL;
-  nr->next        = NULL;
-  nr->gnext       = NULL;
-
-
-  if (pflag == 'K')
-    {
-      nr->label   = sh_string_new_from_lchar(dstr, sl_strlen(dstr));
-      nr->flags  |= RFL_KEEP;
-      nr->delay   = dsec;
-      SH_FREE(dstr);
-    }
-  else if (pflag == 'M')
-    {
-      nr->label   = sh_string_new_from_lchar(dstr, sl_strlen(dstr));
-      nr->flags  |= RFL_MARK;
-      nr->delay   = dsec;
-      SH_FREE(dstr);
-    }
-
-  /* 
-   * If there is an open group, add it to its
-   * rules
-   */
-  if (group_open)
-    {
-      if (flag_err_debug == S_TRUE)
-	{
-	  char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-	  sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Adding rule to group |%s|"), 
-		      sh_string_str(group_open->label));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  emsg, _("sh_eval_radd"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(emsg);
-	}
-
-      DEBUG("adding rule to group |%s|\n", sh_string_str(group_open->label));
-
-      if (group_open->nextrule) 
-	{
-	  tmp = group_open->nextrule; 
-	  while (tmp->nextrule != NULL) { tmp = tmp->nextrule; } /* next -> nextrule */
-	  tmp->nextrule = nr;                                    /* next -> nextrule */
-	} else {
-	  group_open->nextrule = nr;
-	}
-    }
-
-  /* 
-   * ..else, add it to the currently open host (open the
-   * default host, if there is no open one)
-   */
-  else
-    {
-      if (!host_open)
-	{
-	  if (0 != sh_eval_hadd("^.*"))
-	    {
-	      if (nr->label)
-		sh_string_destroy(&(nr->label));
-	      if (nr->rule)
-		pcre2_code_free(nr->rule);
-	      if (nr->match_data)
-		pcre2_match_data_free(nr->match_data);
-	      SH_FREE(nr);
-	      return -1;
-	    }
-	}
-
-      if (host_open)
-	{
-	  /* 
-	   * Add rule as member to grouplist, to facilitate cleanup
-	   */
-
-	  DEBUG("adding solitary rule to grouplist\n");
-
-	  if (grouplist) 
-	    {
-	      tmp = grouplist; 
-	      while (tmp->gnext != NULL) { tmp = tmp->gnext; }
-	      tmp->gnext = nr;
-	    } else {
-	      grouplist = nr;
-	    }
-
-
-	  /* 
-	   * Add rule to host rulegroups
-	   */
-	  DEBUG("adding solitary rule to host rulegroups\n");
-
-	  if (host_open->rulegroups) 
-	    {
-	      /* Second, third, ... rule go to host_open->rulegroups->next,
-	       * since test_grules() iterates over nextrules
-	       */
-	      tmp = host_open->rulegroups; 
-	      while (tmp->next != NULL) { tmp = tmp->next; }
-	      tmp->next = nr;
-	    } 
-	  else 
-	    {
-	      /* First rule goes to host_open->rulegroups */
-	      host_open->rulegroups = nr;
-	    }
-	}
-      else
-	{
-	  if (nr->label)
-	    sh_string_destroy(&(nr->label));
-	  if (nr->rule)
-	    pcre2_code_free(nr->rule);
-	  if (nr->match_data)
-	    pcre2_match_data_free(nr->match_data);
-	  SH_FREE(nr);
-	  return -1;
-	}
-    }
-
-  return 0;
-}
-
-void sh_eval_cleanup()
-{
-  struct sh_geval * gtmp;
-  struct sh_qeval * qtmp;
-  struct sh_heval * htmp;
-
-  while (grouplist)
-    {
-      gtmp      = grouplist;
-      grouplist = gtmp->gnext;
-
-      if (gtmp->label)
-	sh_string_destroy(&(gtmp->label));
-      if (gtmp->rule)
-	pcre2_code_free(gtmp->rule);
-      if (gtmp->match_data)
-	pcre2_match_data_free(gtmp->match_data);
-      if (gtmp->counterlist)
-	zAVLFreeTree(gtmp->counterlist, sh_ceval_free);
-
-#if 0
-      while (gtmp->nextrule)
-	{
-	  tmp            = gtmp->nextrule;
-	  gtmp->nextrule = tmp->nextrule;
-
-	  if (tmp->rule)
-	    pcre2_code_free(tmp->rule);
-	  if (tmp->counterlist)
-	    zAVLFreeTree(tmp->counterlist, sh_ceval_free);
-	  if (tmp->ovector)
-	    SH_FREE(tmp->ovector);
-	  SH_FREE(tmp);
-	}
-#endif
-      SH_FREE(gtmp);
-    }
-
-  qtmp = queuelist;
-  while (qtmp)
-    {
-      if (qtmp->label)      sh_string_destroy(&(qtmp->label));
-      queuelist = qtmp->next;
-      SH_FREE(qtmp);
-      qtmp = queuelist;
-    }
-
-  htmp = hostlist;
-  while (htmp)
-    {
-      if (htmp->hostname)
-	pcre2_code_free(htmp->hostname);
-      if (htmp->rulegroups)
-	htmp->rulegroups = NULL;
-      hostlist = htmp->next;
-      htmp->next = NULL;
-      SH_FREE(htmp);
-      htmp = hostlist;
-    }
-
-  hostlist   = NULL;
-  queuelist  = NULL;
-  grouplist  = NULL;
-
-  host_open  = NULL;
-  group_open = NULL;
-
-  sh_keep_destroy();
-  sh_keep_match_del();
-
-  return;
-}
-
-/**********************************************************************
- *
- * Actual rule processing
- *
- **********************************************************************/ 
-
-/* Test a list of rules against msg; return matched rule, with ovector 
- * filled in
- */
-struct sh_geval ** sh_dummy_828_rule;
-
-static struct sh_geval * test_rule (struct sh_geval * rule, sh_string *msg, time_t tstamp)
-{
-  int res; 
-  volatile int    count;
-  volatile time_t timestamp = tstamp;
-
-  sh_dummy_828_rule = &rule;
-
-  if (!rule)
-    DEBUG("debug: (NULL) rule\n");
-
-  if (rule && sh_string_len(msg) < (size_t)INT_MAX)
-    {
-      count = 1;
-      do {
-
-	if (flag_err_debug == S_TRUE)
-	  {
-	    char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-	    sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Check rule %d for |%s|"), 
-			count, sh_string_str(msg));
-	    SH_MUTEX_LOCK(mutex_thread_nolog);
-	    sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    emsg, _("test_rule"));
-	    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    SH_FREE(emsg);
-	  }
-
-	DEBUG("debug: check rule %d for <%s>\n", count, msg->str);
-	
-	res = pcre2_match(rule->rule, 
-			  (PCRE2_SPTR8)sh_string_str(msg), (int)sh_string_len(msg), 0,
-			  0,   rule->match_data, NULL);
-
-	if (res > 0)
-	  {
-	    rule->ovecnum = pcre2_get_ovector_count(rule->match_data);
-
-	    if (flag_err_debug == S_TRUE)
-	      {
-		char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-		if ( rule->flags & RFL_KEEP )
-		  sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Rule %d matches, result = %d (keep)"), 
-			      count, res);
-		else if ( rule->flags & RFL_MARK )
-		  sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Rule %d matches, result = %d (mark)"), 
-			      count, res);
-		else
-		  sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Rule %d matches, result = %d"), 
-			      count, res);
-		SH_MUTEX_LOCK(mutex_thread_nolog);
-		sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-				emsg, _("test_rule"));
-		SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		SH_FREE(emsg);
-	      }
-
-	    if ( rule->flags & RFL_KEEP )
-	      {
-		DEBUG("debug: rule %d matches (keep), timestamp = %lu\n", count, timestamp);
-		sh_keep_add(rule->label, rule->delay, 
-			    timestamp == 0 ? time(NULL) : timestamp);
-	      }
-
-	    else if ( rule->flags & RFL_MARK )
-	      {
-		DEBUG("debug: rule %d matches (mark)\n", count);
-		sh_log_mark_update(rule->label,
-				   timestamp == 0 ? time(NULL) : timestamp);
-	      }
-
-	    break; /* return the matching rule; ovector is filled in */
-	  }
-
-	if (flag_err_debug == S_TRUE)
-	  {
-	    char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-	    sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Rule %d did not match"), 
-			count);
-	    SH_MUTEX_LOCK(mutex_thread_nolog);
-	    sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			    emsg, _("test_rule"));
-	    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    SH_FREE(emsg);
-	  }
-	DEBUG("debug: rule %d did not match\n", count);
-
-	rule = rule->nextrule; ++count;
-      } while (rule);
-    }
-  if (!rule)
-    DEBUG("debug: no match found\n");
-  /* If there was no match, this is NULL */
-  sh_dummy_828_rule = NULL;
-  return rule;
-}
-  
-/* Test a (struct sh_geval *), which may be single rule or a group of rules,
- * against msg
- */
-struct sh_geval ** sh_dummy_928_result;
-struct sh_geval ** sh_dummy_929_group;
-
-static struct sh_geval * test_grules (struct sh_heval * host, 
-				      sh_string       * msg,
-				      time_t            timestamp)
-{
-  struct sh_geval * result = NULL;
-  struct sh_geval * group  = host->rulegroups;
-
-  sh_dummy_928_result = &result;
-  sh_dummy_929_group  = &group;
-
-  if (group && sh_string_len(msg) < (size_t)INT_MAX)
-    {
-      DEBUG("debug: if group\n");
-      do {
-	if( (group->label != NULL) && (0 != (group->flags & RFL_ISGROUP))) 
-	  {
-	    /* this is a rule group */
-
-	    if (flag_err_debug == S_TRUE)
-	      {
-		char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-		sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Checking group |%s| of rules against |%s|"), 
-			    sh_string_str(group->label), sh_string_str(msg));
-		SH_MUTEX_LOCK(mutex_thread_nolog);
-		sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-				emsg, _("test_rule"));
-		SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		SH_FREE(emsg);
-	      }
-
-	    DEBUG("debug: if group->label %s\n", sh_string_str(group->label));
-	    
-	    if (pcre2_match(group->rule,
-			    (PCRE2_SPTR8)sh_string_str(msg), (int) sh_string_len(msg), 0,
-			    0, NULL, NULL) > 0)
-	      {
-		result = test_rule(group->nextrule, msg, timestamp);
-		if (result)
-		  break;
-	      }
-	  }
-	else
-	  {
-	    /* If there is no group label, the 'group' is actually a solitary 
-	     * rule (not within any group).
-	     */
-
-	    if (flag_err_debug == S_TRUE)
-	      {
-		char * emsg = SH_ALLOC(SH_ERRBUF_SIZE);
-		sl_snprintf(emsg,  SH_ERRBUF_SIZE, _("Checking solitary rules"));
-		SH_MUTEX_LOCK(mutex_thread_nolog);
-		sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-				emsg, _("test_rule"));
-		SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		SH_FREE(emsg);
-	      }
-
-	    DEBUG("debug: else (single rule)\n");
-	    result = test_rule(group, msg, timestamp);
-	    if (result)
-	      break;
-	  }
-	group = group->next; /* next group of rules */
-      } while (group);
-    }
-
-  sh_dummy_928_result = NULL;
-  sh_dummy_929_group  = NULL;
-  return result;
-}
-
-/* Top-level find_rule() function
- */
-static struct sh_geval * find_rule (sh_string *host, 
-				    sh_string *msg,
-				    time_t     timestamp)
-{
-  struct sh_geval * result = NULL;
-  struct sh_heval * hlist  = hostlist;
-
-  if (hlist && sh_string_len(host) < (size_t)INT_MAX)
-    {
-      do {
-	if (pcre2_match(hlist->hostname, 
-			(PCRE2_SPTR8)sh_string_str(host), (int) sh_string_len(host), 0, 
-			0, NULL, NULL) > 0)
-	  {
-	    /* matching host, check rules/groups of rules */
-	    result = test_grules(hlist, msg, timestamp);
-	    if (result)
-	      break;
-	  }
-	hlist = hlist->next;
-      } while (hlist);
-    }
-  return result;
-}
-
-/* copy the message and replace captured substrings with '___'
- */
-static sh_string * replace_captures(const sh_string * message, 
-				    size_t * ovector, int ovecnum)
-{
-  sh_string * retval = sh_string_new_from_lchar(sh_string_str(message), 
-						sh_string_len(message));
-
-  if (ovecnum > 1 && (ovector[0] < ovector[1])) /* guard against patterns using \K */
-    {
-      retval = sh_string_replace(retval, &(ovector[2]), (ovecnum-1), "___", 3);
-    }
-  return retval;
-}
-
-static void msg_report(int severity, const sh_string * alias, 
-		       struct sh_geval * rule, struct sh_logrecord * record)
-{
-  char      * tmp;
-  char      * msg;
-  sh_string * mmm = NULL;
-  char      * ttt;
-
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  if (rule) {
-    mmm = replace_captures(record->message, pcre2_get_ovector_pointer(rule->match_data), 
-			   rule->ovecnum);
-    rule->ovecnum = 0;
-    msg = sh_util_safe_name_keepspace (sh_string_str(mmm));
-  }
-  else {
-    msg = sh_util_safe_name_keepspace (sh_string_str(record->message));
-  }
-  tmp = sh_util_safe_name_keepspace (record->filename);
-  ttt = sh_util_safe_name_keepspace (sh_string_str(record->timestr));
-  sh_error_handle (severity, FIL__, __LINE__, 0, MSG_LOGMON_REP,
-		   msg,
-		   ttt,
-		   sh_string_str(record->host),
-		   tmp);
-  if (alias)
-    {
-      sh_error_mail (sh_string_str(alias),
-		     severity, FIL__, __LINE__, 0, MSG_LOGMON_REP,
-		     msg,
-		     ttt,
-		     sh_string_str(record->host),
-		     tmp);
-    }
-  SH_FREE(ttt);
-  SH_FREE(msg);
-  SH_FREE(tmp);
-  if (mmm)
-    sh_string_destroy(&mmm);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static void sum_report(int severity, const sh_string * alias,
-		       sh_string * host, sh_string * message, sh_string * path)
-{
-  char * tmp;
-  char * msg;
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  tmp = sh_util_safe_name_keepspace (sh_string_str(path));
-  msg = sh_util_safe_name_keepspace (sh_string_str(message));
-  sh_error_handle (severity, FIL__, __LINE__, 0, MSG_LOGMON_SUM,
-		   msg,
-		   sh_string_str(host), 
-		   tmp);
-  if (alias)
-    {
-      sh_error_mail (sh_string_str(alias),
-		     severity, FIL__, __LINE__, 0, MSG_LOGMON_SUM,
-		     msg,
-		     sh_string_str(host),
-		     tmp);
-    }
-  SH_FREE(msg);
-  SH_FREE(tmp);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static zAVLKey sh_eval_getkey(void const *item)
-{
-  return ((const struct sh_ceval *)item)->hostname->str;
-}
-
-/* Find the counter, or initialize one if there is none already
- */
-static struct sh_ceval * find_counter(struct sh_geval * rule, 
-				      sh_string * host, time_t interval)
-{
-  struct sh_ceval * counter;
-
-  if (!(rule->counterlist))
-    {
-      DEBUG("debug: allocate new counterlist AVL tree\n");
-      rule->counterlist = zAVLAllocTree(sh_eval_getkey, zAVL_KEY_STRING);
-    }
-
-  counter = (struct sh_ceval *) zAVLSearch (rule->counterlist, 
-					    sh_string_str(host));
-
-  if (!counter)
-    {
-      DEBUG("debug: no counter found\n");
-
-      counter = SH_ALLOC(sizeof(struct sh_ceval));
-      memset(counter, 0, sizeof(struct sh_ceval));
-
-      counter->hostname    = sh_string_new_from_lchar(sh_string_str(host), 
-						      sh_string_len(host));
-      counter->counted_str = NULL;
-      counter->filename    = NULL;
-      counter->count       = 0;
-      counter->start       = time(NULL);
-      counter->interval    = interval;
-
-      zAVLInsert(rule->counterlist, counter);
-    }
-  return counter;
-		       
-}
-
-
-/* process the counter for a SUM rule
- */
-static int  process_counter(struct sh_ceval * counter, 
-			    struct sh_geval * rule,  
-			    struct sh_logrecord * record)
-{
-  int retval = -1;
-  time_t  now;
-
-  if (!(counter->counted_str))
-    {
-      counter->counted_str = replace_captures(record->message,  pcre2_get_ovector_pointer(rule->match_data), 
-					      rule->ovecnum);
-      rule->ovecnum        = 0;
-      counter->filename    = sh_string_new_from_lchar(record->filename,
-						      strlen(record->filename));
-      DEBUG("debug: counted_str after replace: %s\n", 
-	    sh_string_str(counter->counted_str)); 
-    }
-
-  ++(counter->count);
-  now = time(NULL); now -= counter->start;
-  DEBUG("debug: count %lu, interval %lu, time %lu\n", 
-	counter->count, counter->interval, now);
-  if (now >= counter->interval)
-    {
-      DEBUG("debug: report count\n");
-      sum_report(rule->queue->severity, rule->queue->alias,
-		 counter->hostname, counter->counted_str, counter->filename);
-      counter->start = time(NULL);
-      counter->count = 0;
-    }
-  return retval;
-}
-
-/* Process a rule
- */
-static int  process_rule(struct sh_geval * rule, struct sh_logrecord * record)
-{
-  int retval = -1;
-  struct sh_qeval * queue = rule->queue;
-
-  if (queue)
-    {
-      DEBUG("debug: queue policy = %d found\n", queue->policy);
-      if (queue->policy == EVAL_REPORT)
-	{
-	  DEBUG("debug: EVAL_REPORT host: %s, message: %s\n",
-		 sh_string_str(record->host), 
-		 sh_string_str(record->message));
-	  msg_report(queue->severity, queue->alias, rule, record);
-	  retval = 0;
-	}
-      else if (queue->policy == EVAL_SUM)
-	{
-	  
-	  struct sh_ceval * counter = 
-	    find_counter(rule, record->host, queue->interval);
-	  DEBUG("debug: EVAL_SUM host: %s, message: %s\n",
-		 sh_string_str(record->host),
-		 sh_string_str(record->message));
-	  if (counter)
-	    {
-	      DEBUG("debug: counter found\n");
-	      retval = process_counter(counter, rule, record);
-	    }
-	}
-    }
-  else
-    {
-      DEBUG("debug: no queue found -- trash\n");
-      /* No queue means 'trash' */
-      retval = 0;
-    }
-  return retval;
-}
-
-#define DEFAULT_SEVERITY (-1)
-
-int sh_eval_process_msg(struct sh_logrecord * record)
-{
-  static unsigned long i = 0;
-  if (record)
-    {
-      struct sh_geval * rule = find_rule (record->host,
-					  record->message,
-					  record->timestamp);
-
-      if (rule)
-	{
-	  DEBUG("debug: (%lu) rule found\n", i); ++i;
-	  return process_rule(rule, record);
-	}
-      else
-	{
-	  DEBUG("debug: (%lu) no rule found\n", i); ++i;
-	  msg_report(DEFAULT_SEVERITY, NULL, NULL, record);
-	}
-
-      sh_repeat_message_check(record->host, 
-			      record->message, 
-			      record->timestamp);
-			      
-      return 0;
-    }
-  return -1;
-}
-
-#endif
Index: trunk/src/sh_log_mark.c
===================================================================
--- trunk/src/sh_log_mark.c	(revision 591)
+++ 	(revision )
@@ -1,250 +1,0 @@
-#include "config_xor.h"
-
-#ifdef USE_LOGFILE_MONITOR
-
-#include <string.h>
-#include <time.h>
-
-#undef  FIL__
-#define FIL__  _("sh_log_mark.c")
-
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_mem.h"
-#include "sh_string.h"
-#include "sh_error_min.h"
-#include "sh_log_check.h"
-#include "sh_log_evalrule.h"
-#include "zAVLTree.h"
-
-/* #define DEBUG_MARK */
-
-#ifdef DEBUG_MARK
-static void DEBUG(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap); /* flawfinder: ignore *//* we control fmt string */
-  va_end(ap);
-  return;
-}
-#else
-static void DEBUG(const char *fmt, ...)
-{
-  (void) fmt;
-  return;
-}
-#endif
-
-static zAVLTree * marklist = NULL;
-
-struct sh_mark_event
-{
-  sh_string   * label;
-  sh_string   * queue_id;
-  time_t        last_seen;
-  time_t        interval;
-  time_t        delay;
-  time_t        last_reported;
-};
-
-static void sh_marklist_free(void * item)
-{
-  struct sh_mark_event * event = (struct sh_mark_event *) item;
-  if (!event)
-    return;
-  sh_string_destroy(&(event->label));
-  sh_string_destroy(&(event->queue_id));
-  SH_FREE(event);
-  return;
-}
-
-void sh_log_mark_destroy()
-{
-  zAVLFreeTree(marklist, sh_marklist_free);
-}
-
-static zAVLKey sh_log_mark_getkey(void const *item)
-{
-  return ((const struct sh_mark_event *)item)->label->str;
-}
-
-int sh_log_mark_add (const char * label, time_t interval, const char * qlabel)
-{
-  struct sh_mark_event * event;
-
-  if (!(marklist))
-    {
-      marklist = zAVLAllocTree(sh_log_mark_getkey, zAVL_KEY_STRING);
-    }
-
-  event = (struct sh_mark_event *) zAVLSearch(marklist, label);
-  if (event)
-    {
-      event->interval     = interval;
-      sh_string_destroy(&(event->queue_id));
-      event->queue_id     = sh_string_new_from_lchar(qlabel, strlen(qlabel));
-      return 0;
-    }
-
-  event = SH_ALLOC(sizeof(struct sh_mark_event));
-
-  event->last_seen      = time(NULL);
-  event->interval       = interval;
-  event->delay          = 0;
-  event->last_reported  = 0;
-  event->label          = sh_string_new_from_lchar(label, strlen(label));
-  event->queue_id       = sh_string_new_from_lchar(qlabel, strlen(qlabel));
-
-  if (0 != zAVLInsert(marklist, event))
-    {
-      sh_marklist_free(event);
-      return -1;
-    }
-  return 0;
-}
-
-void sh_log_mark_update (sh_string * label, time_t timestamp)
-{
-  struct sh_mark_event * event = 
-    (struct sh_mark_event *) zAVLSearch (marklist, sh_string_str(label));
-
-  DEBUG("debug: running mark update for %s\n", sh_string_str(label));
- 
-  if (event)
-    {
-      DEBUG("debug: updating, timestamp %lu, last_seen %lu, interval %d\n",
-	    (unsigned long)timestamp, (unsigned long) event->last_seen,
-	    (int)event->interval);
-
-      if ((timestamp > event->last_seen) && 
-	  (event->interval < (timestamp - event->last_seen)) &&
-	  (timestamp > event->last_reported) && 
-	  (event->interval < (timestamp - event->last_reported)))
-	{
-	  event->delay        = timestamp - event->last_seen;
-	  DEBUG("debug: updating delay to %d\n", (int) event->delay);
-	}
-      event->last_seen    = timestamp;
-    }
-  return;
-}
-
-/* This should allow to get all overdue labels with a for loop like:
- *   for (label = sh_log_mark_first(); label; label = sh_log_mark_next()) {} 
- */
-
-static zAVLCursor mark_cursor;
-
-static struct sh_mark_event * sh_log_mark_cursor(time_t * delay, time_t now, 
-						 struct sh_mark_event * event)
-{
-  while (event)
-    {
-      DEBUG("debug: echeck, delay %d, now %lu, last_seen %lu, reported %lu\n",
-	    (int) event->delay,
-	    (unsigned long)now, (unsigned long) event->last_seen,
-	    (unsigned long)event->last_reported);
-      if (event->delay > 0)
-	{
-	  DEBUG("debug: event delay > 0, value %d\n", (int) event->delay);
-	  *delay = event->delay;
-	  event->delay = 0;
-	  event->last_reported = time(NULL);
-	  return event;
-	}
-      else if ((now > event->last_seen) && 
-	       (now > event->last_reported) &&
-	       (event->interval < (now - event->last_seen)) &&
-	       (event->interval < (now - event->last_reported))
-	       )
-	{
-	  DEBUG("debug: event delay 0, now %lu, last_seen %lu, reported %lu\n",
-		(unsigned long)now, (unsigned long) event->last_seen,
-		(unsigned long)event->last_reported);
-	  *delay = now - event->last_seen;
-	  event->delay = 0;
-	  /* Subtract 1 sec to prevent accumulation of the
-	   * one second offset. */
-	  event->last_reported = time(NULL) - 1;
-	  return event;
-	}
-      event = (struct sh_mark_event *) zAVLNext(&mark_cursor);
-    }
-
-  return NULL;
-}
-
-struct sh_mark_event * sh_log_mark_first(time_t * delay, time_t now)
-{
-  struct sh_mark_event * event = 
-    (struct sh_mark_event *) zAVLFirst(&mark_cursor, marklist);
-  
-  return sh_log_mark_cursor (delay, now, event);
-}
-
-struct sh_mark_event * sh_log_mark_next(time_t * delay, time_t now)
-{
-  struct sh_mark_event * event = 
-    (struct sh_mark_event *) zAVLNext(&mark_cursor);
-  
-  return sh_log_mark_cursor (delay, now, event);
-}
-
-static int sh_mark_default_severity = SH_ERR_SEVERE;
-
-int sh_log_set_mark_severity (const char * str)
-{
-  int val = sh_error_convert_level(str);
-  if (val < 0)
-    return -1;
-  sh_mark_default_severity = val;
-  return 0;
-}
-
-static struct sh_mark_event ** dummy_event;
-
-void sh_log_mark_check()
-{
-  struct sh_mark_event * event;
-  time_t now = time(NULL);
-  time_t delay;
-
-  /* variable 'event' might be clobbered by 'longjmp' or 'vfork'
-   */
-  dummy_event = &event;
-
-  DEBUG("debug: running mark check\n"); 
-  for (event = sh_log_mark_first(&delay, now); event; 
-       event = sh_log_mark_next (&delay, now)) 
-    {
-      int severity;
-      sh_string * alias;
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-
-      severity = sh_log_lookup_severity(sh_string_str(event->queue_id));
-      if (severity < 0)
-	severity = sh_mark_default_severity;
-
-      DEBUG("debug: mark check: queue %s, severity %d\n", 
-	    sh_string_str(event->queue_id), severity); 
-      sh_error_handle (severity, 
-		       FIL__, __LINE__, 0, MSG_LOGMON_MARK, 
-		       sh_string_str(event->label), 
-		       (unsigned long) delay);
-      alias = sh_log_lookup_alias(sh_string_str(event->queue_id));
-      if (alias)
-	{
-	  sh_error_mail (sh_string_str(alias), severity, 
-			 FIL__, __LINE__, 0, MSG_LOGMON_MARK, 
-			 sh_string_str(event->label), 
-			 (unsigned long) delay);
-	}
-
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-  return;
-}
-
-#endif
Index: trunk/src/sh_log_parse_apache.c
===================================================================
--- trunk/src/sh_log_parse_apache.c	(revision 591)
+++ 	(revision )
@@ -1,472 +1,0 @@
-/**************************************
- **
- ** PARSER RULES
- **
- ** (a) must set record->host 
- **     (eventually to dummy value)
- **
- ** (b) must set record->prefix
- **     (itoa(status)) 
- **
- **
- **************************************/
-
-/* for strptime */
-#define _XOPEN_SOURCE 500
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <time.h>
-
-#ifdef USE_LOGFILE_MONITOR
-
-#undef  FIL__
-#define FIL__  _("sh_log_parse_apache.c")
-
-/* Debian/Ubuntu: libpcre2-dev */
-#define PCRE2_CODE_UNIT_WIDTH 8
-#ifdef HAVE_PCRE2_PCRE2_H
-#include <pcre2/pcre2.h>
-#else
-#include <pcre2.h>
-#endif
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_log_check.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-
-extern int flag_err_debug;
-
-struct sh_fileinfo_apache {
-  pcre2_code * line_regex;
-  PCRE2_SIZE * line_ovector;         /* captured substrings     */
-  int          line_ovecnum;         /* how many captured       */
-  
-  int    pos_host;
-  int    pos_status;
-  int    pos_time;
-  char * format_time;
-};
-
-static const char lf_error0[]    = N_("%error");
-static const char lf_common0[]   = N_("%h %l %u %t \"%r\" %>s %b");
-static const char lf_combined0[] = N_("%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"");
-
-/* This variable is not used anywhere. It only exist
- * to assign &new to them, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_65_new = NULL;
-void * sh_dummy_66_fti = NULL;
-void * sh_dummy_67_ftr = NULL;
-
-void * sh_eval_fileinfo_apache(char * str)
-{
-  struct sh_fileinfo_apache * result = NULL;
-  unsigned int i, quotes;
-  unsigned int nfields = 64;
-  size_t       lengths[64];
-  char *       new = NULL;
-  char **      splits;
-  char *       token;
-  sh_string  * re_string;
-  char *       p;
-  volatile int          p_host = -1;
-  volatile int          p_status = -1;
-  volatile int          p_time = -1;
-  char                * f_time = NULL;
-  int          error;
-  size_t       erroffset;
-  
-  /* Take the address to keep gcc from putting them into registers. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_65_new = (void*) &new;
-  sh_dummy_66_fti = (void*) &f_time;
-  sh_dummy_67_ftr = (void*) &result;
-
-  if (0 == strncmp("common", str, 6))
-    {
-      new    = sh_util_strdup(_(lf_common0));
-    }
-  else if (0 == strncmp("combined", str, 8))
-    {
-      new    = sh_util_strdup(_(lf_combined0));
-    }
-  else if (0 == strncmp("error", str, 8))
-    {
-      new    = sh_util_strdup(_(lf_error0));
-    }
-  else
-    {
-      new    = sh_util_strdup(str);
-    }
-
-  if (flag_err_debug == S_TRUE)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      new,
-		      _("eval_fileinfo"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  splits = split_array_ws(new, &nfields, lengths);
-
-  if (nfields < 1)
-    {
-      SH_FREE(splits);
-      SH_FREE(new);
-      return NULL;
-    }
-
-  /* Build the regex string re_string
-   */
-  re_string =  sh_string_new(0);
-  sh_string_add_from_char(re_string, "^");
-
-  for (i = 0; i < nfields; ++i)
-    {
-
-      if (i > 0)
-	sh_string_add_from_char(re_string, " ");
-
-      if (splits[i][0] != '"')
-	quotes = 0;
-      else
-	quotes = 1;
-
-      if (quotes && lengths[i] > 1 && splits[i][lengths[i]-1] == '"')
-	{
-	  splits[i][lengths[i]-1] = '\0'; /* cut trailing quote */
-	  token = &(splits[i][1]);
-	} else {
-	  token = splits[i];
-	}
-
-      if(quotes)
-	{
-	  if(strcmp(token, "%r") == 0 || 
-	     strstr(token, _("{Referer}")) != NULL || 
-             strstr(token, _("{User-Agent}")) != NULL ||
-	     strstr(token, _("{X-Forwarded-For}")) != NULL )
-	    {
-	      /*
-	      p = "\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"";
-	      sh_string_add_from_char(re_string, p);
-	      */
-	      sh_string_add_from_char(re_string, "\"([^");
-	      sh_string_add_from_char(re_string, "\"\\\\");
-	      sh_string_add_from_char(re_string, "]*");
-	      sh_string_add_from_char(re_string, "(?:");
-	      sh_string_add_from_char(re_string, "\\\\.");
-	      sh_string_add_from_char(re_string, "[^\"");
-	      sh_string_add_from_char(re_string, "\\\\]*");
-	      sh_string_add_from_char(re_string, ")*)\"");
-	    }    
-	  else
-	    {
-	      sh_string_add_from_char(re_string, "(");
-	      sh_string_add_from_char(re_string, "\\S+");
-	      sh_string_add_from_char(re_string, ")");
-	    }
-	}
-      else if (token[0] == 'R' && token[1] == 'E' && token[2] == '{' && token[strlen(token)-1] == '}') 
-	{
-	  char * lb =  strchr(token, '{');
-	  char * rb = strrchr(token, '}');
-
-	  if (lb && rb)
-	    {
-	      ++lb; *rb = '\0';
-	      sh_string_add_from_char(re_string, lb);
-	    }
-	}
-      else if (token[0] == '%' && token[strlen(token)-1] == 't') 
-	{
-	  char * lb = strchr(token, '{');
-	  char * rb = strchr(token, '}');
-
-	  sh_string_add_from_char(re_string, "\\[");
-	  sh_string_add_from_char(re_string, "([^");
-	  sh_string_add_from_char(re_string, "(\\]");
-	  sh_string_add_from_char(re_string, "]+)");
-	  sh_string_add_from_char(re_string, "\\]");
-
-	  p_time = i+1;
-	  if (lb && rb)
-	    {
-	      ++lb; *rb = '\0';
-	      f_time = sh_util_strdup(lb);
-	    }
-	  else
-	    {
-	      f_time = sh_util_strdup(_("%d/%b/%Y:%T"));
-	    }
-	}
-      else if (token[0] == '%' && token[1] == 'e' && 0 == strcmp(token, _("%error"))) 
-	{
-	  sh_string_add_from_char(re_string, "\\[");
-	  sh_string_add_from_char(re_string, "([^");
-	  sh_string_add_from_char(re_string, "]");
-	  sh_string_add_from_char(re_string, "]+)");
-	  sh_string_add_from_char(re_string, "\\]");
-
-	  p_time = i+1; f_time = sh_util_strdup(_("%a %b %d %T %Y")); ++i;
-	  sh_string_add_from_char(re_string, " ");
-
-	  sh_string_add_from_char(re_string, "\\[");
-	  sh_string_add_from_char(re_string, "([^");
-	  sh_string_add_from_char(re_string, "]");
-	  sh_string_add_from_char(re_string, "]+)");
-	  sh_string_add_from_char(re_string, "\\]");
-
-	  p_status = i+1;
-	  sh_string_add_from_char(re_string, " ");
-
-	  p = "(.+)";
-	  sh_string_add_from_char(re_string, p);
-
-	  nfields = 3;
-
-	  break;
-	}
-      else
-	{
-	  sh_string_add_from_char(re_string, "(");
-	  sh_string_add_from_char(re_string, "\\S+");
-	  sh_string_add_from_char(re_string, ")");
-	  if (token[0] == '%' && token[strlen(token)-1] == 's')
-	    p_status = i+1;
-	  else if (token[0] == '%' && token[strlen(token)-1] == 'v')
-	    p_host = i+1;
-	}
-    }
-  sh_string_add_from_char(re_string, "$");
-
-  if (flag_err_debug == S_TRUE)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(re_string),
-		      _("eval_fileinfo"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  result = SH_ALLOC(sizeof(struct sh_fileinfo_apache));
-  result->line_regex = pcre2_compile((PCRE2_SPTR8)sh_string_str(re_string), sh_string_len(re_string), 0, 
-				    &error, &erroffset, NULL);
-  if (!(result->line_regex))
-    {
-      sh_string * msg =  sh_string_new(0);
-      sh_string_add_from_char(msg, _("Bad regex: "));
-      sh_string_add_from_char(msg, sh_string_str(re_string));
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(msg),
-		      _("eval_fileinfo"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      SH_FREE(result);
-      SH_FREE(splits);
-      SH_FREE(new);   
-      sh_string_destroy(&msg);
-      sh_string_destroy(&re_string);
-
-      return NULL;
-    }
-  sh_string_destroy(&re_string);
-
-  result->line_ovector  = NULL;
-  result->line_ovecnum  = nfields;
-  result->pos_host      = p_host;
-  result->pos_status    = p_status;
-  result->pos_time      = p_time;
-  result->format_time   = f_time;
-
-  SH_FREE(splits);
-  SH_FREE(new);
-  return (void*)result;
-}
-
-struct sh_logrecord * sh_parse_apache (sh_string * logline, void * fileinfo)
-{
-  static struct tm old_tm;
-  static time_t    old_time;
-
-  char         tstr[128];
-  char         sstr[128];
-  char       * hstr;
-  int          res;
-  unsigned char **hstr_addr = (unsigned char **) &hstr;
-  size_t       hstr_len;
-
-  struct sh_fileinfo_apache * info = (struct sh_fileinfo_apache *) fileinfo;
-
-  pcre2_match_data * match_data = NULL;
-  
-  if (sh_string_len(logline) > 0 && flag_err_debug == S_TRUE)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(logline),
-		      _("sh_parse_apache"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  if (logline == NULL || info == NULL)
-    {
-      return NULL;
-    }
-
-  match_data = pcre2_match_data_create_from_pattern(info->line_regex, NULL);
-  
-  res = pcre2_match(info->line_regex,
-		    (PCRE2_SPTR8)sh_string_str(logline), (int)sh_string_len(logline), 0,
-		    0, match_data, NULL);
-
-  if (res == 1+info->line_ovecnum) /* successful match */
-    {
-      struct sh_logrecord * record;
-      time_t timestamp = 0;
-      size_t size;
-
-      info->line_ovector = pcre2_get_ovector_pointer(match_data);
-
-      if (info->line_ovector[0] > info->line_ovector[1]) /* guard against patterns using \K */
-	{
-	  char msg[128];
-	  sl_snprintf(msg, sizeof(msg), _("Matching error: start > end"));
-	  
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  msg,
-			  _("sh_parse_apache"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  goto the_end;
-	}
-      
-      if (info->pos_time > 0)
-	{
-	  size = sizeof(tstr);
-	  res = pcre2_substring_copy_bynumber(match_data,  info->pos_time,
-					      (PCRE2_UCHAR8 *)tstr, &size);
-	  if (res != 0)
-	    goto corrupt;
-	}
-      else
-	{
-	  res = -1;
-	  timestamp = 0;
-	  info->format_time = sh_util_strdup(_("%d/%b/%Y:%T"));
-	  sl_strlcpy(tstr, _("01/Jan/1970:00:00:00"), sizeof(tstr));
-	}
-
-      if (res == 0)
-	{
-	  struct tm btime;
-	  char * ptr = NULL;
-
-	  memset(&btime, 0, sizeof(struct tm));
-	  btime.tm_isdst = -1;
-	  
-	  /* example: 01/Jun/2008:07:55:28 +0200 */
-
-	  ptr = /*@i@*/strptime(tstr, info->format_time, &btime);
-
-	  if (ptr)
-	    {
-	      timestamp = conv_timestamp(&btime, &old_tm, &old_time);
-	    }
-	  else
-	    goto corrupt;
-	}
-
-      if (info->pos_status > 0)
-	{
-	  size = sizeof(sstr);
-	  res = pcre2_substring_copy_bynumber(match_data,  info->pos_status,
-					      (PCRE2_UCHAR8 *)sstr, &size);
-	  if (res != 0)
-	    goto corrupt;
-	}
-      else
-	{
-	  sl_strlcpy(sstr, _("000"), sizeof(sstr));
-	}
-
-      if (info->pos_host > 0)
-	{
-	  res = pcre2_substring_get_bynumber(match_data, info->pos_host,
-					     hstr_addr, &hstr_len);
-	  if (res != 0)
-	    goto corrupt;
-	}
-      else
-	{
-	  hstr = NULL;
-	}
-
-      record = SH_ALLOC(sizeof(struct sh_logrecord));
-      
-      record->timestamp = timestamp;
-      record->timestr   = sh_string_new_from_lchar(tstr, strlen(tstr));
-
-      if (hstr)
-	record->host = sh_string_new_from_lchar(hstr, hstr_len);
-      else
-	record->host = sh_string_new_from_lchar(sh.host.name, strlen(sh.host.name));
-
-      record->message   = sh_string_new_from_lchar(sh_string_str(logline), 
-						   sh_string_len(logline));
-      record->pid       = PID_INVALID;
-
-      /* does nothing if hstr == NULL */
-      pcre2_substring_free((PCRE2_UCHAR8 *)hstr);
-
-      pcre2_match_data_free(match_data);
-      return record;
-    }
-  else
-    {
-      char msg[128];
-      sl_snprintf(msg, sizeof(msg), _("Matching error: %d"), res);
-      
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      msg,
-		      _("sh_parse_apache"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  /* Corrupted logline */
- corrupt:
-
-  {
-    sh_string * msg =  sh_string_new(0);
-    sh_string_add_from_char(msg, _("Corrupt logline: "));
-    sh_string_add_from_char(msg, sh_string_str(logline));
-    
-    SH_MUTEX_LOCK(mutex_thread_nolog);
-    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		    sh_string_str(msg),
-		    _("sh_parse_apache"));
-    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    sh_string_destroy(&msg);
-  }
-  
- the_end:
-  pcre2_match_data_free(match_data);
-  return NULL;
-}
-
-/* USE_LOGFILE_MONITOR */
-#endif
Index: trunk/src/sh_log_parse_generic.c
===================================================================
--- trunk/src/sh_log_parse_generic.c	(revision 591)
+++ 	(revision )
@@ -1,120 +1,0 @@
-/**************************************
- **
- ** PARSER RULES
- **
- ** (a) must set record->host 
- **     (eventually to dummy value)
- **
- ** (b) must set record->prefix
- **     (itoa(status)) 
- **
- **
- **************************************/
-
-#include "config_xor.h"
-
-#ifdef USE_LOGFILE_MONITOR
-
-#undef  FIL__
-#define FIL__  _("sh_log_parse_apache.c")
-
-#include <string.h>
-#include <time.h>
-
-/* Debian/Ubuntu: libpcre2-dev */
-#define PCRE2_CODE_UNIT_WIDTH 8
-#ifdef HAVE_PCRE2_PCRE2_H
-#include <pcre2/pcre2.h>
-#else
-#include <pcre2.h>
-#endif
-
-#include "samhain.h"
-#include "sh_log_check.h"
-#include "sh_string.h"
-
-struct sh_fileinfo_generic {
-  pcre2_code        * line_regex;
-  pcre2_match_data  * line_match_data;      /* captured substrings     */
-  int                 line_ovecnum;         /* how many captured       */
-  
-  int    pos_host;
-  int    pos_status;
-  int    pos_time;
-  char * format_time;
-};
-
-static void default_time (struct sh_logrecord * record)
-{
-  struct tm   ts;
-  struct tm * ts_ptr;
-  char   tmp[80];
-  size_t len;
-
-  record->timestamp = time(NULL);
-  
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  ts_ptr = localtime_r (&(record->timestamp), &ts);
-#else
-  ts_ptr = localtime(&(record->timestamp));
-  if (ts_ptr)
-    memcpy(&ts, ts_ptr, sizeof(struct tm));
-#endif
-  if (ts_ptr)
-    len = strftime(tmp, sizeof(tmp), _("%Y-%m-%dT%H:%M:%S"), &ts);
-  else
-    {
-      sl_strlcpy(tmp, _("1970-01-01T00:00:00"), sizeof(tmp));
-      len = strlen(tmp);
-    } 
-  record->timestr   = sh_string_new_from_lchar(tmp, len);
-
-  return;
-}
-
-static void default_host (struct sh_logrecord * record)
-{
-  record->host      = sh_string_new_from_lchar(sh.host.name, strlen(sh.host.name));
-  return;
-}
-
-sh_string * sh_read_shell (sh_string * record, struct sh_logfile * logfile)
-{
-  return sh_command_reader (record, logfile);
-}
-
-struct sh_logrecord * sh_parse_shell (sh_string * logline, void * fileinfo)
-{
-  (void) fileinfo;
-
-  if (logline)
-    {
-      struct sh_logrecord * record = SH_ALLOC(sizeof(struct sh_logrecord));
-
-      default_time(record);
-      default_host(record);
-
-      record->message   = sh_string_new_from_lchar(sh_string_str(logline), 
-						   sh_string_len(logline));
-      record->pid       = PID_INVALID;
-      return record;
-    }
-  return NULL;
-}
-
-void * sh_eval_fileinfo_generic(char * str)
-{
-  (void) str;
-
-  return NULL;
-}
-
-struct sh_logrecord * sh_parse_generic (sh_string * logline, void * fileinfo)
-{
-  (void) logline;
-  (void) fileinfo;
-
-  return NULL;
-}
-
-#endif
Index: trunk/src/sh_log_parse_pacct.c
===================================================================
--- trunk/src/sh_log_parse_pacct.c	(revision 591)
+++ 	(revision )
@@ -1,357 +1,0 @@
-/**************************************
- **
- ** PARSER RULES
- **
- ** (a) must set record->host 
- **     (eventually to dummy value)
- **
- ** (b) must set record->prefix
- **     (command) 
- **
- **
- **************************************/
-
-/* Based on the GNU Accounting Utilities, which is distributed with the
- * following copyright: 
- */
-
-/* Copyright (C) 1993, 1996, 1997, 2003, 2005 Free Software Foundation, Inc.
- *
- * This file is part of the GNU Accounting Utilities
- *
- * The GNU Accounting Utilities are free software; you can redistribute
- * them and/or modify them under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either version
- * 2, or (at your option) any later version.
- *
- * The GNU Accounting Utilities are distributed in the hope that they 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 the GNU Accounting Utilities; see the file COPYING.  If
- * not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
- * MA 02139, USA.  */
-
-#include "config_xor.h"
-
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <dirent.h>
-
-#if defined(USE_LOGFILE_MONITOR) && defined(HAVE_SYS_ACCT_H)
-
-#include <sys/acct.h>
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_log_check.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-
-#undef  FIL__
-#define FIL__  _("sh_log_parse_pacct.c")
-
-extern int flag_err_debug;
-
-#ifndef ACCT_COMM
-#define ACCT_COMM 16
-#endif
-#ifndef AHZ
-#define AHZ 100
-#endif
-
-#if defined(ACUTIME_COMPT) || defined(ACSTIME_COMPT) || defined(ACETIME_COMPT)
-static double comp_t_2_double (comp_t ct)
-{
-  unsigned long out = 0;
-
-  out = ct & 017777;
-  ct >>= 13;
-
-  while (ct) {
-    ct--;
-    out <<= 3;
-  }
-  
-  return (double) out;
-}
-#endif
-
-#ifdef ACUTIME_COMPT
-# define ACUTIME_2_DOUBLE(x) (comp_t_2_double(x))
-#else
-# define ACUTIME_2_DOUBLE(x) ((double)(x))
-#endif
-
-#ifdef ACSTIME_COMPT
-# define ACSTIME_2_DOUBLE(x) (comp_t_2_double(x))
-#else
-# define ACSTIME_2_DOUBLE(x) ((double)(x))
-#endif
-
-#ifdef ACETIME_COMPT
-# define ACETIME_2_DOUBLE(x) (comp_t_2_double(x))
-#else
-# define ACETIME_2_DOUBLE(x) ((double)(x))
-#endif
-
-
-static void expand_flags(char flag, char * out)
-{
-  int i = 0;
-
-#define	BIT(flg, ch)	if (flag & flg) out[i] = ch; else out[i] = ' '; ++i
-
-  BIT(ASU, 'S');
-  BIT(AFORK, 'F');
-#ifdef ACOMPAT
-  BIT(ACOMPAT, 'C');
-#endif
-#ifdef ACORE
-  BIT(ACORE, 'D');
-#endif
-#ifdef AXSIG
-  BIT(AXSIG, 'X');
-#endif
-
-  out[i] = '\0';
-  return;
-}
-
-static char * uid_name (int uid)
-{
-  static int  userid   = 0;
-  static char user[16] = "";
-
-  if (uid == userid && user[0] != '\0')
-    {
-      return user;
-    }
-  else
-    {
-      struct passwd *thispw = getpwuid (uid);
-      if (thispw)
-	sl_strlcpy (user, thispw->pw_name, sizeof(user));
-      else
-	sl_snprintf(user, sizeof(user), "%d", uid);
-      user[sizeof(user)-1] = '\0';
-      userid = uid;
-    }
-  return user;
-}
-
-struct dev_struct {
-  char * device;
-  long   dev_id;
-  struct dev_struct * next;
-};
-static struct dev_struct * devicelist = NULL;
-
-static void add_devices(const char * dir)
-{
-  DIR *  mdir;
-  char   dirl[256];
-
-  sl_strlcpy(dirl, dir, sizeof(dirl));
-  dirl[sizeof(dirl)-1] = '\0';
-
-  mdir = opendir(dir);
-  
-  if (mdir)
-    {
-      char * path;
-      size_t len;
-      struct dirent * dent;
-      struct stat buf;
-
-      while (NULL != (dent = readdir(mdir)))
-	{
-	  if (0 == strcmp(dent->d_name, "."))
-	    continue;
-	  if (0 == strcmp(dent->d_name, ".."))
-	    continue;
-	  len = strlen(dir) + strlen(dent->d_name) + 2;
-	  path = SH_ALLOC(len);
-	  snprintf(path, len, "%s/%s", dir, dent->d_name);
-	  if (0 == lstat(path, &buf) && S_ISCHR(buf.st_mode))
-	    {
-	      struct dev_struct * dstruct;
-	      dstruct = SH_ALLOC(sizeof(struct dev_struct));
-	      /* eliminate leading '/dev/' */
-	      memmove(path, &path[5], strlen(path)-4); 
-	      dstruct->device = path;
-	      dstruct->dev_id = buf.st_rdev;
-	      dstruct->next   = devicelist;
-	      devicelist      = dstruct;
-	    }
-	  else
-	    {
-	      SH_FREE(path);
-	    }
-	}
-      closedir(mdir);
-    }
-  return;
-}
-
-static char * dev_name(long tty)
-{
-  struct dev_struct * dstruct;
-
-  if (!devicelist)
-    {
-      add_devices("/dev");
-      add_devices("/dev/pts");
-      add_devices("/dev/pty");
-      add_devices("/dev/ptym");
-    }
-
-  dstruct = devicelist;
-  while (dstruct)
-    {
-      if (dstruct->dev_id == tty)
-	return dstruct->device;
-      dstruct = dstruct->next;
-    }
-  return "??";
-}
-
-#if defined(__linux__) && defined(HAVE_ACCT_V3)
-#  define STRUCT_ACCT struct acct_v3
-#elif defined(__FreeBSD__) && defined(HAVE_ACCTV2)
-#  define STRUCT_ACCT struct acctv2
-#else
-#  define STRUCT_ACCT struct acct
-#endif
-
-/* This looks strange, but it's real ANSI C. */
-extern STRUCT_ACCT pacct_rd_never_used;
-#define COMM_LEN ((int) sizeof (pacct_rd_never_used.ac_comm))
-
-sh_string * sh_read_pacct (sh_string * record, struct sh_logfile * logfile)
-{
-  STRUCT_ACCT rec;
-
-  if (NULL != sh_binary_reader ((void*) &rec, sizeof(STRUCT_ACCT), logfile))
-    {
-      time_t btime = (time_t) rec.ac_btime;
-      double ut    = ACUTIME_2_DOUBLE (rec.ac_utime);
-      double st    = ACSTIME_2_DOUBLE (rec.ac_stime);
-      char   fl[6];
-      char   comm[COMM_LEN+1];
-      int    i;
-      char   out[64+COMM_LEN+1+5+8+8+32+4+19+7]; /* see printf format below */
-      
-#if defined(ac_flagx)
-      /* cppcheck-suppress syntaxError */
-      expand_flags(rec.ac_flagx, fl);
-#else
-      expand_flags(rec.ac_flag,  fl);
-#endif
-      
-      /* ac_comm may not be null terminated
-       */
-      for (i = 0; i < COMM_LEN; i++)
-	{
-	  if (rec.ac_comm[i] == '\0')
-	    {
-	      comm[i] = '\0';
-	      break;
-	    }
-	  if (! isprint (rec.ac_comm[i]))
-	    comm[i] = '?';
-	  else
-	    comm[i] = rec.ac_comm[i];
-	}
-      comm[COMM_LEN] = '\0';
-
-      sl_snprintf (out, sizeof(out),
-		   "%ld:%-*.*s %5.5s %-8.8s %-8.8s %6.2f secs %-19.19s",
-		   btime,
-		   COMM_LEN, COMM_LEN, comm, fl, 
-		   uid_name(rec.ac_uid), 
-		   dev_name((long)rec.ac_tty),
-		   ((ut + st) / (double) AHZ),
-		   ctime (&btime));
-
-
-      sh_string_set_from_char(record, out);
-      return record;
-    }
-
-  if (record)
-    sh_string_destroy(&record);
-  return NULL;
-}
-
-void * sh_dummy_294_record = NULL;
-
-struct sh_logrecord * sh_parse_pacct (sh_string * logline, void * fileinfo)
-{
-  char * p;
-  char * endptr;
-  unsigned long ltime;
-  struct sh_logrecord * record = NULL;
-
-  (void) fileinfo;
-
-  sh_dummy_294_record = (void *) &record;
-
-  if (sh_string_len(logline) > 0 && flag_err_debug == S_TRUE)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_string_str(logline),
-		      _("sh_parse_pacct"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  sh_dummy_294_record = NULL;
-  
-  p = strchr(sh_string_str(logline), ':');
-
-  if (!p || p == sh_string_str(logline))
-    return NULL;
-
-  ltime = strtoul(sh_string_str(logline), &endptr, 10);
-  if (p != endptr)
-    return NULL;
-		  
-  ++p; /* points to first char of pacct record */
-  
-  if (*p != '\0')
-    {
-      size_t lengths[7];
-      unsigned int  fields = 7;
-      char ** array;
-      sh_string * message = sh_string_new_from_lchar(p, strlen(p));
-      array = split_array_ws(p, &fields, lengths);
-
-      if (fields == 7)
-	{
-	  record = SH_ALLOC(sizeof(struct sh_logrecord));
-
-	  record->timestamp = ltime;
-	  record->timestr   = sh_string_new_from_lchar(array[6], lengths[6]);
-	  record->message   = message;
-	  record->pid       = 0;
-	  record->host      = sh_string_new_from_lchar(sh.host.name, strlen(sh.host.name));
-	}
-      else
-	{
-	  sh_string_destroy(&message);
-	}
-      SH_FREE(array);
-    }
-  return record;
-}
-/* USE_LOGFILE_MONITOR */
-#endif
Index: trunk/src/sh_log_parse_samba.c
===================================================================
--- trunk/src/sh_log_parse_samba.c	(revision 591)
+++ 	(revision )
@@ -1,104 +1,0 @@
-/**************************************
- **
- ** PARSER RULES
- **
- ** (a) must set record->host 
- **     (eventually to dummy value)
- **
- ** (b) must set record->prefix
- **     (command) 
- **
- **
- **************************************/
-
-/* for strptime */
-#define _XOPEN_SOURCE
-
-#include "config_xor.h"
-#include <string.h>
-
-#if defined(HOST_IS_SOLARIS)
-/* For 'struct timeval' in <sys/time.h> */
-#define __EXTENSIONS__
-#endif
-
-#include <time.h>
-
-#if defined(USE_LOGFILE_MONITOR)
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_log_check.h"
-#include "sh_string.h"
-
-#undef  FIL__
-#define FIL__  _("sh_log_parse_samba.c")
-
-
-sh_string * sh_read_samba (sh_string * record, struct sh_logfile * logfile)
-{
-  return sh_cont_reader (record, logfile, " \t");
-}
-
-struct sh_logrecord * sh_parse_samba (sh_string * logline, void * fileinfo)
-{
-  static struct tm old_tm;
-  static time_t    old_time;
-
-  struct sh_logrecord * record = NULL;
-
-  static const char *    format0_1 = N_("[%Y/%m/%d %T");
-  static char   format_1[16]; 
-  static int    format_init = 0;
-
-  (void) fileinfo;
-
-  if (!format_init)
-    {
-      sl_strlcpy(format_1, _(format0_1), sizeof(format_1));
-      format_init = 1;
-    }
-
-  if (logline && sh_string_len(logline) > 0)
-    {
-      size_t lengths[3];
-      unsigned int  fields = 3;
-      char ** array;
-      char * p = strchr(sh_string_str(logline), ',');
-
-      *p = '\0'; ++p;
-      array = split_array_ws(p, &fields, lengths);
-
-      if (fields == 3)
-	{
-	  struct tm btime;
-	  char * ptr;
-
-	  memset(&btime, 0, sizeof(struct tm));
-	  btime.tm_isdst = -1;
-
-	  ptr = strptime(sh_string_str(logline), format_1, &btime);
-
-	  if (ptr && *ptr == '\0') /* no error, whole string consumed */
-	    {
-	      record = SH_ALLOC(sizeof(struct sh_logrecord));
-
-	      record->timestamp = conv_timestamp(&btime, &old_tm, &old_time);
-
-	      p = sh_string_str(logline); ++p;
-	  
-	      record->timestr   = sh_string_new_from_lchar(p, strlen(p));
-	      
-	      record->message   = sh_string_new_from_lchar(array[2], lengths[2]);
-	  
-	      record->pid       = 0;
-	      record->host      = sh_string_new_from_lchar(sh.host.name, 
-							   strlen(sh.host.name));
-	    }
-	}
-      SH_FREE(array);
-    }
-  return record;
-}
-
-#endif
Index: trunk/src/sh_log_parse_syslog.c
===================================================================
--- trunk/src/sh_log_parse_syslog.c	(revision 591)
+++ 	(revision )
@@ -1,190 +1,0 @@
-/**************************************
- **
- ** PARSER RULES
- **
- ** (a) must set record->host 
- **     (eventually to dummy value)
- **
- ** (b) must set record->prefix
- **     (eventually to dummy value) 
- **
- **
- **************************************/
-
-/* for strptime */
-#define _XOPEN_SOURCE
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if defined(HOST_IS_SOLARIS)
-/* For 'struct timeval' in <sys/time.h> */
-#define __EXTENSIONS__
-#endif
-
-#include <sys/types.h>
-#include <time.h>
-
-#ifdef USE_LOGFILE_MONITOR
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_log_check.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-
-#undef  FIL__
-#define FIL__  _("sh_log_parse_syslog.c")
-
-static int hidepid = 0;
-extern int flag_err_debug;
-
-int sh_get_hidepid()
-{
-  return hidepid;
-}
-
-int sh_set_hidepid(const char *s)
-{
-  return sh_util_flagval(s, &hidepid);
-}
-
-struct sh_logrecord * sh_parse_syslog (sh_string * logline, void * fileinfo)
-{
-  static const char *    format0_1 = N_("%b %d %T");
-  static const char *    format0_2 = N_("%Y-%m-%dT%T");
-
-  static char   format_1[16]; 
-  static char   format_2[16];
-  static int    format_init = 0;
-
-  static struct tm old_tm;
-  static time_t    old_time;
-
-  const unsigned int Tpos = 10;
-  volatile unsigned int tlen = 16;
-
-  (void) fileinfo;
-
-  if (!format_init)
-    {
-      sl_strlcpy(format_1, _(format0_1), sizeof(format_1));
-      sl_strlcpy(format_2, _(format0_2), sizeof(format_2));
-      format_init = 1;
-    }
-
-
-  if (flag_err_debug == S_TRUE && sh_string_len(logline) > 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      logline->str,
-		      _("sh_parse_syslog"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  if (logline && sh_string_len(logline) > tlen)
-    {
-      struct tm btime;
-      char * ptr;
-      int    flag;
-      size_t lengths[3];
-
-      memset(&btime, 0, sizeof(struct tm));
-      btime.tm_isdst = -1;
-
-      /* This is RFC 3164. 
-       */
-      if (logline->str[Tpos] != 'T')
-	{
-	  logline->str[tlen-1] = '\0';
-	  ptr = /*@i@*/strptime(logline->str, format_1, &btime);
-	}
-
-      /* RFC 3339 describes an alternative timestamp format.
-       * Unfortunately, POSIX strptime() does not support reading 
-       * the TZ offset.
-       */
-      else
-	{
-	  ptr = strptime(logline->str, format_2, &btime);
-	  if (ptr)
-	    { 
-	      tlen = 20;
-	      if (*ptr && *ptr != ' ') {
-		do { ++ptr; ++tlen; } while (*ptr && *ptr != ' ');
-		if (*ptr == ' ') *ptr = '\0'; 
-	      }
-	    }
-	}
-
-      if (ptr && *ptr == '\0') /* no error, whole string consumed */
-	{
-	  unsigned int  fields = 3; /* host program(\[pid\])+: message */
-	  char ** array  = split_array_ws(&(logline->str[tlen]), &fields, lengths);
-
-	  if (fields == 3)
-	    {
-	      struct sh_logrecord * record = SH_ALLOC(sizeof(struct sh_logrecord));
-
-	      record->timestamp = conv_timestamp(&btime, &old_tm, &old_time);
-	      record->timestr   = sh_string_new_from_lchar(logline->str, (tlen-1)); 
-
-	      /* host
-	       */
-	      record->host = sh_string_new_from_lchar(array[0], lengths[0]);
-
-	      /* program and pid
-	       */
-	      if (NULL != (ptr = strchr(array[1], '[')))
-		{
-		  *ptr = '\0';
-		  ++ptr;
-		  record->pid = (pid_t) atoi(ptr);
-
-		  if (hidepid == 0 || !*ptr) {
-		    --ptr;
-		    *ptr = '[';
-		  } else {
-		    *ptr = '\0'; /* overwrite first digit */
-		    --ptr;
-		    *ptr = ':';  /* overwrite ex-':' */
-		    lengths[1] = strlen(array[1]);
-		  }
-		}
-	      else
-		{
-		  flag = 0;
-		  ptr = array[1];
-		  if (ptr[lengths[1]] == ':') {
-		    ptr[lengths[1]] = '\0';
-		    flag = 1;
-		  }
-		  record->pid = PID_INVALID;
-		  if (flag == 1) {
-		    ptr[lengths[1]] = ':';
-		  }
-		}
-
-	      /* message
-	       */
-	      record->message = sh_string_new_from_lchar3(array[1], lengths[1],
-							  " ", 1,
-							  array[2], lengths[2]);
-
-	      SH_FREE(array);
-	      return record;
-	    }
-	  SH_FREE(array);
-	}
-    }
-  /* corrupted logline
-   */
-  return NULL;
-}
-
-/* USE_LOGFILE_MONITOR */
-#endif
Index: trunk/src/sh_log_repeat.c
===================================================================
--- trunk/src/sh_log_repeat.c	(revision 591)
+++ 	(revision )
@@ -1,572 +1,0 @@
-#include "config_xor.h"
-
-#ifdef USE_LOGFILE_MONITOR
-
-#include <string.h>
-#include <ctype.h>
-
-#undef  FIL__
-#define FIL__  _("sh_log_repeat.c")
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_string.h"
-#include "sh_log_check.h"
-#include "sh_log_evalrule.h"
-
-#define SH_NHIST   12
-#define SH_NFINT    5
-#define SH_NFIELDS  5*sizeof(SINT32) /* 16 */
-#define SH_NBLOCK  63
-
-typedef enum
-{
-  SH_GFLAG_EMAIL = 1 << 0,
-  SH_GFLAG_PATH  = 1 << 1,
-  SH_GFLAG_IP    = 1 << 2,
-  SH_GFLAG_FQDN  = 1 << 3,
-  SH_GFLAG_NUM   = 1 << 4,
-  SH_GFLAG_ELSE  = 1 << 5,
-
-  SH_GFLAG_XNUM  = 1 << 6,
-  SH_GFLAG_CHAR  = 1 << 7,
-  SH_GFLAG_USC   = 1 << 8
-} SH_GFlags;
-
-
-/* 64 bytes 
- */
-struct gestalt {
-  unsigned char hist[SH_NHIST];      /* time histogram 12 minutes   */
-  union {
-    unsigned char flags[SH_NFIELDS]; /* flags indicating field type */
-    SINT32        flint[SH_NFINT];
-  } f;
-  UINT16      sum[SH_NFIELDS];     /* checksum of field           */
-  UINT16      ltime;               /* last time, in minutes       */
-  UINT16      total;               /* seen how often?             */
-};
-
-static unsigned int     nrec = 0;    /* size of array               */
-static unsigned int     urec = 0;    /* in use thereof              */
-static struct gestalt * arec = NULL; /* array                       */
-
-static int      repeat_count = 24;   /* triggers report             */
-static int     clean_counter = 0;    /* cleanup after N inserts     */
-static int        free_slots = 0;    /* free slots available        */
-
-#define SH_CLEANUP 256
-
-void * sh_dummy_g_array     = NULL;
-
-static struct gestalt * add_entry (unsigned char * flags, UINT16 * sum, 
-				   time_t ltime)
-{
-  struct gestalt * array = NULL;
-
-  sh_dummy_g_array = (void*) &array;
-  
- start:
-  if (urec < nrec)
-    {
-      if (free_slots)
-	{
-	  unsigned int i;
-	  for (i = 0; i < urec; ++i)
-	    {
-	      if (arec[i].total == 0)
-		{
-		  array = &arec[i];
-		  --free_slots;
-		  break;
-		}
-	    }
-	}
-
-      if (!array)
-	{
-	  array = &arec[urec];
-	  ++urec;
-	}
-
-      memcpy(array->sum,       sum, sizeof(UINT16)      * SH_NFIELDS);
-      memcpy(array->f.flags, flags, sizeof(unsigned char) * SH_NFIELDS);
-      memset(array->hist,        0, sizeof(unsigned char) * SH_NHIST);
-
-      array->ltime               = (UINT16)(ltime % 60);
-      array->hist[SH_NHIST-1]    = 1;
-      array->total               = 1;
-
-      ++clean_counter;
-      return array;
-    }
-
-  array =    SH_ALLOC(sizeof(struct gestalt) * (nrec + SH_NBLOCK + 1));
-  memset(array,    0, sizeof(struct gestalt) * (nrec + SH_NBLOCK + 1));
-  memcpy(array, arec, sizeof(struct gestalt) * (nrec));
-
-  nrec += (SH_NBLOCK + 1);
-  goto start;
-}
-
-static UINT16 shift_history(unsigned char * hist, unsigned int shift, 
-			      UINT16 total)
-{
-  unsigned int i, j = 0;
-
-  if (shift >= SH_NHIST)
-    {
-      memset(hist,      0, sizeof(unsigned char) * SH_NHIST);
-      return 0;
-    }
-
-  for (i = shift; i < SH_NHIST; ++i)
-    {
-      if (j < shift)
-	total  -= hist[j];
-      hist[j] = hist[i];
-      ++j;
-    }
-  for (i = (SH_NHIST-shift); i < SH_NHIST; ++i)
-    {
-      hist[i] = 0;
-    }
-  return total;
-}
- 
-static void update_entry (struct gestalt * array, time_t ltime)
-{
-  UINT16 ntime = (UINT16)(ltime % 60);
-
-  if (array->ltime == ntime)
-    {
-      if (array->hist[SH_NHIST-1] < 255) 
-	{
-	  ++(array->hist[SH_NHIST-1]);
-	  ++(array->total);
-	}
-    }
-  else if (array->ltime < ntime)
-    {
-      unsigned int shift = ntime - array->ltime;
-      array->total = shift_history(array->hist, shift, array->total);
-      array->hist[SH_NHIST-1] = 1;
-      array->ltime = ntime;
-      ++(array->total);
-    }
-}
-
-static struct gestalt * update_or_add (unsigned char * flags, UINT16 * sum, 
-				       time_t ltime)
-{
-  SINT32 flint[SH_NFINT];
- start:
-
-  if (arec)
-    {
-      unsigned int i;
-      struct gestalt * array = arec;
-
-      sh_dummy_g_array = (void*) &array;
-      
-      memcpy(flint, flags, SH_NFIELDS);
-
-      for (i = 0; i < urec; ++i)
-	{
-	  /* Check whether field types match. Integer
-	   * comparison is much faster than memcmp() [tested].
-	   */
-	  if (flint[0] == array->f.flint[0] &&
-	      flint[1] == array->f.flint[1] &&
-	      flint[2] == array->f.flint[2] &&
-	      flint[3] == array->f.flint[3] &&
-	      flint[4] == array->f.flint[4])
-	    {
-	      unsigned int j; 
-	      int c1 = 0, c2 = 0;
-	      UINT16 * asum = array->sum;
-
-	      for (j = 0; j < SH_NFIELDS; ++j)
-		{
-		  if (flags[j] == SH_GFLAG_ELSE)
-		    {
-		      ++c1;
-		      if (asum[j] == sum[j]) 
-			++c2;
-		    }
-		}
-
-	      if (c1 == c2)
-		{
-		  /* Found a matching entry, update time histogram
-		   */
-		  update_entry (array, ltime);
-		  return array;
-		}
-	    }
-	  ++array;
-	}
-
-      /* No match found, create a new entry
-       */
-      array = add_entry (flags, sum, ltime);
-      return array;
-    }
-  
-  arec = SH_ALLOC(sizeof(struct gestalt) * SH_NBLOCK);
-  nrec = SH_NBLOCK;
-  urec = 0;
-
-  goto start;
-}
-
-/* --------------------------------------------------------------------
- *
- * crc16 checksum from the linux kernel.
- * This source code is licensed under the GNU General Public License,
- * Version 2. 
- */
-
-/** CRC table for the CRC-16. The poly is 0x8005 (x^16 + x^15 + x^2 + 1) */
-UINT16 const crc16_table[256] = {
-  0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241,
-  0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440,
-  0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40,
-  0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841,
-  0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40,
-  0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41,
-  0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641,
-  0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
-  0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240,
-  0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441,
-  0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41,
-  0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840,
-  0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41,
-  0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40,
-  0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640,
-  0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041,
-  0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240,
-  0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441,
-  0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41,
-  0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840,
-  0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41,
-  0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40,
-  0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640,
-  0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041,
-  0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241,
-  0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440,
-  0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40,
-  0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841,
-  0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40,
-  0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41,
-  0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641,
-  0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
-};
-
-static inline UINT16 crc16_byte(UINT16 crc, const unsigned char data)
-{
-  return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
-}
-
-/**
- * crc16 - compute the CRC-16 for the data buffer
- * @crc:        previous CRC value
- * @buffer:     data pointer
- * @len:        number of bytes in the buffer
- *
- * Returns the updated CRC value.
- */
-static inline UINT16 crc16(UINT16 crc, const unsigned char * buffer, 
-			     size_t len)
-{
-  while (len--)
-    crc = crc16_byte(crc, *buffer++);
-  return crc;
-}
-
-
-/* end crc16 code
- *
- * -------------------------------------------------------------------- */
-
-static void  classify(char ** splits, size_t * lengths, unsigned int nfields, 
-		      unsigned char * flags, UINT16 * sums)
-{
-  unsigned int i;
-  unsigned int flag;
-
-  /* flags we don't want to see in XYZ 
-   */
-  static int m_ip    = SH_GFLAG_PATH|SH_GFLAG_EMAIL|SH_GFLAG_USC|SH_GFLAG_ELSE|SH_GFLAG_CHAR|SH_GFLAG_XNUM;
-  static int m_num   = SH_GFLAG_PATH|SH_GFLAG_EMAIL|SH_GFLAG_USC|SH_GFLAG_ELSE|SH_GFLAG_CHAR;
-  static int m_fqdn  = SH_GFLAG_PATH|SH_GFLAG_EMAIL|SH_GFLAG_USC|SH_GFLAG_ELSE;
-  static int m_email = SH_GFLAG_PATH;
-
-  nfields = (nfields > SH_NFIELDS) ? SH_NFIELDS : nfields;
-
-  for (i = 0; i < nfields; ++i) 
-    {
-      char *p = splits[i];
-      unsigned int np   = 0;
-      unsigned int fqdn = 0;
-
-      flag = 0;
-
-      while (*p)
-	{
-	  if (isxdigit((unsigned int)*p))
-	    {
-	      if (isdigit((unsigned int)*p))
-		{
-		  flag |= SH_GFLAG_NUM;
-		}
-	      else
-		{
-		  flag |= SH_GFLAG_XNUM;
-		}
-	    }
-	  else if (*p == '.')
-	    {
-	      flag |= SH_GFLAG_IP;
-	      ++np;
-	    }
-	  else if (*p == '/')
-	    {
-	      flag |= SH_GFLAG_PATH;
-	    }
-	  else if (*p == '@')
-	    {
-	      flag |= SH_GFLAG_EMAIL;
-	    }
-	  else if (*p == '-')
-	    {
-	      flag |= SH_GFLAG_FQDN;
-	    }
-	  else if (*p == '_')
-	    {
-	      flag |= SH_GFLAG_USC;
-	    }
-	  else if (isalpha((unsigned int)*p))
-	    {
-	      if (flag & SH_GFLAG_IP)
-		++fqdn;
-	      flag |= SH_GFLAG_CHAR;
-	    }
-	  else if (!isascii((unsigned int)*p))
-	    {
-	      flags[i] = SH_GFLAG_ELSE;
-	      break;
-	    }
-	  else
-	    {
-	      flag |= SH_GFLAG_ELSE;
-	    }
-	  ++p;
-	}
-
-      if (flags[i] == 0)
-	{
-	  if (0 == (flag & m_ip)         && 
-	      0 != (flag & SH_GFLAG_IP)  && 
-	      0 != (flag & SH_GFLAG_NUM) && 
-	      np > 2)
-	    {
-	      flags[i] = SH_GFLAG_IP;
-	    }
-	  else if (0 == (flag & m_num) && 
-		   (0 != (flag & SH_GFLAG_NUM) || 0 != (flag & SH_GFLAG_XNUM)))
-	    {
-	      flags[i] = SH_GFLAG_NUM;
-	    }
-	  else if (0 == (flag & m_fqdn)        && 
-		   0 != (flag & SH_GFLAG_IP)   && 
-		   0 != (flag & SH_GFLAG_CHAR) && 
-		   fqdn)
-	    {
-	      flags[i] = SH_GFLAG_FQDN;
-	    }
-	  else if ('/' == splits[i][0])
-	    {
-	      flags[i] = SH_GFLAG_PATH;
-	    }
-	  else if (0 == (flag & m_email)        && 
-		   0 != (flag & SH_GFLAG_EMAIL) && 
-		   0 != (flag & SH_GFLAG_CHAR)) 
-	    {
-	      flags[i] = SH_GFLAG_EMAIL;
-	    }
-	  else 
-	    {
-	      flags[i] = SH_GFLAG_ELSE;
-	    }
-	}
-
-      /* CRC-16 checksum
-       */ 
-      sums[i] = crc16(0, (unsigned char *) splits[i], lengths[i]);
-    }
-
-  return;
-}
-
-static void cleanup_array (time_t ltime)
-{
-  UINT16 ntime = (UINT16)(ltime % 60);
-
-  if (ntime > 12) ntime -= 12;
-
-  if (arec && urec > 0)
-    {
-      struct gestalt * array;
-      unsigned int i, last, urec_orig = urec;
-
-      last = urec-1;
-      array = &arec[0];
-  
-      for (i = 0; i < urec_orig; ++i)
-	{
-	  if (array->ltime < ntime)
-	    {
-	      memset(array,    0, sizeof(struct gestalt));
-	      if (i != last)
-		++free_slots;
-	      else
-		--urec;
-	    }
-	}
-      ++array;
-    }
-  clean_counter = 0;
-  return;
-}
-
-/* ----------------------------------------------------------------------
- *
- *   Public functions
- */
-
-int sh_repeat_set_trigger (const char * str)
-{
-  unsigned long  value;
-  char * foo;
-
-  value = (size_t) strtoul(str, &foo, 0);
-
-  if (*foo == '\0' && value < 65535) {
-    repeat_count = value;
-    return 0;
-  }
-  return -1;
-}
-
-static char * sh_repeat_queue = NULL;
-
-int sh_repeat_set_queue (const char * str)
-{
-  if (!str)
-    return -1;
-  if (sh_repeat_queue)
-    SH_FREE(sh_repeat_queue);
-  sh_repeat_queue = sh_util_strdup(str);
-  return 0;
-}
-
-static int sh_repeat_cron = S_FALSE;
-
-int sh_repeat_set_cron (const char * str)
-{
-  return sh_util_flagval(str, &sh_repeat_cron);
-}
-
-int sh_repeat_message_check (const sh_string * host, 
-			     const sh_string * msg, 
-			     time_t ltime)
-{
-  struct gestalt * array;
-
-  UINT16         sums[SH_NFIELDS] = { 0 };
-  unsigned char flags[SH_NFIELDS] = { 0 };
-
-  /* split message into SH_NFIELDS+1, discard last  */
-
-  unsigned int nfields = SH_NFIELDS+1;
-  size_t       lengths[SH_NFIELDS+1];
-  char *       new;
-  char **      splits;
-
-  if (repeat_count == 0)
-    return 0;
-
-  if (sh_repeat_cron == S_FALSE)
-    {
-      char * s = sh_string_str(msg);
-
-      if (0 == strcmp(s, _("cron")) || 0 == strcmp(s, _("CRON")))
-	return 0;
-    }
-
-  new = sh_util_strdup_l(sh_string_str(msg), sh_string_len(msg));
-
-  splits = split_array_token (new, &nfields, lengths, 
-			      " :,()='[]<>\t\n");
-
-  /* classify fields                                */
-
-  classify (splits, lengths, nfields, flags, sums); 
-
-  /* compare                                        */
-
-  array = update_or_add (flags, sums, ltime);
-
-  /* report                                         */
-
-  if (array->total > repeat_count)
-    {
-      volatile int repeat = array->total;
-      char * tmpmsg;
-      char * tmphost;
-      sh_string * alias;
-
-      /* issue report             */
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      tmphost = sh_util_safe_name (sh_string_str(host));
-      tmpmsg  = sh_util_safe_name_keepspace (sh_string_str(msg));
-      sh_error_handle (sh_log_lookup_severity(sh_repeat_queue), 
-		       FIL__, __LINE__, 0, MSG_LOGMON_BURST, 
-		       repeat, tmpmsg, tmphost);
-      alias = sh_log_lookup_alias(sh_repeat_queue);
-      if (alias)
-	{
-	  sh_error_mail (sh_string_str(alias), 
-			 sh_log_lookup_severity(sh_repeat_queue), 
-			 FIL__, __LINE__, 0, MSG_LOGMON_BURST, 
-			 repeat, tmpmsg, tmphost);
-	}
-      SH_FREE(tmpmsg);
-      SH_FREE(tmphost);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      /* mark slot as free        */
-
-      memset(array,    0, sizeof(struct gestalt));
-      if (array != &arec[urec-1])
-	++free_slots;
-      else
-	urec -= 1;
-    }
-
-  SH_FREE(new);
-
-  /* run cleanup routine                            */
-
-  if (clean_counter >= SH_CLEANUP)
-    {
-      cleanup_array(ltime);
-    }
-
-  return 0;
-}
-
-#endif
Index: trunk/src/sh_login_track.c
===================================================================
--- trunk/src/sh_login_track.c	(revision 591)
+++ 	(revision )
@@ -1,1417 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2010 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#undef  FIL__
-#define FIL__  _("sh_login_track.c")
-
-#if defined(SH_USE_UTMP) && (defined(SH_WITH_CLIENT) || defined (SH_STANDALONE)) 
-
-#include <string.h>
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_string.h"
-#include "sh_tools.h"
-#include "sh_ipvx.h"
-#include "sh_error_min.h"
-
-#ifdef HAVE_UTMPX_H
-
-#include <utmpx.h>
-#define SH_UTMP_S utmpx
-#undef  ut_name
-#define ut_name ut_user
-#ifdef HAVE_UTXTIME
-#undef  ut_time
-#define ut_time        ut_xtime
-#else
-#undef  ut_time
-#define ut_time        ut_tv.tv_sec
-#endif
-
-#else
-
-#include <utmp.h>
-#define SH_UTMP_S utmp
-
-#endif
-
-
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-
-#define SH_LTRACK_VERSION 1
-
-#define SH_LTRACK_USIZE  32
-#define SH_LTRACK_HSIZE 256
-/* One hour    (15 deg)  */
-#define SH_LTRACK_HTRES  24
-/* Ten minutes (2.5 deg) */
-#define SH_LTRACK_GTRES 144
-
-/* Avoid compiling against lmath by including result tables for sin, cos
- */
-const double sintab_htres[SH_LTRACK_HTRES] = {
- 0.13052619222005157340,  0.38268343236508978178,  0.60876142900872065589,  0.79335334029123516508,  0.92387953251128673848,  0.99144486137381038215, 
- 0.99144486137381038215,  0.92387953251128673848,  0.79335334029123516508,  0.60876142900872087793,  0.38268343236508989280,  0.13052619222005157340, 
--0.13052619222005132360, -0.38268343236508967076, -0.60876142900872065589, -0.79335334029123494304, -0.92387953251128651644, -0.99144486137381038215, 
--0.99144486137381049318, -0.92387953251128662746, -0.79335334029123516508, -0.60876142900872087793, -0.38268343236509039240, -0.13052619222005168442, 
-};
-const double costab_htres[SH_LTRACK_HTRES] = {
- 0.99144486137381038215,  0.92387953251128673848,  0.79335334029123516508,  0.60876142900872065589,  0.38268343236508983729,  0.13052619222005171218, 
--0.13052619222005160116, -0.38268343236508972627, -0.60876142900872065589, -0.79335334029123505406, -0.92387953251128673848, -0.99144486137381038215, 
--0.99144486137381049318, -0.92387953251128684951, -0.79335334029123516508, -0.60876142900872087793, -0.38268343236509033689, -0.13052619222005162891, 
- 0.13052619222005126809,  0.38268343236509000382,  0.60876142900872054486,  0.79335334029123494304,  0.92387953251128651644,  0.99144486137381038215, 
-};
-const double sintab_gtres[SH_LTRACK_GTRES] = {
- 0.02181488503456112046,  0.06540312923014306168,  0.10886687485196457070,  0.15212338618991669281,  0.19509032201612824808,  0.23768589232617309825, 
- 0.27982901403099208482,  0.32143946530316158672,  0.36243803828370163567,  0.40274668985873718352,  0.44228869021900124592,  0.48098876891938763256, 
- 0.51877325816052144436,  0.55557023301960217765,  0.59130964836358235193,  0.62592347218405908205,  0.65934581510006884386,  0.69151305578226940352, 
- 0.72236396205975550444,  0.75183980747897738439,  0.77988448309288171956,  0.80644460426748254545,  0.83146961230254523567,  0.85491187067294649449, 
- 0.87672675570750768781,  0.89687274153268836674,  0.91531147911944710227,  0.93200786928279844012,  0.94693012949510557696,  0.96004985438592871372, 
- 0.97134206981326143282,  0.98078528040323043058,  0.98836151046776066220,  0.99405633822231964647,  0.99785892323860347908,  0.99976202707990913243, 
- 0.99976202707990913243,  0.99785892323860347908,  0.99405633822231964647,  0.98836151046776066220,  0.98078528040323043058,  0.97134206981326143282, 
- 0.96004985438592871372,  0.94693012949510568799,  0.93200786928279855115,  0.91531147911944721329,  0.89687274153268836674,  0.87672675570750779883, 
- 0.85491187067294671653,  0.83146961230254545772,  0.80644460426748254545,  0.77988448309288183058,  0.75183980747897738439,  0.72236396205975561546, 
- 0.69151305578226951454,  0.65934581510006895488,  0.62592347218405919307,  0.59130964836358257397,  0.55557023301960217765,  0.51877325816052133334, 
- 0.48098876891938763256,  0.44228869021900130143,  0.40274668985873729454,  0.36243803828370174669,  0.32143946530316175325,  0.27982901403099230686, 
- 0.23768589232617337581,  0.19509032201612860891,  0.15212338618991663730,  0.10886687485196457070,  0.06540312923014311719,  0.02181488503456121761, 
--0.02181488503456097475, -0.06540312923014286739, -0.10886687485196432090, -0.15212338618991641526, -0.19509032201612835911, -0.23768589232617312601, 
--0.27982901403099202930, -0.32143946530316153121, -0.36243803828370152464, -0.40274668985873707250, -0.44228869021900107938, -0.48098876891938741052, 
--0.51877325816052122232, -0.55557023301960195560, -0.59130964836358235193, -0.62592347218405908205, -0.65934581510006884386, -0.69151305578226929249, 
--0.72236396205975550444, -0.75183980747897727337, -0.77988448309288194160, -0.80644460426748265647, -0.83146961230254523567, -0.85491187067294660551, 
--0.87672675570750768781, -0.89687274153268825572, -0.91531147911944710227, -0.93200786928279844012, -0.94693012949510557696, -0.96004985438592860270, 
--0.97134206981326132180, -0.98078528040323031956, -0.98836151046776066220, -0.99405633822231953545, -0.99785892323860347908, -0.99976202707990913243, 
--0.99976202707990913243, -0.99785892323860347908, -0.99405633822231964647, -0.98836151046776066220, -0.98078528040323043058, -0.97134206981326143282, 
--0.96004985438592871372, -0.94693012949510568799, -0.93200786928279855115, -0.91531147911944721329, -0.89687274153268847776, -0.87672675570750790985, 
--0.85491187067294682755, -0.83146961230254545772, -0.80644460426748287851, -0.77988448309288216365, -0.75183980747897782848, -0.72236396205975605955, 
--0.69151305578226918147, -0.65934581510006873284, -0.62592347218405897102, -0.59130964836358235193, -0.55557023301960217765, -0.51877325816052144436, 
--0.48098876891938774358, -0.44228869021900141245, -0.40274668985873740557, -0.36243803828370185771, -0.32143946530316186427, -0.27982901403099241788, 
--0.23768589232617348683, -0.19509032201612871993, -0.15212338618991719241, -0.10886687485196513969, -0.06540312923014367230, -0.02181488503456178660
-};
-const double costab_gtres[SH_LTRACK_GTRES] = {
- 0.99976202707990913243,  0.99785892323860347908,  0.99405633822231964647,  0.98836151046776066220,  0.98078528040323043058,  0.97134206981326143282, 
- 0.96004985438592871372,  0.94693012949510568799,  0.93200786928279855115,  0.91531147911944721329,  0.89687274153268836674,  0.87672675570750768781, 
- 0.85491187067294660551,  0.83146961230254523567,  0.80644460426748265647,  0.77988448309288183058,  0.75183980747897738439,  0.72236396205975561546, 
- 0.69151305578226940352,  0.65934581510006884386,  0.62592347218405908205,  0.59130964836358235193,  0.55557023301960228867,  0.51877325816052155538, 
- 0.48098876891938774358,  0.44228869021900124592,  0.40274668985873723903,  0.36243803828370169118,  0.32143946530316169774,  0.27982901403099202930, 
- 0.23768589232617309825,  0.19509032201612833135,  0.15212338618991680383,  0.10886687485196473724,  0.06540312923014304780,  0.02181488503456115863, 
--0.02181488503456103373, -0.06540312923014292290, -0.10886687485196461234, -0.15212338618991669281, -0.19509032201612819257, -0.23768589232617298723, 
--0.27982901403099191828, -0.32143946530316158672, -0.36243803828370158016, -0.40274668985873712801, -0.44228869021900113490, -0.48098876891938746603, 
--0.51877325816052122232, -0.55557023301960195560, -0.59130964836358246295, -0.62592347218405908205, -0.65934581510006884386, -0.69151305578226929249, 
--0.72236396205975550444, -0.75183980747897727337, -0.77988448309288160853, -0.80644460426748243442, -0.83146961230254534669, -0.85491187067294660551, 
--0.87672675570750768781, -0.89687274153268825572, -0.91531147911944710227, -0.93200786928279844012, -0.94693012949510557696, -0.96004985438592860270, 
--0.97134206981326132180, -0.98078528040323043058, -0.98836151046776066220, -0.99405633822231964647, -0.99785892323860347908, -0.99976202707990913243, 
--0.99976202707990913243, -0.99785892323860347908, -0.99405633822231964647, -0.98836151046776077322, -0.98078528040323043058, -0.97134206981326143282, 
--0.96004985438592871372, -0.94693012949510568799, -0.93200786928279855115, -0.91531147911944721329, -0.89687274153268836674, -0.87672675570750779883, 
--0.85491187067294671653, -0.83146961230254545772, -0.80644460426748254545, -0.77988448309288183058, -0.75183980747897749541, -0.72236396205975561546, 
--0.69151305578226951454, -0.65934581510006906591, -0.62592347218405897102, -0.59130964836358224090, -0.55557023301960217765, -0.51877325816052144436, 
--0.48098876891938768807, -0.44228869021900135694, -0.40274668985873735005, -0.36243803828370180220, -0.32143946530316180876, -0.27982901403099236237, 
--0.23768589232617343132, -0.19509032201612866442, -0.15212338618991713690, -0.10886687485196507030, -0.06540312923014361679, -0.02181488503456172415, 
- 0.02181488503456135639,  0.06540312923014325597,  0.10886687485196470948,  0.15212338618991677608,  0.19509032201612830359,  0.23768589232617307050, 
- 0.27982901403099197379,  0.32143946530316147570,  0.36243803828370146913,  0.40274668985873701699,  0.44228869021900102387,  0.48098876891938735501, 
- 0.51877325816052111129,  0.55557023301960184458,  0.59130964836358201886,  0.62592347218405863796,  0.65934581510006839977,  0.69151305578226895943, 
- 0.72236396205975572649,  0.75183980747897749541,  0.77988448309288183058,  0.80644460426748254545,  0.83146961230254523567,  0.85491187067294660551, 
- 0.87672675570750768781,  0.89687274153268825572,  0.91531147911944710227,  0.93200786928279844012,  0.94693012949510557696,  0.96004985438592860270, 
- 0.97134206981326132180,  0.98078528040323031956,  0.98836151046776066220,  0.99405633822231953545,  0.99785892323860347908,  0.99976202707990913243
-};
-
-struct sh_track_entry_data {
-  UINT64      last_login;
-  UINT32      array[SH_LTRACK_HTRES]; /* 1 h resolution */
-  char        hostname[SH_LTRACK_HSIZE];
-};
-
-struct sh_track_entry {
-  struct sh_track_entry_data data;
-  struct sh_track_entry * next;
-};
-
-struct sh_track_head {
-  UINT32 version;
-  UINT32 n_entries;
-  UINT64 last_login;
-  char   hostname[SH_LTRACK_HSIZE];
-  UINT32 array[SH_LTRACK_GTRES]; /* 10 min resolution */
-};
-
-struct sh_track {
-  struct sh_track_head head;
-  struct sh_track_entry * list;
-};
-
-
-/* Returns zero/nonzero
- */
-static int get_bool(char *bitarray, unsigned int index)
-{
-  int bool;
-
-  bitarray += index / 8; /* skip to char */
-  bool = (*bitarray & (1 << (index % 8)));
-
-  return bool;
-}
-
-static void set_bool(char *bitarray, unsigned int index, int bool)
-{
-  bitarray += index / 8; /* skip to char */
-  if (bool)
-    *bitarray |= 1 << (index % 8);
-  else    
-    *bitarray &= ~(1 << (index % 8));
-  return;
-}
-
-
-static char * build_path (const char * user)
-{
-  char * ui;
-
-  if (0 != sh_util_base64_enc_alloc (&ui, user, sl_strlen(user)))
-    {
-      char * path = sh_util_strconcat(DEFAULT_DATAROOT, "/", ui, NULL);
-
-      SH_FREE(ui);
-      return path;
-    }
-  return NULL;
-}
-
-static void destroy_loaded(struct sh_track * urecord)
-{
-  if (urecord)
-    {
-      struct sh_track_entry * entry = urecord->list;
-      struct sh_track_entry * entry_old;
-
-      while(entry)
-	{
-	  entry_old = entry;
-	  entry = entry->next;
-	  SH_FREE(entry_old);
-	}
-      SH_FREE(urecord);
-    }
-  return;
-}
-
-static struct sh_track * load_data_int (char * path)
-{
-  struct sh_track_head * uhead;
-  struct sh_track * urecord;
-
-  urecord = SH_ALLOC(sizeof(struct sh_track));
-  memset(urecord, 0, sizeof(struct sh_track));
-
-  uhead = &(urecord->head);
-  uhead->version = SH_LTRACK_VERSION;
-
-  if (path)
-    {
-      FILE * fp = fopen(path, "rb");
-      
-      if (fp)
-	{
-	  size_t n;
-	  
-	  n = fread(uhead, sizeof(struct sh_track_head), 1, fp);
-	  
-	  if (n == 1)
-	    {
-	      struct sh_track_entry_data entry_data;
-	      struct sh_track_entry * entry;
-	      
-	      while (1 == fread(&entry_data, sizeof(entry_data), 1, fp))
-		{
-		  entry = SH_ALLOC(sizeof(struct sh_track_entry));
-		  memcpy(&(entry->data), &entry_data, sizeof(entry_data));
-		  entry->next   = urecord->list;
-		  urecord->list = entry;
-		}
-	    }
-	  fclose(fp);
-	}
-    }
-
-  return urecord;
-}
-
-static struct sh_track * load_data (const char * user)
-{
-  char * path = build_path (user);
-  struct sh_track * res = load_data_int (path);
-
-  if (path)
-    SH_FREE(path);
-  return res;
-}
-
-static void save_data_int (struct sh_track * urecord, char * path)
-{
-  mode_t mask;
-  FILE * fp;
-  
-  mask = umask(S_IWGRP | S_IWOTH);
-  fp = fopen(path, "wb");
-  (void) umask(mask);
-  
-  if (fp)
-    {
-      size_t n;
-      
-      n = fwrite(&(urecord->head), sizeof(struct sh_track_head), 1, fp);
-      
-      if (n == 1)
-	{
-	  struct sh_track_entry * entry = urecord->list;
-	  
-	  while (entry && (n > 0))
-	    {
-	      n = fwrite(&(entry->data), sizeof(struct sh_track_entry_data), 
-			 1, fp);
-	      entry = entry->next;
-	    }
-	}
-      fclose(fp);
-    }
-  return;
-}
-
-static void save_data (struct sh_track * urecord, const char * user)
-{
-  char * path = build_path (user);
-
-  if (path)
-    {
-      save_data_int (urecord, path);
-      SH_FREE(path);
-    }
-  return;
-}
-
-/**************
- *
- * Configurable
- *
- **************/
-
-enum significance { SIG00, SIG01, SIG05 };
-enum checklevel   { CHECK_NONE, CHECK_HOST, CHECK_DOMAIN };
-enum days         { WORKDAYS = 0, SATURDAY, SUNDAY };
-#define LTRACK_NDAYS 3
-
-static int sig_level    = SIG00;
-static int check_level  = CHECK_NONE;
-static int check_date   = S_FALSE;
-
-/* We use a bit array of SH_LTRACK_GTRES bits for allowed times 
- * (10 min resolution)
- */
-#define BITARRSIZ(a) ((a + 7) / 8)
-
-static int global_init  = S_FALSE;
-static char global_dates[LTRACK_NDAYS][BITARRSIZ(SH_LTRACK_GTRES)];
-
-struct sh_track_dates {
-  char user[SH_LTRACK_USIZE];
-  char dates[LTRACK_NDAYS][BITARRSIZ(SH_LTRACK_GTRES)];
-  struct sh_track_dates * next;
-};
-struct sh_track_dates * user_dates = NULL;
-
-static int set_dates (char bitarray[][BITARRSIZ(SH_LTRACK_GTRES)], 
-		      unsigned int size, const char * defstr);
-
-void sh_login_reset (void)
-{
-  int i, j;
-  struct sh_track_dates *u_old, *u;
-
-  u          = user_dates;
-  user_dates = NULL;
-
-  while(u)
-    {
-      u_old = u;
-      u     = u->next;
-      SH_FREE(u_old);
-    }
-
-  for (j = 0; j < LTRACK_NDAYS; ++j)
-    {
-      for (i = 0; i < SH_LTRACK_GTRES; ++i)
-	{ 
-	  set_bool(global_dates[j], i, 0);
-	}
-    }
-  global_init = S_FALSE;
-
-  sig_level    = SIG00;
-  check_level  = CHECK_NONE;
-  check_date   = S_FALSE;
-
-  return;
-}
-
-int sh_login_set_def_allow(const char * c)
-{
-  int res = set_dates(global_dates, SH_LTRACK_GTRES, c);
-
-  if (res == 0)
-    {
-      check_date   = S_TRUE;
-      global_init  = S_TRUE;
-    }
-  return res;
-}
-
-static struct sh_track_dates * find_user(const char * user)
-{
-  struct sh_track_dates * u = user_dates;
-
-  while(u)
-    {
-      if (0 == sl_strcmp(user, u->user))
-	{
-	  return u;
-	}
-      u = u->next;
-    }
-  return NULL;
-}
-
-int sh_login_set_user_allow(const char * c)
-{
-  unsigned int i = 0;
-  const char *p = c;
-  char user[SH_LTRACK_USIZE];
-  
-  struct sh_track_dates * u;
-
-  while (p && *p && *p != ':' && *p != ' ' && *p != '\t')
-    {
-      user[i] = *p; ++p; ++i;
-
-      if (i == SH_LTRACK_USIZE)
-	return -1;
-    }
-
-  while (p && *p && (*p == ' ' || *p == '\t')) ++p;
-
-  if (p && *p && (i < SH_LTRACK_USIZE) && (*p == ':'))
-    {
-      user[i] = '\0';
-
-      ++p; while (*p && (*p == ' ' || *p == '\t')) ++p;
-
-      if (*p)
-	{
-	  int res;
-	  int flag = 0;
-
-	  u = find_user(user);
-
-	  if (!u)
-	    {
-	      u = SH_ALLOC(sizeof(struct sh_track_dates));
-	      memset(u, 0, sizeof(struct sh_track_dates));
-	      sl_strlcpy(u->user, user, SH_LTRACK_USIZE);
-	      flag = 1;
-	    }
-
-	  res = set_dates(u->dates, SH_LTRACK_GTRES, p);
-	  if (res != 0)
-	    {
-	      if (flag == 1)
-		SH_FREE(u);
-	      return -1;
-	    }
-
-	  if (flag == 1)
-	    {
-	      u->next    = user_dates;
-	      user_dates = u;
-	    }
-
-	  check_date = S_TRUE;
-	  return 0;
-	}
-    }
-  return -1;
-}
-
-int sh_login_set_siglevel(const char * c)
-{
-  int ret = sh_util_flagval(c, &sig_level);
-
-  if (ret == 0)
-    {
-      sig_level = (sig_level == S_FALSE) ? SIG00 : SIG01;
-      return 0;
-    }
-  else
-    {
-      if (0 == strcmp(c, _("paranoid")))
-	{
-	  sig_level = SIG05;
-	  return 0;
-	}
-    }
-  sig_level = SIG00;
-  return -1;
-}
-
-int sh_login_set_checklevel(const char * c)
-{
-  int ret = sh_util_flagval(c, &check_level);
-
-  if (ret == 0)
-    {
-      check_level = (check_level == S_FALSE) ? CHECK_NONE : CHECK_HOST;
-      return 0;
-    }
-  else
-    {
-      if (0 == strcmp(c, _("domain")))
-	{
-	  check_level = CHECK_DOMAIN;
-	  return 0;
-	}
-    }
-  check_level = CHECK_NONE;
-  return -1;
-}
-
-static int eval_range(char * bitarray, unsigned int size, char * def)
-{
-  unsigned int h1, m1, h2, m2;
-
-  int res = sscanf(def, "%d:%d - %d:%d", &h1, &m1, &h2, &m2);
-
-  if (res == 4)
-    {
-      unsigned int t1 = 3600*h1 + 60*m1;
-      unsigned int t2 = 3600*h2 + 60*m2;
-      int hres        = (60*60*24)/size;
-      unsigned int i;
-
-      if (t1 > t2 || t1 > 86340 || t2 > 86340)
-	return -1;
-
-      t1  = t1 / hres;
-      t2  = t2 / hres;
-      t1  = (t1 < size) ? t1 : (size-1);
-      t2  = (t2 < size) ? t2 : (size-1);
-
-      for (i = t1; i <= t2; ++i)
-	{
-	  set_bool(bitarray, i, 1);
-	}
-      return 0;
-    }
-  return -1;
-}
-
-static int set_ranges(char * bitarray, unsigned int size, 
-		      char ** splits, unsigned int nfields)
-{
-  unsigned int i;
-  int retval = 0;
-
-  for (i = 0; i < nfields; ++i)
-    {
-      char * range = &(splits[i][0]);
-
-      if (0 != eval_range(bitarray, size, range))
-	retval = -1;
-    }
-  return retval;
-}
-
-/* 'always', 'never', workdays(list of ranges), (sun|satur)day(list of ranges)
- */
-static int set_dates (char bitarray[][BITARRSIZ(SH_LTRACK_GTRES)], 
-		      unsigned int size, 
-		      const char * defstr)
-{
-  unsigned int i, j;
-  int retval = -1;
-
-  if (0 == strcmp(_("always"), defstr))
-    {
-      for (j = 0; j < LTRACK_NDAYS; ++j)
-	for (i = 0; i < size; ++i)
-	  set_bool(bitarray[j], i, 1);
-      retval = 0;
-    }
-  else if (0 == strcmp(_("never"), defstr))
-    {
-      for (j = 0; j < LTRACK_NDAYS; ++j)
-	for (i = 0; i < size; ++i)
-	  set_bool(bitarray[j], i, 0);
-      retval = 0;
-    }
-  else
-    {
-      unsigned int nfields = 24; /* list of ranges */
-      size_t       lengths[24];
-      char *       new    = NULL;
-      char **      splits = NULL;
-
-      if      (0 == strncmp(_("workdays"), defstr, 7))
-	{
-	  new    = sh_util_strdup(defstr);
-	  splits = split_array_braced(new, _("workdays"), 
-				      &nfields, lengths);
-	  j = WORKDAYS;
-	}
-      else if (0 == strncmp(_("saturday"), defstr, 8))
-	{
-	  new    = sh_util_strdup(defstr);
-	  splits = split_array_braced(new, _("saturday"), 
-				      &nfields, lengths);
-	  j = SATURDAY;
-	}
-      else if (0 == strncmp(_("sunday"), defstr, 6))
-	{
-	  new    = sh_util_strdup(defstr);
-	  splits = split_array_braced(new, _("sunday"), 
-				      &nfields, lengths);
-	  j = SUNDAY;
-	}
-      else
-	{
-	  return -1;
-	}
-
-      if (new && splits && nfields > 0)
-	{
-	  retval = set_ranges(bitarray[j], size, splits, nfields);
-	}
-
-      if (new) SH_FREE(new);
-    }
-  return retval;
-}
-
-
-
-/**************
- *
- * Report
- *
- **************/
-
-void report_generic(char * file, int line, 
-		    const char * user, time_t time, const char * host, int what)
-{
-  char   ttt[TIM_MAX];
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  (void) sh_unix_time (time, ttt, TIM_MAX);
-  sh_error_handle ((-1), file, line, 0, what,
-		   user, host, ttt);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  return;
-}
-
-void report_bad_date(char * file, int line, 
-		     const char *user, time_t time, const char * host)
-{
-  report_generic(file, line, user, time, host, MSG_UT_BAD);
-}
-
-void report_first(char * file, int line, 
-		  const char *user, time_t time, const char * host)
-{
-  report_generic(file, line, user, time, host, MSG_UT_FIRST);
-}
-
-void report_outlier(char * file, int line, 
-		    const char *user, time_t time, const char * host)
-{
-  report_generic(file, line, user, time, host, MSG_UT_OUTLIER);
-}
-
-/**************
- *
- * Dates
- *
- **************/
-
-static int check_login_date(const char * user, unsigned int index, int wday)
-{
-  unsigned int i, j;
-  struct sh_track_dates * allowed = NULL;
-  int day;
-
-  /* Use an intermediate array 'char* b[m]' to cast 'char a[m][n]' to 'char** c' */
-  char * aux[LTRACK_NDAYS];
-  char **good = (char **) aux;
-
-  for (i = 0; i < LTRACK_NDAYS; ++i)
-    {
-      aux[i] = (char *) &global_dates[i][0];
-      /* + i * BITARRSIZ(SH_LTRACK_GTRES); */
-    }
-
-  if (wday > 0 && wday < 6)
-    day = WORKDAYS;
-  else if (wday == 6)
-    day = SATURDAY;
-  else
-    day = SUNDAY;
-
-  if (check_date != S_FALSE)
-    {
-      if (S_FALSE == global_init)
-	{
-	  for (j = 0; j < LTRACK_NDAYS; ++j)
-	    {
-	      for (i = 0; i < SH_LTRACK_GTRES; ++i) 
-		set_bool(global_dates[j], i, 1);
-	    }
-	  global_init = S_TRUE;
-	}
-
-      if (user) {
-	allowed = find_user(user);
-      }
-
-      if (allowed)
-	{
-	  for (i = 0; i < LTRACK_NDAYS; ++i)
-	    {
-	      aux[i] = (char *)&(allowed->dates)[i][0]; 
-	      /* + i*BITARRSIZ(SH_LTRACK_GTRES); */
-	    }
-	}
-      
-      if (0 == get_bool(good[day], index))
-	{
-	  return -1;
-	}
-    }
-  return 0;
-} 
-
-/**************
- *
- * Statistics
- *
- **************/
-
-/* Compute sqrt(s) using the babylonian algorithm
- * (to avoid linking with -lm).
- */ 
-static double sh_sqrt(double s)
-{
-  double eps = 1.0e-6;
-  double x0  = 1.0;
-  double xs  = s;
-
-  double diff = xs - x0;
-  diff = (diff > 0.0) ? diff : -diff;
-
-  while (diff > eps)
-    {
-      xs = x0;
-      x0 = 0.5 * (x0 + (s/x0));
-      diff = xs - x0;
-      diff = (diff > 0.0) ? diff : -diff;
-    }
-  return x0;
-}
-
-static double M_crit(int n, int flag)
-{
-#define SH_MCSIZE 10
-  const double M_05[SH_MCSIZE] = { 0.975, 0.918, 0.855, 0.794, 0.739, 0.690, 0.647, 0.577, 0.497, 0.406 };
-  const double M_01[SH_MCSIZE] = { 0.995, 0.970, 0.934, 0.891, 0.845, 0.799, 0.760, 0.688, 0.603, 0.498 };
-  const int    M_nn[SH_MCSIZE] = {     4,     5,     6,     7,     8,     9,    10,    12,    15,    20 };
-
-  if (n > M_nn[SH_MCSIZE-1])
-    {
-      return ((flag == SIG05) ? M_05[SH_MCSIZE-1] : M_01[SH_MCSIZE-1]);
-    }
-  else
-    {
-      unsigned int i;
-
-      for (i = 1; i < SH_MCSIZE; ++i)
-	{
-	  if (n < M_nn[i])
-	    {
-	      return ((flag == SIG05) ? M_05[i-1] : M_01[i-1]);
-	    }
-	}
-    }
-
-  return ((flag == SIG05) ? M_05[SH_MCSIZE-1] : M_01[SH_MCSIZE-1]);
-}
-
-static int check_statistics (unsigned int index, UINT32 * array, unsigned int size,
-			     const double * costab, const double * sintab)
-{
-  double C = 0.0;
-  double S = 0.0;
-  double R, Rk, M;
-
-  unsigned int i, n = 0;
-
-  if (sig_level != SIG00)
-    {
-      for (i = 0; i < size; ++i)
-	{
-	  n += array[i];
-	  C += (array[i] * costab[i]);
-	  S += (array[i] * sintab[i]);
-	}
-      
-      if (n > 2) /* current is at least 4th datapoint */
-	{
-	  R = sh_sqrt(S*S + C*C);
-	  
-	  C += array[index] * costab[index];
-	  S += array[index] * sintab[index];
-	  Rk = sh_sqrt(S*S + C*C);
-	  ++n;
-	  
-	  M  = (Rk - R + 1.0)/((double)n - R);
-	  
-	  if (M > M_crit(n, sig_level))
-	    {
-	      return -1;
-	    }
-	}
-    }
-  return 0;
-}
-
-static char * stripped_hostname (const char * host)
-{
-  char *p, *q;
-  
-  if (sh_ipvx_is_numeric(host))
-    {
-      p = sh_util_strdup(host);
-      q = strrchr(p, '.');
-      if (q) 
-	{
-	  *q = '\0';
-	  q = strrchr(p, '.');
-	  if (q)
-	    {
-	      *q = '\0';
-	    }
-	}
-    }
-  else
-    {
-      char * tmp = sh_util_strdup(host);
-      q = strchr(tmp, '.'); 
-      if (q && *q)
-	{
-	  ++q;
-	  p = sh_util_strdup(q);
-	  SH_FREE(tmp);
-	}
-      else
-	{
-	  p = tmp;
-	}
-    }
-  return p;
-}
-
-static unsigned int time_to_index(struct tm * tp, int nbin)
-{
-  int hres  = (60*60*24)/nbin;
-  int index = tp->tm_hour * 3600 + tp->tm_min * 60 + tp->tm_sec;
-  index  = index / hres;
-  index  = (index < nbin) ? index : (nbin-1);
-
-  return index;
-}
-
-static struct sh_track_entry * check_host(struct sh_track_entry * list, 
-					  const char * user, time_t time, const char * host,
-					  struct tm * tp)
-{
-  unsigned int    index = time_to_index(tp, SH_LTRACK_HTRES);
-  struct sh_track_entry * entry = list;
-
-  char * p = NULL;
-  const char * q;
-
-  if (check_level == CHECK_DOMAIN)
-    {
-      p = stripped_hostname(host);
-      q = p;
-    }
-  else
-    {
-      q = host;
-    }
-
-  while (entry)
-    {
-      if (0 == strncmp(q, (entry->data).hostname, SH_LTRACK_HSIZE))
-	break;
-      entry = entry->next;
-    }
-
-  if (entry)
-    {
-      int isAlert;
-
-      (entry->data).last_login    = time;
-
-      /* Check host statistics here 
-       */
-      isAlert = check_statistics (index, (entry->data).array, SH_LTRACK_HTRES, 
-				  costab_htres, sintab_htres); 
-
-      if (isAlert != 0) 
-	{
-	  report_outlier(FIL__, __LINE__, user, time, host);
-	}
-
-      /* Update array afterwards
-       */
-      (entry->data).array[index] += 1;
-    }
-  else
-    {
-      entry = SH_ALLOC(sizeof(struct sh_track_entry));
-      memset(entry, 0, sizeof(struct sh_track_entry));
-      (entry->data).last_login    = time;
-      (entry->data).array[index]  = 1;
-      sl_strlcpy((entry->data).hostname, q, SH_LTRACK_HSIZE);
-
-      /* Report first login from this host 
-       */
-      if (check_level != CHECK_NONE) 
-	{ 
-	  report_first (FIL__, __LINE__, user, time, host);
-	}
-      
-      if (p)
-	SH_FREE(p);
-      return entry;
-    }
-
-  if (p)
-    SH_FREE(p);
-  return NULL;
-}
-
-/********************************************************
- *
- * Public Function
- *
- ********************************************************/
-
-void sh_ltrack_check(struct SH_UTMP_S * ut)
-{
-  int gres;
-  const char * user;
-  time_t time;
-#if defined(HAVE_UTHOST)
-  const char * host;
-#else
-  const char * host;
-#endif
-  struct sh_track * urecord;
-  time_t last_login;
-
-  /* Just return if we are not supposed to do anything
-   */
-  if (sig_level == SIG00 && check_level == CHECK_NONE && check_date == S_FALSE)
-    return;
-
-
-#if defined(HAVE_UTHOST)
-  host = ut->ut_host;
-#else
-  host = sh_util_strdup(_("unknown"));
-#endif
-  time = ut->ut_time;
-  user = ut->ut_name;
-
-  gres  = (60*60*24)/SH_LTRACK_GTRES;
-
-  urecord    = load_data(user);
-  last_login = (urecord->head).last_login;
-
-  if (   last_login < time &&
-	 ( (time - last_login) >= gres || 
-	   0 != strcmp(host, (urecord->head).hostname)
-	   )
-	 )
-    {
-      struct tm ts;
-      unsigned int  index;
-      int isAlert;
-      struct sh_track_entry * entry;
-
-      (urecord->head).last_login = time;
-      sl_strlcpy((urecord->head).hostname, host, SH_LTRACK_HSIZE);
-      (urecord->head).n_entries += 1;
-
-      memcpy(&ts, localtime(&time), sizeof(struct tm));
-      index = time_to_index(&ts, SH_LTRACK_GTRES);
-      
-      /* Check global statistics here 
-       */
-      isAlert = check_statistics (index, (urecord->head).array, 
-				  SH_LTRACK_GTRES, 
-				  costab_gtres, sintab_gtres);
-      
-      if (isAlert != 0) 
-	{
-	  report_outlier(FIL__, __LINE__, user, time, host);
-	}
-      
-
-      if (check_date != S_FALSE)
-	{
-	  int isBad = check_login_date(user, index, ts.tm_wday);
-
-	  if (isBad != 0)
-	    {
-	      report_bad_date(FIL__, __LINE__, user, time, host);
-	    }
-	}
-
-      /* Update array afterwards 
-       */
-      (urecord->head).array[index] += 1;
-
-      entry = check_host(urecord->list, user, time, host, &ts);
-      if (entry)
-	{
-	  entry->next   = urecord->list;
-	  urecord->list = entry;
-	}
-
-      save_data(urecord, user);
-    } 
-
-  destroy_loaded(urecord);
-
-#if !defined(HAVE_UTHOST)
-  SH_FREE(host);
-#endif
-  return;
-}
-
-#ifdef SH_CUTEST
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "CuTest.h"
-
-void Test_login (CuTest *tc) {
-  char bitarr[10] = { 0,0,0,0,0,0,0,0,0,128 };
-  unsigned int i;
-  int j, k;
-  char buf[1024];
-  char *p, *q;
-  size_t l1, l2;
-
-  /* Check bitarray */
-
-  for (i = 0; i < 72; ++i)
-    {
-      set_bool(bitarr, i, 1);
-    }
-  for (i = 72; i < 80; ++i)
-    {
-      set_bool(bitarr, i, 0);
-    }
-  for (i = 0; i < 80; ++i)
-    {
-      j = get_bool(bitarr, i);
-      if (i < 72)
-	CuAssertTrue(tc, j > 0);
-      else
-	CuAssertIntEquals(tc, 0, j);
-    }
-
-  /* check build_path */
-
-  j = sl_strlcpy(buf, DEFAULT_DATAROOT, sizeof(buf));
-  CuAssertIntEquals(tc, 0, j);
-
-  p = build_path("rainer");
-  q = sh_util_dirname(p);
-  j = strncmp(buf, q, strlen(buf));
-  l1 = strlen(buf); l2 = strlen(q);
-  CuAssertTrue(tc, l2 >= l1);
-  CuAssertIntEquals(tc, 0, j);
-
-  q = sh_util_basename(p);
-  CuAssertStrEquals(tc, q, "cmFpbmVy");
-
-  { /* Check load/save of user data */
-    struct sh_track urecord, *precord;
-    struct sh_track_entry uentry0, *pentry;
-    struct sh_track_entry uentry1;
-
-    urecord.head.version   = 40;
-    urecord.head.n_entries = 41;
-    urecord.head.last_login = 42;
-    for (i = 0; i < SH_LTRACK_GTRES; ++i)
-      urecord.head.array[i] = 0;
-    urecord.head.array[30] = 30;
-
-    urecord.list = &uentry0;
-    uentry0.next = &uentry1;
-    uentry1.next = NULL;
-
-    uentry0.data.last_login = 52;
-    strcpy(uentry0.data.hostname, "host0");
-    for (i = 0; i < SH_LTRACK_HTRES; ++i)
-      uentry0.data.array[i] = 0;
-    uentry0.data.array[5] = 50;
-
-    uentry1.data.last_login = 62;
-    strcpy(uentry1.data.hostname, "host1");
-    for (i = 0; i < SH_LTRACK_HTRES; ++i)
-      uentry1.data.array[i] = 0;
-    uentry1.data.array[6] = 60;
-
-    snprintf(buf, sizeof(buf), "cutest_%06d", (int) getpid());
-
-    save_data_int(&urecord, buf);
-
-    precord = load_data_int(buf);
-
-    CuAssertIntEquals(tc, urecord.head.version, (precord->head).version);
-    CuAssertIntEquals(tc, urecord.head.n_entries, (precord->head).n_entries);
-    CuAssertIntEquals(tc, urecord.head.last_login, (precord->head).last_login);
-    for (i = 0; i < SH_LTRACK_GTRES; ++i)
-      CuAssertIntEquals(tc, urecord.head.array[i], (precord->head).array[i]);
-
-    CuAssertPtrNotNull(tc, precord->list);
-    pentry = precord->list;
-    CuAssertIntEquals(tc, uentry1.data.last_login, (pentry->data).last_login);
-    CuAssertStrEquals(tc, uentry1.data.hostname, (pentry->data).hostname);
-    for (i = 0; i < SH_LTRACK_HTRES; ++i)
-      CuAssertIntEquals(tc, uentry1.data.array[i], (pentry->data).array[i]);
-
-    CuAssertPtrNotNull(tc, pentry->next);
-    pentry = pentry->next;
-    CuAssertIntEquals(tc, uentry0.data.last_login, (pentry->data).last_login);
-    CuAssertStrEquals(tc, uentry0.data.hostname, (pentry->data).hostname);
-    for (i = 0; i < SH_LTRACK_HTRES; ++i)
-      CuAssertIntEquals(tc, uentry0.data.array[i], (pentry->data).array[i]);
-
-    CuAssertPtrEquals(tc, pentry->next, NULL);
-    destroy_loaded(precord);
-    unlink(buf);
-
-    precord = load_data_int("supacalifragilistic");
-    CuAssertPtrNotNull(tc, precord);
-    CuAssertPtrEquals(tc, precord->list, NULL);
-    CuAssertIntEquals(tc, SH_LTRACK_VERSION, (precord->head).version);
-    CuAssertIntEquals(tc, 0, (precord->head).n_entries);
-    CuAssertIntEquals(tc, 0, (precord->head).last_login);
-    for (i = 0; i < SH_LTRACK_GTRES; ++i)
-      CuAssertIntEquals(tc, 0, (precord->head).array[i]);
-    destroy_loaded(precord);
-
-    precord = load_data_int(NULL);
-    CuAssertPtrNotNull(tc, precord);
-    CuAssertPtrEquals(tc, precord->list, NULL);
-    CuAssertIntEquals(tc, SH_LTRACK_VERSION, (precord->head).version);
-    CuAssertIntEquals(tc, 0, (precord->head).n_entries);
-    CuAssertIntEquals(tc, 0, (precord->head).last_login);
-    for (i = 0; i < SH_LTRACK_GTRES; ++i)
-      CuAssertIntEquals(tc, 0, (precord->head).array[i]);
-    destroy_loaded(precord);
-  }
-
-  /* check configuration */
-
-  j = sh_login_set_siglevel("duh");
-  CuAssertIntEquals(tc, -1, j);
-  CuAssertIntEquals(tc, SIG00, sig_level);
-
-  j = sh_login_set_siglevel("yes");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, SIG01, sig_level);
-  j = sh_login_set_siglevel("no");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, SIG00, sig_level);
-  j = sh_login_set_siglevel("paranoid");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, SIG05, sig_level);
-
-  j = sh_login_set_checklevel("duh");
-  CuAssertIntEquals(tc, -1, j);
-  CuAssertIntEquals(tc, CHECK_NONE, check_level);
-
-  j = sh_login_set_checklevel("yes");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, CHECK_HOST, check_level);
-  j = sh_login_set_checklevel("no");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, CHECK_NONE, check_level);
-  j = sh_login_set_checklevel("domain");
-  CuAssertIntEquals(tc, 0, j);
-  CuAssertIntEquals(tc, CHECK_DOMAIN, check_level);
-
-  j = sh_login_set_def_allow("always");
-  CuAssertIntEquals(tc, 0, j);
-  for (j = 0; j < LTRACK_NDAYS; ++j)
-    {
-      for (i = 0; i < SH_LTRACK_GTRES; ++i)
-	{
-	  k = get_bool(global_dates[j], i);
-	  CuAssertTrue(tc, k > 0);
-	}
-    }
-
-  j = sh_login_set_def_allow("never");
-  CuAssertIntEquals(tc, 0, j);
-  for (j = 0; j < LTRACK_NDAYS; ++j)
-    {
-      for (i = 0; i < SH_LTRACK_GTRES; ++i)
-	{
-	  k = get_bool(global_dates[j], i);
-	  CuAssertIntEquals(tc, 0, k);
-	}
-    }
-
-  j = sh_login_set_def_allow("workdays( 0:12-1:30, 07:30-18:29,23:30-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  for (j = 0; j < LTRACK_NDAYS; ++j)
-    {
-      for (i = 0; i < SH_LTRACK_GTRES; ++i)
-	{
-	  k = get_bool(global_dates[j], i);
-	  // fprintf(stderr, "%d: %d: %d\n", j, i, k);
-	  if (j == WORKDAYS)
-	    {
-	      if ( (i>=1 && i<=9) || (i>=45 && i <=110) || (i>=141 && i<=143))
-		CuAssertTrue(tc, k > 0);
-	      else
-		CuAssertIntEquals(tc, 0, k);
-	    }
-	  else
-	    {
-	      CuAssertIntEquals(tc, 0, k);
-	    }
-	}
-    }
-
-  j = sh_login_set_user_allow("rainer :workdays( 0:12-1:30, 07:30-18:29,23:30-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = sh_login_set_user_allow("rainer :saturday( 0:0-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = sh_login_set_user_allow("rain : workdays(0:12-1:30, 07:30-18:29,23:30-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = sh_login_set_user_allow("cat: workdays( 0:12-1:30, 07:30-18:29,23:30-23:59 )");
-  CuAssertIntEquals(tc, 0, j);
-  j = sh_login_set_user_allow("cat: sunday(0:00-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-
-  {
-    int count = 0;
-    struct sh_track_dates * u = user_dates;
-    
-    CuAssertPtrNotNull(tc, u);
-
-    do {
-
-      if (count == 0) {
-	CuAssertStrEquals(tc, u->user, "cat");
-	CuAssertPtrNotNull(tc, u->next);
-      }
-      else if (count == 1) {
-	CuAssertStrEquals(tc, u->user, "rain");
-	CuAssertPtrNotNull(tc, u->next);
-      }
-      else if (count == 2) {
-	CuAssertStrEquals(tc, u->user, "rainer");
-	CuAssertPtrEquals(tc, u->next, NULL);
-      }
-
-      for (j = 0; j < LTRACK_NDAYS; ++j)
-	{
-	  for (i = 0; i < SH_LTRACK_GTRES; ++i)
-	    {
-	      k = get_bool(u->dates[j], i);
-	      // fprintf(stderr, "%d: %d: %d\n", j, i, k);
-	      if (j == WORKDAYS)
-		{
-		  if ( (i>=1 && i<=9) || (i>=45 && i <=110) || 
-		       (i>=141 && i<=143) )
-		    {
-		      CuAssertTrue(tc, k > 0);
-		    }
-		  else
-		    {
-		      CuAssertIntEquals(tc, 0, k);
-		    }
-		}
-	      else
-		{
-		  if ((count == 0 && j == SUNDAY) || 
-		      (count == 2 && j == SATURDAY))
-		    CuAssertTrue(tc, k > 0);
-		  else
-		    CuAssertIntEquals(tc, 0, k);
-		}
-	    }
-	}
-
-      if (u->next == NULL)
-	break;
-
-      u = u->next; ++count;
-
-    } while (1 == 1);
-  }
-
-  sh_login_reset();
-  CuAssertIntEquals(tc, SIG00, sig_level);
-  CuAssertIntEquals(tc, CHECK_NONE, check_level);
-
-  /* check dates */
-
-  j = sh_login_set_def_allow("workdays( 0:12-1:30, 07:30-18:29,23:30-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-
-  j = check_login_date("rainer", 0, 2);
-  CuAssertIntEquals(tc, -1, j);
-  j = check_login_date("rainer", 1, 2);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("rainer",50, 3);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("rainer",142, 5);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("rainer", 1, 0);
-  CuAssertIntEquals(tc, -1, j);
-  j = check_login_date("rainer", 1, 6);
-  CuAssertIntEquals(tc, -1, j);
-  j = sh_login_set_user_allow("rainer :saturday( 0:0-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = check_login_date("rainer", 1, 6);
-  CuAssertIntEquals(tc,  0, j);
-  j = sh_login_set_user_allow("mouse :sunday( 0:0-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = sh_login_set_user_allow("cat :saturday(0:0-23:59)");
-  CuAssertIntEquals(tc, 0, j);
-  j = check_login_date("rainer", 1, 6);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("mouse", 1, 6);
-  CuAssertIntEquals(tc, -1, j);
-  j = check_login_date("mouse", 1, 0);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("cat", 1, 6);
-  CuAssertIntEquals(tc,  0, j);
-  j = check_login_date("dog", 1, 6);
-  CuAssertIntEquals(tc, -1, j);
-
-  sh_login_reset();
-
-  /* statistics, critical values */
-  {
-    double f;
-
-    f = M_crit(1, SIG05);
-    CuAssertTrue(tc, f > 0.974 && f < 0.976);
-    f = M_crit(13, SIG05);
-    CuAssertTrue(tc, f > 0.576 && f < 0.578);
-    f = M_crit(22, SIG05);
-    CuAssertTrue(tc, f > 0.405 && f < 0.407);
-    f = M_crit(10, SIG05);
-    CuAssertTrue(tc, f > 0.646 && f < 0.648);
-    f = M_crit(10, SIG01);
-    CuAssertTrue(tc, f > 0.759 && f < 0.761);
-  }
-
-  /* stripped hostname */
-  p = stripped_hostname("127.20.120.100");
-  CuAssertStrEquals(tc, "127.20", p);
-
-  p = stripped_hostname("foo.www.example.com");
-  CuAssertStrEquals(tc, p, "www.example.com");
-
-  p = stripped_hostname("www.example.com");
-  CuAssertStrEquals(tc, p, "example.com");
-
-  p = stripped_hostname("localhost");
-  CuAssertStrEquals(tc, p, "localhost");
-
-  {
-    struct tm tt;
-
-    tt.tm_hour =  0;
-    tt.tm_min  = 30;
-    tt.tm_sec  =  0;
-
-    for (i = 0; i < 24; ++i)
-      {
-	tt.tm_hour =  i;
-	j = time_to_index(&tt, SH_LTRACK_HTRES);
-	CuAssertIntEquals(tc, j, i);
-      }
-
-    tt.tm_min  = 10;
-
-    for (i = 0; i < 24; ++i)
-      {
-	tt.tm_hour =  i;
-	j = time_to_index(&tt, SH_LTRACK_GTRES);
-	CuAssertIntEquals(tc, 1+i*6, j);
-      }
-  } 
-}
-/* #ifdef SH_CUTEST */
-#endif
-
-#else
-
-#ifdef SH_CUTEST
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "CuTest.h"
-
-void Test_login (CuTest *tc) {
-  (void) tc;
-}
-
-/* #ifdef SH_CUTEST */
-#endif
-
-#endif
Index: trunk/src/sh_mail.c
===================================================================
--- trunk/src/sh_mail.c	(revision 591)
+++ trunk/src/sh_mail.c	(revision 1)
@@ -34,8 +34,15 @@
 #if defined(SH_WITH_MAIL)
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
+#else
+#include <time.h>
 #endif
-#include <time.h>
+#endif
+
 
 #ifdef HAVE_MEMORY_H
@@ -51,9 +58,4 @@
 #include "sh_fifo.h"
 #include "sh_tools.h"
-#include "sh_pthread.h"
-#include "sh_filter.h"
-#include "sh_mail_int.h"
-#include "sh_nmail.h"
-#include "sh_ipvx.h"
 
 #undef  FIL__
@@ -62,6 +64,19 @@
 #undef  BAD
 
-static int failedMail = S_FALSE;
-
+static int failedMail = SL_FALSE;
+
+/* MX Resolver Struct
+ */
+typedef struct mx_ {
+  int    pref;
+  char * address;
+} mx;
+
+typedef struct dnsrep_ {
+  int    count;
+  mx   * reply;
+} dnsrep;
+
+static int free_mx (dnsrep * answers);
 static dnsrep * return_mx (char *domain);
 
@@ -78,5 +93,5 @@
 static mail_trail_type * mail_trail = NULL;
 
-int sh_mail_sigverify (const char * s)
+int sh_mail_sigverify (char * s)
 {
   SL_TICKET  fd;
@@ -109,5 +124,5 @@
       _exit (EXIT_FAILURE);
     }
-  if ( SL_ISERROR(fd = sl_open_read (FIL__, __LINE__, s, SL_NOPRIV)))
+  if ( SL_ISERROR(fd = sl_open_read (s, SL_NOPRIV)))
     {
       fprintf(stderr, _("Could not open file %s\n"), s);
@@ -115,6 +130,6 @@
     }
 
-  buf     = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_BUFSIZE+1));
-  bufc    = SH_ALLOC( (size_t)(SH_MSG_BUF+SH_MAXBUF+1));
+  buf     = SH_ALLOC( (size_t)(SH_BUFSIZE+1));
+  bufc    = SH_ALLOC( (size_t)(SH_MAXBUF+1));
 
   while (1 == 1)
@@ -128,5 +143,5 @@
 			     sizeof("-----BEGIN MESSAGE-----")-1)) 
 	{
-	  (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE);
+	  (void) sh_unix_getline (fd, buf, SH_BUFSIZE);
 	  if (buf[0] == '\0')
 	    {
@@ -147,5 +162,5 @@
       while (1 == 1)
 	{
-	  (void) sh_unix_getline (fd, buf, SH_MSG_BUF+SH_BUFSIZE);
+	  (void) sh_unix_getline (fd, buf, SH_BUFSIZE);
 	  if (0 == sl_strncmp(buf, _("-----BEGIN SIGNATURE-----"),
 			      sizeof("-----BEGIN SIGNATURE-----")-1))
@@ -153,13 +168,13 @@
 	  if (buf[0] == '\0') 
 	    _exit (EXIT_FAILURE);
-	  (void) sh_util_compress(bufc, buf, SH_MSG_BUF+SH_MAXBUF-KEY_LEN);
+	  (void) sh_util_compress(bufc, buf, SH_MAXBUF-KEY_LEN);
 	}
       
       /* get signature and number 
        */
-      (void) sh_unix_getline (fd, key, (int)sizeof(key));
+      (void) sh_unix_getline (fd, key, (int)(  sizeof(key)-1));
       key[KEY_LEN] = '\0';
 
-      (void) sh_unix_getline (fd, number, (int)sizeof(number));
+      (void) sh_unix_getline (fd, number, (int)(sizeof(number)-1));
       number[(2*SH_MINIBUF) - 2]   = '\0';
       numsig = atol (number);
@@ -181,5 +196,5 @@
 	  if (numsig > 0)
 	    {
-	      fprintf (stderr, "%s",_("ERROR (no key -- cannot check)\n"));
+	      fprintf (stderr, _("ERROR (no key -- cannot check)\n"));
 	      continue;
 	    }
@@ -195,5 +210,5 @@
       else if (numsig == 0)
 	{
-	  fprintf (stderr, "%s",_("ERROR (repeated audit trail)\n"));
+	  fprintf (stderr, _("ERROR (repeated audit trail)\n"));
 	  continue;
 	}
@@ -204,10 +219,8 @@
 	  sh_util_encode(key, bufc, 1, 'A');
 	  (void) sl_strlcpy (mail_trail_ptr->trail_key, key, KEY_LEN+1);
-	  fprintf (stderr, "%s",_("(unchecked)\n"));
+	  fprintf (stderr, _("(unchecked)\n"));
 	}
       else
 	{
-	  char sigbuf[KEYBUF_SIZE];
-
 	  /* iterate key
 	   */
@@ -215,23 +228,20 @@
 	  for (i = 0; i < numsig; ++i) 
 	    {
-	      char hashbuf[KEYBUF_SIZE];
 	      (void) sl_strlcpy (key2, 
-				 sh_tiger_hash (key2, TIGER_DATA, KEY_LEN,
-						hashbuf, sizeof(hashbuf)), 
+				 sh_tiger_hash (key2, TIGER_DATA, KEY_LEN), 
 				 KEY_LEN+1);
 	    }
 	  
-	  theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc), 
-				   sigbuf, sizeof(sigbuf));
-
+
+	  theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc));
 	  if (sl_strncmp (key, 
 			  theSig,
 			  KEY_LEN) != 0) 
 	    {
-	      fprintf (stderr, "%s",_("(FAILED)\n"));
+	      fprintf (stderr, _("(FAILED)\n"));
 	    } 
 	  else 
 	    { 
-	      fprintf (stderr, "%s",_("(passed)\n"));
+	      fprintf (stderr, _("(passed)\n"));
 	    }
 
@@ -243,5 +253,285 @@
 }
 
-int sh_mail_setNum (const char * str)
+#define SH_FILT_NUM 32
+#define SH_FILT_OR  0
+#define SH_FILT_AND 1
+#define SH_FILT_NOT 2
+#define SH_FILT_INIT { 0, { NULL }, 0, { NULL }, 0, { NULL }}
+
+typedef struct _sh_filter_type
+{
+  int      for_c;
+  char   * for_v[SH_FILT_NUM];
+  int      fand_c;
+  char   * fand_v[SH_FILT_NUM];
+  int      fnot_c;
+  char   * fnot_v[SH_FILT_NUM];
+
+} sh_filter_type;
+
+static
+int sh_filter_filteradd (char * argstring, sh_filter_type * filter, int ftype)
+{
+  int     i = 0;
+  int     flag = 0;
+  size_t  s;
+
+  char  * dup;
+  char  * p;
+  char  * end;
+  int   * ntok;
+  char ** stok;
+
+  SL_ENTER(_("sh_filter_filteradd"));
+
+  if (NULL == argstring)
+    {
+      SL_RETURN((-1), _("sh_filter_filteradd")); 
+    }
+
+  if (ftype == SH_FILT_OR) {
+    ntok = &(filter->for_c);
+    stok = filter->for_v;
+  }
+  else if (ftype == SH_FILT_AND) {
+    ntok = &(filter->fand_c);
+    stok = filter->fand_v;
+  }
+  else if (ftype == SH_FILT_NOT) {
+    ntok = &(filter->fnot_c);
+    stok = filter->fnot_v;
+  }
+  else {
+    SL_RETURN((-1), _("sh_filter_filteradd")); 
+  }
+
+  *ntok = 0;
+
+  dup = sh_util_strdup(argstring);
+  p   = dup;
+
+  do
+    {
+      while (*p == ',' || *p == ' ' || *p == '\t')
+	++p;
+      if (*p == '\0')
+	break;
+
+      end = p; ++end;
+      if (*end == '\0')
+	break;
+
+      if (*p == '\'')
+	{
+	  ++p; end = p; ++end;
+	  if (*p == '\0' || *end == '\0')
+	    break;
+	  while (*end != '\0' && *end != '\'')
+	    ++end;
+	}
+      else if (*p == '"')
+	{
+	  ++p; end = p; ++end;
+	  if (*p == '\0' || *end == '\0')
+	    break;
+	  while (*end != '\0' && *end != '"')
+	    ++end;
+	}
+      else
+	{
+	  while (*end != '\0' && *end != ',' && *end != ' ' && *end != '\t')
+	    ++end;
+	}
+      if (*end == '\0')
+	flag = 1;
+      else
+	*end = '\0';
+
+      s = strlen(p) + 1;
+      if (stok[i] != NULL)
+	SH_FREE(stok[i]);
+      stok[i] = SH_ALLOC(s);
+      (void) sl_strlcpy(stok[i], p, s);
+
+      p = end; ++p;
+
+      ++i;
+      if (i == SH_FILT_NUM)
+	break;
+    }
+  while (p != NULL && *p != '\0' && flag == 0);
+
+  *ntok = i;
+  SH_FREE(dup);
+
+  SL_RETURN (0, _("sh_filter_filteradd"));
+}
+
+/*
+ * -- check filters
+ */
+static 
+int sh_filter_filter (char * message, sh_filter_type * filter)
+{
+  int i;
+  int j = 0;
+
+  SL_ENTER(_("sh_mail_filter"));
+
+  /* Presence of any of these keywords prevents execution.
+   */
+  if (filter->fnot_c > 0)
+    {
+      for (i = 0; i < filter->fnot_c; ++i)
+	{
+	  if (NULL != sl_strstr(message, filter->fnot_v[i]))
+	    {
+	      SL_RETURN ((-1), _("sh_filter_filter"));
+	    }
+	}
+    }
+
+  /* Presence of all of these keywords is required for execution.
+   */
+  if (filter->fand_c > 0)
+    {
+      j = 0;
+
+      for (i = 0; i < filter->fand_c; ++i)
+	if (NULL != sl_strstr(message, filter->fand_v[i]))
+	  ++j;
+
+      if (j != filter->fand_c)
+	{
+	  SL_RETURN ((-1), _("sh_filter_filter"));
+	}
+    }
+
+  /* Presence of at least one of these keywords is required for execution.
+   */
+  if (filter->for_c > 0)
+    {
+      for (i = 0; i < filter->for_c; ++i)
+	{
+	  if (NULL != sl_strstr(message, filter->for_v[i]))
+	    {
+	      goto isok;
+	    }
+	}
+      SL_RETURN ((-1), _("sh_filter_filter"));
+    }
+
+ isok:
+  SL_RETURN ((0), _("sh_filter_filter"));
+}
+
+
+static sh_filter_type mail_filter = SH_FILT_INIT;
+
+/*
+ * -- add keywords to the OR filter
+ */
+int sh_mail_add_or (char * str)
+{
+  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_OR));
+}
+
+/*
+ * -- add keywords to the AND filter
+ */
+int sh_mail_add_and (char * str)
+{
+  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_AND));
+}
+
+/*
+ * -- add keywords to the NOT filter
+ */
+int sh_mail_add_not (char * str)
+{
+  return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_NOT));
+}
+
+
+static char * address_list[8] = { 
+  NULL, NULL, NULL, NULL, 
+  NULL, NULL, NULL, NULL 
+};
+
+static   int   address_num = 0;
+static   int   address_num_compiled = 0;
+static   int   setaddress_compiled = S_FALSE;
+
+void reset_count_dev_mail(void)
+{
+  /* if not, then we still have the compiled-in address (if any), so we
+   * don' touch them
+   */
+  if (address_num_compiled == -99)
+    address_num = 0;
+  return;
+}
+
+int sh_mail_setaddress (char * address)
+{
+  char     *     p;
+
+  SL_ENTER(_("sh_mail_setaddress"));
+  
+  if (0 == strcmp(address, _("NULL")))
+    SL_RETURN ( (0), _("sh_mail_setaddress"));
+    
+  if (address != NULL && address_num < (2 * SH_PATHBUF / 64 )) 
+    {
+      if (address_num < (SH_PATHBUF / 64 ))
+	p = &sh.srvmail.name[address_num*64];
+      else
+	p = &sh.srvmail.alt[address_num*64];
+
+      (void) sl_strlcpy (p, address, 64);
+      
+      if ((p == NULL) || ( sl_strlen(address) != sl_strlen(p)))
+	{
+	  memset(p, (int)'\0', 64);
+	  SL_RETURN ( (-1), _("sh_mail_setaddress"));
+	}
+      address_list[address_num] = p;
+#if 0
+      if (!sl_is_suid())
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<address_list[%d] = %s>\n"), 
+		address_num, address_list[address_num]));
+	}
+#endif
+      if (setaddress_compiled == S_TRUE)
+	{
+	  ++address_num;
+	  ++address_num_compiled;
+	}
+      else
+	{
+	  if (address_num == address_num_compiled)
+	    {
+	      address_num = 0;
+	      address_num_compiled = -99;
+	    }
+	  ++address_num;
+	}
+      SL_RETURN ( (0), _("sh_mail_setaddress"));
+    }
+  SL_RETURN ( (-1), _("sh_mail_setaddress"));
+}
+
+int sh_mail_setaddress_int (char * address)
+{
+  int i;
+  SL_ENTER(_("sh_mail_setaddress_int"));
+  setaddress_compiled = S_TRUE;
+  i = sh_mail_setaddress(address);
+  setaddress_compiled = S_FALSE;
+  SL_RETURN(i, _("sh_mail_setaddress_int"));
+}
+
+int sh_mail_setNum (char * str)
 {
   int i = atoi (str);
@@ -257,11 +547,11 @@
 
 
-int sh_mail_all_in_one = S_FALSE;
-
-int sh_mail_setFlag (const char * str)
+static int all_in_one = S_FALSE;
+
+int sh_mail_setFlag (char * str)
 {
   int i;
   SL_ENTER(_("sh_mail_setFlag"));
-  i = sh_util_flagval(str, &sh_mail_all_in_one);
+  i = sh_util_flagval(str, &all_in_one);
   SL_RETURN(i, _("sh_mail_setFlag"));
 }
@@ -269,5 +559,5 @@
 static char * mail_subject = NULL;
 
-int set_mail_subject (const char * str)
+int set_mail_subject (char * str)
 {
   SL_ENTER(_("set_mail_subject"));
@@ -288,7 +578,6 @@
 }
 
-SH_MUTEX_INIT(mutex_fifo_mail, PTHREAD_MUTEX_INITIALIZER);
-
-SH_FIFO * fifo_mail = NULL;
+
+static SH_FIFO * fifo_mail = NULL;
 
 static
@@ -303,5 +592,4 @@
     SL_RET0(_("sh_mail_emptystack"));
 
-  SH_MUTEX_LOCK(mutex_fifo_mail);
   while (NULL != (msg = pop_list(fifo_mail)))
     {
@@ -310,5 +598,4 @@
       SH_FREE(msg);
     }
-  SH_MUTEX_UNLOCK(mutex_fifo_mail);
 
   SL_RET0(_("sh_mail_emptystack"));
@@ -317,25 +604,26 @@
 /* insert "\r\n" after each 998 char
  */
-static char * split_string(const char * str);
-
-/* fixes warning: variable âpâ might be clobbered by âlongjmpâ or âvforkâ*/
-static char ** p_dummy;
-
-int sh_mail_pushstack (int severity, const char * msg, const char * alias)
+static char * split_string(char * str);
+
+int sh_mail_pushstack (/*@null@*/char * msg)
 {
   char * p;
-  volatile int    retval = 0;
+  int    retval = 0;
   int    status;
 
   SL_ENTER(_("sh_mail_pushstack"));
 
-  if (msg == NULL || failedMail == S_TRUE /* || sh.srvmail.name[0] == '\0' */) 
+  if (msg == NULL || failedMail == SL_TRUE || sh.srvmail.name[0] == '\0') 
     SL_RETURN((0), (_("sh_mail_pushstack")));
 
+  if (0 != sh_filter_filter(msg, &mail_filter))
+    SL_RETURN((0), (_("sh_mail_pushstack")));
+
+#if 0
+  if (msg != NULL && sl_strlen(msg) > 998)  /* RFC 2822 */
+    msg[998] = '\0';
+#endif
+
   p = split_string(msg);
-  /* fixes "variable âpâ might be clobbered by âlongjmpâ or âvforkâ" */
-  p_dummy = &p;
-
-  SH_MUTEX_LOCK(mutex_fifo_mail);
 
   if (fifo_mail == NULL)
@@ -344,7 +632,6 @@
       fifo_init(fifo_mail);
     }
-  status = push_list (fifo_mail, p, severity, alias);
-  SH_MUTEX_UNLOCK(mutex_fifo_mail);
-
+
+  status = push_list (fifo_mail, p);
   if (status >= 0)
     ++sh.mailNum.alarm_last;
@@ -354,6 +641,6 @@
   if (sh.mailNum.alarm_last >= sh.mailNum.alarm_interval)
     {
-      BREAKEXIT(sh_nmail_flush);
-      retval = sh_nmail_flush ();
+      BREAKEXIT(sh_mail_msg);
+      retval = sh_mail_msg (NULL);
     }
 
@@ -366,9 +653,9 @@
 /* The mailer.
  */
-static int sh_mail_end_conn (FILE * connfile, int fd);
-static FILE * sh_mail_start_conn (struct alias * address, int * fd, int * anum);
+static int sh_mail_end_conn (FILE * connfile);
+static FILE * sh_mail_start_conn (int aFlag);
 
 static
-void sh_mail_get_subject(const char * message,
+void sh_mail_get_subject(char * message,
 			 char * mheader, size_t len)
 {
@@ -384,5 +671,4 @@
   char * mptr;
   char   sev[8];
-  char * msg;
 
   SL_ENTER(_("sh_mail_get_subject"));
@@ -401,7 +687,5 @@
   /* fast forward to the important part
    */
-  msg  = sh_util_strdup(message);
-
-  mptr = sl_strstr(msg, _("msg="));
+  mptr = sl_strstr(message, _("msg="));
   if (mptr)
     {
@@ -410,7 +694,7 @@
     }
   else
-    rep_serv_tab[2].data_str   = msg;
-
-  mptr = sl_strstr(msg, _("sev="));
+    rep_serv_tab[2].data_str   = message;
+
+  mptr = sl_strstr(message, _("sev="));
   if (mptr)
     {
@@ -424,5 +708,5 @@
   else
     {
-      mptr = msg;
+      mptr = message;
       sev[0] = *mptr; ++mptr;
       sev[1] = *mptr; ++mptr;
@@ -447,120 +731,103 @@
   (void) sl_strlcat(mheader, p, len);
   SH_FREE(p);
-  SH_FREE(msg);
   SL_RET0(_("sh_mail_get_subject"));
 }
 
-sh_string * sh_mail_signature_block (sh_string  * sigMsg, char * recipient,
-				     char * bufcompress)
-{
-  time_t         id_audit;
-  char         * theSig;
-  char ibuf[80];
-  unsigned int count;
-
-  /* ------ signature block ------------------------------------ */
-  
-  sigMsg = sh_string_add_from_char(sigMsg, 
-				   _("-----BEGIN SIGNATURE-----\r\n"));
-  
-  count  = sh_nmail_get_mailkey (recipient, skey->mailkey_new, KEY_LEN+1,
-				 &id_audit);
-  
-  if (count != 0)
-    {
-      char sigbuf[KEYBUF_SIZE];
-      
-      /* Sign the message with the signature key.
-       */
-      theSig = sh_util_siggen (skey->mailkey_new, 
-			       bufcompress, sl_strlen(bufcompress),
-			       sigbuf, sizeof(sigbuf));
-      sigMsg = sh_string_add_from_char(sigMsg, theSig);
-    }
-  else
-    {
-       /* reveal first signature key
-       */
-      /* flawfinder: ignore */
-      (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1); 
-      
-      BREAKEXIT(sh_util_encode);
-      /* flawfinder: ignore */
-      sh_util_encode(skey->crypt, bufcompress, 0, 'A');
-      
-      /* flawfinder: ignore */
-      sigMsg     = sh_string_add_from_char(sigMsg, skey->crypt);
-      
-      /* flawfinder: ignore */
-      memset (skey->crypt, 0, KEY_LEN);
-    }
-
-    sigMsg     = sh_string_add_from_char(sigMsg, "\r\n");
-
-    sl_snprintf(ibuf, sizeof(ibuf), _("%06u %010lu::%s\r\n"),
-		count, (unsigned long) id_audit, sh.host.name);
-
-    sigMsg     = sh_string_add_from_char(sigMsg, ibuf);
-    sigMsg     = sh_string_add_from_char(sigMsg, _("-----END MESSAGE-----"));
-
-    return sigMsg;
-}
-
-int sh_mail_msg (const char * message)
+
+#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
+#include <sys/mman.h>
+#endif
+
+static char * sh_mail_realloc (char * inbuf, size_t * insize, size_t increase)
+{
+  size_t newsize = (*insize) + increase + 1;
+  char * outbuf;
+
+  SL_ENTER(_("sh_mail_realloc"));
+
+  outbuf = SH_ALLOC(newsize);
+  MLOCK(outbuf, newsize);
+  (void) sl_strlcpy(outbuf, inbuf, newsize);
+
+  memset (inbuf, 0, (*insize));
+  MUNLOCK(inbuf, (*insize));
+  SH_FREE(inbuf);
+
+  *insize = newsize;
+
+  SL_RETURN( (outbuf), _("sh_mail_realloc"));
+}
+
+int sh_mail_msg (/*@null@*/char * message)
 {
     char         subject[32+32+SH_MINIBUF+2+3+SH_PATHBUF];
     char         mheader[32+32+SH_MINIBUF+2+3];
 
-    sh_string  * mailMsg;
-    sh_string  * compMsg;
-    int          status = 0;
-    volatile int errcount;
+    char       * mailMsg;
+    char       * popMsg;
+    int          status = 0, errcount;
     size_t       wrlen;
-    volatile int retval = -1;  
+    int          i;
+    int          num_popped = 0;
+    int          retval = -1;  
 
     char       * bufcompress;
-    size_t       compressed;
-
     static int   failcount = 0;
+    static int   isfirst   = 1;
+    static int   mailcount = 0;
     FILE       * connfile  = NULL;
 
+    struct  sigaction  old_act;
+    struct  sigaction  new_act;
+
+    static  time_t id_audit  = 0;
     static  time_t fail_time = 0;
     static  time_t success_time = 0;
 
-    int       ma_socket = -1;
-
-    int            address_num = 0;
-    sh_string    * theMsg = NULL;
+    static  int ma_block = 0;
+
+    SH_FIFO * fifo_temp = NULL;
+
+    char    * theSig;
+    char    * theMsg = NULL;
 
     /* #define SH_MAILBUF (256)    */
-#define SH_MAILBUF 4096 
-
-    char      timebuf[81];
+#define SH_MAILBUF (8*4096) 
+
+    size_t    msgbufsize = SH_MAILBUF;
+    size_t    combufsize = SH_MAILBUF;
 
     SL_ENTER(_("sh_mail_msg"));
 
-    /* 
-     * Return if we cannot mail.
+    if (ma_block == 1)
+      SL_RETURN( (0), _("sh_mail_msg"));
+
+    /* Return if we cannot mail.
      */
-    if (failedMail == S_TRUE) 
+    if (failedMail == SL_TRUE) 
       SL_RETURN((-1), _("sh_mail_msg"));
 
-    /*
-     * Final failure, can't mail for SH_MAX_FAIL hours.
-     */
+    if (failedMail == SL_FALSE && address_list[0] == NULL)
+      {
+	TPT((0, FIL__, __LINE__, 
+	     _("msg=<Mail error: no recipient address.>\n")));
+	failedMail = SL_TRUE;
+	SL_RETURN((-1), _("sh_mail_msg"));
+      }
+
     if ( (success_time > 0) && (fail_time > 0) &&
 	 (time(NULL) - success_time) > 3600*SH_MAX_FAIL)
       {
+	ma_block = 1;
 	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
-			 _("mail"), 
-			 sh_string_str(all_recipients->recipient));
+			 _("mail"), address_list[0]);
+	ma_block = 0;
 	sh_mail_emptystack();
 	sh.mailNum.alarm_last = 0;
-	failedMail = S_TRUE;
+	failedMail = SL_TRUE;
 	SL_RETURN((-1), _("sh_mail_msg"));
       }
 
-    /*
-     * Try at most every three seconds to mail if there was a failure.
+    /* Try at most each hour.
      */
     if ((fail_time > 0) && (time(NULL) - fail_time) < 3/*600*/)
@@ -568,10 +835,10 @@
 	if (failcount > 3)
 	  {
-	    /* -- Save for later. Changed: done by caller. -- 
-	     *	    sh_nmail_pushstack (severity, message, alias);
+	    /* -- Save for later. -- 
 	     */
+	    sh_mail_pushstack (message);
 	    ++failcount;
 	    
-	    SL_RETURN((-2), _("sh_mail_msg"));
+	    SL_RETURN((-1), _("sh_mail_msg"));
 	  }
 	else
@@ -586,15 +853,19 @@
     fail_time = 0;
 
+    /* -- Polling, empty queue. --
+     */
+    if (message == NULL && sh.mailNum.alarm_last == 0)
+      SL_RETURN((-1), _("sh_mail_msg"));
+
+    /* -- Filtered. --
+     */
+    if (message != NULL && 0 != sh_filter_filter(message, &mail_filter))
+      SL_RETURN((-1), (_("sh_mail_msg")));
+
+
 
     /* ---------  Build complete message. ------------------------ */
 
-    /* Don't flush the queue here, because tag_list doesn't know
-     * how to filter messages. */
-
-    theMsg = sh_string_new_from_lchar(message, sl_strlen(message));
-    if (!theMsg)
-      {
-	SL_RETURN((-1), _("sh_mail_msg"));
-      }
+    theMsg = split_string(message);
 
     /* ---------- Header  ---------------------------------------- */
@@ -603,7 +874,5 @@
       {
 	(void) sl_strlcpy(mheader, _("Subject: "),       sizeof(mheader)-5);
-	(void) sl_strlcat(mheader, 
-			  sh_unix_time (0, timebuf, sizeof(timebuf)),
-			  sizeof(mheader)-5);
+	(void) sl_strlcat(mheader, sh_unix_time (0),     sizeof(mheader)-5);
 	(void) sl_strlcat(mheader, " ",                  sizeof(mheader)-5);
 	(void) sl_strlcat(mheader, sh.host.name,         sizeof(mheader)-5);
@@ -611,4 +880,12 @@
     else
       {
+	
+	if (message == NULL)
+	  {
+	    theMsg  = pop_list(fifo_mail);
+	    message = theMsg;
+	    if (message)
+	      --sh.mailNum.alarm_last;
+	  }
 	
 	if (message)
@@ -619,7 +896,5 @@
 	  {
 	    (void) sl_strlcpy(mheader, _("Subject: "),     sizeof(mheader)-5);
-	    (void) sl_strlcat(mheader, 
-			      sh_unix_time (0, timebuf, sizeof(timebuf)),
-			      sizeof(mheader)-5);
+	    (void) sl_strlcat(mheader, sh_unix_time (0),   sizeof(mheader)-5);
 	    (void) sl_strlcat(mheader, " ",                sizeof(mheader)-5);
 	    (void) sl_strlcat(mheader, sh.host.name,       sizeof(mheader)-5);
@@ -633,6 +908,5 @@
     /* ---------- Message  --------------------------------------- */
 
-    (void) sl_strlcpy(subject, sh_unix_time (0, timebuf, sizeof(timebuf)),
-		      sizeof(subject));
+    (void) sl_strlcpy(subject, sh_unix_time (0),          sizeof(subject));
     (void) sl_strlcat(subject, " ",                       sizeof(subject));
     (void) sl_strlcat(subject, sh.host.name,              sizeof(subject));
@@ -640,139 +914,195 @@
 
 
-    mailMsg     = sh_string_new (SH_MAILBUF);
-    compMsg     = sh_string_new (SH_MAILBUF);
-
-    mailMsg     = sh_string_add_from_char(mailMsg, mheader);
-    mailMsg     = sh_string_add_from_char(mailMsg, 
-					  _("-----BEGIN MESSAGE-----\r\n"));
-
-    mailMsg     = sh_string_add_from_char(mailMsg, subject);
-    mailMsg     = sh_string_add          (mailMsg, theMsg);
-    mailMsg     = sh_string_add_from_char(mailMsg, "\r\n");
-
-    /* ---------- Compressed Message  ---------------------------- */
-
-    compMsg     = sh_string_add_from_char(compMsg, subject);
-    compMsg     = sh_string_add          (compMsg, theMsg);
-    compMsg     = sh_string_add_from_char(compMsg, "\r\n");
-
-    bufcompress = SH_ALLOC(sh_string_len(compMsg) + KEY_LEN + 1);
+    mailMsg     = (char *) SH_ALLOC (msgbufsize);
+    bufcompress = (char *) SH_ALLOC (combufsize);
+
+    MLOCK(mailMsg     , msgbufsize);
+    MLOCK(bufcompress , combufsize);
+
+    (void) sl_strlcpy(mailMsg, mheader, msgbufsize);
     bufcompress[0] = '\0';
 
-    compressed = sh_util_compress (bufcompress, 
-				   sh_string_str(compMsg), 
-				   sh_string_len(compMsg) + 1);
+    (void) sl_strlcat(mailMsg, _("-----BEGIN MESSAGE-----\r\n"), msgbufsize);
+    (void) sl_strlcat(mailMsg, subject, msgbufsize);
+    (void) sh_util_compress (bufcompress, subject, 
+			     (combufsize - KEY_LEN - 1));
+    if (message != NULL)
+      {
+	if ((sl_strlen(theMsg) + sl_strlen(mailMsg) + 1) > 
+	    (msgbufsize-(4*KEY_LEN)))
+	  {
+	    mailMsg     = sh_mail_realloc(mailMsg,     
+					  &msgbufsize, sl_strlen(theMsg)+2);
+	    bufcompress = sh_mail_realloc(bufcompress, 
+					  &combufsize, sl_strlen(theMsg));
+	  }
+	(void) sl_strlcat(mailMsg,  theMsg, msgbufsize-(4*KEY_LEN));
+	(void) sl_strlcat(mailMsg,  "\r\n", msgbufsize-(4*KEY_LEN));
+
+	(void) sh_util_compress (bufcompress,  theMsg, combufsize-KEY_LEN-1);
+      }
+
+    if (sh.mailNum.alarm_last > 0)
+      {
+	fifo_temp = SH_ALLOC (sizeof(SH_FIFO));
+	fifo_init (fifo_temp);
+
+	while ( NULL != (popMsg = pop_list(fifo_mail)) )
+	  {
+	    (void) push_list (fifo_temp, popMsg);
+
+	    if ((sl_strlen(popMsg) + sl_strlen(mailMsg) + 1) > 
+		(msgbufsize-(4*KEY_LEN)))
+	      {
+		mailMsg     = sh_mail_realloc(mailMsg,     
+					      &msgbufsize, 
+					      sl_strlen(popMsg)+2);
+		bufcompress = sh_mail_realloc(bufcompress, 
+					      &combufsize, 
+					      sl_strlen(popMsg));
+	      }
+
+	    (void) sl_strlcat(mailMsg, popMsg, msgbufsize-(4*KEY_LEN));
+	    (void) sl_strlcat(mailMsg, "\r\n", msgbufsize-(4*KEY_LEN));
+	    (void) sh_util_compress(bufcompress, popMsg, combufsize-KEY_LEN-1);
+	    SH_FREE(popMsg);
+	    --sh.mailNum.alarm_last;
+	    ++num_popped;
+	  }
+      }
+
+    /* ------ signature block ------------------------------------ */
+    
+    (void) sl_strlcat(mailMsg, _("-----BEGIN SIGNATURE-----\r\n"), msgbufsize);
+
+    /* Generate new signature key.
+     */
+    if (isfirst == 1)
+      {
+	BREAKEXIT(sh_util_keyinit);
+	(void) sh_util_keyinit (skey->mailkey_old, KEY_LEN+1);
+      }
+
+    /* iterate the key
+     */
+    (void) sl_strlcpy(skey->mailkey_new,
+		      sh_tiger_hash (skey->mailkey_old, TIGER_DATA, KEY_LEN),
+		      KEY_LEN+1);
+
+    if (isfirst == 0)
+      {
+        /* Sign the message with the signature key.
+         */
+	theSig = sh_util_siggen (skey->mailkey_new, 
+				 bufcompress, sl_strlen(bufcompress));
+	(void) sl_strlcat (mailMsg, 
+			   theSig,
+			   msgbufsize);
+      }
+    else
+      {
+        id_audit = time (NULL);
+
+        /* reveal first signature key
+         */
+        (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1);
+
+	BREAKEXIT(sh_util_encode);
+        sh_util_encode(skey->crypt, bufcompress, 0, 'A');
+
+        (void) sl_strlcat (mailMsg, skey->crypt, msgbufsize);
+        memset (skey->crypt, 0, KEY_LEN);
+        isfirst = 0;
+      }
+    (void) sl_strlcat (mailMsg, "\r\n", msgbufsize);
+
+    /* X(n) -> X(n-1)
+     */
+    (void) sl_strlcpy (skey->mailkey_old, skey->mailkey_new, KEY_LEN+1);
+
+    /*@-bufferoverflowhigh@*/
+    sprintf(subject, _("%06d %010ld::%s\r\n"),         /* known to fit  */
+            mailcount, (long) id_audit, sh.host.name);
+    /*@+bufferoverflowhigh@*/
+
+    (void) sl_strlcat (mailMsg, subject, msgbufsize);
+    ++mailcount;
+
+    (void) sl_strlcat (mailMsg, _("-----END MESSAGE-----"), msgbufsize);
+
+
 
     /* ---------- Connect ---------------------------------------- */
 
+
+
+    /* -- Catch (ignore) 'broken pipe'.
+     */
+    new_act.sa_handler = SIG_IGN;
+    sigemptyset( &new_act.sa_mask );         /* set an empty mask       */
+    new_act.sa_flags = 0;                    /* init sa_flags           */
+
+    (void) sigaction (SIGPIPE, &new_act, &old_act);
+
+    i        = 0;
     errcount = 0;
 
-    if (sh_mail_all_in_one == S_FALSE)
+    if (all_in_one == S_FALSE)
       {
-	struct alias * address_list;
-
-	address_list = all_recipients;
-
-	while (address_list)
+	while (address_list[i] != NULL && i < address_num)
 	  {
-	    if (address_list->send_mail == 1)
+	    connfile = sh_mail_start_conn (i);
+	    
+	    if (NULL != connfile)
 	      {
-		connfile = sh_mail_start_conn (address_list, 
-					       &ma_socket, &address_num);
-	    
-		if (NULL != connfile)
-		  {
-		    wrlen = fwrite (sh_string_str(mailMsg), 1, 
-				    sh_string_len(mailMsg), connfile);
-		    wrlen -= sh_string_len(mailMsg);
-
-		    if (wrlen == 0)
-		      {
-			sh_string  * sigMsg  = sh_string_new (0);
-
-			sigMsg = sh_mail_signature_block (sigMsg, 
-							  sh_string_str(address_list->recipient),
-							  bufcompress);
-
-			wrlen = fwrite (sh_string_str(sigMsg), 1, 
-					sh_string_len(sigMsg), connfile);
-			wrlen -= sh_string_len(sigMsg);
-
-			sh_string_destroy(&sigMsg);
-		      }
-
-		    if (wrlen == 0) 
-		      status = sh_mail_end_conn (connfile, ma_socket);
-		    else
-		      status = -1;
-		  }
-		if (NULL == connfile ||  status != 0)
-		  {
-		    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
-				     _("mail"), 
-				     sh_string_str(address_list->recipient));
-		    ++errcount;
-		    ++sh.statistics.mail_failed;
-		  }
+		wrlen = fwrite (mailMsg, 1, sl_strlen(mailMsg), 
+				 connfile);
+		wrlen -= sl_strlen(mailMsg);
+		if (wrlen == 0) 
+		  status = sh_mail_end_conn (connfile);
 		else
-		  {
-		    ++sh.statistics.mail_success;
-		  }
-		
-		if (connfile != NULL)
-		  {
-		    (void) sl_fclose (FIL__, __LINE__, connfile);
-		    connfile = NULL;
-		  }
+		  status = -1;
 	      }
-	    address_list = address_list->all_next;
+	    if (NULL == connfile ||  status != 0)
+	      {
+		ma_block = 1;
+		sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
+				 _("mail"), address_list[i]);
+		ma_block = 0;
+		++errcount;
+		++sh.statistics.mail_failed;
+	      }
+	    else
+	      {
+		++sh.statistics.mail_success;
+	      }
+
+	    if (connfile != NULL)
+	      {
+		(void) fclose (connfile);
+		connfile = NULL;
+	      }
+	    ++i;
 	  }
       }
     else
       {
-	connfile = sh_mail_start_conn (NULL, &ma_socket, &address_num);
-
+	connfile = sh_mail_start_conn ( -9 );
+	
 	if (NULL != connfile)
 	  {
-	    wrlen = fwrite (sh_string_str(mailMsg), 1, 
-			    sh_string_len(mailMsg), connfile);
-	    wrlen -= sh_string_len(mailMsg);
-
+	    wrlen = fwrite (mailMsg, 1, sl_strlen(mailMsg), connfile);
+	    wrlen -= sl_strlen(mailMsg);
 	    if (wrlen == 0)
-	      {
-		sh_string  * sigMsg  = sh_string_new (0);
-		
-		sigMsg  = sh_mail_signature_block (sigMsg, 
-						   NULL,
-						   bufcompress);
-		
-		wrlen = fwrite (sh_string_str(sigMsg), 1, 
-				sh_string_len(sigMsg), connfile);
-		wrlen -= sh_string_len(sigMsg);
-		
-		sh_string_destroy(&sigMsg);
-	      }
-
-	    if (wrlen == 0)
-	      status = sh_mail_end_conn (connfile, ma_socket);
+	      status = sh_mail_end_conn (connfile);
 	    else
 	      status = -1;
 	  }
-
-	if (NULL == connfile || status != 0)
+	if (NULL == connfile ||  status != 0)
 	  {
-	    struct alias* ma_address = all_recipients;
-
-	    while (ma_address)
-	      {
-		if (ma_address->send_mail == 1)
-		  break;
-		ma_address = ma_address->all_next;
-	      }
-
-	    if (ma_address)
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
-			       _("mail"), 
-			       sh_string_str(ma_address->recipient));
+	    ma_block = 1;
+	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
+			     _("mail"), address_list[0]);
+	    ma_block = 0;
 	    errcount = address_num;
 	    ++sh.statistics.mail_failed;
@@ -785,31 +1115,65 @@
 	if (connfile != NULL)
 	  {
-	    (void) sl_fclose (FIL__, __LINE__, connfile);
+	    (void) fclose (connfile);
 	    connfile = NULL;
 	  }
       }
+
     
-    memset (bufcompress, 0, compressed);
+    memset (bufcompress, 0, combufsize);
+    MUNLOCK(bufcompress , combufsize);
     SH_FREE(bufcompress);
 
-    memset (sh_string_str(mailMsg), 0, sh_string_len(mailMsg));
-    memset (sh_string_str(compMsg), 0, sh_string_len(compMsg));
-    memset (sh_string_str(theMsg),  0, sh_string_len(theMsg));
-
-    sh_string_destroy(&mailMsg);
-    sh_string_destroy(&compMsg);
-    sh_string_destroy(&theMsg);
+    memset (mailMsg, 0, msgbufsize);
+    MUNLOCK(mailMsg , msgbufsize);
+    SH_FREE(mailMsg);
 
     /* --- Stay responsible for delivery in case of failure --- */
 
-    if (errcount == address_num)
+    if (errcount == address_num && fifo_temp != NULL)
       {
-	rollback_list(fifo_mail);
-	retval = -3;
+        while ( (NULL != (popMsg = pop_list(fifo_temp))) )
+          {
+            if (push_list (fifo_mail, popMsg) >= 0)
+	      ++sh.mailNum.alarm_last;
+            SH_FREE(popMsg);
+          }
+	if (message != NULL)
+	  {
+	    if (fifo_mail == NULL)
+	      {
+		fifo_mail = SH_ALLOC(sizeof(SH_FIFO));
+		fifo_init(fifo_mail);
+	      }
+	    retval = push_list (fifo_mail,  theMsg);
+	    if (retval >= 0) 
+	      ++sh.mailNum.alarm_last;
+	    if (retval == SH_FIFO_MAX)
+	      retval = -2;
+	    else
+	      retval = -1;
+	  }
       }
-    else
+    else if (fifo_temp != NULL)
       {
-	mark_list(fifo_mail);
+        while ( (NULL != (popMsg = pop_list(fifo_temp))) )
+          {
+            SH_FREE(popMsg);
+          }
       }
+    if (fifo_temp != NULL)
+      SH_FREE(fifo_temp);
+
+    /*
+    if (connfile != NULL) 
+      fclose (connfile);
+    */
+
+    if (theMsg != NULL)
+      SH_FREE(theMsg);
+
+    /* --- Reset signal. ---
+     */
+    (void) sigaction (SIGPIPE, &old_act, NULL);
 
     if (errcount == address_num)
@@ -818,5 +1182,4 @@
 	SL_RETURN((retval), _("sh_mail_msg"));
       }
-
     success_time = time(NULL);
     failcount = 0;
@@ -855,10 +1218,12 @@
 #endif
 
-static int sh_mail_wait(int code, int ma_socket);
+static int sh_mail_wait(int code, FILE * m_socket);
 
 static char * relay_host = NULL;
 
-int sh_mail_set_relay (const char * str_s)
-{
+int sh_mail_set_relay (char * str_s)
+{
+  size_t i = 0;
+
   SL_ENTER(_("sh_mail_set_relay"));
 
@@ -867,16 +1232,18 @@
 
   if (relay_host != NULL)
-    {
-      SH_FREE (relay_host);
+    SH_FREE (relay_host);
+
+  if (0 == sl_strncmp(str_s, _("NULL"), 4))
+    {
       relay_host = NULL;
-    }
-
-  if (0 == sl_strncmp(str_s, _("NULL"), 4))
-    {
       SL_RETURN( 0, _("sh_mail_set_relay"));
     }
 
-  relay_host = sh_util_strdup(str_s);
-
+  i = sl_strlen(str_s) + 1;
+  relay_host = SH_ALLOC (i);
+  if (relay_host != NULL)
+    (void) sl_strlcpy(relay_host, str_s, i);
+  else
+    fprintf(stderr, _("ERROR:  sh_mail_set_relay: Out of memory"));
   SL_RETURN( 0, _("sh_mail_set_relay"));
 }
@@ -884,5 +1251,5 @@
 static char * mail_sender = NULL;
 
-int sh_mail_set_sender (const char *str)
+int sh_mail_set_sender (char *str)
 {
   if (mail_sender != NULL) 
@@ -902,42 +1269,16 @@
 }
 
-static int sh_mail_port = IPPORT_SMTP;
-
-int sh_mail_set_port (const char * str)
-{
-  int i = atoi (str);
-  
-  SL_ENTER(_("sh_mail_set_port"));
-  
-  if (i >= 0 && i < 65535)
-    { 
-      sh_mail_port = i;
-    }
-  else
-    {
-      sh_mail_port = IPPORT_SMTP;
-      SL_RETURN ((-1), _("sh_mail_set_port"));
-    }
-  
-  SL_RETURN( (0), _("sh_mail_set_port"));
-}
 
 /*************************
  *
  * start connection
- * for details on SMTP, see RFC 821
- *
- * If ma_address == NULL, will send to all marked with
- * send_mail=1 in recipient list, else to ma_address.   
+ * for details on SMTP, see RFC 821 
  */
 
 static time_t time_wait = 300;
-static void report_smtp (char * reply);
-
-static FILE * sh_mail_start_conn (struct alias * ma_address, 
-				  int * ma_socket, int * anum)
+
+static FILE * sh_mail_start_conn (int aFlag)
 {
   char       * address;
-  int          aFlag = 0;
 
   int          ecount;
@@ -952,7 +1293,4 @@
   FILE       * connFile = NULL;
   struct tm  * my_tm;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  struct tm    time_tm;
-#endif
   time_t       my_time;
   char         my_tbuf[128];
@@ -965,32 +1303,21 @@
   SL_ENTER(_("sh_mail_start_conn"));
 
-  *ma_socket = -1;
-  time_wait  = 300;
-
-  if (ma_address == NULL)
-    {
-      aFlag = 1;
-      ma_address = all_recipients;
-
-      while (ma_address)
-	{
-	  if (ma_address->send_mail == 1)
-	    break;
-	  ma_address = ma_address->all_next;
-	}
-    }
-
-  if (!ma_address)
+  time_wait = 300;
+
+  if (aFlag >= 0)
+    address = address_list[aFlag];
+  else
+    address = address_list[0];
+
+  TPT(( 0, FIL__, __LINE__, _("msg=<aFlag %d address %s>\n"), 
+	aFlag, address)); 
+
+  /* -------   split adress ------------------  */
+
+  if (0 == strcmp(address, _("NULL")))
     {
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     } 
-
-  address = sh_string_str(ma_address->recipient);
-
-  TPT(( 0, FIL__, __LINE__, _("msg=<address %s>\n"), 
-	address)); 
-
-  /* -------   split adress ------------------  */
-
+    
   if (strchr (address, '@') == NULL) {
     (void) sl_strlcpy(ma_user,    address,     256);
@@ -1002,5 +1329,5 @@
       ++i;
     }
-    
+
     /* adress[i] = '@' 
      */
@@ -1024,16 +1351,10 @@
       TPT((0, FIL__, __LINE__, _("msg=<user %s machine %s>\n"), 
 	   ma_user, ma_machine)); 
-      fd = connect_port (ma_machine, sh_mail_port, 
+      fd = connect_port (ma_machine, IPPORT_SMTP, 
 			 error_call, &error_num, error_msg, 256);
     }
   else
     {
-      answers = ma_address->mx_list;
-      if (!answers)
-	{
-	  answers = return_mx (ma_machine);
-	  ma_address->mx_list = answers;
-	}
-
+      answers = return_mx (ma_machine);
       if (answers)
 	{
@@ -1047,9 +1368,10 @@
 		   _("msg=<user %s mx %s pref %d>\n"), 
 		   ma_user, ma_machine, result[i].pref));
-	      fd = connect_port (ma_machine, sh_mail_port, 
+	      fd = connect_port (ma_machine, IPPORT_SMTP, 
 				 error_call, &error_num, error_msg, 256);
 	      if (fd >= 0)
 		break;
 	    }
+	  (void) free_mx(answers);
 	}
       else
@@ -1078,5 +1400,5 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<fdopen() failed>\n")));
-      (void) sl_close_fd(FIL__, __LINE__, fd);
+      (void) close(fd);
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     }
@@ -1085,5 +1407,5 @@
   /* say HELO to the other socket
    */
-  if (0 == sh_mail_wait (220, fd)) 
+  if (0 == sh_mail_wait (220, connFile)) 
     {
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
@@ -1092,5 +1414,5 @@
 		      _("mail"), sh.host.name);
       TPT(( 0, FIL__, __LINE__, _("msg=<Timeout>\n")));
-      (void) sl_fclose(FIL__, __LINE__, connFile);
+      (void) fclose(connFile);
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     }
@@ -1098,17 +1420,15 @@
   (void) fflush(connFile);
 
-  if (0 != sh_ipvx_is_numeric(sh.host.name))
-    {
-      sl_snprintf(error_msg, sizeof(error_msg), "HELO [%s]", 
-		  sh.host.name);
+  if (0 != is_numeric(sh.host.name))
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<HELO [%s]>%c%c"), 
+	    sh.host.name, 13, 10));
     }
   else
     {
-      sl_snprintf(error_msg, sizeof(error_msg), "HELO %s", 
-		  sh.host.name);
-    }
-  report_smtp(error_msg);
-
-  if (0 != sh_ipvx_is_numeric(sh.host.name))
+      TPT(( 0, FIL__, __LINE__, _("msg=<HELO %s>%c%c"), 
+	    sh.host.name, 13, 10));
+    }
+  if (0 != is_numeric(sh.host.name))
     fprintf(connFile, _("HELO [%s]%c%c"), sh.host.name, 13, 10);
   else
@@ -1117,5 +1437,5 @@
   (void) fflush(connFile);
 
-  if (0 == sh_mail_wait(250, fd)) 
+  if (0 == sh_mail_wait(250, connFile)) 
     {
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
@@ -1124,5 +1444,5 @@
 
       TPT(( 0, FIL__, __LINE__, _("msg=<Timeout.>\n")));
-      (void) sl_fclose(FIL__, __LINE__, connFile);
+      (void) fclose(connFile);
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     }
@@ -1135,5 +1455,5 @@
     {
       (void) sl_strlcat (this_address, "@", 256);
-      if (0 != sh_ipvx_is_numeric(sh.host.name))
+      if (0 != is_numeric(sh.host.name))
 	(void) sl_strlcat (this_address, _("example.com"), 256);
       else
@@ -1141,7 +1461,6 @@
     }
 
-  sl_snprintf(error_msg, sizeof(error_msg), "MAIL FROM:<%s>", 
-	      this_address);
-  report_smtp(error_msg);
+  TPT(( 0, FIL__, __LINE__,  _("msg=<MAIL FROM:<%s>>%c%c"), 
+	this_address, 13, 10));
 
   (void) fflush(connFile);
@@ -1151,5 +1470,5 @@
   (void) fflush(connFile);
 
-  if (0 == sh_mail_wait(250, fd)) 
+  if (0 == sh_mail_wait(250, connFile)) 
     {
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
@@ -1157,5 +1476,5 @@
 		      _("mail"), this_address);
       TPT(( 0, FIL__, __LINE__, _("msg=<Timeout.>\n")));
-      (void) sl_fclose(FIL__, __LINE__, connFile);
+      (void) fclose(connFile);
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     }
@@ -1163,9 +1482,8 @@
   /* tell them who to send mail to
    */
-  if (aFlag == 0)
-    {
-      sl_snprintf(error_msg, sizeof(error_msg), "RCPT TO:<%s>", 
-		  address);
-      report_smtp(error_msg);
+  if (aFlag >= 0)
+    {
+      TPT(( 0, FIL__, __LINE__,  _("msg=<RCPT TO:<%s>>%c%c"), 
+	    address, 13, 10)); 
 
       (void) fflush(connFile);
@@ -1173,5 +1491,5 @@
       (void) fflush(connFile);
 
-      if (0 == sh_mail_wait(250, fd)) 
+      if (0 == sh_mail_wait(250, connFile)) 
 	{
 	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
@@ -1179,52 +1497,35 @@
 			  _("mail"), address);
 	  TPT(( 0, FIL__, __LINE__, _("msg=<Timeout.>\n")));
-	  (void) sl_fclose(FIL__, __LINE__, connFile);
+	  (void) fclose(connFile);
 	  SL_RETURN( NULL, _("sh_mail_start_conn"));
 	}
-      *anum = 1;
     }
   else
     {
-      int address_num = 0;
-      ecount      = 0;
-
-      ma_address = all_recipients;
-
-      while (ma_address)
-	{
-	  if (ma_address->send_mail != 1)
-	    {
-	      ma_address = ma_address->next;
-	      continue;
-	    }
-
-	  ++address_num;
-
-	  sl_snprintf(error_msg, sizeof(error_msg), "RCPT TO:<%s>", 
-		      sh_string_str(ma_address->recipient));
-	  report_smtp(error_msg);
+      ecount = 0;
+      for (i = 0; i < address_num; ++i)
+	{
+	  if (address_list[i] == NULL)  /* paranoia */
+	    break;
+	  TPT(( 0, FIL__, __LINE__,  _("msg=<RCPT TO:<%s>>%c%c"), 
+		address_list[i], 13, 10)); 
 	  
 	  (void) fflush(connFile);
-	  fprintf(connFile, _("RCPT TO:<%s>%c%c"), 
-		  sh_string_str(ma_address->recipient), 13, 10); 
+	  fprintf(connFile, _("RCPT TO:<%s>%c%c"), address_list[i], 13, 10); 
 	  (void) fflush(connFile);
 	  
-	  if (0 == sh_mail_wait(250, fd)) 
+	  if (0 == sh_mail_wait(250, connFile)) 
 	    {
 	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
 			      _("RCPT TO failed"), _("sh_mail_start_conn"), 
-			      _("mail"), sh_string_str(ma_address->recipient));
+			      _("mail"), address_list[i]);
 
 	      TPT(( 0, FIL__, __LINE__, _("msg=<Timeout.>\n")));
 	      ++ecount;
 	    }
-	  ma_address = ma_address->next;
-	}
-
-      *anum += address_num;
-
+	}
       if (ecount == address_num)
 	{
-	  (void) sl_fclose(FIL__, __LINE__, connFile);
+	  (void) fclose(connFile);
 	  SL_RETURN( NULL, _("sh_mail_start_conn"));
 	}
@@ -1233,5 +1534,5 @@
   /* Send the message 
    */
-  report_smtp(_("DATA"));
+  TPT(( 0, FIL__, __LINE__,  _("msg=<DATA>%c%c"), 13, 10)); 
 
   (void) fflush(connFile);
@@ -1239,5 +1540,5 @@
   (void) fflush(connFile);
 
-  if (0 == sh_mail_wait(354, fd)) 
+  if (0 == sh_mail_wait(354, connFile)) 
     {
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
@@ -1245,5 +1546,5 @@
 		      _("mail"), address);
       TPT(( 0, FIL__, __LINE__, _("msg=<Timeout.>\n")));
-      (void) sl_fclose(FIL__, __LINE__, connFile);
+      (void) fclose(connFile);
       SL_RETURN( NULL, _("sh_mail_start_conn"));
     }
@@ -1251,27 +1552,9 @@
 
   my_time = time(NULL);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  my_tm = localtime_r(&my_time, &time_tm);
-#else
-  my_tm = localtime(&my_time);
-#endif
-  
-  if (!my_tm) 
-    {
-      sl_strlcpy(my_tbuf, _("Thu, 01 Jan 1970 00:00:00 +00:00"), sizeof(my_tbuf));
-    }
-  else
-    {
-#if defined(HAVE_STRFTIME_Z)
-      (void) strftime(my_tbuf, 127, _("%a, %d %b %Y %H:%M:%S %z"), my_tm);
-#else
-      (void) strftime(my_tbuf, 127, _("%a, %d %b %Y %H:%M:%S %Z"), my_tm);
-#endif
-    }
+  my_tm   = localtime(&my_time);
+  (void)    strftime(my_tbuf, 127, _("%a, %d %b %Y %H:%M:%S %Z"), my_tm);
 
   TPT(( 0, FIL__, __LINE__,  _("msg=<From: <%s>%c%cTo: <%s>%c%cDate: %s>%c%c"),
 	this_address, 13, 10, address, 13, 10, my_tbuf, 13, 10));
-
-  report_smtp(_("sending data.."));
 
   (void) fflush(connFile);
@@ -1284,5 +1567,4 @@
 	  my_tbuf, 13, 10);
 
-  *ma_socket = fd;
   SL_RETURN( connFile, _("sh_mail_start_conn"));
 }
@@ -1294,11 +1576,9 @@
  */
 
-static int sh_mail_end_conn (FILE * connFile, int fd)
+static int sh_mail_end_conn (FILE * connFile)
 {
   SL_ENTER(_("sh_mail_end_conn"));
 
   time_wait = 300;
-
-  report_smtp(_("."));
 
   (void) fflush(connFile);
@@ -1306,5 +1586,7 @@
   (void) fflush(connFile);
 
-  if (0 != sh_mail_wait(250, fd))
+  TPT(( 0, FIL__, __LINE__, _("msg=<message end written>\n")));
+
+  if (0 != sh_mail_wait(250, connFile))
     {  
       (void) fflush(connFile);
@@ -1333,32 +1615,21 @@
  *
  */
-extern int flag_err_debug;
-
-static void report_smtp (char * reply)
-{
-  char * tmp;
-
-  if (flag_err_debug == S_TRUE)
-    {
-      tmp = sh_util_safe_name_keepspace(reply);
-
-      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		       tmp,
-		       _("report_smtp") );
-      SH_FREE(tmp);
-    }
-  return;
-}
-
-
-static int sh_mail_wait(int code, int ma_socket)
+
+static jmp_buf wait_timeout;
+
+static void sh_mail_alarmhandle (int mysignal)
+{
+  /*@-noeffect@*/
+  (void) mysignal; /* avoid compiler warning */
+  /*@+noeffect@*/
+
+  longjmp(wait_timeout, 1);
+}
+
+static int sh_mail_wait(int code, FILE * ma_socket)
 {
   int rcode, g;
 
-  char c;
-
-  char errmsg[194];
-  char reply[128];
-  unsigned int  ireply = 0;
+  char errmsg[128];
 
   enum { 
@@ -1371,36 +1642,53 @@
   time_t waited_time;
 
+  struct   sigaction          old_act;
+  volatile unsigned int       old_alarm = 0;
+
+  struct  sigaction  new_act;
+  sigset_t           unblock;
+
+  (void) sigemptyset(&unblock);
+  (void) sigaddset  (&unblock, SIGALRM);
+
+  new_act.sa_handler = sh_mail_alarmhandle;
+  (void) sigemptyset( &new_act.sa_mask );       /* set an empty mask       */
+  new_act.sa_flags = 0;                         /* init sa_flags           */
+
   SL_ENTER(_("mail_wait"));
   
+  /* alarm was triggered
+   */
+  if (setjmp(wait_timeout) != 0)
+    {
+      (void) alarm(0);
+      (void) sigaction (SIGALRM, &old_act, NULL);
+      (void) alarm(old_alarm);
+      (void) sigprocmask(SIG_UNBLOCK, &unblock, NULL);
+      TPT((0, FIL__, __LINE__, _("msg=<mail_wait: timeout>\n"))); 
+      SL_RETURN( 0, _("mail_wait"));
+    }
+
   waited_time = time(NULL);
 
   /* timeout after 5 minutes
    */
-
-  rcode    = 0;
-  state    = WAIT_CODE_START;
-  reply[0] = '\0';
-
-  while (sl_read_timeout_fd (ma_socket, &c, 1, time_wait, S_FALSE) > 0) {
-
-    if (ireply < (sizeof(reply) - 1))
+  old_alarm = alarm(0);
+  (void) sigaction (SIGALRM, &new_act, &old_act);
+  (void) alarm((unsigned int) time_wait);
+
+  rcode = 0;
+  state = WAIT_CODE_START;
+
+  while (0 == feof(ma_socket) && 0 == ferror(ma_socket)) {
+
+    if ( (g=fgetc(ma_socket)) == EOF)
       {
-	if (c != '\n' && c != '\r')
-	  {
-	    reply[ireply] = c;
-	    ++ireply;
-	    reply[ireply] = '\0';
-	  }
-      }
-
-    g = (int) c;
-
-    /*
-    if (g == EOF)
-      {
+	(void) alarm(0);
+	(void) sigaction (SIGALRM, &old_act, NULL); 
+	(void) alarm(old_alarm);
+	(void) sigprocmask(SIG_UNBLOCK, &unblock, NULL);
 	TPT((0, FIL__, __LINE__, _("msg=<mail_wait: EOF>\n"))); 
 	SL_RETURN( 0, _("mail_wait")); 
       }
-    */
 
     switch(state) {
@@ -1411,9 +1699,6 @@
       if (0 != isspace(g))
 	break;             /* Skip white space                    */
-      if (0 == isdigit(g)) 
-	{
-	  report_smtp(reply);
-	  SL_RETURN( 0, _("mail_wait")); /* No leading number     */
-	}
+      if (0 == isdigit(g))
+	return 0;          /* No leading number                   */
       rcode = g-(int)'0';  /* convert to number                   */
       state = WAIT_CODE;
@@ -1439,4 +1724,8 @@
 	break;
       /*@-charintliteral@*/
+      (void) alarm(0);
+      (void) sigaction (SIGALRM, &old_act, NULL); 
+      (void) alarm(old_alarm);
+      (void) sigprocmask(SIG_UNBLOCK, &unblock, NULL);
 
       TPT((0, FIL__, __LINE__, 
@@ -1446,16 +1735,11 @@
       if (g != 1)
 	{
-	  char * tmp = sh_util_safe_name_keepspace(reply);
-          sl_snprintf(errmsg, sizeof(errmsg),
-		      _("Bad response (%s), expected %d"), tmp, code);
-	  SH_FREE(tmp);
-
+	  /*@-bufferoverflowhigh@*/
+          sprintf(errmsg,                              /* known to fit  */
+		  _("Bad response (%d), expected %d"), rcode, code);
+	  /*@+bufferoverflowhigh@*/
 	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 
 			  errmsg, _("sh_mail_wait"), 
 			  _("mail"), _("SMTP server"));
-	}
-      else
-	{
-	  report_smtp(reply);
 	}
       waited_time = time(NULL) - waited_time;
@@ -1477,7 +1761,10 @@
       
     default:
+      (void) alarm(0);
+      (void) sigaction (SIGALRM, &old_act, NULL); 
+      (void) alarm(old_alarm);
+      (void) sigprocmask(SIG_UNBLOCK, &unblock, NULL);
 
       TPT((0, FIL__, __LINE__, _("msg=<mail_wait: bad>\n"))); 
-      report_smtp(reply);
       SL_RETURN( 0, _("mail_wait")); 
       
@@ -1485,8 +1772,12 @@
   }
 
+  (void) alarm(0);                            /* Disable alarm       */
+  (void) sigaction (SIGALRM, &old_act, NULL); 
+  (void) alarm(old_alarm);
+  (void) sigprocmask(SIG_UNBLOCK, &unblock, NULL);
+
   TPT((0, FIL__, __LINE__, _("msg=<mail_wait: failed>\n"))); 
 
   /* Failed, EOF or error on socket */
-  report_smtp(reply);
   SL_RETURN( 0, _("mail_wait")); 
 }
@@ -1497,5 +1788,5 @@
 #define SPLIT_AT 998
 
-static char * split_string(const char * str)
+static char * split_string(char * str)
 {
   size_t size;
@@ -1504,26 +1795,17 @@
 
   char * p, * p0;
-  const char * q;
+  char * q;
 
   if (!str)
     return NULL;
 
-  size   = strlen(str) + 1;
+  size   = strlen(str);
+  /* fprintf(stderr, "orig = %d\n", size); */
   blocks = 1 + (size / SPLIT_AT);
   
-  if (sl_ok_muls(2, blocks) && sl_ok_adds(size, (2*blocks)))
-    {
-      size   = size + (2*blocks);
-    }
-  else
-    {
-      /* integer overflow, do not split */
-      p = sh_util_strdup(str);
-      return p;
-    }
-
+  size   = size + (2*blocks) + 1;
   p = SH_ALLOC(size);
   memset(p, 0, size);
-
+  /* fprintf(stderr, "alloc = %d\n", size); */
   p0 = p;
 
@@ -1601,5 +1883,4 @@
   int  ret, length, status;
   mx * result;
-  size_t len;
 
   typedef union
@@ -1609,10 +1890,9 @@
   } querybuf;
 
-  querybuf * reply;
+  querybuf reply;
   char expanded[1024];
   unsigned char * comp_dn, * eom;
   HEADER * header;
-  int      type, rdlength, pref;
-  unsigned int count, theindex;
+  int      count, index, type, rdlength, pref;
   dnsrep * retval;
 
@@ -1622,14 +1902,9 @@
     SL_RETURN (NULL, _("get_mx"));
 
-  reply = SH_ALLOC(sizeof(querybuf));
-
   errno = 0;
   length = res_query (hostname, C_IN, T_MX, 
-		      (unsigned char *) reply, 4095);
-
+		      (unsigned char *) &reply, 4095);
   if (length < 1)
     {
-      char errbuf[SH_ERRBUF_SIZE];
-
       /* error handling
        */
@@ -1644,28 +1919,27 @@
 	  sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN,
 			   (errno == ECONNREFUSED) ? 
-			   sh_error_message (status, errbuf, sizeof(errbuf)) : 
-			   sh_tools_errmessage(status, errbuf, sizeof(errbuf)),
+			   sh_error_message (status) : 
+			   sh_tools_errmessage(status),
 			   _("res_query"));
 #else
 	  if (errno == ECONNREFUSED)
-	    fprintf(stderr, " ERROR: %s: \n", strerror(errno)); /* TESTONLY */
+	    fprintf(stderr, " ERROR: %s: \n", strerror(errno));
 	  else
-	    fprintf(stderr, "HERROR: %s\n", hstrerror(h_errno));/* TESTONLY */
+	    fprintf(stderr, "HERROR: %s\n", hstrerror(h_errno));
 #endif
 	}
-      SH_FREE(reply);
       SL_RETURN (NULL, _("get_mx"));
     }
 
-
-  header  = (HEADER *) reply;
+  ret = 0;
+  header  = (HEADER *) &reply;
 
   /* start of data section
    */
-  comp_dn = (unsigned char *) reply + HFIXEDSZ;
+  comp_dn = (unsigned char *) &reply + HFIXEDSZ;
 
   /* end-of-message
    */
-  eom     = (unsigned char *) reply + length;
+  eom     = (unsigned char *) &reply + length;
 
   /* HEADER NAME  -- must be skipped or decompressed
@@ -1683,48 +1957,28 @@
    */
   count = ntohs (header->qdcount); 
-  for (theindex = 0; theindex < count; ++theindex)
+  for (index = 0; index < count; ++index)
     {
       ret = dn_skipname (comp_dn, eom);
       comp_dn += ret + QFIXEDSZ;
       if (ret < 1 || comp_dn >= eom)
-	{
-	  SH_FREE(reply);
-	  SL_RETURN (NULL, _("get_mx"));
-	}
-    }
-
+	SL_RETURN (NULL, _("get_mx"));
+    }
   count         = ntohs (header->ancount);
   if (count < 1)
-    {
-      SH_FREE(reply);
-      SL_RETURN (NULL, _("get_mx"));
-    }
+    SL_RETURN (NULL, _("get_mx"));
 
   retval        = SH_ALLOC (sizeof (dnsrep));
   if (!retval)
-    {
-      SH_FREE(reply);
-      SL_RETURN (NULL, _("get_mx"));
-    }
-
+    SL_RETURN (NULL, _("get_mx"));
   retval->count = count;
 
   /* allocate space for the results */
 
-  if (!sl_ok_muls(count, sizeof (mx)))
-    {
-      SH_FREE(reply);
+  result        = SH_ALLOC (count * sizeof (mx));
+  if (!result)
+    {
       SH_FREE   (retval);
       SL_RETURN (NULL, _("get_mx"));
     }
-
-  result        = SH_ALLOC (count * sizeof (mx));
-  
-  if (!result)
-    {
-      SH_FREE(reply);
-      SH_FREE   (retval);
-      SL_RETURN (NULL, _("get_mx"));
-    }
   retval->reply = result;
 
@@ -1733,10 +1987,9 @@
       /* HEADER NAME 
        */
-      ret = dn_expand ((unsigned char *) reply, eom, comp_dn, 
+      ret = dn_expand ((unsigned char *) &reply, eom, comp_dn, 
 		       (char *) expanded, 1023);
       comp_dn += ret;
       if (ret < 1 || comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1750,5 +2003,4 @@
       if (type != T_MX || comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1756,17 +2008,14 @@
 	}
 
-
       /* CLASS (re-use 'type' var)
        */
-      /* type = get_short (comp_dn); *//* don't care */
+      type = get_short (comp_dn);
       comp_dn += 2;
       if (comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
 	  SL_RETURN (NULL, _("get_mx"));
 	}
-
 
       /* TTL
@@ -1775,5 +2024,4 @@
       if (comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1787,5 +2035,4 @@
       if (rdlength < 1 || comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1799,5 +2046,4 @@
       if (comp_dn >= eom)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1805,10 +2051,9 @@
 	}
 
-      ret = dn_expand ((unsigned char *) reply, eom, comp_dn, 
+      ret = dn_expand ((unsigned char *) &reply, eom, comp_dn, 
 		       (char *) expanded, 1023);
       comp_dn += ret;
       if (ret < 1)
 	{
-	  SH_FREE(reply);
 	  SH_FREE (result);
 	  SH_FREE (retval);
@@ -1820,11 +2065,9 @@
        */
       result[count].pref = pref;
-      len = strlen (expanded) + 1;
-      result[count].address = SH_ALLOC (len);
-      sl_strlcpy (result[count].address, expanded, len);
+      result[count].address = SH_ALLOC (strlen (expanded) + 1);
+      strcpy (result[count].address, expanded);        /* known to fit  */
     }
   while (ret > 0 && comp_dn < eom && count);
 
-  SH_FREE(reply);
   SL_RETURN (retval, _("get_mx"));
 }
@@ -1854,9 +2097,9 @@
 static dnsrep * return_mx (char *domain)
 {
+  struct hostent *host = NULL;
   dnsrep * answers = NULL;
   mx     * result;
   dnsrep * retval;
-  char   * address = NULL;
-  char     errmsg[128];
+  char     errmsg[128]; 
 
   SL_ENTER(_("return_mx"));
@@ -1875,6 +2118,4 @@
   else
     {
-      char numeric[SH_IP_BUF];
-
       if (domain != NULL)
 	{
@@ -1887,5 +2128,4 @@
 			   _("get_mx"));
 #else
-	  /* flawfinder: ignore *//* test code only */
 	  strcpy  (errmsg,                               /* known to fit  */
 		   _("No MX record for domain "));
@@ -1896,21 +2136,7 @@
 #endif
 	}
-
-      retval = NULL;
-
       if (domain != NULL)
-	address = sh_ipvx_canonical(domain, numeric, sizeof(numeric));
-
-      if (address)
-	{
-	  result       = SH_ALLOC (sizeof (mx));
-	  retval       = SH_ALLOC (sizeof (dnsrep));
-	  retval->reply = result;
-	  retval->count = 1;
-	  result->pref  = 0;
-
-	  result->address = address;
-	}
-      else
+	host = /*@-unrecog@*/sh_gethostbyname (domain)/*@+unrecog@*/;
+      if (!host)
 	{
 #ifdef FIL__
@@ -1923,10 +2149,18 @@
 	  SL_RETURN (NULL, _("return_mx"));
 	}
-
+      result       = SH_ALLOC (sizeof (mx));
+      retval       = SH_ALLOC (sizeof (dnsrep));
+      retval->reply = result;
+      retval->count = 1;
+      result->pref  = 0;
+      /*@-type@*/
+      result->address = SH_ALLOC (strlen (host->h_name) + 1);
+      strcpy (result->address, host->h_name);          /* known to fit  */
+      /*@+type@*/
       SL_RETURN (retval, _("return_mx"));
     }
 }
 
-int free_mx (dnsrep * answers)
+static int free_mx (dnsrep * answers)
 {
   mx     * result;
Index: trunk/src/sh_mem.c
===================================================================
--- trunk/src/sh_mem.c	(revision 591)
+++ trunk/src/sh_mem.c	(revision 1)
@@ -20,7 +20,4 @@
 #include "config_xor.h"
 
-#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
-#define _XOPEN_SOURCE 500
-#endif
 
 #include <stdio.h>
@@ -35,16 +32,14 @@
 #endif
 
-#define SH_REAL_SET
-
 #include "samhain.h"
 #include "sh_error.h"
 #include "sh_utils.h"
 #include "sh_mem.h"
-#include "sh_pthread.h"
-
-extern int safe_logger (int thesignal, int method, char * details);
+
+extern int safe_logger (int signal, int method, pid_t thepid);
 
 #undef  FIL__
 #define FIL__  _("sh_mem.c")
+static int eblock = 0;
 
 #ifdef MEM_DEBUG
@@ -73,41 +68,51 @@
 unsigned long Mem_Current = 0, Mem_Max = 0;
 
-#ifdef HAVE_PTHREAD
-SH_MUTEX_RECURSIVE(mutex_mem);
-#endif
-
-/* define MEM_LOG to enable this */
-/* #define MEM_LOG 1 */
+#if 0
+#define MEM_DETAILS 
+#endif
+
+#ifdef MEM_DETAILS
+int           max_upto_032 = 0;
+int           max_upto_064 = 0;
+int           max_upto_128 = 0;
+int           max_upto_256 = 0;
+int           max_upto_512 = 0;
+int           max_upto_1024 = 0;
+int           max_upto_4096 = 0;
+int           max_upto_inf = 0;
+
+int           now_upto_032 = 0;
+int           now_upto_064 = 0;
+int           now_upto_128 = 0;
+int           now_upto_256 = 0;
+int           now_upto_512 = 0;
+int           now_upto_1024 = 0;
+int           now_upto_4096 = 0;
+int           now_upto_inf = 0;
+
+int           tot_upto_032 = 0;
+int           tot_upto_064 = 0;
+int           tot_upto_128 = 0;
+int           tot_upto_256 = 0;
+int           tot_upto_512 = 0;
+int           tot_upto_1024 = 0;
+int           tot_upto_4096 = 0;
+int           tot_upto_inf = 0;
+#endif
+
 #ifdef MEM_LOG
 void sh_mem_dump ()
 {
   memlist_t   * this = memlist;
-  FILE * fd;
-  static unsigned int nr = 0;
-  char filename[256];
-
-  snprintf(filename, sizeof(filename), "sh_mem_dump.%04u.%lu", nr, (unsigned long) sh.pid);
-  
-  SH_MUTEX_RECURSIVE_INIT(mutex_mem);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
-
-  fd = fopen(filename, "w");
-  if (!fd)
-    {
-      perror(filename);
-      _exit(EXIT_FAILURE);
-    }
+
+
+  FILE * fd = fopen(MEM_LOG, "w");
 
   while (this != NULL)
     {
-      fprintf (fd, "## %20s %5d %ld\n",  this->file, this->line, this->size);
-      fprintf (fd, "%10p %8ld\n", (void *)this->address, this->size);
+      fprintf (fd, "%20s %5d %ld\n",  this->file, this->line, this->size);
       this = this->next;
     }
-  sl_fclose(FIL__, __LINE__, fd);
-
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
-  ++nr;
-  /* _exit(EXIT_SUCCESS); */
+  fclose(fd);
   return;
 }
@@ -119,14 +124,10 @@
 #endif
 
-memlist_t ** sh_dummy_114_merrlist;
-
 void sh_mem_stat ()
 {
   memlist_t   * this;
-  memlist_t   * merrlist = NULL;
+
 
   SL_ENTER(_("sh_mem_stat"));
-
-  sh_dummy_114_merrlist = (memlist_t **) &merrlist;
 
   if (Alloc_Count == Free_Count) 
@@ -142,6 +143,17 @@
 		   Mem_Max, Mem_Current);
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_mem);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
+#ifdef MEM_DETAILS
+  fprintf(stderr, "\n");
+  fprintf(stderr, "__SIZE_____TOTAL___MAXIMUM___\n");
+  fprintf(stderr, "    32    %6d    %6d\n", tot_upto_032, max_upto_032);
+  fprintf(stderr, "    64    %6d    %6d\n", tot_upto_064, max_upto_064);
+  fprintf(stderr, "   128    %6d    %6d\n", tot_upto_128, max_upto_128);
+  fprintf(stderr, "   256    %6d    %6d\n", tot_upto_256, max_upto_256);
+  fprintf(stderr, "   512    %6d    %6d\n", tot_upto_512, max_upto_512);
+  fprintf(stderr, "  1024    %6d    %6d\n", tot_upto_1024, max_upto_1024);
+  fprintf(stderr, "  4096    %6d    %6d\n", tot_upto_4096, max_upto_4096);
+  fprintf(stderr, "   inf    %6d    %6d\n", tot_upto_inf, max_upto_inf);
+  fprintf(stderr, "\n");
+#endif
 
   this = memlist;
@@ -149,46 +161,22 @@
   while (this != NULL) 
     {
-      memlist_t   * merr = calloc(1,sizeof(memlist_t));
-
-      memcpy(merr, this, sizeof(memlist_t));
-      merr->next = merrlist;
-      merrlist   = merr;
-
+      sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_NOTFREE,
+		       this->size, this->file, this->line);
       this = this->next;
     }
 
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
-
-  while (merrlist != NULL) 
-    {
-      memlist_t   * tmp = merrlist;
-      merrlist = merrlist->next;
-      
-      sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_NOTFREE,
-		       tmp->size, tmp->file, tmp->line);
-      free(tmp);
-    }
-
   SL_RET0(_("sh_mem_stat"));
 }
 
-memlist_t ** sh_dummy_168_merrlist;
-
 void sh_mem_check ()
 {
   memlist_t * this;
-  memlist_t * merrlist = NULL;
-  memlist_t * merr;
+  long        nerr = 0;
 
   SL_ENTER(_("sh_mem_check"));
-
-  sh_dummy_168_merrlist = (memlist_t **) &merrlist;
 
   sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MSTAMP,
 		   Mem_Max, Mem_Current);
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_mem);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
-
   this = memlist;
 
@@ -197,11 +185,6 @@
       if ( this->address == NULL )
 	{
-	  merr = calloc (1,sizeof(memlist_t));
-
-	  memcpy(merr, this, sizeof(memlist_t));
-	  merr->size = 2;
-
-	  merr->next = merrlist;
-	  merrlist   = merr;
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL);
+	  ++nerr;
 	}
       else
@@ -209,21 +192,13 @@
 	  if ( this->address[this->size]        != CHECKBYTE )
 	    {
-	      merr = calloc(1, sizeof(memlist_t));
-	      
-	      memcpy(merr, this, sizeof(memlist_t));
-	      merr->size = 1;
-	      
-	      merr->next = merrlist;
-	      merrlist   = merr;
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
+			       this->file, this->line, FIL__, __LINE__);
+	      ++nerr;
 	    }
 	  if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE )
 	    {
-	      merr = calloc(1, sizeof(memlist_t));
-	      
-	      memcpy(merr, this, sizeof(memlist_t));
-	      merr->size = 0;
-	      
-	      merr->next = merrlist;
-	      merrlist   = merr;
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
+			       this->file, this->line, FIL__, __LINE__);
+	      ++nerr;
 	    }
 	}
@@ -231,25 +206,5 @@
     }
 
-
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
-
-  while (merrlist != NULL) 
-    {
-      memlist_t   * tmp = merrlist;
-      merrlist = merrlist->next;
-      
-      if (tmp->size == 2)
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL,
-			   tmp->file, tmp->line, FIL__, __LINE__);
-      if (tmp->size == 1)
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
-			   tmp->file, tmp->line, FIL__, __LINE__);
-      else
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
-			   tmp->file, tmp->line, FIL__, __LINE__);
-      free(tmp);
-      SH_ABORT;
-      _exit (EXIT_FAILURE);
-    }
+  /* if (nerr > 0) abort(); */
 
   SL_RET0(_("sh_mem_check"));
@@ -264,16 +219,21 @@
   SL_ENTER(_("sh_mem_malloc"));
 
-  SH_MUTEX_RECURSIVE_INIT(mutex_mem);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
-
-  the_realAddress = calloc(1,size + 2 * SH_MEMMULT);
+  the_realAddress = malloc(size + 2 * SH_MEMMULT);
   
   if ( the_realAddress  == NULL ) 
     {
-      (void) safe_logger (0, 0, NULL);
-
+      if (eblock == 0)
+	{
+	  eblock = 1;
+	  (void) safe_logger (0, 0, getpid());
+	  /*
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MMEM,
+			   file, line);
+	  */
+	  eblock = 0;
+	}
       /* use _exit() rather than exit() - we malloc() in atexit() functions 
        */
-      _exit (EXIT_FAILURE);
+      _exit (42);
     }
   
@@ -292,68 +252,110 @@
     Max_Alloc_Count = Now_Alloc_Count;
 
+#ifdef MEM_DETAILS
+  if (size <= 32)
+    { 
+      ++now_upto_032;
+      ++tot_upto_032;
+      if (now_upto_032 > max_upto_032) max_upto_032 = now_upto_032;
+    }
+  else if  (size <= 64)
+    { 
+      ++now_upto_064;
+      ++tot_upto_064;
+      if (now_upto_064 > max_upto_064) max_upto_064 = now_upto_064;
+    }
+  else if  (size <= 128)
+    { 
+      ++now_upto_128;
+      ++tot_upto_128;
+      if (now_upto_128 > max_upto_128) max_upto_128 = now_upto_128;
+    }
+  else if  (size <= 256)
+    { 
+      ++now_upto_256;
+      ++tot_upto_256;
+      if (now_upto_256 > max_upto_256) max_upto_256 = now_upto_256;
+    }
+  else if  (size <= 512)
+    { 
+      ++now_upto_512;
+      ++tot_upto_512;
+      if (now_upto_512 > max_upto_512) max_upto_512 = now_upto_512;
+    }
+  else if  (size <= 1024)
+    { 
+      ++now_upto_1024;
+      ++tot_upto_1024;
+      if (now_upto_1024 > max_upto_1024) max_upto_1024 = now_upto_1024;
+    }
+  else if  (size <= 4096)
+    { 
+      ++now_upto_4096;
+      ++tot_upto_4096;
+      if (now_upto_4096 > max_upto_4096) max_upto_4096 = now_upto_4096;
+    }
+  else 
+    { 
+      ++now_upto_inf;
+      ++tot_upto_inf;
+      if (now_upto_inf > max_upto_inf) max_upto_inf = now_upto_inf;
+
+      fprintf(stderr, "\n___BIGSIZE___");
+      fprintf(stderr, "   %6d  -> %16s  %10d \n", size, file, line);
+      fprintf(stderr, "\n");
+
+    }
+#endif
+
   Mem_Current += size;
   Mem_Max = ( (Mem_Current > Mem_Max) ? Mem_Current : Mem_Max);
 
-  this = calloc(1,sizeof(memlist_t));
+  this = (memlist_t *) malloc (sizeof(memlist_t));
 
   if ( this == NULL) 
     {
-      (void) safe_logger(0, 0, NULL);
-
-      _exit(EXIT_FAILURE);
-    }
-  else
-    {
-      /* make list entry */
-
-      this->real_address = the_realAddress;
-      this->address      = theAddress;
-      this->size         = size;
-      this->line         = line;
-      sl_strlcpy(this->file, file, 20);
-
-      this->next = memlist;
-      memlist = this;
-    }
-
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
+      if (eblock == 0)
+	{
+	  eblock = 1;
+	  (void) safe_logger(0, 0, getpid());
+	  /*
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MMEM,
+			   file, line);
+	  */
+	  eblock = 0;
+	}
+      SL_RETURN( the_realAddress, _("sh_mem_malloc"));
+    }
+
+  /* make list entry */
+
+  this->real_address = the_realAddress;
+  this->address      = theAddress;
+  this->size         = size;
+  this->line         = line;
+  sl_strlcpy(this->file, file, 20);
+
+  this->next = memlist;
+  memlist = this;
+
   SL_RETURN( theAddress, _("sh_mem_malloc"));
 }
 
-void ** sh_mem_dummy_a;
-memlist_t ** sh_mem_merr_3;
-
-void sh_mem_free (void * aa, char * file, int line)
-{
-  memlist_t * this;
-  memlist_t * before;
-  memlist_t * merr;
-  memlist_t * merrlist = NULL;
-  unsigned long        size   = 0;
-  void      * a;
-  volatile int         flag = 0;
+
+void sh_mem_free (void * a, char * file, int line)
+{
+  memlist_t * this   = memlist;
+  memlist_t * before = memlist;
+  unsigned long size = 0;
 
   SL_ENTER(_("sh_mem_free"));
 
-  a      = aa;
-  sh_mem_dummy_a = &a;
-  sh_mem_merr_3  = (memlist_t **) &merrlist;
-
-
   if ( a == NULL ) 
     {
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL,
-		       file, line, FIL__, __LINE__);
-      SH_ABORT;
-      _exit (EXIT_FAILURE);
+		       file, line);
       SL_RET0(_("sh_mem_free"));
     }
     
-  SH_MUTEX_RECURSIVE_INIT(mutex_mem);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
-
-  this   = memlist;
-  before = memlist;
-  
   /* -- Find record. -- 
    */
@@ -368,6 +370,7 @@
   if (this == NULL) 
     {
-      flag = 1;
-      goto out;
+      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MREC,
+		       file, line);
+      SL_RET0(_("sh_mem_free"));
     } 
   else 
@@ -377,23 +380,10 @@
       if ( this->address[this->size]        != CHECKBYTE )
 	{
-	  merr = calloc(1, sizeof(memlist_t));
-
-	  memcpy(merr, this, sizeof(memlist_t));
-	  merr->size = 1;
-
-	  merr->next = merrlist;
-	  merrlist = merr;
-	}
-
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
+			   this->file, this->line, file, line);
+	}
       if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE )
-	{
-	  merr = calloc(1,sizeof(memlist_t));
-
-	  memcpy(merr, this, sizeof(memlist_t));
-	  merr->size = 0;
-
-	  merr->next = merrlist;
-	  merrlist = merr;
-	}
+	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
+			 this->file, this->line, file, line);
 
       size = this->size;
@@ -408,33 +398,27 @@
   if (this)
     free(this);
-
   ++Free_Count;
   --Now_Alloc_Count;
 
+#ifdef MEM_DETAILS
+  if (size <= 32)
+    --now_upto_032;
+  else if  (size <= 64)
+    --now_upto_064;
+  else if  (size <= 128)
+    --now_upto_128;
+  else if  (size <= 256)
+    --now_upto_256;
+  else if  (size <= 512)
+    --now_upto_512;
+  else if  (size <= 1024)
+    --now_upto_1024;
+  else if  (size <= 4096)
+    --now_upto_4096;
+  else 
+    --now_upto_inf;
+#endif
+
   Mem_Current -= size;
- out:
-  ; /* label at end of compound statement */
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
-
-  while (merrlist != NULL) 
-    {
-      memlist_t   * tmp = merrlist;
-      merrlist = merrlist->next;
-      
-      if (tmp->size == 1)
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
-			   tmp->file, tmp->line, file, line);
-      else
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
-			   tmp->file, tmp->line, file, line);
-      free(tmp);
-      SH_ABORT;
-      _exit (EXIT_FAILURE);
-    }
-
-  if (flag != 0)
-    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MREC,
-		     file, line);
-
   SL_RET0(_("sh_mem_free"));
 }
@@ -453,5 +437,4 @@
     {
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL);
-      SH_ABORT;
     }
   SL_RET0(_("sh_mem_free"));
@@ -464,19 +447,24 @@
   SL_ENTER(_("sh_mem_malloc"));
 
-  theAddress = calloc(1,size);
-
-  if ( theAddress != NULL ) 
-    {
-      SL_RETURN( theAddress, _("sh_mem_malloc"));
-    }
-  else
-    {
-      (void) safe_logger(0, 0, NULL);
-
+  theAddress = malloc(size);
+
+  if ( theAddress == NULL ) 
+    {
+      if (eblock == 0)
+	{
+	  eblock = 1;
+	  (void) safe_logger(0, 0, getpid());
+	  /*
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MMEM);
+	  */
+	  eblock = 0;
+	}
       /* use _exit() rather than exit() - we malloc() in atexit()  
        */
-      SH_ABORT;
-      _exit (EXIT_FAILURE);
-    }
-}
-#endif
+      _exit (42);
+    }
+  /* memset (theAddress, 0, 1); *//* needs testing */
+
+  SL_RETURN( theAddress, _("sh_mem_malloc"));
+}
+#endif
Index: trunk/src/sh_modules.c
===================================================================
--- trunk/src/sh_modules.c	(revision 591)
+++ trunk/src/sh_modules.c	(revision 1)
@@ -7,15 +7,10 @@
 
 #include "sh_modules.h"
-#include "sh_pthread.h"
 
 #include "sh_utmp.h"
 #include "sh_mounts.h"
 #include "sh_userfiles.h"
+#include "sh_kern.h"
 #include "sh_suidchk.h"
-#include "sh_processcheck.h"
-#include "sh_portcheck.h"
-#include "sh_logmon.h"
-#include "sh_registry.h"
-#include "sh_fInotify.h"
 
 sh_mtype modList[] = {
@@ -23,15 +18,13 @@
   {
     N_("UTMP"),
-    -1,
-    SH_MODFL_NOTIMER,
+    0,
     sh_utmp_init,
     sh_utmp_timer,
     sh_utmp_check,
     sh_utmp_end,
-    sh_utmp_reconf,
+    sh_utmp_null,
 
     N_("[Utmp]"),
     sh_utmp_table,
-    PTHREAD_MUTEX_INITIALIZER,
   },
 #endif
@@ -40,5 +33,4 @@
   {
     N_("MOUNTS"),
-    -1,
     0,
     sh_mounts_init,
@@ -50,5 +42,4 @@
     N_("[Mounts]"),
     sh_mounts_table,
-    PTHREAD_MUTEX_INITIALIZER,
   },
 #endif
@@ -57,5 +48,4 @@
   {
     N_("USERFILES"),
-    -1,
     0,
     sh_userfiles_init,
@@ -67,12 +57,24 @@
     N_("[UserFiles]"),
     sh_userfiles_table,
-    PTHREAD_MUTEX_INITIALIZER,
   },
 #endif
 
+#ifdef SH_USE_KERN
+  {
+    N_("KERNEL"),
+    0,
+    sh_kern_init,
+    sh_kern_timer,
+    sh_kern_check,
+    sh_kern_end,
+    sh_kern_null,
+
+    N_("[Kernel]"),
+    sh_kern_table,
+  },
+#endif
 #ifdef SH_USE_SUIDCHK
   {
     N_("SUIDCHECK"),
-    -1,
     0,
     sh_suidchk_init,
@@ -80,100 +82,12 @@
     sh_suidchk_check,
     sh_suidchk_end,
-    sh_suidchk_reconf,
+    sh_suidchk_free_schedule,
 
     N_("[SuidCheck]"),
     sh_suidchk_table,
-    PTHREAD_MUTEX_INITIALIZER,
   },
 #endif
-
-#ifdef SH_USE_PROCESSCHECK
-  {
-    N_("PROCESSCHECK"),
-    -1,
-    0,
-    sh_prochk_init,
-    sh_prochk_timer,
-    sh_prochk_check,
-    sh_prochk_cleanup,
-    sh_prochk_reconf,
-
-    N_("[ProcessCheck]"),
-    sh_prochk_table,
-    PTHREAD_MUTEX_INITIALIZER,
-  },
-#endif
-
-#ifdef SH_USE_PORTCHECK
-  {
-    N_("PORTCHECK"),
-    -1,
-    0,
-    sh_portchk_init,
-    sh_portchk_timer,
-    sh_portchk_check,
-    sh_portchk_cleanup,
-    sh_portchk_reconf,
-
-    N_("[PortCheck]"),
-    sh_portchk_table,
-    PTHREAD_MUTEX_INITIALIZER,
-  },
-#endif
-
-#ifdef USE_LOGFILE_MONITOR
-  {
-    N_("LOGMON"),
-    -1,
-    0,
-    sh_log_check_init,
-    sh_log_check_timer,
-    sh_log_check_check,
-    sh_log_check_cleanup,
-    sh_log_check_reconf,
-
-    N_("[Logmon]"),
-    sh_log_check_table,
-    PTHREAD_MUTEX_INITIALIZER,
-  },
-#endif
-
-#ifdef USE_REGISTRY_CHECK
-  {
-    N_("REGISTRY"),
-    -1,
-    0,
-    sh_reg_check_init,
-    sh_reg_check_timer,
-    sh_reg_check_run,
-    sh_reg_check_cleanup,
-    sh_reg_check_reconf,
-
-    N_("[Registry]"),
-    sh_reg_check_table,
-    PTHREAD_MUTEX_INITIALIZER,
-  },
-#endif
-
-#if defined(HAVE_SYS_INOTIFY_H)
-  {
-    N_("INOTIFY"),
-    -1,
-    SH_MODFL_NEEDPAUSED,
-    sh_fInotify_init,
-    sh_fInotify_timer,
-    sh_fInotify_run,
-    sh_fInotify_cleanup,
-    sh_fInotify_reconf,
-
-    N_("[Inotify]"),
-    sh_fInotify_table,
-    PTHREAD_MUTEX_INITIALIZER,
-  },
-#endif
-
   {
     NULL,
-    -1,
     0,
 
@@ -186,5 +100,4 @@
     NULL,
     NULL,
-    PTHREAD_MUTEX_INITIALIZER,
   },
 };
Index: trunk/src/sh_mounts.c
===================================================================
--- trunk/src/sh_mounts.c	(revision 591)
+++ trunk/src/sh_mounts.c	(revision 1)
@@ -51,9 +51,9 @@
 
 /* Prototypes for configuration functions */
-int sh_mounts_config_activate (const char * opt);
-int sh_mounts_config_timer    (const char * opt);
-int sh_mounts_config_mount    (const char * opt);
-int sh_mounts_config_sevmnt   (const char * opt);
-int sh_mounts_config_sevopt   (const char * opt);
+int sh_mounts_config_activate (char * opt);
+int sh_mounts_config_timer    (char * opt);
+int sh_mounts_config_mount    (char * opt);
+int sh_mounts_config_sevmnt   (char * opt);
+int sh_mounts_config_sevopt   (char * opt);
 
 /* Prototype for the function to read info on mounted filesystems */
@@ -157,6 +157,6 @@
 static int    ShMountsActive    = S_FALSE;
 static time_t ShMountsInterval  = 86400;
-static int    ShMountsSevMnt    = SH_ERR_ERR;
-static int    ShMountsSevOpt    = SH_ERR_ERR;
+static int    ShMountsSevMnt    = 7;
+static int    ShMountsSevOpt    = 7;
 
 static struct sh_mounts_mnt *mountlist = NULL;
@@ -165,7 +165,6 @@
  * This is called once at the start of each samhain run.
  * Non-configuration setup code should be placed here. */
-int sh_mounts_init (struct mod_type * arg)
-{
-  (void) arg;
+int sh_mounts_init ()
+{
   SL_ENTER(_("sh_mounts_init"));
 
@@ -180,4 +179,6 @@
   }
 
+  lastcheck = time(NULL);
+
   SL_RETURN(0, _("sh_mounts_init"));
 }
@@ -195,5 +196,5 @@
     SL_RETURN(-1, _("sh_mounts_timer"));
   }
- 
+  
   SL_RETURN(0, _("sh_mounts_timer"));
 }
@@ -261,6 +262,6 @@
 
 /* Module reconfiguration
- * Run on receipt of a HUP.
- */
+ * Run on receipt of a HUP. Right now this is identical to _end(), but it may
+ * not always be. */
 int sh_mounts_reconf()
 {
@@ -268,12 +269,4 @@
   sh_mounts_mnt_free(mountlist);
   mountlist = NULL;
-
-  /* re-set defaults
-   */
-  ShMountsActive    = S_FALSE;
-  ShMountsInterval  = 86400;
-  ShMountsSevMnt    = 7;
-  ShMountsSevOpt    = 7;
-
   SL_RETURN( (0), _("sh_mounts_null"));
 }
@@ -283,9 +276,9 @@
 
 /* Configure to check a particular mount */
-int sh_mounts_config_mount (const char * opt_in)
+int sh_mounts_config_mount (char * opt)
 {
   struct sh_mounts_mnt *m;
   struct sh_mounts_opt *o;
-  char *sp, *temp, *opt;
+  char *sp, *temp;
 
   SL_ENTER(_("sh_mounts_config_mount"));
@@ -293,9 +286,9 @@
   /* It's probably best to make a copy of opt before messing about with it
    * via string functions. Good practice and all that. */
-  temp = sh_util_strdup(opt_in);
+  temp = sh_util_strdup(opt);
 
   /* Since we're going to "consume" this new buffer, it'll be good to have a
    * reference to it's allocated memory so we can free it later. Let's use
-   * temp for that, and "opt" for consumption */
+   * temp for that, and the now-unused "opt" for consumption */
   opt = temp;
   
@@ -334,5 +327,5 @@
 
 /* Simply sets our boolean as to whether this module is active */
-int sh_mounts_config_activate (const char * opt)
+int sh_mounts_config_activate (char * opt)
 {
   int i;
@@ -343,5 +336,5 @@
 
 /* Sets up our timer */
-int sh_mounts_config_timer (const char * opt)
+int sh_mounts_config_timer (char * opt)
 {
   long val;
@@ -364,5 +357,5 @@
 
 /* Configure severity for "mount missing" messages */
-int sh_mounts_config_sevmnt  (const char * opt)
+int sh_mounts_config_sevmnt  (char * opt)
 {
   int retval = 0;
@@ -377,5 +370,5 @@
 }
 
-int sh_mounts_config_sevopt  (const char * opt)
+int sh_mounts_config_sevopt  (char * opt)
 {
   int retval = 0;
@@ -398,5 +391,5 @@
 
 /* FreeBSD includes */
-#if defined(HOST_IS_FREEBSD) || defined(HOST_IS_OPENBSD) || defined(HOST_IS_DARWIN)
+#ifdef HOST_IS_FREEBSD
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -457,5 +450,6 @@
   
   while ((c = getc (fd)) == '*') {
-    while (((c = getc (fd)) != '\n') && (c != EOF)) {} /* do nothing */
+    while (((c = getc (fd)) != '\n') && (c != EOF)) {
+    }
   }
 }
@@ -572,8 +566,8 @@
 
 /* end AIX helper routines */
-#endif 
-#endif
-
-#if defined(HOST_IS_FREEBSD) || defined(HOST_IS_OPENBSD) || defined(HOST_IS_DARWIN)
+#endif
+#endif
+
+#if defined(HOST_IS_FREEBSD)
 
 /* FreeBSD returns flags instead of strings as mount options, so we'll convert
@@ -585,31 +579,12 @@
 
 	struct {char *opt; int flag;} table[] = {
-#ifdef MNT_RDONLY
 		{"ro",		MNT_RDONLY},
-#endif
-#ifdef MNT_NOEXEC
 		{"noexec",	MNT_NOEXEC},
-#endif
-#ifdef MNT_NOSUID
 		{"nosuid",	MNT_NOSUID},
-#endif
-#ifdef MNT_NODEV
 		{"nodev",	MNT_NODEV},
-#endif
-#ifdef MNT_SYNCHRONOUS
 		{"sync",	MNT_SYNCHRONOUS},
-#endif
-#ifdef MNT_ASYNC
 		{"async",	MNT_ASYNC},
-#endif
-#ifdef MNT_LOCAL
 		{"local",	MNT_LOCAL},
-#endif
-#ifdef MNT_QUOTA
 		{"quota",	MNT_QUOTA},
-#endif
-#ifdef MNT_NOATIME
-		{"noatime",	MNT_NOATIME},
-#endif
 		{"bound",	-1}
 	};
@@ -682,6 +657,6 @@
 	list = m;
 
-/* The Open/FreeBSD way */
-#if defined(HOST_IS_FREEBSD) || defined(HOST_IS_OPENBSD) || defined(HOST_IS_DARWIN)
+/* The FreeBSD way */
+#ifdef HOST_IS_FREEBSD
 {
 	struct statfs *fsp;
@@ -749,5 +724,5 @@
 	}
 
-	sl_fclose(FIL__, __LINE__, tab);
+	fclose(tab);
 }
 #endif
@@ -806,5 +781,5 @@
         }
 
-        (void) sl_fclose(FIL__, __LINE__, tab);
+        (void) fclose(tab);
 	aix_fs_get (NULL, NULL); /* reset */
 }
Index: trunk/src/sh_nmail.c
===================================================================
--- trunk/src/sh_nmail.c	(revision 591)
+++ 	(revision )
@@ -1,1032 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2008 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
-#define _XOPEN_SOURCE 500
-#endif
-
-#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
-#if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
-#pragma GCC diagnostic ignored "-Wclobbered"
-#endif
-#endif
-
-#include <string.h>
-#include <time.h>
-
-#if defined(SH_WITH_MAIL)
-
-#undef  FIL__
-#define FIL__  _("sh_nmail.c")
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_mem.h"
-#include "sh_mail.h"
-#include "sh_tiger.h"
-#include "sh_string.h"
-#include "sh_utils.h"
-#include "sh_fifo.h"
-#include "sh_filter.h"
-#include "sh_mail_int.h"
-
-SH_MUTEX_INIT(mutex_listall, PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_INIT(mutex_flush_l, PTHREAD_MUTEX_INITIALIZER);
-
-/* Pointer to last address */
-
-static struct alias * last = NULL;
-
-/* List of mail recipients */
-
-static struct alias * recipient_list = NULL;
-
-static struct alias * compiled_recipient_list = NULL;
-static sh_filter_type compiled_mail_filter = SH_FILT_INIT;
-
-/* List of mail aliases */
-
-static struct alias * alias_list = NULL;
-
-/* List of all recipients */
-
-struct alias * all_recipients = NULL;
-
-/* Check if addr is in list. If list is all_recipients,
- * must iterate over ->all_next instead of ->next
- */
-static int check_double (const char * str, struct alias * list, int isAll)
-{
-  if (str && list)
-    {
-      struct alias * item = list;
-
-      while (item)
-	{
-	  if (0 == strcmp(sh_string_str(item->recipient), str))
-	    return -1;
-	  if (isAll)
-	    item = item->all_next;
-	  else
-	    item = item->next;
-	}
-    }
-  return 0;
-}
-
-/* Add recipient to 'list' AND to all_recipients. If
- * it already is in all_recipients, mark it as an alias
- * (isAlias = 1).
- */
-struct alias * add_recipient_intern(const char * str, 
-				    struct alias * list)
-{
-  if (str)
-    {
-      struct alias * new  = SH_ALLOC(sizeof(struct alias));
-      new->next           = list;
-      new->mx_list        = NULL;
-      new->mail_filter    = NULL;
-      new->recipient_list = NULL;
-      new->severity       = (-1);
-      new->send_mail      = 0;
-      new->isAlias        = 0;
-      new->recipient      = sh_string_new_from_lchar(str, strlen(str));
-      list                = new;
-
-      SH_MUTEX_LOCK_UNSAFE(mutex_listall);
-      if (0 != check_double(str, all_recipients, S_TRUE))
-	{
-	  new->isAlias    = 1;
-	}
-      new->all_next       = all_recipients;
-      all_recipients      = new;
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_listall);
-    }
-  return list;
-}
-
-int sh_nmail_close_recipient(const char * str)
-{
-  (void) str;
-
-  if (last)
-    {
-      last = NULL;
-      return 0;
-    }
-  return -1;
-}
-
-/* Add a single recipient. Must not be in in
- * recipient_list already, and not in all_recipients.
- */
-int sh_nmail_add_recipient(const char * str)
-{
-  /* return error if duplicate, or 
-   * already defined within an alias list.
-   */
-  if (0 == check_double(str,  recipient_list, S_FALSE) &&
-      0 == check_double(str,  all_recipients, S_TRUE))
-    {
-      recipient_list = add_recipient_intern(str, recipient_list);
-      last           = recipient_list;
-      return 0;
-    }
-  return -1;
-}
-
-/* Add a compiled-in address. These share the compiled_mail_filter
- */
-int sh_nmail_add_compiled_recipient(const char * str)
-{
-  if (0 == check_double(str,  compiled_recipient_list, S_FALSE))
-    {
-      compiled_recipient_list = 
-	add_recipient_intern(str, compiled_recipient_list);
-      if (compiled_recipient_list)
-	compiled_recipient_list->mail_filter = &compiled_mail_filter;
-      last           = compiled_recipient_list;
-      return 0;
-    }
-  return -1;
-}
-
-/* Add an alias; format is name ":" comma-delimited_list_of_recipients
- */
-int sh_nmail_add_alias(const char * str)
-{
-#define SH_ALIASES_RECP_NUM 256
-  size_t lengths[SH_ALIASES_RECP_NUM];
-  unsigned int    nfields = SH_ALIASES_RECP_NUM;
-  char * new = sh_util_strdup(str);
-  char * p   = strchr(new, ':');
-  char * q;
-
-  if (p && strlen(p) > 1)
-    {
-      unsigned int     i;
-      char ** array;
-
-      *p = '\0'; q = p; ++p;
-      if (strlen(new) > 0)
-	{
-	  /* strip trailing space
-	   */
-	  --q; while ((q != new) && *q == ' ') { *q = '\0'; --q; }
-	}
-      else
-	{
-	  goto err;
-	}
-
-      if (0 == check_double(new, alias_list, S_FALSE))
-	{
-	  array = split_array_list(p, &nfields, lengths);
-
-	  if (array && nfields > 0)
-	    {
-	      struct alias * newalias = NULL;
-
-	      /* Enforce that all list members are defined already
-	       */
-	      int                nflag = 0;
-
-	      for (i = 0; i < nfields; ++i) {
-		if (0 == check_double(array[i],  all_recipients, S_TRUE))
-		  nflag = 1; /* not in all_recipients --> bad */
-	      }
-
-	      if (nflag == 0)
-		{
-		  newalias                 = SH_ALLOC(sizeof(struct alias));
-		  newalias->recipient_list = NULL;
-		  newalias->mail_filter    = NULL;
-		  newalias->mx_list        = NULL;
-		  newalias->severity       = (-1);
-		  
-		  /* This is the alias */
-		  newalias->recipient = sh_string_new_from_lchar(new, strlen(new));
-		  
-		  for (i = 0; i < nfields; ++i)
-		    {
-		      if (lengths[i] > 0 && 
-			  0 == check_double(array[i], newalias->recipient_list, S_FALSE))
-			{
-			  newalias->recipient_list = 
-			    add_recipient_intern(array[i], newalias->recipient_list);
-			}
-		    }
-		}
-
-	      SH_FREE(array);
-
-	      if (newalias == NULL || newalias->recipient_list == NULL)
-		{
-		  if (newalias)
-		    SH_FREE(newalias);
-		  goto err;
-		}
-      
-	      newalias->next = alias_list;
-	      alias_list     = newalias;
-	      last           = alias_list;
-
-	      SH_FREE(new);
-	      return 0;
-	    }
-	}
-    }
- err:
-  SH_FREE(new);
-  return -1;
-}
-
-
-/* <<<<<<<<<<<<<<< Recipient List >>>>>>>>>>>>>>>>>>>>>> */
-
-static struct alias * find_list (const char * alias, int * single)
-{
-  struct alias * list   = NULL;
-
-  *single = 0;
-
-  if (!alias)
-    {
-      list = all_recipients;
-    }
-  else
-    {
-      struct alias * test = alias_list;
-      
-      while (test)
-	{
-	  if (0 == strcmp(alias, sh_string_str(test->recipient)))
-	    {
-	      list = test->recipient_list;
-	      break;
-	    }
-	  test = test->next;
-	}
-      
-      if (!list)
-	{
-	  test = recipient_list;
-	  while (test)
-	    {
-	      if (0 == strcmp(alias, sh_string_str(test->recipient)))
-		{
-		  list   = test;
-		  *single = 1;
-		  break;
-		}
-	      test = test->next;
-	    }
-	}
-      
-      if (!list)
-	{
-	  test = compiled_recipient_list;
-	  while (test)
-	    {
-	      if (0 == strcmp(alias, sh_string_str(test->recipient)))
-		{
-		  list   = test;
-		  *single = 1;
-		  break;
-		}
-	      test = test->next;
-	    }
-	}
-    }
-  return list;
-}
-
-/* Returns zero (no) or one (yes). Used to tag messages that are
- * valid for a given recipient (or mailing list alias).
- */
-int sh_nmail_valid_message_for_alias (int level, 
-				      const char * message, 
-				      const char * alias, 
-				      const void * rcv_info)
-{
-  const struct alias * rcv = (const struct alias *) rcv_info;
-
-  if (!alias || 0 == strcmp(alias, sh_string_str(rcv->recipient)))
-    {
-      if ((level & rcv->severity) == 0)
-	{
-	  return 0;
-	}
-
-      if (rcv->mail_filter)
-	{
-	  if (0 != sh_filter_filter(message, rcv->mail_filter))
-	    {
-	      return 0;
-	    }
-	}
-    }
-
-  return 1;
-}
-
-/* Returns number of recipients */
-
-static
-int sh_nmail_compute_recipients (int level, const char * message, 
-				 const char * alias, int flagit)
-{
-  struct alias * list   = NULL;
-  int            single = 0;
-  int            retval = 0;
-
-  if (flagit)
-    {
-      list = all_recipients;
-      while (list)
-	{
-	  list->send_mail = 0;
-	  list = list->all_next;
-	}
-      list = NULL;
-    }
-
-  if (message)
-    {
-      int flag = 0;
-
-      list = find_list (alias, &single);
-      if (list == all_recipients)
-	flag = 1;
-
-      while (list)
-	{
-	  /* Check severity 
-	   */
-	  if ((list->severity & level) == 0)
-	    {
-	      if (single) break;
-	      if (flag)
-		list = list->all_next;
-	      else
-		list = list->next;
-	      continue;
-	    }
-
-	  /* Check filter
-	   */
-	  if (list->mail_filter &&
-	      0 != sh_filter_filter(message, list->mail_filter))
-	    {
-	      if (single) break;
-	      if (flag)
-		list = list->all_next;
-	      else
-		list = list->next;
-	      continue;
-	    }
-	  
-	  /* Mark the entry
-	   */
-	  if (flag)
-	    {
-	      /* Don't mark aliases
-	       */
-	      if (flagit && list->isAlias == 0)
-		{
-		  list->send_mail = 1;
-		}
-	      list = list->all_next;
-	    }
-	  else
-	    {
-	      if (flagit)
-		  list->send_mail = 1;
-	      list = list->next;
-	    }
-	  ++retval;
-	}
-    }
-  return retval;
-}
-
-/* Is not called from same(recursively) or different thread
- */
-static
-int sh_nmail_flag_recipients (int level, const char * message, 
-			      const char * alias)
-{
-  int retval = 0;
-
-  if (message)
-    {
-      SH_MUTEX_LOCK_UNSAFE(mutex_listall);
-      retval = sh_nmail_compute_recipients (level, message, alias, 1);
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_listall);
-    }
-  return retval;
-}
-
-/* Can be called from same thread with mutex_listall held via sh_nmail_flush()
- */
-static
-int sh_nmail_test_recipients (int level, const char * message, 
-			      const char * alias)
-{
-  int retval = 0;
-
-  if (message)
-    {
-      if (0 == SH_MUTEX_TRYLOCK_UNSAFE(mutex_flush_l))
-	{
-	  SH_MUTEX_LOCK_UNSAFE(mutex_listall);
-	  retval = sh_nmail_compute_recipients (level, message, alias, 0);
-	  SH_MUTEX_UNLOCK_UNSAFE(mutex_listall);
-	  SH_MUTEX_UNLOCK_UNSAFE(mutex_flush_l);
-	}
-    }
-  return retval;
-}
-
-/* <<<<<<<<<<<<<<<<<<<  Mail the message  >>>>>>>>>>>>>>>>>>>>>> */
-
-SH_MUTEX_RECURSIVE(mutex_nmail_msg);
-SH_MUTEX_STATIC(nmail_lock, PTHREAD_MUTEX_INITIALIZER);
-
-/*
- * First test list of recipients, then call sh_mail_pushstack().
- */
-int sh_nmail_pushstack (int level, const char * message, 
-			const char * alias)
-{
-  int retval = 0;
-
-  if (0 != sh_nmail_test_recipients (level, message, alias))
-    {
-      retval = sh_mail_pushstack(level, message, alias);
-    }
-  return retval;
-}
-
-static int nmail_count = 0;
-
-/*
- * First mark list of recipients, then call sh_mail_msg().
- */
-int sh_nmail_msg (int level, const char * message, 
-		  const char * alias)
-{
-  volatile int retval = 0;
-
-  /* Need to:
-   *   -- wait if different thread, and
-   *   -- fail if same thread. */
-  SH_MUTEX_RECURSIVE_INIT(mutex_nmail_msg);
-  SH_MUTEX_RECURSIVE_LOCK(mutex_nmail_msg);
-
-  /* Only same thread beyond this point. We fail
-   * if count > 0 already. */
-  if (0 == SH_MUTEX_TRYLOCK_UNSAFE(nmail_lock))
-    {
-      ++nmail_count;
-      if (nmail_count != 1)
-	{
-	  --nmail_count;
-	  SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-	  goto cleanup;
-	}
-      SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-
-      if (0 != sh_nmail_flag_recipients (level, message, alias))
-	{
-	  /* Need to keep info for sh_nmail_pushstack() 
-	   */
-	  SH_MUTEX_LOCK(mutex_listall);
-	  retval = sh_mail_msg(message);
-	  SH_MUTEX_UNLOCK(mutex_listall);
-
-	  if (retval != 0)
-	    {
-	      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-			       retval, MSG_E_SUBGEN,
-			       _("could not mail immediately"),
-			       _("sh_nmail_msg") );
-	      sh_mail_pushstack(level, message, alias);
-	    }
-	}
-      SH_MUTEX_LOCK_UNSAFE(nmail_lock);
-      --nmail_count;
-      SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-    }
- cleanup:
-  ; /* label at end of compound statement */
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_nmail_msg);
-  return retval;
-}
-
-static int sh_nmail_flush_int (void);
-
-int sh_nmail_flush ()
-{
-  int                retval = 0;
-
-  if (0 == SH_MUTEX_TRYLOCK_UNSAFE(nmail_lock))
-    {
-      ++nmail_count;
-      if (nmail_count != 1)
-	{
-	  --nmail_count;
-	  SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-	  return retval;
-	}
-      SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-
-      retval = sh_nmail_flush_int ();
-
-      SH_MUTEX_LOCK_UNSAFE(nmail_lock);
-      --nmail_count;
-      SH_MUTEX_UNLOCK_UNSAFE(nmail_lock);
-    }
-  return retval;
-}
-
-/* warning: variable âlistâ might be clobbered by âlongjmpâ or âvforkâ*/
-static struct alias ** list_dummy;
-
-/*
- * Loop over all recipients in stack. 
- * For each distinct one, mark all messages for sending. 
- * Then call sh_mail_msg().
- */
-
-static int sh_nmail_flush_int ()
-{
-  int                retval = 0;
-  sh_string *        msg    = NULL;
-  sh_string *        smsg   = NULL;
-  struct alias     * list;
-  struct alias     * dlist;
-
-  /* warning: variable âlistâ might be clobbered by âlongjmpâ or âvforkâ*/
-  list_dummy = &list;
-
-  SH_MUTEX_LOCK(mutex_listall);
-
-  /* Reset recipient list
-   */
-  list = all_recipients;
-  while (list)
-    {
-      list->send_mail = 0;
-      list = list->all_next;
-    }
-
-  /* Check (i) compiled recipients, (b) aliases, (c) single recipients.
-   * For each, tag all messages, then call sh_mail_msg with
-   *  appropriate address list.
-   */
-
-  reset_list(fifo_mail);
-
-  /* Compiled recipients. These share threshold and filter,
-   * hence only the first recipient needs to be tested.
-   */
-  list  = compiled_recipient_list;
-
-  if (list)
-    {
-      msg   = tag_list(fifo_mail, sh_string_str(list->recipient),
-		       sh_nmail_valid_message_for_alias, list, S_TRUE);
-    }
-
-  if (msg)
-    {
-      while (list)
-	{
-	  list->send_mail = 1;
-	  list = list->next;
-	}
-      
-      list = compiled_recipient_list;
-      
-      SH_MUTEX_LOCK(mutex_flush_l);
-      (void) sh_mail_msg(sh_string_str(msg));
-      SH_MUTEX_UNLOCK(mutex_flush_l);
-
-      sh_string_destroy(&msg);
-      
-      list = compiled_recipient_list;
-      while (list)
-	{
-	  list->send_mail = 0;
-	  list = list->next;
-	}
-    }
-
-  /* Aliases
-   */
-  list  = alias_list;
-
-  while (list) {
-
-    /* Work through the recipient list. As smsg stores last msg,
-     * we send a batch whenever msg != smsg, and continue from
-     * that point in the recipient list.
-     */
-    struct alias     * lnew;
-
-    while (list)
-      {
-	msg   = tag_list(fifo_mail, sh_string_str(list->recipient),
-			 sh_nmail_valid_message_for_alias, list, S_FALSE);
-
-	if (msg)
-	  {
-	    if (!smsg) /* init */
-	      {
-		smsg      = sh_string_copy(msg);
-	      }
-	    else
-	      {
-		if (0 != strcmp(sh_string_str(smsg), sh_string_str(msg)))
-		  {
-		    /*
-		     * Don't set list = list->next here, since we want
-		     * to continue with this recipient in the next batch.
-		     */
-		    sh_string_destroy(&msg);
-		    break;
-		  }
-	      }
-	    lnew = list->recipient_list;
-	    while (lnew)
-	      {
-		lnew->send_mail = 1;
-		lnew= lnew->next;
-	      }
-	    sh_string_destroy(&msg);
-	  }
-	list      = list->next;
-      }
-
-    /* Continue here if smsg != msg */
-
-    if (smsg)
-      {
-	SH_MUTEX_LOCK(mutex_flush_l);
-	(void) sh_mail_msg(sh_string_str(smsg));
-	SH_MUTEX_UNLOCK(mutex_flush_l);
-	sh_string_destroy(&smsg);
-      }
-
-    /* Reset old list of recipients (up to current point in list)
-     * and then continue with list from current point on.
-     */
-    dlist  = alias_list;
-    while (dlist)
-      {
-	lnew = dlist->recipient_list;
-	while (lnew)
-	  {
-	    lnew->send_mail = 0;
-	    lnew = lnew->next;
-	  }
-	dlist = dlist->next;
-      }
-  }
-
-
-  /* Single recipients
-   */
-  list  = recipient_list;
-
-  while (list) {
-
-    /* Work through the recipient list. As smsg stores last msg,
-     * we send a batch whenever msg != smsg, and continue from
-     * that point in the recipient list.
-     */
-
-    while (list)
-      {
-	msg   = tag_list(fifo_mail, sh_string_str(list->recipient),
-			 sh_nmail_valid_message_for_alias, list, S_TRUE);
-
-	if (msg)
-	  {
-	    if (!smsg) /* init */
-	      {
-		smsg = sh_string_copy(msg);
-	      }
-	    else
-	      {
-		if (0 != strcmp(sh_string_str(smsg), sh_string_str(msg)))
-		  {
-		    /*
-		     * Don't set list = list->next here, since we want
-		     * to continue with this recipient in the next batch.
-		     */
-		    sh_string_destroy(&msg);
-		    break;
-		  }
-	      }
-	    list->send_mail = 1;
-	    sh_string_destroy(&msg);
-	  }
-	list = list->next;
-      }
-
-    /* Continue here if smsg != msg */
-
-    if (smsg)
-      {
-	SH_MUTEX_LOCK(mutex_flush_l);
-	(void) sh_mail_msg(sh_string_str(smsg));
-	SH_MUTEX_UNLOCK(mutex_flush_l);
-	sh_string_destroy(&smsg);
-      }
-
-    /* Reset old list of recipients (up to current point in list)
-     * and then continue with list from current point on.
-     */
-    dlist  = recipient_list;
-    while (dlist)
-      {
-	dlist->send_mail = 0;
-	dlist = dlist->next;
-      }
-  }
-
-  /* Remove all mails for which no recipient failed
-   */
-
-  sh.mailNum.alarm_last -= commit_list(fifo_mail);
-  SH_MUTEX_UNLOCK(mutex_listall);
-
-  return retval;
-}
-
-
-
-/* <<<<<<<<<<<<<<<<<<<  Severity  >>>>>>>>>>>>>>>>>>>>>> */
-
-/* 
- * -- set severity threshold for recipient or alias
- */
-int sh_nmail_set_severity (const char * str)
-{
-  if (last == recipient_list || last == alias_list)
-    {
-      if (0 == sh_error_set_level(str, &(last->severity)))
-	{
-	  /* All recipients in alias share the severity
-	   */
-	  if (last == alias_list)
-	    {
-	      struct alias * ptr = last->recipient_list;
-
-	      while (ptr)
-		{
-		  ptr->severity = last->severity;
-		  ptr = ptr->next;
-		}
-	    }
-	  return 0;
-	}
-    }
-  return (-1);
-}
-
-/* <<<<<<<<<<<<<<<<<<<  Filters >>>>>>>>>>>>>>>>>>>>>> */
-
-
-int sh_nmail_add_generic (const char * str, int flag)
-{
-  if (last)
-    {
-      if (NULL == last->mail_filter)
-	last->mail_filter = sh_filter_alloc();
-
-      /* All recipients in alias share the mail filter
-       */
-      if (last == alias_list)
-	{
-	  struct alias * ptr = last->recipient_list;
-	  
-	  while (ptr)
-	    {
-	      ptr->mail_filter = last->mail_filter;
-	      ptr = ptr->next;
-	    }
-	}
-
-      return (sh_filter_add (str, last->mail_filter, flag));
-    }
-  return (-1);
-}
-
-/*
- * -- add keywords to the OR filter
- */
-int sh_nmail_add_or (const char * str)
-{
-  return sh_nmail_add_generic(str, SH_FILT_OR);
-}
-
-/*
- * -- add keywords to the AND filter
- */
-int sh_nmail_add_and (const char * str)
-{
-  return sh_nmail_add_generic(str, SH_FILT_AND);
-}
-
-/*
- * -- add keywords to the NOT filter
- */
-int sh_nmail_add_not (const char * str)
-{
-  return sh_nmail_add_generic(str, SH_FILT_NOT);
-}
-
-
-/* <<<<<<<<<<<<<<<<<<<  Mailkey per Alias >>>>>>>>>>>>>>>>>>>>>>>>> */
-
-#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-#include <sys/mman.h>
-#endif
-
-#include "zAVLTree.h"
-
-zAVLTree        * mailkeys = NULL;
-
-struct alias_mailkey {
-  char * alias;
-  unsigned int mailcount;
-  time_t       id_audit;
-  char   mailkey_old[KEY_LEN+1];
-  char   mailkey_new[KEY_LEN+1];
-};
-
-static zAVLKey sh_nmail_getkey(void const *item)
-{
-  const struct alias_mailkey * t = (const struct alias_mailkey *) item;
-  return (zAVLKey) t->alias;
-}
-
-/* Return mailkey for alias. If there's no key yet, create it and
- * store it in the AVL tree.
- * This is called from sh_mail_msg, 
- *    which is called from sh_nmail_msg,
- *        which is protected by a mutex.
- */
-int sh_nmail_get_mailkey (const char * alias, char * buf, size_t bufsiz,
-			  time_t * id_audit)
-{
-  char hashbuf[KEYBUF_SIZE];
-
- start:
-
-  if (mailkeys)
-    {
-      struct alias_mailkey * t;
-
-      if (!alias)
-	t = (struct alias_mailkey *) zAVLSearch (mailkeys, _("(null)"));
-      else
-	t = (struct alias_mailkey *) zAVLSearch (mailkeys, alias);
-
-      if (t)
-	{
-	  /* iterate the key
-	   */
-	  (void) sl_strlcpy(t->mailkey_new,
-			    sh_tiger_hash (t->mailkey_old, TIGER_DATA, KEY_LEN,
-					   hashbuf, sizeof(hashbuf)),
-			    KEY_LEN+1);
-	  (void) sl_strlcpy(buf, t->mailkey_new, bufsiz);
-	  ++(t->mailcount);
-	}
-      else
-	{
-	  t = SH_ALLOC(sizeof(struct alias_mailkey));
-
-	  MLOCK(t, sizeof(struct alias_mailkey));
-
-	  if (!alias)
-	    t->alias = sh_util_strdup(_("(null)"));
-	  else
-	    t->alias = sh_util_strdup(alias);
-
-	  t->mailcount = 0;
-	  t->id_audit  = time(NULL);
-
-	  BREAKEXIT(sh_util_keyinit);
-	  (void) sh_util_keyinit (t->mailkey_old, KEY_LEN+1);
-
-	  /* iterate the key
-	   */
-	  (void) sl_strlcpy(t->mailkey_new,
-			    sh_tiger_hash (t->mailkey_old, TIGER_DATA, KEY_LEN,
-					   hashbuf, sizeof(hashbuf)),
-			    KEY_LEN+1);
-	  (void) sl_strlcpy(buf, t->mailkey_new, bufsiz);
-	  (void) zAVLInsert(mailkeys, t);
-	}
-
-      /* X(n) -> X(n-1)
-       */
-      (void) sl_strlcpy (t->mailkey_old, t->mailkey_new, KEY_LEN+1);
-
-      *id_audit = t->id_audit;
-
-      return (t->mailcount);
-    }
-
-  mailkeys = zAVLAllocTree (sh_nmail_getkey, zAVL_KEY_STRING);
-  goto start;
-}
-
-/* <<<<<<<<<<<<<<<<<<<  Free for Reconfigure >>>>>>>>>>>>>>>>>>>>>> */
-
-
-static void free_recipient_list(struct alias * list)
-{
-  struct alias * new;
-  sh_filter_type * p = NULL;
-
-  while (list)
-    {
-      new  = list;
-      list = new->next;
-      if (new->mx_list)
-	free_mx(new->mx_list);
-      if (new->mail_filter)
-	{
-	  sh_filter_free(new->mail_filter);
-	  if (!p || p != new->mail_filter)
-	    {
-	      p = new->mail_filter;
-	      SH_FREE(new->mail_filter);
-	    }
-	}
-      sh_string_destroy(&(new->recipient));
-      SH_FREE(new);
-    }
-}
-
-/* Free everything to prepare for reconfigure
- */
-void sh_nmail_free()
-{
-  SH_MUTEX_LOCK_UNSAFE(mutex_listall);
-  all_recipients = NULL;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_listall);
-
-  free_recipient_list(recipient_list);
-  recipient_list = NULL;
-
-  sh_filter_free(&compiled_mail_filter);
-
-  while (alias_list) 
-    {
-      struct alias * item = alias_list;
-
-      alias_list = item->next;
-
-      sh_string_destroy(&(item->recipient));
-      free_recipient_list(item->recipient_list);
-      if (item->mail_filter)
-	{
-	  sh_filter_free(item->mail_filter);
-	  /* SH_FREE(item->mail_filter); */
-	}
-      SH_FREE(item);
-    }
-  alias_list = NULL;
-
-  last = compiled_recipient_list;
-  return;
-}
-
-/* defined(SH_WITH_MAIL) */
-#endif
Index: trunk/src/sh_port2proc.c
===================================================================
--- trunk/src/sh_port2proc.c	(revision 591)
+++ 	(revision )
@@ -1,1080 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2008 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#define NAMLEN(dirent) sl_strlen((dirent)->d_name)
-#else
-#define dirent direct
-#define NAMLEN(dirent) (dirent)->d_namlen
-#ifdef HAVE_SYS_NDIR_H
-#include <sys/ndir.h>
-#endif
-#ifdef HAVE_SYS_DIR_H
-#include <sys/dir.h>
-#endif
-#ifdef HAVE_NDIR_H
-#include <ndir.h>
-#endif
-#endif
-#define NEED_ADD_DIRENT
-
-#if defined(SH_USE_PORTCHECK) && (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE))
-
-/* #define DEBUG_P2P 1 */
-
-#include "samhain.h"
-#include "sh_utils.h"
-
-/****************************************************************************
- *
- *  >>> COMMON CODE <<<
- *
- ****************************************************************************/
-#if defined(__linux__) || defined(__FreeBSD__)
- 
-#include "sh_error_min.h"
-#include "sh_pthread.h"
-#include "sh_ipvx.h"
-
-#define FIL__  _("sh_port2proc.c")
-
-struct sock_store {
-  unsigned long sock;
-  size_t        pid;
-  char *        path;
-  char *        user;
-  struct sock_store * next;
-};
-
-/* /proc: 
- *        linux:     /proc/pid/exe
- *        freebsd:   /proc/pid/file
- *        solaris10: /proc/pid/path/a.out
- */
-static void get_user_and_path (struct sock_store * add)
-{
-  extern char *  sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len);
-
-  char        path[128];
-  char *      buf;
-  struct stat sbuf;
-  int         len;
-  char *      tmp;
-
-  sl_snprintf (path, sizeof(path), "/proc/%ld/exe", (unsigned long) add->pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  sl_snprintf (path, sizeof(path), "/proc/%ld/file", (unsigned long) add->pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  sl_snprintf (path, sizeof(path), "/proc/%ld/path/a.out", (unsigned long) add->pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  return;
-
- linkread:
-
-  buf = SH_ALLOC(PATH_MAX);
-  len = readlink(path, buf, PATH_MAX);   /* flawfinder: ignore */
-  len = (len >= PATH_MAX) ? (PATH_MAX-1) : len;
-
-  if (len > 0)
-    { 
-      buf[len] = '\0';
-      add->path = buf;
-    }
-  else
-    {
-      SH_FREE(buf);
-    }
-
-  add->user = SH_ALLOC(USER_MAX);
-  tmp  = sh_unix_getUIDname (SH_ERR_ALL, sbuf.st_uid, add->user, USER_MAX);
-
-  if (!tmp)
-    sl_snprintf (add->user, USER_MAX, "%ld", (unsigned long) sbuf.st_uid);
-
-  return;
-}
-
-#endif
-
-/****************************************************************************
- *
- *  >>> LINUX CODE <<<
- *
- ****************************************************************************/
-
-#if defined(__linux__)
-
-static  size_t  sh_minpid = 0x0001;
-static  size_t  sh_maxpid = 0x8000;
-
-#ifndef HAVE_LSTAT
-#define lstat(x,y) stat(x,y)
-#endif /* HAVE_LSTAT */
-
-#if defined(S_IFLNK) && !defined(S_ISLNK)
-# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
-#else
-# if !defined(S_ISLNK)
-#  define S_ISLNK(mode) (0)
-# endif
-#endif
-
-#if defined(__linux__)
-#define PROC_PID_MAX _("/proc/sys/kernel/pid_max")
-
-static int proc_max_pid (size_t * procpid)
-{
-  char * ret;
-  unsigned long  pid;
-  FILE * fd;
-  char   str[128];
-  char * ptr;
-
-  SL_ENTER(_("proc_max_pid"));
-    
-  if (0 == access(PROC_PID_MAX, R_OK)) /* flawfinder: ignore */
-    {
-      if (NULL != (fd = fopen(PROC_PID_MAX, "r")))
-        {
-          str[0] = '\0';
-          ret = fgets(str, 128, fd);
-          if (ret && *str != '\0')
-            {
-              pid = strtoul(str, &ptr, 0);
-              if (*ptr == '\0' || *ptr == '\n')
-                {
-                  sl_fclose(FIL__, __LINE__, fd);
-                  *procpid = (size_t) pid;
-                  SL_RETURN(0, _("proc_max_pid"));
-                }
-            }
-          sl_fclose(FIL__, __LINE__, fd);
-        }
-    }
-  SL_RETURN((-1), _("proc_max_pid"));
-}
-#else
-static int proc_max_pid(size_t * procpid)
-{
-  *procpid = sh_maxpid;
-  return 0;
-}
-#endif
-
-static struct sock_store * socklist = NULL;
-
-static void del_sock_all()
-{
-  struct sock_store * del = socklist;
-
-  while (del)
-    {
-      socklist = del->next;
-      if (del->path)
-	SH_FREE(del->path);
-      if (del->user)
-	SH_FREE(del->user);
-      SH_FREE(del);
-      del = socklist;
-    }
-  socklist = NULL;
-  return;
-}
-
-static void add_sock(unsigned long sock, size_t pid)
-{
-  struct sock_store * add = SH_ALLOC(sizeof(struct sock_store));
-
-  add->sock = sock;
-  add->pid  = pid;
-  add->path = NULL;
-  add->user = NULL;
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  get_user_and_path(add);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  add->next = socklist;
-  socklist  = add;
-  return;
-}
-
-static void check_and_add_sock(char * fbuf, size_t pid)
-{
-  if (0 == strncmp(_("socket:["), fbuf, 8))
-    {
-      char * end;
-      unsigned long sock;
-      size_t len = strlen(fbuf);
-      if (fbuf[len-1] == ']')
-	fbuf[len-1] = '\0';
-      sock = strtoul(&fbuf[8], &end, 0);
-      if (*end == '\0' && fbuf[8] != '\0')
-	{
-	  add_sock(sock, pid);
-	}
-    }
-}
-
-static void fetch_socks(size_t pid)
-{
-  char path[128];
-  DIR * dir;
-  sl_snprintf(path, sizeof(path), _("/proc/%lu/fd"), (unsigned long) pid);
-
-  dir = opendir(path);
-  if (dir)
-    {
-      struct dirent *entry;
-      while (NULL != (entry = readdir(dir)))
-	{
-	  char fpath[384];
-	  char fbuf[64];
-	  int  ret;
-	  /* /proc/PID/fd/N-> socket:[15713] */
-	  sl_snprintf(fpath, sizeof(fpath), _("%s/%s"), path, entry->d_name);
-	  ret = readlink(fpath, fbuf, sizeof(fbuf)-1);   /* flawfinder: ignore */
-	  if (ret > 0)
-	    {
-	      fbuf[ret] = '\0';
-	      check_and_add_sock(fbuf, pid);
-	    }
-	}
-      closedir(dir);
-    }
-}
-
-int sh_port2proc_prepare()
-{
-  size_t i;
-  
-  if (0 != proc_max_pid(&sh_maxpid))
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-                      _("Failed to detect max_pid"), 
-                      _("sh_port2proc"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SL_RETURN ((-1), _("sh_port2proc"));
-    }
-
-  /* Delete old socket list and re-create it
-   */
-  del_sock_all();
-
-  for (i = sh_minpid; i < sh_maxpid; ++i)
-    {
-      fetch_socks(i);
-    }
-
-  return 0;
-}
-
-void sh_port2proc_finish()
-{
-  /* Delete old socket list
-   */
-  del_sock_all();
-  return;
-}
-
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-/* returns the command and fills the 'user' array 
- */
-static char * port2proc_query(char * file, int proto, int domain,
-			      struct sh_sockaddr * saddr, int sport, 
-			      unsigned long * pid, char * user, size_t userlen)
-{
-  FILE * fd;
-
-  fd = fopen(file, "r");
-
-  *pid = 0;
-
-#ifdef DEBUG_P2P
-  {
-    char errmsg[256];
-    char siface[SH_IP_BUF];
-    sh_ipvx_ntoa(siface, sizeof(siface), saddr);
-    sl_snprintf(errmsg, sizeof(errmsg), 
-		"query, file=%s, proto=%d, port=%d, iface=%s\n",
-		file, proto, sport, siface);
-    fprintf(stderr, "%s", errmsg);
-  }
-#endif
-
-  if (fd)
-    {
-      unsigned int n, i, port, niface, inode, istatus;
-      char line[512];
-      char ip_port[128];
-      char iface[SH_IP_BUF];
-
-      while (NULL != fgets(line, sizeof(line), fd))
-	{
-	
-#ifdef DEBUG_P2P
-	  {
-	    fprintf(stderr, "%s", line);
-	  }
-#endif
-
-	  if (4 == sscanf(line, 
-			  "%u: %127s %*X:%*X %X %*X:%*X %*X:%*X %*X %*d %*d %u %*s",
-			  &n, ip_port, &istatus, &inode))
-	    {
-	      struct sockaddr_in  addr4;
-	      struct sockaddr_in6 addr6;
-	      struct sh_sockaddr  ss;
-	      
-	      char * p;
-
-	      ip_port[127] = '\0';
-
-	      p = strchr(ip_port, ':');
-
-	      if (p)
-		{
-		  *p = '\0'; ++p;
-		  port = (unsigned int) strtoul(p, NULL, 16);
-		  sl_strlcpy(iface, ip_port, sizeof(iface));
-		}
-	      else
-		{
-		  continue;
-		}
-
-	      niface = 0;
-
-	      switch (domain) 
-		{
-		case AF_INET:
-		  addr4.sin_addr.s_addr = (int) strtol(iface, NULL, 16);
-		  niface = (unsigned int) addr4.sin_addr.s_addr;
-		  sh_ipvx_save(&ss, AF_INET, (struct sockaddr *)&addr4);
-		  break;
-
-		case AF_INET6:
-		  sscanf(iface, 
-			 "%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx", 
-			 &addr6.sin6_addr.s6_addr[3], &addr6.sin6_addr.s6_addr[2], &addr6.sin6_addr.s6_addr[1], &addr6.sin6_addr.s6_addr[0], 
-			 &addr6.sin6_addr.s6_addr[7], &addr6.sin6_addr.s6_addr[6], &addr6.sin6_addr.s6_addr[5], &addr6.sin6_addr.s6_addr[4], 
-			 &addr6.sin6_addr.s6_addr[11], &addr6.sin6_addr.s6_addr[10], &addr6.sin6_addr.s6_addr[9], &addr6.sin6_addr.s6_addr[8], 
-			 &addr6.sin6_addr.s6_addr[15], &addr6.sin6_addr.s6_addr[14], &addr6.sin6_addr.s6_addr[13], &addr6.sin6_addr.s6_addr[12]);
-		  
-		  for (i = 0; i < 16; ++i)
-		    {
-		      if (0 != (unsigned int) addr6.sin6_addr.s6_addr[i]) 
-			++niface;
-		    }
-		  sh_ipvx_save(&ss, AF_INET6, (struct sockaddr *)&addr6);
-		  break;
-		}
-
-#ifdef DEBUG_P2P
-	      {
-		char a[SH_IP_BUF];
-		char b[SH_IP_BUF];
-
-		sh_ipvx_ntoa(a, sizeof(a), &ss);
-		sh_ipvx_ntoa(b, sizeof(b), saddr);
-
-		fprintf(stderr, " -> inode %u, iface/port %s,%u, status %u, searching %s,%u, %u\n", 
-			inode, a, port, istatus, b, sport, 
-			proto == IPPROTO_TCP ? 0x0a : 0x07);
-	      }
-#endif
-
-	      if (proto == IPPROTO_TCP && istatus != 0x0a)
-		continue;
-	      if (proto == IPPROTO_UDP && istatus == 0x01)
-		continue;
-
-#ifdef DEBUG_P2P
-	      {
-		fprintf(stderr, "check iface %u..\n", iface);
-	      }
-#endif
-
-	      if ((proto == IPPROTO_UDP || niface == 0 || 0 == sh_ipvx_cmp(&ss, saddr)) && 
-		  port == (unsigned int)sport)
-		{
-		  struct sock_store * new = socklist;
-
-#ifdef DEBUG_P2P
-		  {
-		    fprintf(stderr, "found it\n");
-		  }
-#endif
-
-		  while (new)
-		    {
-#ifdef DEBUG_P2P
-		      {
-			fprintf(stderr, "searching inode %u: %lu\n", 
-				inode, new->sock);
-		      }
-#endif
-		      if (inode == new->sock)
-			{
-#ifdef DEBUG_P2P
-			  {
-			    fprintf(stderr, "found it: path=(%s), user=(%s)\n",
-				    new->path == NULL ? "NULL" : new->path,
-				    new->user == NULL ? "NULL" : new->user);
-			  }
-#endif
-			  sl_fclose(FIL__, __LINE__, fd);
-			  *pid = (unsigned long) new->pid;
-			  if (new->path)
-			    {
-			      if (new->user)
-				sl_strlcpy(user, new->user, userlen);
-			      else
-				sl_strlcpy(user, "-", userlen);
-			      return sh_util_strdup(new->path);
-			    }
-			  goto err_out;
-			}
-		      new = new->next;
-		    }
-		}
-	    }
-	}
-      sl_fclose(FIL__, __LINE__, fd);
-    }
- err_out:
-  sl_strlcpy(user, "-", userlen);
-  return sh_util_strdup("-");
-}
-
-/* returns the command and fills the 'user' array 
- */
-char * sh_port2proc_query(int proto, struct sh_sockaddr * saddr, int sport, 
-			  unsigned long * pid, char * user, size_t userlen)
-{
-  char file[32];
-  char * ret;
- 
-  if (proto == IPPROTO_TCP)
-    {
-      sl_strlcpy(file, _("/proc/net/tcp"), sizeof(file));
-      ret = port2proc_query(file, proto, AF_INET, saddr, sport, pid, user, userlen);
-
-      if (ret[0] == '-' && ret[1] == '\0')
-	{
-	  SH_FREE(ret);
-	  sl_strlcpy(file, _("/proc/net/tcp6"), sizeof(file));
-	  ret = port2proc_query(file, proto, AF_INET6, saddr, sport, pid, user, userlen);
-	}
-      return ret;
-    }
-  else
-    {
-      char * ret;
-      sl_strlcpy(file, _("/proc/net/udp"), sizeof(file));
-      ret = port2proc_query(file, proto, AF_INET, saddr, sport, pid, user, userlen);
-
-      if (ret[0] == '-' && ret[1] == '\0')
-	{
-	  SH_FREE(ret);
-	  sl_strlcpy(file, _("/proc/net/udp6"), sizeof(file));
-	  ret = port2proc_query(file, proto, AF_INET6, saddr, sport, pid, user, userlen);
-	}
-      return ret;
-    }
-}
-
-
-/****************************************************************************
- *
- *  >>> FREEBSD CODE <<<
- *
- ****************************************************************************/
-
-#elif defined(__FreeBSD__)
-
-/* Uses code from sockstat.c. Error and memory handling modified.
- * Only required functions from sockstat.c are included.
- */
-
-/*-
- * Copyright (c) 2002 Dag-Erling Co<EF>dan Sm<F8>rgrav
- * 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
- *    in this position and unchanged.
- * 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. The name of the author may not 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.
- */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/sockstat/sockstat.c,v 1.13.2.1.4.1 2008/10/02 02:57:24 kensmith Exp $");
-
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/sysctl.h>
-#include <sys/file.h>
-#include <sys/user.h>
-
-#include <sys/un.h>
-#include <sys/unpcb.h>
-
-#include <net/route.h>
-
-#include <netinet/in.h>
-#include <netinet/in_pcb.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/tcp_var.h>
-#include <arpa/inet.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <unistd.h>
-
-static int       opt_4 = 1;         /* Show IPv4 sockets */
-static int       opt_6 = 1;         /* Show IPv6 sockets */
-static int       opt_c = 0;         /* Show connected sockets */
-static int       opt_l = 1;         /* Show listening sockets */
-static int       opt_v = 0;         /* Verbose mode */
-
-struct sock {
-        void *socket;
-        void *pcb;
-        int vflag;
-        int family;
-        int proto;
-
-        struct sockaddr_storage laddr;
-        struct sockaddr_storage faddr;
-        struct sock *next;
-};
-
-#define HASHSIZE 1009
-static struct sock *sockhash[HASHSIZE];
-
-static struct xfile *xfiles;
-static int nxfiles;
-
-
-static void * xrealloc(void * buf, size_t len0, size_t len)
-{
-  if (len > 0)
-    {
-      void * xbuf = SH_ALLOC(len);
-      if (buf)
-	{
-	  if (len0 <= len)
-	    memcpy(xbuf, buf, len0);
-	  else
-	    memset(xbuf, 0, len);
-	  SH_FREE(buf);
-	}
-      return xbuf;
-    }
-  SH_FREE(buf);
-  return NULL;
-}
-
-/* Sets address and port in struct sockaddr_storage *sa
- */
-static void
-sockaddr(struct sockaddr_storage *sa, int af, void *addr, int port)
-{
-        struct sockaddr_in *sin4;
-        struct sockaddr_in6 *sin6;
-
-        bzero(sa, sizeof *sa);
-        switch (af) {
-        case AF_INET:
-                sin4 = (struct sockaddr_in *)sa;
-                sin4->sin_len = sizeof *sin4;
-                sin4->sin_family = af;
-                sin4->sin_port = port;
-                sin4->sin_addr = *(struct in_addr *)addr;
-                break;
-        case AF_INET6:
-                sin6 = (struct sockaddr_in6 *)sa;
-                sin6->sin6_len = sizeof *sin6;
-                sin6->sin6_family = af;
-                sin6->sin6_port = port;
-                sin6->sin6_addr = *(struct in6_addr *)addr;
-                break;
-        default:
-                return;
-        }
-}
-
-/* Get socket information from the kernel.
- */
-static void
-gather_inet(int proto)
-{
-        struct xinpgen *xig, *exig;
-        struct xinpcb *xip;
-        struct xtcpcb *xtp;
-        struct inpcb *inp;
-        struct xsocket *so;
-        struct sock *sock;
-        char varname[32];
-        size_t len, bufsize, bufsize0;
-        void *buf;
-        int hash, retry, vflag;
-
-        vflag = 0;
-        if (opt_4)
-                vflag |= INP_IPV4;
-        if (opt_6)
-                vflag |= INP_IPV6;
-
-        switch (proto) {
-        case IPPROTO_TCP:
-	  sl_strlcpy(varname, _("net.inet.tcp.pcblist"), sizeof(varname));
-                break;
-        case IPPROTO_UDP:
-                sl_strlcpy(varname, _("net.inet.udp.pcblist"), sizeof(varname));
-                break;
-        case IPPROTO_DIVERT:
-                sl_strlcpy(varname, _("net.inet.divert.pcblist"), sizeof(varname));
-                break;
-        default:
-                return;
-        }
-
-        buf = NULL;
-        bufsize  = 8192;
-	bufsize0 = bufsize;
-        retry = 5;
-        do {
-                for (;;) {
-		        buf = xrealloc(buf, bufsize0, bufsize);
-			bufsize0 = bufsize;
-                        len = bufsize;
-                        if (sysctlbyname(varname, buf, &len, NULL, 0) == 0)
-                                break;
-		        if (errno == ENOENT)
-                                goto out;
-                        if (errno != ENOMEM)
-			  {
-			    SH_MUTEX_LOCK(mutex_thread_nolog);
-			    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 
-					    0, MSG_E_SUBGEN, 
-					    _("sysctlbyname()"), 
-					    _("gather_inet"));
-			    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-			    SH_FREE(buf);
-			    return;
-			  }
-                        bufsize *= 2;
-                }
-                xig = (struct xinpgen *)buf;
-                exig = (struct xinpgen *)(void *)
-                    ((char *)buf + len - sizeof *exig);
-                if (xig->xig_len != sizeof *xig ||
-                    exig->xig_len != sizeof *exig)
-		  {
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-				    _("struct xinpgen size mismatch"), 
-				    _("gather_inet"));
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		    goto out;
-		  }
-
-        } while (xig->xig_gen != exig->xig_gen && retry--);
-
-        if (xig->xig_gen != exig->xig_gen && opt_v)
-		  {
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-				    _("data may be inconsistent"), 
-				    _("gather_inet"));
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		  }
-
-        for (;;) {
-                xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len);
-                if (xig >= exig)
-                        break;
-                switch (proto) {
-                case IPPROTO_TCP:
-                        xtp = (struct xtcpcb *)xig;
-                        if (xtp->xt_len != sizeof *xtp) {
-				SH_MUTEX_LOCK(mutex_thread_nolog);
-				sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-						_("struct xtcpcb size mismatch"), 
-						_("gather_inet"));
-				SH_MUTEX_UNLOCK(mutex_thread_nolog);
-                                goto out;
-                        }
-                        inp = &xtp->xt_inp;
-                        so = &xtp->xt_socket;
-                        break;
-                case IPPROTO_UDP:
-                case IPPROTO_DIVERT:
-                        xip = (struct xinpcb *)xig;
-                        if (xip->xi_len != sizeof *xip) {
-				SH_MUTEX_LOCK(mutex_thread_nolog);
-				sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-						_("struct xinpcb size mismatch"), 
-						_("gather_inet"));
-				SH_MUTEX_UNLOCK(mutex_thread_nolog);
-                                goto out;
-                        }
-                        inp = &xip->xi_inp;
-                        so = &xip->xi_socket;
-                        break;
-                default:
-                        return;
-                }
-                if ((inp->inp_vflag & vflag) == 0)
-                        continue;
-                if (inp->inp_vflag & INP_IPV4) {
-                        if ((inp->inp_fport == 0 && !opt_l) ||
-                            (inp->inp_fport != 0 && !opt_c))
-                                continue;
-                } else if (inp->inp_vflag & INP_IPV6) {
-#ifndef in6p_fport
-#define in6p_fport inp_fport
-#endif
-                        if ((inp->in6p_fport == 0 && !opt_l) ||
-                            (inp->in6p_fport != 0 && !opt_c))
-                                continue;
-                } else {
-		        if (opt_v) {
-			        char errmsg[64];
-                                sl_snprintf(errmsg, sizeof(errmsg), 
-					    _("invalid vflag 0x%x"), inp->inp_vflag);
-				SH_MUTEX_LOCK(mutex_thread_nolog);
-				sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-						errmsg, 
-						_("gather_inet"));
-				SH_MUTEX_UNLOCK(mutex_thread_nolog);
-				continue;
-			}
-                }
-
-                sock = SH_ALLOC(sizeof *sock);
-		memset(sock, 0, sizeof (*sock));
-
-#ifndef in6p_lport
-#define in6p_lport inp_lport
-#endif
-                sock->socket = so->xso_so;
-                sock->proto = proto;
-                if (inp->inp_vflag & INP_IPV4) {
-                        sock->family = AF_INET;
-                        sockaddr(&sock->laddr, sock->family,
-                            &inp->inp_laddr, inp->inp_lport);
-                        sockaddr(&sock->faddr, sock->family,
-                            &inp->inp_faddr, inp->inp_fport);
-                } else if (inp->inp_vflag & INP_IPV6) {
-                        sock->family = AF_INET6;
-                        sockaddr(&sock->laddr, sock->family,
-                            &inp->in6p_laddr, inp->in6p_lport);
-                        sockaddr(&sock->faddr, sock->family,
-                            &inp->in6p_faddr, inp->in6p_fport);
-                }
-                sock->vflag = inp->inp_vflag;
-
-                hash = (int)((uintptr_t)sock->socket % HASHSIZE);
-                sock->next = sockhash[hash];
-                sockhash[hash] = sock;
-        }
-out:
-	if (buf)
-	  SH_FREE(buf);
-}
-
-static void
-getfiles(void)
-{
-        size_t len;
-        size_t len0;
-
-        xfiles = SH_ALLOC(len = sizeof *xfiles);
-	len0   = len;
-
-        while (sysctlbyname(_("kern.file"), xfiles, &len, 0, 0) == -1) {
-                if (errno != ENOMEM)
-		  {
-		    volatile int status = errno;
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
-				    _("sysctlbyname()"),
-				    _("getfiles"));
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		  }
-                len *= 2;
-                xfiles = xrealloc(xfiles, len0, len);
-		len0   = len;
-        }
-        if (len > 0 && xfiles->xf_size != sizeof *xfiles)
-                if (errno != ENOMEM)
-		  {
-		    volatile int status = errno;
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
-				    _("struct xfile size mismatch"),
-				    _("getfiles"));
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		  }
-        nxfiles = len / sizeof *xfiles;
-}
-
-static const char *
-getprocname(pid_t pid)
-{
-        static struct kinfo_proc proc;
-        size_t len;
-        int mib[4];
-
-        mib[0] = CTL_KERN;
-        mib[1] = KERN_PROC;
-        mib[2] = KERN_PROC_PID;
-        mib[3] = (int)pid;
-        len = sizeof proc;
-        if (sysctl(mib, 4, &proc, &len, NULL, 0) == -1) {
-                /* Do not warn if the process exits before we get its name. */
-                if (errno != ESRCH)
-		  {
-		    volatile int status = errno;
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, status, MSG_E_SUBGEN,
-				    _("sysctl()"),
-				    _("getfiles"));
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		  }
-                return ("-");
-        }
-        return (proc.ki_ocomm);
-}
-
-char * sh_port2proc_query(int proto, struct sh_sockaddr * saddr, int sport,
-			  unsigned long * pid, char * user, size_t userlen)
-{
-  int n, hash;
-  struct xfile *xf;
-  struct in_addr  * haddr  = NULL;
-  struct in6_addr * haddr6 = NULL;
-  struct sock * s;
-  struct in6_addr   anyaddr = IN6ADDR_ANY_INIT; 
-
-  *pid = 0;
-  
-  for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) {
-    
-    if (xf->xf_data == NULL)
-      continue;
-    
-    /* Find the socket in sockhash[] that corresponds to it
-     */
-    hash = (int)((uintptr_t)xf->xf_data % HASHSIZE);
-    for (s = sockhash[hash]; s != NULL; s = s->next)
-      if ((void *)s->socket == xf->xf_data)
-	break;
-    
-    if (!s)
-      continue;
-
-    if (s->proto != proto)
-      continue;
-
-    if (s->family != AF_INET && s->family != AF_INET6)
-      continue;
-
-    if (s->family == AF_INET &&
-	(sport != ntohs(((struct sockaddr_in *)(&s->laddr))->sin_port)))
-      continue;
-
-    if (s->family == AF_INET6 &&
-	(sport != ntohs(((struct sockaddr_in6 *)(&s->laddr))->sin6_port)))
-      continue;
-
-    if (s->family == AF_INET)
-      haddr  = &((struct sockaddr_in  *)(&s->laddr))->sin_addr;
-    if (s->family == AF_INET6)
-      haddr6 = &((struct sockaddr_in6 *)(&s->laddr))->sin6_addr;
-    
-
-    if ( (s->family == AF_INET && 
-	  (haddr->s_addr == (saddr->sin).sin_addr.s_addr || 
-	   sh_ipvx_isany(saddr) || 
-	   inet_lnaof(*haddr) == INADDR_ANY))
-	 ||
-	 (s->family == AF_INET6 &&
-	  (0 == memcmp(haddr6->s6_addr, &((saddr->sin6).sin6_addr.s6_addr), 16) ||
-	   0 == memcmp(haddr6->s6_addr, &(anyaddr.s6_addr), 16) ||
-	   sh_ipvx_isany(saddr) ))
-	 )
-      {
-	struct sock_store try;
-	
-	*pid = xf->xf_pid;
-
-	try.pid  = xf->xf_pid;
-	try.path = NULL;
-	try.user = NULL;
-	get_user_and_path (&try); /* Try to get info from /proc */
-
-	if (try.path == NULL)
-	  {
-	    extern char * sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len);
-	    char * tmp  = sh_unix_getUIDname (SH_ERR_ALL, xf->xf_uid, user, userlen);
-	    if (!tmp)
-	      sl_snprintf (user, userlen, "%ld", (unsigned long) xf->xf_uid);
-	    return sh_util_strdup(getprocname(xf->xf_pid));
-	  }
-	else
-	  {
-	    sl_strlcpy(user, try.user, userlen);
-	    SH_FREE(try.user);
-	    return try.path;
-	  }
-      }
-  }
-  sl_strlcpy(user, "-", userlen);
-  return sh_util_strdup("-");
-}
-
-static void sockdel(struct sock * sock)
-{
-  if (sock)
-    {
-      if (sock->next)
-	sockdel(sock->next);
-      SH_FREE(sock);
-    }
-  return;
-}
-
-int sh_port2proc_prepare()
-{
-  int i;
-
-  if (xfiles)
-    {
-      SH_FREE(xfiles);
-      xfiles = NULL;
-    }
-
-  for (i = 0; i < HASHSIZE; ++i)
-    {
-      sockdel(sockhash[i]);
-      sockhash[i] = NULL;
-    }
-
-  /* Inet connections
-   */
-  gather_inet(IPPROTO_TCP);
-  gather_inet(IPPROTO_UDP);
-  gather_inet(IPPROTO_DIVERT);
-
-  getfiles();
-
-  return 0;
-}
-
-void sh_port2proc_finish()
-{
-  return;
-}
-
-#else /* !defined(__linux__) && !defined(__FreeBSD__) */
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_ipvx.h"
-
-char * sh_port2proc_query(int proto, struct sh_sockaddr * saddr, int sport,
-			  unsigned long * pid, char * user, size_t userlen)
-{
-  (void) proto;
-  (void) saddr;
-  (void) sport;
-
-  *pid = 0;
-
-  sl_strlcpy(user, "-", userlen);
-  return sh_util_strdup("-");
-}
-
-int sh_port2proc_prepare()
-{
-  return 0;
-}
-
-void sh_port2proc_finish()
-{
-  return;
-}
-#endif
-
-#endif /* defined(SH_USE_PORTCHECK) */
Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 591)
+++ 	(revision )
@@ -1,2703 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2006 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-/***************************************************************************
- *
- * This file provides a module for samhain to check for open ports
- * on the local machine.
- *
- */
-
-
-/* #define TEST_ONLY */
-#ifndef TEST_ONLY
-#include "config_xor.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#ifdef HAVE_IFADDRS_H
-#include <ifaddrs.h>
-#include <netdb.h>
-#endif
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#define PORTCHK_VERSION "1.1"
-
-#if defined(TEST_ONLY) || (defined(SH_USE_PORTCHECK) && (defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)))
-
-
-#define PORTMAP
-#ifdef  HAVE_RPC_RPC_H
-#include <rpc/rpc.h>
-#ifdef  HAVE_RPC_RPCENT_H
-#include <rpc/rpcent.h>
-#endif
-#include <rpc/pmap_clnt.h>
-#include <rpc/pmap_prot.h>
-#endif
-#include <netdb.h>
-
-/*
- * struct pmaplist {
- *      struct pmap     pml_map;
- *      struct pmaplist *pml_next;
- * };
- */
-
-/* struct pmap {
- *      long unsigned pm_prog;
- *      long unsigned pm_vers;
- *      long unsigned pm_prot;
- *      long unsigned pm_port;
- * };
- */
-
-/* TIME_WAIT ? 60-240 seconds */
-
-#if !defined(TEST_ONLY)
-
-#define FIL__ _("sh_portcheck.c")
-#include "samhain.h"
-#include "sh_error.h"
-#include "sh_mem.h"
-#include "sh_calls.h"
-#include "sh_utils.h"
-#include "sh_modules.h"
-#define SH_NEED_GETHOSTBYXXX
-#include "sh_static.h"
-#include "sh_pthread.h"
-#include "sh_ipvx.h"
-
-/* the size of an interface string 
- */
-#define SH_INTERFACE_SIZE SH_IP_BUF
-
-#define SH_PORT_NOT 0
-#define SH_PORT_REQ 1
-#define SH_PORT_OPT 2
-#define SH_PORT_IGN 3
-#define SH_PORT_BLACKLIST 4
-
-static char * sh_port_type2str (int type)
-{
-  if (type == 0) return _("not");
-  if (type == 1) return _("req");
-  if (type == 2) return _("opt");
-  if (type == 3) return _("ign");
-  if (type == 4) return _("blc");
-  return _("???");
-}
-
-#define SH_PORT_MISS 0
-#define SH_PORT_ISOK 1
-#define SH_PORT_UNKN 2
-
-#define SH_PORT_NOREPT 0
-#define SH_PORT_REPORT 1
-
-#define SH_PROTO_TCP 0
-#define SH_PROTO_UDP 1
-#define SH_PROTO_STR(a) (((a) == IPPROTO_TCP) ? _("tcp") : _("udp"))
-
-struct sh_portentry {
-  int  port;
-  char interface[SH_INTERFACE_SIZE];
-  char * service;
-  char * error;
-  int  flag;    /* required or not */
-  int  status;  /* missing or not  */
-  struct sh_portentry * next;
-};
-
-static struct sh_portentry * portlist_tcp = NULL;
-static struct sh_portentry * portlist_udp = NULL;
-
-
-#define SH_PORTCHK_INTERVAL 300
-
-static int sh_portchk_check_udp  = 1;
-static int sh_portchk_active     = 1;
-static int sh_portchk_same_ports = 1;
-static int sh_portchk_transients = 1;
-static int sh_portchk_interval   = SH_PORTCHK_INTERVAL;
-
-static int sh_portchk_minport = -1;
-static int sh_portchk_maxport = -1;
-
-struct sh_port {
-  int                  port;
-  struct sh_sockaddr * paddr;
-  struct sh_port     * next;
-};
-
-static struct sh_port * blacklist_tcp = NULL;
-static struct sh_port * blacklist_udp = NULL;
-
-static struct sh_port * transient_tcp = NULL;
-static struct sh_port * transient_udp = NULL;
-
-SH_MUTEX_STATIC(mutex_port_check, PTHREAD_MUTEX_INITIALIZER);
-
-static int sh_portchk_severity  = SH_ERR_SEVERE;
-
-extern char * sh_port2proc_query(int proto, struct sh_sockaddr * saddr, int sport,
-				 unsigned long * pid, char * user, size_t userlen);
-extern int sh_port2proc_prepare();
-extern void sh_port2proc_finish();
-
-#endif
-
-/* Exported interface to add ignoreable ports as 'iface:portlist'
- */
-static int sh_portchk_add_ignore (const char * str);
-
-/* Exported interface to add required ports as 'iface:portlist'
- */
-static int sh_portchk_add_required (const char * str);
-
-/* Exported interface to add optional ports as 'iface:portlist'
- */
-static int sh_portchk_add_optional (const char * str);
-
-/* Exported interface to add blacklisted ports as 'iface:portlist'
- */
-static int sh_portchk_add_blacklist (const char * str);
-
-/* Exported interface to add an ethernet interface
- */
-static int sh_portchk_add_interface (const char * str);
-
-#if defined(HAVE_IFADDRS_H)
-/* Exported interface to add an ethernet device
- */
-static int sh_portchk_add_device (const char * str);
-#endif
-
-/* verify whether port/interface is blacklisted (do not check)
- */
-static int sh_portchk_is_blacklisted(int port, struct sh_sockaddr * haddr, int proto);
-
-/* verify whether port/interface is transient (used as source port hence no check required)
- */
-static int sh_portchk_is_transient(int port, struct sh_sockaddr * haddr, int proto);
-static int sh_portchk_transient(int port, struct sh_sockaddr * haddr, int proto);
-
-#ifndef TEST_ONLY
-
-static int sh_portchk_set_interval (const char * c)
-{
-  int retval = 0;
-  long val;
-
-  SL_ENTER(_("sh_portchk_set_interval"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val <= 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("port check interval"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      retval = -1;
-    }
-  else
-    {
-      sh_portchk_interval = (time_t) val;
-    }
-  SL_RETURN(retval, _("sh_portchk_set_interval"));
-}
-
-static int sh_portchk_set_port_minmax (const char * c, int * setthis)
-{
-  int retval = 0;
-  long val;
-
-  SL_ENTER(_("sh_portchk_set_port_minmax"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val < 0 || val > 65535)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("port check port minmax"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      retval = -1;
-    }
-  else
-    {
-      *setthis = (int) val;
-    }
-  SL_RETURN(retval, _("sh_portchk_set_port_minmax"));
-}
-
-
-static int sh_portchk_set_minport     (const char * str)
-{
-  return sh_portchk_set_port_minmax (str, &sh_portchk_minport);
-}
-
-static int sh_portchk_set_maxport     (const char * str)
-{
-  return sh_portchk_set_port_minmax (str, &sh_portchk_maxport);
-}
-
-static int sh_portchk_set_active     (const char * str)
-{
-  return sh_util_flagval(str, &sh_portchk_active);
-}
-
-static int sh_portchk_set_udp        (const char * str)
-{
-  return sh_util_flagval(str, &sh_portchk_check_udp);
-}
-#if defined(SH_ALLOW_RESTORE)
-static int sh_portchk_set_transients (const char * str)
-{
-  return sh_util_flagval(str, &sh_portchk_transients);
-}
-
-static int sh_portchk_set_same_ports (const char * str)
-{
-  return sh_util_flagval(str, &sh_portchk_same_ports);
-}
-#endif
-static int sh_portchk_set_severity   (const char * str)
-{
-  char tmp[32];
-  tmp[0] = '='; tmp[1] = '\0';
-  sl_strlcat (tmp, str, 32);
-  return sh_error_set_level (tmp, &sh_portchk_severity);
-}
-
-sh_rconf sh_portchk_table[] = {
-    {
-        N_("severityportcheck"),
-        sh_portchk_set_severity,
-    },
-    {
-        N_("portcheckrequired"),
-        sh_portchk_add_required,
-    },
-    {
-        N_("portcheckoptional"),
-        sh_portchk_add_optional,
-    },
-    {
-        N_("portcheckignore"),
-        sh_portchk_add_ignore,
-    },
-    {
-        N_("portcheckskip"),
-        sh_portchk_add_blacklist,
-    },
-    {
-        N_("portcheckactive"),
-        sh_portchk_set_active,
-    },
-#if defined(HAVE_IFADDRS_H)
-    {
-        N_("portcheckdevice"),
-        sh_portchk_add_device,
-    },
-#endif
-    {
-        N_("portcheckinterface"),
-        sh_portchk_add_interface,
-    },
-    {
-        N_("portcheckinterval"),
-        sh_portchk_set_interval,
-    },
-    {
-        N_("portcheckminport"),
-        sh_portchk_set_minport,
-    },
-    {
-        N_("portcheckmaxport"),
-        sh_portchk_set_maxport,
-    },
-    {
-        N_("portcheckudp"),
-        sh_portchk_set_udp,
-    },
-#if defined(SH_ALLOW_RESTORE)
-    {
-        N_("portchecktransients"),
-        sh_portchk_set_transients,
-    },
-    {
-        N_("portchecksameports"),
-        sh_portchk_set_same_ports,
-    },
-#endif
-    {
-        NULL,
-        NULL
-    }
-};
-
-#endif
-
-/* Interface to initialize port check
- */
-int sh_portchk_init (struct mod_type * arg);
-
-/* Interface to reset port check
- */
-int sh_portchk_reset (void);
-
-/* Interface to run port check
- */
-int sh_portchk_check (void);
-
-
-static char * check_services (int port, int proto);
-
-#ifdef TEST_ONLY
-
-static int portchk_debug = 0; 
-#define SH_ALLOC       malloc
-#define SH_FREE        free
-#define sh_util_strdup strdup
-#define sl_strlcpy     strncpy
-#define _(a)           a
-
-#else
-
-static int portchk_debug = 0;
-
-#endif
-
-#ifdef  HAVE_RPC_RPC_H
-static char * sh_getrpcbynumber (int number, char * buf, size_t len)
-{
-  FILE * fp;
-
-  if (NULL != (fp = fopen(_("/etc/rpc"), "r")))
-    {
-      sh_string * s = sh_string_new(0);
-      while (0 < sh_string_read(s, fp, 1024))
-	{
-	  char * p = sh_string_str(s);
-	  while (*p && (*p == ' ' || *p == '\t')) ++p; /* skip whitespace */
-	  if (*p == '\0' || *p == '#') 
-	    continue; /* skip comment */
-	  else
-	    {
-	      size_t lengths[3];
- 	      unsigned int  fields = 3;
- 	      char * q             = sh_string_str(s);
-	      char ** splits       = split_array_ws(q, &fields, lengths);
-
-	      if (fields >= 2)
-		{
-		  int n = atoi(splits[1]);
-		  if (n == number)
-		    {
-		      sl_strlcpy(buf, splits[0], len);
-		      SH_FREE(splits);
-		      sh_string_destroy(&s);
-		      sl_fclose(FIL__, __LINE__, fp);
-		      return buf;
-		    }
-		}
-	      SH_FREE(splits);
-	    }
-	}
-      sh_string_destroy(&s);
-      sl_fclose(FIL__, __LINE__, fp);
-    }
-  /* cppcheck-suppress resourceLeak */
-  return NULL;
-}
-#endif
-
-static char * sh_getservbyport (int port, const char * proto_in, char * buf, size_t len)
-{
-  FILE * fp;
-  char   proto[8];
-
-  sl_strlcpy(proto, proto_in, sizeof(proto));
-
-  if (NULL != (fp = fopen(_("/etc/services"), "r")))
-    {
-      sh_string * s = sh_string_new(0);
-      while (0 < sh_string_read(s, fp, 1024))
-	{
-	  char * p = sh_string_str(s);
-	  while (*p && (*p == ' ' || *p == '\t')) ++p; /* skip whitespace */
-	  if (*p == '\0' || *p == '#')
-	    continue; /* skip comment */
-	  else
-	    {
-	      size_t lengths[3];
- 	      unsigned int  fields = 3;
- 	      char * q             = sh_string_str(s);
-	      char ** splits       = split_array_ws(q, &fields, lengths);
-
-	      if (fields >= 2)
-		{
-		  char * end;
-		  long n = strtol(splits[1], &end, 10);
-		  if (n == port && end && (*end == '/' || *end == ','))
-		    {
-		      ++end;
-		      if (0 == strcmp(end, proto))
-			{
-			  sl_strlcpy(buf, splits[0], len);
-			  SH_FREE(splits);
-			  sh_string_destroy(&s);
-			  sl_fclose(FIL__, __LINE__, fp);
-			  return buf;
-			}
-		    }
-		}
-	      SH_FREE(splits);
-	    }
-	}
-      sh_string_destroy(&s);
-      sl_fclose(FIL__, __LINE__, fp);
-    }
-  /* cppcheck-suppress resourceLeak */
-  return NULL;
-}
-
-static void sh_portchk_add_to_list (int proto, 
-				    int port, struct sh_sockaddr * paddr, 
-				    char * service,
-				    int flag, int status)
-{
-  struct sh_portentry * new = SH_ALLOC (sizeof(struct sh_portentry));
-
-  new->port = port;
-  sh_ipvx_ntoa(new->interface, SH_INTERFACE_SIZE, paddr);
-  new->status = status;
-  new->flag   = flag;
-
-  new->error  = NULL;
-
-  if (portchk_debug)
-    fprintf(stderr, _("add to list: port %d/%s %d %d (%s) %s\n"),
-	    port, SH_PROTO_STR(proto), flag, status, service ? service : _("undef"),
-	    new->interface);
-
-  if (service)
-    new->service = sh_util_strdup (service);
-  else
-    new->service = NULL;
-  if (proto == IPPROTO_TCP)
-    {
-      new->next = portlist_tcp;
-      portlist_tcp = new;
-    }
-  else
-    {
-      new->next = portlist_udp;
-      portlist_udp = new;
-    }
-  return;
-}
-
-/* Reset the list by setting all entries to UNKN.
- * In the next cycle we will check, and set found ports to ISOK.
- * Thereafter, we check for entries that are still UNKN.
- */
-static void sh_portchk_reset_lists (void)
-{
-  struct sh_portentry * portlist;
-
-  portlist = portlist_tcp;
-  while (portlist)
-    {
-      if (portlist->status != SH_PORT_MISS)
-	portlist->status = SH_PORT_UNKN;
-      portlist = portlist->next;
-    }
-  portlist = portlist_udp;
-  while (portlist)
-    {
-      if (portlist->status != SH_PORT_MISS)
-	portlist->status = SH_PORT_UNKN;
-      portlist = portlist->next;
-    }
-  return;
-}
-
-static struct sh_portentry * sh_portchk_kill_list (struct sh_portentry * head)
-{
-  if (head)
-    {
-      if (head->next)
-	sh_portchk_kill_list (head->next);
-
-      if (head->service)
-	SH_FREE(head->service);
-      SH_FREE(head);
-    }
-  return NULL;
-}
-  
-static struct sh_port * sh_portchk_kill_blacklist (struct sh_port * head)
-{
-  if (head)
-    {
-      if (head->next)
-	sh_portchk_kill_blacklist (head->next);
-
-      SH_FREE(head->paddr);
-      SH_FREE(head);
-    }
-  return NULL;
-}
-  
-static struct sh_port * sh_portchk_kill_transient (struct sh_port * head)
-{
-  if (head)
-    {
-      if (head->next)
-	sh_portchk_kill_transient (head->next);
-
-      SH_FREE(head->paddr);
-      SH_FREE(head);
-    }
-  return NULL;
-}
-  
-/* These variables are not used anywhere. They only exist
- * to assign &pre, &ptr to them, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_531_pre = NULL;
-void * sh_dummy_532_ptr = NULL;
-
-/* check the list of open ports for any that are marked as UNKN
- */
-static void sh_portchk_check_list (struct sh_portentry ** head, 
-				   int proto, int report)
-{
-  struct sh_portentry * ptr = *head;
-  struct sh_portentry * pre = *head;
-  char errbuf[512];
-
-  /* Take the address to keep gcc from putting them into registers. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_531_pre = (void*) &pre;
-  sh_dummy_532_ptr = (void*) &ptr;
- 
-  while (ptr)
-    {
-      if (portchk_debug && report)
-	fprintf(stderr, _("check list: port %d/%s %d %d\n"),
-		ptr->port, SH_PROTO_STR(proto), ptr->flag, ptr->status);
-
-      if (ptr->status == SH_PORT_UNKN)
-	{
-	  /* Don't report missing ports that are marked as optional
-	   */
-	  if (ptr->flag != SH_PORT_OPT && ptr->flag != SH_PORT_IGN)
-	    {
-	      snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s)"), 
-			ptr->interface, ptr->port, SH_PROTO_STR(proto), 
-			ptr->service ? ptr->service : check_services(ptr->port, proto));
-#ifdef TEST_ONLY
-	      if (report == SH_PORT_REPORT)
-		fprintf(stderr, _("%s\n"), errbuf);
-#else
-	      if (report == SH_PORT_REPORT)
-		{
-		  SH_MUTEX_LOCK(mutex_thread_nolog);
-		  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-				  MSG_PORT_MISS, errbuf);
-		  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		}
-#endif
-	    }
-
-	  ptr->status = SH_PORT_MISS;
-
-	  if ((ptr->flag != SH_PORT_REQ) && (ptr->flag != SH_PORT_OPT) && (ptr->flag != SH_PORT_IGN))
-	    {
-	      if (portchk_debug && report)
-		fprintf(stderr, _("removing: port %d/%s %d %d\n"),
-			ptr->port, SH_PROTO_STR(proto), ptr->flag, ptr->status);
-	      
-	      if (ptr == *head)
-		{
-		  *head = ptr->next;
-		  if (ptr->service)
-		    SH_FREE(ptr->service);
-		  SH_FREE(ptr);
-		  ptr = *head;
-		  pre = *head;
-		  continue;
-		}
-	      else if (ptr->next == NULL)
-		{
-		  pre->next = NULL;
-		  if (ptr->service)
-		    SH_FREE(ptr->service);
-		  SH_FREE(ptr);
-		  return;
-		}
-	      else
-		{
-		  pre->next = ptr->next;
-		  if (ptr->service)
-		    SH_FREE(ptr->service);
-		  SH_FREE(ptr);
-		  ptr = pre->next;
-		  continue;
-		}
-	    }
-	}
-      pre = ptr;
-      ptr = ptr->next;
-    }
-
-  sh_dummy_532_ptr = NULL;
-  sh_dummy_531_pre = NULL;
-
-  return;
-}
-
-
-static struct sh_portentry * sh_portchk_get_from_list (int proto, int port, 
-						       struct sh_sockaddr * paddr, char * service)
-{
-  struct sh_portentry * portlist;
-  char str_addr[SH_IP_BUF];
-
-
-  if (proto == IPPROTO_TCP)
-    portlist = portlist_tcp;
-  else
-    portlist = portlist_udp;
-
-  sh_ipvx_ntoa(str_addr, sizeof(str_addr), paddr);
-
-  if (service)
-    {
-      while (portlist) 
-	{
-	  if (portlist->service && 
-	      0 == strcmp(service, portlist->service) &&
-	      ( 0 == strcmp(portlist->interface, str_addr) ||
-	        sh_ipvx_isany(paddr) ))
-	    return portlist;
-	  portlist = portlist->next;
-	}
-    }
-  else
-    {
-      while (portlist) 
-	{
-	  if (port == portlist->port &&
-	      (0 == strcmp(portlist->interface, str_addr)  ||
-	       sh_ipvx_isany(paddr) ))
-	    return portlist;
-	  portlist = portlist->next;
-	}
-    }
-  return NULL;
-}
-      
-
-static void sh_portchk_cmp_to_list (int proto, int port, 
-				    struct sh_sockaddr * paddr, char * service)
-{
-  struct sh_portentry * portent;
-  char errbuf[512];
-
-  
-  portent = sh_portchk_get_from_list (proto, port, paddr, service);
-
-  if (service)
-    {
-      if (!portent)
-	{
-	  char * path;
-	  unsigned long qpid;
-	  char   user[USER_MAX];
-	  char   saddr[SH_IP_BUF];
-
-	  sh_ipvx_ntoa(saddr, sizeof(saddr), paddr);
-
-	  snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s)"), 
-		    saddr, port, SH_PROTO_STR(proto), service);
-
-	  if (portchk_debug)
-	    fprintf(stderr, _("cmp_to_list: open port: %s:%d/%s (%s)\n"), 
-		    saddr, port, SH_PROTO_STR(proto), service);
-
-#ifndef TEST_ONLY
-	  path = sh_port2proc_query(proto, paddr, port, &qpid, user, sizeof(user));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-			  MSG_PORT_NEW, errbuf, path, qpid, user);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(path);
-#endif
-	  /* 
-	   * was not there, thus it is not in 'required' or 'optional' list
-	   */
-	  sh_portchk_add_to_list (proto, port, paddr, service, SH_PORT_NOT, SH_PORT_ISOK);
-	}
-      else if (portent->status == SH_PORT_MISS && portent->flag != SH_PORT_IGN)
-	{
-	  char * path;
-	  unsigned long qpid;
-	  char   user[USER_MAX];
-	  char   saddr[SH_IP_BUF];
-
-	  sh_ipvx_ntoa(saddr, sizeof(saddr), paddr);
-
-	  snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s), was %d/%s"), 
-		    saddr, port, SH_PROTO_STR(proto), service, portent->port, SH_PROTO_STR(proto));
-#ifdef TEST_ONLY
-	  fprintf(stderr, _("service: %s\n"), errbuf);
-#else
-	  path = sh_port2proc_query(proto, paddr, port, &qpid, user, sizeof(user));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-			  MSG_PORT_RESTART, errbuf, path, qpid, user);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(path);
-#endif
-
-	  portent->status = SH_PORT_ISOK;
-	}
-      else if (port != portent->port && (-1) != portent->port)
-	{
-	  char * path;
-	  unsigned long qpid;
-	  char   user[USER_MAX];
-	  char   saddr[SH_IP_BUF];
-
-	  sh_ipvx_ntoa(saddr, sizeof(saddr), paddr);
-
-	  snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s), was %d/%s"), 
-		    saddr, port, SH_PROTO_STR(proto), service, portent->port, SH_PROTO_STR(proto));
-#ifdef TEST_ONLY
-	  fprintf(stderr, _("service: %s\n"), errbuf);
-#else
-	  path = sh_port2proc_query(proto, paddr, port, &qpid, user, sizeof(user));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-			  MSG_PORT_NEWPORT, errbuf, path, qpid, user);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(path);
-#endif
-	  portent->port   = port;
-	  portent->status = SH_PORT_ISOK;
-	}
-      else
-	{
-	  portent->status = SH_PORT_ISOK;
-	}
-    }
-  else
-    {
-      if (!portent)
-	{
-	  char * path;
-	  unsigned long qpid;
-	  char   user[USER_MAX];
-	  char   saddr[SH_IP_BUF];
-
-	  if (portchk_debug)
-	    fprintf(stderr, _("call to  sh_ipvx_ntoa (port %d)\n"), port);
- 
-	  sh_ipvx_ntoa(saddr, sizeof(saddr), paddr);
-
-	  snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s)"), 
-		    saddr, port, SH_PROTO_STR(proto), check_services(port, proto));
-
-	  if (portchk_debug)
-	    fprintf(stderr, _("cmp_to_list: open port: %s:%d/%s (%s) check_services\n"), 
-		    saddr, port, SH_PROTO_STR(proto), check_services(port, proto));
-
-#ifndef TEST_ONLY
-	  path = sh_port2proc_query(proto, paddr, port, &qpid, user, sizeof(user));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-			  MSG_PORT_NEW, errbuf, path, qpid, user);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(path);
-#endif
-
-	  /* was not there, thus it is not in 'required' or 'optional' list
-	   */
-	  sh_portchk_add_to_list (proto, port, paddr, service, SH_PORT_NOT, SH_PORT_ISOK);
-	}
-      else if (portent->status == SH_PORT_MISS && portent->flag != SH_PORT_IGN)
-	{
-	  char * path;
-	  unsigned long qpid;
-	  char   user[USER_MAX];
-	  char   saddr[SH_IP_BUF];
-
-	  sh_ipvx_ntoa(saddr, sizeof(saddr), paddr);
-
-	  snprintf (errbuf, sizeof(errbuf), _("port: %s:%d/%s (%s)"), 
-		    saddr, port, SH_PROTO_STR(proto), check_services(port, proto));
-#ifdef TEST_ONLY
-	  fprintf(stderr, _("port   : %s\n"), errbuf);
-#else
-	  path = sh_port2proc_query(proto, paddr, port, &qpid, user, sizeof(user));
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_portchk_severity, FIL__, __LINE__, 0, 
-			  MSG_PORT_RESTART, errbuf, path, qpid, user);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(path);
-#endif
-
-	  portent->status = SH_PORT_ISOK;
-	}
-      else
-	{
-	  portent->status = SH_PORT_ISOK;
-	}
-    }
-
-  return;
-}
-
-			       
-/* Returns a static buffer containing the name of the service
- * running on port <port> (from /etc/services)
- * Returns NULL on failure
- */
-static char * check_services (int port, int proto)
-{
-  static char buf[256];
-  char * service = sh_getservbyport(port, SH_PROTO_STR(proto), buf, sizeof(buf));
-
-  if (!service)
-    {
-      snprintf (buf, sizeof(buf), "%s",_("unknown"));
-    }
-  return buf;
-}
-
-/* Returns a static buffer containing the name of the service
- * running on port <port> at <address> (from portmap daemon)
- * Returns NULL on failure
- */
-static char * check_rpc_list (int port, struct sockaddr_in * address, 
-			      unsigned long prot)
-{
-#if defined(HAVE_RPC_RPC_H) && defined(HAVE_PMAP_GETMAPS)
-  struct pmaplist * head;
-  char *r;
-  static char buf[256];
-
-  head = pmap_getmaps(address);
-
-  if (head) 
-    {
-      do /* while (head != NULL) */
-	{
-	  if ((head->pml_map.pm_prot == prot) && 
-	      (port == (int)head->pml_map.pm_port)) 
-	    {
-	      r = sh_getrpcbynumber((int)head->pml_map.pm_prog, 
-				    buf, sizeof(buf));
-	      if (r)
-		{
-		  return buf;
-		}
-	      else
-		{
-		  snprintf (buf, sizeof(buf), "RPC_%lu",
-			    (unsigned long)head->pml_map.pm_prog);
-		  return buf;
-		}
-	    }
-	  head = head->pml_next;
-	}
-      while (head != NULL);
-    }
-#else
-  (void) port;
-  (void) address;
-  (void) prot;
-#endif
-  return NULL;
-}
-
-void * sh_dummy_950_p = NULL;
-void * sh_dummy_951_p = NULL;
-
-static int check_port_udp_internal (int fd, int port, struct sh_sockaddr * paddr)
-{
-  int                retval;
-  char             * p = NULL;
-  char               buf[8] = { 0 };
-#ifndef TEST_ONLY
-  char               errmsg[256];
-  volatile int       nerr;
-#endif
-  char errbuf[SH_ERRBUF_SIZE];
-  char ipbuf[SH_IP_BUF];
-
-  struct sh_sockaddr	saddr;
-  socklen_t		slen  = 0;
-  volatile int		sport = 0;
-
-  sh_dummy_950_p = (void*) &p;
-  
-  sh_ipvx_set_port(paddr, port);
-
-  do {
-    retval = connect(fd, sh_ipvx_sockaddr_cast(paddr), SH_SSP_LEN(paddr));
-  } while (retval < 0 && (errno == EINTR || errno == EINPROGRESS));
-
-  if (retval == -1)
-    {
-#ifdef TEST_ONLY
-      if (portchk_debug)
-	perror(_("connect"));
-#else
-      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-
-      nerr = errno;
-      sl_snprintf(errmsg, sizeof(errmsg), _("check port: %5d/udp on %15s: %s"),
-		  port, ipbuf, sh_error_message(errno, errbuf, sizeof(errbuf)));
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, nerr, MSG_E_SUBGEN, 
-		      errmsg, _("connect"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-    }
-  else
-    {
-      /* Register the used source port as transient. This will avoid
-       * the issue of lingering source ports being reported as a spurious
-       * service. The lingering source port is effectvely a race condition.
-       *
-       * Also use this code to obtain the source port. Sometimes Samhain
-       * reports on a port where it connects back to itself. In that case
-       * source and destination port are the same.
-       *
-       * AGH, 23 Apr 2017 (www.2024sight.com).
-       */
-
-#if defined(USE_IPVX)
-      if (paddr->ss_family == AF_INET)
-        {
-          saddr.ss_family = AF_INET;
-          slen = sizeof( struct sockaddr_in );
-          retval = getsockname(fd, (struct sockaddr *)&(saddr.sin), &slen);
-        }
-      else
-        {
-          saddr.ss_family = AF_INET6;
-          slen = sizeof( struct sockaddr_in6 );
-          retval = getsockname(fd, (struct sockaddr *)&(saddr.sin6), &slen);
-        }
-#else
-      saddr.ss_family = AF_INET;
-      slen = sizeof( struct sockaddr_in );
-      retval = getsockname(fd, (struct sockaddr *)&(saddr.sin), &slen);
-#endif
-
-      if ( retval == 0 )
-        {
-          sport = sh_ipvx_get_port(&saddr);
-          sh_portchk_transient(sport, &saddr, IPPROTO_UDP);
-        }
-      else
-        {
-#ifdef TEST_ONLY
-          if (portchk_debug)
-            perror(_("getsockname"));
-#else
-            sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-            nerr = errno;
-            sl_snprintf(errmsg, sizeof(errmsg), _("source port transient for %15s:%d/udp: %s"),
-		            ipbuf, port, sh_error_message(errno, errbuf, sizeof(errbuf)));
-            SH_MUTEX_LOCK(mutex_thread_nolog);
-            sh_error_handle((-1), FIL__, __LINE__, nerr, MSG_E_SUBGEN, errmsg, _("getsockname"));
-            SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-        }
-
-      if (( sport != port ) || ( sh_portchk_same_ports == S_FALSE ))
-        {
-          do {
-	    retval = send (fd, buf, 0, 0);
-          } while (retval < 0 && errno == EINTR);
-
-          if (retval == -1 && errno == ECONNREFUSED)
-	    {
-	      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	      if (portchk_debug)
-	        fprintf(stderr, _("check port_udp: %5d/udp on %15s established/time_wait\n"),
-		        port, ipbuf);
-	    }
-          else 
-	    {
-	      /* Only the second send() may catch the error 
-	       */
-	      do {
-	        retval = send (fd, buf, 0, 0);
-	      } while (retval < 0 && errno == EINTR);
-
-	      if (retval == -1 && errno == ECONNREFUSED)
-	        {
-	          sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	          if (portchk_debug)
-		    fprintf(stderr, _("check port: %5d/udp on %15s established/time_wait\n"),
-			    port, ipbuf);
-	        }
-	      else if (retval != -1)
-	        {
-	          /* Try to get service name from portmap
-	           */
-	          if (paddr->ss_family == AF_INET)
-		    {
-		      p = check_rpc_list (port, 
-				          (struct sockaddr_in *) sh_ipvx_sockaddr_cast(paddr), 
-				          IPPROTO_UDP);
-		    }
-
-	          sh_portchk_cmp_to_list (IPPROTO_UDP, port, paddr, p ? p : NULL);
-	      
-	          /* If not an RPC service, try to get name from /etc/services
-	           */
-	          if (!p)
-		    p = check_services(port, IPPROTO_UDP);
-	      
-	          if (portchk_debug)
-		    {
-		      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-		      fprintf(stderr, _("check port_udp: %5d/udp on %15s open %s\n"), 
-			      port, ipbuf, p);
-		    }
-	      
-	        }
-	      else
-	        {
-	          if (portchk_debug)
-		    {
-		      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-		      fprintf(stderr, _("check port_udp: %5d/udp on %15s ERRNO %d\n"), 
-			      port, ipbuf, errno);
-		    }
-	        }
-	    }
-        }
-      else
-        {
-	  if (portchk_debug)
-            {
-              sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	      fprintf(stderr, _("check port_udp: %5d/udp on %15s same source and destination port\n"), 
-		      port, ipbuf);
-            }
-        }
-    }
-  sl_close_fd (FIL__, __LINE__, fd);
-  sh_dummy_950_p = NULL; 
-  return 0;
-}
-
-static int check_port_tcp_internal (int fd, int port, struct sh_sockaddr * paddr)
-{
-  volatile int       retval;
-  int                flags;
-  char             * p = NULL;
-#ifndef TEST_ONLY
-  char               errmsg[256];
-  volatile int       nerr;
-#endif
-  char errbuf[SH_ERRBUF_SIZE];
-  char ipbuf[SH_IP_BUF];
-
-  struct sh_sockaddr	saddr;
-  socklen_t		slen  = 0;
-  volatile int		sport = 0;
-
-  sh_dummy_951_p = (void*) &p;
-
-  sh_ipvx_set_port(paddr, port);
-
-  do {
-    retval = connect(fd, sh_ipvx_sockaddr_cast(paddr), SH_SSP_LEN(paddr));
-  } while (retval < 0 && (errno == EINTR || errno == EINPROGRESS));
-
-  if (retval == -1 && errno == ECONNREFUSED)
-    {
-      if (portchk_debug)
-	{
-	  sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	  fprintf(stderr, _("check port_tcp: %5d on %15s closed\n"),
-		  port, ipbuf);
-	}
-    }
-  else if (retval == -1)
-    {
-#ifdef TEST_ONLY
-      if (portchk_debug)
-	perror(_("connect"));
-#else
-      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-      nerr = errno;
-      sl_snprintf(errmsg, sizeof(errmsg), _("check port: %5d/tcp on %15s: %s"),
-		  port, ipbuf, sh_error_message(errno, errbuf, sizeof(errbuf)));
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, nerr, MSG_E_SUBGEN, 
-		      errmsg, _("connect"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-    }
-  else
-    {
-      /* Register the used source port as transient. This will avoid
-       * the issue of lingering source ports being reported as a spurious
-       * service. The lingering source port is effectively a race condition.
-       *
-       * Also use this code to obtain the source port. Sometimes Samhain
-       * reports on a port where it connects back to itself. In that case
-       * source and destination port are the same.
-       *
-       * AGH, 23 Apr 2017 (www.2024sight.com).
-       */
-
-#if defined(USE_IPVX)
-      if (paddr->ss_family == AF_INET)
-        {
-          saddr.ss_family = AF_INET;
-          slen = sizeof( struct sockaddr_in );
-          retval = getsockname(fd, (struct sockaddr *)&(saddr.sin), &slen);
-        }
-      else
-        {
-          saddr.ss_family = AF_INET6;
-          slen = sizeof( struct sockaddr_in6 );
-          retval = getsockname(fd, (struct sockaddr *)&(saddr.sin6), &slen);
-        }
-#else
-      saddr.ss_family = AF_INET;
-      slen = sizeof( struct sockaddr_in );
-      retval = getsockname(fd, (struct sockaddr *)&(saddr.sin), &slen);
-#endif
-
-      if ( retval == 0 )
-        {
-          sport = sh_ipvx_get_port(&saddr);
-          sh_portchk_transient(sport, &saddr, IPPROTO_TCP);
-        }
-      else
-        {
-#ifdef TEST_ONLY
-          if (portchk_debug)
-	    perror(_("getsockname"));
-#else
-            sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-            nerr = errno;
-            sl_snprintf(errmsg, sizeof(errmsg), _("source port transient for %15s:%d/tcp: %s"),
-		        ipbuf, port, sh_error_message(errno, errbuf, sizeof(errbuf)));
-            SH_MUTEX_LOCK(mutex_thread_nolog);
-            sh_error_handle((-1), FIL__, __LINE__, nerr, MSG_E_SUBGEN, 
-		            errmsg, _("getsockname"));
-            SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-        }
-
-      if (( sport != port ) || ( sh_portchk_same_ports == S_FALSE ))
-        {
-          /* Try to get service name from portmap
-           */
-          if (paddr->ss_family == AF_INET)
-	    {
-	      p = check_rpc_list (port, 
-			          (struct sockaddr_in *) sh_ipvx_sockaddr_cast(paddr), 
-			          IPPROTO_TCP);
-	    }
-
-          sh_portchk_cmp_to_list (IPPROTO_TCP, port, paddr, p ? p : NULL);
-
-          /* If not an RPC service, try to get name from /etc/services
-           */
-          if (!p)
-	    p = check_services(port, IPPROTO_TCP);
-
-          if (portchk_debug)
-	    {
-	      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	      fprintf(stderr, _("check port_tcp: %5d on %15s open %s\n"), 
-		      port, ipbuf, p);
-	    }
-        }
-      else
-        {
-	  if (portchk_debug)
-            {
-              sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), paddr);
-	      fprintf(stderr, _("check port_udp: %5d/tcp on %15s same source and destination port\n"), 
-		      port, ipbuf);
-            }
-        }
-
-#if !defined(O_NONBLOCK)
-#if defined(O_NDELAY)
-#define O_NONBLOCK  O_NDELAY
-#else
-#define O_NONBLOCK  0
-#endif
-#endif
-
-      /* prepare to close connection gracefully
-       */
-      if      (port == 22)  /* ssh */
-	{
-	  flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
-	  retval = write (fd, _("SSH-2.0-Foobar"), 14);
-	  if (retval > 0) retval = write (fd, "\r\n", 2);
-	}
-      else if (port == 25)  /* smtp */
-	{
-	  flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
-	  retval = write (fd, _("QUIT"), 4);
-	  if (retval > 0) retval = write (fd, "\r\n", 2);
-	}
-      else if (port == 79)  /* finger */
-	{
-	  flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
-	  retval = write (fd, "\r\n", 2);
-	}
-      else if (port == 110) /* pop3 */
-	{
-	  flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
-	  retval = write (fd, _("QUIT"), 4);
-	  if (retval > 0) retval = write (fd, "\r\n", 2);
-	}
-      else if (port == 143) /* imap */
-	{
-	  flags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, flags | O_NONBLOCK);
-	  retval = write (fd, _("A01 LOGOUT"), 10);
-	  if (retval > 0) retval = write (fd, "\r\n", 2);
-	}
-
-      if (portchk_debug && retval < 0)
-	fprintf(stderr, _("check port: error writing to port %5d\n"), 
-		port);
-     }
-  sl_close_fd (FIL__, __LINE__, fd);
-  sh_dummy_951_p = NULL;
-  return 0;
-}
-
-/* typedef uint32_t in_addr_t;
- * struct in_addr
- * {
- * in_addr_t s_addr;
- * };
- */
-
-#define SH_IFACE_MAX 64
-#define SH_IFACE_ADDR 0
-#define SH_IFACE_DEV  1
-
-struct portchk_interfaces {
-  struct sh_sockaddr iface;
-  int            type;
-};
-
-static struct portchk_interfaces iface_list[SH_IFACE_MAX];
-static int iface_list_used   = 0;
-static int iface_initialized = 0;
-
-#ifdef TEST_ONLY
-static char * portchk_hostname = NULL;
-#else
-static char * portchk_hostname = sh.host.name;
-#endif
-
-static int sh_portchk_init_internal (void)
-{
-  volatile int     i, j; /* might be clobbered by âlongjmpâ or âvforkâ*/
-  char errbuf[256];
-#if defined(USE_IPVX)
-  struct addrinfo hints;
-  struct addrinfo *res;
-#else
-  struct hostent * hent;
-#endif
-  char ipbuf[SH_IP_BUF];
-
-  if (portchk_debug)
-    fprintf(stderr, _("checking ports on: %s\n"), portchk_hostname ? portchk_hostname : _("NULL"));
-
-  if (!portchk_hostname)
-    return -1;
-
-  if (sh_portchk_active == S_FALSE)
-    return -1;
-
-  SH_MUTEX_LOCK(mutex_port_check);
-  if (iface_initialized == 0)
-    {
-      iface_list_used   = 0;
-      iface_initialized = 1;
-    }
-
-#if !defined(USE_IPVX)
-  SH_MUTEX_LOCK(mutex_resolv);
-  hent = sh_gethostbyname(portchk_hostname);
-  i = 0;
-  while (hent && hent->h_addr_list[i] && (iface_list_used < SH_IFACE_MAX))
-    {
-      struct sockaddr_in sin;
-      struct sh_sockaddr iface_tmp;
-
-      memcpy(&(sin.sin_addr.s_addr), hent->h_addr_list[i], sizeof(in_addr_t));
-      sh_ipvx_save(&iface_tmp, AF_INET, (struct sockaddr *)&sin);
-
-      for (j = 0; j < iface_list_used; ++j)
-	{
-	  if (0 == sh_ipvx_cmp(&iface_tmp, &(iface_list[j].iface)))
-	    {
-	      goto next_iface;
-	    }
-	}
-
-      sh_ipvx_save(&(iface_list[iface_list_used].iface), 
-		   AF_INET, (struct sockaddr *)&sin);
-      iface_list[iface_list_used].type = SH_IFACE_ADDR;
-      
-      if (portchk_debug)
-	{
-	  char buf[256];
-	  sh_ipvx_ntoa(buf, sizeof(buf), &(iface_list[iface_list_used].iface));
-	  fprintf(stderr, _("added interface[%d]: %s\n"), i, buf); 
-	}
-      ++iface_list_used;
-
-    next_iface:
-      ++i;
-    }
-  SH_MUTEX_UNLOCK(mutex_resolv);
-#else
-  memset(&hints, 0, sizeof(hints));
-  hints.ai_family = PF_UNSPEC;
-  hints.ai_flags  = AI_ADDRCONFIG;
-
-  if (0 == getaddrinfo(portchk_hostname, NULL, &hints, &res))
-    {
-      struct addrinfo *p = res;
-      struct sh_sockaddr iface_tmp;
-
-      while ((p != NULL) && (iface_list_used < SH_IFACE_MAX))
-	{
-	  sh_ipvx_save(&iface_tmp, p->ai_family, p->ai_addr);
-
-          for (j = 0; j < iface_list_used; ++j)
-	    {
-	      if (portchk_debug)
-		{
-		  char buf1[256], buf2[256];
-		  sh_ipvx_ntoa(buf1, sizeof(buf1), &(iface_list[j].iface));
-		  sh_ipvx_ntoa(buf2, sizeof(buf2), &iface_tmp);
-		  fprintf(stderr, _("check interface[%d]: %s vs %s\n"), j, buf1, buf2); 
-		}
-	      if (0 == sh_ipvx_cmp(&iface_tmp, &(iface_list[j].iface)))
-		{
-		  if (portchk_debug) 
-		    fprintf(stderr, _("skipping interface[%d]\n"), j);
-		  goto next_iface;
-		}
-	    }
-	  sh_ipvx_save(&(iface_list[iface_list_used].iface), 
-		       p->ai_family, p->ai_addr);
-	  iface_list[iface_list_used].type = SH_IFACE_ADDR;
-	  if (portchk_debug)
-	    {
-	      char buf[256];
-	      sh_ipvx_ntoa(buf, sizeof(buf), &(iface_list[iface_list_used].iface));
-	      fprintf(stderr, _("added interface[%d]: %s\n"), iface_list_used, buf); 
-	    }
-
-	  ++iface_list_used;
-
-	next_iface:
-	  p = p->ai_next;
-	}
-      freeaddrinfo(res);
-    } 
-#endif
-
-  for (i = 0; i < iface_list_used; ++i)
-    {
-      sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), &(iface_list[i].iface));
-      sl_snprintf(errbuf, sizeof(errbuf), _("added interface: %s"), ipbuf);
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      errbuf, _("sh_portchk_init"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-  SH_MUTEX_UNLOCK(mutex_port_check);
-
-  return 0;
-}
-
-int sh_portchk_init (struct mod_type * arg)
-{
-#ifndef HAVE_PTHREAD
-  (void) arg;
-#endif
-
-  if (sh_portchk_active == S_FALSE)
-    return SH_MOD_FAILED;
-  if (!portchk_hostname)
-    return SH_MOD_FAILED;
-
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      (void) sh_portchk_init_internal();
-      return SH_MOD_THREAD;
-    }
-#endif
-  return sh_portchk_init_internal();
-}
-
-static void dev_list_kill();
-
-#if !defined(TEST_ONLY)
-int sh_portchk_reconf (void)
-{
-  SH_MUTEX_LOCK(mutex_port_check);
-  iface_initialized    = 0;
-  sh_portchk_active    = 1;
-  sh_portchk_check_udp = 1;
-  sh_portchk_interval  = SH_PORTCHK_INTERVAL;
-
-  sh_portchk_minport = -1;
-  sh_portchk_maxport = -1;
-
-  dev_list_kill();
-  
-  portlist_udp = sh_portchk_kill_list (portlist_udp);
-  portlist_tcp = sh_portchk_kill_list (portlist_tcp);
-
-  blacklist_udp = sh_portchk_kill_blacklist (blacklist_udp);
-  blacklist_tcp = sh_portchk_kill_blacklist (blacklist_tcp);
-  sh_port2proc_finish();
-
-  SH_MUTEX_UNLOCK(mutex_port_check);
-  return 0;
-}
-
-int sh_portchk_cleanup (void)
-{
-  return sh_portchk_reconf ();
-}
-
-int sh_portchk_timer (time_t tcurrent) 
-{
-  static time_t lastcheck = 0;
-
-  SL_ENTER(_("sh_portchk_timer"));
-  if ((time_t) (tcurrent - lastcheck) >= sh_portchk_interval)
-    {
-      lastcheck  = tcurrent;
-      SL_RETURN((-1), _("sh_portchk_timer"));
-    }
-  SL_RETURN(0, _("sh_portchk_timer"));
-}
-#endif
-
-static int check_port_generic (int port, int domain, int type, int protocol)
-{
-  volatile int     i    =  0;
-  int              sock = -1;
-  int              flag =  1; /* non-zero to enable an option */
-  struct sh_sockaddr   paddr;
-  char errbuf[SH_ERRBUF_SIZE];
-
-  /* Check all interfaces for this host
-   */
-  while (i < iface_list_used)
-    {
-      memcpy(&paddr, &(iface_list[i].iface), sizeof(paddr));
-
-      if (paddr.ss_family != domain)
-	{
-	  ++i;
-	  continue;
-	}
-
-      if (0 != sh_portchk_is_blacklisted(port, &paddr, protocol))
-	{
-	  ++i; 
-	  continue;
-	}
-
-      if (0 != sh_portchk_is_transient(port, &paddr, protocol))
-	{
-	  ++i; 
-	  continue;
-	}
-
-      if ((sock = socket(paddr.ss_family, type, protocol)) < 0 )
-	{
-	  ++i;
-#ifdef TEST_ONLY
-	  if (portchk_debug)
-	    perror(_("socket"));
-#else
-
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT 0
-#endif
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT    0
-#endif
-	  if (errno != EPROTONOSUPPORT && errno != EAFNOSUPPORT)
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, 
-			      sh_error_message(errno, errbuf, sizeof(errbuf)), _("socket"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-#endif
-	  continue;
-	}
-      if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		      (void *) &flag, sizeof(flag)) < 0 )
-	{
-	  ++i;
-#ifdef TEST_ONLY
-	  if (portchk_debug)
-	    perror(_("setsockopt"));
-#else
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, 
-			  sh_error_message(errno, errbuf, sizeof(errbuf)),_("setsockopt"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	  continue;
-	}
-
-
-      if (protocol == IPPROTO_TCP)
-	check_port_tcp_internal(sock, port, &paddr);
-      else
-	check_port_udp_internal(sock, port, &paddr);
-
-      ++i;
-    }
-
-  return 0;
-}
-
-
-
-static int check_port_udp (int port, int domain)
-{
-  return check_port_generic(port, domain, SOCK_DGRAM, IPPROTO_UDP);
-}
-
-static int check_port_tcp (int port, int domain)
-{
-  return check_port_generic(port, domain, SOCK_STREAM, IPPROTO_TCP);
-}
-
-
-static int sh_portchk_scan_ports_generic (int min_port, int max_port_arg, 
-					  int domain, int type, int protocol)
-{
-  /*
-  int min_port = 1024;
-  int max_port = 65535;
-  */
-
-  volatile int port; /*  might be clobbered by âlongjmpâ or âvforkâ*/
-  volatile int max_port = max_port_arg;
-  int retval;
-  int sock   = -1;
-#if 0
-  int flag   = 1; /* non-zero to enable an option */
-#endif
-  struct sockaddr_in  addr4;
-  struct sockaddr_in6 addr6;
-
-  int addrlen4      = sizeof(addr4);
-  int addrlen6      = sizeof(addr6);
-
-  struct in6_addr anyaddr = IN6ADDR_ANY_INIT; 
-
-  char errbuf[SH_ERRBUF_SIZE];
-
-  if (min_port == -1)
-     min_port = 0;
-  if (max_port == -1)
-    max_port = 65535;
-
-  if (portchk_debug)
-    fprintf(stderr, _("scan_ports_generic %d-%d %s %s\n"), 
-	    min_port, max_port, (domain == AF_INET6) ? _("AF_INET6") : _("AF_INET"),
-	    (protocol == IPPROTO_TCP) ? _("tcp") : _("udp"));
-	    
-  for (port = min_port; port <= max_port; ++port) 
-    {
-      if ((sock = socket(domain, type, protocol)) < 0 )
-	{
-#ifdef TEST_ONLY
-	  if (portchk_debug)
-	    perror(_("socket"));
-#else
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT 0
-#endif
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT    0
-#endif
-	  if (errno != EPROTONOSUPPORT && errno != EAFNOSUPPORT)
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, 
-			      sh_error_message(errno, errbuf, sizeof(errbuf)), _("socket"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-#endif
-	  continue;
-	}
-
-#if 0
-      if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		      (void *) &flag, sizeof(flag)) < 0 )
-	{
-#ifdef TEST_ONLY
-	  if (portchk_debug)
-	    perror(_("setsockopt"));
-#else
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, 
-			  sh_error_message(errno, errbuf, sizeof(errbuf)),_("setsockopt"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	  continue;
-	}
-#endif
-
-      if (domain == AF_INET)
-	{
-	  addr4.sin_family      = AF_INET;
-	  addr4.sin_port        = htons(port);
-	  addr4.sin_addr.s_addr = INADDR_ANY;
-	  retval = bind (sock, (struct sockaddr *) &addr4, addrlen4);
-	}
-      else
-	{
-	  addr6.sin6_family       = AF_INET6;
-	  addr6.sin6_port         = htons(port);
-	  memcpy(&(addr6.sin6_addr.s6_addr), &anyaddr, sizeof(anyaddr));
-	  retval = bind (sock, (struct sockaddr *) &addr6, addrlen6);
-	}
-
-      if (retval == 0)
-	{
-	  /* we can bind the port, thus it is unused
-	   */
-	  sl_close_fd (FIL__, __LINE__, sock);
-	}
-      else
-	{
-	  if (errno == EINVAL || errno == EADDRINUSE)
-	    {
-	      /* try to connect to the port
-	       */
-	      if (protocol == IPPROTO_TCP)
-		check_port_tcp(port, domain);
-	      else
-		check_port_udp(port, domain);
-	    }
-	  else
-	    {
-#ifdef TEST_ONLY
-	      if (portchk_debug)
-		perror(_("bind"));
-#else
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN, 
-			      sh_error_message(errno, errbuf, sizeof(errbuf)), _("bind"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	    }
-	  sl_close_fd (FIL__, __LINE__, sock);
-	}
-    }
-
-  if (protocol == IPPROTO_TCP)
-    transient_tcp=sh_portchk_kill_transient(transient_tcp);
-  else
-    transient_udp=sh_portchk_kill_transient(transient_udp);
-  
-  return 0;
-}
-
-static int sh_portchk_scan_ports_tcp (int min_port, int max_port)
-{
-#if defined(USE_IPVX)
-  sh_portchk_scan_ports_generic (min_port, max_port, AF_INET6, 
-				 SOCK_STREAM, IPPROTO_TCP);
-#endif
-  return sh_portchk_scan_ports_generic (min_port, max_port, AF_INET, 
-					SOCK_STREAM, IPPROTO_TCP);
-}
- 
-static int sh_portchk_scan_ports_udp (int min_port, int max_port)
-{
-#if defined(USE_IPVX)
-  sh_portchk_scan_ports_generic (min_port, max_port, AF_INET6, 
-				 SOCK_DGRAM, IPPROTO_UDP);
-#endif
-  return sh_portchk_scan_ports_generic (min_port, max_port, AF_INET,
-					SOCK_DGRAM, IPPROTO_UDP);
-}
-
-/* Subroutine to add an interface
- */
-void * sh_dummy_1564_str    = NULL; /* fix clobbered by.. warning */
-
-static int sh_portchk_add_interface_int (const char * str, int type)
-{
-  struct sh_sockaddr saddr;
-  char errbuf[256];
-  char buf[64];
-
-  sh_dummy_1564_str    = (void*) &str;
-
-  if (iface_initialized == 0)
-    {
-      iface_list_used   = 0;
-      iface_initialized = 1;
-    }
-
-  do {
-
-    while (*str == ',' || *str == ' ' || *str == '\t') ++str;
-
-    if (*str)
-      {
-	char ipbuf[SH_IP_BUF];
-	unsigned int i = 0;
-	while (*str && i < (sizeof(buf)-1) && 
-	       *str != ',' && *str != ' ' && *str != '\t')
-	  {
-	    buf[i] = *str; ++str; ++i;
-	  }
-	buf[i] = '\0';
-
-	if (0 == sh_ipvx_aton(buf, &saddr))
-	  return -1;
-
-	if (iface_list_used == SH_IFACE_MAX)
-	  return -1;
-
-	sh_ipvx_ntoa(ipbuf, sizeof(ipbuf), &saddr);
-	sl_snprintf(errbuf, sizeof(errbuf), _("interface: %s"), ipbuf);
-	SH_MUTEX_LOCK(mutex_thread_nolog);
-	sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			errbuf, _("sh_portchk_add_interface"));
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	
-	memcpy (&(iface_list[iface_list_used].iface), &(saddr), sizeof(saddr));
-	iface_list[iface_list_used].type = type;
-	++iface_list_used;
-      }
-  } while (*str);
-
-  sh_dummy_1564_str = NULL;
-  return 0;
-}
-
-static int sh_portchk_add_interface (const char * str)
-{
-  return sh_portchk_add_interface_int (str, SH_IFACE_ADDR);
-}
-
-#if defined(HAVE_IFADDRS_H)
-/* 
- * subroutines to add a device
- */
-void * sh_dummy_1651_ifa    = NULL; /* fix clobbered by.. warning */
-
-static int portchk_add_device_int (const char * buf)
-{
-  struct ifaddrs *ifaddr, *ifa;
-  int family;
-#ifndef NI_MAXHOST
-#define NI_MAXHOST 1025
-#endif
-  char host[NI_MAXHOST];
-
-  sh_dummy_1651_ifa = (void*) &ifa;
-  
-  if (getifaddrs(&ifaddr) == -1)
-    {
-      volatile int nerr = errno;
-      char errbuf[SH_ERRBUF_SIZE];
-      sh_error_message(errno, errbuf, sizeof(errbuf));
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, nerr, MSG_E_SUBGEN, 
-		      errbuf, _("getifaddrs"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      return -1;
-    }
-
-  for ( ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next)
-    {
-      if (ifa->ifa_addr == NULL)
-	continue;
-      
-      if (strcmp(ifa->ifa_name, buf) == 0)
-	{
-	  volatile int s = 0;
-          family = ifa->ifa_addr->sa_family;
-	  
-          if (family == AF_INET)
-	    {
-	      s = getnameinfo( ifa->ifa_addr, sizeof(struct sockaddr_in),
-			       host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST );
-	      
-	      if (s == 0)
-		{
-		  if (sh_portchk_add_interface_int(host, SH_IFACE_DEV) < 0)
-		    {
-		      freeifaddrs(ifaddr);
-		      return -1;
-		    }
-		}
-	    }
-	  
-#if defined(USE_IPVX)
-          if (family == AF_INET6)
-	    {
-	      s = getnameinfo( ifa->ifa_addr, sizeof(struct sockaddr_in6),
-			       host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST );
-	      
-	      if (s == 0)
-		{
-		  if (sh_portchk_add_interface_int(host, SH_IFACE_DEV) < 0)
-		    {
-		      freeifaddrs(ifaddr);
-		      return -1;
-		    }
-		}
-	    }
-#endif
-	  
-	  if (s != 0)
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      sl_strlcpy(errbuf, buf,             sizeof(errbuf));
-	      sl_strlcat(errbuf, ": ",            sizeof(errbuf));
-	      sl_strlcat(errbuf, gai_strerror(s), sizeof(errbuf));
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, s, MSG_E_SUBGEN, 
-			      errbuf, _("getnameinfo"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  
-        }
-    }
-
-  freeifaddrs(ifaddr);
-  return 0;
-}
-
-struct added_dev {
-  char dev[64];
-  struct added_dev * next;
-};
-
-static struct added_dev * dev_list = NULL;
-
-static void dev_list_add (char * buf)
-{
-  struct added_dev * new = SH_ALLOC(sizeof(struct added_dev));
-  sl_strlcpy(new->dev, buf, 64);
-  new->next = dev_list;
-  dev_list  = new;
-  return;
-}
-
-static void dev_list_kill ()
-{
-  struct added_dev * old;
-  struct added_dev * new = dev_list;
-  dev_list = NULL;
-
-  while (new)
-    {
-      old = new;
-      new = new->next;
-      SH_FREE(old);
-    }
-  return;
-}
- 
-static int sh_portchk_add_device (const char * str)
-{
-  char buf[64];
-                
-  do {
-
-    while (*str == ',' || *str == ' ' || *str == '\t') ++str;
-
-    if (*str)
-      {
-	unsigned int i = 0;
-	while (*str && i < (sizeof(buf)-1) &&
-	       *str != ',' && *str != ' ' && *str != '\t') {
-	  buf[i] = *str; ++str; ++i;
-	}
-	buf[i] = '\0';
-	
-	if (portchk_add_device_int (buf) < 0)
-	  return -1;
-	
-	dev_list_add(buf);
-      }
-  } while (*str);
-
-  return 0;
-}
-
-static int iface_comp (const void *a, const void *b)
-{
-  const struct portchk_interfaces * aa = (const struct portchk_interfaces *) a;
-  const struct portchk_interfaces * bb = (const struct portchk_interfaces *) b;
-  return (aa->type - bb->type);
-}
-
-static void iface_qsort()
-{
-  qsort(&iface_list[0], iface_list_used, sizeof(struct portchk_interfaces),
-	iface_comp);
-  return;
-}
-
-static void recheck_devices()
-{
-  if (dev_list)
-    {
-      struct added_dev * dev = dev_list;
-      int i, j;
-
-      if (portchk_debug)
-	{
-	  for (j = 0; j < iface_list_used; ++j)
-	    {
-	      char buf[SH_IP_BUF];
-	      struct portchk_interfaces * aa = &(iface_list[j]);
-	      sh_ipvx_ntoa(buf, sizeof(buf), &(aa->iface));
-	      fprintf(stderr, _("presort: iface[%d] type(%d) %s\n"), j, iface_list[j].type, buf);
-	    }
-	}
-
-      iface_qsort();
-      
-      if (portchk_debug)
-	{
-	  for (j = 0; j < iface_list_used; ++j)
-	    {
-	      char buf[SH_IP_BUF];
-	      struct portchk_interfaces * aa = &(iface_list[j]);
-	      sh_ipvx_ntoa(buf, sizeof(buf), &(aa->iface));
-	      fprintf(stderr, _("postsor: iface[%d] type(%d) %s\n"), j, iface_list[j].type, buf);
-	    }
-	}
-
-      i = 0;
-      for (j = 0; j < iface_list_used; ++j)
-	if (iface_list[j].type == SH_IFACE_DEV) ++i;
-      iface_list_used -= i;
-
-      if (portchk_debug)
-	{
-	  for (j = 0; j < iface_list_used; ++j)
-	    {
-	      char buf[SH_IP_BUF];
-	      struct portchk_interfaces * aa = &(iface_list[j]);
-	      sh_ipvx_ntoa(buf, sizeof(buf), &(aa->iface));
-	      fprintf(stderr, _("postdel: iface[%d] type(%d) %s\n"), j, iface_list[j].type, buf);
-	    }
-	}
-
-      while (dev)
-	{
-	  portchk_add_device_int (dev->dev);
-	  dev = dev->next;
-	}
-    }
-  return;
-}
-#endif
-
-/* verify whether port/interface is blacklisted (do not check)
- */
-static int sh_portchk_is_blacklisted(int port, struct sh_sockaddr * saddr, 
-				     int proto)
-{
-  struct sh_port * head;
-
-  if (proto == IPPROTO_TCP)
-    head = blacklist_tcp;
-  else
-    head = blacklist_udp;
-
-  while (head)
-    {
-      if (head->port == port && ( sh_ipvx_isany(head->paddr) ||  0 == sh_ipvx_cmp(head->paddr, saddr) ))
-	return 1;
-      head = head->next;
-    }
-  return 0;
-}
-
-
-static int sh_portchk_blacklist(int port, struct sh_sockaddr * saddr, int proto)
-{
-  struct sh_port * black;
-  struct sh_port * head;
-
-  if (proto == IPPROTO_TCP)
-    head = blacklist_tcp;
-  else
-    head = blacklist_udp;
-
-  black = head;
-
-  while (black)
-    {
-      if (black->port == port && 
-	  0 == sh_ipvx_cmp(head->paddr, saddr))
-	return -1;
-      black = black->next;
-    }
-
-  black = SH_ALLOC (sizeof(struct sh_port));
-  black->paddr = SH_ALLOC (sizeof(struct sh_sockaddr));
-  black->port  = port;
-  memcpy(black->paddr, saddr, sizeof(struct sh_sockaddr));
-  black->next  = head;
-
-  if (proto == IPPROTO_TCP)
-    blacklist_tcp = black;
-  else
-    blacklist_udp = black;
-
-  if (portchk_debug)
-    {
-      int checkit = sh_portchk_is_blacklisted(port, saddr, proto);
-      fprintf(stderr, _("port blacklisted: %d %s\n"), port, 
-	      (checkit == 1) ? _("ok") : _("fail"));
-    }
-  return 0;
-}
-
-
-/* verify whether port/interface is transient (used as source port 
- *hence no check required)
- */
-static int sh_portchk_is_transient(int port, struct sh_sockaddr * saddr, 
-				     int proto)
-{
-  struct sh_port * head;
-  
-  if (proto == IPPROTO_TCP)
-    head = transient_tcp;
-  else
-    head = transient_udp;
-  
-  while (head)
-    {
-      if (head->port == port && ( sh_ipvx_isany(head->paddr) || 0 == sh_ipvx_cmp(head->paddr, saddr) ))
-	return 1;
-      head = head->next;
-    }
-  return 0;
-}
-
-
-static int sh_portchk_transient(int port, struct sh_sockaddr * saddr, int proto)
-{
-  struct sh_port * transient;
-  struct sh_port * head;
-
-  if (sh_portchk_transients == S_FALSE)
-    return 0;
-
-  if (proto == IPPROTO_TCP)
-    head = transient_tcp;
-  else
-    head = transient_udp;
-
-  transient = head;
-
-  while (transient)
-    {
-      if (transient->port == port && 
-	  0 == sh_ipvx_cmp(head->paddr, saddr))
-	return -1;
-      transient = transient->next;
-    }
-
-  transient = SH_ALLOC (sizeof(struct sh_port));
-  transient->paddr = SH_ALLOC (sizeof(struct sh_sockaddr));
-  transient->port  = port;
-  memcpy(transient->paddr, saddr, sizeof(struct sh_sockaddr));
-  transient->next  = head;
-
-  if (proto == IPPROTO_TCP)
-    transient_tcp = transient;
-  else
-    transient_udp = transient;
-
-  if (portchk_debug)
-    {
-      int checkit = sh_portchk_is_transient(port, saddr, proto);
-      fprintf(stderr, _("port transient: %d %s\n"), port, 
-	      (checkit == 1) ? _("ok") : _("fail"));
-    }
-  return 0;
-}
-
-
-/* Subroutine to add a required or optional port/service
- */
-static int sh_portchk_add_required_port_generic (char * service, 
-						 char * interface, int type)
-{
-  char buf[256] = { '\0' };
-  int proto;
-  char * p;
-  char * endptr;
-  unsigned long int  port;
-  struct sh_sockaddr   saddr;
-  struct sh_portentry * portent;
-
-  if (0 == sh_ipvx_aton(interface, &saddr))
-    return -1;
-
-  sl_strlcpy (buf, service, sizeof(buf));
-
-  p = strchr(buf, '/');
-  if (!p)
-    return -1;
-  if (0 == strcasecmp(p, _("/tcp")))
-    proto = IPPROTO_TCP;
-  else if  (0 == strcasecmp(p, _("/udp")))
-    proto = IPPROTO_UDP;
-  else
-    return -1;
-
-  *p = '\0';
-  port = strtoul(buf, &endptr, 0);
-
-  if (portchk_debug)
-    {
-      char buf[SH_IP_BUF];
-      sh_ipvx_ntoa(buf, sizeof(buf), &saddr);
-      fprintf(stderr, _("add_port_generic: %s (%s) %d %s (%s)\n"),
-	      interface, buf, (int) port, (proto == IPPROTO_TCP) ? _("tcp") : _("udp"),
-	      sh_port_type2str(type));
-    }
-
-  /* Blacklisted ports
-   */
-  if (*endptr == '\0' && port <= 65535 && type == SH_PORT_BLACKLIST)
-    return (sh_portchk_blacklist(port, &saddr, proto));
-
-  if (*endptr != '\0')
-    {  
-      portent = sh_portchk_get_from_list (proto, -1, &saddr, buf);
-      if (!portent)
-	{
-	  if (portchk_debug)
-	    fprintf(stderr, _("add_required_port %d\n"), (int) port);
-	  sh_portchk_add_to_list (proto,   -1, &saddr,  buf, type, SH_PORT_UNKN);
-	}
-      else
-	{
-#ifdef TEST_ONLY
-	  fprintf(stderr, "** WARNING: duplicate port definition %s/%s\n", buf, SH_PROTO_STR(proto));
-#else
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			  _("duplicate port definition"), _("sh_portchk_add_required_port_generic"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	  return -1;
-	}
-    }
-  else if (port <= 65535)
-    {
-      portent = sh_portchk_get_from_list (proto, port, &saddr, NULL);
-      if (!portent)
-	{
-	  if (portchk_debug)
-	    fprintf(stderr, _("add_required_port: open port: %d/%s\n"), 
-		    (int) port, SH_PROTO_STR(proto));
-	  sh_portchk_add_to_list (proto, port, &saddr, NULL, type, SH_PORT_UNKN);
-	}
-      else
-	{
-#ifdef TEST_ONLY
-	  fprintf(stderr, "** WARNING: duplicate port definition %lu/%s\n", port, SH_PROTO_STR(proto));
-#else
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			  _("duplicate port definition"), _("sh_portchk_add_required_port_generic"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	  return -1;
-	}
-    }
-  else
-    return -1;
-
-  return 0;
-}
-
-/* Internal interface to add required or optional ports as 'iface:portlist'
- */
-static int sh_portchk_add_required_generic (const char * str, int type)
-{
-  size_t ll = 0;
-  int    status;
-
-  char * interface = NULL;
-  char * list;
-  char * p;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  char * saveptr;
-#endif
-
-  if (!str)
-    return -1;
-
-  if (strchr(str, ':'))
-    {
-      char *last = strrchr(str, ':');
-      if (last != NULL)
-	{
-	  size_t tolast = (last - str);
-	  interface = SH_ALLOC(tolast+1);
-	  sl_strlcpy(interface, str, tolast+1);
-	  interface[tolast] = '\0';
-
-	  ll = tolast;
-
-	  while (str[ll] == ':' || str[ll] == ' ' || str[ll] == '\t')
-	    ++ll;
-	}
-    }
-  else
-    {
-      interface = SH_ALLOC(8);
-      sl_strlcpy(interface, _("0.0.0.0"), 8);
-      interface[7] = '\0';
-      while (str[ll] == ' ' || str[ll] == '\t')
-	++ll;      
-    }
-
-  if (!interface)
-    return -1;
-
-  if (str[ll] == '\0')
-    {
-      SH_FREE(interface);
-      return -1;
-    }
-
-  if (portchk_debug)
-    fprintf(stderr, "add ports for interface: %s (%s)\n", interface, sh_port_type2str(type));
-
-  list = sh_util_strdup(&str[ll]);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  p    = strtok_r (list, " ,\t", &saveptr);
-#else
-  p    = strtok (list, " ,\t");
-#endif
-  if (!p)
-    {
-      SH_FREE(interface);
-      SH_FREE(list);
-      return -1;
-    }
-  while (p)
-    {
-      status = sh_portchk_add_required_port_generic (p, interface, type);
-
-      if (-1 == status)
-	{
-	  SH_FREE(interface);
-	  SH_FREE(list);
-	  return -1;
-	}
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-      p    = strtok_r (NULL, " ,\t", &saveptr);
-#else
-      p    = strtok (NULL, " ,\t");
-#endif
-    }
-  SH_FREE(interface);
-  SH_FREE(list);
-  return 0;
-}
-
-/* User interface to add required ports as 'iface:portlist'
- */
-static int sh_portchk_add_required (const char * str)
-{
-  return sh_portchk_add_required_generic (str, SH_PORT_REQ); 
-}
-
-/* User interface to add optional ports as 'iface:portlist'
- */
-static int sh_portchk_add_optional (const char * str)
-{
-  return sh_portchk_add_required_generic (str, SH_PORT_OPT); 
-}
-
-/* User interface to add ignoreable ports as 'iface:portlist'
- */
-static int sh_portchk_add_ignore (const char * str)
-{
-  return sh_portchk_add_required_generic (str, SH_PORT_IGN); 
-}
-
-/* User interface to add ports that should not be checked as 'iface:portlist'
- */
-static int sh_portchk_add_blacklist (const char * str)
-{
-  return sh_portchk_add_required_generic (str, SH_PORT_BLACKLIST); 
-}
-
-/* Interface to run port check
- */
-int sh_portchk_check ()
-{
-  volatile int min_port;
-  static int noprivports = 0;
-
-  SH_MUTEX_LOCK(mutex_port_check);
-
-  min_port = (sh_portchk_minport == -1) ? 0 : sh_portchk_minport;
-
-  if (sh_portchk_active != S_FALSE)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checking for open ports"),
-		      _("sh_portchk_check"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      sh_portchk_reset_lists();
-
-#if defined(HAVE_IFADDRS_H)
-      recheck_devices();
-#endif
-
-      if ((0 != geteuid()) && (min_port < 1024))
-	{
-	  min_port = 1024;
-	  if (noprivports == 0)
-	    {
-#ifdef TEST_ONLY
-	      fprintf(stderr, "** WARNING not scanning ports < 1024\n");
-#else
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			      _("not scanning ports below 1024"), 
-			      _("sh_portchk_check"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-#endif
-	      noprivports = 1;
-	    }
-	}
-
-      sh_port2proc_prepare();
-
-      if (sh_portchk_check_udp == 1)
-	sh_portchk_scan_ports_udp(min_port, sh_portchk_maxport);
-      sh_portchk_scan_ports_tcp(min_port, sh_portchk_maxport);
-
-
-      sh_portchk_check_list (&portlist_tcp, IPPROTO_TCP, SH_PORT_REPORT);
-      if (sh_portchk_check_udp == 1)
-	sh_portchk_check_list (&portlist_udp, IPPROTO_UDP, SH_PORT_REPORT);
-
-    }
-  SH_MUTEX_UNLOCK(mutex_port_check);
-  return 0;
-}
-#endif
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_portcheck_lists (CuTest *tc)
-{
-#if defined(SH_USE_PORTCHECK) && (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE))
-  struct sh_sockaddr    haddr_local;
-  struct sh_portentry * portent;
-  char   buf[256];
-  char * p;
-
-#ifdef HAVE_RPC_RPC_H
-  p = sh_getrpcbynumber(0, buf, sizeof(buf));
-  CuAssertTrue(tc, p == NULL);
-
-  p = sh_getrpcbynumber(100000, buf, sizeof(buf));
-  CuAssertPtrNotNull(tc, p);
-  CuAssertTrue(tc, (0 == strcmp(p, "portmapper") || 0 == strcmp(p, "rpcbind")));
-  CuAssertTrue(tc, (0 == strcmp(buf, "portmapper") || 0 == strcmp(p, "rpcbind")));
-
-  p = sh_getrpcbynumber(100007, buf, sizeof(buf));
-  CuAssertPtrNotNull(tc, p);
-  CuAssertTrue(tc, 0 == strcmp(p, "ypbind"));
-  CuAssertTrue(tc, 0 == strcmp(buf, "ypbind"));
-#endif
-
-  p = sh_getservbyport(0, SH_PROTO_STR(IPPROTO_UDP), buf, sizeof(buf));
-  CuAssertTrue(tc, p == NULL);
-
-#if !defined(HOST_IS_CYGWIN)
-  p = sh_getservbyport(22, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf));
-  CuAssertPtrNotNull(tc, p);
-  CuAssertTrue(tc, 0 == strcmp(p, "ssh"));
-  CuAssertTrue(tc, 0 == strcmp(buf, "ssh"));
-#endif
-
-  p = sh_getservbyport(13, SH_PROTO_STR(IPPROTO_UDP), buf, sizeof(buf));
-  CuAssertPtrNotNull(tc, p);
-  CuAssertTrue(tc, 0 == strcmp(p, "daytime"));
-  CuAssertTrue(tc, 0 == strcmp(buf, "daytime"));
-
-  CuAssertTrue(tc, 0 != sh_ipvx_aton("127.0.0.1", &haddr_local));
-
-  sh_portchk_add_to_list (IPPROTO_TCP,  8000, &haddr_local, NULL, SH_PORT_NOT, SH_PORT_UNKN);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, NULL);
-  CuAssertPtrNotNull(tc, portent);
-
-  CuAssertTrue(tc, portent->port == 8000);
-  CuAssertTrue(tc, 0 == strcmp("127.0.0.1", portent->interface));
-  CuAssertTrue(tc, portent->status == SH_PORT_UNKN);
-  CuAssertTrue(tc, portent->flag == SH_PORT_NOT);
-
-  sh_portchk_check_list (&portlist_tcp, IPPROTO_TCP, SH_PORT_NOREPT);
-
-  CuAssertTrue(tc, NULL == portlist_tcp);
-
-  sh_portchk_add_to_list (IPPROTO_TCP,  8000, &haddr_local, NULL, SH_PORT_REQ, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,  8001, &haddr_local, NULL, SH_PORT_NOT, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,  8002, &haddr_local, NULL, SH_PORT_REQ, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,  8003, &haddr_local, NULL, SH_PORT_NOT, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,  8004, &haddr_local, NULL, SH_PORT_IGN, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,    -1, &haddr_local, "foo1", SH_PORT_NOT, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,    -1, &haddr_local, "foo2", SH_PORT_REQ, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,    -1, &haddr_local, "foo3", SH_PORT_NOT, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,    -1, &haddr_local, "foo4", SH_PORT_REQ, SH_PORT_UNKN);
-  sh_portchk_add_to_list (IPPROTO_TCP,    -1, &haddr_local, "foo5", SH_PORT_IGN, SH_PORT_UNKN);
-
-  sh_portchk_check_list (&portlist_tcp, IPPROTO_TCP, SH_PORT_NOREPT);
-
-  CuAssertPtrNotNull(tc, portlist_tcp);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, NULL);
-  CuAssertPtrNotNull(tc, portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8001, &haddr_local, NULL);
-  CuAssertTrue(tc, NULL == portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8002, &haddr_local, NULL);
-  CuAssertPtrNotNull(tc, portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8003, &haddr_local, NULL);
-  CuAssertTrue(tc, NULL == portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8004, &haddr_local, NULL);
-  CuAssertPtrNotNull(tc, portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, "foo1");
-  CuAssertTrue(tc, NULL == portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, "foo2");
-  CuAssertPtrNotNull(tc, portent);
-  CuAssertTrue(tc, 0 == strcmp(portent->service, "foo2"));
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, "foo3");
-  CuAssertTrue(tc, NULL == portent);
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, "foo4");
-  CuAssertPtrNotNull(tc, portent);
-  CuAssertTrue(tc, 0 == strcmp(portent->service, "foo4"));
-
-  portent = sh_portchk_get_from_list(IPPROTO_TCP,  8000, &haddr_local, "foo5");
-  CuAssertPtrNotNull(tc, portent);
-  CuAssertTrue(tc, 0 == strcmp(portent->service, "foo5"));
-
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(666, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 != sh_portchk_blacklist(666, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(667, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(668, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(666, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 != sh_portchk_blacklist(666, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(667, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 == sh_portchk_blacklist(668, &haddr_local, IPPROTO_UDP));
-
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(668, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(667, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(666, &haddr_local, IPPROTO_UDP));
-  CuAssertTrue(tc, 0 == sh_portchk_is_blacklisted(665, &haddr_local, IPPROTO_UDP));
-
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(668, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(667, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 != sh_portchk_is_blacklisted(666, &haddr_local, IPPROTO_TCP));
-  CuAssertTrue(tc, 0 == sh_portchk_is_blacklisted(665, &haddr_local, IPPROTO_TCP));
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-#endif
-
-#ifdef TEST_ONLY
-
-void usage (char * pname)
-{
-  printf ("%s [-r|--required interface:portlist][-o|--optional interface:portlist][--no-udp][-d|--debug] hostname\n\n", pname);
-  printf ("   Check local host for open ports; Version %s\n\n", PORTCHK_VERSION);
-  printf ("   Interface: Numeric address for an interface, e.g. 127.0.0.1\n");
-  printf ("   Portlist:  List of ports or services, e.g. 22/tcp,nfs/udp,nlockmgr/udp\n");
-  printf ("     required -> must be open\n");
-  printf ("     optional ->  may be open or closed\n");
-  printf ("   RPC services must be specified with service **name**, others with **port number**\n\n");
-  printf ("   Example:\n");
-  printf ("      %s --required 192.168.1.2:22/tcp,nfs/udp,nlockmgr/udp\n\n", pname);
-  return;
-}
-
-int main(int argc, char *argv[])
-{
-  char * pname = argv[0];
-
-
-  /* 
-  test_lists();
-
-  portlist_tcp = sh_portchk_kill_list (portlist_tcp);
-  portlist_udp = sh_portchk_kill_list (portlist_udp);
-  */
-
-  /* sh_portchk_add_required ("127.0.0.1 : nlockmgr/tcp, 5308/tcp, nfs/tcp"); */
-
-  while (argc > 1 && argv[1][0] == '-')
-    {
-      if (0 == strcmp(argv[1], "--help") || 0 == strcmp(argv[1], "-h"))
-	{
-	  usage(pname);
-	  exit (0);
-	}
-      else if (0 == strcmp(argv[1], "--required") || 0 == strcmp(argv[1], "-r"))
-	{
-	  if (argc < 3)
-	    {
-	      usage(pname);
-	      exit (1);
-	    }
-	  sh_portchk_add_required (argv[2]);
-	  --argc; ++argv;
-	}
-      else if (0 == strcmp(argv[1], "--optional") || 0 == strcmp(argv[1], "-o"))
-	{
-	  if (argc < 3)
-	    {
-	      usage(pname);
-	      exit (1);
-	    }
-	  sh_portchk_add_optional (argv[2]);
-	  --argc; ++argv;
-	}
-      else if (0 == strcmp(argv[1], "--no-udp"))
-	{
-	  sh_portchk_check_udp = 0;
-	}
-      else if (0 == strcmp(argv[1], "--debug") || 0 == strcmp(argv[1], "-d"))
-	{
-	  portchk_debug = 1;
-	}
-      else
-	{
-	  usage(pname);
-	  exit (1);
-	}
-      --argc; ++argv;
-    }
-
-  if (argc < 2)
-    {
-      usage(pname);
-      exit (1);
-    }
-
-  portchk_hostname = argv[1];
-      
-  if (0 != sh_portchk_init ())
-    {
-      usage(pname);
-      exit (1);
-    }
-
-  sh_portchk_check();
-
-  return 0;
-}
-#endif
Index: trunk/src/sh_prelink.c
===================================================================
--- trunk/src/sh_prelink.c	(revision 591)
+++ trunk/src/sh_prelink.c	(revision 1)
@@ -38,6 +38,7 @@
 static char * prelink_hash = NULL;
 
-int sh_prelink_set_path (const char * str)
-{
+int sh_prelink_set_path (char * str)
+{
+  size_t len;
   SL_ENTER(_("sh_prelink_set_path"));
   if (prelink_path != NULL)
@@ -48,14 +49,11 @@
       SL_RETURN((-1), _("sh_prelink_set_path")); 
     }
-#ifdef SH_EVAL_SHELL
-  prelink_path = sh_util_strdup(str);
+  len = sl_strlen (str);
+  prelink_path = SH_ALLOC(len+1);
+  (void) sl_strlcpy(prelink_path, str, len+1);
   SL_RETURN(0, _("sh_prelink_set_path")); 
-#else
-  prelink_path = NULL;
-  SL_RETURN((-1), _("sh_prelink_set_path"));
-#endif
-}
-
-int sh_prelink_set_hash (const char * str)
+}
+
+int sh_prelink_set_hash (char * str)
 {
   size_t len;
@@ -74,37 +72,23 @@
 }
 
-int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout, char * path)
-{
-  long   status;
-  char   magic[4];
-  char * tmp;
-
-  /* 42 bytes is about the minimum an ELF binary might have
-   * (with plenty of hacks to reduce the size, such as interleaving
-   * the code with the header...)
-   */
-  if (size < 42)
-    return S_FALSE;
-
-  status = sl_read_timeout (fd, magic, 4, alert_timeout, S_FALSE);
-  (void) sl_rewind(fd);
-  if (status == 4)
-    {
-      /*@-usedef@*/
-      if (magic[0] == (char) 0x7f &&
-	  magic[1] == 'E'  &&
-	  magic[2] == 'L'  &&
-	  magic[3] == 'F')
-	return S_TRUE;
-      /*@+usedef@*/
-    }
-  else
-    {
-      tmp = sh_util_safe_name (path);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGPATH, 
-		      _("Error reading file"), _("sh_prelink_iself"), tmp);
-      SH_FREE(path);
-    }
-  return S_FALSE;
+int sh_prelink_iself (SL_TICKET fd, off_t size, int alert_timeout)
+{
+   long status;
+   char magic[4];
+   if (size < 42)
+	return S_FALSE;
+   status = sl_read_timeout (fd, magic, 4, alert_timeout);
+   (void) sl_rewind(fd);
+   if (status == 4)
+     {
+       /*@-usedef@*/
+       if (magic[0] == (char) 0x7f &&
+	   magic[1] == 'E'  &&
+	   magic[2] == 'L'  &&
+	   magic[3] == 'F')
+	 return S_TRUE;
+       /*@+usedef@*/
+     }
+   return S_FALSE;
 }
 
@@ -115,5 +99,4 @@
   SL_TICKET ticket;
   char * tmp;
-  char hashbuf[KEYBUF_SIZE];
 
   if (task->com_ti != (-1))
@@ -123,21 +106,17 @@
       task->com_ti = -1;
     }
-  ticket = sl_open_read(FIL__, __LINE__, task->command, 
+  ticket = sl_open_read(task->command, 
 			task->privileged == 0 ? SL_NOPRIV : SL_YESPRIV);
   if (SL_ISERROR(ticket))
     {
-      char errbuf[SH_ERRBUF_SIZE];
-      char errbuf2[SH_ERRBUF_SIZE];
-      sh_error_message(errno, errbuf2, sizeof(errbuf2));
-      sl_strlcpy(errbuf, sl_error_string(ticket), sizeof(errbuf));
       tmp = sh_util_safe_name (task->command);
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, ticket, MSG_E_READ, errbuf, errbuf2, tmp);
+      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, ticket, MSG_E_READ, tmp);
       SH_FREE(tmp);
       return;
     }
-
+  tiger_fd = ticket;
   if (*(task->checksum) == '\0' ||
       0 == sl_strcmp(task->checksum, 
-		     sh_tiger_hash (task->command, ticket, TIGER_NOLIM, hashbuf, sizeof(hashbuf))))
+		     sh_tiger_hash (task->command, TIGER_FD, 0)))
     {
       task->com_fd = get_the_fd(ticket);
@@ -156,5 +135,5 @@
 /* returns static storage
  */
-int sh_prelink_run (char * path, char * file_hash, int alert_timeout, unsigned long mask)
+int sh_prelink_run (char * path, char * file_hash, int alert_timeout)
 {
   static int      init = S_FALSE;
@@ -164,4 +143,6 @@
   int    status = 0;
   char * p;
+  struct  sigaction  new_act;
+  struct  sigaction  old_act;
 
   SL_ENTER(_("sh_prelink_run"));
@@ -185,8 +166,6 @@
   if (init == S_FALSE)
     {
-      char dir[SH_PATHBUF];
-
       sh_ext_tas_init(&task);
-      p = sh_unix_getUIDdir (SH_ERR_ERR, task.run_user_uid, dir, sizeof(dir));
+      p = sh_unix_getUIDdir (SH_ERR_ERR, task.run_user_uid);
       if (p)
 	{
@@ -255,17 +234,18 @@
     }
 
+  /* ignore SIGPIPE (instead get EPIPE if connection is closed)
+   */
+  new_act.sa_handler = SIG_IGN;
+  (void) retry_sigaction (FIL__, __LINE__, SIGPIPE, &new_act, &old_act);
+
   /* read from pipe
    */
-  sl_read_timeout_prep (task.pipeTI);
-
-  {
-    char hashbuf[KEYBUF_SIZE];
-    UINT64 length_nolim = TIGER_NOLIM;
-    if (sh.flag.opts == S_TRUE) sh_tiger_set_hashtype_mask(mask);
-    sl_strlcpy(file_hash,
-	       sh_tiger_generic_hash (path, task.pipeTI, &length_nolim, alert_timeout,
-				      hashbuf, sizeof(hashbuf)),
-	       KEY_LEN+1);
-  }
+  tiger_fd = task.pipeTI;
+  strcpy(file_hash,                        /* known to fit */
+	 sh_tiger_generic_hash (path, TIGER_FD, 0, alert_timeout));
+
+  /* restore old signal handler
+   */
+  (void) retry_sigaction (FIL__, __LINE__, SIGPIPE, &old_act, NULL);
 
   /* close pipe and return exit status
Index: trunk/src/sh_prelude.c
===================================================================
--- trunk/src/sh_prelude.c	(revision 591)
+++ trunk/src/sh_prelude.c	(revision 1)
@@ -27,31 +27,34 @@
  *       include libprelude 0.9 code from Yoann Vandoorselaere
  */
-
-
-/*
- * for strptime()
- */
-#define _GNU_SOURCE 1 
-
+ 
 #include "config_xor.h"
+
+#define _XOPEN_SOURCE 500 /* glibc2 needs this */
 
 #include <stdio.h>
 #include <string.h>
-#include <ctype.h>
 #include <sys/types.h>
 
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
+#if TIME_WITH_SYS_TIME
+
+# include <sys/time.h>
+# include <time.h>
+
+#else
+
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+
 #endif
-#include <time.h>
 
 #include <unistd.h>
 #include <syslog.h>
 #include <pwd.h>
-
-int     sh_argc_store;
-char ** sh_argv_store;
-
-#if defined(HAVE_LIBPRELUDE)
+#include <grp.h>
+
+#if defined(HAVE_LIBPRELUDE) && defined(HAVE_LIBPRELUDE_9)
 
 
@@ -70,11 +73,9 @@
  * includes for samhain-specific functions (sl_strstr, sh_error_handle)
  */
-#include "samhain.h"
+#include "slib.h"
 #include "sh_cat.h"
 #include "sh_error_min.h"
 #include "sh_prelude.h"
-#define SH_NEED_PWD_GRP 1
-#include "sh_static.h"
-char * sh_util_strdup (const char * str) SH_GNUC_MALLOC;
+
 /*
  * When SH_USE_XML is set, value are formated using name="value".
@@ -92,5 +93,7 @@
 #define IDMEF_ANALYZER_CLASS _("Integrity Checker")
 #define IDMEF_ANALYZER_VERSION VERSION
-#define IDMEF_ANALYZER_MANUFACTURER _("http://www.la-samhna.de/samhain/")
+#define IDMEF_ANALYZER_MANUFACTURER _("Samhain by Rainer Wichmann")
+
+#define CLASSIFICATION_URL _("http://www.la-samhna.de/samhain/")
 
 
@@ -127,20 +130,8 @@
 }
 
-static int set_prelude_severity_int (const char * str, int prelude_sev)
-{
-        char * p;
-	char * dup = strdup (str);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-	char * saveptr;
-#endif
-
-	if (!dup) 
-	        return -1;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-	p = strtok_r (dup, ", \t", &saveptr);
-#else
-	p = strtok (dup, ", \t");
-#endif
+static int set_prelude_severity_int (char * str, int prelude_sev)
+{
+        char * p = strtok (str, ", \t");
+
         if (p) {
                 do {
@@ -161,32 +152,25 @@
                         else if (0 == strcmp (p, _("info")))
 	                        clear_and_set (prelude_sev, SH_ERR_INFO);
-                        else {
-			        free (dup);
+                        else
 	                        return -1;
-			}
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-                        p = strtok_r (NULL, ", \t", &saveptr);
-#else
                         p = strtok (NULL, ", \t");
-#endif
                 } while (p);
         }
-	free(dup);
         return 0;
 }
 
-int sh_prelude_map_info (const char * str)
+int sh_prelude_map_info (char * str)
 {
         return (set_prelude_severity_int(str,(int)IDMEF_IMPACT_SEVERITY_INFO));
 }
-int sh_prelude_map_low (const char * str)
+int sh_prelude_map_low (char * str)
 {
         return (set_prelude_severity_int(str,(int)IDMEF_IMPACT_SEVERITY_LOW));
 }
-int sh_prelude_map_medium (const char * str)
+int sh_prelude_map_medium (char * str)
 {
         return (set_prelude_severity_int(str,(int)IDMEF_IMPACT_SEVERITY_MEDIUM));
 }
-int sh_prelude_map_high (const char * str)
+int sh_prelude_map_high (char * str)
 {
         return (set_prelude_severity_int(str,(int)IDMEF_IMPACT_SEVERITY_HIGH));
@@ -210,9 +194,5 @@
 {
         char *ret = NULL;
-#if defined(SH_WITH_SERVER)
-        int    delim_start_count = 0;
-        int    found = 0;
-#endif                
-
+        
         ptr = strchr(ptr, delim_start);
         if ( ! ptr )
@@ -220,19 +200,6 @@
 
         ret = ++ptr;
-#if defined(SH_WITH_SERVER)
-        while ((*ptr != '\0') && (!found)){
-		if (*ptr == delim_end) {
-		        if (delim_start_count == 0)
-			        found = 1;
-			delim_start_count--;
-		}
-		else if (*ptr == delim_start) 
-		        delim_start_count++;
-		ptr++;
-        }
-        ptr = (found) ? ptr-1 : NULL ;
-#else
+
         ptr = strchr(ptr, delim_end);
-#endif
         if ( ! ptr )
                 return NULL;
@@ -330,5 +297,4 @@
 }
 
-/* flawfinder: ignore *//* is part of name, not access() */
 static void get_access_info(idmef_file_access_t *access, char * mode, int pos, int mpos)
 {
@@ -339,6 +305,5 @@
 	do {
 	        if ( mode[pos] == 'r' ) {
-			/* flawfinder: ignore *//* is part of name, not access() */
-	                ret = idmef_file_access_new_permission(access, &str, IDMEF_LIST_APPEND);
+	                ret = idmef_file_access_new_permission(access, &str, -1);
 	                if ( ret < 0 )
 	                        return;
@@ -347,6 +312,5 @@
 	        }
 	        else if ( mode[pos] == 'w' ) {
-			/* flawfinder: ignore *//* is part of name, not access() */
-	                ret = idmef_file_access_new_permission(access, &str, IDMEF_LIST_APPEND);
+	                ret = idmef_file_access_new_permission(access, &str, -1);
 	                if ( ret < 0 )
 	                        return;
@@ -355,6 +319,5 @@
 	        }
 	        else if ( mode[pos] == 'x' || mode[pos] == 's' || mode[pos] == 't') {
-			/* flawfinder: ignore *//* is part of name, not access() */
-	                ret = idmef_file_access_new_permission(access, &str, IDMEF_LIST_APPEND);
+	                ret = idmef_file_access_new_permission(access, &str, -1);
 	                if ( ret < 0 )
 	                        return;
@@ -374,6 +337,5 @@
 
 	if ( got == 0 ) {
-	        /* flawfinder: ignore *//* is part of name, not access() */
-	        ret = idmef_file_access_new_permission(access, &str, IDMEF_LIST_APPEND);
+	        ret = idmef_file_access_new_permission(access, &str, -1);
 	        if ( ret < 0 )
 	                return;
@@ -395,10 +357,10 @@
         prelude_string_t *str;
         idmef_checksum_t *checksum;
-        idmef_file_access_t *access; /* flawfinder: ignore */
+        idmef_file_access_t *access;
         idmef_user_id_t *userid;
         const char *suffix = (category == IDMEF_FILE_CATEGORY_CURRENT) ? "_new" : "_old";
 	char *mode = NULL;
                 
-        ret = idmef_target_new_file(target, &file, IDMEF_LIST_APPEND);
+        ret = idmef_target_new_file(target, &file, -1);
         if ( ret < 0  )
                 return;
@@ -412,8 +374,6 @@
                  */
                 ret = idmef_file_new_path(file, &str);
-                if ( ret < 0 ) {
-		        free(ptr);
-                        return;
-		}
+                if ( ret < 0 )
+                        return;
                 prelude_string_set_nodup(str, ptr);
 
@@ -421,7 +381,8 @@
                 if ( ptr ) {
                         ret = idmef_file_new_name(file, &str);
-                        if ( ret == 0 ) {
-			        prelude_string_set_dup(str, ptr + 1);
-			}
+                        if ( ret < 0 )
+                                return;
+                        
+                        prelude_string_set_dup(str, ptr + 1);
                 }
         }
@@ -436,7 +397,8 @@
         if ( ptr ) {
                 ret = idmef_time_from_samhain(&time, ptr);
-                if ( ret == 0 ) {
-                        idmef_file_set_modify_time(file, time);
-		}
+                if ( ret < 0 )
+                        return;
+                
+                idmef_file_set_modify_time(file, time);
                 free(ptr);
         }
@@ -445,7 +407,8 @@
         if ( ptr ) {
                 ret = idmef_time_from_samhain(&time, ptr);
-                if ( ret == 0 ) {
-                        idmef_file_set_create_time(file, time);
-		}
+                if ( ret < 0 )
+                        return;
+                
+                idmef_file_set_create_time(file, time);
                 free(ptr);
         }
@@ -454,17 +417,8 @@
         if ( ptr ) {
                 ret = idmef_file_new_inode(file, &inode);
-                if ( ret == 0 ) {
-			char * dev = get_value(msg, _("dev"), suffix);
-			if (dev) {
-			        char * q = strchr(dev, ',');
-				if (*q) {
-				         *q = '\0'; ++q;
-					 idmef_inode_set_major_device(inode, strtoul(dev, NULL, 0));
-					 idmef_inode_set_minor_device(inode, strtoul(  q, NULL, 0));
-				}
-				free(dev);
-			}
-			idmef_inode_set_number(inode, strtoul(ptr, NULL, 10));
-		}
+                if ( ret < 0 )
+                        return;
+                
+                idmef_inode_set_number(inode, strtoul(ptr, NULL, 10));
                 free(ptr);
         }
@@ -472,148 +426,109 @@
         ptr = get_value(msg, _("chksum"), suffix);
         if ( ptr ) {
-                ret = idmef_file_new_checksum(file, &checksum, IDMEF_LIST_APPEND);
-                if ( ret < 0 ) {
-			free(ptr);
-			goto get_mode;
-		}
+                ret = idmef_file_new_checksum(file, &checksum, 0);
+                if ( ret < 0 )
+                        return;
 
 		hashtype = sh_tiger_get_hashtype();
 
 		if (hashtype == 0)
-			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
-
-		else if (hashtype == 1)
-			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_SHA1);
-		
-		else if (hashtype == 2)
-			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_MD5);
-		
-		else
-			idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
-
-
-		ret = idmef_checksum_new_value(checksum, &str);
-		if ( ret < 0 ) {
-			free(ptr);
-			goto get_mode;
-		}
+                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
+
+                else if (hashtype == 1)
+                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_SHA1);
+
+                else if (hashtype == 2)
+                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_MD5);
+
+                else
+                        idmef_checksum_set_algorithm(checksum, IDMEF_CHECKSUM_ALGORITHM_TIGER);
+
+
+                ret = idmef_checksum_new_value(checksum, &str);
+                if ( ret < 0 )
+                        return;
 
 		/* will be freed on destroy()
 		 */
-		prelude_string_set_nodup(str, ptr);
-	}
-
- get_mode:
+                prelude_string_set_nodup(str, ptr);
+        }
 
 	mode = get_value(msg, _("mode"), suffix);
         if ( mode ) {
-	        /* flawfinder: ignore *//* is part of name, not access() */
-                ret = idmef_file_new_file_access(file, &access, IDMEF_LIST_APPEND);
-                if ( ret < 0 )
-                        goto get_owner;
-
-	        /* flawfinder: ignore *//* is part of name, not access() */
+                ret = idmef_file_new_file_access(file, &access, -1);
+                if ( ret < 0 )
+                        return;
+
                 ret = idmef_file_access_new_user_id(access, &userid);
                 if ( ret < 0 )
-                        goto get_owner;
+                        return;
                 idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_OTHER_PRIVS);
 
-	        /* flawfinder: ignore *//* is part of name, not access() */
 		get_access_info ( access, mode, 7, 9 );
         }
-
- get_owner:
  
         ptr = get_value(msg, _("owner"), suffix);
         if ( ptr ) {
-	        char * uid;
-                
-	        /* flawfinder: ignore *//* is part of name, not access() */
-                ret = idmef_file_new_file_access(file, &access, IDMEF_LIST_APPEND);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto get_group;
-		}
-
-	        /* flawfinder: ignore *//* is part of name, not access() */
+                struct passwd *pw;
+                
+                ret = idmef_file_new_file_access(file, &access, 0);
+                if ( ret < 0 )
+                        return;
+
                 ret = idmef_file_access_new_user_id(access, &userid);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto get_group;
-		}
+                if ( ret < 0 )
+                        return;
                 idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_USER_PRIVS);
                 
                 ret = idmef_user_id_new_name(userid, &str);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto get_group;
-                }
+                if ( ret < 0 )
+                        return;
+                
                 prelude_string_set_nodup(str, ptr);
                 
-                uid = get_value(msg, _("iowner"), suffix);
-                if ( ! uid )
-                        goto get_group;
-                
-                idmef_user_id_set_number(userid, strtoul(uid, NULL, 0));
+                pw = getpwnam(ptr);
+                if ( ! pw )
+                        return;
+                
+                idmef_user_id_set_number(userid, pw->pw_uid);
 
 		if ( mode ) {
-		        /* flawfinder: ignore *//* is part of name, not access() */
 		        get_access_info ( access, mode, 1, 3 );
 		}
-
-		free(uid);
-		/* Don't free(ptr) because of prelude_string_set_nodup(str, ptr) */
-        }
-
- get_group:
+        }
 
         ptr = get_value(msg, _("group"), suffix);
         if ( ptr ) {
-                char *gid;
-                
-	        /* flawfinder: ignore *//* is part of name, not access() */
-                ret = idmef_file_new_file_access(file, &access, IDMEF_LIST_APPEND);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto mode_free;
+                struct group *gr;
+                
+                ret = idmef_file_new_file_access(file, &access, -1);
+                if ( ret < 0 )
+                        return;
+
+                ret = idmef_file_access_new_user_id(access, &userid);
+                if ( ret < 0 )
+                        return;
+                idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_GROUP_PRIVS);
+                
+                ret = idmef_user_id_new_name(userid, &str);
+                if ( ret < 0 )
+                        return;
+                
+                prelude_string_set_nodup(str, ptr);
+
+                gr = getgrnam(ptr);
+                if ( ! gr )
+                        return;
+
+                idmef_user_id_set_number(userid, gr->gr_gid);
+
+		if ( mode ) {
+		        get_access_info ( access, mode, 4, 6 );
 		}
-
-                ret = idmef_file_access_new_user_id(access, &userid);/* flawfinder: ignore *//* is part of name, not access() */
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto mode_free;
-		}
-
-                idmef_user_id_set_type(userid, IDMEF_USER_ID_TYPE_GROUP_PRIVS);
-                
-                ret = idmef_user_id_new_name(userid, &str);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        goto mode_free;
-		}
-                
-                prelude_string_set_nodup(str, ptr);
-
-                gid = get_value(msg, _("igroup"), suffix);
-                if ( ! gid )
-                        goto mode_free;
-
-                idmef_user_id_set_number(userid, strtoul(gid, NULL, 0));
-
-		if ( mode ) {
-		        get_access_info ( access, mode, 4, 6 ); /* flawfinder: ignore */
-		}
-
-		free(gid);
-		/* Don't free(ptr) because of prelude_string_set_nodup(str, ptr) */
-        }
-
- mode_free:
+        }
 
 	if ( mode ) {
 	        free ( mode );
 	}
-
-	return;
 }
 
@@ -661,11 +576,4 @@
 #endif
 
-#ifdef SH_USE_PORTCHECK
-		{ MSG_PORT_MISS, N_("Service closed"), IDMEF_IMPACT_TYPE_OTHER },
-		{ MSG_PORT_NEW, N_("Service opened"), IDMEF_IMPACT_TYPE_OTHER },
-		{ MSG_PORT_RESTART, N_("Service restarted"), IDMEF_IMPACT_TYPE_OTHER },
-		{ MSG_PORT_NEWPORT, N_("Service restarted"), IDMEF_IMPACT_TYPE_OTHER },
-#endif
-
 #ifdef SH_USE_SUIDCHK
                 { MSG_SUID_POLICY, N_("SUID/SGID File Detected"), IDMEF_IMPACT_TYPE_FILE },
@@ -693,13 +601,5 @@
                 return -1;
         }
-
-#if defined(SH_WITH_SERVER)
-        /* when using yule, theres a msg=<... msg=<...> >*/
-	while ( (msg = get_value(ptr, _("msg"), NULL)) ) {
-	        free(ptr);
-		ptr = msg;
-	}
-#endif        
-
+        
         ret = prelude_string_cat(out, ptr);
         free(ptr);
@@ -709,276 +609,4 @@
 
 
-#ifdef SH_USE_PORTCHECK
-static int get_service_info(char *msg, idmef_alert_t *alert)
-{
-        int ret;
-	long port;
-	char *ptr, *new, *tmp, *ip, *srv, *protocol, *end;
-        prelude_string_t *str;
-        idmef_address_t *address;
-        idmef_node_t *node;
-	idmef_user_t *user;
-	idmef_process_t *process;
-        idmef_service_t *service;
-        idmef_source_t *source = idmef_alert_get_next_source(alert, NULL);
-        struct passwd *pw;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-	struct passwd pwd;
-	char * buffer;
-#endif
-
-        new = sh_util_strdup(msg);
- 
-        ptr = strstr(new, _("port: "));
-        if ( ! ptr ) {
-                sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-                                _("malformed Samhain port check message"), _("get_service_info"));
-		SH_FREE( new );
-                return -1;
-        }
-
-        ptr += 6; /* skip 'port: ', position on first byte of interface */
-        tmp = strchr(ptr, ':');
-        if ( ! tmp ) {
-                sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-                                _("malformed Samhain port check message (no port)"), _("get_service_info"));
-		SH_FREE( new );
-                return -1;
-        }
-	*tmp = '\0';
-
-	/* Get interface 
-	 */
-	ip = strdup(ptr);
-        if ( ip ) {
-                if ( ! source ) {
-                        ret = idmef_alert_new_source(alert, &source, IDMEF_LIST_APPEND);
-                        if ( ret < 0 ) {
-                                free(ip);
-				SH_FREE( new );
-                                return ret;
-                        }
-                }
-
-                ret = idmef_source_new_node(source, &node);
-                if ( ret < 0 ) {
-                        free(ip);
-			SH_FREE( new );
-                        return ret;
-                }
-                
-                ret = idmef_node_new_address(node, &address, IDMEF_LIST_APPEND);
-                if ( ret < 0 ) {
-                        free(ip);
-			SH_FREE( new );
-                        return ret;
-                }
-                
-                ret = idmef_address_new_address(address, &str);
-                if ( ret < 0 ) {
-                        free(ip);
-			SH_FREE( new );
-                        return ret;
-                }
-                
-                prelude_string_set_nodup(str, ip);
-        }
-
-	ptr = tmp;
-	++ptr;
-        tmp = strchr(ptr, '/');
-        if ( ! tmp ) {
-                sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-                                _("malformed Samhain port check message (no protocol)"), _("get_service_info"));
-		SH_FREE( new );
-                return -1;
-        }
-	*tmp = '\0';
-
-	/* Get port number
-	 */
-	port = strtol(ptr, &end, 0);
-        if ( *ptr && *end == '\0' && port >= 0 && port < 65536) {
-
-                if ( ! source ) {
-                        ret = idmef_alert_new_source(alert, &source, IDMEF_LIST_APPEND);
-                        if ( ret < 0 ) {
-				SH_FREE( new );
-                                return ret;
-                        }
-                }
-
-                ret = idmef_source_new_service(source, &service);
-                if ( ret < 0 ) {
-			SH_FREE( new );
-                        return ret;
-                }
-
-		idmef_service_set_port(service, port);
-
-                ret = idmef_service_new_protocol(service, &str);
-                if ( ret < 0 ) {
-			SH_FREE( new );
-                        return ret;
-                }
-                
-		++tmp; 
-		if (*tmp) { 
-		        char * tmpw = tmp;
-			char tmpw_store;
-			while (*tmpw && !isblank((int) *tmpw)) ++tmpw;
-			tmpw_store = *tmpw; *tmpw = '\0';
-		        protocol = strdup(tmp);
-			*tmpw = tmpw_store;
-			prelude_string_set_nodup(str, protocol);
-		}
-
-	}
-
-	ptr = tmp;
-	++ptr;
-        ptr = strchr(ptr, '(');
-        if ( ! ptr ) {
-                sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-                                _("malformed Samhain port check message (no service)"), _("get_service_info"));
-		SH_FREE( new );
-                return -1;
-        }
-	++ptr;
-        tmp = strchr(ptr, ')');
-        if ( ! tmp ) {
-                sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-                                _("malformed Samhain port check message (service not closed)"), _("get_service_info"));
-		SH_FREE( new );
-                return -1;
-        }
-	*tmp = '\0';
-
-	/* Get service
-	 */
-	srv = strdup(ptr);
-        if ( srv ) {
-                if ( ! source ) {
-                        ret = idmef_alert_new_source(alert, &source, IDMEF_LIST_APPEND);
-                        if ( ret < 0 ) {
-                                free(srv);
-				SH_FREE( new );
-                                return ret;
-                        }
-                }
-
-		if ( ! service ) {
-                        ret = idmef_source_new_service(source, &service);
-			if ( ret < 0 ) {
-                                free(srv);
-				SH_FREE( new );
-				return ret;
-			}
-                }
-
-                ret = idmef_service_new_name(service, &str);
-                if ( ret < 0 ) {
-                        free(srv);
-			SH_FREE( new );
-                        return ret;
-                }
-                
-                prelude_string_set_nodup(str, srv);
-        }
-
-	SH_FREE( new );
-
-        ptr = get_value(msg, _("userid"), NULL);
-
-        if ( ptr ) {
-
-	        idmef_user_id_t * user_id;
-
-	        ret = idmef_source_new_user(source, &user);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return ret;
-                }
-
-                idmef_user_set_category(user, IDMEF_USER_CATEGORY_APPLICATION);
-                
-                ret = idmef_user_new_user_id(user, &user_id, IDMEF_LIST_APPEND);
-                if ( ret < 0 ) {
-                        free(ptr);
-                        return ret;
-                }
-                
-                idmef_user_id_set_type(user_id, IDMEF_USER_ID_TYPE_CURRENT_USER);
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-		buffer = SH_ALLOC(SH_PWBUF_SIZE);
-		sh_getpwnam_r(ptr, &pwd, buffer, SH_PWBUF_SIZE, &pw);
-#else
-		pw = sh_getpwnam(ptr);
-#endif
-                if ( pw )
-                        idmef_user_id_set_number(user_id, pw->pw_uid);
-
-                ret = idmef_user_id_new_name(user_id, &str);
-                if ( ret < 0 ) {
-                        free(ptr);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-			SH_FREE(buffer);
-#endif
-                        return ret;
-                }
-                prelude_string_set_nodup(str, ptr);
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-		SH_FREE(buffer);
-#endif
-	}
-
-
-        ptr = get_value(msg, _("path"), NULL);
-        tmp = get_value(msg, _("pid"), NULL);
-
-        if ( ptr ) {
-
-                /*
-                 * In term of IDMEF, this is the full path,
-                 * including the name.
-                 */
-                ret = idmef_source_new_process(source, &process);
-                if ( ret < 0 ) {
-		        free(ptr);
-                        return ret;
-		}
-
-		ret = idmef_process_new_path(process, &str);
-                if ( ret < 0 ) {
-		        free(ptr);
-                        return ret;
-		}
-                prelude_string_set_nodup(str, ptr);
-
-                
-                if ( NULL != strrchr(ptr, '/') ) {
-                        ret = idmef_process_new_name(process, &str);
-                        if ( ret == 0 ) {
-			        ptr = strrchr(ptr, '/');
-			        prelude_string_set_dup(str, ptr + 1);
-			}
-                } else {
-		        ret = idmef_process_new_name(process, &str);
-                        if ( ret == 0 ) {
-			        prelude_string_set_dup(str, ptr);
-			}
-		}
-
-		idmef_process_set_pid(process, strtoul(tmp, NULL, 0));
-        }
-
-	if (tmp)
-	  free(tmp);
-
-	return 0;
-}
-#endif
 
 static int get_login_info(char *msg, idmef_alert_t *alert)
@@ -989,8 +617,4 @@
         idmef_node_t *node;
         struct passwd *pw;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-	struct passwd pwd;
-	char * buffer;
-#endif
         prelude_string_t *str;
         idmef_user_id_t *user_id;
@@ -1002,5 +626,5 @@
         if ( ptr ) {
                 if ( ! source ) {
-                        ret = idmef_alert_new_source(alert, &source, IDMEF_LIST_APPEND);
+                        ret = idmef_alert_new_source(alert, &source, -1);
                         if ( ret < 0 ) {
                                 free(ptr);
@@ -1015,5 +639,5 @@
                 }
                 
-                ret = idmef_node_new_address(node, &address, IDMEF_LIST_APPEND);
+                ret = idmef_node_new_address(node, &address, -1);
                 if ( ret < 0 ) {
                         free(ptr);
@@ -1036,5 +660,5 @@
                 else {
                         if ( ! source ) {
-                                ret = idmef_alert_new_source(alert, &source, IDMEF_LIST_APPEND);
+                                ret = idmef_alert_new_source(alert, &source, -1);
                                 if ( ret < 0 ) {
                                         free(ptr);
@@ -1069,5 +693,5 @@
                 idmef_user_set_category(user, IDMEF_USER_CATEGORY_OS_DEVICE);
                 
-                ret = idmef_user_new_user_id(user, &user_id, IDMEF_LIST_APPEND);
+                ret = idmef_user_new_user_id(user, &user_id, -1);
                 if ( ret < 0 ) {
                         free(ptr);
@@ -1077,10 +701,5 @@
                 idmef_user_id_set_type(user_id, IDMEF_USER_ID_TYPE_TARGET_USER);
                 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-		buffer = SH_ALLOC(SH_PWBUF_SIZE);
-		sh_getpwnam_r(ptr, &pwd, buffer, SH_PWBUF_SIZE, &pw);
-#else
-		pw = sh_getpwnam(ptr);
-#endif
+                pw = getpwnam(ptr);
                 if ( pw )
                         idmef_user_id_set_number(user_id, pw->pw_uid);
@@ -1089,7 +708,4 @@
                 if ( ret < 0 ) {
                         free(ptr);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-			SH_FREE(buffer);
-#endif
                         return ret;
                 }
@@ -1101,7 +717,4 @@
                         if ( ret < 0 ) {
                                 free(ptr);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-				SH_FREE(buffer);
-#endif
                                 return ret;
                         }
@@ -1109,7 +722,4 @@
                         prelude_string_set_nodup(str, ptr);
                 }
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-		SH_FREE(buffer);
-#endif
         }
 
@@ -1130,37 +740,7 @@
 }
 
-#if defined(SH_WITH_SERVER)
-static int node_set_address(idmef_node_t *node, const char *addr)
-{
-        int ret;
-	prelude_string_t *prelude_str;
-	idmef_address_t *idmef_addr;
-
-	ret = prelude_string_new(&prelude_str);
-	if ( ret < 0 ) 
-                goto err;
-      
-	ret = prelude_string_set_ref(prelude_str, addr);
-	if ( ret < 0 ) 
-                goto err;
-
-	ret = idmef_address_new(&idmef_addr);
-	if ( ret < 0 ) 
-                goto err;
-      
-	idmef_address_set_category(idmef_addr, IDMEF_ADDRESS_CATEGORY_IPV4_ADDR);
-	idmef_address_set_address(idmef_addr, prelude_str);
-	idmef_node_set_address(node, idmef_addr, 0);
-
-	return 0;
- err:
-        return -1;
-}
-#endif
-                                          
 
 static int samhain_alert_prelude(int priority, int sh_class, 
-				 char *message, unsigned long msgid, 
-				 char * inet_peer_ip)
+				 char *message, unsigned long msgid)
 {
         int ret;
@@ -1175,11 +755,6 @@
         idmef_confidence_t *confidence;
         prelude_string_t *str;
-#if defined(SH_WITH_SERVER)
-        idmef_node_t *node;
-#else
-	(void) inet_peer_ip;
-#endif
-                
-        if ( !client || sh_class == STAMP)
+                
+        if ( sh_class == STAMP)
                 return 0;
         
@@ -1192,5 +767,5 @@
                 goto err;
 
-        idmef_alert_set_analyzer(alert, idmef_analyzer_ref(prelude_client_get_analyzer(client)), IDMEF_LIST_PREPEND);
+        idmef_alert_set_analyzer(alert, idmef_analyzer_ref(prelude_client_get_analyzer(client)), 0);
         
         ret = idmef_time_new_from_gettimeofday(&time);
@@ -1208,34 +783,18 @@
                 goto err;
         
-        ret = idmef_alert_new_target(alert, &target, IDMEF_LIST_APPEND);
+        ret = idmef_alert_new_target(alert, &target, -1);
         if ( ret < 0 )
                 goto err;
 
         idmef_target_set_decoy(target, IDMEF_TARGET_DECOY_NO);
-
-#if defined(SH_WITH_SERVER)
-        if ( inet_peer_ip != NULL){
-                ret = idmef_target_new_node(target, &node);
-		if ( ret < 0 )
-                          goto err;
-        
-		ret = node_set_address(node, inet_peer_ip); 
-		if ( ret < 0 )
-                          goto err;
-                          
-		idmef_target_set_node(target, idmef_node_ref(node));
-        }
-        else
-#endif        
+        
         if ( idmef_analyzer_get_node(prelude_client_get_analyzer(client)) ) {
                 idmef_node_ref(idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
                 idmef_target_set_node(target, idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
         }
-
+        
         if ( strstr(message, _("path=")) ) {
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
                 if ( msgid != MSG_FI_ADD && msgid != MSG_FI_ADD2 )
                         get_file_infos(target, message, IDMEF_FILE_CATEGORY_ORIGINAL);
-#endif
                 
                 get_file_infos(target, message, IDMEF_FILE_CATEGORY_CURRENT);
@@ -1258,12 +817,4 @@
                 goto err;
         
-#ifdef SH_USE_PORTCHECK
-	if (msgid == MSG_PORT_MISS || msgid == MSG_PORT_NEW || msgid == MSG_PORT_RESTART || msgid == MSG_PORT_NEWPORT) {
-	        ret = get_service_info(message, alert);
-		if ( ret < 0 )
-		        goto err;
-        }
-#endif
-   
         map_policy_to_class(message, msgid, impact, str);
 
@@ -1288,5 +839,5 @@
         idmef_confidence_set_rating(confidence, IDMEF_CONFIDENCE_RATING_HIGH);
         
-        ret = idmef_alert_new_additional_data(alert, &data, IDMEF_LIST_APPEND);
+        ret = idmef_alert_new_additional_data(alert, &data, -1);
         if ( ret < 0 )
                 goto err;
@@ -1313,5 +864,5 @@
 
 
-int sh_prelude_alert(int priority, int sh_class, char *message, long msgflags, unsigned long msgid, char *inet_peer_ip)
+int sh_prelude_alert(int priority, int sh_class, char *message, long msgflags, unsigned long msgid)
 {
         int ret;
@@ -1319,8 +870,8 @@
 	(void) msgflags; /* fix compiler warning */
 
-        if ( initialized < 1 )
+        if ( initialized < 0 )
                 return -1;
         
-        ret = samhain_alert_prelude(priority, sh_class, message, msgid, inet_peer_ip);
+        ret = samhain_alert_prelude(priority, sh_class, message, msgid);
         if ( ret < 0 ) {
                 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
@@ -1334,5 +885,5 @@
 
 
-int sh_prelude_set_profile(const char *arg)
+int sh_prelude_set_profile(char *arg)
 {
         if ( profile ) {
@@ -1350,8 +901,5 @@
 }
 
-/* Allow initialization of prelude; to be called
- * after forking the daemon. Delays heartbeat
- * start after config read until it is safe.
- */
+
 void sh_prelude_reset(void)
 {
@@ -1369,14 +917,5 @@
         if (initialized < 1)
                 return;
-
-	if (sh.flag.isdaemon == S_TRUE)
-	        prelude_client_destroy(client, PRELUDE_CLIENT_EXIT_STATUS_FAILURE);
-	else
-	        prelude_client_destroy(client, PRELUDE_CLIENT_EXIT_STATUS_SUCCESS);
-
-	client = NULL;
-
-	prelude_deinit();
-
+        prelude_client_destroy(client, PRELUDE_CLIENT_EXIT_STATUS_SUCCESS);
         initialized = 0;
         return;
@@ -1391,8 +930,4 @@
         idmef_analyzer_t *analyzer;
         prelude_client_flags_t flags;
-#ifdef SH_NOFAILOVER
-	prelude_connection_pool_t *pool;
-	prelude_connection_pool_flags_t conn_flags;
-#endif
 
 	if (ready_for_init == 0)
@@ -1403,5 +938,5 @@
 
 	prelude_thread_init(NULL);
-        prelude_init(&sh_argc_store, sh_argv_store);
+        prelude_init(NULL, NULL);
 
         ret = prelude_client_new(&client, profile ? profile : _("samhain"));
@@ -1430,12 +965,4 @@
         prelude_string_set_dup(str, IDMEF_ANALYZER_VERSION);
         
-#ifdef SH_NOFAILOVER
-	pool = prelude_client_get_connection_pool(client);
-	conn_flags = prelude_connection_pool_get_flags(pool);
-
-	conn_flags &= ~PRELUDE_CONNECTION_POOL_FLAGS_FAILOVER;
-	prelude_connection_pool_set_flags(pool, conn_flags);
-#endif
-
         ret = prelude_client_start(client);
         if ( ret < 0 ) {
Index: trunk/src/sh_prelude_old.c
===================================================================
--- trunk/src/sh_prelude_old.c	(revision 1)
+++ trunk/src/sh_prelude_old.c	(revision 1)
@@ -0,0 +1,825 @@
+/*
+ *
+ * Copyright (C) 2004, 2005 Rainer Wichmann, Patrice Bourgin, 
+ *                    Yoann Vandoorselaere
+ *
+ * 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, 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; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/*
+ *
+ * 03/12/2004 : R.W.: 
+ *       fix more memory leaks in get_file_infos()
+ *       workaround (re-init) for file descriptor closing problem with GPG
+ *
+ * R.W.: fix missing treatment of alternative XML-style messages
+ *       fix get_value (if terminating '>' or '"' is not found, may 
+ *           overwrite the NULL terminator of the string ...)
+ *       fix memory leaks in get_file_infos(), retrieve_time()
+ *
+ * 13/03/2004 : This file is modified by Patrice Bourgin 
+ *              <pbourgin@xpconseil.com> 
+ *
+ * R.W.: Some problems with the patch by Patrice Bourgin fixed 
+ *       (e.g. memory leak)
+ *
+ * Modifications (13/03/2004) by Patrice bourgin (pbourgin@xpconseil.com) : 
+ * Comment : thanks for memory leak fix :p
+ * 1 : remove translation of HTML tag
+ * 2 : send detailled information about files to prelude (with two 
+ *     functions : get_value and get_file_infos)
+ *     these two functions were written by Yoann, but for future 
+ *     version of prelude, I adapt them to work
+ *     with version 0.8.10 of libprelude
+ * 3 : send a heartbeat just after initialization, to alert prelude that 
+ *     samhain is started
+ * 4 : these modifications was tested successfully, and all informations are 
+ *     correctly transmitted to prelude and displayed with piwi
+ *
+ * Modifications (7/03/2004) by Patrice bourgin (pbourgin@xpconseil.com) : 
+ * 1 : translation of HTML tag <> to tag () in alert to permit 
+ *     displaying alerts on piwi
+ * 2 : add the address in the source and in the target for displaying on piwi
+ * 3 : add information about the classification, because there was only 
+ *     one classification and it was not enough
+ * 4 : add impact field to classify alert in prelude, becuse impact is 
+ *     needed to treat information
+ * 5 : correct some errors with transmission to prelude  with libprelude
+ */
+ 
+#include "config_xor.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#include <unistd.h>
+#include <syslog.h>
+
+#if defined(HAVE_LIBPRELUDE) && !defined(HAVE_LIBPRELUDE_9)
+
+/*
+ * _() macros are samhain specific; they are used to replace string
+ * constants at runtime. This is part of the samhain stealth mode
+ * (fill string constants with encoded strings, decode at runtime).
+ */
+#define FIL__  _("sh_prelude.c")
+
+#if defined(__GNUC__)
+extern char *strptime (const char * s,
+                       const char * fmt, struct tm * tp);
+#endif
+
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/utsname.h>
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h> 
+#endif
+
+#include <libprelude/list.h>
+#include <libprelude/idmef-tree.h>
+#include <libprelude/idmef-tree-func.h>
+#include <libprelude/prelude-io.h>
+#include <libprelude/prelude-message.h>
+#include <libprelude/prelude-message-buffered.h>
+#include <libprelude/idmef-msg-send.h>
+#include <libprelude/idmef-message-id.h>
+#include <libprelude/prelude-message-id.h>
+#include <libprelude/sensor.h>
+
+#ifndef HAVE_BASENAME
+#define basename(a) ((NULL == strrchr(a, '/')) ? (a) : (strrchr(a, '/')))
+#endif
+
+/* 
+ * includes for samhain-specific functions (sl_strstr, sh_error_handle)
+ */
+#include "slib.h"
+#include "sh_mem.h"
+#include "sh_cat.h"
+#include "sh_error_min.h"
+#include "sh_prelude.h"
+#define SH_NEED_GETHOSTBYXXX
+#include "sh_static.h"
+
+static char               programname[64];
+static idmef_heartbeat_t  heartbeat;
+static prelude_msgbuf_t * hb_msgbuf  = NULL; 
+static struct utsname   * uname_data = NULL;
+
+static char               hostname[256];
+			  
+static char               model[64];
+static char               class[64];
+static char               version[8];
+static char               manufacturer[64];
+			  
+static char               name[16];
+static char               url[32];
+			  
+static char               meaning[64];
+static char               description[128];
+
+static char             * path_basename = NULL;
+static char             * path_fullname = NULL;
+
+/* safe string duplication function
+ */
+static char * xstrdup (const char * str)
+{
+  size_t len;
+  char * ret;
+
+  if (!str)
+    return NULL;
+  len = sl_strlen(str);
+  ret = SH_ALLOC(len+1);
+  sl_strlcpy (ret, str, len+1);
+  return (ret);
+}
+
+/* Get the value for a key. The key is built from toktmp + toksuffix.
+ * msg is modified temporarily, so it should not be declared 'const'.
+ */
+static char *get_value (char *msg, const char *toktmp, 
+			const char *toksuffix)
+{
+  char * ret = NULL, *ptr, tok[128];
+
+  snprintf(tok, sizeof(tok), "%s%s", toktmp, (toksuffix) ? toksuffix : "");
+
+  ptr = strstr(msg, tok);
+  if ( ! ptr )
+    return NULL;
+
+#ifdef SH_USE_XML
+  while (*ptr && *ptr != '"') ptr++;
+  if (*ptr) { 
+    ret = ptr + 1; ptr = ret; 
+  }
+  while (*ptr && *ptr != '"') ptr++;
+  if (*ptr)
+    {
+      *ptr = '\0';
+      if (ret) ret = xstrdup(ret);
+      *ptr = '"';
+    }
+  else
+    {
+      if (ret) ret = xstrdup(ret);
+    }
+#else
+  while (*ptr && *ptr != '<') ptr++;
+  if (*ptr) ret = ptr + 1;
+  while (*ptr && *ptr != '>') ptr++;
+  if (*ptr)
+    {
+      *ptr = '\0';
+      if (ret) ret = xstrdup(ret);
+      *ptr = '>';
+    }
+  else
+    {
+      if (ret) ret = xstrdup(ret);
+    }
+#endif
+
+  return ret;
+}
+
+int sh_prelude_init ()
+{
+  int ret = -1;
+
+  if (uname_data != NULL) {
+    SH_FREE(uname_data);
+    uname_data = NULL;
+  }
+  uname_data = SH_ALLOC(sizeof(struct utsname));    /* only once */
+  if (!uname_data) {
+    return -1; 
+  }
+  ret = uname(uname_data);
+  if (ret < 0) {
+    uname_data = NULL;
+    return -1;
+  }
+
+  /* ------- LibPrelude Init ------- 
+   */
+  strncpy(programname, _("Samhain"), 64);
+  programname[63] = '\0';
+
+  if ( prelude_sensor_init(programname, NULL, 0, NULL) < 0)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+		      _("Failed to initialize Prelude"), 
+		      _("sh_prelude_init"));
+      return -1;
+    }
+
+  strncpy(model, _("Samhain"), 64);
+  model[63] = '\0';
+  strncpy(class, _("Samhain Host Intrusion Detection System"), 64);
+  class[63] = '\0';
+  strncpy(version, VERSION, 8); 
+  version[7] = '\0';
+  strncpy(manufacturer, _("Samhain by Rainer Wichmann"), 64);
+  manufacturer[63] = '\0';
+
+  /*
+  if (sh.host.name[0] != '\0') {
+    strncpy(hostname, sh.host.name, 256); hostname[255] = '\0';
+  } else {
+    gethostname (hostname, 256); hostname[255] = '\0';
+  }
+  */
+
+  /* According to the manpage, if gethostname returns a truncated hostname,
+   * it may or may not be NULL terminated. So we terminate explicitely.
+   */
+  gethostname (hostname, 256); hostname[255] = '\0';
+
+  strncpy (name, _("Samhain HIDS"), 16);
+  name[15] = '\0';
+  strncpy (url, _("http://www.la-samhna.de/samhain/"), 32);
+  url[31] = '\0';
+
+  strncpy (meaning, _("Message generated by Samhain"), 64);
+  meaning[63] = '\0';
+
+  /* analyzer information */
+  idmef_string_set (&heartbeat.analyzer.model,   model);
+  idmef_string_set (&heartbeat.analyzer.class,   class);
+  idmef_string_set (&heartbeat.analyzer.version, version);
+  
+  /* analyzer address */
+  idmef_analyzer_node_new(&heartbeat.analyzer);
+  idmef_string_set (&heartbeat.analyzer.node->name, hostname);
+  
+  /* analyzer type */
+  idmef_string_set(&heartbeat.analyzer.ostype,    uname_data->sysname);
+  idmef_string_set(&heartbeat.analyzer.osversion, uname_data->release);
+
+  
+  INIT_LIST_HEAD(&heartbeat.additional_data_list);
+  
+  if (hb_msgbuf != NULL)
+    {
+      prelude_msgbuf_close (hb_msgbuf);
+      hb_msgbuf = NULL;
+    }
+  hb_msgbuf = prelude_msgbuf_new(0);
+  if (!hb_msgbuf) {
+    return -1;
+  }
+
+  /* prelude_heartbeat_register_cb(&SendHeartbeat, NULL); */
+  return 1;
+}
+
+/* Retrieve the content of "msg=" for adding informations on 
+ * impact tag with prelude 
+ */
+char *RetrieveImpact(const char *msg)
+{
+  char *tmp1;
+  char *tmp2;
+  char *tmp0;
+  char *ret = NULL;
+  
+  tmp2 = xstrdup(msg);
+  /* 
+   * don't use strtok - strtok (str, delim) is 'one of the chars 
+   * in delim', not the full 'delim' string
+   */
+  if (tmp2)
+    tmp1 = sl_strstr (tmp2, _("msg="));
+  else
+    return NULL;
+
+  if (tmp1)
+    {
+      tmp1 += 5;
+#ifdef SH_USE_XML
+      tmp0 = strchr(tmp1, '"');
+#else
+      tmp0 = strchr(tmp1, '>');
+#endif
+      if (tmp0)
+	*tmp0 = '\0';
+      ret = xstrdup(tmp1);
+    }
+  SH_FREE(tmp2); /* fix memory leak */
+
+  return ret;
+}
+
+/* Transform the string time from the event into time 
+ */
+time_t retrieve_time(char *stime)
+{
+#ifdef HAVE_STRPTIME
+  struct tm tmptime;
+  time_t rettime = -1;
+  char *tmp0, *tmp1, *tmp2;
+
+  /* fix more memory leaks
+   */
+  if ( stime )
+    {
+      tmp0 = xstrdup(stime);
+      tmp1 = tmp0;
+      tmp2 = tmp1 + 1;
+        	
+      while (*tmp1 && *tmp1 != ']') tmp1++;
+      if (*tmp1)
+	{
+	  *tmp1 = '\0';
+	  tmp2 = xstrdup(tmp2);  
+	  SH_FREE (tmp0);
+	}
+      else
+	{
+	  tmp2 = xstrdup(tmp2);
+	  SH_FREE (tmp0);
+	}
+      
+      memset (&tmptime, '\0', sizeof(struct tm));
+      strptime(tmp2,"%Y-%m-%dT%H:%M:%S", &tmptime);
+      rettime = mktime(&tmptime);
+
+      SH_FREE(tmp2);
+
+      if ( rettime != -1 )
+	return rettime;
+      else
+	return 0;
+    } 
+#endif
+  return 0;
+}
+
+/* msg is modified temporarily in get_value(), 
+ * so it should not be declared 'const'.
+ */
+void get_file_infos(idmef_target_t *target, char *msg, 
+		    idmef_file_category_t category)
+{
+  char *ptr;
+  idmef_file_t *file;
+  idmef_time_t *temps;
+  idmef_inode_t *inode;
+  const char *suffix = (category == current) ? "_new" : "_old";
+  
+  file = idmef_target_file_new(target);
+  if ( ! file )
+    return;
+  
+  file->category = category;
+  /* 
+   * Fix memory leak - the pointer to  get_value(msg, "path", NULL) is lost
+   * libprelude does not strdup, only sets a pointer, so need a global pointer
+   * to keep track of this :(
+   */
+  if (category == original)
+    path_fullname = get_value(msg, "path", NULL);
+  idmef_string_set (&file->path, path_fullname);
+
+  if (category == original)
+    path_basename = get_value(msg, "path", NULL);
+  if (path_basename) {
+    idmef_string_set (&file->name, basename(path_basename));
+  }
+  
+  ptr = get_value(msg, "size", suffix);
+  if ( ptr ) {
+    file->data_size = strtoul(ptr, NULL, 10);
+    SH_FREE(ptr);
+  }
+  
+  ptr = get_value(msg, "mtime", suffix);
+  if ( ptr ) {
+    temps = idmef_file_modify_time_new(file);
+    temps->sec = retrieve_time(ptr);
+    SH_FREE(ptr);
+  }
+  
+  ptr = get_value(msg, "ctime", suffix);
+  if ( ptr ) {
+    temps = idmef_file_create_time_new(file);
+    temps->sec = retrieve_time(ptr);
+    SH_FREE(ptr);
+  }
+  
+  ptr = get_value(msg, "atime", suffix);
+  if ( ptr ) {
+    temps = idmef_file_access_time_new(file);
+    temps->sec = retrieve_time(ptr);
+    SH_FREE(ptr);
+  }
+  
+  ptr = get_value(msg, "inode", suffix);
+  if ( ptr ) {
+    inode = idmef_file_inode_new(file);
+    inode->number = strtoul(ptr, NULL, 10);
+    SH_FREE(ptr);
+  }
+}
+
+void sh_prelude_reset()
+{
+  (void) sh_prelude_alert (0, 0, NULL, 0, 0);
+  return;
+}
+
+int sh_prelude_alert (int priority, int sh_class, char * message,
+		      long msgflags, unsigned long msgid)
+{
+  static int                initialized = 0;
+  struct timeval            tv;
+
+  idmef_alert_t           * alert;
+  idmef_message_t         * idmef;
+  prelude_msgbuf_t        * msgbuf;
+  idmef_classification_t  * classification;        
+  idmef_target_t          * target;
+  idmef_address_t 	  * taddr;
+  idmef_source_t          * source;
+  idmef_assessment_t      * assessment;
+  idmef_additional_data_t * data;
+  /* To store impact */
+  char			  * impactmsg = NULL; 
+  struct hostent 	  * myhost;
+  char 			  * src_ip = NULL;
+
+  static int                some_error = 0;
+
+  (void) msgflags;
+  (void) msgid;
+
+  /* Workaround for the file closing bug
+   */
+  if (message == NULL && priority == 0 && sh_class == 0)
+    {
+      initialized = 0;
+      return 0;
+    }
+
+  if (initialized == 0)
+    {
+      /* initialize
+       */
+      initialized = sh_prelude_init();
+
+     /* send a heartbeat after initialization to say to prelude "I'm alive" */
+     
+      gettimeofday(&tv, NULL);
+      heartbeat.create_time.sec  = tv.tv_sec;
+      heartbeat.create_time.usec = tv.tv_usec;
+  
+      /*
+       * we could use additional data to send stats.
+       */
+      prelude_msgbuf_set_header(hb_msgbuf, PRELUDE_MSG_IDMEF, 0);
+      idmef_send_heartbeat(hb_msgbuf, &heartbeat);
+      prelude_msgbuf_mark_end(hb_msgbuf);
+    }
+  if (initialized == -1)
+    {
+      /* init failed
+       */
+      if (some_error == 0)
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			  _("Problem with prelude-ids support: init failed"), 
+			  _("sh_prelude_alert"));
+	}
+      some_error = 1;
+      return -1; 
+    }
+
+  if (sh_class == STAMP)
+    {
+      gettimeofday(&tv, NULL);
+      heartbeat.create_time.sec  = tv.tv_sec;
+      heartbeat.create_time.usec = tv.tv_usec;
+  
+      /*
+       * we could use additional data to send stats.
+       */
+      prelude_msgbuf_set_header(hb_msgbuf, PRELUDE_MSG_IDMEF, 0);
+      idmef_send_heartbeat(hb_msgbuf, &heartbeat);
+      prelude_msgbuf_mark_end(hb_msgbuf);
+      return 0;
+    }
+
+  /* This function serves to initialize a message structure.
+   * The returned idmef_message_t structure is a static variable
+   * declared in idmef_message_new().
+   */
+  idmef = idmef_message_new();
+  if ( ! idmef )
+    goto err;
+        
+  /* 'alert' is a static variable that gets initialized and
+   * associated with the idmef_message_t idmef_alert_t member. 
+   * -> no new memory allocated; not signal-safe or thread-safe.
+   */
+  idmef_alert_new(idmef);
+  alert = idmef->message.alert;
+      
+  /* Set the 'detect time'. idmef_alert_new() will already set the
+   * 'create time', whatever the difference is supposed to be.
+   */
+  gettimeofday(&tv, NULL);
+  idmef_alert_detect_time_new(alert);
+  alert->detect_time->sec  = tv.tv_sec;
+  alert->detect_time->usec = tv.tv_usec;
+       
+  /* ------- Analyzer. -------
+   * 
+   * This apparently is supposed to provide some information
+   * about the sensor to the server (what sensor process ? where ?).
+   *
+   * idmef_string_set (x, y) is a macro that will make x
+   * a pointer to y. Therefore the caller must guarantee that y will
+   * never be overwritten until the alert is sent.
+   * With the samhain _() macros, this means we must copy to another
+   * storage region.
+   *
+   * N.B.: with constant strings, you can use idmef_string_set_constant() 
+   * instead.
+   */
+  idmef_string_set (&alert->analyzer.model,        model);
+  idmef_string_set (&alert->analyzer.class,        class);
+  idmef_string_set (&alert->analyzer.version,      version);
+  idmef_string_set (&alert->analyzer.manufacturer, manufacturer);
+
+  /* Here we add some information on the host OS.
+   */
+  idmef_string_set (&alert->analyzer.ostype,    uname_data->sysname);
+  idmef_string_set (&alert->analyzer.osversion, uname_data->release);
+
+  /* ------- Analyzer / Process ------- 
+   *
+   * Fill in minimal info about the process. Apparently one could also
+   * supply things like path, argv, env (?).
+   */
+  idmef_analyzer_process_new (&alert->analyzer);
+  alert->analyzer.process->pid = getpid();
+
+  /* ------- Analyzer / Node ------- 
+   *
+   * Provide the name of this node, i.e. host.
+   */
+  idmef_analyzer_node_new (&alert->analyzer);
+  idmef_string_set (&alert->analyzer.node->name, hostname);
+
+
+
+  /* ------- Classification -------
+   *
+   * Apparently 'classification' provides details about the sensor
+   * program.
+   *
+   * For reasons unbeknown to me (did not care to investigate),
+   * this function does allocate memory, instead of using a static variable. 
+   *
+   */
+  classification = idmef_alert_classification_new(alert);
+  if ( ! classification )
+    goto err;
+
+
+  impactmsg = RetrieveImpact(message);
+  if (impactmsg)
+    idmef_string_set (&classification->name, impactmsg);
+  idmef_string_set (&classification->url,  url);
+
+  classification->origin = vendor_specific;
+         
+  /* Get information about ip address */
+  
+  myhost = sh_gethostbyname(hostname);
+  src_ip = xstrdup(inet_ntoa(*((struct in_addr *)myhost->h_addr_list[0])));
+              
+
+  /* ------- Target -------
+   *
+   * Purpose ? To provide informations about destination of alert
+   *
+   * Allocates memory.
+   *
+   */
+  target = idmef_alert_target_new(alert);
+  if ( ! target )
+    goto err;
+  idmef_target_node_new(target);
+  idmef_string_set(&target->node->name, hostname);
+
+  if ( strstr(message, "path=") ) {
+    get_file_infos(target, message, original);
+    get_file_infos(target, message, current);
+  }
+
+  if (src_ip)
+    {
+      taddr = idmef_node_address_new(target->node);
+      if (!taddr) 
+	goto err;
+      
+      taddr->category = ipv4_addr;
+      idmef_string_set(&taddr->address, src_ip);
+    }
+
+  /* ------- Source -------
+   *
+   * Purpose ? To provide informations about source of alert
+   *
+   * Allocates memory.
+   *
+   */
+  source = idmef_alert_source_new(alert);
+  if ( ! source )
+    goto err;
+
+  /* ------- Impact ------- 
+   */
+  idmef_alert_assessment_new(alert);
+  assessment = alert->assessment;
+  idmef_assessment_impact_new(assessment);
+
+  if ((priority == SH_ERR_SEVERE) || (priority == SH_ERR_FATAL))
+    {
+      assessment->impact->severity   = impact_high;
+    }
+  else if ((priority == SH_ERR_ALL) || (priority == SH_ERR_INFO) ||
+      (priority == SH_ERR_NOTICE))
+    {
+      assessment->impact->severity   = impact_low;
+    }
+  else
+    {
+      assessment->impact->severity   = impact_medium;
+    }
+
+  if (NULL != sl_strstr(message, _("POLICY")))
+    {
+      if (NULL != sl_strstr(message, _("POLICY KERNEL")))
+	{
+	  assessment->impact->severity   = impact_high;
+	  assessment->impact->completion = succeeded;
+	  assessment->impact->type       = other;
+	  strncpy(description, 
+		  _("Kernel modification detected by Samhain."),
+		  128);
+	  description[127] = '\0';
+	}
+      else
+	{
+	  assessment->impact->severity   = impact_high;
+	  assessment->impact->completion = succeeded;
+	  assessment->impact->type       = file;
+	  strncpy(description, 
+		  _("File system modification detected by Samhain."),
+		  128);
+	  description[127] = '\0';
+	}
+    }
+  else
+    {
+      if ( ((NULL != sl_strstr(message, _("Login"))) ||
+	    (NULL != sl_strstr(message, _("Multiple login"))) ||
+	    (NULL != sl_strstr(message, _("Logout")))) &&
+	   (NULL == sl_strstr(message, _("Checking"))))
+	{
+	  assessment->impact->completion = succeeded;
+	  assessment->impact->type       = user;
+	  strncpy(description, 
+		  _("Login/logout detected by Samhain."),
+		  128);
+	  description[127] = '\0';
+	}
+      else
+	{
+	  /* assessment->impact->severity   = impact_low; */
+	  assessment->impact->completion = succeeded;
+	  assessment->impact->type       = other;
+	  strncpy(description, 
+		  _("Message by Samhain."),
+		  128);
+	  description[127] = '\0';
+	}
+    }
+  idmef_string_set (&assessment->impact->description, description); 
+  idmef_assessment_confidence_new(assessment);
+  assessment->confidence->rating = high;
+
+  /* ------- Additional Data ------- 
+   * 
+   * Here we supply the log message.
+   *
+   */
+  data = idmef_alert_additional_data_new(alert);
+  if ( ! data )
+    goto err;
+
+  data->type = string;
+  idmef_string_set (&data->meaning, meaning);
+  if (message)
+    idmef_additional_data_set_data (data, string, message, 
+				    strlen(message) + 1);
+  
+  /* ------- Send ------- 
+   *
+   * Finally, the preparated message is sent.
+   */      
+  msgbuf = prelude_msgbuf_new(0);
+  if ( ! msgbuf )
+    goto err;
+
+  /* Always return 0 (in libprelude 0.8.10); i.e. no useful
+   * exit status
+   */
+  idmef_msg_send(msgbuf, idmef, PRELUDE_MSG_PRIORITY_HIGH);
+
+  /* Cleanup
+   */
+  idmef_message_free(idmef);
+  prelude_msgbuf_close(msgbuf);
+  if (path_basename)
+    {
+      SH_FREE(path_basename);
+      path_basename = NULL;
+    }
+  if (path_fullname)
+    {
+      SH_FREE(path_fullname);
+      path_fullname = NULL;
+    }
+  if (impactmsg)
+    SH_FREE(impactmsg);
+  if (src_ip)
+    SH_FREE(src_ip);
+
+  some_error = 0;
+
+  return 0;
+        
+ err:
+  /* Cleanup
+   */
+  idmef_message_free(idmef);
+  if (0 == some_error)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+		      _("Problem with IDMEF for prelude-ids support: alert lost"), 
+		      _("sh_prelude_alert"));
+    }
+  if (path_basename)
+    {
+      SH_FREE(path_basename);
+      path_basename = NULL;
+    }
+  if (path_fullname)
+    {
+      SH_FREE(path_fullname);
+      path_fullname = NULL;
+    }
+  if (impactmsg)
+    SH_FREE(impactmsg);
+  if (src_ip)
+    SH_FREE(src_ip);
+  some_error = 1;
+  return -1;
+
+}
+
+/* HAVE_LIBPRELUDE */
+#endif
Index: trunk/src/sh_processcheck.c
===================================================================
--- trunk/src/sh_processcheck.c	(revision 591)
+++ 	(revision )
@@ -1,1558 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2006 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-/***************************************************************************
- *
- * This file provides a module for samhain to check for hidden/faked/missing
- * processes on the host.
- *
- */
-
-#include "config_xor.h"
-
-/* changed from 500 to 600 b/o FreeBSD (see sys/cdefs.h) 
- * which needs _POSIX_C_SOURCE >= 200112 for lstat()
- */
-#if defined(__sun) || defined(__sun__) || defined(sun)
-#define _XOPEN_SOURCE 500
-#else
-#define _XOPEN_SOURCE 600
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <signal.h>
-#include <unistd.h>
-
-#ifdef _POSIX_PRIORITY_SCHEDULING
-#include <sched.h>
-#endif
-
-#ifdef HAVE_GETPRIORITY
-#include <errno.h>
-#include <sys/resource.h>
-#endif
-
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
-
-
-#ifdef HAVE_REGEX_H
-#include <regex.h>
-#endif
-
-#include "samhain.h"
-#include "sh_modules.h"
-#include "sh_processcheck.h"
-#include "sh_utils.h"
-#include "sh_error.h"
-#include "sh_extern.h"
-#include "sh_calls.h"
-#include "sh_pthread.h"
-
-#ifdef SH_USE_PROCESSCHECK
-
-#define FIL__  _("sh_processcheck.c")
-
-#ifdef __linux__
-#define PS_THREADS
-#endif
-
-/* We won't want to build this into yule 
- */
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-
-SH_MUTEX_STATIC(mutex_proc_check, PTHREAD_MUTEX_INITIALIZER);
-
-/* sh_prochk_maxpid is one more than the largest pid
- */
-static  size_t  sh_prochk_minpid = 0x0001;
-static  size_t  sh_prochk_maxpid = 0x8000;
-static  size_t  sh_prochk_size   = 0;
-
-static  int     ShProchkActive  = S_TRUE;
-static  short * sh_prochk_res   = NULL; 
-
-static  char  * sh_prochk_pspath = NULL;
-static  char  * sh_prochk_psarg  = NULL;
-
-#define SH_PROCHK_INTERVAL 300
-static time_t   sh_prochk_interval = SH_PROCHK_INTERVAL;
-static int      sh_prochk_severity = SH_ERR_SEVERE;
-static int      sh_prochk_openvz   = S_FALSE;
-
-static int sh_prochk_set_maxpid  (const char * str);
-static int sh_prochk_set_minpid  (const char * str);
-static int sh_prochk_set_active  (const char *str);
-static int sh_prochk_add_process (const char *str);
-static int sh_prochk_set_pspath  (const char *str);
-static int sh_prochk_set_psarg   (const char *str);
-static int sh_prochk_set_interval(const char *str);
-static int sh_prochk_set_severity(const char *str);
-static int sh_prochk_set_openvz  (const char *str);
-
-sh_rconf sh_prochk_table[] = {
-    {
-        N_("severityprocesscheck"),
-        sh_prochk_set_severity,
-    },
-    {
-        N_("processcheckexists"),
-        sh_prochk_add_process,
-    },
-    {
-        N_("processcheckactive"),
-        sh_prochk_set_active,
-    },
-    {
-        N_("processcheckminpid"),
-        sh_prochk_set_minpid,
-    },
-    {
-        N_("processcheckmaxpid"),
-        sh_prochk_set_maxpid,
-    },
-    {
-        N_("processcheckpspath"),
-        sh_prochk_set_pspath,
-    },
-    {
-        N_("processcheckpsarg"),
-        sh_prochk_set_psarg,
-    },
-    {
-        N_("processcheckinterval"),
-        sh_prochk_set_interval,
-    },
-    {
-        N_("processcheckisopenvz"),
-        sh_prochk_set_openvz,
-    },
-    {
-        NULL,
-        NULL
-    }
-};
-
-#define    SH_PROC_MISSING 1
-#define    SH_PROC_FAKED   2
-#define    SH_PROC_HIDDEN  4
-#define    SH_PROC_EXISTS  8
-
-#ifndef HAVE_LSTAT
-#define lstat(x,y) stat(x,y)
-#endif /* HAVE_LSTAT */
-
-#if defined(S_IFLNK) && !defined(S_ISLNK)
-#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
-#else
-#if !defined(S_ISLNK)
-#define S_ISLNK(mode) (0)
-#endif
-#endif
-
-static const short SH_PR_PS       = 0x0001;
-
-static const short SH_PR_GETSID   = 0x0002;
-static const short SH_PR_KILL     = 0x0004;
-static const short SH_PR_GETPGID  = 0x0008;
-
-static const short SH_PR_LSTAT    = 0x0010;
-static const short SH_PR_OPENDIR  = 0x0020;
-static const short SH_PR_CHDIR    = 0x0040;
-static const short SH_PR_SCHED    = 0x0080;
-
-static const short SH_PR_PRIORITY = 0x0100;
-static const short SH_PR_STATVSF  = 0x0200;
-
-static const short SH_PR_PS2      = 0x1000;
-static const short SH_PR_PS_ANY   = 0x2000;
-static const short SH_PR_ALL      = 0x4000;
-static const short SH_PR_ANY      = 0x8000;
-
-/* /proc: 
- *        linux:     /proc/pid/exe
- *        freebsd:   /proc/pid/file
- *        solaris10: /proc/pid/path/a.out
- */
-static char * get_user_and_path (pid_t pid, char * user, size_t usrlen)
-{
-  extern char *  sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len);
-
-  char        path[128];
-  char *      buf;
-  struct stat sbuf;
-  int         len;
-  char *      tmp;
-
-  sl_snprintf (path, sizeof(path), _("/proc/%ld/exe"), (unsigned long) pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  sl_snprintf (path, sizeof(path), _("/proc/%ld/file"), (unsigned long) pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  sl_snprintf (path, sizeof(path), _("/proc/%ld/path/a.out"), (unsigned long) pid);
-
-  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
-    {
-      goto linkread;
-    }
-
-  return NULL;
-
- linkread:
-
-  buf = SH_ALLOC(PATH_MAX);
-  len = readlink(path, buf, PATH_MAX);   /* flawfinder: ignore */
-  len = (len >= PATH_MAX) ? (PATH_MAX-1) : len;
-
-  if (len > 0)
-    { 
-      buf[len] = '\0';
-    }
-  else
-    {
-      SH_FREE(buf);
-      return NULL;
-    }
-
-  tmp = sh_unix_getUIDname (SH_ERR_ALL, sbuf.st_uid, user, usrlen);
-
-  if (!tmp)
-    sl_snprintf (user, usrlen, "%ld", (unsigned long) sbuf.st_uid);
-
-  return buf;
-}
-
-
-struct watchlist {
-  char        * str;
-  unsigned long pid;
-#ifdef HAVE_REGEX_H
-  regex_t       preg;
-#endif
-  int           seen;
-
-  struct watchlist *next;
-};
-
-static struct watchlist * process_check = NULL;
-
-static struct watchlist * list_missing  = NULL;
-static struct watchlist * list_fake     = NULL;
-static struct watchlist * list_hidden   = NULL;
-
-/* recursively remove all list entries
- */
-static void kill_list (struct watchlist * head)
-{
-  if (head->next)
-    kill_list (head->next);
-
-  if (head->str)
-    SH_FREE(head->str);
-  SH_FREE(head);
-
-  return;
-}
-
-  
-/* check the list for old entries; clean out old entries; reset others
- * Return number of non-obsolete entries
- */
-static size_t clean_list (struct watchlist ** head_ptr)
-{
-  size_t count = 0;
-  struct watchlist * ptr = *head_ptr;
-  struct watchlist * pre = *head_ptr;
-
-  while (ptr)
-    {
-      if (ptr->seen == S_FALSE) /* obsolete entry */
-	{
-	  if (ptr == pre)       /* at head        */
-	    {
-	      ptr       = pre->next;
-	      *head_ptr = pre->next;
-	      if (pre->str) 
-		SH_FREE(pre->str);
-	      SH_FREE(pre);
-	      pre       = ptr;
-	    }
-	  else
-	    {
-	      pre->next = ptr->next;
-	      if (ptr->str) 
-		SH_FREE(ptr->str);
-	      SH_FREE(ptr);
-	      ptr       = pre->next;
-	    }
-	}
-      else
-	{
-	  ++count;
-	  ptr->seen = S_FALSE; /* reset status */
-	  pre = ptr;
-	  ptr = ptr->next;
-	}
-    }
-  return count;
-}
-
-/* check if process is in list; if not, add it and return false
- */
-static int  is_in_list (struct watchlist ** head_ptr, 
-			char * str, unsigned long pid)
-{
-  struct watchlist * ptr = *head_ptr;
-
-  if (str)
-    {
-      while (ptr)
-	{
-	  if (ptr->str && (0 == strcmp(str, ptr->str)))
-	    {
-	      ptr->seen = S_TRUE;
-	      return S_TRUE;
-	    }
-	  ptr = ptr->next;
-	}
-    }
-  else
-    {
-      while (ptr)
-	{
-	  if (ptr->pid == pid)
-	    {
-	      ptr->seen = S_TRUE;
-	      return S_TRUE;
-	    }
-	  ptr = ptr->next;
-	}
-    }
-
-  ptr = SH_ALLOC(sizeof(struct watchlist));
-
-  if (str)
-    {
-      ptr->str = sh_util_strdup(str);
-    }
-  else
-    {
-      ptr->str = NULL;
-      ptr->pid = pid;
-    }
-  ptr->next = *head_ptr;
-  ptr->seen = S_TRUE;
-  *head_ptr = ptr;
-
-  return S_FALSE;
-}
-
-static int is_in_watchlist (const char *str, unsigned long num)
-{
-  struct watchlist * list = process_check;
-
-  while (list) 
-    {
-#ifdef HAVE_REGEX_H
-      if (0 == regexec(&(list->preg), str, 0, NULL, 0))
-	{
-	  list->seen = S_TRUE;
-	  list->pid  = num;
-	  return S_TRUE;
-	}
-#else
-      if (strstr(str, list->str)) 
-	{
-	  list->seen = S_TRUE;
-	  list->pid  = num;
-	  return S_TRUE;
-	}
-#endif
-      list = list->next;
-    }
-  return S_FALSE;
-} 
-
-/* These variables are not used anywhere. They only exist
- * to assign &userold, &user to them, which keeps gcc from
- * putting them into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_413_watchlist = NULL;
-
-static void check_watchlist (short * res)
-{
-  struct watchlist * list = process_check;
-  char * tmp;
-  size_t indx;
-
-  /* Take the address to keep gcc from putting them into registers. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_413_watchlist = (void*) &list;
-
-  while (list) 
-    {
-      if (list->seen == S_FALSE)
-	{
-	  /* avoid repetition of messages
-	   */
-	  if (S_FALSE == is_in_list(&list_missing, list->str, 0))
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      tmp = sh_util_safe_name (list->str);
-	      sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 
-			      MSG_PCK_MISS,
-			      tmp);
-	      SH_FREE(tmp);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	}
-      else
-	{
-	  indx = list->pid - sh_prochk_minpid;
-
-	  if (list->pid < sh_prochk_maxpid && list->pid >= sh_prochk_minpid && 
-	      ((res[indx] & SH_PR_ANY) == 0) && /* not found         */
-	      ((res[indx] & SH_PR_PS)  != 0) && /* seen in first ps  */ 
-	      ((res[indx] & SH_PR_PS2) != 0))   /* seen in second ps */
-	    {
-	      /* fake process, thus considered missing
-	       */
-	      if (S_FALSE == is_in_list(&list_missing, list->str, 0))
-		{
-		  SH_MUTEX_LOCK(mutex_thread_nolog);
-		  tmp = sh_util_safe_name (list->str);
-		  sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 
-				  MSG_PCK_MISS, 
-				  tmp);
-		  SH_FREE(tmp);
-		  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		}
-	    }
-	  list->seen = S_FALSE;
-	}
-      list = list->next;
-    }
-
-  sh_dummy_413_watchlist = NULL;
-  return;
-}
-
-/* Add 'str' to the list of watched processes for which
- * existence should be checked.
- */
-int sh_prochk_add_process (const char *str) 
-{
-  struct watchlist *new;
-  int               status;
-  char              errbuf[256];
-    
-  SL_ENTER(_("sh_prochk_add_process"));
-
-  if( str == NULL )
-    SL_RETURN(-1, _("sh_prochk_add_process") );
-
-  new       = SH_ALLOC(sizeof(struct watchlist));
-  new->next = process_check;
-  new->str  = sh_util_strdup(str);
-#ifdef HAVE_REGEX_H
-  status = regcomp(&(new->preg), str, REG_NOSUB|REG_EXTENDED);
-  if (status != 0)
-    {
-      regerror(status, &(new->preg), errbuf, sizeof(errbuf));
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN, 
-		      errbuf, _("sh_processes_add_process"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(new->str);
-      SH_FREE(new);
-      SL_RETURN(-1, _("sh_prochk_add_process") );
-    }
-#endif
-  new->pid  = 0;
-  new->seen = S_FALSE;
-
-  process_check = new;
-  SL_RETURN(0, _("sh_prochk_add_process") );
-}
-
-/* severity
- */
-int sh_prochk_set_severity  (const char * c)
-{
-  char tmp[32];
-  tmp[0] = '='; tmp[1] = '\0';
-  sl_strlcat (tmp, c, 32);
-  return sh_error_set_level (tmp, &sh_prochk_severity);
-}
-
-
-
-/* Path to ps
- */
-int sh_prochk_set_pspath(const char *str) 
-{
-  SL_ENTER(_("sh_prochk_set_pspath"));
-
-  if (!str || ('/' != str[0]))
-    SL_RETURN((-1), _("sh_prochk_set_pspath"));
-  if (sh_prochk_pspath)
-    SH_FREE(sh_prochk_pspath);
-#ifdef SH_EVAL_SHELL
-  sh_prochk_pspath = sh_util_strdup (str);
-  SL_RETURN((0), _("sh_prochk_set_pspath"));
-#else
-  sh_prochk_pspath = NULL;
-  SL_RETURN((-1), _("sh_prochk_set_pspath"));
-#endif
-}
-
-/* argument for ps
- */
-int sh_prochk_set_psarg(const char *str) 
-{
-  SL_ENTER(_("sh_prochk_set_psarg"));
-
-  if (sh_prochk_psarg)
-    SH_FREE(sh_prochk_psarg);
-#ifdef SH_EVAL_SHELL
-  sh_prochk_psarg = sh_util_strdup (str);
-  SL_RETURN((0), _("sh_prochk_set_psarg"));
-#else
-  (void) str;
-  sh_prochk_psarg = NULL;
-  SL_RETURN((-1), _("sh_prochk_set_psarg"));
-#endif
-}
-
-
-/* Decide if we're active.
- */
-int sh_prochk_set_active(const char *str) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_prochk_set_active"));
-
-  value = sh_util_flagval(str, &ShProchkActive);
-
-  SL_RETURN((value), _("sh_prochk_set_active"));
-}
-
-/* Are we on openvz.
- */
-static int openvz_hidden = 0;
-
-int sh_prochk_set_openvz(const char *str) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_prochk_set_openvz"));
-
-  value = sh_util_flagval(str, &sh_prochk_openvz);
-
-  if (sh_prochk_openvz != S_FALSE) {
-    openvz_hidden = 1;
-  }
-
-  SL_RETURN((value), _("sh_prochk_set_openvz"));
-}
-
-/* Minimum PID
- */
-int sh_prochk_set_minpid(const char * str)
-{
-  size_t  value;
-  char * foo;
-  int    retval = 0;
-
-  SL_ENTER(_("sh_prochk_set_minpid"));
-
-  value = (size_t) strtoul(str, &foo, 0);
-  if (*foo != '\0')
-    retval = -1;
-  else
-    sh_prochk_minpid = value;
-
-  SL_RETURN((retval), _("sh_prochk_set_minpid"));
-}
-
-/* Maximum PID
- */
-static int userdef_maxpid = 0;
-
-int sh_prochk_set_maxpid(const char * str)
-{
-  size_t  value;
-  char * foo;
-  int    retval = -1;
-
-  SL_ENTER(_("sh_prochk_set_maxpid"));
-
-  value = (size_t) strtoul(str, &foo, 0);
-
-  if (*foo == '\0' && S_TRUE == sl_ok_adds(value, 1)) {
-    sh_prochk_maxpid = value + 1;
-    userdef_maxpid   = 1;
-    retval = 0;
-  }
-
-  SL_RETURN((retval), _("sh_prochk_set_maxpid"));
-}
-
-int sh_prochk_set_interval (const char * c)
-{
-  int retval = 0;
-  long val;
-
-  SL_ENTER(_("sh_prochk_set_interval"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val <= 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("process check interval"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      retval = -1;
-    }
-  else
-    {
-      sh_prochk_interval = (time_t) val;
-    }
-  SL_RETURN(retval, _("sh_prochk_set_interval"));
-}
-
-
-
-/* Recurse to the end of the list and then free the data as we return
- * back up towards the start, making sure to free any strdupped strings
- */
-static void sh_prochk_free_list(struct watchlist *head) 
-{
-  if ( head != NULL ) 
-    {
-      sh_prochk_free_list(head->next);
-      if (head->str)
-	SH_FREE(head->str);
-#ifdef HAVE_REGEX_H
-      regfree(&(head->preg));
-#endif
-      SH_FREE(head);
-    }
-  return;
-}
-
-#if defined(__linux__)
-#define PROC_PID_MAX _("/proc/sys/kernel/pid_max")
-
-static int proc_max_pid (size_t * procpid)
-{
-  char * ret;
-  unsigned long  pid;
-  FILE * fd;
-  char   str[128];
-  char * ptr;
-
-  SL_ENTER(_("proc_max_pid"));
-
-  if (userdef_maxpid != 0)
-    SL_RETURN((-1), _("proc_max_pid"));
-    
-  if (0 == access(PROC_PID_MAX, R_OK)) /* flawfinder: ignore */
-    {
-      if (NULL != (fd = fopen(PROC_PID_MAX, "r")))
-	{
-	  str[0] = '\0';
-	  ret = fgets(str, 128, fd);
-	  if (ret && *str != '\0')
-	    {
-	      pid = strtoul(str, &ptr, 0);
-	      if (*ptr == '\0' || *ptr == '\n')
-		{
-		  sl_fclose(FIL__, __LINE__, fd);
-		  *procpid = (size_t) pid;
-		  SL_RETURN(0, _("proc_max_pid"));
-		}
-	    }
-	  sl_fclose(FIL__, __LINE__, fd);
-	}
-    }
-  SL_RETURN((-1), _("proc_max_pid"));
-}
-#else
-static int proc_max_pid(size_t * dummy)
-{
-  (void) dummy;
-  return -1;
-}
-#endif
-
-static void sh_processes_tlist (char * list, size_t len, short res)
-{
-  if (res & SH_PR_PS)       sl_strlcat(list, _(" ps(initial)"), len);
-  if (res & SH_PR_CHDIR)    sl_strlcat(list, _(" chdir"), len);
-  if (res & SH_PR_OPENDIR)  sl_strlcat(list, _(" opendir"), len);
-  if (res & SH_PR_LSTAT)    sl_strlcat(list, _(" lstat"), len);
-  if (res & SH_PR_PRIORITY) sl_strlcat(list, _(" getpriority"), len);
-  if (res & SH_PR_SCHED)    sl_strlcat(list, _(" sched_getparam"), len);
-  if (res & SH_PR_GETSID)   sl_strlcat(list, _(" getsid"), len);
-  if (res & SH_PR_GETPGID)  sl_strlcat(list, _(" getpgid"), len);
-  if (res & SH_PR_KILL)     sl_strlcat(list, _(" kill"), len);
-  if (res & SH_PR_STATVSF)  sl_strlcat(list, _(" statvfs"), len);
-  if (res & SH_PR_PS2)      sl_strlcat(list, _(" ps(final)"), len);
-  return;
-}
-
-
-static short sh_processes_check (pid_t pid, short res)
-{
-  int  have_checks = 0;
-  int  need_checks = 0;
-#ifdef HAVE_PROCFS
-  char path[128];
-  struct stat buf;
-  DIR * dir;
-  int  retval;
-#if defined(HAVE_STATVFS) && !defined(__FreeBSD__)
-  struct statvfs vfsbuf;
-#endif
-#endif
-
-#if !defined(sun) && !defined(__sun) && !defined(__sun__) && !defined(__OpenBSD__) && !defined(__APPLE__)
-#ifdef _POSIX_PRIORITY_SCHEDULING
-  struct sched_param p;
-#endif
-#endif
-
-  if (0 == kill(pid, 0))
-    { 
-      res |= SH_PR_KILL;    res |= SH_PR_ANY; ++have_checks;
-      ++need_checks;
-    }
-  else if (errno != EPERM)
-    {
-      ++need_checks;
-    }
-
-
-#ifdef HAVE_GETPGID
-  if ((pid_t)-1 != getpgid(pid))
-    { 
-      res |= SH_PR_GETPGID; res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-#endif
-
-#ifdef HAVE_GETSID
-  if ((pid_t)-1 != getsid(pid))
-    { 
-      res |= SH_PR_GETSID;  res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-#endif
-
-  /* sched_getparam() is broken on solaris 10, may segfault in librt
-   * also not on MacOS
-   */
-#if !defined(sun) && !defined(__sun) && !defined(__sun__) && !defined(__OpenBSD__) && !defined(__APPLE__)
-#ifdef _POSIX_PRIORITY_SCHEDULING
-  if (0 == sched_getparam (pid, &p))
-    { 
-      res |= SH_PR_SCHED;   res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-#endif
-#endif
-
-#ifdef HAVE_GETPRIORITY
-  errno = 0;
-  if (((-1) == getpriority (PRIO_PROCESS, (int) pid)) && (errno == ESRCH));
-  else
-    { 
-      res |= SH_PR_PRIORITY; res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-#endif
-
-#ifdef HAVE_PROCFS
-  sl_snprintf (path, sizeof(path), "/proc/%ld", (unsigned long) pid);
-
-  do {
-    retval = lstat (path, &buf);
-  } while (retval < 0 && errno == EINTR);
-
-  if (0 == retval)
-    { 
-      res |= SH_PR_LSTAT;   res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-
-  if (NULL != (dir = opendir(path)))
-    {
-      res |= SH_PR_OPENDIR; res |= SH_PR_ANY; ++have_checks;
-      closedir(dir);
-    }
-  ++need_checks;
-
-#if defined(HAVE_STATVFS) && !defined(__FreeBSD__)
-  do {
-    retval = statvfs (path, &vfsbuf);
-  } while (retval < 0 && errno == EINTR);
-
-  if (0 == retval)
-    { 
-      res |= SH_PR_STATVSF;   res |= SH_PR_ANY; ++have_checks;
-    }
-  ++need_checks;
-#endif
-
-#if !defined(SH_PROFILE)
-  if (0 == chdir(path))
-    {
-      res |= SH_PR_CHDIR;   res |= SH_PR_ANY; ++have_checks;
-      do {
-	retval = chdir ("/");
-      } while (retval < 0 && errno == EINTR);
-    }
-  ++need_checks;
-#endif
-#endif
-
-  if (have_checks == need_checks)
-    {
-      res |= SH_PR_ALL;
-    }
-  return res;
-}
-
-extern int flag_err_debug;
-
-static int sh_processes_readps (FILE * in, short * res, 
-				char * str, size_t len, 
-				short flag, pid_t pid)
-{
-  int  cc; 
-  volatile unsigned int  lnum   = 0;
-  volatile unsigned long num    = 0;
-  char c;
-  unsigned int  pos = 0;
-#define SH_TWAIT_MAX 60
-  volatile unsigned int  twait = 0;
-  char tstr[256];
-  enum { SKIP_TO_WS, SKIP_WS, SKIP_TO_WS2, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;
-
-  SL_ENTER(_("sh_processes_readps"));
-
-  if (!in) {
-    SL_RETURN((-1), _("sh_processes_readps"));
-  }
-
-  tstr[(sizeof(tstr)-1)] = '\0';
-  tstr[0]                = '\0';
-  line = SKIP_END;		/* Skip 1st line */
-
-  do
-    {
-      cc = fgetc(in);
-
-      if (EOF == cc) 
-	{
-	  if (feof(in))
-	    {
-	      break;
-	    }
-	  else if ((errno == EAGAIN) && (twait < SH_TWAIT_MAX))
-	    {
-	      clearerr(in);
-	      retry_msleep(1, 0);
-	      ++twait;
-	      continue;
-	    }
-#ifdef HOST_IS_OPENBSD
-	  else if (errno == ENODEV)
-	    {
-	      clearerr(in);
-	      continue;
-	    }
-#endif
-	  else
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			      sh_error_message(errno, errbuf, sizeof(errbuf)),
-			      _("sh_processes_readps"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      break;
-	    }
-	}
-
-      c = (char) cc;
-
-      if (pos < (sizeof(tstr)-1))
-	{ 
-	  tstr[pos] = c; ++pos; 
-	}
-
-      switch(line)
-	{
-	case SKIP_END:
-	  if (c == '\n')
-	    { 
-	      tstr[pos-1] = '\0';
-	      if (flag_err_debug == S_TRUE)
-		{
-		  SH_MUTEX_LOCK(mutex_thread_nolog);
-		  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, num, 
-				  MSG_E_SUBGEN,
-				  tstr,
-				  _("sh_processes_readps"));
-		  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		}
-	      /* fprintf(stderr, "<%ld> %s\n", num, tstr); */
-	      line = SKIP_WS; pos = 0;
-	      if (str != NULL && num == (unsigned long) pid)
-		sl_strlcpy(str, tstr, len);
-	      if (lnum != 0)
-		is_in_watchlist (tstr, num);
-	      ++lnum;
-	    }
-	  break;
-	case SKIP_TO_WS:
-	  if (!isspace(cc))
-	    break;
-	  line = SKIP_WS;
-	  /* fallthrough */
-	case SKIP_WS:
-	  if (isspace(cc))
-	    break;
-	  num  = 0;
-	  line = GET_NUM;
-	  /* fallthrough */
-	case GET_NUM:
-	  if (isdigit(cc))
-	    {
-	      num = num * 10 + (c - '0');
-	      break;
-	    }
-	  else if (isspace(cc))
-	    {
-#ifdef PS_THREADS
-	      num  = 0;
-	      line = SKIP_WS2;
-#else
-	      if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
-		{
-		  res[num - sh_prochk_minpid] |= flag;
-		}
-	      line = SKIP_END;
-#endif
-	      break;
-	    }
-	  else
-	    {
-	      line = SKIP_TO_WS;
-	      break;
-	    }
-	case SKIP_TO_WS2:
-	  if (!isspace(cc))
-	    break;
-	  line = SKIP_WS2;
-	  /* fallthrough */
-	case SKIP_WS2:
-	  if (isspace(cc))
-	    break;
-	  num  = 0;
-	  line = GET_NUM2;
-	  /* fallthrough */
-	case GET_NUM2:
-	  if (isdigit(cc))
-	    {
-	      num = num * 10 + (c - '0');
-	      break;
-	    }
-	  else if (isspace(cc))
-	    {
-	      if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
-		{
-		  res[num - sh_prochk_minpid] |= flag;
-		}
-	      line = SKIP_END;
-	      break;
-	    }
-	  else
-	    {
-	      line = SKIP_TO_WS2;
-	      break;
-	    }
-	default:
-	  SL_RETURN ((-1), _("sh_processes_readps"));
-	}
-    } while (1);
-
-  if (ferror(in))
-    {
-      SL_RETURN ((-1), _("sh_processes_readps"));
-    }
-
-  SL_RETURN ((0), _("sh_processes_readps"));
-}
-
-static int sh_processes_runps (short * res, char * str, size_t len, 
-			       short flag, pid_t pid)
-{
-  sh_tas_t task;
-
-  int    status = 0;
-  char * p;
-  int retval = 0;
-  char  dir[SH_PATHBUF];
-
-  SL_ENTER(_("sh_processes_runps"));
-
-  sh_ext_tas_init(&task);
-  p = sh_unix_getUIDdir (SH_ERR_ERR, task.run_user_uid, dir, sizeof(dir));
-  if (p)
-    {
-      (void) sh_ext_tas_add_envv (&task, _("HOME"), p);
-    }
-  (void) sh_ext_tas_add_envv (&task, _("SHELL"), 
-			      _("/bin/sh")); 
-  (void) sh_ext_tas_add_envv (&task, _("PATH"),  
-			      _("/sbin:/usr/sbin:/bin:/usr/bin")); 
-  if (sh.timezone != NULL)
-    {
-      (void) sh_ext_tas_add_envv(&task,  "TZ", sh.timezone);
-    }
-
-  if (!sh_prochk_pspath)
-    sh_ext_tas_command(&task,  PSPATH);
-  else
-    sh_ext_tas_command(&task,  sh_prochk_pspath);
-
-  (void) sh_ext_tas_add_argv(&task,  _("ps"));
-
-  if (!sh_prochk_psarg)
-    {
-#ifdef PS_THREADS
-      (void) sh_ext_tas_add_argv(&task,  _("-eT"));
-#else
-      (void) sh_ext_tas_add_argv(&task,  PSARG);
-#endif
-    }
-  else
-    {
-      (void) sh_ext_tas_add_argv(&task,  sh_prochk_psarg);
-    }
-
-  task.rw = 'r';
-  task.fork_twice = S_FALSE;
-
-  status = sh_ext_popen(&task);
-  if (status != 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-		      _("Could not open pipe"), _("sh_processes_runps"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SL_RETURN ((-1), _("sh_processes_runps"));
-    }
-
-  /* read from the open pipe
-   */
-  if (task.pipe != NULL)
-    {
-      retval = sh_processes_readps (task.pipe, res, str, len, flag, pid);
-    }
-
-  /* close pipe and return exit status
-   */
-  (void) sh_ext_pclose(&task);
-  sh_ext_tas_free (&task);
-  SL_RETURN ((retval), _("sh_processes_runps"));
-}
-
-/* Check whether there is a visible process
- * with PID = i + 1024
- */
-static size_t p_store = 0;
-
-static int openvz_ok(short * res, size_t i)
-{
-
-  if (sh_prochk_openvz == S_FALSE) {
-    return 0;
-  }
-
-  i += 1024;
-
-  if (i >= sh_prochk_size) {
-    return 0;
-  }
-
-  if ( ((res[i] & SH_PR_PS) || (res[i] & SH_PR_PS2)) && (res[i] & SH_PR_ANY))
-    {
-      /* This is a system process corresponding to a 'virtual'
-       * process that has a PID offset by 1024
-       */
-      return 1;
-    }
-
-  if (openvz_hidden > 0)
-    {
-      p_store = i;
-      --openvz_hidden;
-      return 1;
-    }
-  else if (i == p_store)
-    {
-      return 1;
-    }
-
-  return 0;
-}
-
-static int sh_process_check_int (short * res)
-{
-  volatile size_t i;
-  size_t j;
-  char  tests[512];
-  volatile int   retval;
-
-  pid_t this_pid;
-
-  SL_ENTER(_("sh_process_check_int"));
-
-  this_pid = getpid();
-
-  if (!res)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Internal error: NULL argument, switching off"), 
-		      _("sh_process_check_int"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SL_RETURN ((-1), _("sh_process_check_int"));
-    }
-
-  retval = sh_processes_runps (res, NULL, 0, SH_PR_PS, 0);
-
-  for (i = sh_prochk_minpid; i != sh_prochk_maxpid; ++i)
-    {
-      j      = i - sh_prochk_minpid; 
-      res[j] = sh_processes_check ((pid_t) i, res[j]);
-    }
-
-  retval += sh_processes_runps (res, NULL, 0, SH_PR_PS2, 0);
-
-  if (retval != 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Failed to run ps, switching off"), 
-		      _("sh_process_check_int"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SL_RETURN ((-1), _("sh_process_check_int"));
-    }
-
-  /* Evaluate results
-   */
-  for (i = sh_prochk_minpid; i != sh_prochk_maxpid; ++i)
-    {
-      /* don't check the current process
-       */
-      if (i == (size_t) this_pid)
-	continue;
-
-      j      = i - sh_prochk_minpid;
-
-      if (((res[j] & SH_PR_PS) != 0) || ((res[j] & SH_PR_PS2) != 0))
-	{
-	  res[j] |= SH_PR_PS_ANY;
-	}
-      else
-	{
-	  res[j] &= ~SH_PR_PS_ANY;
-	}
-
-      tests[0] = '\0';
-
-      if ((res[j] & SH_PR_ANY) || (res[j] & SH_PR_PS_ANY))
-	{
-	  /* list all tests where the pid was found
-	   */
-	  sh_processes_tlist (tests, sizeof(tests), res[j]);
-
-	  /* 
-	   * case 1: in ps and found 
-	   */
-	  if ((res[j] & SH_PR_PS_ANY) && (res[j] & SH_PR_ANY))
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_PCK_OK, 
-			      (unsigned long) i, tests);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-
-	  /* 
-	   * case 2: not in ps and found
-	   */
-	  else if ((res[j] & SH_PR_PS_ANY) == 0) 
-	    {
-	      res[j] = sh_processes_check ((pid_t) i, 0);
-	      /*
-	       * if still there, it is real and hidden
-	       */
-	      if ((res[j] & SH_PR_ANY) && !openvz_ok(res, j))
-		{
-		  if (S_FALSE == is_in_list(&list_hidden, NULL, i))
-		    {
-		      char   user[16];
-		      char * aout;
-		      char * safe;
-
-		      SH_MUTEX_LOCK(mutex_thread_nolog);
-		      aout = get_user_and_path ((pid_t) i, user, sizeof(user));
-		      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-		      if (aout)
-			{
-			  safe = sh_util_safe_name (aout);
-			  SH_MUTEX_LOCK(mutex_thread_nolog);
-			  sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 
-					  MSG_PCK_P_HIDDEN,
-					  (unsigned long) i, tests, safe, user);
-			  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-			  SH_FREE(safe);
-			  SH_FREE(aout);
-			}
-		      else
-			{
-			  SH_MUTEX_LOCK(mutex_thread_nolog);
-			  sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 
-					  MSG_PCK_HIDDEN,
-					  (unsigned long) i, tests);
-			  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-			}
-		    }
-		}
-	    }
-
-	  /*
-	   * case 3: in ps, but not found
-	   */
-	  else
-	    {
-	      if (((res[j] & SH_PR_PS) != 0) && ((res[j] & SH_PR_PS2) != 0))
-		{
-		  if (S_FALSE == is_in_list(&list_fake, NULL, i))
-		    {
-		      SH_MUTEX_LOCK(mutex_thread_nolog);
-		      sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 
-				      MSG_PCK_FAKE, 
-				      (unsigned long) i, tests);
-		      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		    }
-		}
-	    }
-	}
-    } /* loop end */
-
-  check_watchlist (res);
-
-  SL_RETURN (0, _("sh_process_check_int"));
-}
-
-/* Initialise. 
- */
-static int sh_prochk_init_internal(void) 
-{
-  SL_ENTER(_("sh_prochk_init"));
-
-  (void) proc_max_pid (&sh_prochk_maxpid);
-
-  if (sh_prochk_minpid > sh_prochk_maxpid)
-    ShProchkActive = S_FALSE;
-
-  /* We need to free anything allocated by the configuration functions if
-   * we find that the module is to be left inactive - otherwise _reconf()
-   * won't quite work. 
-   */
-  if( ShProchkActive == S_FALSE ) 
-    {
-      sh_prochk_free_list(process_check);
-      process_check = NULL;
-      SL_RETURN(-1, _("sh_prochk_init"));
-    }
-
-  sh_prochk_size = sh_prochk_maxpid - sh_prochk_minpid;
-
-  if (sh_prochk_res == NULL)
-    {
-      sh_prochk_res  = SH_ALLOC(sizeof(short) * sh_prochk_size);
-    }
-  memset (sh_prochk_res, 0, sizeof(short) * sh_prochk_size);
-  
-  SL_RETURN(0, _("sh_prochk_init"));
-}
-
-int sh_prochk_init (struct mod_type * arg)
-{
-#ifndef HAVE_PTHREAD
-  (void) arg;
-#endif
-
-  if (ShProchkActive == S_FALSE)
-    return SH_MOD_FAILED;
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      sh_prochk_init_internal();
-      return SH_MOD_THREAD;
-    }
-#endif
-  return sh_prochk_init_internal();
-}
-
-int sh_prochk_timer(time_t tcurrent) 
-{
-  static time_t lastcheck = 0;
-
-  SL_ENTER(_("sh_prochk_timer"));
-  if ((time_t) (tcurrent - lastcheck) >= sh_prochk_interval)
-    {
-      lastcheck  = tcurrent;
-      SL_RETURN((-1), _("sh_prochk_timer"));
-    }
-  SL_RETURN(0, _("sh_prochk_timer"));
-}
-
-int sh_prochk_check(void) 
-{
-  int status;
-
-  SL_ENTER(_("sh_prochk_check"));
-
-  SH_MUTEX_LOCK(mutex_proc_check);
-
-  status = 0;
-
-  if( ShProchkActive != S_FALSE )
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_PCK_CHECK, 
-		      (unsigned long) sh_prochk_minpid, 
-		      (unsigned long) (sh_prochk_maxpid-1));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      if (sh_prochk_res) {
-	memset (sh_prochk_res, 0, sizeof(short) * sh_prochk_size);
-      }
-      status = sh_process_check_int(sh_prochk_res);
-
-      if (status != 0)
-	ShProchkActive = S_FALSE;
-
-      /* clean out old entries which are not marked 
-       * as missing/hidden/fake anymore
-       */
-      clean_list (&list_missing);
-      clean_list (&list_hidden);
-      clean_list (&list_fake);
-    }
-
-  SH_MUTEX_UNLOCK(mutex_proc_check);
-
-  SL_RETURN(status, _("sh_prochk_check"));
-}
-
-/* Free our lists and the associated memory 
- */
-int sh_prochk_cleanup(void) 
-{
-  SL_ENTER(_("sh_prochk_cleanup"));
-
-  sh_prochk_reconf();
-
-  if (list_missing) {
-    kill_list(list_missing);
-    list_missing = NULL;
-  }
-  if (list_hidden) {
-    kill_list(list_hidden);
-    list_hidden  = NULL;
-  }
-  if (list_fake) {
-    kill_list(list_fake);
-    list_fake    = NULL;
-  }
-  
-  SL_RETURN(0, _("sh_prochk_cleanup"));
-}
-
-/* Free our lists and the associated memory 
- */
-int sh_prochk_reconf(void) 
-{
-  SL_ENTER(_("sh_prochk_reconf"));
-
-  SH_MUTEX_LOCK(mutex_proc_check);
-  userdef_maxpid     = 0;
-  sh_prochk_maxpid   = 0x8000;
-  sh_prochk_minpid   = 0x0001;
-  sh_prochk_interval = SH_PROCHK_INTERVAL;
-  sh_prochk_openvz   = S_FALSE;
-  p_store            = 0;
-  openvz_hidden      = 0;
-
-  sh_prochk_free_list(process_check);
-  process_check = NULL;
-  if (sh_prochk_res != NULL)
-    SH_FREE(sh_prochk_res);
-  sh_prochk_res = NULL;
-
-  if (sh_prochk_psarg)
-    SH_FREE(sh_prochk_psarg);
-  sh_prochk_psarg = NULL;
-  if (sh_prochk_pspath)
-    SH_FREE(sh_prochk_pspath);
-  sh_prochk_pspath = NULL;
-  SH_MUTEX_UNLOCK(mutex_proc_check);
-
-  SL_RETURN(0, _("sh_prochk_reconf"));
-}
-
-/* #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) */
-#endif
-
-/* #ifdef SH_USE_PROCESSCHECK */
-#endif
-
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_processcheck_watchlist_ok (CuTest *tc) {
-#if defined(SH_USE_PROCESSCHECK) && (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE))
-  CuAssertTrue(tc, 0 == sh_prochk_add_process("init"));
-  CuAssertTrue(tc, 
-	       S_TRUE  == is_in_watchlist("    1 ?        00:00:00 init", 0));
-  CuAssertTrue(tc, 
-	       S_FALSE == is_in_watchlist("    1 ?        00:00:00 flix", 0));
-  CuAssertTrue(tc, 
-	       S_TRUE  == is_in_watchlist("25218 ?        SNs    0:01 /usr/sbin/init -k start -DSSL", 0));
-  CuAssertTrue(tc, 
-	       S_FALSE  == is_in_watchlist("25218 ?        SNs    0:01 /usr/sbin/apache2 -k start -DSSL", 0));
-
-
-  sh_prochk_free_list(process_check);
-  process_check = NULL;
-  CuAssertTrue(tc, S_FALSE == is_in_watchlist("init", 0));
-
-  CuAssertTrue(tc, 0 == sh_prochk_add_process("init"));
-  CuAssertTrue(tc, 0 == sh_prochk_add_process("ssh"));
-  CuAssertTrue(tc, 0 == sh_prochk_add_process("syslog"));
-  CuAssertTrue(tc, S_TRUE  == is_in_watchlist("init", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_watchlist("ssh", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_watchlist("syslog", 0));
-
-  sh_prochk_free_list(process_check);
-  process_check = NULL;
-  CuAssertTrue(tc, S_FALSE == is_in_watchlist("init", 0));
-  CuAssertTrue(tc, S_FALSE == is_in_watchlist("ssh", 0));
-  CuAssertTrue(tc, S_FALSE == is_in_watchlist("syslog", 0));
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-
-void Test_processcheck_listhandle_ok (CuTest *tc) {
-#if defined(SH_USE_PROCESSCHECK) && (defined(SH_WITH_CLIENT) || defined(SH_STANDALONE))
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "foobar", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "foobar", 0));
-
-  if (list_missing)
-    kill_list(list_missing);
-  list_missing = NULL;
-
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "foobar", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "foobar", 0));
-
-  if (list_missing)
-    kill_list(list_missing);
-  list_missing = NULL;
-
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_FALSE == is_in_list(&list_missing, "foobar", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "foobar", 0));
-
-  CuAssertTrue(tc, 2  == clean_list(&list_missing));
-  CuAssertPtrNotNull(tc, list_missing);
-
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "init", 0));
-  CuAssertTrue(tc, S_TRUE  == is_in_list(&list_missing, "foobar", 0));
-
-  CuAssertTrue(tc, 2  == clean_list(&list_missing));
-  CuAssertPtrNotNull(tc, list_missing);
-
-  CuAssertTrue(tc, 0  == clean_list(&list_missing));
-  CuAssertTrue(tc, NULL == list_missing);
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-
-
-/* #ifdef SH_CUTEST */
-#endif
-
Index: trunk/src/sh_pthread.c
===================================================================
--- trunk/src/sh_pthread.c	(revision 591)
+++ 	(revision )
@@ -1,323 +1,0 @@
-#include "config_xor.h"
-
-#include "sh_pthread.h"
-
-#ifdef HAVE_PTHREAD
-
-#include <signal.h>
-#include "sh_calls.h"
-#include "sh_modules.h"
-extern volatile  int      sh_thread_pause_flag;
-
-SH_MUTEX_INIT(mutex_skey,         PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_INIT(mutex_resolv,       PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_INIT(mutex_pwent,        PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_INIT(mutex_readdir,      PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_INIT(mutex_thread_nolog, PTHREAD_MUTEX_INITIALIZER);
-
-int sh_pthread_setsigmask(int how, const void *set, void *oldset)
-{
-  return pthread_sigmask(how, (const sigset_t *)set, (sigset_t *)oldset);
-}
-
-void sh_pthread_mutex_unlock (void *arg)
-{
-  (void) pthread_mutex_unlock ((pthread_mutex_t *)arg);
-  return;
-}
-
-int sh_pthread_init_threadspecific(void)
-{
-  int rc = 0;
-#ifdef SH_STEALTH
-  do {
-    extern int sh_g_thread(void);
-
-    rc = sh_g_thread();
-  } while (0);
-#endif
-
-  return rc;
-}
-
-
-/* 
- *  ----  Utilities for modules  ----
- */
-
-/* MODULES: init()
- *
- * #ifdef HAVE_PTHREAD
- *  if (arg != NULL)
- *    {
- *      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
- *	  return SH_MOD_THREAD;
- *      else
- *	  return SH_MOD_FAILED;
- *    }
- * #else
- *  return sh_utmp_init_internal();
- * #endif
- *
- *
- *          sh_threaded_module_run(module_struct) 
- *             -- calls internal init, 
- *             -- polls timer, 
- *             -- runs module check,
- *             -- runs sh_pthread_testcancel()
- *             -- returns (return == exit)
- */
-
-#define SH_NUM_THREADS 16
-static pthread_t threads[SH_NUM_THREADS];
-static int       ithread[SH_NUM_THREADS];
-static pthread_mutex_t  create_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-int sh_pthread_create(void *(*start_routine)(void*), void *arg)
-{
-  int rc, nthread = 1;
-  sigset_t signal_set;
-  int retval = 0;
-
-  pthread_mutex_lock(&create_mutex);
-
-  /* block all signals 
-   */
-  sigfillset( &signal_set );
-#if defined(SCREW_IT_UP)
-  /*
-   * raise(SIGTRAP) sends to same thread, like 
-   * pthread_kill(pthread_self(), sig); so we need to unblock the
-   * signal. 
-   */
-  sigdelset( &signal_set, SIGTRAP );
-#endif 
-  pthread_sigmask( SIG_BLOCK, &signal_set, NULL );
-
-  /* find a free slot in threads[]
-   */
-  while (nthread < SH_NUM_THREADS) 
-    {
-      if (ithread[nthread] == 0)
-	break;
-      ++nthread;
-      if (nthread == SH_NUM_THREADS)
-	{
-	  retval = -1;
-	  goto err_out;
-	}
-    } 
-
-  rc = pthread_create(&threads[nthread], NULL, start_routine, arg);
-  if (rc != 0)
-    {
-      retval = -1;
-      goto err_out;
-    }
-
-  ithread[nthread] = 1;
-
- err_out:
-  pthread_sigmask( SIG_UNBLOCK, &signal_set, NULL );
-  pthread_mutex_unlock(&create_mutex);
-  return retval;
-}
-
-int sh_pthread_cancel_all()
-{
-  int i;
-  int ret = 0;
-
-  SH_MUTEX_LOCK(create_mutex);
-
-  for (i = 1; i < SH_NUM_THREADS; ++i)
-    {
-      if (ithread[i] != 0)
-	if (0 != pthread_cancel(threads[i]))
-	  ithread[i] = 0;
-    }
-
-  for (i = 1; i < SH_NUM_THREADS; ++i)
-    {
-      if (ithread[i] != 0)
-	pthread_join(threads[i], NULL);
-      ithread[i] = 0;
-    }
-
-  SH_MUTEX_UNLOCK(create_mutex);
-  return ret;
-}
-
-/* ---- Utility functions for modules ----
- */
-
-#undef  S_TRUE
-#define S_TRUE    1
-#undef  S_FALSE
-#define S_FALSE   0
-
-void sh_threaded_module_cleanup(void *arg)
-{
-  sh_mtype * this_module = (sh_mtype *) arg;
-  this_module->mod_cleanup();
-  this_module->initval = -1;
-  return;
-}
-
-void * sh_threaded_module_run(void *arg)
-{
-  sh_mtype * this_module = (sh_mtype *) arg;
-
-  /* First we lock the module. This ensures that it cannot be
-   * run twice.
-   */
-  pthread_cleanup_push(sh_pthread_mutex_unlock, (void*) &(this_module->mod_mutex));
-  pthread_mutex_lock(&(this_module->mod_mutex));
-
-  if (0 == sh_pthread_init_threadspecific())
-    {
-
-      if (0 == this_module->mod_init(NULL))
-	{
-	  pthread_cleanup_push(sh_threaded_module_cleanup, arg);
-
-	  while (1)
-	    {
-	      if (sh_thread_pause_flag != S_TRUE)
-		{
-		  this_module->flags &= ~SH_MODFL_ISPAUSED;
-		  
-		  if (0 != this_module->mod_timer(time(NULL)))
-		    {
-		      /* If module has been de-activated on reconfigure,
-		       * mod_check() must return non-zero.
-		       * The mod_cleanup() routine must then enable the 
-		       * module to be re-activated eventually.
-		       */
-		      if (0 != this_module->mod_check())
-			break;
-		      pthread_testcancel();
-		    }
-		}
-	      else
-		{
-		  this_module->flags |= SH_MODFL_ISPAUSED;
-		}
-	      if (0 == (SH_MODFL_NOTIMER & this_module->flags) ||
-		  sh_thread_pause_flag == S_TRUE)
-		retry_msleep(1,0);
-	    }
-
-	  pthread_cleanup_pop(1); /* notreached,but required */
-	}
-    }
-
-  pthread_cleanup_pop(1);
-
-  return NULL;
-}
-
-
-/*
- *  ----  Implementation of recursive mutexes from libxml2  ----
- */
-#if !defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
-/**
- * libxml2 threads.c: set of generic threading related routines 
- *
- * Gary Pennington <Gary.Pennington@uk.sun.com>
- * daniel@veillard.com
- 
- * Except where otherwise noted in the source code (e.g. the files hash.c,
- * list.c and the trio files, which are covered by a similar licence but
- * with different Copyright notices) all the files are:
- *
- *    Copyright (C) 1998-2003 Daniel Veillard.  All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is fur-
- * nished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
- * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
- * DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
- * NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of Daniel Veillard shall not
- * be used in advertising or otherwise to promote the sale, use or other deal-
- * ings in this Software without prior written authorization from him.
- */
-
-/* Modified NewRMutex -> InitRMutex. We use a static structure, rather than 
- * allocating one. Also dropped code for non-POSIX OSes.
- */
-void sh_InitRMutex(struct sh_RMutex * tok)
-{
-  pthread_mutex_init(&tok->lock, NULL);
-  tok->held = 0;
-  tok->waiters = 0;
-  pthread_cond_init(&tok->cv, NULL);
-
-  return;
-}
-
-void sh_RMutexLock(struct sh_RMutex * tok)
-{
-  if (tok == NULL)
-    return;
-
-  pthread_mutex_lock(&tok->lock);
-  if (tok->held) {
-    if (pthread_equal(tok->tid, pthread_self())) {
-      tok->held++;
-      pthread_mutex_unlock(&tok->lock);
-      return;
-    } else {
-      tok->waiters++;
-      while (tok->held)
-	pthread_cond_wait(&tok->cv, &tok->lock);
-      tok->waiters--;
-    }
-  }
-  tok->tid = pthread_self();
-  tok->held = 1;
-  pthread_mutex_unlock(&tok->lock);
-}
-
-void sh_RMutexUnlock(void * arg)
-{
-  struct sh_RMutex * tok = (struct sh_RMutex *) arg;
-
-  if (tok == NULL)
-    return;
-    
-  pthread_mutex_lock(&tok->lock);
-  tok->held--;
-  if (tok->held == 0) {
-    if (tok->waiters)
-      pthread_cond_signal(&tok->cv);
-    tok->tid = 0;
-  }
-  pthread_mutex_unlock(&tok->lock);
-}
-#endif
-
-#else
-
-#include <signal.h>
-
-int sh_pthread_setsigmask(int how, const void *set, void *oldset)
-{
-  return sigprocmask(how, (const sigset_t *)set, (sigset_t *)oldset);
-}
-
-
-#endif
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 591)
+++ trunk/src/sh_readconf.c	(revision 1)
@@ -28,29 +28,29 @@
 
 #include "samhain.h"
+#include "sh_error.h"
+#include "sh_database.h"
+#include "sh_unix.h"
+#include "sh_utils.h"
+#include "sh_files.h"
+#include "sh_mail.h"
 #include "sh_calls.h"
-#include "sh_error.h"
+#include "sh_tiger.h"
+#include "sh_forward.h"
+#include "sh_modules.h"
+#include "sh_gpg.h"
+#include "sh_hash.h"
+#include "sh_ignore.h"
+#include "sh_prelink.h"
 #include "sh_extern.h"
-#include "sh_unix.h"
-#include "sh_files.h"
-#include "sh_xfer.h"
-#include "sh_sig.h"
-#include "sh_hash.h"
-#include "sh_dbIO.h"
-#include "sh_ignore.h"
+
+#ifdef WITH_DATABASE
 #include "sh_database.h"
-#include "sh_mail.h"
-#include "sh_modules.h"
-#include "sh_nmail.h"
-#include "sh_prelink.h"
-#ifdef HAVE_LIBPRELUDE
+#endif
+
+#ifdef HAVE_LIBPRELUDE_9
 #include "sh_prelude.h"
 #endif
-#include "sh_tiger.h"
-#include "sh_tools.h"
-#include "sh_utils.h"
-#include "sh_restrict.h"
-#include "sh_socket.h"
-
-extern int set_reverse_lookup (const char * c);
+
+extern int set_reverse_lookup (char * c);
 
 #undef  FIL__
@@ -69,7 +69,4 @@
   SH_SECTION_USER0,
   SH_SECTION_USER1,
-  SH_SECTION_USER2,
-  SH_SECTION_USER3,
-  SH_SECTION_USER4,
   SH_SECTION_PRELINK,
 #if defined (SH_WITH_MAIL) 
@@ -96,5 +93,5 @@
 
 typedef struct str_ListSections {
-  const char * name;
+  char * name;
   int    type;
 } sh_str_ListSections;
@@ -111,7 +108,4 @@
   { N_("[User0]"),            SH_SECTION_USER0},
   { N_("[User1]"),            SH_SECTION_USER1},
-  { N_("[User2]"),            SH_SECTION_USER2},
-  { N_("[User3]"),            SH_SECTION_USER3},
-  { N_("[User4]"),            SH_SECTION_USER4},
   { N_("[Prelink]"),          SH_SECTION_PRELINK},
 #ifdef WITH_EXTERNAL
@@ -135,198 +129,4 @@
 };
 
-static char * sh_readconf_expand_value (const char * str)
-{
-#ifdef SH_EVAL_SHELL
-  char * tmp = sh_util_strdup(str);
-  char * out;
-  char * tmp_orig = tmp;
-
-  while (tmp && isspace((int)*tmp)) ++tmp;
-  
-  if (tmp && tmp[0] == '$' && tmp[1] == '(')
-    {
-      size_t len = strlen(tmp);
-      while (isspace((int) tmp[len-1])) { tmp[len-1] = '\0'; --len; }
-      if (tmp[len-1] == ')')
-	{
-	  tmp[len-1] = '\0';
-	  out = sh_ext_popen_str(&tmp[2]);
-	  SH_FREE(tmp_orig);
-	  return out;
-	}
-    }
-  SH_FREE(tmp_orig);
-#endif
-  return sh_util_strdup(str);
-}
-
-enum {
-  SH_RC_ANY        = 0, 
-  SH_RC_HOST       = 1, 
-  SH_RC_SYSTEM     = 2,
-  SH_RC_FILE       = 3,
-  SH_RC_IFACE      = 4,
-#ifdef SH_EVAL_SHELL
-  SH_RC_CMD        = 5
-#endif
-};
-
-
-static int sh_readconf_cond_match(char * str, int line)
-{
-  int    match  = 0;
-  int    negate = 1;
-  int    cond_type = SH_RC_ANY;
-  char   myident[3*SH_MINIBUF+3];
-  struct stat buf;
-
-  char * p = str;
-
-  if (*p == '!') { negate = 0; ++p; }
-  if (*p == '$') { 
-    cond_type = SH_RC_SYSTEM; ++p; /* [!]$system */ 
-  }
-  else { /* *p == '@' */
-
-    ++p; while (isspace((int)*p)) ++p;
-
-    if (0 != strncasecmp(p, _("if "),   3)) {
-      cond_type = SH_RC_HOST; /* [!]$host */
-    }
-
-    else {
-
-      p += 3; while (isspace((int)*p)) ++p; /* skip the 'if\s+' */
-
-      if (0 == strncasecmp(p, _("not "), 4))
-	{
-	  p += 4; while (isspace((int)*p)) ++p;
-	  negate = 0;
-	  match  = 1;
-	}
-      else if (0 == strncmp(p, _("!"), 1))
-	{
-	  ++p; while (isspace((int)*p)) ++p;
-	  negate = 0;
-	  match  = 1;
-	}
-  
-      if (0 == strncasecmp(p, _("file_exists "), 12))
-	{
-	  p += 12; cond_type = SH_RC_FILE;
-	}
-      else if (0 == strncasecmp(p, _("interface_exists "), 17))
-	{
-	  p += 17; cond_type = SH_RC_IFACE;
-	}
-      else if (0 == strncasecmp(p, _("hostname_matches "), 17))
-	{
-	  p += 17; cond_type = SH_RC_HOST;
-	}
-      else if (0 == strncasecmp(p, _("system_matches "), 15))
-	{
-	  p += 15; cond_type = SH_RC_SYSTEM;
-	}
-#ifdef SH_EVAL_SHELL
-      else if (0 == strncasecmp(p, _("command_succeeds "), 17))
-	{
-	  p += 17; cond_type = SH_RC_CMD;
-	}
-#endif
-      else
-	{
-	  char errbuf[SH_ERRBUF_SIZE];
-	  sl_snprintf(errbuf, sizeof(errbuf), 
-		      _("Unsupported test at line %d of configuration file"),
-		      line);
-	  sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  errbuf,
-			  _("sh_readconf_cond_match"));
-	  return 0;
-	}
-    }
-  }
-
-  while (isspace((int)*p)) ++p;
-
-  switch (cond_type)
-    {
-    case SH_RC_HOST:
-      if  (sl_strncmp (p,  sh.host.name, strlen(sh.host.name)) == 0
-#ifdef HAVE_REGEX_H
-	   || sh_util_regcmp (p, sh.host.name) == 0
-#endif
-	   )
-	match = negate;
-      break;
-    case SH_RC_SYSTEM:
-      /*
-       * The system type, release, and machine.
-       */
-      sl_snprintf(myident, sizeof(myident), _("%s:%s:%s"),  
-		  sh.host.system, /* flawfinder: ignore */ 
-		  sh.host.release, sh.host.machine);
-      
-      if  (sl_strncmp (p,  myident, strlen(myident)) == 0
-#ifdef HAVE_REGEX_H
-	   || sh_util_regcmp (p, myident) == 0
-#endif
-	   )
-	match = negate;
-      break;
-    case SH_RC_FILE:
-      if (0 == retry_lstat(FIL__, __LINE__, p, &buf))
-	match = negate;
-      break;
-    case SH_RC_IFACE:
-      if (sh_tools_iface_is_present(p))
-	match = negate;
-      break;
-#ifdef SH_EVAL_SHELL
-    case SH_RC_CMD:
-      if (0 == sh_unix_run_command(p))
-	match = negate;
-      break;
-#endif
-    default:
-      /* do nothing */;
-    }
-  return match;
-}
-
-static int sh_readconf_is_end (char * str)
-{
-  int retval = 0;
-
-  if (str[0] == '@' || str[0] == '$')
-    {
-      char * p = str;
-      ++p; while (isspace((int)*p)) ++p;
-      if ( 
-	  (0 == strncasecmp (p, _("end"), 3) && (p[3] == '\0' || isspace((int)p[3]))) ||
-	  (0 == strncasecmp (p, _("fi"),  2) && (p[2] == '\0' || isspace((int)p[2])))
-	   )
-	{
-	  return 1;
-	}
-    }
-  return retval;
-}
-   
-static int sh_readconf_is_else (char * str)
-{
-  int retval = 0;
-
-  if (str[0] == '@')
-    {
-      char * p = str;
-      ++p; while (isspace((int)*p)) ++p;
-      if ( 0 == strncasecmp (p, _("else"), 4) && (p[4] == '\0' || isspace((int)p[4])) )
-	{
-	  return 1;
-	}
-    }
-  return retval;
-}
    
 static int sh_readconfig_line (char * line);
@@ -351,23 +151,31 @@
 #if defined(SH_STEALTH) && !defined(SH_STEALTH_MICRO)
   SL_TICKET    fdTmp = -1;
-#endif
-#if defined(WITH_SIG) 
-  SL_TICKET    fdSIG = -1;
+  SL_TICKET open_tmp (void);
 #endif
   char * tmp;
-
-#define SH_LINE_IN 16384
-  char * line_in;
+  char * lptr;
+
+  char   line_in[512+2];
   char * line;
+  int    line_int;
+
+  char   myident[3*SH_MINIBUF+3];
 
   /* This is for nested conditionals.
    */
-  int    cond_depth  = 0;
-  int    cond_excl   = 0;
-  
+  int    some_other_host[16]   = { 0 };
+  int    some_other_system[16] = { 0 };
+  int    seen_host   = 0;
+  int    seen_system = 0;
+  int    host_int    = 0;
+  int    sys_int     = 0;
+
+  int    invert = 0;
+  int    length = sl_strlen(sh.host.name);
+
   int    local_file = 1;
   char   local_flag = 'R';
 
-#if defined(WITH_SIG)
+#if defined(WITH_GPG) || defined(WITH_PGP)
   int    signed_content = S_FALSE;
   int    true_content   = S_FALSE;
@@ -377,5 +185,4 @@
 #endif
   uid_t  euid;
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_readconf_read"));
@@ -388,18 +195,12 @@
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_D_START);
 
-      fd = sh_xfer_request_file(_("CONF"));
+      fd = sh_forward_req_file(_("CONF"));
 
       if (!SL_ISERROR(fd))
-	{
-	  local_file = 0;
-	}
+	local_file = 0;
       else if (sh.flag.checkSum != SH_CHECK_INIT)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FBAD);
-	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-	}
+	aud_exit (FIL__, __LINE__, EXIT_FAILURE);
       else
 	{
-	  sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_TCP_FBAD);
 	  sh_error_handle ((-1), FIL__, __LINE__, fd, MSG_D_FAIL);
 	  local_file = 1;
@@ -427,6 +228,5 @@
 	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
 	}
-      if (SL_ISERROR(fd = sl_open_read(FIL__, __LINE__, 
-				       file_path('C',local_flag),SL_YESPRIV)))
+      if (SL_ISERROR(fd = sl_open_read(file_path('C',local_flag),SL_YESPRIV)))
 	{
 	  sl_get_euid(&euid);
@@ -445,11 +245,9 @@
   /* Compute the checksum of the open file.
    */
+  tiger_fd = fd;
   sl_strlcpy(sh.conf.hash, 
-	     sh_tiger_hash(file_path('C',local_flag), fd, TIGER_NOLIM, 
-			   hashbuf, sizeof(hashbuf)),
+	     sh_tiger_hash(file_path('C',local_flag),TIGER_FD, 0),
 	     KEY_LEN+1);
   sl_rewind (fd);
-
-  line_in = SH_ALLOC(SH_LINE_IN);
 
 #if defined(SH_STEALTH) && !defined(SH_STEALTH_MICRO)
@@ -457,8 +255,5 @@
      */
   fdTmp = open_tmp(); 
-
-  sh_unix_getline_stealth (0, NULL, 0); /* initialize */
-
-  while ( sh_unix_getline_stealth (fd, line_in, SH_LINE_IN-2) > 0) {
+  while ( sh_unix_getline_stealth (fd, line_in, 512) > 0) {
     hidden_count++;
     if (line_in[0] == '\n')
@@ -470,6 +265,6 @@
 	sl_write_line(fdTmp, line_in, sl_strlen(line_in));
       }
-#if defined(WITH_SIG)
-    if (S_TRUE == sh_sig_data_end(line_in))
+#if defined(WITH_GPG) || defined(WITH_PGP)
+    if (0 == sl_strncmp(line_in, _("-----END PGP SIGNATURE-----"), 25))
       break;
 #else
@@ -477,5 +272,5 @@
       break;
 #endif
-    if (hidden_count > 1048576)  /* arbitrary safeguard, 1024*1024 */
+    if (hidden_count > 4096)  /* arbitrary safeguard */
       break;
   }
@@ -485,23 +280,8 @@
 #endif
 
-#if defined(WITH_SIG)
-
-  /* extract the data and copy to temporary file
+  /* The system type, release, and machine.
    */
-  fdSIG = sh_sig_extract_signed(fd);
-
-  sl_close(fd);
-  fd = fdSIG;
-
-  /* Validate signature of open file.
-   */
-  if (0 != sh_sig_check_signature (fd, SIG_CONF))
-    {
-      SH_FREE(line_in);
-      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1, sh.prg_name);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
-  sl_rewind (fd);
-#endif
+  sprintf(myident, _("%s:%s:%s"),                  /* known to fit  */
+	  sh.host.system, sh.host.release, sh.host.machine);
 
 
@@ -510,5 +290,5 @@
   conf_line = 0;
 
-  while ( sh_unix_getline (fd, line_in, SH_LINE_IN-2) > 0) {
+  while ( sh_unix_getline (fd, line_in, 512) > 0) {
 
     ++conf_line;
@@ -520,17 +300,24 @@
     /* Sun May 27 18:40:05 CEST 2001
      */
-#if defined(WITH_SIG)
+#if defined(WITH_GPG) || defined(WITH_PGP)
     if (signed_content == S_FALSE)
       { 
-	if (S_TRUE == sh_sig_msg_start(line))
+	if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))
 	  signed_content = S_TRUE;
 	else 
 	  continue;
       }
-    else /* if (signed_content == S_TRUE) */
+    else if (true_content == S_FALSE)
+      {
+	if (line[0] == '\n')
+	  true_content = S_TRUE;
+	else
+	  continue;
+      }
+    else if (signed_content == S_TRUE)
       { 
-	if (S_TRUE == sh_sig_msg_end(line))
+	if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNATURE-----")))
 	  break;
-	else if (S_TRUE == sh_sig_msg_start(line))
+	else if (0 == sl_strcmp(line, _("-----BEGIN PGP SIGNED MESSAGE-----")))
 	  {
 	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
@@ -541,15 +328,6 @@
 	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EXIT_ABORT1,
 			     sh.prg_name);
-	    SH_FREE(line_in);
 	    aud_exit (FIL__, __LINE__,EXIT_FAILURE);
 	  }
-      }
-
-    if (true_content == S_FALSE) /* continue if in header */
-      {
-	if (S_TRUE == sh_sig_msg_startdata(line))
-	  true_content = S_TRUE;
-	else
-	  continue;
       }
 #endif
@@ -557,6 +335,11 @@
     /* Skip leading white space.
      */
-    while (isspace((int)*line)) ++line;
-
+    while (*line)
+      {
+	line_int = *line;
+	if (!isspace(line_int))
+	  break;
+	++line;
+      }
 
     /* Skip header etc. 
@@ -572,71 +355,17 @@
 
 
-    /* ---  an @host/@if/$system directive -------------- */
-
-    if (line[0] == '@' || (line[0] == '!' && line[1] == '@') || 
-	line[0] == '$' || (line[0] == '!' && line[1] == '$'))
-      {
-	if (sh_readconf_is_end(line))
-	  {
-	    if (0 == cond_depth) {
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALD,
-			       _("config file"), 
-			       (long) conf_line);
-	    }
-	    else {
-	      if (cond_excl == cond_depth)
-		cond_excl = 0;
-	      --cond_depth;
-	    }
-	  }
-	else if (sh_readconf_is_else(line))
-	  {
-	    if (0 == cond_depth) {
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALD,
-			       _("config file"), 
-			       (long) conf_line);
-	    }
-	    else if (cond_excl == cond_depth) {
-	      cond_excl = 0;
-	    }
-	    else if (cond_excl == 0) {
-	      cond_excl = cond_depth;
-	    }
-	  }
-	else
-	  {
-	    if (sh_readconf_cond_match(line, conf_line)) {
-	      ++cond_depth;
-	    }
-	    else {
-	      ++cond_depth;
-	      if (cond_excl == 0)
-		cond_excl = cond_depth;
-	    }
-	  }
-	continue;
-      }
-
-    /* fprintf(stderr, "%d %s\n", cond_excl, line); */
-
-    /****************************************************
-     *
-     * Only carry on if this section is intended for us
-     *
-     ****************************************************/
-    
-    if (cond_excl != 0) {
-      continue;
-    }
-
     /* -------  starts a section  ------------  */
     
-    else if (line[0] == '[')
+    if (line[0] == '['                       && 
+	some_other_host[seen_host] == 0      &&
+	some_other_system[seen_system] == 0) 
       { 
 	read_mode = SH_SECTION_NONE;
 
-	if (0 == sl_strncasecmp (line,  _("[EOF]"), 5)) {
-	  goto nopel;
-	}
+	if (sl_strncmp (line,  _("[EOF]"), 
+			  5) == 0)
+	  {
+	    goto nopel;
+	  }
 
 	i = 0;
@@ -644,6 +373,6 @@
 	while (tab_ListSections[i].name != 0)
 	  {
-	    if (sl_strncasecmp (line, _(tab_ListSections[i].name), 
-				sl_strlen(tab_ListSections[i].name)) == 0)
+	    if (sl_strncmp (line, _(tab_ListSections[i].name), 
+			    sl_strlen(tab_ListSections[i].name)) == 0)
 	      { 
 		read_mode = tab_ListSections[i].type;
@@ -658,6 +387,6 @@
 	    for (modnum = 0; modList[modnum].name != NULL; ++modnum) 
 	      {
-		if (0 == sl_strncasecmp (line, _(modList[modnum].conf_section),
-					 sl_strlen(modList[modnum].conf_section)) )
+		if (0 == sl_strncmp (line,  _(modList[modnum].conf_section),
+				     sl_strlen(modList[modnum].conf_section)) )
 		  read_mode = SH_SECTION_OTHER;
 	      }
@@ -669,4 +398,70 @@
 			     (long) conf_line);
 	  }
+      } 
+
+    /* ---  an @host directive -------------- */
+
+    else if (line[0] == '@' || (line[0] == '!' && line[1] == '@')) 
+      {
+	if (line[0] == '!')
+	  {
+	    lptr   = &line[2];
+	    invert = 1;
+	  }
+	else
+	  {
+	    lptr   = &line[1];
+	    invert = 0;
+	  }
+
+	if (sl_strncmp (lptr, _("end"), 3) == 0)
+	  {
+	    if (0 == seen_host)
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALD,
+			       _("config file"), 
+			       (long) conf_line);
+
+	    else if (host_int == 0)
+	      {
+		/* end  of an @host directive 
+		 */
+		some_other_host[seen_host] = 0;
+		--seen_host;
+		seen_host = (seen_host < 0) ? 0 : seen_host;
+	      }
+
+	    else 
+	      {
+		--host_int;
+		host_int = (host_int < 0) ? 0 : host_int;
+	      }
+	  }
+	else if (some_other_host[seen_host] == 0      &&
+		 some_other_system[seen_system] == 0  && 
+		 seen_host < 15)
+	  {
+	    if  (sl_strncmp (lptr,  sh.host.name, length) == 0
+#ifdef HAVE_REGEX_H
+		 || sh_util_regcmp (lptr, sh.host.name) == 0
+#endif
+		 )
+	      {
+		/* if match and '@',  set some_other_host = 0;
+		 * if match and '!@', set some_other_host = 1;
+		 */
+		++seen_host;
+		some_other_host[seen_host] = invert; 
+	      }
+	    else
+	      {
+		/* if no match and '@',  set some_other_host = 1;
+		 * if no match and '!@', set some_other_host = 0;
+		 */
+		++seen_host;
+		some_other_host[seen_host] = (invert == 0) ? 1 : 0;
+	      }
+	  }
+	else
+	  ++host_int;
       } 
 
@@ -676,7 +471,7 @@
       {
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-	if (line[0] == '!' && 0 == sl_strcasecmp(&(line[2]), _("SCHEDULE_TWO")))
+	if (line[0] == '!' && 0 == sl_strcmp(&(line[2]), _("SCHEDULE_TWO")))
 	  set_dirList(1);
-	else if (0 == sl_strcasecmp(&(line[1]), _("SCHEDULE_TWO")))
+	else if (0 == sl_strcmp(&(line[1]), _("SCHEDULE_TWO")))
 	  set_dirList(2);
 #else
@@ -684,9 +479,70 @@
 #endif
       }
+	  
+    /* ---  an $system directive -------------- */
+
+    else if (line[0] == '$' || (line[0] == '!' && line[1] == '$')) 
+      {
+	if (line[0] == '!')
+	  {
+	    lptr   = &line[2];
+	    invert = 1;
+	  }
+	else
+	  {
+	    lptr   = &line[1];
+	    invert = 0;
+	  }
+
+	if (sl_strncmp (lptr, _("end"), 3) == 0)
+	  {
+	    if (0 == seen_system)
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALD,
+			       _("config file"),
+			       (long) conf_line);
+
+	    else if (sys_int == 0)
+	      {
+		/* end  of an $system directive 
+		 */
+		some_other_system[seen_system] = 0;
+		--seen_system;
+		seen_system = (seen_system < 0) ? 0 : seen_system;
+	      }
+	    else 
+	      {
+		--sys_int;
+		sys_int = (sys_int < 0) ? 0 : sys_int;
+	      }
+	  }
+	else if (some_other_host[seen_host] == 0      &&
+		 some_other_system[seen_system] == 0  && 
+		 seen_system < 15)
+	  {
+	    if  (sl_strncmp (lptr,  myident, sl_strlen(myident)) == 0
+#ifdef HAVE_REGEX_H
+		 || sh_util_regcmp (lptr, myident) == 0
+#endif
+		 )
+	      {
+		++seen_system;
+		some_other_system[seen_system] = invert;
+	      }
+	    else
+	      {
+		++seen_system;
+		some_other_system[seen_system] = (invert == 0) ? 1 : 0;
+	      }
+	  }
+	else
+	  ++sys_int;
+      }
 
     /* ------  no new section -------------- */
 
 
-    else if (read_mode != SH_SECTION_NONE)
+    else if (some_other_host[seen_host] == 0          && 
+	     some_other_system[seen_system] == 0      && 
+	     read_mode != SH_SECTION_NONE) 
       { 
 	if (0 != sh_readconfig_line (line))
@@ -696,13 +552,23 @@
 	  }
       }
-  } /* while getline() */
+
+  }
 
  nopel:
 	   
-  if (0 != cond_depth)
+  if (0 != seen_host || 0 != seen_system)
     sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALDD,
 		     _("config file"), 
 		     (long) conf_line);
 
+#if defined(WITH_GPG) || defined(WITH_PGP)
+  /* Validate signature of open file.
+   */
+  sl_rewind (fd);
+  sh_error_only_stderr (S_FALSE);
+  if (0 != sh_gpg_check_sign (fd, 0, 1))
+    aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+#endif
+
   sl_close (fd);
 
@@ -711,9 +577,8 @@
   read_mode = SH_SECTION_NONE; /* reset b/o sighup reload */
 
-  SH_FREE(line_in);
   SL_RETURN( 0, _("sh_readconf_read"));
 }
 
-int sh_readconf_set_path (char * which, const char * what)
+int sh_readconf_set_path (char * which, char * what)
 {
   int len;
@@ -756,15 +621,15 @@
 }
 
-int sh_readconf_set_database_path (const char * what)
+int sh_readconf_set_database_path (char * what)
 {
   return (sh_readconf_set_path(sh.data.path, what));
 }
 
-int sh_readconf_set_logfile_path (const char * what)
+int sh_readconf_set_logfile_path (char * what)
 {
   return (sh_readconf_set_path(sh.srvlog.name, what));
 }
 
-int sh_readconf_set_lockfile_path (const char * what)
+int sh_readconf_set_lockfile_path (char * what)
 {
   return( sh_readconf_set_path(sh.srvlog.alt, what));
@@ -780,5 +645,5 @@
  
     
-int sh_readconf_setTime (const char * str, ShTimerItem what)
+int sh_readconf_setTime (char * str, ShTimerItem what)
 {
   unsigned long i = atoi (str);
@@ -809,15 +674,15 @@
 }
 
-int sh_readconf_setMailtime (const char * c)
+int sh_readconf_setMailtime (char * c)
 {
   return sh_readconf_setTime (c, SET_MAILTIME);
 }
 
-int sh_readconf_setFiletime (const char * c)
+int sh_readconf_setFiletime (char * c)
 {
   return sh_readconf_setTime (c, SET_FILETIME);
 }
 
-int sh_readconf_set_nice (const char * c)
+int sh_readconf_set_nice (char * c)
 {
   long val;
@@ -838,19 +703,6 @@
 }
 
-
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
-static int sh_readconf_set_delay (const char * c)
-{
-  unsigned long i = atol (c);
-
-  if (i  > INT_MAX)
-    return -i;
-  sh.delayload = (int) i;
-  return 0;
-}
-#endif
-
 #ifdef FANCY_LIBCAP
-int sh_readconf_setCaps(const char * c)
+int sh_readconf_setCaps(char * c)
 {
   int i;
@@ -863,19 +715,18 @@
 
 typedef struct _cfg_options {
-  const char * optname;
+  char * optname;
   ShSectionType   section;
   ShSectionType   alt_section;
-  int (*func)(const char * opt);
+  int (*func)(char * opt);
 } cfg_options;
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-extern int sh_set_schedule_one(const char * str);
-extern int sh_set_schedule_two(const char * str);
-extern int sh_set_silent_full (const char * str);
+extern int sh_set_schedule_one(char * str);
+extern int sh_set_schedule_two(char * str);
 #endif
 #if defined (SH_WITH_SERVER)
-extern int sh_socket_use (const char * c);
-extern int sh_socket_uid (const char * c);
-extern int sh_socket_password (const char * c);
+extern int sh_socket_use (char * c);
+extern int sh_socket_uid (char * c);
+extern int sh_socket_password (char * c);
 #endif
 
@@ -884,6 +735,4 @@
   { N_("opencommand"),     SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
     sh_ext_setcommand },
-  { N_("closecommand"),    SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
-    sh_ext_close_command },
   { N_("setcommandline"),  SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
     sh_ext_add_argv },
@@ -934,5 +783,4 @@
     set_enter_wrapper },
 #endif
-
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
@@ -970,16 +818,4 @@
   { N_("file"),           SH_SECTION_USER1,      SH_SECTION_NONE, 
     sh_files_pushfile_user1 },
-  { N_("dir"),            SH_SECTION_USER2,      SH_SECTION_NONE, 
-    sh_files_pushdir_user2 },
-  { N_("file"),           SH_SECTION_USER2,      SH_SECTION_NONE, 
-    sh_files_pushfile_user2 },
-  { N_("dir"),            SH_SECTION_USER3,      SH_SECTION_NONE, 
-    sh_files_pushdir_user3 },
-  { N_("file"),           SH_SECTION_USER3,      SH_SECTION_NONE, 
-    sh_files_pushfile_user3 },
-  { N_("dir"),            SH_SECTION_USER4,      SH_SECTION_NONE, 
-    sh_files_pushdir_user4 },
-  { N_("file"),           SH_SECTION_USER4,      SH_SECTION_NONE, 
-    sh_files_pushfile_user4 },
   { N_("dir"),            SH_SECTION_PRELINK,    SH_SECTION_NONE, 
     sh_files_pushdir_prelink },
@@ -987,16 +823,8 @@
     sh_files_pushfile_prelink },
 
-  { N_("ignoreadded"),          SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("ignoreadded"), SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_ignore_add_new },
-  { N_("ignoremissing"),        SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("ignoremissing"), SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_ignore_add_del },
-  { N_("ignoremodified"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_ignore_add_mod },
-
-  { N_("skipchecksum"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_restrict_define },
-  { N_("filetype"),             SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_restrict_add_ftype },
-
 
   { N_("filecheckscheduleone"), SH_SECTION_MISC,   SH_SECTION_NONE, 
@@ -1005,65 +833,34 @@
     sh_set_schedule_two },
 
-  { N_("usehardlinkcheck"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("usehardlinkcheck"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_check_hardlinks },
-  { N_("usersrccheck"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_files_use_rsrc },
-  { N_("hardlinkoffset"),       SH_SECTION_MISC,   SH_SECTION_NONE,
+  { N_("hardlinkoffset"),     SH_SECTION_MISC,   SH_SECTION_NONE,
     sh_files_hle_reg },
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-  { N_("useattributescheck"),      SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_unix_setcheckattributes },
-#endif
-#if defined(USE_XATTR)
-  { N_("useselinuxcheck"),      SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_unix_setcheckselinux },
-#endif
-#if defined(USE_ACL)
-  { N_("useaclcheck"),          SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_unix_setcheckacl },
-#endif
-#if !defined(SH_COMPILE_STATIC) && defined(__linux__) && defined(HAVE_AUPARSE_H) && defined(HAVE_AUPARSE_LIB)
-  { N_("setauditdflags"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_audit_set_flags },
-#endif
-  { N_("loosedircheck"),        SH_SECTION_MISC,   SH_SECTION_NONE,
-    sh_hash_loosedircheck },
-  { N_("addokchars"),           SH_SECTION_MISC,   SH_SECTION_NONE,
+  { N_("addokchars"),         SH_SECTION_MISC,   SH_SECTION_NONE,
     sh_util_obscure_ok },
-  { N_("filenamesareutf8"),     SH_SECTION_MISC,   SH_SECTION_NONE,
-    sh_util_obscure_utf8 },
-  { N_("setrecursionlevel"),    SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("setrecursionlevel"),  SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_setrecursion },
-  { N_("checksumtest"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("checksumtest"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_util_setchecksum },
-  { N_("reportonlyonce"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("reportonlyonce"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_reportonce },
-  { N_("reportfulldetail"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("reportfulldetail"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_fulldetail },
-  { N_("uselocaltime"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("uselocaltime"),       SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_unix_uselocaltime },
 
-  { N_("setnicelevel"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("setnicelevel"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_readconf_set_nice },
 
-  { N_("startuploaddelay"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_readconf_set_delay },
-
 #if defined(FANCY_LIBCAP)
-  { N_("usecaps"),              SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("usecaps"),        SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_readconf_setCaps },
 #endif
 
-  { N_("reportcheckflags"),     SH_SECTION_MISC,   SH_SECTION_NONE, 
-    set_report_checkflags },
-
-  { N_("setdropcache"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sl_set_drop_cache },
-
-  { N_("setiolimit"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
+  { N_("setiolimit"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_unix_set_io_limit },
 
   { N_("versionstring"),        SH_SECTION_MISC,   SH_SECTION_NONE,
-    sh_dbIO_version_string },
+    sh_hash_version_string },
 
   { N_("digestalgo"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
@@ -1093,13 +890,4 @@
   { N_("redefuser1"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_files_redef_user1 },
-
-  { N_("redefuser2"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_files_redef_user2 },
-
-  { N_("redefuser3"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_files_redef_user3 },
-
-  { N_("redefuser4"),           SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_files_redef_user4 },
 
   { N_("redefprelink"),         SH_SECTION_MISC,   SH_SECTION_NONE, 
@@ -1111,8 +899,4 @@
   { N_("setprelinkchecksum"),   SH_SECTION_MISC,   SH_SECTION_NONE, 
     sh_prelink_set_hash },
-
-  { N_("setfullsilent"),        SH_SECTION_MISC,   SH_SECTION_NONE, 
-    sh_set_silent_full },
-
   /* client or standalone
    */
@@ -1131,5 +915,5 @@
     sh_socket_password },
   { N_("setstripdomain"),      SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_strip },
+    sh_forward_set_strip },
   { N_("useseparatelogs"),     SH_SECTION_SRV,  SH_SECTION_MISC, 
     set_flag_sep_log },
@@ -1137,43 +921,28 @@
     sh_unix_set_chroot },
   { N_("setclienttimelimit"),  SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_time_limit },
-  { N_("setconnectiontimeout"),SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_timeout },
+    sh_forward_set_time_limit },
   { N_("useclientseverity"),   SH_SECTION_SRV,  SH_SECTION_MISC, 
-  sh_xfer_use_clt_sev },
+  sh_forward_use_clt_sev },
   { N_("useclientclass"),      SH_SECTION_SRV,  SH_SECTION_MISC, 
-  sh_xfer_use_clt_class },
+  sh_forward_use_clt_class },
   { N_("severitylookup"),      SH_SECTION_SRV,  SH_SECTION_MISC, 
-  sh_xfer_lookup_level },
+  sh_forward_lookup_level },
   { N_("setclientfromaccept"), SH_SECTION_SRV,  SH_SECTION_MISC, 
     set_socket_peer },
   { N_("setserverport"),       SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_port },
+    sh_forward_set_port },
   { N_("setserverinterface"),  SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_interface },
-  { N_("alias"),               SH_SECTION_CLIENTS,           SH_SECTION_NONE, 
-    sh_xfer_register_alias },
+    sh_forward_set_interface },
   { N_("client"),              SH_SECTION_CLIENTS,           SH_SECTION_NONE, 
-    sh_xfer_register_client },
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+    sh_forward_register_client },
+#endif
+
+#ifdef SH_WITH_CLIENT
   { N_("exportseverity"),      SH_SECTION_LOG,  SH_SECTION_NONE, 
     sh_error_setexport },
   { N_("exportclass"),         SH_SECTION_LOG,  SH_SECTION_NONE, 
     sh_error_export_mask },
-#if defined(SH_WITH_SERVER)
-  { N_("setlogserver"),        SH_SECTION_SRV,  SH_SECTION_MISC, 
-    sh_xfer_set_logserver },
-#else
   { N_("setlogserver"),        SH_SECTION_CLT,  SH_SECTION_MISC, 
-    sh_xfer_set_logserver },
-  { N_("setthrottle"),         SH_SECTION_CLT,  SH_SECTION_MISC, 
-    sh_xfer_set_throttle_delay},
-  { N_("setdeltaretrycount"),   SH_SECTION_CLT,  SH_SECTION_MISC, 
-    set_delta_retry_count},
-  { N_("setdeltaretryinterval"),SH_SECTION_CLT,  SH_SECTION_MISC, 
-    set_delta_retry_interval},
-#endif
+    sh_forward_setlogserver },
 #endif
   { N_("setfilechecktime"),  SH_SECTION_MISC,   SH_SECTION_NONE, 
@@ -1191,8 +960,8 @@
   { N_("setmailnum"),        SH_SECTION_MAIL,  SH_SECTION_MISC, 
     sh_mail_setNum },
+  { N_("setmailaddress"),    SH_SECTION_MAIL,  SH_SECTION_MISC, 
+    sh_mail_setaddress },
   { N_("setmailrelay"),      SH_SECTION_MAIL,  SH_SECTION_MISC, 
     sh_mail_set_relay },
-  { N_("setmailport"),       SH_SECTION_MAIL,  SH_SECTION_MISC,
-    sh_mail_set_port },
   { N_("mailsingle"),        SH_SECTION_MAIL,  SH_SECTION_MISC, 
     sh_mail_setFlag },
@@ -1201,18 +970,10 @@
   { N_("setmailsender"),     SH_SECTION_MAIL,  SH_SECTION_MISC, 
     sh_mail_set_sender },
-  { N_("setmailalias"),       SH_SECTION_MAIL,  SH_SECTION_MISC, 
-    sh_nmail_add_alias },
-  { N_("setmailaddress"),    SH_SECTION_MAIL,  SH_SECTION_MISC, 
-    sh_nmail_add_recipient },
-  { N_("closeaddress"),      SH_SECTION_MAIL,  SH_SECTION_MISC, 
-    sh_nmail_close_recipient },
-  { N_("setaddrseverity"),   SH_SECTION_MAIL,  SH_SECTION_MISC,
-    sh_nmail_set_severity },
   { N_("setmailfilternot"),  SH_SECTION_MAIL,  SH_SECTION_MISC,
-    sh_nmail_add_not },
+    sh_mail_add_not },
   { N_("setmailfilterand"),  SH_SECTION_MAIL,  SH_SECTION_MISC,
-    sh_nmail_add_and },
+    sh_mail_add_and },
   { N_("setmailfilteror"),   SH_SECTION_MAIL,  SH_SECTION_MISC,
-    sh_nmail_add_or },
+    sh_mail_add_or },
 #endif
   { N_("setbindaddress"),    SH_SECTION_MISC,  SH_SECTION_NONE,
@@ -1246,4 +1007,5 @@
   { N_("preludeclass"),      SH_SECTION_LOG,   SH_SECTION_NONE, 
     sh_error_prelude_mask },
+#ifdef HAVE_LIBPRELUDE_9
   { N_("preludeprofile"),    SH_SECTION_MISC,  SH_SECTION_NONE,
     sh_prelude_set_profile },
@@ -1257,4 +1019,5 @@
     sh_prelude_map_high },
 #endif
+#endif
 
   { N_("logcalls"),          SH_SECTION_LOG,   SH_SECTION_NONE, 
@@ -1266,9 +1029,4 @@
   { N_("setconsole"),        SH_SECTION_MISC,  SH_SECTION_NONE, 
     sh_log_set_console },
-
-  { N_("setreportfile"),     SH_SECTION_MISC,  SH_SECTION_NONE, 
-    sh_efile_path },
-  { N_("setreportgroup"),    SH_SECTION_MISC,  SH_SECTION_NONE, 
-    sh_efile_group },
 
 #ifdef WITH_MESSAGE_QUEUE
@@ -1295,18 +1053,7 @@
     sh_log_set_facility },
 
-  { N_("syslogmapstampto"),    SH_SECTION_LOG,   SH_SECTION_MISC, 
-    sh_log_set_stamp_priority },
-
   { N_("mactype"),     SH_SECTION_MISC,  SH_SECTION_NONE, 
     sh_util_sigtype },
 
-  { N_("avoidblock"),     SH_SECTION_MISC,  SH_SECTION_NONE, 
-    sh_calls_set_sub },
-
-#ifdef SCREW_IT_UP
-  { N_("setsigtrapmaxduration"),        SH_SECTION_MISC,  SH_SECTION_MISC, 
-    sh_sigtrap_max_duration_set },
-#endif
-
   { NULL,    0,   0,  NULL}
 };
@@ -1316,8 +1063,6 @@
 
 static int sh_readconfig_line (char * line)
-{
-  char * key;
-  const char * value;
-  char * value_dup;
+{    
+  char * c;
   char * tmp;
   int    i;
@@ -1328,15 +1073,5 @@
 #endif
 
-  static const char  *dummy = N_("dummy");
-
-  static const char  *closing[] = {
-    N_("closecommand"),
-    N_("closeaddress"),
-    N_("logmonendgroup"),
-    N_("logmonendhost"),
-    NULL
-  };
-
-  static const char  *ident[] = {
+  static char  *ident[] = {
     N_("severityreadonly"),
     N_("severitylogfiles"),
@@ -1350,7 +1085,4 @@
     N_("severityuser0"),
     N_("severityuser1"),
-    N_("severityuser2"),
-    N_("severityuser3"),
-    N_("severityuser4"),
     N_("severityprelink"),
     NULL
@@ -1369,7 +1101,4 @@
     SH_ERR_T_USER0,       
     SH_ERR_T_USER1,       
-    SH_ERR_T_USER2,       
-    SH_ERR_T_USER3,       
-    SH_ERR_T_USER4,       
     SH_ERR_T_PRELINK,       
   };
@@ -1377,50 +1106,10 @@
   SL_ENTER(_("sh_readconf_line"));
 
-  /* convert to lowercase                              */
-
-  tmp = line;
-  while (*tmp != '=' && *tmp != '\0')
-    {
-      *tmp = tolower( (int) *tmp);
-      ++tmp;
-    }
-
-  key = line;
-
   /* interpret line                                    */
 
-  value = strchr(line, '=');
-
-  if (value == NULL || (*value) == '\0')
-    {
-      if (key != NULL)
-	{
-	  i = 0;
-	  while (closing[i] != NULL) 
-	    {
-	      if (sl_strncmp(key,_(closing[i]),sl_strlen(closing[i])-1) == 0)
-		{
-		  value = dummy;
-		  goto ok_novalue;
-		}
-	      ++i;
-	    }
-
-	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
-		line));
-	}
-      SL_RETURN(good_opt, _("sh_readconf_line"));
-    }
-  else
-    ++value;
-
-  /* skip leading whitespace
-   */
-  while ((*value) == ' ' || (*value) == '\t')
-    ++value;
-
-  if ((*value) == '\0')     /* no value                    */
-    {
-      if (key != NULL)
+  c = strchr(line, '=');
+  if (c == NULL || (*c) == '\0')
+    {
+      if (line != NULL)
 	{
 	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
@@ -1429,6 +1118,30 @@
       SL_RETURN(good_opt, _("sh_readconf_line"));
     }
-
- ok_novalue:
+  else
+    ++c;
+
+  /* skip leading whitespace
+   */
+  while ((*c) == ' ' || (*c) == '\t')
+    ++c;
+
+  if ((*c) == '\0')     /* no value                    */
+    {
+      if (line != NULL)
+	{
+	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
+		line));
+	}
+      SL_RETURN(good_opt, _("sh_readconf_line"));
+    }
+
+  /* convert to lowercase                              */
+
+  tmp = line;
+  while (*tmp != '=')
+    {
+      *tmp = tolower( (int) *tmp);
+      ++tmp;
+    }
 
   if (!sl_is_suid())
@@ -1437,18 +1150,4 @@
     }
 
-  /* Expand shell expressions. This return allocated memory which we must free.
-   * If !defined(SH_EVAL_SHELL), this will reduce to a strdup.
-   */
-  value_dup = sh_readconf_expand_value(value);
-
-  if (!value_dup || (*value_dup) == '\0')
-    {
-      TPT(( 0, FIL__, __LINE__, 
-	    _("msg=<ConfigFile: empty after shell expansion: %s>\n"),
-	    line));
-      SL_RETURN(good_opt, _("sh_readconf_line"));
-    }
-
-  value = value_dup;
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
@@ -1460,12 +1159,12 @@
 	       ++modkey) 
 	    {
-	      if (sl_strncmp (key,
+	      if (sl_strncmp (line,   
 			      _(modList[modnum].conf_table[modkey].the_opt),
 			      sl_strlen(modList[modnum].conf_table[modkey].the_opt) ) == 0)
 		{
 		  good_opt = 0;
-		  if (0 != modList[modnum].conf_table[modkey].func(value))
+		  if (0 != modList[modnum].conf_table[modkey].func(c))
 		    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALS,
-				     _(modList[modnum].conf_table[modkey].the_opt), value);
+				     _(modList[modnum].conf_table[modkey].the_opt), c);
 		  if (!sl_is_suid())
 		    {
@@ -1487,8 +1186,8 @@
       i = 0;
       while (ident[i] != NULL) {
-	if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])) == 0)
+	if (sl_strncmp (line, _(ident[i]), sl_strlen(ident[i])-1) == 0)
 	  {
 	    good_opt = 0;
-	    sh_error_set_iv (identnum[i], value);
+	    sh_error_set_iv (identnum[i], c);
 	    break;
 	  }
@@ -1503,11 +1202,11 @@
 	  if ((ext_table[i].section == read_mode || 
 	       ext_table[i].alt_section == read_mode) &&
-	      sl_strncmp (key, _(ext_table[i].optname), 
+	      sl_strncmp (line, _(ext_table[i].optname), 
 			  sl_strlen(ext_table[i].optname)) == 0)
 	    {
 	      good_opt = 0;
-	      if (0 != ext_table[i].func (value))
+	      if (0 != ext_table[i].func (c))
 		sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALS,
-				 _(ext_table[i].optname), value);
+				 _(ext_table[i].optname), c);
 	      break;
 	    }
@@ -1516,8 +1215,6 @@
     }
 
-  SH_FREE(value_dup);
-
   SL_RETURN(good_opt, _("sh_readconf_line"));
 }
-
+  
     
Index: trunk/src/sh_registry.c
===================================================================
--- trunk/src/sh_registry.c	(revision 591)
+++ 	(revision )
@@ -1,1019 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2010       Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-/***************************************************************************
- *
- * This file provides a module for samhain to check the MS Windows registry.
- *
- */
-
-#include "config_xor.h"
-
-#ifdef USE_REGISTRY_CHECK
-
-#include <windows.h>
-#include <stdio.h>
-#include <time.h>
-
-#define FIL__  _("sh_registry.c")
-
-/* We don't want to build this into yule 
- */
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-
-#include <sys/types.h>
-#include <regex.h>
-
-#include "samhain.h"
-#include "sh_pthread.h"
-#include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_modules.h"
-#include "sh_hash.h"
-#include "sh_tiger.h"
-
-static int check_key (char * name, int isSingle);
-
-static int sh_reg_set_active  (const char *s);
-static int sh_reg_set_interval (const char * c);
-static int sh_reg_set_severity (const char *s);
-static int sh_reg_add_key (const char *s);
-static int sh_reg_add_hierarchy (const char *s);
-static int sh_reg_add_stop (const char *s);
-static int sh_reg_add_ign (const char *s);
-static int sh_reg_ign_time (const char *s);
-
-#define STOP_FALSE  0
-#define STOP_CHECK  1
-#define STOP_IGN    2
-
-sh_rconf sh_reg_check_table[] = {
-    {
-        N_("severitychange"),
-        sh_reg_set_severity,
-    },
-    {
-        N_("registrycheckactive"),
-        sh_reg_set_active,
-    },
-    {
-        N_("registrycheckinterval"),
-        sh_reg_set_interval,
-    },
-    {
-        N_("ignoretimestamponly"),
-        sh_reg_ign_time,
-    },
-    {
-        N_("singlekey"),
-        sh_reg_add_key,
-    },
-    {
-        N_("hierarchy"),
-        sh_reg_add_hierarchy,
-    },
-    {
-        N_("stopatkey"),
-        sh_reg_add_stop,
-    },
-    {
-        N_("ignorekey"),
-        sh_reg_add_ign,
-    },
-    {
-        NULL,
-        NULL
-    }
-};
-
-/* Runtime configuration */
-
-#define SH_REGISTRY_INTERVAL 300
-
-static int      ShRegCheckActive      = S_FALSE;
-static time_t   sh_reg_check_interval = SH_REGISTRY_INTERVAL;
-static int      sh_reg_check_severity = SH_ERR_SEVERE;
-static int      ShRegIgnTime          = S_FALSE;
-
-struct regkeylist {
-  char        * name;
-  int           stop;
-  int           single;
-#ifdef HAVE_REGEX_H
-  regex_t       preg;
-#endif
-
-  struct regkeylist *next;
-};
-
-static struct regkeylist * keylist = NULL;
-
-static int sh_reg_set_active(const char *s) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_reg_set_active"));
-
-  value = sh_util_flagval(s, &ShRegCheckActive);
-
-  SL_RETURN((value), _("sh_reg_set_active"));
-}
-
-static int sh_reg_ign_time(const char *s) 
-{
-  int value;
-    
-  SL_ENTER(_("sh_reg_ign_time"));
-
-  value = sh_util_flagval(s, &ShRegIgnTime);
-
-  SL_RETURN((value), _("sh_reg_ign_time"));
-}
-
-static int sh_reg_set_interval (const char * c)
-{
-  int retval = 0;
-  long val;
-
-  SL_ENTER(_("sh_reg_set_interval"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val <= 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("registry check interval"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      retval = -1;
-    }
-
-  sh_reg_check_interval = (time_t) val;
-  SL_RETURN(0, _("sh_reg_set_interval"));
-}
-
-static int sh_reg_set_severity (const char *s)
-{
-  char tmp[32];
-  tmp[0] = '='; tmp[1] = '\0';
-  sl_strlcat (tmp, s, 32);
-  return sh_error_set_level (tmp, &sh_reg_check_severity);
-}
-
-static int sh_reg_add_key_int (const char *s, int isSingle, int isStop)
-{
-  struct regkeylist * newkey;
-  size_t len = sl_strlen(s);
-
-  if (len > 0)
-    {
-      newkey = SH_ALLOC(sizeof(struct regkeylist));
-      newkey->single = isSingle;
-      newkey->stop   = isStop;
-      newkey->name = NULL;
-
-      if (STOP_FALSE == isStop)
-	{
-	  newkey->name = SH_ALLOC(len + 1);
-	  sl_strlcpy(newkey->name, s, len+1);
-	}
-      else
-	{
-#ifdef HAVE_REGEX_H
-	  int status = regcomp(&(newkey->preg), s, REG_NOSUB|REG_EXTENDED);
-	  if (status != 0)
-	    {
-	      char  errbuf[512];
-	      char  *p;
-	      regerror(status, &(newkey->preg), errbuf, sizeof(errbuf));
-
-	      sl_strlcat(errbuf, ": ", sizeof(errbuf));
-	      p = sh_util_safe_name_keepspace(s);
-	      sl_strlcat(errbuf, p, sizeof(errbuf));
-	      SH_FREE(p);
-
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			      errbuf, _("sh_reg_add_key_int"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      SH_FREE(newkey);
-	      return -1;
-	    }
-#else
-	  newkey->name = SH_ALLOC(len + 1);
-	  sl_strlcpy(newkey->name, s, len+1);
-#endif
-	}
-      newkey->next = keylist;
-      keylist      = newkey;
-      return 0;
-    }
-  return -1;
-}
-
-static int sh_reg_add_key (const char *s)
-{
-  return sh_reg_add_key_int (s, S_TRUE, STOP_FALSE);
-}
-static int sh_reg_add_hierarchy (const char *s)
-{
-  return sh_reg_add_key_int (s, S_FALSE, STOP_FALSE);
-}
-static int sh_reg_add_stop (const char *s)
-{
-  return sh_reg_add_key_int (s, S_FALSE, STOP_CHECK);
-}
-static int sh_reg_add_ign (const char *s)
-{
-  return sh_reg_add_key_int (s, S_FALSE, STOP_IGN);
-}
-
-/* Module functions      */
-
-int sh_reg_check_init(struct mod_type * arg)
-{
-#ifndef HAVE_PTHREAD
-  (void) arg;
-#endif
-
-  if (ShRegCheckActive == S_FALSE)
-    return SH_MOD_FAILED;
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      return SH_MOD_THREAD;
-    }
-#endif
-  return 0;
-}
-
-int sh_reg_check_timer(time_t tcurrent)
-{
-  static time_t lastcheck = 0;
-
-  SL_ENTER(_("sh_reg_check_timer"));
-  if ((time_t) (tcurrent - lastcheck) >= sh_reg_check_interval)
-    {
-      lastcheck  = tcurrent;
-      SL_RETURN((-1), _("sh_reg_check_timer"));
-    }
-  SL_RETURN(0, _("sh_reg_check_timer"));
-}
-
-#define SH_REGFORM_NEW 1
-#define SH_REGFORM_OLD 2
-
-static char * format_changes(int flag, char * buf, size_t len,
-			     time_t time_old, unsigned long size_old, 
-			     unsigned long keys_old, unsigned long values_old,
-			     char * hash_old,
-			     time_t time_new, unsigned long size_new, 
-			     unsigned long keys_new, unsigned long values_new,
-			     char * hash_new)
-{
-  char timestr1[32];
-  char timestr2[32];
-  char timestr3[32];
-
-  char buf_old[512] = "";
-  char buf_new[512] = "";
-
-  if ((0 != (flag & SH_REGFORM_NEW)) && (NULL != hash_new))
-    {
-      (void) sh_unix_gmttime (time_new,   timestr1,  sizeof(timestr1));
-      (void) sh_unix_gmttime (keys_new,   timestr2,  sizeof(timestr2));
-      (void) sh_unix_gmttime (values_new, timestr3,  sizeof(timestr3));
-
-#ifdef SH_USE_XML
-      sl_snprintf(buf_new, sizeof(buf_new), 
-		  "size_new=\"%lu\" mtime_new=\"%s\" ctime_new=\"%s\" atime_new=\"%s\" chksum_new=\"%s\"",
-		  size_new, timestr1, timestr2, timestr3, hash_new);
-#else
-      sl_snprintf(buf_new, sizeof(buf_new), 
-		  "size_new=<%lu>, mtime_new=<%s>, ctime_new=<%s>, atime_new=<%s>, chksum_new=<%s>",
-		  size_new, timestr1, timestr2, timestr3, hash_new);
-#endif
-    }
-
-  if ((0 != (flag & SH_REGFORM_OLD)) && (NULL != hash_old))
-    {
-      (void) sh_unix_gmttime (time_old,   timestr1,  sizeof(timestr1));
-      (void) sh_unix_gmttime (keys_old,   timestr2,  sizeof(timestr2));
-      (void) sh_unix_gmttime (values_old, timestr3,  sizeof(timestr3));
-
-#ifdef SH_USE_XML
-      sl_snprintf(buf_old, sizeof(buf_old), 
-		  " size_old=\"%lu\" mtime_old=\"%s\" ctime_old=\"%s\" atime_old=\"%s\" chksum_old=\"%s\"",
-		  size_old, timestr1, timestr2, timestr3, hash_old);
-#else
-      sl_snprintf(buf_old, sizeof(buf_old), 
-		  " size_old=<%lu>, mtime_old=<%s>, ctime_old=<%s>, atime_old=<%s>, chksum_old=<%s>",
-		  size_old, timestr1, timestr2, timestr3, hash_old);
-#endif
-    }
-
-  sl_strlcpy(buf, buf_new, len);
-  sl_strlcat(buf, buf_old, len);
-
-  return buf;
-}
-
-static void report_missing_entry(const char * path)
-{
-  char  * infobuf  = SH_ALLOC(1024);
-  char  * errbuf   = SH_ALLOC(1024);
-  char  * tmp      = sh_util_safe_name (path);
-  char timestr[32];
-  struct store2db save;
-
-  memset(&save, 0, sizeof(struct store2db));
-  sh_hash_db2pop (path, &save);
-    
-  (void) sh_unix_gmttime (save.val1, timestr,  sizeof(timestr));
-  
-  sl_snprintf(infobuf, 1024, _("mtime=%s size=%lu subkeys=%lu values=%lu"),
-	      timestr, 
-	      (unsigned long) save.val0, 
-	      (unsigned long) save.val2, 
-	      (unsigned long) save.val3);
-
-  (void) format_changes (SH_REGFORM_OLD, errbuf, 1024, 
-			 save.val1, save.val0, save.val2, save.val3, save.checksum,
-			 0, 0, 0, 0, NULL);
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle(sh_reg_check_severity, FIL__, __LINE__, 0, MSG_REG_MISS, 
-		  infobuf, tmp, errbuf);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  
-  SH_FREE(tmp);
-  SH_FREE(errbuf);
-  SH_FREE(infobuf);
-  return;
-}
-
-int sh_reg_check_run(void)
-{
-  struct regkeylist *this = keylist;
-
-  if (this)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checking the registry"),
-		      _("sh_reg_check_run"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-      while (this)
-	{
-	  if (STOP_FALSE == this->stop)
-	    {
-	      /* 
-	       *  -- Check key -- 
-	       */
-	      check_key (this->name, this->single);
-	    }
-	  this = this->next;
-	}
-    }
-  sh_hash_unvisited_custom ('H', report_missing_entry);
-
-  return 0;
-}
-
-int sh_reg_check_reconf(void)
-{
-  struct regkeylist *this;
-
-  while (keylist)
-    {
-      this    = keylist;
-      keylist = keylist->next;
-
-      if (this->name)
-	SH_FREE(this->name);
-#ifdef HAVE_REGEX_H
-      if (STOP_FALSE != this->stop)
-	regfree(&(this->preg));
-#endif
-      SH_FREE(this);
-    }
-
-  sh_reg_check_interval = SH_REGISTRY_INTERVAL;
-
-  return 0;
-}
-
-int sh_reg_check_cleanup(void)
-{
-  sh_reg_check_reconf();
-  return 0;
-}
-
-/* >>>>>>>>>>>> Main check function <<<<<<<<<<<< */
-
-
-#include <windows.h>
-
-#define MAX_KEY_LENGTH (2*256)
-#define MAX_VALUE_NAME (2*16384)
-
-CHAR  achValue[MAX_VALUE_NAME];
-
-unsigned long nKeys = 0;
-unsigned long nVals = 0;
-
-static int CheckThisSubkey (HKEY key, char * subkey, char * path, 
-			    int isSingle, int view);
-
-static time_t convertTime(FILETIME * ft)
-{
-  time_t result;
-
-  /* Shift high part up by 2^32
-   */
-  UINT64 date = ((UINT64)ft->dwHighDateTime) << 32; 
-
-  /* Add low part 
-   */
-  date |= (UINT64)ft->dwLowDateTime;
-
-  /* Subtract difference between Jan 1, 1601 and Jan 1, 1970
-   */
-  date -= ((UINT64)116444736) * ((UINT64)100) * ((UINT64)10000000);
-
-  /* Divide by number of 100-nanosecond intervals per second
-   */
-  date /= ((UINT64)10000000);
-
-  /* Convert to a time_t 
-   */
-  result = (time_t) date;
-
-  return result;
-}
-
-#if !defined(KEY_WOW64_64KEY)
-#define KEY_WOW64_64KEY 0x0100;
-#endif
-#if !defined(KEY_WOW64_32KEY)
-#define KEY_WOW64_32KEY 0x0200;
-#endif
-
-
-#define SH_KEY_NULL _("000000000000000000000000000000000000000000000000")
-
-int QueryKey(HKEY hKey, char * path, size_t pathlen, int isSingle) 
-{ 
-  CHAR     achKey[MAX_KEY_LENGTH];   /* buffer for subkey name */
-  DWORD    cbName;                   /* size of name string */
-  /* CHAR     achClass[MAX_PATH] = "";  *//* buffer for class name */
-  /* DWORD    cchClassName = MAX_PATH/2;*//* size of class string */
-  DWORD    cSubKeys=0;               /* number of subkeys */
-  DWORD    cbMaxSubKey;              /* longest subkey size */
-  DWORD    cchMaxClass;              /* longest class string */
-  DWORD    cValues;              /* number of values for key */
-  DWORD    cchMaxValue;          /* longest value name */
-  DWORD    cbMaxValueData;       /* longest value data */
-  DWORD    cbSecurityDescriptor; /* size of security descriptor */
-  FILETIME ftLastWriteTime;      /* last write time */
-  DWORD    lpType;               /* type of data stored in value */
-  BYTE     lpData[256];          /* buffer for data in value */
-  DWORD    lpcbData;             /* size of lpData buffer */
-  DWORD    i, retCode; 
-  DWORD    cchValue = MAX_VALUE_NAME/2;
-
-  char hashbuf[KEYBUF_SIZE];
-  unsigned long totalSize = 0;
-  time_t fTime = 0;
-
-  char * tPath = NULL;
-  int    doUpdate = S_FALSE;
-
-  retCode = RegQueryInfoKey(
-			    hKey,                    /* key handle */
-			    NULL /* achClass */,     /* buffer for class name */
-			    NULL /* &cchClassName */,/* size of class string */
-			    NULL,                    /* reserved */
-			    &cSubKeys,               /* number of subkeys */
-			    &cbMaxSubKey,            /* longest subkey size */
-			    &cchMaxClass,            /* longest class string */
-			    &cValues,                /* number of values for this key */
-			    &cchMaxValue,            /* longest value name */
-			    &cbMaxValueData,         /* longest value data */
-			    &cbSecurityDescriptor,   /* security descriptor */
-			    &ftLastWriteTime);       /* last write time */
-  
-  if (retCode != ERROR_SUCCESS)
-    {
-      return -1;
-    }
-
-  ++nKeys;
-
-  fTime = convertTime (&ftLastWriteTime);
-
-  /* Enumerate the subkeys, until RegEnumKeyEx fails. */
-  
-  if (cSubKeys)
-    {
-      /*
-       * printf( "\nNumber of subkeys: %lu\n", (unsigned long) cSubKeys);
-       */
-
-      for (i=0; i<cSubKeys; i++) 
-	{ 
-	  cbName = MAX_KEY_LENGTH/2;
-	  retCode = RegEnumKeyEx(hKey, i,
-				 achKey, 
-				 &cbName, 
-				 NULL, 
-				 NULL, 
-				 NULL, 
-				 &ftLastWriteTime);
- 
-	  if (retCode == ERROR_SUCCESS && S_TRUE != isSingle) 
-	    {
-	      /*
-	       * _tprintf(TEXT("(%lu) %s\\%s\n"), (unsigned long) i+1, 
-	       * path, achKey);
-	       */
-	      CheckThisSubkey (hKey, achKey, path, isSingle, 0); 
-	    }
-	}
-    } 
-  
-  /* Enumerate the key values. */
-
-  if (cValues) 
-    {
-      char hashtmp[3][KEYBUF_SIZE];
-
-      memset(hashbuf, '0', sizeof(hashbuf));
-
-      /* Loop over values and build checksum */
-
-      for (i=0, retCode=ERROR_SUCCESS; i<cValues; i++) 
-	{ 
-	  LPBYTE lpDataAlloc = NULL;
-
-	  cchValue = MAX_VALUE_NAME/2; 
-	  achValue[0] = '\0';
-	  lpcbData = sizeof(lpData);
-	  retCode = RegEnumValue(hKey, i, 
-				 achValue, 
-				 &cchValue, 
-				 NULL, 
-				 &lpType,
-				 lpData,
-				 &lpcbData);
-	  
-	  if (retCode == ERROR_MORE_DATA)
-	    {
-	      lpDataAlloc = SH_ALLOC(lpcbData);
-
-	      retCode = RegEnumValue(hKey, i, 
-				     achValue, 
-				     &cchValue, 
-				     NULL, 
-				     &lpType,
-				     lpDataAlloc,
-				     &lpcbData);
-	    }
-
-	  if (retCode == ERROR_SUCCESS)
-	    {
-	      totalSize += lpcbData;
-
-	      /* checksum(valuename) */
-	      sh_tiger_hash (achValue, TIGER_DATA, cchValue, 
-			     hashtmp[0], KEYBUF_SIZE);
-
-	      /* checksum(valuedata) */
-	      if (NULL == lpDataAlloc)
-		{
-		  sh_tiger_hash ((char*) lpData,      TIGER_DATA, lpcbData, 
-				 hashtmp[1], KEYBUF_SIZE);
-		}
-	      else
-		{
-		  sh_tiger_hash ((char*) lpDataAlloc, TIGER_DATA, lpcbData, 
-				 hashtmp[1], KEYBUF_SIZE);
-		}
-
-	      /* old_checksum */
-	      memcpy(hashtmp[2], hashbuf, KEYBUF_SIZE);
-
-	      /* hash(hash(valuename)+hash(valuedata)+old_hash) */
-	      sh_tiger_hash ((char*) hashtmp, TIGER_DATA, 
-			     sizeof(hashtmp), hashbuf, sizeof(hashbuf));
-
-	      ++nVals;
-	    }
-
-	  if (lpDataAlloc)
-	    {
-	      SH_FREE(lpDataAlloc);
-	    }
-	}
-    }
-  else
-    {
-      /* no values */
-      sl_strlcpy(hashbuf, SH_KEY_NULL, sizeof(hashbuf));
-    }
-
-  /* Here we have:
-   *  hashbuf       [checksum over values], 
-   *  fTime         [last write time], 
-   *  totalSize     [size of all value data],
-   *  cSubKeys      [number of subkeys],
-   *  cValues       [number of values],
-   *  path, pathlen [which may be up to 131072 (256*512) bytes] 
-   */
-
-  if (pathlen > (PATH_MAX-1))
-    {
-      char hashbuf2[KEYBUF_SIZE];
-      char * p = strchr(path, '\\');
-
-      if (p)
-	{
-	  char *q = p;
-
-	  ++p;
-	  
-	  tPath = SH_ALLOC(256 + KEYBUF_SIZE);
-	  *q = '\0';
-	  sl_strlcpy(tPath, path, 256); /* truncates */
-	  *q = '\\';
-	  sl_strlcat(tPath, "\\", 257);
-	  (void) sh_tiger_hash(p, TIGER_DATA, sl_strlen(p), 
-			       hashbuf2, sizeof(hashbuf2));
-	  sl_strlcat(tPath, hashbuf2, 256 + KEYBUF_SIZE);
-	}
-    }
- 
-  if (sh.flag.checkSum == SH_CHECK_CHECK || sh.flag.update == S_TRUE)
-    {
-      struct store2db save;
-
-      memset(&save, 0, sizeof(struct store2db));
-
-      if (tPath)
-	{
-	  sh_hash_db2pop (tPath, &save);
-	}
-      else
-	{
-	  sh_hash_db2pop (path, &save);
-	}
-
-      if (save.size == -1)
-	{
-	  /* Not in database */
-
-	  char  * infobuf  = SH_ALLOC(1024);
-	  char  * errbuf   = SH_ALLOC(1024);
-	  char  * tmp      = sh_util_safe_name ((tPath == NULL) ? path : tPath);
-	  char timestr[32];
-      
-	  (void) sh_unix_gmttime (fTime, timestr,  sizeof(timestr));
-
-	  sl_snprintf(infobuf, 1024, 
-		      _("mtime=%s size=%lu subkeys=%lu values=%lu"), 
-		      timestr, 
-		      (unsigned long) totalSize, 
-		      (unsigned long) cSubKeys, 
-		      (unsigned long) cValues);
-
-	  (void) format_changes (SH_REGFORM_NEW, errbuf, 1024, 
-				 0, 0, 0, 0, NULL,
-				 fTime, totalSize, cSubKeys, cValues, hashbuf);
-      
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_reg_check_severity, FIL__, __LINE__, 
-			  0, MSG_REG_NEW, 
-			  infobuf, tmp, errbuf);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  
-	  SH_FREE(tmp);
-	  SH_FREE(errbuf);
-	  SH_FREE(infobuf);
-
-	  doUpdate = S_TRUE;
-	}
-      else if (save.val0 != totalSize ||  
-	       save.val2 != cSubKeys ||
-	       save.val3 != cValues ||
-	       0 != strcmp(save.checksum, hashbuf) || 
-	       ( (((time_t) save.val1) != fTime) && (ShRegIgnTime == S_FALSE)) )
-	{
-	  /* Change detected */
-	  char  * infobuf  = SH_ALLOC(1024);
-	  char  * errbuf   = SH_ALLOC(1024);
-	  char  * tmp      = sh_util_safe_name ((tPath == NULL) ? path : tPath);
- 	  char timestr_new[32];
-      
-	  (void) sh_unix_gmttime (fTime,     timestr_new,  sizeof(timestr_new));
-
-	  sl_snprintf(infobuf, 1024, 
-		      _("mtime=%s size %lu->%lu subkeys %lu->%lu values %lu->%lu checksum %s"), 
-		      timestr_new, 
-		      (unsigned long) save.val0, (unsigned long) totalSize, 
-		      (unsigned long) save.val2, (unsigned long) cSubKeys, 
-		      (unsigned long) save.val3, (unsigned long) cValues, 
-		      (0 == strcmp(save.checksum, hashbuf)) ? _("good") : _("bad"));
-
-	  (void) format_changes (SH_REGFORM_OLD|SH_REGFORM_NEW, errbuf, 1024, 
-				 save.val1, save.val0, 
-				 save.val2, save.val3, save.checksum,
-				 fTime, totalSize, 
-				 cSubKeys, cValues, hashbuf);
-      
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle(sh_reg_check_severity, FIL__, __LINE__, 
-			  0, MSG_REG_CHANGE, 
-			  infobuf, tmp, errbuf);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  
-	  SH_FREE(tmp);
-	  SH_FREE(errbuf);
-	  SH_FREE(infobuf);
-
-	  doUpdate = S_TRUE;
-	}
-
-    }
- 
-  if ( sh.flag.checkSum == SH_CHECK_INIT || doUpdate == S_TRUE /* change detected */ )
-    {
-      struct store2db save;
-
-      memset(&save, 0, sizeof(struct store2db));
-      
-      save.val0 = totalSize;
-      save.val1 = fTime;
-      save.val2 = cSubKeys;
-      save.val3 = cValues;
-      sl_strlcpy(save.checksum, hashbuf, KEY_LEN+1);
-
-      if (tPath)
-	{
-	  sh_hash_push2db (tPath, &save);
-	}
-      else
-	{
-	  sh_hash_push2db (path, &save);
-	}
-    }
-
-  /* Without this, freshly updated entries would get deleted
-   * as 'not seen'.
-   */
-  if (sh.flag.checkSum != SH_CHECK_INIT)
-    {
-      if (tPath)
-	sh_hash_set_visited (tPath);
-      else
-	sh_hash_set_visited (path);
-    }
-
-  if (tPath)
-    {
-      SH_FREE(tPath);
-    }
-
-  return 0;
-}
-
-static int check_for_stop (char * name)
-{
-  struct regkeylist *this = keylist;
-
-  while (this)
-    {
-      if (STOP_FALSE != this->stop)
-	{
-#ifdef HAVE_REGEX_H
-	  if (0 == regexec(&(this->preg), name, 0, NULL, 0))
-	    return this->stop;
-#else
-	  if (0 == strcmp(this->name, name))
-	    return this->stop;
-#endif
-	}
-      this = this->next;
-    }
-  return STOP_FALSE;
-}
-
-
-int CheckThisSubkey (HKEY key, char * subkey, char * path, int isSingle,
-		     int view)
-{
-  HKEY hTestKey;
-  LONG qError;
-  char * newpath;
-  size_t len;
-  int    retval = -1;
-
-  if (!subkey)
-    return 0;
-  
-  len = strlen(path) + 1 + strlen(subkey) + 1;
-  newpath = SH_ALLOC(len);
-  snprintf(newpath, len, "%s\\%s", path, subkey);
-  
-  /* Check for stop condition, if not single key. 
-   * Set flag to isSingle = S_TRUE if we should stop here. 
-   */
-  if (S_TRUE != isSingle)
-    {
-      int isStop = check_for_stop(newpath);
-
-      if (STOP_CHECK == isStop)
-	{
-	  isSingle = S_TRUE;
-	}
-      else if (STOP_IGN == isStop)
-	{
-	  SH_FREE(newpath);
-	  return 0;
-	}
-    }
-
-  len = strlen(path) + 1 + strlen(subkey) + 1;
-  newpath = SH_ALLOC(len);
-  snprintf(newpath, len, "%s\\%s", path, subkey);
-  
-  qError = RegOpenKeyEx( key,
-			 subkey,
-			 0,
-			 (KEY_READ | view),
-			 &hTestKey);
-
-
-  if (qError == ERROR_SUCCESS)
-    {
-      QueryKey(hTestKey, newpath, len-1, isSingle);
-      RegCloseKey(hTestKey);
-      retval = 0;
-    }
-  else
-    {
-      /* Error message */
-      LPVOID lpMsgBuf;
-  
-      char  * tmp     = sh_util_safe_name (newpath);
-      size_t  tlen    = sl_strlen(tmp);
-
-      if (S_TRUE == sl_ok_adds(64, tlen))
-	{
-	  char * errbuf;
-	  size_t elen;
-
-	  tlen += 64;
-
-	  elen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
-			       FORMAT_MESSAGE_FROM_SYSTEM |
-			       FORMAT_MESSAGE_IGNORE_INSERTS,
-			       NULL,
-			       qError,
-			       MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-			       /* cppcheck-suppress uninitvar */
-			       (LPTSTR) &lpMsgBuf,
-			       0, NULL );
-
-	  if (elen > 0 && S_TRUE == sl_ok_adds(elen, tlen))
-	    {
-	      tlen += elen;
-
-	      errbuf = SH_ALLOC(elen + tlen);
-	      sl_snprintf(errbuf, 64+tlen, _("Failed to open key %s: %s"), 
-			  tmp, lpMsgBuf);
-	      LocalFree(lpMsgBuf);
-
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			      errbuf, _("CheckThisSubkey"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      
-	      SH_FREE(errbuf);
-	    }
-	}
-      sh_reg_add_ign (newpath);
-      SH_FREE(tmp);
-    }
-  
-  SH_FREE(newpath);
-  return retval;
-}
-
-
-int check_key (char * key, int isSingle)
-{
-  HKEY topKey;
-  char * subkey = NULL;
-  char path[20] = "";
-  int pos = 0;
-  
-  if      (0 == strncmp(key, _("HKEY_CLASSES_ROOT"), 17))
-    {
-      topKey = HKEY_CLASSES_ROOT;
-      pos = 17;
-      strncpy(path, _("HKEY_CLASSES_ROOT"), sizeof(path));
-    }
-  else if (0 == strncmp(key, _("HKEY_CURRENT_USER"), 17))
-    {
-      topKey = HKEY_CURRENT_USER;
-      pos = 17;
-      strncpy(path, _("HKEY_CURRENT_USER"), sizeof(path));
-    }
-  else if (0 == strncmp(key, _("HKEY_LOCAL_MACHINE"), 18))
-    {
-      topKey = HKEY_LOCAL_MACHINE;
-      pos = 18;
-      strncpy(path, _("HKEY_LOCAL_MACHINE"), sizeof(path));
-    }
-  else if (0 == strncmp(key, _("HKEY_USERS"), 10))
-    {
-      topKey = HKEY_USERS;
-      pos = 10;
-      strncpy(path, _("HKEY_USERS"), sizeof(path));
-    }
-
-
-  if (pos > 0)
-    {
-      if (key[pos] == '\\')
-	{
-	  ++pos;
-	  subkey = &key[pos];
-	}
-    }
-  else
-    {
-      /* We bail out here if the topKey is undefined */
-      char * tmp = sh_util_safe_name_keepspace(key);
-      size_t tlen = sl_strlen(tmp);
-
-      if (S_TRUE == sl_ok_adds(64, tlen))
-	{
-	  char * errbuf = SH_ALLOC(64 + tlen);
-	  
-	  sl_snprintf(errbuf, 64+tlen, _("Invalid key %s"), tmp);
-	  
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			  errbuf, _("check_key"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  
-	  SH_FREE(errbuf);
-	}
-      SH_FREE(tmp);
-      return -1;
-    }
-
-  /************************  
-  if (ShCheckBothViews)
-    {
-      CheckThisSubkey (topKey, subkey, path, isSingle, KEY_WOW64_32KEY);
-      return CheckThisSubkey (topKey, subkey, path, isSingle, KEY_WOW64_64KEY);
-    }
-  *************************/
-
-  /* Returns 0 if !subkey */
-  /* cppcheck-suppress legacyUninitvar */
-  return CheckThisSubkey (topKey, subkey, path, isSingle, 0);
-}
-
-/* #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) */
-#endif
-
-/* #ifdef USE_REGISTRY_CHECK */
-#endif
-
Index: trunk/src/sh_restrict.c
===================================================================
--- trunk/src/sh_restrict.c	(revision 591)
+++ 	(revision )
@@ -1,686 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2011 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#ifndef NULL
-#if !defined(__cplusplus)
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-
-#ifdef HAVE_REGEX_H
-#include <sys/types.h>
-#include <regex.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "samhain.h"
-#include "sh_mem.h"
-#include "sh_error_min.h"
-#include "sh_string.h"
-#include "sh_utils.h"
-#include "sh_restrict.h"
-
-#define FIL__ _("sh_restrict.c")
-
-#define SH_COND_NOT    (1 << 0)
-#define SH_COND_PREFIX (1 << 1)
-#define SH_COND_REGEX  (1 << 2)
-#define SH_COND_SIZE   (1 << 3)
-#define SH_COND_PERM   (1 << 4)
-#define SH_COND_FTYPE  (1 << 5)
-#define SH_COND_PINCL  (1 << 6)
-
-#define SH_COND_MAX 6
-
-struct sh_restrict_cond {
-
-  unsigned char cond_type[SH_COND_MAX];
-
-#ifdef HAVE_REGEX_H
-  regex_t *     cond_preg[SH_COND_MAX];
-#endif
-
-  char  *       cond_str[SH_COND_MAX];
-
-  UINT64        cond_int[SH_COND_MAX];
-
-  struct sh_restrict_cond * next;
-};
-
-static struct sh_restrict_cond * sh_restrict_list = NULL;
-
-extern int matches_filetype(SL_TICKET ft, char * test_type);
-
-#ifdef HAVE_REGEX_H
-static int matches_regex (const char * path, const regex_t * regex)
-{
-  SL_ENTER(_("matches_regex"));
-
-  if (0 == regexec(regex, path, 0, NULL, 0))
-    {
-      SL_RETURN(1, _("matches_regex"));
-    }
-  SL_RETURN(0, _("matches_regex"));
-}
-#else
-static int matches_string (const char * path, const char * string)
-{
-  SL_ENTER(_("matches_string"));
-  
-  if (NULL == strstr(path, string))
-    {
-      SL_RETURN(0, _("matches_string"));
-    }
-  SL_RETURN(1, _("matches_string"));
-}
-#endif
-
-static int matches_prefix (const char * path, const char * prefix)
-{
-  size_t path_len;
-  size_t pref_len;
-
-  SL_ENTER(_("matches_prefix"));
-
-  if (path && prefix)
-    {
-      path_len = sl_strlen(path);
-      pref_len = sl_strlen(prefix);
-      
-      if (path_len >= pref_len)
-	{
-	  if (0 == strncmp(path, prefix, pref_len))
-	    {
-	      SL_RETURN(1, _("matches_prefix"));
-	    }
-	}
-    }
-  SL_RETURN(0, _("matches_prefix"));
-}
-
-static int exceeds_size (UINT64 size, UINT64 maxsize)
-{
-  SL_ENTER(_("exceeds_size"));
-
-  if (size > maxsize)
-    {
-      SL_RETURN(1, _("exceeds_size"));
-    }
-  SL_RETURN(0, _("exceeds_size"));
-}
-
-static int matches_perm (UINT64 perm, UINT64 needed_perm)
-{
-  SL_ENTER(_("matches_perm"));
-
-  if (needed_perm == (perm & 07777))
-    {
-      SL_RETURN(1, _("matches_perm"));
-    }
-  SL_RETURN(0, _("matches_perm"));
-}
-
-static int includes_perm (UINT64 perm, UINT64 needed_perm)
-{
-  UINT64 tmp = perm & 07777;
-
-  SL_ENTER(_("includes_perm"));
-
-  if (needed_perm == (tmp & needed_perm))
-    {
-      SL_RETURN(1, _("includes_perm"));
-    }
-  SL_RETURN(0, _("includes_perm"));
-}
-
-static int sh_restrict_test(const char * path, 
-			    UINT64 size, UINT64 perm, SL_TICKET fh,
-			    struct sh_restrict_cond * current)
-{
-  int i;
-  unsigned char flag;
-  int res = 0;
-
-  (void) fh;
-
-  SL_ENTER(_("sh_restrict_test"));
-
-  for (i = 0; i < SH_COND_MAX; ++i)
-    {
-      flag = current->cond_type[i];
-
-      if (flag != 0)
-	{
-	  if      ((flag & (SH_COND_PREFIX)) != 0) {
-	    res = matches_prefix(path, current->cond_str[i]);
-	  }
-	  else if ((flag & (SH_COND_REGEX)) != 0) {
-#ifdef HAVE_REGEX_H
-	    res = matches_regex(path, current->cond_preg[i]);
-#else
-	    res = matches_string(path, current->cond_str[i]);
-#endif
-	  }
-	  else if ((flag & (SH_COND_SIZE)) != 0) {
-	    res = exceeds_size(size, current->cond_int[i]);
-	  }
-	  else if ((flag & (SH_COND_PERM)) != 0) {
-	    res = matches_perm(perm, current->cond_int[i]);
-	  }
-	  else if ((flag & (SH_COND_PINCL)) != 0) {
-	    res = includes_perm(perm, current->cond_int[i]);
-	  }
-	  else if ((flag & (SH_COND_FTYPE)) != 0) {
-	    res = matches_filetype(fh, current->cond_str[i]);
-	  }
-
-	  /* Does condition hold?
-	   */
-	  if ((flag & (SH_COND_NOT)) != 0) {
-	    /* 
-	     * Condition negated, ok if false (res == 0)
-	     */
-	    if (0 != res) {
-	      SL_RETURN(0, _("sh_restrict_this"));
-	    }
-	  }
-	  else {
-	    /* Condition ok if true (res != 0) */
-	    if (0 == res) {
-	      SL_RETURN(0, _("sh_restrict_this"));
-	    }
-	  }
-	}
-      else
-	{
-	  break;
-	}
-    }
-
-  /* All conditions true, restricted 
-   */
-  SL_RETURN(1, _("sh_restrict_this"));
-}
-
-/* >>>>>>>>>> Evaluate the list <<<<<<<<<< */
-
-int sh_restrict_this(const char * path, UINT64 size, UINT64 perm, SL_TICKET fh)
-{
-  struct sh_restrict_cond * current = sh_restrict_list;
-
-  SL_ENTER(_("sh_restrict_this"));
-
-  if (!current) 
-    {
-      SL_RETURN(0, _("sh_restrict_this"));
-    }
-
-  while (current) 
-    {
-      if (0 != sh_restrict_test(path, size, perm, fh, current))
-	{
-	  /* The current conditions are true, restricted
-	   */
-	  SL_RETURN(1, _("sh_restrict_this"));
-	}
-      current = current->next;
-    }
-
-  SL_RETURN(0, _("sh_restrict_this"));
-}
-
-
-/* >>>>>>>>>> Purge the list <<<<<<<<<< */
-
-static void sh_restrict_delete (struct sh_restrict_cond * current)
-{
-  int i;
-
-  if (current->next)
-    {
-      sh_restrict_delete(current->next);
-    }
-
-  for (i = 0; i < SH_COND_MAX; ++i)
-    {
-      if (current->cond_str[i]) {
-	SH_FREE(current->cond_str[i]);
-      }
-#ifdef HAVE_REGEX_H
-      if (current->cond_preg[i]) {
-	regfree(current->cond_preg[i]);
-	SH_FREE(current->cond_preg[i]);
-      }
-#endif
-    }
-  SH_FREE(current);
-  return;
-}
-
-void sh_restrict_purge ()
-{
-  struct sh_restrict_cond * current = sh_restrict_list;
-
-  sh_restrict_list = NULL;
-  if (current)
-    sh_restrict_delete(current);
-
-  sh_restrict_add_ftype(NULL);
-
-  return;
-}
-
-/* >>>>>>>>>> Create the list <<<<<<<<<< */
-
-static char * get_com(char * str)
-{
-  char * s;
-  char * e;
-
-  /* skip leading WS 
-   */
-  for (s = str; *s && isspace((int)*s); ++s) /* nothing */;
-
-  e = strchr(s, '(');
-  if (e && (e != s))
-    {
-      *e = '\0'; --e;
-      while ( (e != s) && isspace((int)*e) )
-	{
-	  *e = '\0'; --e;
-	}
-      if (e != s)
-	return s;
-    }
-  return NULL;
-}
-
-static char * get_arg(char * str)
-{
-  char * s;
-  char * e;
-
-  s = strchr(str, '(');
-
-  if (s)
-    {
-      ++s;
-      
-      /* skip leading WS 
-       */
-      for (; *s && isspace((int)*s); ++s) /* nothing */;
-
-      e = strrchr(s, ')');
-      if (e && (e != s))
-	{
-	  /* check that nothing follows */
-	  char * u = e;
-	  ++u; for (; *u && isspace((int)*u); ++u) /* nothing */;
-	  if (*u != '\0') return NULL;
-	  
-	  /* strip trailing space */
-	  *e = '\0'; --e;
-	  while ( (e != s) && isspace((int)*e) )
-	    {
-	      *e = '\0'; --e;
-	    }
-	  
-	  if (e != s)
-	    return s;
-	}
-    }
-  return NULL;
-}
-
-static int set_cond(struct sh_restrict_cond * current, int i, 
-		    char * com, char * arg)
-{
-  if (!com || !arg || (i >= SH_COND_MAX))
-    return -1;
-
-  if      (0 == strcmp(com, _("match_prefix")))
-    {
-      current->cond_str[i] = sh_util_strdup(arg);
-      current->cond_type[i] |= SH_COND_PREFIX;
-    }
-  else if (0 == strcmp(com, _("match_regex")))
-    {
-#ifdef HAVE_REGEX_H
-      regex_t * preg = SH_ALLOC(sizeof(regex_t)); 
-
-      if (0 != regcomp(preg, arg, REG_NOSUB|REG_EXTENDED))
-	{
-	  SH_FREE(preg);
-	  return (-1);
-	}
-      current->cond_preg[i] = preg;
-#else
-      current->cond_str[i] = sh_util_strdup(arg);
-#endif
-      current->cond_type[i] |= SH_COND_REGEX;
-    }
-  else if (0 == strcmp(com, _("size_exceeds")))
-    {
-      current->cond_int[i] = (UINT64) strtoul(arg, (char **) NULL, 0);
-      current->cond_type[i] |= SH_COND_SIZE;
-    }
-  else if (0 == strcmp(com, _("match_permission")))
-    {
-      current->cond_int[i] = (UINT64) strtoul(arg, (char **) NULL, 8);
-      current->cond_type[i] |= SH_COND_PERM;
-    }
-  else if (0 == strcmp(com, _("have_permission")))
-    {
-      current->cond_int[i] = (UINT64) strtoul(arg, (char **) NULL, 8);
-      current->cond_type[i] |= SH_COND_PINCL;
-    }
-  else if (0 == strcmp(com, _("match_filetype")))
-    {
-      current->cond_str[i] = sh_util_strdup(arg);
-      current->cond_type[i] |= SH_COND_FTYPE;
-    }
-  else
-    {
-      return (-1);
-    }
-  return 0;
-}
-
-/* Format is [!]cond1(arg), cond2(arg), ... 
- */
-int sh_restrict_define(const char * str)
-{
-  SL_ENTER(_("sh_restrict_define"));
-
-  if (str) 
-    {
-      size_t lengths[SH_COND_MAX];
-      unsigned int nfields = SH_COND_MAX;
-      char ** array;
-      sh_string * def = sh_string_new_from_lchar(str, strlen(str));
-
-      array = split_array_list(sh_string_str(def), &nfields, lengths);
-
-      if (array && nfields > 0)
-	{
-	  char * p;
-	  char * q;
-	  unsigned int i;
-	  struct sh_restrict_cond * current = 
-	    SH_ALLOC(sizeof(struct sh_restrict_cond));
-
-	  current->next = NULL;
-	  for (i = 0; i < SH_COND_MAX; ++i)
-	    {
-	      current->cond_int[i]  = 0; 
-	      current->cond_type[i] = 0;
-	      current->cond_str[i] = NULL;
-#ifdef HAVE_REGEX_H
-	      current->cond_preg[i] = NULL;
-#endif
-	    }
-      
-	  for (i = 0; i < nfields; ++i) 
-	    {
-	      if (i == SH_COND_MAX)
-		{
-		  sh_restrict_delete (current);
-		  sh_string_destroy(&def);
-		  SH_FREE(array);
-		  SL_RETURN((-1), _("sh_restrict_define"));
-		}
-	      
-	      p = array[i];
-
-	      if (*p == '!')
-		{
-		  current->cond_type[i] |= SH_COND_NOT;
-		  ++p;
-		}
-
-	      q = get_arg(p);
-	      p = get_com(p);
-
-	      if (!q || !p || (0 != set_cond(current, i, p, q)))
-		{
-		  sh_restrict_delete (current);
-		  sh_string_destroy(&def);
-		  SH_FREE(array);
-		  SL_RETURN((-1), _("sh_restrict_define"));
-		}
-	    }
-
-	  SH_FREE(array);
-
-	  current->next = sh_restrict_list;
-	  sh_restrict_list = current;
-	}
-
-      sh_string_destroy(&def);
-      SL_RETURN(0, _("sh_restrict_define"));
-    }
-
-  SL_RETURN((-1), _("sh_restrict_define"));
-}
-
-
-/* #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) */
-#endif
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_restrict (CuTest *tc) {
-
-#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
-
-  char str[256];
-  char * p;
-  char * q;
-  int  res;
-  SL_TICKET fd;
-  char buf[1024];
-
-  strcpy(str, "match(this)");
-  p = get_arg(str);
-  q = get_com(str);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertStrEquals(tc, "match", q);
-  CuAssertStrEquals(tc, "this",  p);
-  
-  strcpy(str, "  match( this)");
-  p = get_arg(str);
-  q = get_com(str);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertStrEquals(tc, "match", q);
-  CuAssertStrEquals(tc, "this",  p);
-  
-  strcpy(str, "  match ( this ) ");
-  p = get_arg(str);
-  q = get_com(str);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertStrEquals(tc, "match", q);
-  CuAssertStrEquals(tc, "this",  p);
-  
-  strcpy(str, "  match   (this   ) ");
-  p = get_arg(str);
-  q = get_com(str);
-  CuAssertPtrNotNull(tc, p);
-  CuAssertPtrNotNull(tc, q);
-  CuAssertStrEquals(tc, "match", q);
-  CuAssertStrEquals(tc, "this",  p);
-  
-  strcpy(str, "size_exceeds(800), match_prefix(/home), match_regex(.*\\.mpg) ");
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,0,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-
-  sh_restrict_purge();
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-
-  strcpy(str, "size_exceeds(800), match_prefix(/home), match_regex(.*\\.mpg), match_permission(0755) ");
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,0,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-
-  strcpy(str, "size_exceeds(800), match_prefix(/foo), have_permission(0100)");
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,0,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-
-  strcpy(str, "size_exceeds(800); match_prefix(/foo), have_permission(0100)");
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,-1,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-  
-  res = sh_restrict_this("/home/foo.mpg", 1000, 0755, 0);
-  CuAssertIntEquals(tc,1,res);
-
-  res = sh_restrict_this("/foo.mpg",      1000, 0755, 0);
-  CuAssertIntEquals(tc,1,res);
-
-  /* size too small */
-  res = sh_restrict_this("/foo.mpg",       600, 0755, 0);
-  CuAssertIntEquals(tc,0,res);
-
-  /* no execute permission */
-  res = sh_restrict_this("/foo.mpg",       600, 0644, 0);
-  CuAssertIntEquals(tc,0,res);
-
-  /* regex does not match */
-   res = sh_restrict_this("/home/foo",     1000, 0755, 0);
-  CuAssertIntEquals(tc,0,res);
-
-  /* wrong permission */
-  res = sh_restrict_this("/home/foo.mpg", 1000, 0705, 0);
-  CuAssertIntEquals(tc,0,res);
-  
-  /* size too small */
-  res = sh_restrict_this("/home/foo.mpg",  600, 0755, 0);
-  CuAssertIntEquals(tc,0,res);
-  
-  /* wrong prefix */
-  res = sh_restrict_this("/hoff/foo.mpg", 1000, 0755, 0);
-  CuAssertIntEquals(tc,0,res);
-  
-  sh_restrict_purge();
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-
-  fd = sl_open_fastread(FIL__, __LINE__, "/bin/sh", SL_NOPRIV);
-  CuAssertTrue(tc, fd > 0);
-
-  strcpy(str, "match_prefix(/bin), match_filetype(EXECUTABLE:UNIX:ELF)");
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,0,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-
-#if !defined(HOST_IS_CYGWIN) && !defined(HOST_IS_DARWIN)
-  res = sh_restrict_this("/bin/sh", 1000, 0755, fd);
-  CuAssertIntEquals(tc,1,res);
-#endif
-
-  sl_close(fd);
-
-  sh_restrict_purge();
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-
-  strcpy(str, "match_filetype(FILE:TEXT:COPYING)");
-  res = sh_restrict_define(str);
-  CuAssertIntEquals(tc,0,res);
-  CuAssertPtrNotNull(tc, sh_restrict_list);
-
-  p = getcwd(buf, sizeof(buf));
-  CuAssertPtrNotNull(tc, p);
-
-  strcpy(str, "0:0:0:FILE:TEXT:COPYING:Copying:=0a=53=41=4d=48=41=49=4e");
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-
-  sl_strlcat(buf, "/COPYING", sizeof(buf));
-  fd = sl_open_fastread(FIL__, __LINE__, buf, SL_NOPRIV);
-  CuAssertTrue(tc, fd > 0);
-
-  res = sh_restrict_this(buf, 1000, 0755, fd);
-  CuAssertIntEquals(tc,1,res);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,-1,res);
-
-  sh_restrict_purge();
-  CuAssertTrue(tc, sh_restrict_list == NULL);
-
-  res = sh_restrict_add_ftype(str);
-  CuAssertIntEquals(tc,0,res);
-  
-#else
-  (void) tc;
-/* #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) */
-#endif
-
-}
-#endif
-
-
Index: trunk/src/sh_schedule.c
===================================================================
--- trunk/src/sh_schedule.c	(revision 591)
+++ trunk/src/sh_schedule.c	(revision 1)
@@ -42,12 +42,16 @@
 #endif
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
-
-#include "samhain.h"
+#endif
+#endif
+
 #include "sh_mem.h"
-#include "sh_error_min.h"
 
 /* TESTONLY */
@@ -125,7 +129,4 @@
   struct tm * tval;
   int count, i, nval;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  struct tm     time_tm;
-#endif
 
   if (!isched)
@@ -133,16 +134,5 @@
 
   now  = time(NULL);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  tval = localtime_r(&now, &time_tm);
-#else
   tval = localtime(&now);
-#endif
-
-  if (!tval)
-    {
-      sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-                       _("localime() failed"), _("test_sched_int") );
-      return 0;
-    }
 
   count = 0;
@@ -215,5 +205,5 @@
 	/*@+charint@*//* Incompatible types for == (char, char): ??? */
 	for (k = 0; k < 3; ++k)
-	  if (p[k] != '\0' && tolower((int) p[k]) == MonNames[j][k]) ++l;
+	  if (p[k] != '\0' && tolower(p[k]) == MonNames[j][k]) ++l;
 	/*@-charint@*/
 	if (l == 3)
@@ -227,5 +217,5 @@
 	/*@+charint@*//* Incompatible types for == (char, char): ??? */
 	for (k = 0; k < 3; ++k)
-	  if (p[k] != '\0' && tolower((int) p[k]) == DayNames[j][k]) ++l;
+	  if (p[k] != '\0' && tolower(p[k]) == DayNames[j][k]) ++l;
 	/*@-charint@*/
 	if (l == 3)
@@ -328,26 +318,16 @@
   char * copy;
   int    i = 0;
-  size_t len;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  char * saveptr;
-#endif
 
   if (!ssched || !isched)
     return -1;
 
-  len = strlen(ssched)+1;
 #ifdef TESTONLY
-  copy = calloc(1,len);                 /* testonly code */
-#else
-  copy = SH_ALLOC(len);
-#endif
-  sl_strlcpy(copy, ssched, len);
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  p = strtok_r(copy, " \t", &saveptr); /* parse crontab-style schedule */
-#else
+  copy = malloc(strlen(ssched)+1);                 /* testonly code */
+#else
+  copy = SH_ALLOC(strlen(ssched)+1);
+#endif
+  strcpy(copy, ssched);                            /* known to fit  */
+
   p = strtok(copy, " \t"); /* parse crontab-style schedule */
-#endif
-
   if (!p)
     goto err; 
@@ -357,9 +337,5 @@
   for (i = 1; i < 5; ++i)
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-      p = strtok_r(NULL, " \t", &saveptr); /* parse crontab-style schedule */
-#else
       p = strtok(NULL, " \t"); /* parse crontab-style schedule */
-#endif
       if (!p)
 	goto err; 
@@ -367,4 +343,10 @@
 	goto err;
     }
+
+  /*
+  for (i = 0; i < 5; ++i)
+    printf("%2d MIN  %3d  MAX  %3d  STEP  %3d\n", 
+	   i, isched->min[i], isched->max[i], isched->step[i]);
+  */
 
   isched->last_exec = (time_t)-1;
@@ -441,5 +423,5 @@
     {
       if (test_sched(&isched))
-	printf("EXECUTE  at: %s", ctime(&(isched.last_exec))); /* TESTONLY */
+	printf("EXECUTE  at: %s", ctime(&(isched.last_exec)));
       sleep (1); /* TESTONLY */
     }
Index: trunk/src/sh_sem.c
===================================================================
--- trunk/src/sh_sem.c	(revision 591)
+++ 	(revision )
@@ -1,325 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2000, 2015 Rainer Wichmann                          */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-#include <stdlib.h>
-#include <stdio.h>
-
-#if defined(HAVE_SYS_SEM_H) && defined(HAVE_UNISTD_H)
-#include "samhain.h"
-#include "sh_sem.h"
-#include "sh_error_min.h"
-
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <unistd.h>
-
-#undef  FIL__
-#define FIL__  _("sh_sem.c")
-
-typedef enum {
-  exit_ok   = 0,
-  exit_fail = 1,
-  exit_time = 2,
-  exit_err  = 3
-} sh_estat;
-
-
-/* FreeBSD 6.1 defines this in <sys/sem.h> too...     */
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
-/* union semun is defined by including <sys/sem.h>    */
-#else
-#if !defined(HAVE_UNION_SEMUN)
-/* according to X/OPEN we have to define it ourselves */
-union semun {
-  int val;
-  struct semid_ds *buf;
-  unsigned short *array;
-};
-#endif
-#endif
-
-
-#define SH_SEMVMX 32767
-
-static int get_semaphore (void) 
-{
-  key_t  key = ftok(DEFAULT_DATAROOT, '#');
-  int    semid;
-
-  if (key < 0)
-    return -1;
-  semid = semget (key, 0, IPC_PRIVATE);
-  if (semid < 0)
-    return -1;
-  return semid;
-}
-
-static void sem_purge(int sem_id)
-{
-  union semun tmp;
-
-  tmp.val = 0;
-  
-  if (sem_id != -1)
-    semctl(sem_id, 0, IPC_RMID, tmp);
-  return;
-}
-
-static void sem_purge_stale()
-{
-  int stale_ID = get_semaphore();
-  if (stale_ID != -1)
-    sem_purge(stale_ID);
-  return;
-}
-
-static int report_err(int errnum, char * file, int line, char * func)
-{
-  char errbuf[SH_ERRBUF_SIZE];
-  sh_error_message(errnum, errbuf, sizeof(errbuf));
-  sh_error_handle((-1), file, line, errnum, MSG_E_SUBGEN,
-		  errbuf, func);
-  return -1;
-}
-
-static int init_semaphore (int nsems) 
-{
-  int    i;
-  mode_t mask;
-  int    semid;
-  int    errnum;
-  union semun tmp;
-  key_t  key = ftok(DEFAULT_DATAROOT, '#');
-
-  if (key < 0)
-    return report_err(errno, FIL__, __LINE__, _("ftok"));
-
-  mask   = umask(0);
-  semid  = semget (key, nsems, IPC_CREAT | IPC_EXCL | 0660);
-  errnum = errno;
-  umask(mask);
-  
-  tmp.val = 1;
-
-  if (semid < 0)
-    return report_err(errnum, FIL__, __LINE__, _("semget"));
-  for (i=0; i<nsems; ++i)
-    if (semctl (semid, i, SETVAL, tmp) == -1)
-      return report_err(errnum, FIL__, __LINE__, _("semclt"));
-  return semid;
-}
-
-
-static int sem_set(int semid, int sem_no, int val)
-{
-  union semun tmp;
-
-  tmp.val = val;
-  
-  if (semid < 0)
-    return -1;
-  if (semctl (semid, sem_no, SETVAL, tmp) == -1)
-    return -1;
-  return 0;
-}
-
-static int sem_get(int semid, int sem_no)
-{
-  union semun tmp;
-  if (semid < 0)
-    return -1;
-  tmp.val = 0;
-  return semctl (semid, sem_no, GETVAL, tmp);
-}
-
-
-static int sem_change(int semid, int sem_no, int amount)
-{
-  struct sembuf tmp;
-  int retval;
-
-  tmp.sem_num = sem_no;
-  tmp.sem_flg = SEM_UNDO;
-  tmp.sem_op  = amount;
-
-  do { retval = semop(semid, &tmp, 1);
-  } while (retval == -1 && errno == EINTR);
-
-  return retval;
-}
-
-static int sem_try_change(int semid, int sem_no, int amount)
-{
-  struct sembuf tmp;
-  int retval;
-
-  tmp.sem_num = sem_no;
-  tmp.sem_flg = IPC_NOWAIT|SEM_UNDO;
-  tmp.sem_op  = amount;
-
-  do { retval = semop(semid, &tmp, 1);
-  } while (retval == -1 && errno == EINTR);
-
-  return retval;
-}
-
-#define SH_SEMAPHORE_EXTERN(S)  int S = get_semaphore()
-#define SH_SEMAPHORE_INIT(S, N) int S = init_semaphore(N)
-#define SH_SEMAPHORE_TRYLOCK(S) sem_try_change(S, 0, SH_SEM_LOCK)
-#define SH_SEMAPHORE_LOCK(S)    sem_change(S, 0, SH_SEM_LOCK)
-#define SH_SEMAPHORE_UNLOCK(S)  sem_change(S, 0, SH_SEM_UNLOCK)
-#define SH_SEMAPHORE_PURGE(S)   sem_purge(S)
-
-static int sem_ID = -1;
-
-void sh_sem_open()
-{
-  if (sh.flag.isdaemon != S_TRUE)
-    return;
-
-  if (sem_ID < 0)
-    {
-      sem_purge_stale();
-      sem_ID = init_semaphore(2);
-      sem_set(sem_ID, 1, (int) 0);
-    }
-
-  return;
-}
-
-void sh_sem_trylock()
-{
-  SH_SEMAPHORE_TRYLOCK(sem_ID);
-  return;
-}
-
-void sh_sem_lock()
-{
-  SH_SEMAPHORE_LOCK(sem_ID);
-  return;
-}
-
-void sh_sem_unlock (long val)
-{
-  if (val >= 0)
-    {
-      val = (val > SH_SEMVMX) ? SH_SEMVMX : val; /* signed short int maxval */
-      sem_set(sem_ID, 1, (int) val);
-    }
-  SH_SEMAPHORE_UNLOCK(sem_ID);
-  return;
-}
-
-void sh_sem_close()
-{
-  SH_SEMAPHORE_PURGE(sem_ID);
-  return;
-}
-
-static volatile int alarm_triggered = 0;
-static void alarm_handler(int sig)
-{
-  (void) sig;
-  alarm_triggered = 1;
-  return;
-}
-
-int  sh_sem_wait(const char * wait)
-{
-  int rc, flag = 0;
-  int time_wait = atoi(wait);
-
-  SH_SEMAPHORE_EXTERN(sem_id);
-
-  if (time_wait < 0) { time_wait *= (-1); time_wait -= 1; flag = 1; }
-  if (time_wait < 0 || time_wait > (24*3600))
-    {
-      fprintf(stderr, _("Invalid argument <%d>.\n"), time_wait);
-      _exit(exit_err);
-    }
-  if (sem_id == -1)
-    {
-      if (flag && errno == ENOENT) { 
-	do { retry_msleep(1, 0); rc = get_semaphore(); } while (rc == -1);
-	sem_id = rc;
-      } else {
-	if (errno == ENOENT) {
-	  fputs(_("Samhain IPC not initialized.\n"), stderr);
-	  _exit(exit_err); }
-	else if (errno == EACCES)
-	  fputs(_("No permission to access Samhain IPC.\n"), stderr);
-	_exit(exit_err);
-      }
-    }
-
-  retry_msleep(0, 50);
-
-  if (time_wait > 0)
-    {
-      signal(SIGALRM, alarm_handler);
-      alarm(time_wait);
-    }
-  rc = SH_SEMAPHORE_LOCK(sem_id);
-  if (rc == -1 && errno == EINTR)
-    {
-      if (alarm_triggered)
-        {
-	  fputs(_("Timeout on wait.\n"), stderr);
-	  _exit(exit_time);
-        }
-    }
-  else if (rc == -1)
-    {
-      if (errno == EACCES)
-	fputs(_("No permission to access Samhain IPC.\n"), stderr);
-      else
-	perror(_("semop"));
-      _exit(exit_err);
-    }
-
-  rc = sem_get(sem_id, 1);
-  if (rc == 0)    
-    _exit(exit_ok);
-  else if (rc == SH_SEMVMX)
-    fprintf(stdout, _("%d or more issues reported\n"), rc);
-  else
-    fprintf(stdout, _("%d issues reported\n"), rc);
-  _exit(exit_fail);
-}
-
-#else
-
-void sh_sem_open()    { return; }
-void sh_sem_trylock() { return; }
-void sh_sem_lock()    { return; }
-void sh_sem_unlock(long val)  { (void) val; return; }
-void sh_sem_close()   { return; }
-int  sh_sem_wait(const char * wait)
-{
-  (void) wait;
-  fputs(_("Function not implemented (OS does not support SysV semaphores).\n"),
-	stderr);
-  exit(exit_err);
-}
-
-#endif /* defined(HAVE_SYS_SEM_H) && defined(HAVE_UNISTD_H) */
Index: trunk/src/sh_sig.c
===================================================================
--- trunk/src/sh_sig.c	(revision 591)
+++ 	(revision )
@@ -1,1789 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2000 Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-#if defined(WITH_SIG)
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#if defined(SH_WITH_SERVER)
-#include <pwd.h>
-#endif
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/wait.h>
-
-#include <string.h>
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-
-
-#if !defined(O_NONBLOCK)
-#if defined(O_NDELAY)
-#define O_NONBLOCK  O_NDELAY
-#else
-#define O_NONBLOCK  0
-#endif
-#endif
-
-
-#include "samhain.h"
-#include "sh_utils.h"
-#include "sh_error.h"
-#include "sh_tiger.h"
-#if defined(SH_WITH_SERVER)
-#define SH_NEED_PWD_GRP 1
-#include "sh_static.h"
-#endif
-#include "sh_sig.h"
-
-int get_the_fd(SL_TICKET file_1);
-
-#if defined(WITH_GPG)
-static struct {
-  char     conf_id[SH_MINIBUF+1];
-  char     conf_fp[SH_MINIBUF+1];
-  char     data_id[SH_MINIBUF+1];
-  char     data_fp[SH_MINIBUF+1];
-} gp;
-#endif
-
-typedef struct {
-  pid_t    pid;
-  FILE   * pipe;
-} sh_gpg_popen_t;
-
-#define SH_SIG_OK      0
-#define SH_SIG_BAD     1
-#define SH_SIG_BADSIGN 2
-
-/* replace #if 0 by #if 1 and set an appropriate path in front of '/pdbg.'
- * for debugging
- */
-#if 0
-#define PDGBFILE "/pdbg."
-#endif
-
-#if defined(PDGBFILE)
-FILE * pdbg;
-FILE * pdbgc;
-#define PDBG_OPEN    pdbg = fopen(PDGBFILE"main",  "a")  
-#define PDBG_CLOSE   sl_fclose (FIL__, __LINE__, pdbg)
-#define PDBG(arg)    fprintf(pdbg,  "PDBG: step %d\n", arg); fflush(pdbg)
-#define PDBG_D(arg)  fprintf(pdbg,  "PDBG: %d\n", arg); fflush(pdbg)
-#define PDBG_S(arg)  fprintf(pdbg,  "PDBG: %s\n", arg); fflush(pdbg)
-
-#define PDBGC_OPEN   pdbgc = fopen(PDGBFILE"child", "a")  
-#define PDBGC_CLOSE  sl_fclose (FIL__, __LINE__, pdbgc)
-#define PDBGC(arg)   fprintf(pdbgc, "PDBG: step %d\n", arg); fflush(pdbgc)
-#define PDBGC_D(arg) fprintf(pdbgc, "PDBG: %d\n", arg); fflush(pdbgc)
-#define PDBGC_S(arg) fprintf(pdbgc, "PDBG: %s\n", arg); fflush(pdbgc)
-#else
-#define PDBG_OPEN    
-#define PDBG_CLOSE   
-#define PDBG(arg)    
-#define PDBG_D(arg)  
-#define PDBG_S(arg)  
-#define PDBGC_OPEN    
-#define PDBGC_CLOSE   
-#define PDBGC(arg)    
-#define PDBGC_D(arg)  
-#define PDBGC_S(arg)  
-#endif
-
-#undef  FIL__
-#define FIL__  _("sh_sig.c")
-
-#if defined(SIG_HASH) || defined(SIG_KEY_HASH)
-
-typedef enum { SIG_HASH_REPORT, SIG_HASH_REPORTFULL, SIG_HASH_OTHER } checksum_flag;
-
-static int sh_sig_checksum (SL_TICKET checkfd, checksum_flag flag, const char * expected_in, const char * path)
-{
-  char * test_sig;
-  char * expected = NULL;
-  char * test_ptr1 = NULL;
-  char * test_ptr2 = NULL;
-  char   wstrip1[128];
-  char   wstrip2[128];
-  int    i, k;
-#include "sh_sig_chksum.h"
-
-  SL_ENTER(_("sh_sig_checksum"));
-
-  
-  if (flag == SIG_HASH_OTHER)
-    expected = sh_util_strdup(expected_in);
-  
-  if (flag == SIG_HASH_OTHER)
-    test_sig = sh_tiger_hash_gpg (path, checkfd, TIGER_NOLIM);
-  else
-    test_sig = sh_tiger_hash_gpg (DEFAULT_SIG_PATH, checkfd, TIGER_NOLIM);
-  
-  test_ptr1 = (flag == SIG_HASH_OTHER) ? strchr(expected, ':') : strchr(SIG_HASH, ':');
-  if (test_ptr1 != NULL)
-    test_ptr1 += 2;
-  else
-    test_ptr1 = (flag == SIG_HASH_OTHER) ? expected : SIG_HASH;
-
-  if (test_sig != NULL)
-    test_ptr2 = strchr(test_sig, ':');
-  if (test_ptr2 != NULL)
-    test_ptr2 += 2;
-  else
-    test_ptr2 = test_sig;
-
-  /* Tue Jun 24 23:11:54 CEST 2003 (1.7.9) -- strip whitespace
-   */
-  k = 0;
-  for (i = 0; i < 127; ++i)
-    {
-      if (test_ptr1[i] == '\0')
-	break;
-      if (test_ptr1[i] != ' ')
-	{
-	  wstrip1[k] = test_ptr1[i];
-	  ++k;
-	}
-    }
-  wstrip1[k] = '\0';
-
-  if (flag != SIG_HASH_OTHER)
-    {
-      for(i = 0; i < KEY_LEN; ++i)
-	{
-	  if (sigchk[i] != wstrip1[i]) 
-	    {
-	      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, MSG_E_GPG_CHK, 
-			      sigchk, wstrip1);
-	      break;
-	    }
-	}
-    }
-
-  k = 0;
-  if (test_ptr2)
-    {
-      for (i = 0; i < 127; ++i)
-	{
-	  if (test_ptr2[i] == '\0')
-	    break;
-	  if (test_ptr2[i] != ' ')
-	    {
-	      wstrip2[k] = test_ptr2[i];
-	      ++k;
-	    }
-	}
-    }
-  wstrip2[k] = '\0';
-
-  if (0 != sl_strncmp(wstrip1, wstrip2, 127))
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<sig checksum: %s>\n"), test_sig));
-      TPT(((0), FIL__, __LINE__, _("msg=<compiled in : %s>\n"), (flag == SIG_HASH_OTHER) ? expected : SIG_HASH));
-      TPT(((0), FIL__, __LINE__, _("msg=<wstrip1     : %s>\n"), wstrip1));
-      TPT(((0), FIL__, __LINE__, _("msg=<wstrip2     : %s>\n"), wstrip2));
-      if (flag == SIG_HASH_REPORTFULL)
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_GPG, 
-			SIG_HASH, test_sig);
-      if (flag == SIG_HASH_OTHER)
-	dlog(1, FIL__, __LINE__, _("The compiled-in checksum of the public key %s\n(%s)\ndoes not match the actual checksum\n(%s).\nYou need to recompile with the correct checksum."), path, wstrip1, wstrip2);
-      else
-	dlog(1, FIL__, __LINE__, _("The compiled-in checksum of the signature checking binary %s\n(%s)\ndoes not match the actual checksum\n(%s).\nYou need to recompile with the correct checksum."), DEFAULT_SIG_PATH, wstrip1, wstrip2);
-      SH_FREE(test_sig);
-      if (expected)
-	SH_FREE(expected);
-      SL_RETURN((-1), _("sh_sig_checksum"));
-    }
-  SH_FREE(test_sig);
-  if (expected)
-    SH_FREE(expected);
-  SL_RETURN( (0), _("sh_sig_checksum"));
-}
-#endif
-
-struct startup_info {
-  long   line;
-  char * program;
-  long   uid;
-  char * path;
-  char * key_uid;
-  char * key_id;
-};
-
-static struct startup_info startInfo = { 0, NULL, 0, NULL, NULL, NULL };
-
-static void sh_sig_fill_startup (long line, char * program, long uid, char * path, 
-				 char * key_uid, char * key_id)
-{
-  startInfo.line    = line;
-  startInfo.program = sh_util_strdup(program);
-  startInfo.uid     = uid;
-  startInfo.path    = sh_util_strdup(path);
-  if (key_uid)
-    startInfo.key_uid = sh_util_strdup(key_uid);
-  else
-    startInfo.key_uid = sh_util_strdup(_("(not given)"));
-  if (key_id)
-    startInfo.key_id  = sh_util_strdup(key_id);
-  else
-    startInfo.key_id  = sh_util_strdup(_("(not given)"));
-  return;
-}
-
-typedef enum { SIG_DATASIG, SIG_DATAONLY } extractlevel;
-
-
-static FILE * sh_sig_popen (char *const argv[], sh_gpg_popen_t  *source, int fd);
-
-
-static FILE * sh_sig_popen (char *const arg[], sh_gpg_popen_t  *source, int fd)
-{
-  size_t len;
-  extern int flag_err_debug;
-  int pipedes[2];
-  FILE * outf = NULL;
-  char * envp[2];
-
-#if defined(HAVE_SIG_CHECKSUM)
-  SL_TICKET   checkfd = -1;
-  int         myrand;
-  int         i;
-#if defined(__linux__)
-  int         get_the_fd(SL_TICKET);
-  char        pname[128];
-  int         pfd;
-  int         val_return;
-#endif
-#endif
-
-  SL_ENTER(_("sh_sig_popen"));
-
-  /* use homedir of effective user
-   */
-  len = sl_strlen(sh.effective.home) + 6;
-  envp[0] = calloc(1, len); /* free() ok   */
-  if (envp[0] != NULL)
-	sl_snprintf (envp[0], len, _("HOME=%s"), sh.effective.home); 
-  envp[1] = NULL;
-
-  /* Create the pipe 
-   */
-  if (aud_pipe(FIL__, __LINE__, pipedes) < 0) 
-    {
-      if (envp[0] != NULL) 
-	free(envp[0]);
-      SL_RETURN( (NULL), _("sh_gpg_popen"));
-    }
-
-  fflush (NULL);
-  
-  source->pid = aud_fork(FIL__, __LINE__);
-  
-  /* Failure
-   */
-  if (source->pid == (pid_t) - 1) 
-    {
-      sl_close_fd(FIL__, __LINE__, pipedes[0]);
-      sl_close_fd(FIL__, __LINE__, pipedes[1]);
-      if (envp[0] != NULL) 
-	free(envp[0]);
-      SL_RETURN( (NULL), _("sh_sig_popen"));
-    }
-
-  if (source->pid == (pid_t) 0) 
-    {
-
-      /* child - make read side of the pipe stdout 
-       */
-      if (retry_aud_dup2(FIL__, __LINE__,
-			pipedes[STDOUT_FILENO], STDOUT_FILENO) < 0)
-	{
-	  TPT(((0), FIL__, __LINE__, _("msg=<dup2 on pipe failed>\n")));
-	  dlog(1, FIL__, __LINE__, _("Internal error: dup2 failed\n"));
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-      
-      /* close the pipe descriptors 
-       */
-      sl_close_fd (FIL__, __LINE__, pipedes[STDIN_FILENO]);
-      sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-      
-      if (retry_aud_dup2(FIL__, __LINE__, fd, STDIN_FILENO) < 0)
-	{
-	  TPT(((0), FIL__, __LINE__, _("msg=<dup2 on fd failed>\n")));
-	  dlog(1, FIL__, __LINE__, _("Internal error: dup2 failed\n"));
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
- 
-      /* don't leak file descriptors
-       */
-      sh_unix_closeall (3, -1, S_TRUE); /* in child process */
-
-      if (flag_err_debug != S_TRUE)
-	{
-	  if (NULL == freopen(_("/dev/null"), "r+", stderr))
-	    {
-	      dlog(1, FIL__, __LINE__, _("Internal error: freopen failed\n"));
-	      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	    }
-	}
-
-
-      /* We should become privileged if SUID,
-       * to be able to read the keyring.
-       * We have checked that gpg is OK,
-       * AND that only a trusted user could overwrite
-       * gpg.
-       */
-      memset (skey, 0, sizeof(sh_key_t));
-      aud_setuid(FIL__, __LINE__, geteuid());
-      
-      PDBGC_OPEN;
-      PDBGC_D((int)getuid());
-      PDBGC_D((int)geteuid());
-
-      {
-	int i = 0;
-	while (arg[i] != NULL)
-	  {
-	    PDBGC_S(arg[i]);
-	    ++i;
-	  }
-      }
-      PDBGC_CLOSE;
-
-      /* exec the program */
-
-#if defined(__linux__) && defined(HAVE_SIG_CHECKSUM)
-      /* 
-       * --  emulate an fexecve with checksum testing
-       */
-      checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_SIG_PATH, SL_NOPRIV);
-
-      if (0 != sh_sig_checksum(checkfd, SIG_HASH_REPORT, NULL, NULL))
-	{
-	  sl_close(checkfd);
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-
-      pfd = get_the_fd(checkfd);
-      do {
-	val_return = dup (pfd);
-      } while (val_return < 0 && errno == EINTR);
-      pfd = val_return;
-      sl_close(checkfd);
-      /* checkfd = -1; *//* never read */
-
-      sl_snprintf(pname, sizeof(pname), _("/proc/self/fd/%d"), pfd);
-      if (0 == access(pname, R_OK|X_OK))               /* flawfinder: ignore */
-
-	{
-	  fcntl  (pfd, F_SETFD, FD_CLOEXEC);
-	  retry_aud_execve (FIL__, __LINE__,  pname, arg, envp);
-	      
-	  dlog(1, FIL__, __LINE__, _("Unexpected error: execve %s failed\n"),
-	       pname);
-	  /* failed 
-	   */
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-	  
-      /* procfs not working, go ahead 
-       */
-#endif
-
-#if defined(HAVE_SIG_CHECKSUM)
-      /* This is an incredibly ugly kludge to prevent an attacker
-       * from knowing when it is safe to slip in a fake executable
-       * between the integrity check and the execve
-       */
-      myrand = (int) taus_get ();
-
-      myrand = (myrand < 0) ? (-myrand) : myrand;
-      myrand = (myrand % 32) + 2;
-
-      for (i = 0; i < myrand; ++i)
-	{
-	  checkfd = sl_open_fastread(FIL__, __LINE__, 
-				     DEFAULT_SIG_PATH, SL_NOPRIV);
-
-	  if (0 != sh_sig_checksum(checkfd, SIG_HASH_REPORT, NULL, NULL)) {
-	    aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	  }
-	  sl_close(checkfd);
-	}
-#endif
-
-      retry_aud_execve (FIL__, __LINE__, DEFAULT_SIG_PATH, arg, envp);
-      dlog(1, FIL__, __LINE__, _("Unexpected error: execve %s failed\n"),
-	   DEFAULT_SIG_PATH);
-      
-      /* failed 
-       */
-      TPT(((0), FIL__, __LINE__, _("msg=<execve failed>\n")));
-      dlog(1, FIL__, __LINE__, _("Unexpected error: execve failed\n"));
-      aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  /* parent
-   */
-
-  if (envp[0] != NULL) 
-    free(envp[0]);
-
-  sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-  retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFD, FD_CLOEXEC);
-  retry_fcntl (FIL__, __LINE__, pipedes[STDIN_FILENO], F_SETFL,  O_NONBLOCK);
-
-  outf = fdopen (pipedes[STDIN_FILENO], "r");
-  
-  if (outf == NULL) 
-    {
-      aud_kill (FIL__, __LINE__, source->pid, SIGKILL);
-      sl_close_fd (FIL__, __LINE__, pipedes[STDOUT_FILENO]);
-      waitpid (source->pid, NULL, 0);
-      source->pid = 0;
-      SL_RETURN( (NULL), _("sh_sig_popen"));
-    }
-  
-  SL_RETURN( (outf), _("sh_sig_popen"));
-}
-
-
-static int sh_sig_pclose (sh_gpg_popen_t *source)
-{
-  int status = 0;
-  
-  SL_ENTER(_("sh_sig_pclose"));
-
-  status = sl_fclose(FIL__, __LINE__, source->pipe);
-  if (status)
-    SL_RETURN( (-1), _("sh_sig_pclose"));
-  
-  if (waitpid(source->pid, NULL, 0) != source->pid)
-    status = -1;
-  
-  source->pipe = NULL;
-  source->pid = 0;
-  SL_RETURN( (status), _("sh_sig_pclose"));
-}
-
-/* This is signify specific stuff 
- */
-#if defined(WITH_SIGNIFY)
-
-#include <ctype.h>
-
-static
-int sh_signify_comp_comm(const char * line, size_t * commlen)
-{
-  /* check for a valid comment line: not exceeding 1023 chars and 
-   * starting with 'untrusted comment: ' */
-  static char   cmp[SH_MINIBUF];
-  static size_t cmp_len = 0;
-
-  size_t len = sl_strlen(line);
-  
-  if (cmp_len == 0) {
-    sl_strlcpy(cmp, _("untrusted comment: "), sizeof(cmp));
-    cmp_len = strlen(cmp);
-  }
-
-  if (line[len-1] == '\n') {
-    /* signify will replace the '\n' with '\0', so 1024 -> 1023, which fits */
-    if (len > 1024) return S_FALSE;
-    else            *commlen = len;
-  } else {
-    if (len > 1023) return S_FALSE;
-    else            *commlen = (len+1);
-  }
-
-  if (len >= cmp_len && 0 == strncmp(cmp, line, cmp_len))
-    return S_TRUE;
-  return S_FALSE;
-}
-
-static const char bto64_0[] = N_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
-static char bto64[65] = { '\0' };
-
-static
-int sh_signify_comp_sig(const char * line, size_t commlen)
-{
-  char   cmp[128];
-  char   out[128];
-  size_t len = sl_strlen(line);
-  size_t i, j = 0;
-  int padf = 0;
-
-  if (bto64[0] == '\0')
-    memcpy(bto64, _(bto64_0), 65);
-  
-  if (line[len-1] == '\n') {
-    if ((len+commlen) > 2047) return S_FALSE;
-  } else {
-    if ((len+commlen) > 2046) return S_FALSE;
-  }
-
-  for (i = 0; i < len; ++i)
-    {
-      if (isspace(line[i])) {
-	/* signify will skip arbitrary space, using isspace() */
-	continue;
-      }
-      if (line[i] == '=') {
-	if (padf > 1) /* more than two padding '=' */
-	  return S_FALSE;
-	else
-	  ++padf;
-      } else if (!strchr(bto64, line[i]) || (line[i] == '=' && padf > 0)) {
-	return S_FALSE;
-      }
-      if (j < sizeof(cmp)) {
-	  cmp[j] = line[i]; ++j;
-      }
-    }
-
-  /* signature is 'Ed' + 8 byte random + 64 bytes = 74 bytes
-   * => 1 pad byte => 75 bytes => 100 b64 bytes */
-  if (j != 100 || padf != 1)
-    return S_FALSE;
-  
-  cmp[j] = '\0'; /* j == 100 */
-  sh_util_base64_dec((unsigned char *) out, (unsigned char *) cmp, j);
-  if(out[0] == 'E' && out[1] == 'd')
-    return S_TRUE;
-  
-  return S_FALSE;
-}
-static
-int sh_signify_msg_start(const char * line)
-{
-  static int  step = 0;
-  static size_t commlen = 0;
-
-  if (step == 0) {
-    if (S_TRUE == sh_signify_comp_comm(line, &commlen))
-      ++step;
-  }
-  else if (step == 1) {
-    if (S_TRUE == sh_signify_comp_sig(line, commlen)) {
-      ++step;
-    }
-    else {
-      step = 0; commlen = 0;
-    }
-  }
-  else if (step == 2) {
-    step = 0; commlen = 0;
-    return S_TRUE;
-  }
-  return S_FALSE;
-}
-
-static
-int sh_signify_msg_startdata(const char * line)
-{
-  (void) line;
-  return S_TRUE;
-}
- 
-static
-int sh_signify_msg_end(const char * line)
-{
-  if (line[0] != '\0')
-    return S_FALSE;
-  return S_TRUE;
-}
-
-static
-int sh_signify_data_end(const char * line)
-{
-  if (line[0] == '[' && line[1] == 'E' && line[2] == 'O' &&
-      line[3] == 'F' && line[4] == ']')
-    return S_TRUE;
-  else if (line[0] != '\0')
-    return S_FALSE;
-  return S_TRUE;
-}
-
-static
-SL_TICKET sh_signify_extract_signed(SL_TICKET fd, extractlevel extract_level)
-{
-  const  int fgets_buf_size = 16384;
-  FILE * fin_cp = NULL;
-  char * buf    = NULL;
-  int    bufc;
-  char * comment = NULL;
-  size_t commlen = 0;
-  
-  int    flag_comm = S_FALSE;
-  int    flag_sig  = S_FALSE;
-  SL_TICKET fdTmp  = (-1);
-  SL_TICKET open_tmp (void);
-
-  /* extract the data and copy to temporary file
-   */
-  fdTmp = open_tmp();
-  if (SL_ISERROR(fdTmp))
-    {
-      dlog(1, FIL__, __LINE__, _("Error opening temporary file.\n")); 
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Error opening temporary file."), 
-		      _("sh_signify_extract_signed"));
-      return -1;
-    }
-
-  fin_cp = fdopen(dup(get_the_fd(fd)), "rb");
-  buf = SH_ALLOC(fgets_buf_size);
-
-  while (NULL != fgets(buf, fgets_buf_size, fin_cp))
-    {
-      
-      bufc = 0; 
-      while (bufc < fgets_buf_size) { 
-	if (buf[bufc] == '\n') { ++bufc; break; }
-	++bufc;
-      }
-
-      if (flag_comm == S_FALSE)
-	{
-	  if (sh_signify_comp_comm(buf, &commlen) == S_TRUE)
-	    {
-	      flag_comm = S_TRUE;
-	      if (extract_level == SIG_DATASIG)
-		{
-		  comment = sh_util_strdup(buf);
-		  commlen = bufc;
-		}
-	    }
-	  continue;
-	}
-      else if (flag_comm == S_TRUE && flag_sig == S_FALSE)
-	{
-	  if (sh_signify_comp_sig(buf, commlen) == S_TRUE)
-	    {
-	      flag_sig = S_TRUE;
-	      if (extract_level == SIG_DATASIG)
-		{
-		  sl_write(fdTmp, comment, commlen);
-		  sl_write(fdTmp, buf, bufc);
-		}
-	      if (comment != NULL)
-		SH_FREE(comment);
-	      comment = NULL;
-	    }
-	  else
-	    {
-	      if (comment != NULL)
-		SH_FREE(comment);
-	      comment = NULL; commlen = 0; flag_comm = 0;
-	    }
-	  continue;
-	}
-      
-      if (flag_sig == S_TRUE)
-	{
-	  sl_write(fdTmp, buf, bufc); 
-	}
-    }
-  if (comment != NULL)
-    SH_FREE(comment);
-  sl_fclose(FIL__, __LINE__, fin_cp);
-  sl_rewind (fdTmp);
-
-#if defined(SH_DEBUG_SIGNIFY)
-  fin_cp = fdopen(dup(get_the_fd(fdTmp)), "rb");
-  FILE * fout = fopen("xxx.out", "w+");
-  while (NULL != fgets(buf, fgets_buf_size, fin_cp))
-    {
-      fputs(buf, fout);
-    }
-  fclose(fout);
-  sl_rewind(fdTmp);
-#endif
-  
-  SH_FREE(buf);
-  return fdTmp;
-}
-
-
-static FILE * sh_signify_popen (sh_gpg_popen_t  *source, int fd, char * homedir)
-{
-  char   path[256];
-  char   cc1[32];
-  char   cc2[32];
-  char   cc3[32];
-  char   cc4[SH_PATHBUF+32];
-  char   cc5[32];
-  char   cc6[32];
-  char * argv[9];
-  FILE * retval = NULL;
-
-  struct stat lbuf;
-  int         status_stat = 0;
-
-#ifdef HAVE_SIG_KEY_HASH
-  SL_TICKET checkfd;
-#endif
-
-
-  SL_ENTER(_("sh_signify_popen"));
-
-  sl_strlcpy (path,  DEFAULT_SIG_PATH,  256);
-
-  sl_strlcpy (cc1,   _("-Vem"),         32);
-  sl_strlcpy (cc2,   _("/dev/null"),    32);
-
-  sl_strlcpy (cc3,   _("-p"),           32);
-  sl_strlcpy (cc4,   homedir,           SH_PATHBUF+32);
-  sl_strlcat (cc4,   _("/.signify/"),   SH_PATHBUF+32);
-  sl_strlcat (cc4,   SH_INSTALL_NAME,   SH_PATHBUF+32);
-  sl_strlcat (cc4,   _(".pub"),         SH_PATHBUF+32);
-
-  /* read signed message from stdin */
-  sl_strlcpy (cc5,   _("-x"),           32);
-  sl_strlcpy (cc6,   _("-"),            32);
-
-  status_stat =  retry_lstat(FIL__, __LINE__, cc4, &lbuf);
-  if (status_stat == -1)
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("Signify public key %s\ndoes not exist or is not accessible.\nPlease add the directory and put the key there\nto allow signature verification.\n"),
-	   cc4);
-      sh_error_handle((-1), FIL__, __LINE__, status_stat, MSG_EXIT_ABORT1, 
-		      sh.prg_name);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
-#ifdef HAVE_SIG_KEY_HASH
-  checkfd = sl_open_read(FIL__, __LINE__, cc4, SL_YESPRIV);
-
-  if (0 != sh_sig_checksum(checkfd, SIG_HASH_OTHER, SIG_KEY_HASH, cc4))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checksum mismatch for signify public key"), 
-		      _("signify_popen"));
-      sl_close(checkfd);
-      sh_error_handle((-1), FIL__, __LINE__, status_stat, MSG_EXIT_ABORT1, 
-		      sh.prg_name);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
-  sl_close(checkfd);
-#endif
- 
-  argv[0] = path; 
-  argv[1] = cc1;
-  argv[2] = cc2;
-  argv[3] = cc3;
-  argv[4] = cc4;
-  argv[5] = cc5;
-  argv[6] = cc6;
-  argv[7] = NULL;
-
-  retval = sh_sig_popen(argv, source, fd);
-  SL_RETURN((retval), _("sh_signify_popen")); 
-}
-
-static
-int sh_signify_check_file_sign(int fd, char * homedir)
-{
-  struct stat buf;
-  char line[256];
-  sh_gpg_popen_t  source;
-  int status = 0;
-  unsigned int n_goodsig  = 0;
-  unsigned int n_lines    = 0;
-  
-#ifdef HAVE_SIG_CHECKSUM
-  SL_TICKET checkfd;
-#endif
-
-  SL_ENTER(_("sh_signify_check_file_sign"));
-
-  /* check whether signify exists and has the correct checksum
-   */
-  TPT(((0), FIL__, __LINE__, _("msg=<Check signature>\n")));
-  TPT(((0), FIL__, __LINE__, _("msg=<signify is %s>\n"), DEFAULT_SIG_PATH));
-
-  if (0 != retry_lstat(FIL__, __LINE__, DEFAULT_SIG_PATH, &buf))
-    {
-      char errbuf[SH_ERRBUF_SIZE];
-
-      status = errno;
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_ERR_LSTAT,
-		      sh_error_message(status, errbuf, sizeof(errbuf)), DEFAULT_SIG_PATH);
-      SL_RETURN( SH_SIG_BAD, _("sh_signify_check_file_sign"));
-    }
-
-  if (0 != tf_trust_check (DEFAULT_SIG_PATH, SL_YESPRIV))
-    SL_RETURN( SH_SIG_BAD, _("sh_signify_check_file_sign"));
-
-#ifdef HAVE_SIG_CHECKSUM
-  checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_SIG_PATH, SL_YESPRIV);
-
-  if (0 != sh_sig_checksum(checkfd, SIG_HASH_REPORTFULL, NULL, NULL))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checksum mismatch"), 
-		      _("signify_check_file_sign"));
-      sl_close(checkfd);
-      SL_RETURN( SH_SIG_BAD, _("sh_signify_check_file_sign"));
-    }
-  sl_close(checkfd);
-#endif
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe to check signature>\n")));
-
-  fflush(NULL);
- 
-  source.pipe   = sh_signify_popen  ( &source, fd, homedir );
-
-  if (NULL == source.pipe)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Could not open pipe"), 
-		      _("signify_check_file_sign"));
-      SL_RETURN( SH_SIG_BAD, _("sh_signify_check_file_sign"));
-    }
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe success>\n")));
-
- xagain:
-
-  errno = 0;
-
-  while (NULL != fgets(line, sizeof(line), source.pipe))
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<signify out: %s>\n"), line));
-      if (line[strlen(line)-1] == '\n')
-	line[strlen(line)-1] = ' ';
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      line, 
-		      _("signify_check_file_sign"));
-
-      ++n_lines;
-
-      /* the '\n' has been replaced with ' ' for logging */ 
-      if (0 == sl_strcmp(_("Signature Verified "), line))
-	{
-	  ++n_goodsig;
-	} 
-    }
-
-  if (ferror(source.pipe) && errno == EAGAIN) 
-    {
-      /* sleep 10 ms to avoid starving the gpg child writing to the pipe */
-      retry_msleep(0,10); 
-      clearerr(source.pipe);
-      goto xagain;
-    }
- 
-  if (0 != sh_sig_pclose (&source))
-    {
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			_("Error on closing process pipe"), 
-			_("signify_check_file_sign"));
-	n_goodsig = 0;
-    }
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Close pipe>\n")));
-
-  if (n_goodsig == 1 && n_lines == 1)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<Signature Verified>\n")));
-      SL_RETURN( SH_SIG_OK, _("sh_signature_check_file_sign"));
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Error verifying file signature"), 
-		      _("signify_check_file_sign"));
-    }
-  SL_RETURN( SH_SIG_BADSIGN, _("sh_signature_check_file_sign"));
-}
-
-
-int sh_signify_check_signature (SL_TICKET file, ShSigFile what)
-{
-  int status = SH_SIG_BAD;
-  int fd = 0;
-
-  static int smsg = S_FALSE;
-
-  char  * homedir = sh.effective.home;
-  char  * home_alloc = NULL;
-#if defined(SH_WITH_SERVER)
-  struct passwd * tempres;
-#if defined(USE_GETPWNAM_R)
-  struct passwd    pwd;
-  char           * buffer = SH_ALLOC(SH_PWBUF_SIZE);
-#endif
-#endif
-
-  SL_ENTER(_("sh_signify_check_sign"));
-
-  (void) what;
-  
-  fd = get_the_fd(file);
-
-  if (fd < 0)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD = %d>\n"), fd));
-      dlog(1, FIL__, __LINE__, 
-	   _("This looks like an unexpected internal error.\n"));
-#if defined(SH_WITH_SERVER) && defined(USE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
-      SL_RETURN( (-1), _("sh_signify_check_sign"));
-    }
-  
-#if defined(SH_WITH_SERVER)
-#if defined(USE_GETPWNAM_R)
-  sh_getpwnam_r(DEFAULT_IDENT, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-  tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
-  if ((tempres != NULL) && (0 == sl_ret_euid()))
-    {
-      /* privileges not dropped yet*/
-      homedir = tempres->pw_dir;
-    }
-#endif
-
-  home_alloc = sh_util_strdup(homedir);
-  
-  TPT(((0), FIL__, __LINE__, _("msg=<SIGNIFY_CHECK: FD = %d>\n"), fd));
-  status = sh_signify_check_file_sign(fd, homedir);
-  
-  if (status != SH_SIG_OK) 
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<Status = %d>\n"), status));
-      dlog(1, FIL__, __LINE__, 
-	   _("The signature of the configuration file or the file signature database\ncould not be verified. Possible reasons are:\n - signify binary (%s) not found\n - invalid signature\n - there is no keyfile in %s/.signify/%s.pub, or\n - the file is not signed - did you move /filename.sig to /filename ?\nTo create a signed file, use (remove old signatures before):\n   signify|signify-openbsd -Se -s KEYNAME.sec -m FILE\n   mv FILE.sig FILE\n"),
-	   DEFAULT_SIG_PATH, home_alloc, SH_INSTALL_NAME);
-      SH_FREE(home_alloc);
-      SL_RETURN( (-1), _("sh_signify_check_sign"));
-    }
-
-  if (smsg == S_FALSE)
-    {
-      sh_sig_fill_startup (__LINE__,
-			   sh.prg_name, sh.real.uid,
-			   (sh.flag.hidefile == S_TRUE) ? 
-			   _("(hidden)") : file_path('C', 'R'), 
-			   NULL,  NULL);
-    }
-  smsg = S_TRUE;
-
-  SH_FREE(home_alloc);
-  SL_RETURN(0, _("sh_signify_check_sign"));
-}  
-
-/* This is GPG specific stuff 
- */
-#elif defined(WITH_GPG)
-static FILE * sh_gpg_popen (sh_gpg_popen_t  *source, int fd, char * homedir)
-{
-  char   path[256];
-  char   cc1[32];
-  char   cc2[32];
-
-  char   cc0[2] = "-";
-  char   cc3[32];
-  char   cc4[SH_PATHBUF+32];
-  char   cc5[32];
-  char * argv[9];
-  FILE * retval = NULL;
-
-
-  SL_ENTER(_("sh_gpg_popen"));
-
-  /* -- GnuPG -- */
-  sl_strlcpy (path,  DEFAULT_SIG_PATH,  256);
-  sl_strlcpy (cc1,   _("--status-fd"),  32);
-  sl_strlcpy (cc2,   _("--verify"),     32);
-  sl_strlcpy (cc3,   _("--homedir"),    32);
-  /* sl_strlcpy (cc4,   sh.effective.home, SH_PATHBUF+32); */
-  sl_strlcpy (cc4,   homedir,           SH_PATHBUF+32);
-  sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32);
-  sl_strlcpy (cc5,   _("--no-tty"),     32);
-
-#if defined(SH_WITH_SERVER)
-  if (0 == sl_ret_euid())   /* privileges not dropped yet */
-    {
-      struct stat lbuf;
-      int         status_stat = 0;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      struct passwd    pwd;
-      char          *  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-      struct passwd *  tempres;
-      sh_getpwnam_r(DEFAULT_IDENT, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-      struct passwd * tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
-
-      if (!tempres)
-	{
-	  dlog(1, FIL__, __LINE__, 
-	       _("User %s does not exist. Please add the user to your system.\n"), 
-	       DEFAULT_IDENT);
-	  status_stat = -1;
-	}
-      if (!tempres->pw_dir || tempres->pw_dir[0] == '\0')
-	{
-	  dlog(1, FIL__, __LINE__, 
-	       _("User %s does not have a home directory.\nPlease add the home directory for this user to your system.\n"), 
-	       DEFAULT_IDENT);
-	  status_stat = -2;
-	}
-      if (status_stat == 0)
-	{
-	  sl_strlcpy (cc4, tempres->pw_dir, SH_PATHBUF+32); 
-	  sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32); 
-	  status_stat =  retry_lstat(FIL__, __LINE__, cc4, &lbuf);
-	  if (status_stat == -1)
-	    {
-	      dlog(1, FIL__, __LINE__, 
-		   _("Gnupg directory %s for user %s\ndoes not exist or is not accessible.\nPlease add the directory and put the keyring (pubring.gpg or pubring.kbx) there\nto verify the configuration file.\n"),
-		   cc4, DEFAULT_IDENT);
-	      status_stat = -3;
-	    }
-	}
-      if (status_stat == 0 && lbuf.st_uid != tempres->pw_uid)
-	{
-	  dlog(1, FIL__, __LINE__, 
-	       _("Gnupg directory %s\nis not owned by user %s.\n"), 
-	       cc4, DEFAULT_IDENT);
-	  status_stat = -4;
-	}
-      if (status_stat == 0)
-	{
-	  char   cc4_test[SH_PATHBUF+32];
-
-	  sl_strlcpy(cc4_test, cc4, SH_PATHBUF+32);
-	  sl_strlcat (cc4_test,   _("/pubring.gpg"),      SH_PATHBUF+32); 
-
-	  status_stat =  retry_lstat(FIL__, __LINE__, cc4_test, &lbuf);
-	  if (status_stat == -1)
-	    {
-	      sl_strlcpy(cc4_test, cc4, SH_PATHBUF+32);
-	      sl_strlcat (cc4_test,   _("/pubring.kbx"),      SH_PATHBUF+32);
-
-	      status_stat =  retry_lstat(FIL__, __LINE__, cc4_test, &lbuf);
-	      if (status_stat == -1)
-		{
-		  sl_strlcpy(cc4_test, cc4, SH_PATHBUF+32);
-		  sl_strlcat (cc4_test,   _("/pubring.(gpg|kbx)"),      SH_PATHBUF+32);
-		  
-		  dlog(1, FIL__, __LINE__, 
-		       _("Gnupg public keyring %s for user %s\ndoes not exist or is not accessible.\nPlease add the directory and put the keyring (pubring.gpg or pubring.kbx) there\nto verify the configuration file.\n"),
-		       cc4_test, DEFAULT_IDENT);
-		  status_stat = -5;
-		}
-	    }
-	}
-      if (status_stat == 0 && lbuf.st_uid != tempres->pw_uid)
-	{
-	  dlog(1, FIL__, __LINE__, 
-	       _("Gnupg public keyring %s\nis not owned by user %s.\n"), 
-	       cc4, DEFAULT_IDENT);
-	  status_stat = -6;
-	}
-      if (status_stat != 0)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, status_stat, MSG_EXIT_ABORT1, 
-			  sh.prg_name);
-	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-	}
-      sl_strlcpy (cc4, tempres->pw_dir, SH_PATHBUF+32); 
-      sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32); 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
-    }
-#endif
-
-  argv[0] = path; 
-  argv[1] = cc1;
-  argv[2] = "1";
-  argv[3] = cc2;
-  argv[4] = cc3;
-  argv[5] = cc4;
-  argv[6] = cc5;
-  argv[7] = cc0;
-  argv[8] = NULL;
-
-  retval = sh_sig_popen(argv, source, fd);
-  SL_RETURN((retval), _("sh_gpg_popen")); 
-}
-
-static
-int sh_gpg_check_file_sign(int fd, char * sign_id, char * sign_fp, 
-			   char * homedir, ShSigFile whichfile)
-{
-  struct stat buf;
-  char line[256];
-  sh_gpg_popen_t  source;
-  int have_id = BAD, have_fp = BAD, status = 0;
-  unsigned int n_newsig   = 0;
-  unsigned int n_goodsig  = 0;
-  unsigned int n_validsig = 0;
-  
-#ifdef HAVE_SIG_CHECKSUM
-  SL_TICKET checkfd;
-#endif
-
-  SL_ENTER(_("sh_gpg_check_file_sign"));
-
-  /* check whether GnuPG exists and has the correct checksum
-   */
-  TPT(((0), FIL__, __LINE__, _("msg=<Check signature>\n")));
-  TPT(((0), FIL__, __LINE__, _("msg=<gpg is %s>\n"), DEFAULT_SIG_PATH));
-
-  if (0 != retry_lstat(FIL__, __LINE__, DEFAULT_SIG_PATH, &buf))
-    {
-      char errbuf[SH_ERRBUF_SIZE];
-
-      status = errno;
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_ERR_LSTAT,
-		      sh_error_message(status, errbuf, sizeof(errbuf)), DEFAULT_SIG_PATH);
-      SL_RETURN( SH_SIG_BAD, _("sh_gpg_check_file_sign"));
-    }
-
-  if (0 != tf_trust_check (DEFAULT_SIG_PATH, SL_YESPRIV))
-    SL_RETURN( SH_SIG_BAD, _("sh_gpg_check_file_sign"));
-
-#ifdef HAVE_SIG_CHECKSUM
-  checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_SIG_PATH, SL_YESPRIV);
-
-  if (0 != sh_sig_checksum(checkfd, SIG_HASH_REPORTFULL, NULL, NULL))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checksum mismatch"), 
-		      _("gpg_check_file_sign"));
-      sl_close(checkfd);
-      SL_RETURN( SH_SIG_BAD, _("sh_gpg_check_file_sign"));
-    }
-  sl_close(checkfd);
-#endif
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe to check signature>\n")));
-
-  fflush(NULL);
- 
-  source.pipe   = sh_gpg_popen  ( &source, fd, homedir );
-
-  if (NULL == source.pipe)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Could not open pipe"), 
-		      _("gpg_check_file_sign"));
-      SL_RETURN( SH_SIG_BAD, _("sh_gpg_check_file_sign"));
-    }
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Open pipe success>\n")));
-
- xagain:
-
-  errno = 0;
-
-  while (NULL != fgets(line, sizeof(line), source.pipe))
-    {
-
-      TPT(((0), FIL__, __LINE__, _("msg=<gpg out: %s>\n"), line));
-      if (line[strlen(line)-1] == '\n')
-	line[strlen(line)-1] = ' ';
-      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      line, 
-		      _("gpg_check_file_sign"));
-
-      if (sl_strlen(line) < 12) 
-	continue;
-
-      /* Sun May 27 18:40:05 CEST 2001
-       */
-      if (0 == sl_strncmp(_("BADSIG"),     &line[9], 6) ||
-	  0 == sl_strncmp(_("ERRSIG"),     &line[9], 6) ||
-	  0 == sl_strncmp(_("NO_PUBKEY"),  &line[9], 6) ||
-	  0 == sl_strncmp(_("NODATA"),     &line[9], 6) ||
-	  0 == sl_strncmp(_("ERROR"),      &line[9], 5) ||
-	  0 == sl_strncmp(_("SIGEXPIRED"), &line[9], 6))
-	{
-	  if      (0 == sl_strncmp(_("BADSIG"), &line[9], 6)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is signed, but the signature is invalid."),
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")));
-	  } 
-	  else if (0 == sl_strncmp(_("NO_PUBKEY"), &line[9], 6)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is signed, but the public key to verify the signature is not in my keyring %s/.gnupg/pubring.asc."), 
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")),
-		 homedir);
-	  }
-	  else if (0 == sl_strncmp(_("ERRSIG"), &line[9], 6)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is signed, but the public key to verify the signature is not in my keyring %s/.gnupg/pubring.asc."), 
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")),
-		 homedir);
-	  }
-	  else if (0 == sl_strncmp(_("SIGEXPIRED"), &line[9], 6)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is signed, but the public key to verify the signature has expired."), 
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")));
-	  }
-	  else if (0 == sl_strncmp(_("NODATA"), &line[9], 6)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is not signed."), 
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")));
-	  }
-	  else if (0 == sl_strncmp(_("ERROR"), &line[9], 5)) {
-	    dlog(1, FIL__, __LINE__, 
-		 _("%s file is not correctly signed. An error occured while verifying the signature."), 
-		 ((whichfile == SIG_CONF) ? _("Configuration") : _("Database")));
-	  }
-
-	  have_fp = BAD; have_id = BAD;
-	  break;
-	}
-      if (0 == sl_strncmp(_("GOODSIG"), &line[9], 7))
-	{
-	  ++n_goodsig;
-	  sl_strlcpy (sign_id, &line[25], SH_MINIBUF+1);
-	  if (sign_id)
-	    sign_id[sl_strlen(sign_id)-1] = '\0';  /* remove trailing '"' */
-	  have_id = GOOD;
-	} 
-      else if (0 == sl_strncmp(_("VALIDSIG"), &line[9], 8))
-	{
-	  ++n_validsig;
-	  strncpy (sign_fp, &line[18], 40);
-	  sign_fp[40] = '\0';
-	  have_fp = GOOD;
-	}
-      else if (0 == sl_strncmp(_("NEWSIG"), &line[9], 6))
-	{
-	  ++n_newsig;
-	}
-      
-    }
-
-  if (ferror(source.pipe) && errno == EAGAIN) 
-    {
-      /* sleep 10 ms to avoid starving the gpg child writing to the pipe */
-      retry_msleep(0,10); 
-      clearerr(source.pipe);
-      goto xagain;
-    }
- 
-  if (0 != sh_sig_pclose (&source))
-    {
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			_("Error on closing process pipe"), 
-			_("gpg_check_file_sign"));
-	have_id = BAD;
-    }
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Close pipe>\n")));
-
-  if (n_goodsig != n_validsig || n_newsig > 1 || n_goodsig > 1)
-    {
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			_("Too many or invalid signatures"), 
-			_("gpg_check_file_sign"));
-	have_id = BAD;
-    }
-  
-  if (have_id == GOOD)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<Got signator ID>\n")));
-    }
-  if (have_fp == GOOD)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<Got fingerprint>\n")));
-    }
-
-  if (have_id == GOOD && have_fp == GOOD)
-    SL_RETURN( SH_SIG_OK, _("sh_gpg_check_file_sign"));
-  else
-    {
-      if (have_id == BAD)
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			_("No good signature"), 
-			_("gpg_check_file_sign"));
-      else
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-			_("No fingerprint for key"), 
-			_("gpg_check_file_sign"));
-      SL_RETURN( SH_SIG_BADSIGN, _("sh_gpg_check_file_sign"));
-    }
-}
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && \
-  defined(HAVE_GETPWNAM_R)
-#define USE_GETPWNAM_R 1
-#endif
-
-static
-int sh_gpg_check_signature (SL_TICKET file, ShSigFile what)
-{
-  int status = SH_SIG_BAD;
-  int fd = 0;
-
-  static int smsg = S_FALSE;
-  char  * tmp;
-
-  char  * sig_id;
-  char  * sig_fp;
-
-  char  * homedir = sh.effective.home;
-#if defined(SH_WITH_SERVER)
-  struct passwd * tempres;
-#if defined(USE_GETPWNAM_R)
-  struct passwd    pwd;
-  char           * buffer = SH_ALLOC(SH_PWBUF_SIZE);
-#endif
-#endif
-
-#ifdef USE_FINGERPRINT
-#include "sh_gpg_fp.h"
-#endif
-
-  SL_ENTER(_("sh_gpg_check_sign"));
-
-
-  if (what == SIG_CONF)
-    fd = get_the_fd(file);
-  if (what == SIG_DATA)
-    fd = get_the_fd(file);
-
-
-  if (fd < 0)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD = %d>\n"), fd));
-      dlog(1, FIL__, __LINE__, 
-	   _("This looks like an unexpected internal error.\n"));
-#if defined(SH_WITH_SERVER) && defined(USE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
-      SL_RETURN( (-1), _("sh_gpg_check_sign"));
-    }
-  
-#if defined(SH_WITH_SERVER)
-#if defined(USE_GETPWNAM_R)
-      sh_getpwnam_r(DEFAULT_IDENT, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-      tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
-      if ((tempres != NULL) && (0 == sl_ret_euid()))
-	{
-	  /* privileges not dropped yet*/
-	  homedir = tempres->pw_dir;
-	}
-#endif
-
-  if (what == SIG_CONF)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD = %d>\n"), fd));
-      status = sh_gpg_check_file_sign(fd, gp.conf_id, gp.conf_fp, homedir, SIG_CONF);
-      TPT(((0), FIL__, __LINE__, _("msg=<CONF SIGUSR: |%s|>\n"), gp.conf_id));
-      TPT(((0), FIL__, __LINE__, _("msg=<CONF SIGFP:  |%s|>\n"), gp.conf_fp));
-      sig_id =  gp.conf_id; sig_fp = gp.conf_fp;
-    }
-
-  if (what == SIG_DATA)
-    {
-      TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD = %d>\n"), fd));
-      status = sh_gpg_check_file_sign(fd, gp.data_id, gp.data_fp, homedir, SIG_DATA);
-      TPT(((0), FIL__, __LINE__, _("msg=<DATA SIGUSR: |%s|>\n"), gp.data_id));
-      TPT(((0), FIL__, __LINE__, _("msg=<DATA SIGFP:  |%s|>\n"), gp.data_fp));
-      sig_id =  gp.data_id; sig_fp = gp.data_fp;
-    }
-  
-  if (SH_SIG_OK == status)
-    {
-#ifdef USE_FINGERPRINT
-      if ((sl_strcmp(SH_GPG_FP, sig_fp) == 0))
-	{
-	  int i;
-
-	  for(i = 0; i < (int) sl_strlen(sig_fp); ++i) {
-	      if (gpgfp[i] != sig_fp[i]) {
-		sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-				MSG_E_GPG_FP, gpgfp, sig_fp);
-		break; }
-	  }
-
-	  if (smsg == S_FALSE) {
-	    tmp  = sh_util_safe_name(sig_id);
-	    sh_sig_fill_startup (__LINE__, sh.prg_name, sh.real.uid,
-				 (sh.flag.hidefile == S_TRUE) ? 
-				 _("(hidden)") : file_path('C', 'R'), 
-				 tmp, 
-				 sig_fp);
-	    SH_FREE(tmp); }
-	  smsg = S_TRUE;
-
-#if defined(SH_WITH_SERVER) && defined(USE_GETPWNAM_R)
-	  SH_FREE(buffer);
-#endif
-	  SL_RETURN(0, _("sh_gpg_check_sign"));
-	}
-      else
-	{
-	  /* fp mismatch */
-	  dlog(1, FIL__, __LINE__, 
-	       _("The fingerprint of the signing key: %s\ndoes not match the compiled-in fingerprint: %s.\nTherefore the signature could not be verified.\n"), 
-	       sig_fp, SH_GPG_FP);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Fingerprint mismatch"), _("gpg_check_sign"));
-	  status = SH_SIG_BADSIGN;
-	}
-#else /* ifdef USE_FINGERPRINT */
-      if (smsg == S_FALSE)
-	{
-	  tmp = sh_util_safe_name(sig_id);
-	  sh_sig_fill_startup (__LINE__,
-			       sh.prg_name, sh.real.uid,
-			       (sh.flag.hidefile == S_TRUE) ? 
-			       _("(hidden)") : file_path('C', 'R'), 
-			       tmp,  sig_fp);
-	  SH_FREE(tmp);
-	}
-      smsg = S_TRUE;
-
-#if defined(SH_WITH_SERVER) && defined(USE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
-
-      /* status == OK and no fp checking */
-      SL_RETURN(0, _("sh_gpg_check_sign"));
-#endif /* !ifdef USE_FINGERPRINT */
-    }
-
-  if (status != SH_SIG_OK) 
-    {
-      uid_t   e_uid  = sl_ret_euid();
-      char  * e_home = sh.effective.home;
-
-#if defined(SH_WITH_SERVER)
-#if defined(USE_GETPWNAM_R)
-      struct passwd    e_pwd;
-      char          *  e_buffer = SH_ALLOC(SH_PWBUF_SIZE);
-      struct passwd *  e_tempres;
-      sh_getpwnam_r(DEFAULT_IDENT, &e_pwd, e_buffer, SH_PWBUF_SIZE, &e_tempres);
-#else
-      struct passwd * e_tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
-
-      if ((e_tempres != NULL) && (0 == sl_ret_euid()))   
-	{
-	  /* privileges not dropped yet */
-	  e_uid  = e_tempres->pw_uid;
-	  e_home = e_tempres->pw_dir;
-	}
-#endif
-      dlog(1, FIL__, __LINE__, 
-	   _("The signature of the configuration file or the file signature database\ncould not be verified. Possible reasons are:\n - gpg binary (%s) not found\n - invalid signature\n - the signature key is not in the private keyring of UID %d,\n - there is no keyring in %s/.gnupg, or\n - the file is not signed - did you move /filename.asc to /filename ?\nTo create a signed file, use (remove old signatures before):\n   gpg -a --clearsign --not-dash-escaped FILE\n   mv FILE.asc FILE\n"),
-	   DEFAULT_SIG_PATH,
-	   (int) e_uid, e_home);
-
-#if defined(SH_WITH_SERVER) && defined(USE_GETPWNAM_R)
-      SH_FREE(e_buffer);
-#endif
-    }
-
-  TPT(((0), FIL__, __LINE__, _("msg=<Status = %d>\n"), status));
-
-  SL_RETURN(-1, _("sh_gpg_check_sign")); /* make compiler happy */
-}  
-
-static int sh_gpg_comp(const char * line, const char * cmp)
-{
-  int retval = S_FALSE;
-
-  if (line && line[0] == '-' && line[1] == '-')
-    {
-      char * dup = sh_util_strdup(line);
-      char * tmp = dup + sl_strlen( dup );
-      --tmp;
-      if (*tmp == '\n') { *tmp = '\0'; --tmp; }
-      while( (*tmp == '\t' || *tmp == ' ' || *tmp == '\r' ) && tmp >= dup ) *tmp-- = '\0';
-
-      if (0 == sl_strcmp(dup, cmp))
-	retval = S_TRUE;
-      SH_FREE(dup);
-    }
-  return retval;
-}
-
-static
-int sh_gpg_msg_start(const char * line)
-{
-  static char cmp[SH_MINIBUF];
-  static int  initialized = 0;
-
-  if (initialized == 0) {
-    sl_strlcpy(cmp, _("-----BEGIN PGP SIGNED MESSAGE-----"), sizeof(cmp));
-    initialized = 1;
-  }
-  return sh_gpg_comp(line, cmp);
-}
-
-static
-int sh_gpg_msg_startdata(const char * line)
-{
-  if (line[0] == '\n')
-    return S_TRUE;
-  return S_FALSE;
-}
-
-static
-int sh_gpg_msg_end(const char * line)
-{
-  static char cmp[SH_MINIBUF];
-  static int  initialized = 0;
-
-  if (initialized == 0) {
-    sl_strlcpy(cmp, _("-----BEGIN PGP SIGNATURE-----"), sizeof(cmp));
-    initialized = 1;
-  }
-  return sh_gpg_comp(line, cmp);
-}
-
-static
-int sh_gpg_sig_end(const char * line)
-{
-  static char cmp[SH_MINIBUF];
-  static int  initialized = 0;
-
-  if (initialized == 0) {
-    sl_strlcpy(cmp, _("-----END PGP SIGNATURE-----"), sizeof(cmp));
-    initialized = 1;
-  }
-  return sh_gpg_comp(line, cmp);
-}
-
-static
-SL_TICKET sh_gpg_extract_signed(SL_TICKET fd, extractlevel extract_level)
-{
-  const  int fgets_buf_size = 16384;
-  FILE * fin_cp = NULL;
-  char * buf    = NULL;
-  int    bufc;
-  int    flag_pgp    = S_FALSE;
-  int    flag_nohead = S_FALSE;
-  SL_TICKET fdTmp = (-1);
-  SL_TICKET open_tmp (void);
-
-  /* extract the data and copy to temporary file
-   */
-  fdTmp = open_tmp();
-  if (SL_ISERROR(fdTmp))
-    {
-      dlog(1, FIL__, __LINE__, _("Error opening temporary file.\n")); 
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Error opening temporary file."), 
-		      _("sh_gpg_extract_signed"));
-      return -1;
-    }
-
-  fin_cp = fdopen(dup(get_the_fd(fd)), "rb");
-  buf = SH_ALLOC(fgets_buf_size);
-
-  while (NULL != fgets(buf, fgets_buf_size, fin_cp))
-    {
-      bufc = 0; 
-      while (bufc < fgets_buf_size) { 
-	if (buf[bufc] == '\n') { ++bufc; break; }
-	++bufc;
-      }
-
-      if (flag_pgp == S_FALSE && sh_gpg_msg_start(buf) == S_TRUE)
-	{
-	  flag_pgp = S_TRUE;
-	  if (extract_level == SIG_DATASIG)
-	    sl_write(fdTmp, buf, bufc);
-	  continue;
-	}
-      
-      if (flag_pgp == S_TRUE && flag_nohead == S_FALSE)
-	{
-	  /* Header finished */
-	  if (buf[0] == '\n')
-	    {
-	      flag_nohead = S_TRUE;
-	      if (extract_level == SIG_DATASIG)
-		sl_write(fdTmp, buf, 1);
-	      continue;
-	    }
-	  /* copy these headers */
-	  else if (0 == sl_strncmp(buf, _("Hash:"), 5) ||
-		   0 == sl_strncmp(buf, _("NotDashEscaped:"), 15))
-	    {
-	      if (extract_level == SIG_DATASIG)
-		sl_write(fdTmp, buf, bufc);
-	      continue;
-	    }
-	  /* ignore other headers */
-	  else
-	    continue;
-	}
-    
-      if (flag_pgp == S_TRUE && buf[0] == '\n')
-	{
-	  sl_write(fdTmp, buf, 1);
-	}
-      else if (flag_pgp == S_TRUE)
-	{
-	  if (extract_level == SIG_DATASIG) {
-	    sl_write(fdTmp, buf, bufc); 
-	  }
-	  else {
-	    if (sh_gpg_msg_end(buf) == S_TRUE)
-	      break;
-	    else
-	      sl_write(fdTmp, buf, bufc);
-	  }
-	}
-
-      /* This is after the copy has been done. */
-      if (flag_pgp == S_TRUE && sh_gpg_sig_end(buf) == S_TRUE)
-	break;
-    }
-  SH_FREE(buf);
-  sl_fclose(FIL__, __LINE__, fin_cp);
-  sl_rewind (fdTmp);
-
-  return fdTmp;
-}
-#endif
-
-/*********************************************************************
- *
- * Exported functions
- *
- *********************************************************************/
-
-int sh_sig_check_signature (SL_TICKET file, ShSigFile what)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_check_signature (file, what);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_check_signature (file, what);
-#else
-  return -1;
-#endif
-}
-
-SL_TICKET sh_sig_extract_signed(SL_TICKET fd)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_extract_signed(fd, SIG_DATASIG);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_extract_signed(fd, SIG_DATASIG);
-#else
-  return -1;
-#endif
-}
-
-SL_TICKET sh_sig_extract_signed_data(SL_TICKET fd)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_extract_signed(fd, SIG_DATAONLY);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_extract_signed(fd, SIG_DATAONLY);
-#else
-  return -1;
-#endif
-}
-
-int sh_sig_msg_start(const char * line)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_msg_start(line);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_msg_start(line);
-#else
-  return -1;
-#endif
-}
-
-int sh_sig_msg_startdata(const char * line)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_msg_startdata(line);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_msg_startdata(line);
-#else
-  return -1;
-#endif
-}
-
-int sh_sig_msg_end(const char * line)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_msg_end(line);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_msg_end(line);
-#else
-  return -1;
-#endif
-}
-
-int sh_sig_data_end(const char * line)
-{
-#if defined(WITH_GPG)
-  return sh_gpg_sig_end(line);
-#elif defined(WITH_SIGNIFY)
-  return sh_signify_data_end(line);
-#else
-  return -1;
-#endif
-}
-
-void sh_sig_log_startup (void)
-{
-  if (startInfo.program != NULL)
-    {
-      sh_error_handle ((-1), FIL__, startInfo.line, 0, MSG_START_GH,
-		       startInfo.program, startInfo.uid,
-		       startInfo.path,
-		       startInfo.key_uid, startInfo.key_id);
-    }
-  return;
-}
-
-/* #ifdef WITH_SIG */
-#endif
-
-
-
-
-
-
-
-
Index: trunk/src/sh_socket.c
===================================================================
--- trunk/src/sh_socket.c	(revision 591)
+++ trunk/src/sh_socket.c	(revision 1)
@@ -24,17 +24,8 @@
  */
 
-#if defined(SH_WITH_SERVER) && defined(__linux__)
-#define _GNU_SOURCE
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
-
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
 
 #include "samhain.h"
@@ -43,7 +34,4 @@
 #include "sh_unix.h"
 #include "sh_calls.h"
-#include "sh_guid.h"
-#include "sh_fifo.h"
-#include "sh_utils.h"
 
 #undef  FIL__
@@ -54,145 +42,4 @@
 #include <signal.h>
 
-typedef struct delta_tofetch {
-  char            uuid[SH_UUID_BUF];
-  time_t          last_time;
-  unsigned int    count;
-} SH_DELTA_DB;
-
-static SH_DELTA_DB * parse_entry(SH_DELTA_DB * db, const char * str)
-{
-  long last_time;
-  unsigned int count;
-  char buf[SH_UUID_BUF];
-  int res = sscanf(str, _("%u:%ld:%36s"), &count, &last_time, buf);
-  if (res == 3)
-    {
-      db->count = count;
-      db->last_time  = (time_t) last_time;
-      sl_strlcpy(db->uuid, buf, SH_UUID_BUF);
-      return db;
-    }
-  return NULL;
-}
-
-static char * unparse_entry(const SH_DELTA_DB * db, char * str, size_t len)
-{
-  int nbytes = sl_snprintf(str, len, _("%u:%ld:%s"), 
-			   db->count, (long) db->last_time, db->uuid);
-  if (nbytes < 0 || nbytes >= (int) len)
-    return NULL;
-  return str;
-}
-
-static SH_FIFO xfifo = SH_FIFO_INITIALIZER;
-
-int sh_socket_store_uuid(const char * cmd)
-{
-  char * p = sh_util_strdup(cmd);
-  char * q = strchr(cmd, ':');
-  char   entry[SH_BUFSIZE];
-  SH_DELTA_DB db;
-
-  if (!q) { SH_FREE(p); return -1; }
-
-  ++q;
-
-  if (0 != sh_uuid_check(q)) { SH_FREE(p); return -1; }
-
-  db.count = 0;
-  db.last_time = (time_t) 0;
-  sl_strlcpy(db.uuid, q, SH_UUID_BUF);
-  SH_FREE(p);
-
-  if (NULL != unparse_entry(&db, entry, sizeof(entry)))
-    {
-      sh_fifo_push(&xfifo, entry);
-      return 0;
-    }
-  return -1;
-}
-
-static unsigned int try_interval = 60;
-static unsigned int try_max = 2;
-
-int set_delta_retry_interval(const char * str)
-{
-  long val = strtol (str, (char **)NULL, 10);
-
-  if (val < 0 || val > INT_MAX)
-    return -1;
-  try_interval = (unsigned int) val;
-  return 0;
-}
-int set_delta_retry_count(const char * str)
-{
-  long val = strtol (str, (char **)NULL, 10);
-
-  if (val < 0 || val > INT_MAX)
-    return -1;
-  try_max = (unsigned int) val;
-  return 0;
-}
-
-char * sh_socket_get_uuid(int * errflag, unsigned int * count, time_t * last)
-{
-  char * entry = sh_fifo_pop(&xfifo);
-  char * uuid = NULL;
-
-  if (entry)
-    {
-      SH_DELTA_DB db;
-      time_t      now;
-      
-      if (NULL == parse_entry(&db, entry))
-	{
-	  SH_FREE(entry);
-	  sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			  _("Bad entry in fifo"), 
-			  _("sh_socket_get_uuid"));
-	  *errflag = -1;
-	  return NULL;
-	}
-
-      now = time(NULL);
-
-      if ( (db.count > 0) && ((unsigned long)(now - db.last_time) < try_interval) )
-	{
-	  sh_fifo_push_tail(&xfifo, entry);
-	  SH_FREE(entry);
-	  *errflag = -1;
-	  return NULL;
-	}
-
-      SH_FREE(entry);
-      uuid   = sh_util_strdup(db.uuid);
-      *count = db.count;
-      *last  = db.last_time;
-    }
-
-  *errflag = 0;
-  return uuid;
-}
-
-int sh_socket_return_uuid (const char * uuid, unsigned int count, time_t last)
-{
-  (void) last;
-
-  if (count < try_max)
-    {
-      char   entry[SH_BUFSIZE];
-      SH_DELTA_DB db;
-      time_t now = time(NULL);
-
-      db.count     = count + 1;
-      db.last_time = now;
-      sl_strlcpy(db.uuid, uuid, SH_UUID_BUF);
-
-      if (NULL != unparse_entry(&db, entry, sizeof(entry)))
-	return sh_fifo_push_tail(&xfifo, entry); /* >0 for success */
-    }
-  return -1;
-}
-
 void sh_socket_server_cmd(const char * srvcmd)
 {
@@ -203,6 +50,6 @@
       SL_RET0(_("sh_socket_server_cmd"));
     }
-
-  if (0 == strncmp(srvcmd, _("STOP"), 4))
+  if ((srvcmd[0] == 'S') || (srvcmd[1] == 'T') || 
+      (srvcmd[2] == 'O') || (srvcmd[3] == 'P'))
     {
       TPT((0, FIL__, __LINE__, _("msg=<stop command from server>\n")));
@@ -210,10 +57,10 @@
       raise(SIGQUIT);
 #else
-      sig_terminate       = 1;
-      ++sig_raised;
+      TPT((0, FIL__, __LINE__, _("msg=<sigquit not defined>\n")));
 #endif
     } 
-
-  else if (0 == strncmp(srvcmd, _("RELOAD"), 6))
+  else if ((srvcmd[0] == 'R') || (srvcmd[1] == 'E') || 
+	   (srvcmd[2] == 'L') || (srvcmd[3] == 'O') ||
+	   (srvcmd[4] == 'A') || (srvcmd[5] == 'D'))
     {
       TPT((0, FIL__, __LINE__, _("msg=<reload command from server>\n")));
@@ -221,44 +68,10 @@
       raise(SIGHUP);
 #else
-      sig_config_read_again = 1;
-      ++sig_raised;
-#endif
-    }
-
-  else if (0 == strncmp(srvcmd, _("DELTA:"), 6))
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<delta load command from server>\n")));
-
-      if (sh_socket_store_uuid(srvcmd) == 0)
-	{
-	  ++sh_load_delta_flag;
-	  ++sig_raised;
-	}
-    }
-
-  else if (0 == strncmp(srvcmd, _("SCAN"), 4))
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<scan command from server>\n")));
-      if (sh.flag.isdaemon == S_TRUE) 
-	{ 
-#ifdef SIGTTOU
-	  raise(SIGTTOU);
-#else
-	  sig_force_check = 1;
-	  ++sig_raised;
-#endif
-	} 
-      else 
-	{
-	  sig_force_check = 1;
-	  ++sig_raised;
-	}
-    }
-
-  /* Unknown command 
-   */
+      TPT((0, FIL__, __LINE__, _("msg=<sighup not defined>\n")));
+#endif
+    }
   else
     {
-      sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN,
+      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN,
 		      srvcmd, 
 		      _("sh_socket_server_cmd"));
@@ -266,5 +79,7 @@
   SL_RET0(_("sh_socket_server_cmd"));
 }
-#endif  /* #if defined (SH_WITH_CLIENT) */
+/* #if defined (SH_WITH_CLIENT)
+ */
+#endif
 
 #if defined(SH_WITH_SERVER)
@@ -296,5 +111,6 @@
 int    pf_unix_fd  = -1;
 static char * sh_sockname = NULL;
-static char   sh_sockpass_real[SOCKPASS_MAX+1];
+/* static char   sh_sockpass[29]; */
+static char   sh_sockpass_real[15];
 
 struct socket_cmd {
@@ -325,8 +141,5 @@
 #include "sh_utils.h"
 
-/* The reload list stores information about
- * reloads confirmed by clients (startup and/or
- * runtime cinfiguration reloaded).
- */
+
 struct reload_cmd {
   char          clt[SH_MAXMSGLEN];
@@ -344,7 +157,4 @@
       if (0 == sl_strcmp(new->clt, clt))
 	{
-#ifdef SH_DEBUG_SOCKET
-	  fprintf(stderr, "add2reload: time reset for %s\n", clt);
-#endif
 	  sl_strlcpy (new->clt, clt, SH_MAXMSGLEN);
 	  new->cti = time(NULL);
@@ -355,7 +165,4 @@
 
   new = SH_ALLOC(sizeof(struct reload_cmd));
-#ifdef SH_DEBUG_SOCKET
-  fprintf(stderr, "add2reload: time set for %s\n", clt);
-#endif
   sl_strlcpy (new->clt, clt, SH_MAXMSGLEN);
   new->cti = time(NULL);
@@ -372,5 +179,5 @@
 static void sh_socket_add2list (struct socket_cmd * in);
 
-static void sh_socket_probe4reload (void)
+static void sh_socket_probe4reload ()
 {
   struct reload_cmd  * new;
@@ -390,6 +197,4 @@
       if (item->status_now != CLT_INACTIVE)
 	{
-	  int flag = 0;
-
 	  file = get_client_conf_file (item->hostname, &dummy);
 
@@ -401,6 +206,4 @@
 		  if (0 == sl_strcmp(new->clt, item->hostname))
 		    {
-		      flag = 1; /* Client is in list already */
-
 		      if (buf.st_mtime > new->cti)
 			{
@@ -414,39 +217,14 @@
 		  new = new->next;
 		}
-
-	      if (flag == 0)
-		{
-		  /* client is active, but start message has been missed; reload 
-		   */
-		  sl_strlcpy(cmd.cmd, _("RELOAD"),    SH_MAXMSGLEN);
-		  sl_strlcpy(cmd.clt, item->hostname, SH_MAXMSGLEN);
-		  sh_socket_add2list (&cmd);
-
-		  /* Add the client to the reload list and set
-		   * time to 0, since we don't know the startup time.
-		   */
-		  sh_socket_add2reload (item->hostname);
-		  new = reloadlist;
-		  while (new)
-		    {
-		      if (0 == sl_strcmp(new->clt, item->hostname))
-			{
-			  new->cti = 0;
-			  break;
-			}
-		      new = new->next;
-		    }
-		}
-	    } /* if stat(file).. */
-	} /* if !CLT_INACTIVE */
-    } /* loop over clients */
+	    }
+	}
+    }
   return;
 }
 
-char * sh_get_sockpass (void)
-{
-  size_t j = 0;
-
-  while (skey->sh_sockpass[2*j] != '\0' && j < sizeof(sh_sockpass_real))
+char * sh_get_sockpass ()
+{
+  int j = 0;
+  while (skey->sh_sockpass[2*j] != '\0')
     {
       sh_sockpass_real[j] = skey->sh_sockpass[2*j];
@@ -454,9 +232,8 @@
     }
   sh_sockpass_real[j] = '\0';
-
   return sh_sockpass_real;
 }
 
-void sh_set_sockpass (void)
+void sh_set_sockpass ()
 {
   int j;
@@ -467,5 +244,5 @@
 }
 
-int sh_socket_use (const char * c)
+int sh_socket_use (char * c)
 {
   return sh_util_flagval(c, &sh_socket_flaguse);
@@ -509,7 +286,8 @@
 
 #define NEED_PASSWORD_AUTH
-#endif
-
-int sh_socket_uid (const char * c)
+
+#endif
+
+int sh_socket_uid (char * c)
 {
   uid_t val = (uid_t) strtol (c, (char **)NULL, 10);
@@ -523,5 +301,5 @@
 }
 
-int sh_socket_password (const char * c)
+int sh_socket_password (char * c)
 {
 #if defined(NEED_PASSWORD_AUTH)
@@ -531,8 +309,8 @@
 
   i = sl_strlen(c);
-  if (i > SOCKPASS_MAX) {
+  if (i > 14) {
     return -1;
   }
-  for (j = 0; j < (2*SOCKPASS_MAX+1); ++j)
+  for (j = 0; j < 29; ++j)
     {
       skey->sh_sockpass[j] = '\0';
@@ -563,5 +341,4 @@
 #endif
   struct stat buf;
-  char errbuf[SH_ERRBUF_SIZE];
   
   SL_ENTER(_("sh_socket_open_int"));
@@ -575,5 +352,5 @@
     {
       size = sl_strlen(DEFAULT_PIDDIR) + 1 + sl_strlen(SH_INSTALL_NAME) + 6;
-      sh_sockname = SH_ALLOC(size); /* compile-time constant */
+      sh_sockname = SH_ALLOC(size);
       sl_strlcpy(sh_sockname, DEFAULT_PIDDIR, size);
       sl_strlcat(sh_sockname, "/", size);
@@ -582,15 +359,9 @@
     }
 
-  if (0 != sh_unix_check_piddir (sh_sockname))
-    {
-      SH_FREE(sh_sockname);
-      SL_RETURN((-1),_("sh_socket_open_int"));
-    }
-
   pf_unix_fd = socket (PF_UNIX, SOCK_STREAM, 0);
   if ((pf_unix_fd) < 0)
     {
       sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		       sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		       sh_error_message (errno), 
 		       _("sh_socket_open_int: socket"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -599,5 +370,5 @@
   if (sizeof(name.sun_path) < (1 + sl_strlen(sh_sockname)))
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle ((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
 		       _("PID dir path too long"), 
@@ -607,5 +378,5 @@
 
   name.sun_family = AF_FILE;
-  sl_strlcpy (name.sun_path, sh_sockname, sizeof(name.sun_path));
+  strcpy (name.sun_path, sh_sockname);
 
   size = (offsetof (struct sockaddr_un, sun_path)
@@ -621,5 +392,5 @@
       if (sh_socket_remove() < 0) 
 	{
-	  sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+	  close(pf_unix_fd); pf_unix_fd = -1;
 	  sh_error_handle ((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
 			   _("Unlink of socket failed, maybe path not trusted"), 
@@ -631,7 +402,7 @@
   if (bind ((pf_unix_fd), (struct sockaddr *) &name, size) < 0)
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		       sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		       sh_error_message (errno), 
 		       _("sh_socket_open_int: bind"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -642,7 +413,7 @@
 		      &optval, sizeof(optval)))
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		       sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		       sh_error_message (errno), 
 		       _("sh_socket_open_int: setsockopt"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -653,7 +424,7 @@
   if (flags < 0)
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		       sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		       sh_error_message (errno), 
 		       _("sh_socket_open_int: fcntl1"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -663,7 +434,7 @@
   if (flags < 0)
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		      sh_error_message (errno), 
 		      _("sh_socket_open_int: fcntl2"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -672,7 +443,7 @@
   if (0 != listen(pf_unix_fd, 5))
     {
-      sl_close_fd(FIL__, __LINE__, pf_unix_fd); pf_unix_fd = -1;
+      close(pf_unix_fd); pf_unix_fd = -1;
       sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		       sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		       sh_error_message (errno), 
 		       _("sh_socket_open_int: listen"));
       SL_RETURN( (-1), _("sh_socket_open_int"));
@@ -680,5 +451,18 @@
   SL_RETURN( (0), _("sh_socket_open_int"));
 }
-
+/* #if !defined(HAVE_CMSGCRED) || !defined(SO_PEERCRED) */
+/* #endif */
+
+/*
+#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && !defined(HAVE_STRUCT_CMSGCRED) && !defined(HAVE_STRUCT_FCRED) && !(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
+static 
+int sh_socket_read (struct socket_cmd * srvcmd)
+{
+  srvcmd->cmd[0] = '\0';
+  srvcmd->clt[0] = '\0';
+  return 0;
+}
+#else
+*/
 
 /*
@@ -709,20 +493,124 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
-
-static int receive_message(int talkfd, struct msghdr * msg, size_t message_size)
-{
-  unsigned int retry = 0;
+static 
+int sh_socket_read (struct socket_cmd * srvcmd)
+{
+  struct socket_cmd * list_cmd;
+  char message[SH_MAXMSG];
+  struct sockaddr_un name;
+  int size;
   int nbytes;
-  char * message = msg->msg_iov->iov_base;
-  char errbuf[SH_ERRBUF_SIZE];
+  int talkfd;
+  int retry = 0;
+
+  char * cmd = NULL;
+  char * clt = NULL;
+
+  int  client_uid = -1;
+
+
+  struct msghdr msg;
+  struct iovec iov;
+
+#if defined(NEED_PASSWORD_AUTH)
+  char * eopw = NULL;
+  char * goodpassword = NULL;
+#endif
+
+#if defined(HAVE_GETPEEREID)
+  uid_t peer_uid;
+  gid_t peer_gid;
+#elif defined(SO_PEERCRED) 
+  struct ucred cr;
+  int          cl = sizeof(cr);
+
+#elif defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
+
+#ifdef HAVE_STRUCT_CMSGCRED
+  typedef struct cmsgcred Cred;
+#define CRED_UID cmcred_uid 
+
+#elif HAVE_STRUCT_FCRED
+  typedef struct fcred Cred;
+#define CRED_UID fc_uid 
+
+#elif HAVE_STRUCT_SOCKCRED
+  typedef struct sockcred Cred;
+#define CRED_UID sc_uid 
+
+#endif
+  Cred       *cred;
+
+  /* Compute size without padding */
+  char   cmsgmem[ALIGN(sizeof(struct cmsghdr)) + ALIGN(sizeof(Cred))];   
+  /* for NetBSD */
+
+  /* Point to start of first structure */
+  struct cmsghdr *cmsg = (struct cmsghdr *) cmsgmem;
+#endif
+
+  if (pf_unix_fd  < 0)
+    {
+      return 0;
+    }
+
+  iov.iov_base = (char *) &message;
+  iov.iov_len  = SH_MAXMSG;
+
+  memset (&msg, 0, sizeof (msg));
+  msg.msg_iov = &iov;
+  msg.msg_iovlen = 1;
+
+#if !defined(SO_PEERCRED) && !defined(HAVE_GETPEEREID)
+#if defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
+  msg.msg_control = (char *) cmsg;
+  msg.msg_controllen = sizeof (cmsgmem);
+  memset (cmsg, 0, sizeof (cmsgmem));
+#endif
+#endif
+
+  /* the socket is non-blocking 
+   * 'name' is the address of the sender socket
+   */
+  size = sizeof (name);
+  talkfd = retry_accept(FIL__, __LINE__, 
+			pf_unix_fd, (struct sockaddr *) & name, &size);
+  if ((talkfd < 0) && (errno == EAGAIN))
+    {
+      return 0;
+    }
+  else if (talkfd < 0)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
+		      sh_error_message (errno), 
+		      _("sh_socket_read: accept"));
+      return -1;
+    }
+
+
+#if defined(LOCAL_CREDS) && !defined(SO_PEERCRED) && !defined(HAVE_GETPEEREID)
+  /* Set the socket to receive credentials on the next message 
+   */
+  {
+    int on = 1;
+    if (setsockopt (talkfd, 0, LOCAL_CREDS, &on, sizeof (on)) < 0)
+      {
+	sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
+			sh_error_message (errno), 
+			_("sh_socket_read: setsockopt"));
+	close(talkfd);
+	return -1;
+      }
+  }
+#endif
 
   do {
-    nbytes = recvmsg (talkfd, msg, 0);
+    nbytes = recvmsg (talkfd, &msg, 0);
     if ((nbytes < 0) && (errno != EAGAIN))
       {
 	sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			sh_error_message (errno, errbuf, sizeof(errbuf)),
+			sh_error_message (errno),
 			_("sh_socket_read: recvmsg"));
-	sl_close_fd(FIL__, __LINE__, talkfd);	
+	close(talkfd);	
 	return -1;
       }
@@ -730,11 +618,15 @@
       {
 	++retry;
-	retry_msleep(0, 10);
+	retry_msleep(0, 1);
       }
   } while ((nbytes < 0) && (retry < 3));
 
-  /* msg.msg_iov.iov_base, filled by recvmsg
-   */
-  message[message_size-1] = '\0';
+#ifdef SH_DEBUG_SOCKET
+  fprintf(stderr, "%d bytes received\n", nbytes);
+#endif
+
+  /* nbytes = recv (talkfd, message, SH_MAXMSG, 0); */
+
+  message[SH_MAXMSG-1] = '\0';
 
   if (nbytes < 0)
@@ -743,81 +635,56 @@
 	{
 	  /* no data */
-	  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			  sh_error_message (errno, errbuf, sizeof(errbuf)), 
-			  _("sh_socket_read: recvfrom"));
-	  sl_close_fd(FIL__, __LINE__, talkfd);
+	  close(talkfd);
 	  return 0;
 	}
       sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		      sh_error_message (errno), 
 		      _("sh_socket_read: recvfrom"));
-      sl_close_fd(FIL__, __LINE__, talkfd);
+      close(talkfd);
       return -1;
     }
-  return 0;
-}
 
 #if defined(HAVE_GETPEEREID)
-
-static int get_peer_uid(int talkfd)
-{
-  uid_t peer_uid;
-  gid_t peer_gid;
-  char errbuf[SH_ERRBUF_SIZE];
-
   if (0 != getpeereid(talkfd, &peer_uid, &peer_gid))
     {
       sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		      sh_error_message (errno), 
 		      _("sh_socket_read: getpeereid"));
-      sl_close_fd(FIL__, __LINE__, talkfd);
+      close(talkfd);
       return -1;
     }
-  return peer_uid;
-}
-
-#elif defined(SO_PEERCRED) 
-
-static int get_peer_uid(int talkfd)
-{
-  char errbuf[SH_ERRBUF_SIZE];
-  struct ucred cr;
-#ifdef HAVE_SOCKLEN_T
-  socklen_t cl = sizeof(cr);
-#else
-  int       cl = sizeof(cr);
-#endif 
-
+  client_uid = peer_uid;
+  cmd = message;
+#elif defined(SO_PEERCRED)
   if (0 != getsockopt(talkfd, SOL_SOCKET, SO_PEERCRED, &cr, &cl))
     {
       sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
+		      sh_error_message (errno), 
 		      _("sh_socket_read: getsockopt"));
-      sl_close_fd(FIL__, __LINE__, talkfd);
+      close(talkfd);
       return -1;
     }
-  return cr.uid;
-}
-
-#endif
-
-#if defined(NEED_PASSWORD_AUTH)
-char * check_password(char * message, size_t msglen, int * client_uid, int talkfd)
-{
-  char * cmd = NULL;
-  char * eopw = NULL;
-  char * goodpassword = NULL;
-
+  client_uid = cr.uid;
+  cmd = message;
+#elif defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
+  if (cmsg->cmsg_len < sizeof (cmsgmem) || cmsg->cmsg_type != SCM_CREDS)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+		      _("Message from recvmsg() was not SCM_CREDS"), 
+		      _("sh_socket_read"));
+      close(talkfd);
+      return -1;
+    }
+  cred = (Cred *) CMSG_DATA (cmsg);
+  client_uid = cred->CRED_UID;
+  cmd = message;
+#elif defined(NEED_PASSWORD_AUTH)
   goodpassword = sh_get_sockpass();
   eopw = strchr(message, '@');
   if (eopw) 
     *eopw = '\0';
-  /*
-   * message is null-terminated and >> goodpassword
-   */
-  if (0 == strcmp(goodpassword, message) &&
-      strlen(goodpassword) < (msglen/2))
-    {
-      *client_uid = sh_socket_flaguid;
+  if (0 == strcmp(goodpassword, message))
+    {
+      client_uid = sh_socket_flaguid;
       cmd = &message[strlen(goodpassword)+1];
       sh_set_sockpass();
@@ -829,79 +696,18 @@
 		      _("sh_socket_read"));
       sh_set_sockpass();
-      sl_close_fd(FIL__, __LINE__, talkfd);
-      return NULL;
-    }
-  return cmd;
-}
-#endif
-
-static int list_all (int talkfd, char * cmd);
-static int process_message(int talkfd, char * cmd, struct socket_cmd * srvcmd);
-
-static 
-int sh_socket_read (struct socket_cmd * srvcmd)
-{
-  char message[SH_MAXMSG];
-  struct sockaddr_un name;
-  ACCEPT_TYPE_ARG3 size = sizeof(name);
-  int talkfd;
-  char * cmd = NULL;
-  int  client_uid = -1;
-  char errbuf[SH_ERRBUF_SIZE];
-  struct msghdr msg;
-  struct iovec iov;
-  int status;
-
-  if (pf_unix_fd  < 0)
-    return 0;
-
-  iov.iov_base = (char *) &message;
-  iov.iov_len  = sizeof(message);
-
-  memset (&msg, 0, sizeof (msg));
-  msg.msg_iov = &iov;
-  msg.msg_iovlen = 1;
-
-  /* the socket is non-blocking 
-   * 'name' is the address of the sender socket
-   */
-  do {
-    talkfd = accept(pf_unix_fd, (struct sockaddr *) &name, &size);
-  } while (talkfd < 0 && errno == EINTR);
-
-  if ((talkfd < 0) && (errno == EAGAIN))
-    {
-      return 0;
-    }
-  else if (talkfd < 0)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
-		      _("sh_socket_read: accept"));
+      close(talkfd);
       return -1;
     }
-
-  if (receive_message(talkfd, &msg, sizeof(message)) < 0)
-    return -1;
-
-  /* Authenticate request by peer uid or password.
-   */
-#if defined(HAVE_GETPEEREID)
-  client_uid = get_peer_uid(talkfd);
-  cmd = message;
-
-#elif defined(SO_PEERCRED)
-  client_uid = get_peer_uid(talkfd);
-  cmd = message;
-
-#elif defined(NEED_PASSWORD_AUTH)
-  cmd = check_password(message, sizeof(message), &client_uid, talkfd);
-
 #else
   sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
 		  _("Socket credentials not supported on this OS"), 
 		  _("sh_socket_read"));
-  sl_close_fd(FIL__, __LINE__, talkfd);
+  close(talkfd);
   return -1;
+#endif
+
+#ifdef SH_DEBUG_SOCKET
+  fprintf(stderr, "Peer uid=%d, required=%d\n",
+	  client_uid, sh_socket_flaguid);
 #endif
 
@@ -911,85 +717,19 @@
 		      _("client does not have required uid"), 
 		      _("sh_socket_read: getsockopt"));
-      sl_close_fd(FIL__, __LINE__, talkfd);
+      close(talkfd);
       return -1;
     }
 
-  status = process_message(talkfd, cmd, srvcmd);
-
-  sl_close_fd(FIL__, __LINE__, talkfd);
-  return status;
-}
-
-static int check_valid_command(const char * str)
-{
-  unsigned int i = 0;
-  char * commands[] = { N_("DELTA"),  N_("RELOAD"),  N_("STOP"), N_("SCAN"),
-			N_("CANCEL"), N_("LISTALL"), N_("LIST"), N_("PROBE"), NULL };
-
-  while (commands[i])
-    {
-      if (0 == strcmp(_(commands[i]), str))
-	{
-	  return 0;
-	}
-      ++i;
-    }
-  return -1;
-}
-
-static int send_reply (int fd, char * msg)
-{
-  int nbytes = send (fd, msg, strlen(msg) + 1, 0);
-
-  if (nbytes < 0)
-    {
-      char errbuf[SH_ERRBUF_SIZE];
-      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-		      sh_error_message (errno, errbuf, sizeof(errbuf)), 
-		      _("send_reply"));
-      return -1;
-    }
-
-  return nbytes;
-}
-
-static int process_message(int talkfd, char * cmd, struct socket_cmd * srvcmd)
-{
-  int nbytes;
-  char error_type[SH_ERRBUF_SIZE] = { '\0' };
-  char * clt  = (cmd) ? strchr(cmd, ':') : NULL;
-
-  if (clt && 0 == strncmp(cmd, _("DELTA:"), 6))
-    {
-      /* DELTA:uuid:hostname 
-       */
-      char * uuid = clt;
-      
-      *uuid = '\0'; ++uuid;
-      clt = strchr(uuid, ':');
-      if (clt) { *clt = '\0'; ++clt; }
-      
-      if (sh_uuid_check(uuid) < 0)
-	{
-	  sl_strlcpy(error_type, _("!E:uuid-format:"), sizeof(error_type));
-	  sl_strlcat(error_type, uuid, sizeof(error_type));
-	  clt = NULL;
-	}
-      
-      --uuid; *uuid = ':';
-    }
-  else if (clt && *clt == ':')
-    { 
-      *clt = '\0'; ++clt; 
-      if (check_valid_command(cmd) < 0)
-	{
-	  sl_strlcpy(error_type, _("!E:cmd-invalid:"), sizeof(error_type));
-	  sl_strlcat(error_type, cmd, sizeof(error_type));
-	  clt = NULL;
-	}
-    }
-    
+
+  /* Give a diagnostic message. 
+   */
+#ifdef SH_DEBUG_SOCKET
+  fprintf (stderr, "Server: got message: %s\n", cmd);
+#endif
+
+  clt = strchr(cmd, ':');
   if (clt != NULL) 
     {
+      *clt = '\0'; ++clt;
       if (sl_strlen(cmd) >= SH_MAXMSGLEN)
 	{
@@ -997,6 +737,5 @@
 			  _("Bad message format: command too long"), 
 			  _("sh_socket_read"));
-	  sl_strlcpy(error_type, _("!E:cmd-toolong"), sizeof(error_type));
-	  send_reply(talkfd, error_type);
+	  close(talkfd);
 	  return -1;
 	}
@@ -1006,18 +745,19 @@
 			  _("Bad message format: hostname too long"), 
 			  _("sh_socket_read"));
-	  sl_strlcpy(error_type, _("!E:hostname-toolong"), sizeof(error_type));
-	  send_reply(talkfd, error_type);
+	  close(talkfd);
 	  return -1;
 	}
-
-      if (0 == strncmp(cmd, _("LIST"), 4))
-	return list_all(talkfd, cmd);
-      else if (0 == strncmp(cmd, _("PROBE"), 4))
+      if (cmd[0] == 'L' && cmd[1] == 'I' &&
+	  cmd[2] == 'S' && cmd[3] == 'T')
+	{
+	  goto list_all;
+	}
+      else if (cmd[0] == 'P' && cmd[1] == 'R' &&
+	  cmd[2] == 'O' && cmd[3] == 'B' && cmd[4] == 'E')
 	{
 	  sh_socket_probe4reload();
-	  sl_strlcpy(cmd, _("LIST"), 5);
-	  return list_all(talkfd, cmd);
-	}
-
+	  cmd[0] = 'L'; cmd[1] = 'I'; cmd[2] = 'S'; cmd[3] = 'T';cmd[4] = '\0';
+	  goto list_all;
+	}
       sl_strlcpy (srvcmd->cmd, cmd, SH_MAXMSGLEN);
       sl_strlcpy (srvcmd->clt, clt, SH_MAXMSGLEN);
@@ -1029,38 +769,61 @@
 		      _("Bad message format"), 
 		      _("sh_socket_read"));
-      if (error_type[0] == '\0')
-	sl_strlcpy(error_type, _("!E:message-format"), sizeof(error_type));
-      send_reply(talkfd, error_type);
+      close(talkfd);
       return -1;
     }
 
   /* Bounce the message back to the sender. 
+   * 'name' is the receiver address; it has been been filled
+   *        with the sender address in the recvfrom call 
    */
-  nbytes = send_reply(talkfd, cmd);
-
+#ifdef SH_DEBUG_SOCKET
+  fprintf (stderr, "Server: send message: %s to %s\n", 
+	   cmd, name.sun_path);
+#endif
+  /*
+  nbytes = sendto (pf_unix_fd, message, nbytes, 0,
+                       (struct sockaddr *) & name, size);
+  */
+  nbytes = send (talkfd, cmd, strlen(cmd) + 1, 0);
+  close(talkfd);
+  if (nbytes < 0)
+    {
+      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
+		      sh_error_message (errno), 
+		      _("sh_socket_read: send"));
+      return -1;
+    }
+#ifdef SH_DEBUG_SOCKET
+  fprintf (stderr, "Server: message is out\n");
+#endif
   return nbytes;
-}
-
-static int list_all (int talkfd, char * cmd)
-{
-  int nbytes;
-  struct socket_cmd * list_cmd;
-  char message[SH_MAXMSG];
-  char errbuf[SH_ERRBUF_SIZE];
-
-  if (0 == strncmp(cmd, _("LISTALL"), 7))
+
+ list_all:
+#ifdef SH_DEBUG_SOCKET
+  fprintf (stderr, "Server: list all\n");
+#endif
+  if (cmd[4] == 'A' && cmd[5] == 'L' && cmd[6] == 'L')
     {
       list_cmd = runlist;
       while (list_cmd)
 	{
-	  sl_snprintf(message, sizeof(message), _("SENT  %42s  %32s  %s"),
+	  sl_snprintf(message, SH_MAXMSG, _("SENT  %8s  %32s  %s"),
 		      list_cmd->cmd, list_cmd->clt, list_cmd->cti);
-
+	  /*
+	  sl_strlcpy(message,     _("DONE"), SH_MAXMSG);
+	  sl_strlcat(message,          "  ", SH_MAXMSG);
+	  sl_strlcat(message, list_cmd->cmd, SH_MAXMSG);
+	  sl_strlcat(message,          "  ", SH_MAXMSG);
+	  sl_strlcat(message, list_cmd->clt, SH_MAXMSG);
+	  sl_strlcat(message,          "  ", SH_MAXMSG);
+	  sl_strlcat(message, list_cmd->cti, SH_MAXMSG);
+	  */
 	  nbytes = send (talkfd, message, sl_strlen(message) + 1, 0);
 	  if (nbytes < 0)
 	    {
 	      sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			      sh_error_message (errno, errbuf, sizeof(errbuf)), 
+			      sh_error_message (errno), 
 			      _("sh_socket_read: sendto"));
+	      close(talkfd);
 	      return -1;
 	    }
@@ -1072,13 +835,26 @@
   while (list_cmd)
     {
-      sl_snprintf(message, sizeof(message), _(">>>>  %42s  %32s  %s"),
+      sl_snprintf(message, SH_MAXMSG, _(">>>>  %8s  %32s  %s"),
 		  list_cmd->cmd, list_cmd->clt, list_cmd->cti);
-
+      /*
+      sl_strlcpy(message,     _(">>>>"), SH_MAXMSG);
+      sl_strlcat(message,          "  ", SH_MAXMSG);
+      sl_strlcat(message, list_cmd->cmd, SH_MAXMSG);
+      sl_strlcat(message,          "  ", SH_MAXMSG);
+      sl_strlcat(message, list_cmd->clt, SH_MAXMSG);
+      sl_strlcat(message,          "  ", SH_MAXMSG);
+      sl_strlcat(message, list_cmd->cti, SH_MAXMSG);
+      */
+      /*
+      nbytes = sendto (pf_unix_fd, message, sl_strlen(message) + 1, 0,
+                       (struct sockaddr *) & name, size);
+      */
       nbytes = send (talkfd, message, sl_strlen(message) + 1, 0);
       if (nbytes < 0)
 	{
 	  sh_error_handle((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			  sh_error_message (errno, errbuf, sizeof(errbuf)), 
+			  sh_error_message (errno), 
 			  _("sh_socket_read: sendto"));
+	  close(talkfd);
 	  return -1;
 	}
@@ -1086,21 +862,41 @@
     }
 
-  send (talkfd, _("END"), 4, 0);
+  /*
+  nbytes = sendto (pf_unix_fd, _("END"), 4, 0,
+		   (struct sockaddr *) & name, size);
+  */
+  nbytes = send (talkfd, _("END"), 4, 0);
+  close(talkfd);
   return 0;
 }
+/* #if !defined(HAVE_CMSGCRED) || !defined(SO_PEERCRED) */
+/* #endif */
 
 static void sh_socket_add2list (struct socket_cmd * in)
 {
-  struct socket_cmd  * new  = cmdlist;
-  struct socket_cmd  * last = cmdlist;
+  struct socket_cmd  * new;
+
+  new = SH_ALLOC(sizeof(struct socket_cmd));
+  strcpy (new->cmd, in->cmd);
+  strcpy (new->clt, in->clt);
+  strcpy (new->cti, sh_unix_time(0));
+  new->next = cmdlist;
+  cmdlist   = new;
+
+  return;
+}
+
+static void sh_socket_add2run (struct socket_cmd * in)
+{
+  struct socket_cmd  * new = runlist;
+  char * client_name       = in->clt;
 
   while (new)
     {
-      /* Only skip identical commands.
-       */
-      if (0 == sl_strcmp(new->clt,  in->clt) &&
-	  0 == sl_strcmp(new->cmd,  in->cmd))
-	{
-	  (void) sh_unix_time(0, new->cti, sizeof(new->cti));
+      if (0 == sl_strcmp(new->clt, client_name))
+	{
+	  strcpy (new->cmd, in->cmd);
+	  strcpy (new->clt, in->clt);
+	  strcpy (new->cti, sh_unix_time(0));
 	  return;
 	}
@@ -1109,65 +905,16 @@
 
   new = SH_ALLOC(sizeof(struct socket_cmd));
-  sl_strlcpy (new->cmd,  in->cmd,  sizeof(new->cmd));
-  sl_strlcpy (new->clt,  in->clt,  sizeof(new->clt));
-  (void) sh_unix_time(0, new->cti, sizeof(new->cti));
-  new->next  = NULL;
-
-  if (last)
-    {
-      while (last->next) { last = last->next; }
-      last->next = new;
-    }
-  else
-    {
-      cmdlist = new;
-    }
+  strcpy (new->cmd, in->cmd);
+  strcpy (new->clt, in->clt);
+  strcpy (new->cti, sh_unix_time(0));
+  new->next = runlist;
+  runlist   = new;
+
   return;
 }
 
-static void sh_socket_add2run (struct socket_cmd * in)
-{
-  struct socket_cmd  * new  = runlist;
-  struct socket_cmd  * last = runlist;
-
-  while (new)
-    {
-      /* Only skip identical commands. First 5 will
-       * make all 'DELTA' identical.
-       */
-      if (0 == sl_strcmp(new->clt,  in->clt) &&
-	  0 == sl_strncmp(new->cmd,  in->cmd, 5))
-	{
-	  sl_strlcpy (new->cmd,  in->cmd,  sizeof(new->cmd));
-	  (void) sh_unix_time(0, new->cti, sizeof(new->cti));
-	  return;
-	}
-      new = new->next;
-    }
-
-  new = SH_ALLOC(sizeof(struct socket_cmd));
-  sl_strlcpy (new->cmd,  in->cmd,  sizeof(new->cmd));
-  sl_strlcpy (new->clt,  in->clt,  sizeof(new->clt));
-#ifdef SH_DEBUG_SOCKET
-  fprintf(stderr, "add2run: time set for %s\n", new->clt);
-#endif
-  (void) sh_unix_time(0, new->cti, sizeof(new->cti));
-  new->next  = NULL;
-
-  if (last)
-    {
-      while (last->next) { last = last->next; }
-      last->next = new;
-    }
-  else
-    {
-      runlist = new;
-    }
-  return;
-}
-
-
-
-static void sh_socket_rm2list (const char * client_name, int remove_all)
+
+
+static void sh_socket_rm2list (const char * client_name)
 {
   struct socket_cmd * old = cmdlist;
@@ -1180,5 +927,4 @@
 	  if ((new == cmdlist) && (new->next == NULL))
 	    {
-	      /* There is only one entry */
 	      cmdlist = NULL;
 	      SH_FREE(new);
@@ -1187,12 +933,7 @@
 	  else if (new == cmdlist)
 	    {
-	      /* first entry: new = old = cmdlist */
 	      cmdlist = new->next;
 	      SH_FREE(new);
-	      if (remove_all == S_FALSE)
-		return;
-	      old = cmdlist;
-	      new = cmdlist;
-	      continue;
+	      return;
 	    }
 	  else
@@ -1200,7 +941,5 @@
 	      old->next = new->next;
 	      SH_FREE(new);
-	      if (remove_all == S_FALSE)
-		return;
-	      new = old;
+	      return;
 	    }
 	}
@@ -1221,14 +960,21 @@
 
   if (pf_unix_fd  < 0)
-    return 0;
-
-  sl_strlcpy(cancel_cmd, _("CANCEL"), sizeof(cancel_cmd)); 
+    {
+      return 0;
+    }
+
+  sl_strlcpy(cancel_cmd, _("CANCEL"), SH_MAXMSGLEN); 
 
   while (sh_socket_read (&cmd) > 0)
     {
       if (0 == sl_strcmp(cmd.cmd, cancel_cmd))
-	sh_socket_rm2list  (cmd.clt, S_TRUE);
+	{
+	  sh_socket_rm2list  (cmd.clt);
+	}
       else
-	sh_socket_add2list (&cmd);
+	{
+	  sh_socket_rm2list  (cmd.clt);
+	  sh_socket_add2list (&cmd);
+	}
     }
   return 0;
@@ -1240,4 +986,5 @@
 char * sh_socket_check(const char * client_name)
 {
+  struct socket_cmd * old = cmdlist;
   struct socket_cmd * new = cmdlist;
   static char         out[SH_MAXMSGLEN];
@@ -1247,149 +994,17 @@
       if (0 == sl_strcmp(new->clt, client_name))
 	{
-	  sl_strlcpy(out,  new->cmd,  sizeof(out));
+	  sl_strlcpy(out, new->cmd, SH_MAXMSGLEN);
 	  sh_socket_add2run (new);
-	  sh_socket_rm2list (client_name, S_FALSE);
+	  sh_socket_rm2list  (client_name);
 	  return out;
 	}
+      old = new;
       new = new->next;
     }
   return NULL;
 }
+
 /* #if defined (SH_WITH_SERVER)
  */
 #endif
 
-
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_cmdlist (CuTest *tc) {
-
-#if defined (SH_WITH_SERVER)
-  struct socket_cmd cmd;
-  char * p;
-
-  sl_strlcpy(cmd.clt, "one", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-
-  sh_socket_add2list (&cmd);
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "RELOAD", p);
-
-  p = sh_socket_check("one");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "STOP",   sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  sl_strlcpy(cmd.clt, "two", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "STOP", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.clt, "three", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "STOP", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  sl_strlcpy(cmd.clt, "one", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "DELTA",   sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "RELOAD", p);
-
-  sl_strlcpy(cmd.clt, "two", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.clt, "three", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "STOP", p);
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "DELTA", p);
-  p = sh_socket_check("one");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  /* Test removal in correct order */
-  sl_strlcpy(cmd.clt, "one", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "STOP",   sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "DELTA",  sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "FOOBAR", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  
-  sh_socket_rm2list ("one", S_FALSE);
-
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "STOP", p);
-
-  sh_socket_rm2list ("one", S_FALSE);
-  
-  p = sh_socket_check("one");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "FOOBAR", p);
-
-  p = sh_socket_check("one");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  sl_strlcpy(cmd.clt, "one", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "STOP",   sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  sl_strlcpy(cmd.clt, "two", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.clt, "three", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "RELOAD", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  sl_strlcpy(cmd.clt, "one", sizeof(cmd.clt));
-  sl_strlcpy(cmd.cmd, "DELTA",  sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-  sl_strlcpy(cmd.cmd, "FOOBAR", sizeof(cmd.cmd));
-  sh_socket_add2list (&cmd);
-
-  sh_socket_rm2list ("one", S_TRUE);
-  p = sh_socket_check("one");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  p = sh_socket_check("two");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "STOP", p);
-  p = sh_socket_check("two");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "RELOAD", p);
-  p = sh_socket_check("two");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  p = sh_socket_check("three");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "STOP", p);
-  p = sh_socket_check("three");
-  CuAssertPtrNotNull(tc, p);
-  CuAssertStrEquals(tc, "RELOAD", p);
-  p = sh_socket_check("three");
-  CuAssertPtrEquals(tc, NULL, p);
-
-  p = sh_socket_check("four");
-  CuAssertPtrEquals(tc, NULL, p);
-#else
-  (void) tc;
-#endif
-}
-
-#endif  /* #ifdef SH_CUTEST */
-
-
-
Index: trunk/src/sh_srp.c
===================================================================
--- trunk/src/sh_srp.c	(revision 591)
+++ trunk/src/sh_srp.c	(revision 1)
@@ -29,17 +29,4 @@
 #ifdef USE_SRP_PROTOCOL
 
-/* dont modify this, unless you know what you do
- */
-#define SRP_GENERATOR_1024      "2"
-#define SRP_MODULUS_1024_1        \
-_("f488fd584e49dbcd20b49de49107366b336c380d451d0f7c88b31c7c5b2d8ef6") 
-#define SRP_MODULUS_1024_2        \
-_("f3c923c043f0a55b188d8ebb558cb85d38d334fd7c175743a31d186cde33212c") 
-#define SRP_MODULUS_1024_3        \
-_("b52aff3ce1b1294018118d7c84a70a72d686c40319c807297aca950cd9969fab")
-#define SRP_MODULUS_1024_4        \
-_("d00a509b0246d3083d66a45d419f9c7cbd894b221926baaba25ec355e92f78c7")
-
-
 #if (defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER))
 
@@ -61,5 +48,5 @@
 #define bignum MP_INT
 
-static
+inline
 int big_create (bignum * a)
 {
@@ -68,5 +55,5 @@
 }
 
-static
+inline
 int big_zerop (bignum * a)
 {
@@ -82,5 +69,5 @@
 }
 
-static
+inline
 int big_trunc (bignum * a, bignum * b, bignum * q, bignum *r)
 {
@@ -89,5 +76,5 @@
 }
 
-static
+inline
 int big_exptmod (bignum * a, bignum * b, bignum * c, bignum *d)
 {
@@ -99,5 +86,5 @@
 int    siz_str_internal = 0;
 
-static
+inline
 char * big_string (bignum * a, int base)
 {
@@ -109,5 +96,5 @@
   if (get_str_internal == NULL)
     {
-      get_str_internal = calloc(1,512);   /* only once */
+      get_str_internal = malloc(512);   /* only once */
       if (get_str_internal)
 	{
@@ -127,17 +114,5 @@
       size = strlen(str) + 1;
       if (size > siz_str_internal)
-	{
-	  char * ptr = realloc (get_str_internal, size);
-	  if (ptr)
-	    get_str_internal = ptr;
-	  else
-	    {
-	      /* "If realloc() fails, the original block is left untouched;
-	       * it is not freed or moved." */
-	      /* cppcheck-suppress doubleFree */
-	      free(get_str_internal);
-	      get_str_internal = NULL;
-	    }
-	}
+	get_str_internal = realloc (get_str_internal, size);
       if (get_str_internal == NULL)
 	{
@@ -146,5 +121,5 @@
 	}
       siz_str_internal = size;
-      sl_strlcpy (get_str_internal, str, siz_str_internal);
+      strcpy (get_str_internal, str);                   /* known to fit  */
       for (i = 0; i < (size-1); ++i)
 	if (get_str_internal[i] >= 'a' && get_str_internal[i] <= 'f' )
@@ -155,5 +130,5 @@
 }
 
-static 
+inline 
 int big_add(bignum * a, bignum * b, bignum * c)
 {
@@ -162,5 +137,5 @@
 }
 
-static 
+inline 
 int big_sub(bignum * a, bignum * b, bignum * c)
 {
@@ -169,5 +144,5 @@
 }
 
-static 
+inline 
 int big_mul(bignum * a, bignum * b, bignum * c)
 {
@@ -176,5 +151,5 @@
 }
 
-static 
+inline 
 int big_greaterp(bignum * a, bignum * b)
 {
@@ -182,5 +157,5 @@
 }
 
-static 
+inline 
 int big_set_big(bignum * a, bignum * b)
 {
@@ -190,5 +165,5 @@
 
 
-static 
+inline 
 int big_set_string(const char * str, int base, bignum * a)
 {
@@ -222,8 +197,7 @@
 
   char           *combi;
-  size_t          len, l2;
+  size_t          len;
   register int i;
   unsigned char * dez = NULL;
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_srp_x"));
@@ -244,13 +218,8 @@
 
   (void) sl_strlcpy (skey->vernam,
-		     sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN, 
-				   hashbuf, sizeof(hashbuf)), 
-		     KEY_LEN);
+		     sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN), KEY_LEN);
   skey->vernam[KEY_LEN] = '\0';
 
-  len = sl_strlen(salt) + 1;
-  l2  = sl_strlen(skey->vernam);
-  if (sl_ok_adds(len, l2))
-    len += l2;
+  len = sl_strlen(salt) + sl_strlen(skey->vernam) + 1;
 
   /* H(s,P)
@@ -261,6 +230,5 @@
   (void) sl_strlcpy (sh_srp.x, 
 		     sh_tiger_hash(combi, TIGER_DATA, 
-				   (unsigned long) sl_strlen(combi),
-				   hashbuf, sizeof(hashbuf)),
+				   (unsigned long) sl_strlen(combi)),
 		     KEY_LEN+1);
   SH_FREE (combi);
@@ -269,8 +237,9 @@
 }
 
-char * sh_srp_M (char * x1, char * x2, char * x3, char * hash, size_t size)
+char * sh_srp_M (char * x1, char * x2, char * x3)
 {
   char           *combi;
-  size_t          len, l2, l3;
+  size_t          len;
+  static char     hash[KEY_LEN+1];
   
   SL_ENTER(_("sh_srp_M"));
@@ -279,12 +248,5 @@
 	     _("x1 != NULL && x2 != NULL && x3 !=NULL"), NULL);
 
-  len = sl_strlen(x1) + 1;
-  l2  = sl_strlen(x2); 
-  l3  = sl_strlen(x3);
-
-  if (sl_ok_adds(len, l2))
-    len += l2;
-  if (sl_ok_adds(len, l3))
-    len += l3;
+  len = sl_strlen(x1) + sl_strlen(x2) + sl_strlen(x3) + 1;
   
   /* H(x1,x2,x3)
@@ -294,6 +256,7 @@
   (void) sl_strlcat (combi, x2, len);
   (void) sl_strlcat (combi, x3, len);
-  (void) sh_tiger_hash(combi, TIGER_DATA, (unsigned long) (len-1),
-		       hash, size);
+  (void) sl_strlcpy (hash, 
+		     sh_tiger_hash(combi, TIGER_DATA, (unsigned long) (len-1)),
+		     KEY_LEN+1);
   SH_FREE (combi);
   
@@ -362,15 +325,14 @@
   int    res;
   char   hash[KEY_LEN+1];
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_srp_make_a"));
 
   for (i = 0; i < 6; ++i)
-    randl[i] = (UINT32) taus_get ();
-
+    randl[i] = (UINT32) taus_get (&(skey->rng0[0]), 
+				  &(skey->rng1[0]),
+				  &(skey->rng2[0]));
   (void) sl_strlcpy (hash, 
 		     sh_tiger_hash((char *)&randl[0], TIGER_DATA, 
-				   (unsigned long) 6*sizeof(UINT32),
-				   hashbuf, sizeof(hashbuf)), 
+				   (unsigned long) 6*sizeof(UINT32)), 
 		     KEY_LEN+1);
 
@@ -413,5 +375,4 @@
   if (res != BIG_OK)             val = (-1);
   else if (0 != big_zerop(&AB) ) val = (-1); /* 0 != (sign == 0) */
-  else if (0 != big_zerop(&r) )  val = (-1); /* 0 != (sign == 0) */
   else                           val =    0;
 
@@ -423,5 +384,5 @@
 }
 
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#ifdef SH_WITH_CLIENT
   
 
@@ -431,4 +392,5 @@
   char    *str;
   char    *combi;
+  size_t   len;
   bigerr_t res;
 
@@ -446,5 +408,9 @@
   
   if (str != NULL)
-    combi = sh_util_strdup(str);
+    {
+      len = sl_strlen(str) + 1;
+      combi = SH_ALLOC(len);
+      (void) sl_strlcpy (combi, str, len);
+    }
   else
     combi = NULL;
@@ -464,4 +430,5 @@
   char    *str;
   char    *combi;
+  long     len;
   bigerr_t res;
 
@@ -502,5 +469,10 @@
   
   if (str != NULL)
-    combi = sh_util_strdup(str);
+    {
+      len = sl_strlen(str) + 1;
+      combi = SH_ALLOC(len);
+      sl_strlcpy (combi, str, len);
+      /* fprintf(stderr, "OK2a %ld %s\n", len, combi); */
+    }
   else
     combi = NULL;
@@ -517,5 +489,5 @@
   
   
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#ifdef SH_WITH_CLIENT
   
 char * sh_srp_S_c (char * u_str, char * B_str)
@@ -524,4 +496,5 @@
   char    *str;
   char    *combi;
+  size_t   len;
   bigerr_t res;
 
@@ -598,5 +571,9 @@
 
   if (str != NULL)
-    combi = sh_util_strdup(str);
+    {
+      len = sl_strlen(str) + 1;
+      combi = SH_ALLOC(len);
+      (void) sl_strlcpy (combi, str, len);
+    }
   else
     combi = NULL;
@@ -624,4 +601,5 @@
   char    *str;
   char    *combi;
+  size_t   len;
   bigerr_t res;
 
@@ -673,5 +651,9 @@
   
   if (str != NULL)
-    combi = sh_util_strdup(str);
+    {
+      len = sl_strlen(str) + 1;
+      combi = SH_ALLOC(len);
+      (void) sl_strlcpy (combi, str, len);
+    }
   else
     combi = NULL;
@@ -697,4 +679,5 @@
   char    *combi;
   char    *str;
+  size_t   len;
   bigerr_t res;
   
@@ -717,5 +700,9 @@
   
   if (str != NULL)
-    combi = sh_util_strdup(str);
+    {
+      len = sl_strlen(str) + 1;
+      combi = SH_ALLOC(len);
+      (void) sl_strlcpy (combi, str, len);
+    }
   else
     combi = NULL;
@@ -737,95 +724,4 @@
 
 
-#ifdef SH_CUTEST
-#include "CuTest.h"
-
-void Test_srp (CuTest *tc)
-{
-#if defined(USE_SRP_PROTOCOL) && (defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER))
-
-  int result;
-  char     modulus[80*4];
-  bignum   a, b, c;
-  bigerr_t res;
-  char    *str = NULL;
-
-  res = sh_srp_init();
-  CuAssertTrue(tc, res == 0);
-
-  (void) sl_strlcpy(modulus, SRP_MODULUS_1024_1, sizeof(modulus));
-  (void) sl_strlcat(modulus, SRP_MODULUS_1024_2, sizeof(modulus));
-  (void) sl_strlcat(modulus, SRP_MODULUS_1024_3, sizeof(modulus));
-  (void) sl_strlcat(modulus, SRP_MODULUS_1024_4, sizeof(modulus));
-
-  res = big_create(&a);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  /* Check plain zero 
-   */
-  result = sh_srp_check_zero ("0");
-  CuAssertTrue(tc, result != 0);
-  
-  res = big_set_string ("0",  16, &a);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  result = sh_srp_check_zero (big_string(&a, 16));
-  CuAssertTrue(tc, result != 0);
-
-  /* Check modulus (equals 0 % M) 
-   */
-  result = sh_srp_check_zero (modulus);
-  CuAssertTrue(tc, result != 0);
-
-  res = big_set_string (modulus,  16, &a);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  result = sh_srp_check_zero (big_string(&a, 16));
-  CuAssertTrue(tc, result != 0);
-
-  /* Check non-zero 
-   */
-  modulus[0] = 'a';
-
-  result = sh_srp_check_zero (modulus);
-  CuAssertTrue(tc, result == 0);
-
-  res = big_set_string (modulus,  16, &a);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  result = sh_srp_check_zero (big_string(&a, 16));
-  CuAssertTrue(tc, result == 0);
-
-  modulus[0] = 'f';
-
-  /* Check multiple of modulus 
-   */
-  res = big_set_string (modulus,  16, &a);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  res = big_create(&b);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  res = big_create(&c);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  res = big_set_string ("deadbeef", 16, &b);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  res = big_mul (&a, &b, &c);
-  CuAssertTrue(tc, res == BIG_OK);
-
-  str = strdup(big_string (&c, 16));
-  CuAssertPtrNotNull(tc, str);
-
-  result = sh_srp_check_zero (str);
-  CuAssertTrue(tc, result != 0);
-
-#else
-  (void) tc; /* fix compiler warning */
-#endif
-  return;
-}
-#endif
-
-
-
+
+
Index: trunk/src/sh_static.c
===================================================================
--- trunk/src/sh_static.c	(revision 591)
+++ trunk/src/sh_static.c	(revision 1)
@@ -52,10 +52,4 @@
 #include <grp.h>
 
-#include "sh_pthread.h"
-
-extern  int sl_close_fd (const char * file, int line, int fd);
-extern  int sl_fclose (const char * file, int line, FILE * fp);
-
-
 #ifndef _PATH_PASSWD
 #define _PATH_PASSWD "/etc/passwd"
@@ -65,9 +59,4 @@
 #endif
 
-#undef  FIL__
-#define FIL__  _("sh_static.c")
-
-extern  int sl_strlcpy(char * dst, /*@null@*/const char * src, size_t siz);
-extern  int sl_strlcat(char * dst, /*@null@*/const char * src, size_t siz);
 
 
@@ -76,6 +65,5 @@
 
 #define PWD_BUFFER_SIZE 256
-#define GRP_BUFFER_SIZE 3584
-#define GRP_BUFFER_SIZE_MALLOC 32768
+#define GRP_BUFFER_SIZE 256
 
 /**********************************************************************/
@@ -102,8 +90,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 
-int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-		    char *__restrict buffer, size_t buflen,
-		    GETXXKEY_R_ENTTYPE **__restrict result)
+static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+			   char *__restrict buffer, size_t buflen,
+			   GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -131,5 +119,5 @@
       }
     } while (1);
-    sl_fclose(FIL__, __LINE__, stream);
+    fclose(stream);
   }
   
@@ -150,8 +138,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 
-int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-		    char *__restrict buffer, size_t buflen,
-		    GETXXKEY_R_ENTTYPE **__restrict result)
+static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+			   char *__restrict buffer, size_t buflen,
+			   GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -179,5 +167,5 @@
       }
     } while (1);
-    sl_fclose(FIL__, __LINE__, stream);
+    fclose(stream);
   }
   
@@ -198,8 +186,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_PASSWD
 
-int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-		    char *__restrict buffer, size_t buflen,
-		    GETXXKEY_R_ENTTYPE **__restrict result)
+static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+			   char *__restrict buffer, size_t buflen,
+			   GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -227,5 +215,5 @@
       }
     } while (1);
-    sl_fclose(FIL__, __LINE__, stream);
+    fclose(stream);
   }
   
@@ -246,8 +234,8 @@
 #define DO_GETXXKEY_R_PATHNAME  _PATH_GROUP
 
-int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
-		    GETXXKEY_R_ENTTYPE *__restrict resultbuf,
-		    char *__restrict buffer, size_t buflen,
-		    GETXXKEY_R_ENTTYPE **__restrict result)
+static int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
+			   GETXXKEY_R_ENTTYPE *__restrict resultbuf,
+			   char *__restrict buffer, size_t buflen,
+			   GETXXKEY_R_ENTTYPE **__restrict result)
 {
   FILE *stream;
@@ -275,5 +263,5 @@
       }
     } while (1);
-    sl_fclose(FIL__, __LINE__, stream);
+    fclose(stream);
   }
   
@@ -291,9 +279,4 @@
 }
 
-struct passwd * getpwuid(uid_t uid)
-{
-        return sh_getpwuid(uid);
-}
-
 struct group * sh_getgrgid(gid_t gid)
 {
@@ -306,8 +289,4 @@
 }
 
-struct group * getgrgid(gid_t gid)
-{
-        return sh_getgrgid(gid);
-}
 
 struct passwd * sh_getpwnam(const char *name)
@@ -331,6 +310,6 @@
 }
 
-SH_MUTEX_STATIC(pwf_lock, PTHREAD_MUTEX_INITIALIZER);
-
+#define LOCK		((void) 0)
+#define UNLOCK		((void) 0)
 
 static FILE *pwf = NULL;
@@ -338,19 +317,19 @@
 void  sh_setpwent(void)
 {
-        SH_MUTEX_LOCK(pwf_lock);
+	LOCK;
 	if (pwf) {
 		rewind(pwf);
 	}
-	SH_MUTEX_UNLOCK(pwf_lock);
+	UNLOCK;
 }
 
 void  sh_endpwent(void)
 {
-        SH_MUTEX_LOCK(pwf_lock);
+	LOCK;
 	if (pwf) {
-		sl_fclose(FIL__, __LINE__, pwf);
+		fclose(pwf);
 		pwf = NULL;
 	}
-	SH_MUTEX_UNLOCK(pwf_lock);
+	UNLOCK;
 }
 
@@ -362,5 +341,5 @@
 	int rv;
 
-        SH_MUTEX_LOCK(pwf_lock);
+	LOCK;
 
 	*result = NULL;				/* In case of error... */
@@ -380,11 +359,11 @@
 
  ERR:
-	; /* 'label at end of compound statement' */
-	SH_MUTEX_UNLOCK(pwf_lock);
+	UNLOCK;
 
 	return rv;
 }
 
-SH_MUTEX_STATIC(grf_lock, PTHREAD_MUTEX_INITIALIZER);
+#define LOCK		((void) 0)
+#define UNLOCK		((void) 0)
 
 static FILE *grf = NULL;
@@ -392,19 +371,19 @@
 void  sh_setgrent(void)
 {
-	SH_MUTEX_LOCK(grf_lock);
+	LOCK;
 	if (grf) {
 		rewind(grf);
 	}
-	SH_MUTEX_UNLOCK(grf_lock);
+	UNLOCK;
 }
 
 void  sh_endgrent(void)
 {
-	SH_MUTEX_LOCK(grf_lock);
+	LOCK;
 	if (grf) {
-		sl_fclose(FIL__, __LINE__, grf);
+		fclose(grf);
 		grf = NULL;
 	}
-	SH_MUTEX_UNLOCK(grf_lock);
+	UNLOCK;
 }
 
@@ -415,5 +394,5 @@
 	int rv;
 
-	SH_MUTEX_LOCK(grf_lock);
+	LOCK;
 
 	*result = NULL;				/* In case of error... */
@@ -433,6 +412,5 @@
 
  ERR:
-	; /* 'label at end of compound statement' */
-	SH_MUTEX_UNLOCK(grf_lock);
+	UNLOCK;
 
 	return rv;
@@ -457,5 +435,5 @@
 	struct group *result;
 
-	sh_getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
+	 sh_getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
 	return result;
 }
@@ -464,16 +442,14 @@
 {
 	FILE *grf;
-	gid_t *group_list = NULL;
-	size_t num_groups;
-	int rv;
+	gid_t *group_list;
+	int num_groups, rv;
 	char **m;
 	struct group group;
-
-	char * buff = calloc(1,GRP_BUFFER_SIZE_MALLOC);
+	char buff[PWD_BUFFER_SIZE];
 
 	rv = -1;
 
 	/* We alloc space for 8 gids at a time. */
-	if (buff && ((group_list = calloc(8,sizeof(gid_t *))) != NULL)
+	if (((group_list = (gid_t *) malloc(8*sizeof(gid_t *))) != NULL)
 		&& ((grf = fopen(_PATH_GROUP, "r")) != NULL)
 		) {
@@ -484,5 +460,5 @@
 		num_groups = 1;
 
-		while (!__pgsreader(__parsegrent, &group, buff, GRP_BUFFER_SIZE_MALLOC, grf)) {
+		while (!__pgsreader(__parsegrent, &group, buff, sizeof(buff), grf)) {
 			assert(group.gr_mem); /* Must have at least a NULL terminator. */
 			if (group.gr_gid != gid) {
@@ -490,19 +466,12 @@
 					if (!strcmp(*m, user)) {
 						if (!(num_groups & 7)) {
-						  gid_t *tmp = NULL;
-						  if (num_groups > (SIZE_MAX - 8)) {
-						    rv = -1;
-						    goto DO_CLOSE;
-						  }
-						  if ((num_groups+8) <= (SIZE_MAX / sizeof(gid_t *))) {
-						    tmp = (gid_t *)
-						      realloc(group_list,
-							      (num_groups+8) * sizeof(gid_t *));
-						  } 
-						  if (!tmp) {
-						    rv = -1;
-						    goto DO_CLOSE;
-						  }
-						  group_list = tmp;
+							gid_t *tmp = (gid_t *)
+								realloc(group_list,
+										(num_groups+8) * sizeof(gid_t *));
+							if (!tmp) {
+								rv = -1;
+								goto DO_CLOSE;
+							}
+							group_list = tmp;
 						}
 						group_list[num_groups++] = group.gr_gid;
@@ -515,12 +484,10 @@
 		rv = setgroups(num_groups, group_list);
 	DO_CLOSE:
-		sl_fclose(FIL__, __LINE__, grf);
+		fclose(grf);
 	}
 
 	/* group_list will be NULL if initial malloc failed, which may trigger
 	 * warnings from various malloc debuggers. */
-	if (group_list) free(group_list);
-	if (buff) free(buff);
-	/* cppcheck-suppress resourceLeak */
+	free(group_list);
 	return rv;
 }
@@ -700,6 +667,6 @@
 		skip = 0;
 		do {
-			if (!fgets(line_buff, buflen, f)) {
-				if (feof(f)) {
+			if (!fgets_unlocked(line_buff, buflen, f)) {
+				if (feof_unlocked(f)) {
 					rv = ENOENT;
 				}
@@ -711,10 +678,6 @@
 				line_buff[line_len] = 0;
 			} else if (line_len + 2 == buflen) { /* line too long */
-			        rv = ERANGE;
-				break;
-				/*
 				++skip;
 				continue;
-				*/
 			}
 
@@ -886,5 +849,5 @@
 #include <arpa/inet.h>
 
-/* sl_close_fd(FIL__, __LINE__, )
+/* close()
  */
 #include <unistd.h>
@@ -898,5 +861,6 @@
 #include <arpa/nameser.h>
 
-SH_MUTEX_STATIC(resolv_lock, PTHREAD_MUTEX_INITIALIZER);
+#define BIGLOCK
+#define BIGUNLOCK
 
 #define __UCLIBC_HAS_IPV6__
@@ -917,8 +881,7 @@
 
 #undef DEBUG
-/* #define DEBUG */
+/*#define DEBUG*/
 
 #ifdef DEBUG
-/* flawfinder: ignore *//* definition of debug macro */
 #define DPRINTF(X,args...) fprintf(stderr, X, ##args)
 #else
@@ -1008,31 +971,14 @@
 		return -1;
 
-	do {
-		l = data[offset];
-		if (offset < INT_MAX)
-	                offset++;
-		else
-		        return -1;
-		if (!l)
-		  break;
-		
-		DPRINTF("l[%d] = %d\n", offset, l);
+	while ((l = data[offset++])) {
 
 		if ((l & 0xc0) == (0xc0)) {
-		        if (offset < INT_MAX)
-			  offset++;
-			else
-			  return -1;
+			offset++;
 			break;
 		}
 
-		if (offset <= (INT_MAX - l))
-		  offset += l;
-		else
-		  return -1;
-
-	} while (l);
-
-	DPRINTF("orig: %d now %d\n", orig_offset, offset);
+		offset += l;
+	}
+
 	return offset - orig_offset;
 }
@@ -1045,8 +991,6 @@
 	if (i < 0)
 		return i;
-	if (i < (INT_MAX - 4))
-	  return i + 4;
-	else
-	  return -1;
+
+	return i + 4;
 }
 
@@ -1064,44 +1008,26 @@
 	if (!data)
 		return -1;
-	if ((offset < 0) || (offset > (PACKETSZ-1)))
-	        return -1;
-	while ((l=data[offset])) {
-	        if (offset < (PACKETSZ-1)) offset++;
-		else return -1;
+
+	while ((l=data[offset++])) {
 		if (measure)
-		    { if (total < INT_MAX) total++; else return -1; }
+		    total++;
 		if ((l & 0xc0) == (0xc0)) {
-		        if (measure)
-			  { if (total < INT_MAX) total++; else return -1; }
-		        /* compressed item, redirect */ 
+			if (measure)
+				total++;
+			/* compressed item, redirect */
 			offset = ((l & 0x3f) << 8) | data[offset];
-			if ((offset < 0) || (offset > (PACKETSZ-1)))
-			  return -1; 
 			measure = 0;
 			continue;
 		}
-	        
-		if (used >= (INT_MAX - l))
-		  return -1;
 
 		if ((used + l + 1) >= maxlen)
-		  return -1; 
+			return -1;
 
 		memcpy(dest + used, data + offset, l);
-		
-		if (offset <= ((PACKETSZ-1) - l))
-		  offset += l;
-		else
-		  return -1;
-
-		if (used <= (INT_MAX - l))
-		  used += l;
-		else
-		  return -1;
+		offset += l;
+		used += l;
 		if (measure)
-		  { if (total <= (INT_MAX -l)) total += l; else return -1; }
-
-		if (used >= maxlen)
-		  return -1;
+			total += l;
+
 		if (data[offset] != 0)
 			dest[used++] = '.';
@@ -1112,5 +1038,5 @@
 	/* The null byte must be counted too */
 	if (measure) {
-	    if (total < INT_MAX) total++; else return -1; 
+	    total++;
 	}
 
@@ -1124,14 +1050,11 @@
 {
 	char temp[256];
-	int i = 0;
+	int i;
 
 	i = __decode_dotted(message, offset, temp, sizeof(temp));
-	if (i < 0 || i > PACKETSZ)
-		return -1;
-
-	if (offset <= ((PACKETSZ - 10) - i))
-	  message += offset + i;
-	else
-	  return -1;
+	if (i < 0)
+		return i;
+
+	message += offset + i;
 
 	a->dotted = strdup(temp);
@@ -1150,12 +1073,5 @@
 	DPRINTF("i=%d,rdlength=%d\n", i, a->rdlength);
 
-	if (RRFIXEDSZ <= (INT_MAX - i))
-	  i += RRFIXEDSZ;
-	else
-	  return -1;
-	if (a->rdlength <= (INT_MAX - i))
-	  return i + a->rdlength;
-	else
-	  return -1;
+	return i + RRFIXEDSZ + a->rdlength;
 }
 
@@ -1204,6 +1120,4 @@
 
 	dest += i;
-	if (maxlen < i)
-	  return -1;
 	maxlen -= i;
 
@@ -1216,8 +1130,5 @@
 	dest[3] = (q->qclass & 0x00ff) >> 0;
 
-	if (i <= (INT_MAX - 4))
-	  return i + 4;
-	else
-	  return -1;
+	return i + 4;
 }
 
@@ -1238,6 +1149,6 @@
 	struct resolv_question q;
 	int retries = 0;
-	unsigned char * packet = calloc(1,PACKETSZ);
-	char *dns, *lookup = calloc(1,MAXDNAME);
+	unsigned char * packet = malloc(PACKETSZ);
+	char *dns, *lookup = malloc(MAXDNAME);
 	int variant = 0;
 	struct sockaddr_in sa;
@@ -1254,11 +1165,11 @@
 	DPRINTF("Looking up type %d answer for '%s'\n", type, name);
 
-	SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+	LOCK;
 	ns %= nscount;
-	SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+	UNLOCK;
 
 	while (retries++ < MAX_RETRIES) {
 		if (fd != -1)
-			sl_close_fd(FIL__, __LINE__, fd);
+			close(fd);
 
 		memset(packet, 0, PACKETSZ);
@@ -1267,15 +1178,15 @@
 
 		/* Mess with globals while under lock */
-		SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+		LOCK;
 		++id;
 		id &= 0xffff;
 		h.id = id;
 		dns = nsip[ns];
-		SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+		UNLOCK;
 
 		h.qdcount = 1;
 		h.rd = 1;
 
-		DPRINTF("encoding header %d\n", h.rd);
+		DPRINTF("encoding header\n", h.rd);
 
 		i = __encode_header(&h, packet, PACKETSZ);
@@ -1283,12 +1194,12 @@
 			goto fail;
 
-		sl_strlcpy(lookup,name,MAXDNAME);
-		SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+		strncpy(lookup,name,MAXDNAME);
+		BIGLOCK;
 		if (variant < __searchdomains && strchr(lookup, '.') == NULL)
 		{
-		    sl_strlcat(lookup,".", MAXDNAME);
-		    sl_strlcat(lookup,__searchdomain[variant], MAXDNAME);
-		}
-		SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+		    strncat(lookup,".", MAXDNAME);
+		    strncat(lookup,__searchdomain[variant], MAXDNAME);
+		}
+		BIGUNLOCK;
 		DPRINTF("lookup name: %s\n", lookup);
 		q.dotted = (char *)lookup;
@@ -1363,16 +1274,15 @@
 		}
 
-		/* ok because we have checked that recv at least HFIXEDSZ */
 		__decode_header(packet, &h);
 
 		DPRINTF("id = %d, qr = %d\n", h.id, h.qr);
 
-		SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+		LOCK;
 		if ((h.id != id) || (!h.qr)) {
-			SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+			UNLOCK;
 			/* unsolicited */
 			goto again;
 		}
-		SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+		UNLOCK;
 
 
@@ -1397,6 +1307,4 @@
 				goto again;
 			pos += i;
-			if (pos >= PACKETSZ)
-			        goto again;
 		}
 		DPRINTF("Decoding answer at pos %d\n", pos);
@@ -1417,6 +1325,4 @@
 		    free(a->dotted);
 		    pos += i;
-		    if (pos >= PACKETSZ)
-		            goto again;
 		}
 
@@ -1424,5 +1330,5 @@
 		DPRINTF("Answer type = |%d|\n", a->atype);
 
-		sl_close_fd(FIL__, __LINE__, fd);
+		close(fd);
 
 		if (outpacket)
@@ -1439,7 +1345,7 @@
 		    int sdomains;
 
-		    SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+		    BIGLOCK;
 		    sdomains=__searchdomains;
-		    SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+		    BIGUNLOCK;
 		    variant = 0;
 		    if (retries >= nscount*(sdomains+1))
@@ -1451,7 +1357,7 @@
 		{
 		    int sdomains;
-		    SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+		    BIGLOCK;
 		    sdomains=__searchdomains;
-		    SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+		    BIGUNLOCK;
 
 		    if (variant < sdomains) {
@@ -1460,7 +1366,7 @@
 		    } else {
 			/* next server, first search */
-			SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+			LOCK;
 			ns = (ns + 1) % nscount;
-			SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+			UNLOCK;
 			variant = 0;
 		    }
@@ -1470,5 +1376,5 @@
 fail:
 	if (fd != -1)
-	    sl_close_fd(FIL__, __LINE__, fd);
+	    close(fd);
 	if (lookup)
 	    free(lookup);
@@ -1483,5 +1389,4 @@
 		*fp = fopen("/etc/config/hosts", "r");
 	}
-	/* cppcheck-suppress resourceLeak */
 	return;
 }
@@ -1559,7 +1464,4 @@
 
 	*h_errnop=HOST_NOT_FOUND;
-	if (fp == NULL) {
-	        return ret;
-	}
 	while (fgets(buf, buflen, fp)) {
 		if ((cp = strchr(buf, '#')))
@@ -1630,10 +1532,10 @@
         
 		if (action!=GETHOSTENT) {
-			sl_fclose(FIL__, __LINE__, fp);
+			fclose(fp);
 		}
 		return ret;
 	}
 	if (action!=GETHOSTENT) {
-		sl_fclose(FIL__, __LINE__, fp);
+		fclose(fp);
 	}
 	return ret;
@@ -1653,5 +1555,5 @@
 }
 
-static int __open_nameservers(void)
+static int __open_nameservers()
 {
 	FILE *fp;
@@ -1661,7 +1563,8 @@
 	int argc;
 
-	SH_MUTEX_LOCK(resolv_lock);
-	if (__nameservers > 0) {
-	  goto the_end;
+	BIGLOCK;
+	if (__nameservers > 0) { 
+	    BIGUNLOCK;
+	    return 0;
 	}
 
@@ -1703,13 +1606,10 @@
 			}
 		}
-		sl_fclose(FIL__, __LINE__, fp);
+		fclose(fp);
 	} else {
 	    DPRINTF("failed to open %s\n", "resolv.conf");
 	}
 	DPRINTF("nameservers = %d\n", __nameservers);
- the_end:
-	; /* 'label at end of compound statement' */
-	SH_MUTEX_UNLOCK(resolv_lock);
-	/* cppcheck-suppress resourceLeak */
+	BIGUNLOCK;
 	return 0;
 }
@@ -1730,5 +1630,4 @@
 	char ** __nameserverXX;
 
-	DPRINTF("sh_gethostbyname_r: /%s/\n", name);
 	__open_nameservers();
 
@@ -1774,5 +1673,5 @@
 	if (buflen<256)
 		return ERANGE;
-	strncpy(buf, name, buflen-1);
+	strncpy(buf, name, buflen);
 
 	/* First check if this is already an address */
@@ -1789,8 +1688,8 @@
 	for (;;) {
 
-	SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+	BIGLOCK;
 	__nameserversXX=__nameservers;
 	__nameserverXX=__nameserver;
-	SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+	BIGUNLOCK;
 		i = __dns_lookup(buf, T_A, __nameserversXX, __nameserverXX, &packet, &a);
 
@@ -1801,5 +1700,5 @@
 		}
 
-		strncpy(buf, a.dotted, buflen-1);
+		strncpy(buf, a.dotted, buflen);
 		free(a.dotted);
 
@@ -1831,5 +1730,4 @@
 			free(packet);
 			*h_errnop=HOST_NOT_FOUND;
-			DPRINTF("host_not_found\n");
 			return TRY_AGAIN;
 		}
@@ -1843,12 +1741,12 @@
 struct hostent * sh_gethostbyname(const char *name)
 {
-        static struct hostent h = { NULL, NULL, 0, 0, NULL};
+	static struct hostent h;
 	static char buf[sizeof(struct in_addr) +
 			sizeof(struct in_addr *)*2 +
 			sizeof(char *)*(ALIAS_DIM) + 256/*namebuffer*/ + 32/* margin */];
 	struct hostent *hp;
-	
-	DPRINTF("sh_gethostbyname: /%s/\n", name);
+
 	sh_gethostbyname_r(name, &h, buf, sizeof(buf), &hp, &h_errno);
+
 	return hp;
 }
@@ -1909,5 +1807,4 @@
 	char ** __nameserverXX;
 
-	DPRINTF("sh_gethostbyaddr_r called\n");
 	*result=NULL;
 	if (!addr)
@@ -1984,5 +1881,5 @@
 
 	if(type == AF_INET) {
-		const unsigned char *tmp_addr = (const unsigned char *)addr;
+		unsigned char *tmp_addr = (unsigned char *)addr;
 
 		memcpy(&in->s_addr, addr, len);
@@ -2011,8 +1908,8 @@
 	for (;;) {
 
-	SH_MUTEX_LOCK_UNSAFE(resolv_lock);
+	BIGLOCK;
 	__nameserversXX=__nameservers;
 	__nameserverXX=__nameserver;
-	SH_MUTEX_UNLOCK_UNSAFE(resolv_lock);
+	BIGUNLOCK;
 		i = __dns_lookup(buf, T_PTR, __nameserversXX, __nameserverXX, &packet, &a);
 
@@ -2022,5 +1919,5 @@
 		}
 
-		strncpy(buf, a.dotted, buflen-1);
+		strncpy(buf, a.dotted, buflen);
 		free(a.dotted);
 
@@ -2080,5 +1977,4 @@
 	struct hostent *hp;
 
-	DPRINTF("sh_gethostbyaddr called\n");
 	sh_gethostbyaddr_r(addr, len, type, &h, buf, sizeof(buf), &hp, &h_errno);
         
Index: trunk/src/sh_string.c
===================================================================
--- trunk/src/sh_string.c	(revision 591)
+++ 	(revision )
@@ -1,1057 +1,0 @@
-
-#include "config_xor.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <sys/types.h>
-
-#include "sh_string.h"
-#include "sh_mem.h"
-
-#undef  FIL__
-#define FIL__  _("sh_string.c")
-
-extern int sl_ok_adds (size_t a, size_t b);
-#define S_TRUE  1
-#define S_FALSE 0
-
-#include <ctype.h>
-#include <errno.h>
-
-/* Split array at delim in at most nfields fields. 
- * Empty fields are returned as empty (zero-length) strings. 
- * Leading and trailing WS are removed from token. 
- * The number of fields is returned in 'nfields', their
- * lengths in 'lengths'.
- * A single delimiter will return two empty fields.
- */
-char ** split_array(char *line, unsigned int * nfields, 
-                    char delim, size_t * lengths)
-{
-  char *a, *e, *s;
-  unsigned int i = 0;
-  int flag = 0;
-  char **arr;
-  unsigned int maxfields = (*nfields);
-
-  arr = SH_ALLOC((maxfields+1) * sizeof (char*));
-
-  e = line;
-
-  do
-    {
-      /* skip leading WS 
-       */
-      for (s=e; *s && isspace((int)*s); ++s) /* nothing */;
-
-      if (*s) 
-        {
-          /* move a to next delim
-           */
-          for (a=s; *a && *a != delim; ++a) /* nothing */;
-          
-          /* set e to next after delim
-           */
-          if (*a == delim)
-            {
-              e    = a+1;
-              flag = 1;
-            }
-          else /* (!*a) */
-            {
-              e    = a;
-              flag = 0;
-            }
-
-          if (a != line)
-            {
-	      if (i < (maxfields -1))
-                {
-
-		  /* chop off trailing WS 
-		   */
-		  for (a--; isspace((int)*a) && a > s; a--) /* do nothing */;
-		  
-		  /* terminate string
-		   */
-		  ++a; *a = '\0';
-		}
-              else
-                {
-                  /* If nfields < actual fields, last string 
-                   * will be remainder, therefore skip to end.
-                   */
-                  if ( *a )
-                    {
-                      do {
-                        a++;
-                      } while ( *a );
-                    }
-                }
-	    }
-          else
-            {
-              *a = '\0';
-            }
-        }
-      else /* (!*s) */
-        {
-          a = s;
-	  /* (i == 0) handles the special case of splitting the empty string */
-          if (flag || i == 0) 
-            {
-              flag = 0;
-              goto setnext;
-            }
-          break;
-        }
-
-    setnext:
-      lengths[i] = (size_t) (a-s); /* a >= s always */
-      arr[i] = s;
-      ++i;
-
-    } while (i < maxfields);
-
-  *nfields = i;
-  arr[i]   = NULL;
-
-  return arr;
-}
-
-/* Split array at whitespace in at most nfields fields.
- * Multiple whitespaces are collapsed. 
- * Empty fields are returned as empty (zero-length) strings.
- * The number of fields is returned in nfields.
- * An empty string will return zero fields.
- * If nfields < actual fields, last string will be remainder.
- */
-
-#define SH_SPLIT_LIST 0
-#define SH_SPLIT_WS   1
-
-char ** split_array_ws_int (char *line, 
-			    unsigned int * nfields, size_t * lengths,
-			    const char *delim, int isList)
-{
-  char *a, *e, *s;
-  unsigned int i = 0;
-  char **arr;
-  unsigned int maxfields = (*nfields);
-
-  arr = SH_ALLOC((maxfields+1) * sizeof (char*));
-
-  e = line;
-
-  do
-    {
-      s = e;
-
-      /* skip leading WS 
-       */
-      if (isList == SH_SPLIT_WS)
-	{
-	  if ( *s && isspace((int)*s) )
-	    {
-	      do {
-		++s;
-	      } while ( *s && isspace((int)*s) );
-	    }
-	}
-      else
-	{
-          if ( *s && strchr(delim, (int)*s))
-            {
-              do {
-                ++s;
-              } while ( *s && strchr(delim, (int)*s));
-            }
-
-	}
-
-      if (*s)
-        {
-
-          /* s is at non-ws, move a to next ws
-           */
-          a = s;
-	  if (isList == SH_SPLIT_WS)
-	    {
-	      do {
-		a++;
-	      } while ( *a && (!isspace((int)*a)) );
-	    }
-	  else
-	    {
-              do {
-                a++;
-              } while ( *a && NULL == strchr(delim, (int)*a));
-	    }
-
-          /* next token, *a is either ws or '\0' 
-           */
-          e = ( (*a) ? a+1 : a);
-          
-          /* terminate and set arr[i]
-           */
-          if (i < (maxfields-1))
-	    {
-              *a = '\0';
-	    }
-	  else
-	    {
-	      /* If nfields < actual fields, last 
-	       * string will be remainder. Therefore
-	       * skip to end.
-	       */
-	      if ( *a )
-		{
-		  do {
-		    a++;
-		  } while ( *a );
-		}
-	    }
-          lengths[i] = (size_t)(a-s); /* a >= s always */
-          arr[i]     = s; 
-          ++i;
-        }
-      else /* if (!*s) */
-        {
-          break;
-        }
-
-    } while (i < maxfields);
-
-  *nfields = i;
-  arr[i]   = NULL;
-
-  return arr;
-}
-
-char ** split_array_ws (char *line, 
-			unsigned int * nfields, size_t * lengths)
-{
-  return split_array_ws_int (line, nfields, lengths, NULL, SH_SPLIT_WS);
-}
-
-char ** split_array_list (char *line, 
-			  unsigned int * nfields, size_t * lengths)
-{
-  return split_array_ws_int (line, nfields, lengths, ", \t", SH_SPLIT_LIST);
-}
-
-char ** split_array_token (char *line, 
-			   unsigned int * nfields, size_t * lengths,
-			   const char * token)
-{
-  return split_array_ws_int (line, nfields, lengths, token, SH_SPLIT_LIST);
-}
-
-/* return a split() of a list contained in 'PREFIX\s*( list ).*'
- */
-char ** split_array_braced (char *line, const char * prefix,
-			    unsigned int * nfields, size_t * lengths)
-{
-  char * s = line;
-  char * p;
-  unsigned int sind = (prefix) ? strlen(prefix) : 0;
-
-  while ( *s && isspace((int)*s) ) ++s;
-  if (prefix && 0 != strncmp(s, prefix, strlen(prefix)))
-    return NULL;
-  s = &s[sind];
-  while ( *s && isspace((int)*s) ) ++s;
-  if (!s || (*s != '('))
-    return NULL;
-  ++s;
-  p = strchr(s, ')');
-  if (!p || (*p == *s))
-    return NULL;
-  *p = '\0';
-  return split_array_list (s, nfields, lengths);
-}
-
-#define SH_STRING_PARCEL 120
-
-static
-size_t sh_string_read_int(sh_string * s, FILE * fp, size_t maxlen, char *start);
-
-size_t sh_string_read(sh_string * s, FILE * fp, size_t maxlen)
-{
-  return sh_string_read_int(s, fp, maxlen, NULL);
-}
-
-size_t sh_string_read_cont(sh_string * s, FILE * fp, size_t maxlen, char *cont)
-{
-  return sh_string_read_int(s, fp, maxlen, cont);
-}
-
-static char * sh_str_fgets (char *s, int size, FILE *fp)
-{
-  char * ret;
-  do {
-    clearerr(fp);
-    ret = fgets(s, size, fp);
-  } while (ret == NULL && ferror(fp) && errno == EAGAIN);
-
-  return ret;
-}
-
-size_t sh_string_read_int(sh_string * s, FILE * fp, size_t maxlen, char *start)
-{
-
-  /* case 0) start != NULL and first char not in 'start'
-   */
-  if (start)
-    {
-      int first;
-
-      do {
-	clearerr(fp);
-	first = fgetc(fp);
-      } while (first == EOF && ferror(fp) && errno == EAGAIN);
-
-      if (first == EOF)
-	{
-	  sh_string_truncate(s, 0);
-	  if (ferror(fp))
-	    return -1;
-	  return 0;
-	}
-
-      if (NULL == strchr(start, first))
-	{
-	  ungetc(first, fp);
-	  return 0;
-	}
-      ungetc(first, fp);
-    }
-
-  /* case 1) EOF or error 
-   */
-  if (sh_str_fgets(s->str, s->siz, fp) == NULL)
-    {
-      sh_string_truncate(s, 0);
-      if (ferror(fp))
-        return -1;
-      return 0;
-    }
-
-  /* case 2) end of line reached. strlen should always be > 0
-   *         because of the '\n', but we check.
-   */
-  s->len = strlen(s->str);
-  if (s->len > 0 && (s->str)[s->len-1] == '\n') 
-    {
-      (s->str)[s->len-1] = '\0';
-      --(s->len);
-      return (s->len + 1);
-    }
-      
-  /* case 3) incomplete string
-   */
-  for (;;) {
-    
-    if (maxlen > 0 && (s->siz+SH_STRING_PARCEL) > maxlen)
-      {
-        if (s->siz < maxlen)
-          sh_string_grow(s, (maxlen-s->siz));
-        else
-          return -2;
-      }
-    else
-      {
-        sh_string_grow(s, 0);
-      }
-    
-    if (sh_str_fgets(&(s->str[s->len]), (s->siz - s->len), fp) == NULL) 
-      {
-        if (ferror(fp))
-          {
-            sh_string_truncate(s, 0);
-            return -1;
-          }
-        return s->len;
-      }
-    
-    s->len += strlen( &(s->str[s->len]) );
-    if (s->len > 0 && s->str[s->len-1] == '\n')
-      {
-        (s->str)[s->len-1] = '\0';
-        --(s->len);
-        return (s->len + 1);
-      }
-  }
-
-  /* notreached */
-}
-
-sh_string * sh_string_cat_lchar(sh_string * s, const char * str, size_t len)
-{
-  if (sl_ok_adds(len, s->siz) == S_TRUE)
-    {
-      if ((len + 1 + s->len) > s->siz)
-	{
-	  sh_string_grow(s, ((len+1+s->len) - s->siz) );
-	}
-      memcpy(&(s->str[s->len]), str, len);
-      s->len += len;
-      s->str[s->len] = '\0';
-      return s;
-    }
-
-  return NULL;
-}
-
-sh_string * sh_string_set_from_char(sh_string * s, const char * str)
-{
-  size_t len = strlen(str);
-
-  if ((len+1) > s->siz)
-    {
-      sh_string_grow(s, ((len+1) - s->siz) );
-    }
-  memcpy(s->str, str, (len+1));
-  s->len = len;
-  return s;
-}
-
-sh_string * sh_string_add_from_char(sh_string * s, const char * str)
-{
-  size_t len   = strlen(str);
-  size_t avail = (s->siz - s->len);
-
-  if ((len+1) > avail)
-    {
-      (void) sh_string_grow(s, ((len+1) - avail) );
-    }
-  memcpy(&(s->str[s->len]), str, (len+1));
-  s->len += len;
-  return s;
-}
-
-sh_string * sh_string_new_from_lchar(const char * str, size_t len)
-{
-  sh_string * s;
-  s      = SH_ALLOC(sizeof(sh_string));
-  s->str = SH_ALLOC(len+1);
-  if (str)
-    memcpy(s->str, str, len);
-  else
-    s->str[0] = '\0';
-  s->str[len] = '\0';
-  s->siz = len+1;
-  s->len = len;
-  return s;
-}
-
-sh_string * sh_string_new_from_lchar3(const char * str1, size_t len1,
-                                      const char * str2, size_t len2,
-                                      const char * str3, size_t len3)
-{
-  sh_string * s;
-  size_t len = 0;
-
-  if (sl_ok_adds(len1, len2) == S_TRUE)
-    len    = len1 + len2;
-  else
-    return NULL;
-  if (sl_ok_adds( len, len3) == S_TRUE)
-    len    = len  + len3;
-  else
-    return NULL;
-
-  s      = SH_ALLOC(sizeof(sh_string));
-  s->str = SH_ALLOC(len+1);
-
-  memcpy(s->str, str1, len1);
-  memcpy(&s->str[len1], str2, len2);
-  memcpy(&s->str[len1+len2], str3, len3);
-
-  s->str[len] = '\0';
-  s->siz = len+1;
-  s->len = len;
-  return s;
-}
-
-sh_string * sh_string_grow(sh_string * s, size_t increase)
-{
-  char * new;
-
-  if (increase == 0)
-    increase = SH_STRING_PARCEL;
-  
-  if (s && sl_ok_adds(s->siz, increase) == S_TRUE)
-    {
-      new = SH_ALLOC(s->siz + increase);
-
-      if (s->str)
-        {
-          memcpy(new, s->str, s->len+1);
-          SH_FREE(s->str);
-        }
-      else
-        {
-          new[0] = '\0';
-        }
-      s->str  = new;
-      s->siz += increase;
-      return s;
-    }
-  return NULL;
-}
-
-sh_string * sh_string_truncate(sh_string * s, size_t len)
-{
-  if (s)
-    {
-      if (s->str && (s->len > len) )
-        {
-          s->len            = len;
-          (s->str)[len]     = '\0';
-        }
-      return s;
-    }
-  return NULL;
-}
-
-void sh_string_destroy(sh_string ** s)
-{
-  if (s)
-    {
-      if ((*s) && (*s)->str)
-        SH_FREE ((*s)->str);
-      SH_FREE(*s);
-      *s = NULL;
-    }
-  return;
-}
-
-sh_string * sh_string_new(size_t size)
-{
-  sh_string * s;
-  s      = SH_ALLOC (sizeof(sh_string));
-  if (size == 0)
-    size = SH_STRING_PARCEL;
-  s->str = SH_ALLOC (size);
-  s->str[0] = '\0';
-  s->siz = size;
-  s->len = 0;
-  return s;
-}
-
-/* Replaces fields in s with 'replacement'. Fields are given
- * in the ordered array ovector, comprising ovecnum pairs 
- * ovector[i], ovector[i+1] which list offset of first char
- * of field, offset of first char after field (this is how
- * the pcre library does it).
- */
-#define IS_PCRE2_UNSET           (~(size_t)0)
-
-sh_string * sh_string_replace(const sh_string * s, 
-                              const size_t * ovector, int ovecnum, 
-                              const char * replacement, size_t rlen)
-{
-  sh_string * r = NULL;
-  char * p;
-  long   tlen;
-  size_t len;
-  int    end    = 0;
-  int    start  = 0;
-  size_t oldlen = 0;
-  size_t newlen = 0;
-  long   diff;
-  int    i, curr, last;
-
-  for (i = 0; i < ovecnum; ++i)
-    {
-      start = ovector[2*i];       /* offset of first char of substring       */
-      if (start >= end)
-        {
-          end   = ovector[2*i+1]; /* offset of first char after substring end*/
-
-          if (end > start && (unsigned int)end <= (s->len + 1))
-            {
-              oldlen += (end - start);
-              newlen += rlen;
-            }
-          else                    /* inconsistency detected                  */
-            {
-              return NULL;
-            }
-        }
-      else                        /* overlap detected                        */
-        {
-          return NULL;
-        }
-    }
-
-  diff = newlen - oldlen;
-
-  if ((diff > 0) && ((s->len + 1 + diff) > s->siz))
-    {
-      r = sh_string_new_from_lchar(sh_string_str(s), 
-                                   sh_string_len(s));
-      r = sh_string_grow(r, diff);
-    }
-  else
-    {
-      r = sh_string_new_from_lchar(sh_string_str(s), 
-                                   sh_string_len(s));
-    }
-
-
-  curr = -1;
-
-  for (i = 0; i < ovecnum; ++i)
-    {
-      if (ovector[2*i] != IS_PCRE2_UNSET)
-        {
-          curr = 2*i;
-          break;
-        }
-    }
-  
-  if (r && ovecnum > 0 && ovector[curr] != IS_PCRE2_UNSET)
-    {
-      r->len = 0; r->str[0] = '\0'; p = r->str;
-
-      /* First part, until start of first replacement 
-       */
-      if (r->siz > ovector[curr]) {
-	memcpy(p, s->str, ovector[curr]); 
-	p += ovector[curr]; 
-	r->len += ovector[curr];
-      }
-      if (r->siz > (r->len + rlen)) {
-	memcpy(p, replacement,    rlen); 
-	p += rlen;
-	r->len += rlen;
-      }
-      *p = '\0';
-
-      last = curr + 1;
-
-      for (i = 1; i < ovecnum; ++i)
-        {
-          if (ovector[2*i] == IS_PCRE2_UNSET)
-            continue;
-
-          curr = 2*i;
-
-          /* From end of last replacement to start of this */
-          tlen = (long)(ovector[curr] - ovector[last]);
-          if (tlen >= 0)
-            {
-              len = (size_t) tlen;
-
-              if (tlen > 0 && r->siz > (r->len + len) /* && &(s->str[ovector[last]]) always true */ )
-                {
-                  memcpy(p, &(s->str[ovector[last]]), (size_t)len);
-                  p += len;
-		  r->len += len; 
-                }
-              
-              /* The replacement */
-	      if (r->siz > (r->len + rlen)) {
-		memcpy(p, replacement, rlen);       
-		p += rlen;
-		r->len += rlen;
-	      }
-              
-              /* null terminate */
-              *p = '\0';
-
-              last = curr + 1;
-            }
-	}
-
-      /* Last part, after last replacement; includes terminating null 
-       */
-      if (last > 0)
-        {
-          /* If not, nothing has been replaced, and r is still a copy of s
-           */
-          tlen = (long)((s->len + 1) - ovector[last]);
-          if (tlen > 0)
-            {
-              len = (size_t)tlen;
-	      if (r->siz >= (r->len + len) /* && &(s->str[ovector[2*i -1]]) always true */ ) {
-		memcpy(p, &(s->str[ovector[2*i -1]]), (size_t)len);
-		p += (len - 1); 
-		r->len += (len - 1);
-		*p = '\0'; 
-	      }
-            }
-        }
-
-    }
-
-  return r;
-}
-
-
-#ifdef SH_CUTEST
-#include <stdlib.h>
-#include "CuTest.h"
-
-void Test_string (CuTest *tc) {
-  int status, i, max = 120;
-  FILE * fp;
-  sh_string * s = NULL;
-  sh_string * t;
-  static char template[] = "/tmp/xtest.XXXXXX";
-  char ** array;
-  char test[128];
-  size_t lengths[16];
-  unsigned int iarr;
-  size_t ovector[16];
-  int ovecnum;
-
-  s = sh_string_new(0);
-  CuAssertPtrNotNull(tc, s);
-  sh_string_destroy(&s);
-  CuAssertTrue(tc, s == NULL);
-
-  s = sh_string_new(0);
-  CuAssertPtrNotNull(tc, s);
-
-  status = mkstemp(template);
-  CuAssertTrue(tc, status >= 0);
-
-  fp = fdopen(status, "r+");
-  CuAssertPtrNotNull(tc, fp);
-
-  for (i = 0; i <  80; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 0 */
-  for (i = 0; i < 118; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 1 */
-  for (i = 0; i < 119; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 2 */
-  for (i = 0; i < 120; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 3 */
-  for (i = 0; i < 121; ++i) { fputc ('a', fp); } fputc ('\n', fp); /* 4 */
-  for (i = 0; i < 238; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 239; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 240; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-  for (i = 0; i < 241; ++i) { fputc ('a', fp); } fputc ('\n', fp);
-
-  rewind(fp);
-
-  for (i = 0; i < 9; ++i)
-    {
-      status = sh_string_read(s, fp, max);
-
-      switch (i) {
-      case 0:
-	CuAssertTrue(tc, s->len ==  80);
-	CuAssertTrue(tc, s->siz == 120);
-	CuAssertTrue(tc, status ==  81);
-	break;
-      case 1:
-	CuAssertTrue(tc, s->len == 118);
-	CuAssertTrue(tc, s->siz == 120);
-	CuAssertTrue(tc, status == 119);
-	break;
-      case 2:
-	CuAssertTrue(tc, s->len == 119);
-	CuAssertTrue(tc, s->siz == 120);
-	CuAssertTrue(tc, status ==  -2); /* no terminating '\n', truncated */
-	break;
-      case 3:
-	CuAssertTrue(tc, s->len == 120);
-	CuAssertTrue(tc, s->siz == 240);
-	CuAssertTrue(tc, status == 121);
-	break;
-      case 4:
-	CuAssertTrue(tc, s->len == 121);
-	CuAssertTrue(tc, s->siz == 240);
-	CuAssertTrue(tc, status == 122);
-	break;
-      case 5:
-	CuAssertTrue(tc, s->len == 238);
-	CuAssertTrue(tc, s->siz == 240);
-	CuAssertTrue(tc, status == 239);
-	break;
-      case 6:
-	CuAssertTrue(tc, s->len == 239);
-	CuAssertTrue(tc, s->siz == 240);
-	CuAssertTrue(tc, status ==  -2); /* no terminating '\n', truncated */
-	break;
-      default:
-	CuAssertTrue(tc, s->len == 239);
-	CuAssertTrue(tc, s->siz == 240);
-	CuAssertTrue(tc, status ==  -2);
-      }
-      if (status == -2) /* read in rest of string */
-        { max = 240; sh_string_read(s, fp, max); }
-    }
-
-  rewind(fp);
-
-  sh_string_truncate(s, 0);
-  CuAssertTrue(tc, s->len == 0);
-
-  for (i = 0; i < 9; ++i)
-    {
-      status = sh_string_read(s, fp, 240);
-      if (status == -2)
-        sh_string_read(s, fp, 240);
-      else
-        {
-          for (status = 0; status < (int)s->len; ++status)
-            {
-              if (s->str[status] != 'a')
-                {
-                  CuFail(tc, "unexpected character");
-                }
-            }
-        }
-    }
-
-  status = fclose(fp); 
-  CuAssertTrue(tc, status == 0);
-  status = remove(template);
-  CuAssertTrue(tc, status == 0);
-
-  iarr = 10; strcpy(test, "|a1|| a2| |a3 |a4|a5|");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,9,(int)iarr);
-  CuAssertStrEquals(tc,"",   array[0]);
-  CuAssertStrEquals(tc,"a1", array[1]);
-  CuAssertStrEquals(tc,"",   array[2]);
-  CuAssertStrEquals(tc,"a2", array[3]);
-  CuAssertStrEquals(tc,"",   array[4]);
-  CuAssertStrEquals(tc,"a3", array[5]);
-  CuAssertStrEquals(tc,"a4", array[6]);
-  CuAssertStrEquals(tc,"a5", array[7]);
-  CuAssertStrEquals(tc,"",   array[8]);
-
-  CuAssertIntEquals(tc, 0, (int)lengths[0]);
-  CuAssertIntEquals(tc, 2, (int)lengths[1]);
-  CuAssertIntEquals(tc, 0, (int)lengths[2]);
-  CuAssertIntEquals(tc, 2, (int)lengths[3]);
-  CuAssertIntEquals(tc, 0, (int)lengths[4]);
-  CuAssertIntEquals(tc, 2, (int)lengths[5]);
-  CuAssertIntEquals(tc, 2, (int)lengths[6]);
-  CuAssertIntEquals(tc, 2, (int)lengths[7]);
-  CuAssertIntEquals(tc, 0, (int)lengths[8]);
-
-  iarr = 10; strcpy(test, "a1|| a2| |a3 |a4|a5|");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,8,(int)iarr);
-  CuAssertStrEquals(tc,"a1", array[0]);
-  CuAssertStrEquals(tc,"",   array[1]);
-  CuAssertStrEquals(tc,"a2", array[2]);
-  CuAssertStrEquals(tc,"",   array[3]);
-  CuAssertStrEquals(tc,"a3", array[4]);
-  CuAssertStrEquals(tc,"a4", array[5]);
-  CuAssertStrEquals(tc,"a5", array[6]);
-  CuAssertStrEquals(tc,"",   array[7]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-  CuAssertIntEquals(tc, 0, (int)lengths[1]);
-  CuAssertIntEquals(tc, 2, (int)lengths[2]);
-  CuAssertIntEquals(tc, 0, (int)lengths[3]);
-  CuAssertIntEquals(tc, 2, (int)lengths[4]);
-  CuAssertIntEquals(tc, 2, (int)lengths[5]);
-  CuAssertIntEquals(tc, 2, (int)lengths[6]);
-  CuAssertIntEquals(tc, 0, (int)lengths[7]);
-
-  iarr = 10; strcpy(test, "  a1|| a2  | |a3 |a4|a5");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,7,(int)iarr);
-  CuAssertStrEquals(tc,"a1", array[0]);
-  CuAssertStrEquals(tc,"",   array[1]);
-  CuAssertStrEquals(tc,"a2", array[2]);
-  CuAssertStrEquals(tc,"",   array[3]);
-  CuAssertStrEquals(tc,"a3", array[4]);
-  CuAssertStrEquals(tc,"a4", array[5]);
-  CuAssertStrEquals(tc,"a5", array[6]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-  CuAssertIntEquals(tc, 0, (int)lengths[1]);
-  CuAssertIntEquals(tc, 2, (int)lengths[2]);
-  CuAssertIntEquals(tc, 0, (int)lengths[3]);
-  CuAssertIntEquals(tc, 2, (int)lengths[4]);
-  CuAssertIntEquals(tc, 2, (int)lengths[5]);
-  CuAssertIntEquals(tc, 2, (int)lengths[6]);
-
-  iarr = 10; strcpy(test, "a1|| a2  | |a3 |a4|a5  ");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,7,(int)iarr);
-  CuAssertStrEquals(tc,"a1", array[0]);
-  CuAssertStrEquals(tc,"",   array[1]);
-  CuAssertStrEquals(tc,"a2", array[2]);
-  CuAssertStrEquals(tc,"",   array[3]);
-  CuAssertStrEquals(tc,"a3", array[4]);
-  CuAssertStrEquals(tc,"a4", array[5]);
-  CuAssertStrEquals(tc,"a5", array[6]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-  CuAssertIntEquals(tc, 0, (int)lengths[1]);
-  CuAssertIntEquals(tc, 2, (int)lengths[2]);
-  CuAssertIntEquals(tc, 0, (int)lengths[3]);
-  CuAssertIntEquals(tc, 2, (int)lengths[4]);
-  CuAssertIntEquals(tc, 2, (int)lengths[5]);
-  CuAssertIntEquals(tc, 2, (int)lengths[6]);
-
-  iarr = 10; strcpy(test, "|");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,2,(int)iarr);
-  CuAssertStrEquals(tc,"",   array[0]);
-  CuAssertStrEquals(tc,"",   array[1]);
-
-  CuAssertIntEquals(tc, 0, (int)lengths[0]);
-  CuAssertIntEquals(tc, 0, (int)lengths[1]);
-
-  iarr = 10; strcpy(test, "|||");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,4,(int)iarr);
-  CuAssertStrEquals(tc,"",   array[0]);
-  CuAssertStrEquals(tc,"",   array[1]);
-  CuAssertStrEquals(tc,"",   array[2]);
-  CuAssertStrEquals(tc,"",   array[3]);
-
-  CuAssertIntEquals(tc, 0, (int)lengths[0]);
-  CuAssertIntEquals(tc, 0, (int)lengths[1]);
-  CuAssertIntEquals(tc, 0, (int)lengths[2]);
-  CuAssertIntEquals(tc, 0, (int)lengths[3]);
-
-  iarr = 10; strcpy(test, " a1 ");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,1,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-
-  iarr = 10; strcpy(test, "");
-  array  = split_array(test, &iarr, '|', lengths);
-  CuAssertIntEquals(tc,1,(int)iarr);
-  CuAssertStrEquals(tc,"",   array[0]);
-
-  CuAssertIntEquals(tc, 0, (int)lengths[0]);
-
-  /* WS separated */
-
-  iarr = 10; strcpy(test, "a1");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,1,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-
-  iarr = 10; strcpy(test, " a1");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,1,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-
-  iarr = 10; strcpy(test, " a1 ");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,1,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-
-  iarr = 10; strcpy(test, "   ");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,0,(int)iarr);
-  CuAssertTrue(tc, array[0] == NULL);
-
-  iarr = 10; strcpy(test, " a1 a2");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,2,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-  CuAssertStrEquals(tc,"a2",   array[1]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-  CuAssertIntEquals(tc, 2, (int)lengths[1]);
-
-  iarr = 10; strcpy(test, " a1  a2  ");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,2,(int)iarr);
-  CuAssertStrEquals(tc,"a1",   array[0]);
-  CuAssertStrEquals(tc,"a2",   array[1]);
-
-  CuAssertIntEquals(tc, 2, (int)lengths[0]);
-  CuAssertIntEquals(tc, 2, (int)lengths[1]);
-
-  iarr = 10; strcpy(test, "");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,0,(int)iarr);
-  CuAssertTrue(tc, array[0] == NULL);
-
-  iarr = 3; strcpy(test, " this is a test for remainder");
-  array  = split_array_ws (test, &iarr, lengths);
-  CuAssertIntEquals(tc,3,(int)iarr);
-  CuAssertStrEquals(tc,"this",   array[0]);
-  CuAssertStrEquals(tc,"is",     array[1]);
-  CuAssertStrEquals(tc,"a test for remainder",     array[2]);
-  for (i = 0; i < 3; ++i)
-    {
-      CuAssertIntEquals(tc, (int)strlen(array[i]), lengths[i] );
-    }
-
-  /* split_array_list */
-  iarr = 6; strcpy(test, " this(a) is_a(test);for(b),remainder(test)foo(bar)");
-  array  = split_array_list (test, &iarr, lengths);
-  CuAssertIntEquals(tc,3,(int)iarr);
-  CuAssertStrEquals(tc,"this(a)",   array[0]);
-  CuAssertStrEquals(tc,"is_a(test);for(b)",     array[1]);
-  CuAssertStrEquals(tc,"remainder(test)foo(bar)",     array[2]);
-  for (i = 0; i < 3; ++i)
-    {
-      CuAssertIntEquals(tc, (int)strlen(array[i]), lengths[i] );
-    }
-
-  
-  /* string replace */
-  s = sh_string_new_from_lchar3 ("abc ", 4, "def ", 4, "ghi ", 4);
-  ovecnum = 2;
-  ovector[0] = 0;  ovector[1] = 2;
-  ovector[2] = 4;  ovector[3] = 11;
-
-  t = sh_string_replace(s, ovector, ovecnum, 
-                        "___", 3);
-  CuAssertPtrNotNull(tc, t);
-  CuAssertStrEquals(tc, "___c ___ ",   t->str);
-  CuAssertIntEquals(tc, 9, (int)t->len);
-
-  ovector[0] = 0;  ovector[1] = 2;
-  ovector[2] = 4;  ovector[3] = 12; 
-  t = sh_string_replace(s, ovector, ovecnum, 
-                        "___", 3);
-  CuAssertPtrNotNull(tc, t);
-  CuAssertStrEquals(tc, "___c ___",   t->str);
-  CuAssertIntEquals(tc, 8, (int)t->len);
-
-  ovector[0] = 0;  ovector[1] = 0;
-  ovector[2] = 0;  ovector[3] = 0; 
-  t = sh_string_replace(s, ovector, ovecnum, 
-                        "___", 3);
-  CuAssertTrue(tc, t == NULL);
-
-  ovector[0] = 0;  ovector[1] = 3;
-  ovector[2] = 3;  ovector[3] = 6; 
-  t = sh_string_replace(s, ovector, ovecnum, 
-                        "___", 3);
-  
-  CuAssertPtrNotNull(tc, t);
-  CuAssertStrEquals(tc, "______f ghi ",   t->str);
-  CuAssertIntEquals(tc, 12, (int)t->len);
-
-  ovector[0] = 4;  ovector[1] = 5;
-  ovector[2] = 11;  ovector[3] = 12; 
-  t = sh_string_replace(s, ovector, ovecnum, 
-                        "___", 3);
-  CuAssertPtrNotNull(tc, t);
-  CuAssertStrEquals(tc, "abc ___ef ghi___",   t->str);
-  CuAssertIntEquals(tc, 16, (int)t->len);
-
-  t = sh_string_replace(s, ovector, 0, 
-                        "___", 3);
-  CuAssertPtrNotNull(tc, t);
-  CuAssertStrEquals(tc, s->str,   t->str);
-  CuAssertIntEquals(tc, (int)s->len, (int)t->len);
-
-}
-
-#endif
Index: trunk/src/sh_sub.c
===================================================================
--- trunk/src/sh_sub.c	(revision 591)
+++ 	(revision )
@@ -1,525 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2011 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-/* 0->1 for debug */ 
-#if 0
-#define SH_SUB_DBG 1
-#endif
-
-#ifndef NULL
-#if !defined(__cplusplus)
-#define NULL ((void*)0)
-#else
-#define NULL (0)
-#endif
-#endif
-
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <poll.h>
-
-#include "samhain.h"
-#include "sh_pthread.h"
-
-#ifndef HAVE_LSTAT
-#define lstat stat
-#endif
-
-#define FIL__ _("sh_sub.c")
-
-static pid_t sh_child_pid = -1;
-static pid_t sh_wait_ret  =  1;
-
-static int parent2child[2];
-static int child2parent[2];
-
-SH_MUTEX_STATIC(mutex_sub,      PTHREAD_MUTEX_INITIALIZER);
-SH_MUTEX_STATIC(mutex_sub_work, PTHREAD_MUTEX_INITIALIZER);
-
-static void wait_for_command();
-static ssize_t sh_sub_read(int fd, void *buf, size_t count);
-
-void sh_kill_sub()
-{
-  SH_MUTEX_LOCK(mutex_sub);
-
-  if (sh_child_pid != -1)
-    {
-      int status;
-#ifdef WCONTINUED
-      int wflags = WNOHANG|WUNTRACED|WCONTINUED;
-#else
-      int wflags = WNOHANG|WUNTRACED;
-#endif
-
-      close (parent2child[1]);
-      close (child2parent[0]);
-
-      /* Let's be rude. */
-      kill(sh_child_pid, SIGKILL);
-
-      retry_msleep(1,0);
-
-      if (sh_wait_ret == 0)
-	sh_wait_ret = waitpid(          -1, &status, wflags);
-      else
-	sh_wait_ret = waitpid(sh_child_pid, &status, wflags);
-
-      sh_child_pid = -1;
-    }
-
-  SH_MUTEX_UNLOCK(mutex_sub);
-  return;
-}
-
-static int sh_create_sub()
-{
-  pid_t res;
-  volatile int   retval = 0;
-
-  SH_MUTEX_LOCK(mutex_sub);
-
-#if !defined(O_NONBLOCK)
-#if defined(O_NDELAY)
-#define O_NONBLOCK  O_NDELAY
-#else
-#define O_NONBLOCK  0
-#endif
-#endif
-
-  if (sh_child_pid == -1)
-    {
-      sigset_t signal_set_new;
-      sigset_t signal_set_old;
-
-      sigfillset ( &signal_set_new );
-      sigemptyset( &signal_set_old );
-
-      /* Create pipes. */
-      res = pipe (parent2child);
-      if (res == 0)
-	res = pipe (child2parent);
-      
-      if (res != 0)
-	goto out;
-
-      SH_SETSIGMASK(SIG_BLOCK, &signal_set_new, &signal_set_old);
-
-      res = fork();
-      
-      if (res == 0)
-	{
-	  /* Child process. */
-#ifdef _SC_OPEN_MAX
-	  int fdlimit = sysconf (_SC_OPEN_MAX);
-#else
-#ifdef OPEN_MAX
-	  int fdlimit = OPEN_MAX;
-#else
-	  int fdlimit = _POSIX_OPEN_MAX;
-#endif
-#endif
-	  int sflags, i, fd = 0;
-	  struct sigaction act;
-
-	  /* zero private information 
-	   */
-	  memset(skey, 0, sizeof(sh_key_t)); 
-
-	  close (parent2child[1]);
-	  close (child2parent[0]);
-	  
-	  sflags = fcntl(parent2child[0], F_GETFL, 0);
-	  fcntl(parent2child[0], F_SETFL, sflags | O_NONBLOCK);
-	  sflags = fcntl(child2parent[1], F_GETFL, 0);
-	  fcntl(child2parent[1], F_SETFL, sflags | O_NONBLOCK);
-
-	  /* close inherited file descriptors 
-	   */
-	  if (fdlimit < 0) 
-	    fdlimit = 20;  /* POSIX lower limit */
-	  while (fd < fdlimit)
-	    {
-	      if (fd != parent2child[0] && fd != child2parent[1])
-		close(fd);
-	      ++fd;
-	    }
-
-	  /*
-	  for (i = 0; i < 3; ++i)
-	    {
-	      if ( fcntl(i, F_GETFL, 0) == (-1))
-		(void) open(_("/dev/null"), O_RDWR, 0);
-	    }
-	  */
-
-	  /* reset signal handling 
-	   */
-	  act.sa_handler = SIG_DFL;
-	  act.sa_flags   = 0;
-	  sigemptyset( &act.sa_mask );
-	  
-	  for (i = 1; i < NSIG; ++i)
-	    sigaction(i, &act, NULL);
-	  SH_SETSIGMASK(SIG_UNBLOCK, &signal_set_new, NULL);
-
-	  wait_for_command();
-	  
-	  _exit(0);
-	}
-      else if (res > 0)
-	{
-	  /* Parent process. */
-	  int sflags;
-
-	  SH_SETSIGMASK(SIG_SETMASK, &signal_set_old, NULL);
-
-	  close (parent2child[0]);
-	  close (child2parent[1]);
-	  
-	  sflags = fcntl(parent2child[1], F_GETFL, 0);
-	  fcntl(parent2child[1], F_SETFL, sflags | O_NONBLOCK);
-	  sflags = fcntl(child2parent[0], F_GETFL, 0);
-	  fcntl(child2parent[0], F_SETFL, sflags | O_NONBLOCK);
-
-	  sh_child_pid = res;
-	}
-      else
-	{
-	  /* Failure. */
-
-	  SH_SETSIGMASK(SIG_SETMASK, &signal_set_old, NULL);
-
-	  close (parent2child[0]);
-	  close (parent2child[1]);
-
-	  close (child2parent[0]);
-	  close (child2parent[1]);
-	  
-	  retval = -1;
-	}
-    }
-
- out:
-  ; /* 'label at end of compound statement' */
-  SH_MUTEX_UNLOCK(mutex_sub);
-  return retval;
-}
-
-#define  SH_SUB_BUF (PIPE_BUF-1)
-struct sh_sub_in {
-  char   command;
-  char   path[SH_SUB_BUF];
-};
-
-struct sh_sub_out {
-  int retval;
-  int errnum;
-  struct stat sbuf;
-};
-
-#define SH_COM_STAT  0
-#define SH_COM_LSTAT 1
-
-static ssize_t sh_sub_write(int fd, const void *buf, size_t count)
-{
-  const char * mbuf = (const char *) buf;
-  ssize_t rcount;
-  int ttl = 5; /* 0, 1, 9, 81, 729 millisec */
-  int tti = 1; 
-
-  do {
-
-    rcount = write(fd, mbuf, count);
-    if (rcount > 0) 
-      {
-	count -= rcount; mbuf += rcount; --ttl;
-      }
-
-    if (count > 0)
-      {
-	if (ttl > 0)
-	  {
-	    retry_msleep(0, tti);
-	    tti *= 9;
-	  }
-	else
-	  {
-	    return -1;
-	  }
-      }
-  } while (count > 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
-
-  if (count > 0)
-    return -1;
-  return 0;
-}
-
-static void wait_for_command()
-{
-  int               ret;
-  struct pollfd     fds;
-  struct sh_sub_in  inbuf;
-  struct sh_sub_out outbuf;
-
-  fds.fd     = parent2child[0];
-  fds.events = POLLIN;
-
-  do {
-
-    do {
-      ret = poll(&fds, 1, -1);
-    } while (ret < 0 && errno == EINTR);
-
-    if (ret > 0)
-      {
-	ret = sh_sub_read(parent2child[0], &inbuf, sizeof(inbuf));
-
-	if (ret == 0)
-	  {
-	    if (inbuf.command == SH_COM_LSTAT)
-	      {
-		do { 
-		  outbuf.retval = lstat(inbuf.path, &(outbuf.sbuf)); 
-		} while (outbuf.retval < 0 && errno == EAGAIN);
-	      }
-	    else
-	      {
-		do { 
-		  outbuf.retval = stat(inbuf.path, &(outbuf.sbuf)); 
-		} while (outbuf.retval < 0 && errno == EAGAIN);
-	      }
-
-	    outbuf.errnum = errno;
-
-	    ret = sh_sub_write(child2parent[1], &outbuf, sizeof(outbuf));
-	    if (ret < 0)
-	      {
-		return;
-	      }
-	  }
-	else /* sh_sub_read() < 0 */
-	  {
-	    return;
-	  }
-      }
-  } while (1 == 1);
-}
-
-#ifndef ETIMEDOUT
-#define ETIMEDOUT EIO
-#endif
-
-static ssize_t sh_sub_read(int fd, void *buf, size_t count)
-{
-  char * mbuf = (char *) buf;
-  ssize_t rcount;
-  int ttl = 5; /* 0, 1, 9, 81, 729 millisec */
-  int tti = 1; 
-
-  do {
-    rcount = read(fd, mbuf, count);
-
-    if (rcount > 0) 
-      {
-	count -= rcount; mbuf += rcount; --ttl;
-      }
-
-    if (count > 0)
-      {
-	if (ttl > 0)
-	  {
-	    retry_msleep(0, tti);
-	    tti *= 9;
-	  }
-	else
-	  {
-	    if (rcount >= 0) 
-	      errno = ETIMEDOUT;
-	    return -1;
-	  }
-      }
-  } while (count > 0 && 
-	   (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR));
-
-  if (count > 0)
-    return -1;
-
-  return 0;
-}
-
-#ifdef SH_SUB_DBG
-#include <stdarg.h>
-static void debug_it (const char *fmt, ...)
-{
-  char msg[256];
-  va_list ap;
-
-  int fd = open("debug.it", O_CREAT|O_WRONLY|O_APPEND, 0666);
-
-  va_start(ap, fmt);
-  vsnprintf(msg, sizeof(msg), fmt, ap);  /* flawfinder: ignore */
-  va_end(ap);
-
-  write(fd, msg, strlen(msg));
-  write(fd, "\n", 1);
-  close(fd);
-  return;
-}
-#endif
-
-static int sh_sub_stat_int(const char *path, struct stat *buf, char command)
-{
-  int retval;
-  volatile int sflag = 0;
-  struct sh_sub_in  inbuf;
-  struct sh_sub_out outbuf;
-  struct pollfd     pfds;
-
-  size_t len = strlen(path) + 1;
-
-  if (len > SH_SUB_BUF)
-    {
-      if (command == SH_COM_LSTAT)
-	{
-	  do { 
-	    retval = lstat(path, buf); 
-	  } while (retval < 0 && errno == EAGAIN);
-
-	  return retval;
-	}
-      else
-	{
-	  do { 
-	    retval = stat(path, buf); 
-	  } while (retval < 0 && errno == EAGAIN);
-
-	  return retval;
-	}
-    }
-
-  sl_strlcpy(inbuf.path, path, SH_SUB_BUF);
-  inbuf.command = command;
-
- start:
-
-#ifdef SH_SUB_DBG
-  debug_it("%d sh_child_pid %d\n", (int)getpid(), (int) sh_child_pid);
-#endif
-
-  if (sh_child_pid == -1)
-    sh_create_sub();
-
-#ifdef SH_SUB_DBG
-  debug_it("%d stat_sub %s (%d)\n", (int)getpid(), inbuf.path, (int) sh_child_pid);
-#endif
-
-  SH_MUTEX_LOCK(mutex_sub_work);
-
-  retval = sh_sub_write(parent2child[1], &inbuf, sizeof(inbuf));
-  if (retval < 0)
-    {
-      int error = errno;
-      sh_kill_sub();
-      errno = error;
-      sflag = 1;
-      goto end;
-    }
-
-#ifdef SH_SUB_DBG
-  debug_it("%d stat_sub polling..\n", (int)getpid());
-#endif
-
-  pfds.fd     = child2parent[0];
-  pfds.events = POLLIN;
-
-  do {
-    retval = poll(&pfds, 1, 300 * 1000);
-  } while (retval < 0 && errno == EINTR);
-
-  if (retval <= 0)
-    {
-      int error = errno;
-      sh_kill_sub();
-      errno = (retval == 0) ? ETIMEDOUT : error;
-      sflag = -1;
-      goto end;
-    }
-
-#ifdef SH_SUB_DBG
-  debug_it("%d stat_sub reading..\n", (int)getpid());
-#endif
-
-  retval = sh_sub_read (child2parent[0], &outbuf, sizeof(outbuf));
-  if (retval < 0)
-    {
-      int error = errno;
-      sh_kill_sub();
-      errno = error;
-      sflag = 1;
-      goto end;
-    }
-
- end:
-  ; /* 'label at end of compound statement' */
-  SH_MUTEX_UNLOCK(mutex_sub_work);
-
-  if      (sflag == 0)
-    {
-#ifdef SH_SUB_DBG
-      debug_it("%d stat_sub done..\n", (int)getpid());
-#endif
-      memcpy(buf, &(outbuf.sbuf), sizeof(struct stat));
-      errno = outbuf.errnum;
-      return outbuf.retval;
-    }
-  else if (sflag == 1)
-    {
-#ifdef SH_SUB_DBG
-      debug_it("%d stat_sub error..\n", (int)getpid());
-#endif
-      /* could not read, thus subprocess may have gone */
-      sflag = 0;
-      goto start;
-    }
-
-  return -1;
-}
-
-int sh_sub_stat (const char *path, struct stat *buf)
-{
-  return sh_sub_stat_int(path, buf, SH_COM_STAT);
-}
-
-int sh_sub_lstat(const char *path, struct stat *buf)
-{
-  return sh_sub_stat_int(path, buf, SH_COM_LSTAT);
-}
-
Index: trunk/src/sh_subuid.c
===================================================================
--- trunk/src/sh_subuid.c	(revision 591)
+++ 	(revision )
@@ -1,245 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 2018 Rainer Wichmann                                      */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#undef  FIL__
-#define FIL__  _("sh_subuid.c")
-
-
-#include <sys/types.h>
-#include <time.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <stdlib.h>
-#include <errno.h>
-#include <limits.h>
-
-#if defined(__linux__)
-
-#include "samhain.h"
-#include "sh_unix.h"
-
-#define SH_SUBUID_FILE _("/etc/subuid")
-#define SH_SUBGID_FILE _("/etc/subgid")
-
-struct subuid_t {
-  char name[32];
-  unsigned long first;
-  unsigned long last;
-  struct subuid_t * next;
-};
-
-static time_t last_subuid = 0;
-static time_t last_subgid = 0;
-
-struct subuid_t * list_subuid = NULL;
-struct subuid_t * list_subgid = NULL;
-
-/* Check whether we need to re-read the subuid/subgid file
- */
-static int needs_reread (char * file, time_t * last)
-{
-  int retval = S_FALSE;
-  struct stat   buf;
-  int status = retry_lstat (FIL__, __LINE__, file, &buf);
-
-  if (status == 0)
-    {
-      if ((buf.st_mtime - *last) > 1)
-	{
-	  *last = buf.st_mtime;
-	  retval = S_TRUE;
-	}
-    }
-  else if (status && errno == ENOENT)
-    {
-      /* If there was a file make sure we attempt to re-read
-       * to zero out the list. 
-       */
-      if (*last > 0) retval = S_TRUE;
-      *last = 0;
-    }
-  return retval;
-}
-
-/* free the whole list
- */
-static void free_subordinate(struct subuid_t * head)
-{
-  struct subuid_t * prev;
-  struct subuid_t * curr = head;
-  
-  while (curr)
-    {
-      prev = curr;
-      curr = curr->next;
-      SH_FREE(prev);
-    }
-  return;
-}
-
-#define NFIELDS_SUBUID 3
-
-static int get_ulong(char * str, unsigned long * result)
-{
-  char * endptr;
-
-  errno = 0;
-  *result = strtoul(str, &endptr, 0);
-  if (*str != '\0' && *endptr == '\0' && errno != ERANGE)
-    return S_TRUE;
-  return S_FALSE;
-}
-
-/* Parse a single line into name / startuid / lastuid 
- */
-static struct subuid_t * parse_subordinate(char * line)
-{
-  unsigned int      nfields = NFIELDS_SUBUID;
-  size_t            lengths[NFIELDS_SUBUID];
-  unsigned long     start, count;
-  struct subuid_t * new;
-  
-  char ** array = split_array(line, &nfields, ':', lengths);
-
-  if (nfields != NFIELDS_SUBUID)
-    { SH_FREE(array); return NULL; }
-
-  if (S_TRUE != get_ulong(array[1], &start))
-    { SH_FREE(array); return NULL; }
-  if ((S_TRUE != get_ulong(array[2], &count)) || (count == 0))
-    { SH_FREE(array); return NULL; }
-  if (lengths[0] == 0)
-    { SH_FREE(array); return NULL; }
-
-  /* we have checked that count != 0 */
-  --count;
-
-  if (start > (ULONG_MAX - count))
-    { SH_FREE(array); return NULL; }
-    
-  new = SH_ALLOC(sizeof(struct subuid_t));
-  sl_strlcpy(new->name, array[0], 32);
-  new->first = start;
-  new->last  = start + count; /* start+count-1, but we already did --count */
-  new->next  = NULL;
-
-  SH_FREE(array);
-  return new;
-}
-
-/* (re-)read the subuid/subgid file
- */
-static void reread_subordinate (char * file, struct subuid_t ** head_ref)
-{
-  SL_TICKET fd = (-1);
-  char      line[1024];
-  
-  if (*head_ref) { free_subordinate(*head_ref); *head_ref = NULL; }
-
-  fd = sl_open_read (FIL__, __LINE__, file, SL_YESPRIV);
-  if (!SL_ISERROR(fd))
-    {
-      while ( sh_unix_getline(fd, line, sizeof(line)) > 0 ) 
-        {
-	  /* for invalid lines, NULL will be returned 
-	   */
-	  struct subuid_t * new = parse_subordinate(line);
-
-	  if (new)
-	    {
-	      new->next = *head_ref;
-	      *head_ref = new;
-	    }
-        }
-      sl_close(fd);
-    }
-  return;
-}
-
-/* Return the username for a given subuid/subgid 
- */
-static char * get_name4id (unsigned long id, struct subuid_t * head)
-{
-  struct subuid_t * cur = head;
-  
-  while (cur)
-    {
-      if (id >= cur->first && id <= cur->last)
-	return cur->name;
-      cur = cur->next;
-    }
-  return NULL;
-}
-
-/***********************************************
- *
- * Public functions
- *
- ***********************************************/
-
-/* Returns username or NULL for a subuid
- */
-char * sh_get_subuid (unsigned long subuid)
-{
-  static int  init = 0;
-  static char file[256];
-
-  if (!init) { sl_strlcpy(file, SH_SUBUID_FILE, sizeof(file)); init = 1; }
-  
-  if (S_TRUE == needs_reread(file, &last_subuid))
-    reread_subordinate(file, &list_subuid); 
-  
-  return get_name4id (subuid, list_subuid);
-}
-
-/* Returns group name or NULL for subgid
- */
-char * sh_get_subgid (unsigned long subgid)
-{
-  static int  init = 0;
-  static char file[256];
-
-  if (!init) { sl_strlcpy(file, SH_SUBGID_FILE, sizeof(file)); init = 1; }
-  
-  if (S_TRUE == needs_reread(file, &last_subgid))
-    reread_subordinate(file, &list_subgid); 
-  
-  return get_name4id (subgid, list_subgid);
-}
-
-/* Not Linux, hence no sub(u|g)id
- */
-#else
-
-char * sh_get_subuid (unsigned long subuid)
-{
-  (void) subuid;
-  return NULL;
-}
-
-char * sh_get_subgid (unsigned long subgid)
-{
-  (void) subgid;
-  return NULL;
-}
-
-#endif
Index: trunk/src/sh_suidchk.c
===================================================================
--- trunk/src/sh_suidchk.c	(revision 591)
+++ trunk/src/sh_suidchk.c	(revision 1)
@@ -30,5 +30,7 @@
 #include <errno.h>
 #include <limits.h>
-
+#ifdef HAVE_LIBGEN_H
+#include <libgen.h>
+#endif
 #ifdef HAVE_SCHED_H
 #include <sched.h>
@@ -37,4 +39,8 @@
 #ifdef SH_USE_SUIDCHK
 
+#ifndef HAVE_BASENAME
+#define basename(a) ((NULL == strrchr(a, '/')) ? (a) : (strrchr(a, '/')))
+#endif
+
 #undef  FIL__
 #define FIL__  _("sh_suidchk.c")
@@ -42,8 +48,14 @@
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
 
 #ifdef HAVE_DIRENT_H
@@ -63,8 +75,6 @@
 #endif
 #endif
-#define NEED_ADD_DIRENT
 
 #include "samhain.h"
-#include "sh_pthread.h"
 #include "sh_utils.h"
 #include "sh_error.h"
@@ -72,10 +82,8 @@
 #include "sh_suidchk.h"
 #include "sh_hash.h"
-#include "sh_dbIO.h"
 #include "sh_unix.h"
 #include "sh_files.h"
 #include "sh_schedule.h"
 #include "sh_calls.h"
-#include "zAVLTree.h"
 
 
@@ -110,8 +118,4 @@
   },
   {
-    N_("suidchecknosuid"),
-    sh_suidchk_set_nosuid
-  },
-  {
     N_("suidcheckquarantinefiles"),
     sh_suidchk_set_quarantine
@@ -135,6 +139,5 @@
 static int     ShSuidchkActive   = S_TRUE;
 static time_t  ShSuidchkInterval = 7200;
-static unsigned long    ShSuidchkFps      = 0;
-static int     ShSuidchkNosuid   = S_FALSE;
+static long    ShSuidchkFps      = 0;
 static int     ShSuidchkYield    = S_FALSE;
 static int     ShSuidchkQEnable  = S_FALSE;
@@ -142,36 +145,13 @@
 static int     ShSuidchkQDelete  = S_FALSE;
 static int     ShSuidchkSeverity = SH_ERR_SEVERE;
+static char *  ShSuidchkExclude  = NULL;
+static int     ExcludeLen        = 0;
 
 static time_t  FileLimNow        = 0;
 static time_t  FileLimStart      = 0;
-static unsigned long    FileLimNum        = 0;
-static unsigned long    FileLimTotal      = 0;
+static long    FileLimNum        = 0;
+static long    FileLimTotal      = 0;
 
 static sh_schedule_t * ShSuidchkSched = NULL;
-
-
-static zAVLTree *  ShSuidchkExclude  = NULL;
-static void sh_suid_exclude_free()
-{
-  zAVL_string_reset(ShSuidchkExclude);
-  ShSuidchkExclude  = NULL;
-  return;
-}
-static int sh_suid_exclude_add(const char * str)
-{
-  size_t len;
-  int    ret;
-  char * key = sh_util_strdup(str);
-
-  len = sl_strlen (key);
-  if (len && key[len-1] == '/')
-    {
-      key[len-1] = '\0';
-    }
-  ret = zAVL_string_set(&ShSuidchkExclude, key);
-  SH_FREE(key);
-  return ret;
-}
-
 
 static char *
@@ -182,35 +162,8 @@
 #endif
 
-SH_MUTEX_STATIC(mutex_suid_check, PTHREAD_MUTEX_INITIALIZER);
-
 extern unsigned long sh_files_maskof (int class);
-
-static void set_defaults (void)
-{
-  ShSuidchkActive   = S_TRUE;
-  ShSuidchkInterval = 7200;
-  ShSuidchkFps      = 0;
-  ShSuidchkNosuid   = S_FALSE;
-  ShSuidchkYield    = S_FALSE;
-  ShSuidchkQEnable  = S_FALSE;
-  ShSuidchkQMethod  = SH_Q_CHANGEPERM;
-  ShSuidchkQDelete  = S_FALSE;
-  ShSuidchkSeverity = SH_ERR_SEVERE;
-  if (ShSuidchkExclude != NULL)
-    sh_suid_exclude_free();
-
-  FileLimNow        = 0;
-  FileLimStart      = 0;
-  FileLimNum        = 0;
-  FileLimTotal      = 0;
-
-  return;
-}
 
 /* Recursively descend into the directory to make sure that
  * there is no symlink in the path.
- *
- * Use retry_lstat_ns() here because we cannot chdir the subprocess
- * that does the lstat().
  */
 static int do_truncate_int (char * path, int depth)
@@ -220,13 +173,10 @@
   struct stat two;
   int         fd;
-  char errbuf[SH_ERRBUF_SIZE];
 
   if (depth > 99)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 		       MSG_SUID_ERROR,
 		       _("do_truncate: max depth 99 exceeded"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       return -1;
     }
@@ -234,9 +184,7 @@
   if (path[0] != '/')
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 		       MSG_SUID_ERROR,
 		       _("do_truncate: not an absolute path"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       return -1;
     }
@@ -246,11 +194,9 @@
     {
       *q = '\0';
-      if (0 != retry_lstat_ns(FIL__, __LINE__, path, &one))
+      if (0 != retry_lstat(FIL__, __LINE__, path, &one))
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message(errno));
 	  *q = '/'; 
 	  return -1; 
@@ -259,9 +205,7 @@
 	
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 			   MSG_SUID_ERROR,
 			   _("Possible race: not a directory"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 	  *q = '/'; 
 	  return -1; 
@@ -271,20 +215,16 @@
       if (0 != chdir(path))
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message(errno));
 	  *q = '/';
 	  return -1;
 	}
       *q = '/';
-      if (0 != retry_lstat_ns(FIL__, __LINE__, ".", &two))
+      if (0 != retry_lstat(FIL__, __LINE__, ".", &two))
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message(errno));
 	  return -1; 
 	}
@@ -293,9 +233,7 @@
 	  (!S_ISDIR(two.st_mode))/*@+usedef@*/)
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 			   MSG_SUID_ERROR,
 			   _("Possible race: lstat(dir) != lstat(.)"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 	  return -1;
 	}
@@ -310,11 +248,9 @@
       if (*path == '\0')
 	return -1;
-      if (0 != retry_lstat_ns(FIL__, __LINE__, path, &one))
+      if (0 != retry_lstat(FIL__, __LINE__, path, &one))
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message(errno));
 	  return -1;
 	} 
@@ -322,19 +258,15 @@
       if (-1 == fd)
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message(errno));
 	  return -1;
 	} 
       if (0 != retry_fstat(FIL__, __LINE__, fd, &two))
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
-			   sh_error_message(errno, errbuf, sizeof(errbuf)));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  (void) sl_close_fd(FIL__, __LINE__, fd);
+			   sh_error_message(errno));
+	  (void) close(fd);
 	  return -1; 
 	}
@@ -342,30 +274,24 @@
 	  (one.st_ino != two.st_ino)/*@+usedef@*/)
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 			   MSG_SUID_ERROR,
 			   _("Possible race: lstat != fstat"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  (void) sl_close_fd(FIL__, __LINE__, fd); 
+	  (void) close(fd); 
 	  return -1;
 	}
       if (!S_ISREG(two.st_mode))
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 			   MSG_SUID_ERROR,
 			   _("Possible race: not a regular file"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  (void) sl_close_fd(FIL__, __LINE__, fd); 
+	  (void) close(fd); 
 	  return -1;
 	}
       if ((0 == (two.st_mode & S_ISUID)) && (0 == (two.st_mode & S_ISGID)))
 	{ 
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 			   MSG_SUID_ERROR,
 			   _("Possible race: not a suid/sgid file"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  (void) sl_close_fd(FIL__, __LINE__, fd); 
+	  (void) close(fd); 
 	  return -1;
 	}
@@ -379,29 +305,23 @@
 	  if (-1 == /*@-unrecog@*/fchmod(fd, two.st_mode)/*@+unrecog@*/)
 	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
 	      sh_error_handle ((-1), FIL__, __LINE__, errno,
 			       MSG_SUID_ERROR,
-			       sh_error_message(errno, errbuf, sizeof(errbuf)));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      (void) sl_close_fd(FIL__, __LINE__, fd); 
+			       sh_error_message(errno));
+	      (void) close(fd); 
 	      return -1;
 	    }
 #else
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno,
 			   MSG_SUID_ERROR,
 			   _("The fchmod() function is not available"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  (void) sl_close_fd(FIL__, __LINE__, fd); 
+	  (void) close(fd); 
 	  return -1;
 #endif
 	  if (two.st_nlink > 1)
 	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
 	      sh_error_handle ((-1), FIL__, __LINE__, 0,
 			       MSG_SUID_ERROR,
 			       _("Not truncated because hardlink count gt 1"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      (void) sl_close_fd(FIL__, __LINE__, fd); 
+	      (void) close(fd); 
 	      return -1;
 	    }
@@ -410,10 +330,8 @@
 	  if (-1 == /*@-unrecog@*/ftruncate(fd, 0)/*@+unrecog@*/)
 	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
 	      sh_error_handle ((-1), FIL__, __LINE__, errno,
 			       MSG_SUID_ERROR,
-			       sh_error_message(errno, errbuf, sizeof(errbuf)));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      (void) sl_close_fd(FIL__, __LINE__, fd); 
+			       sh_error_message(errno));
+	      (void) close(fd); 
 	      return -1;
 	    }
@@ -423,597 +341,81 @@
 	  if (-1 == retry_aud_unlink(FIL__, __LINE__, path))
 	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
 	      sh_error_handle ((-1), FIL__, __LINE__, errno,
 			       MSG_SUID_ERROR,
-			       sh_error_message(errno, errbuf, sizeof(errbuf)));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      (void) sl_close_fd(FIL__, __LINE__, fd); 
+			       sh_error_message(errno));
+	      (void) close(fd); 
 	      return -1;
 	    }
 	}
-      (void) sl_close_fd (FIL__, __LINE__, fd);
+      (void) close (fd);
       return (0);
     }
 }
 
-static int do_truncate (const char * path_in)
-{
-  volatile int    caperr;
-  int    result;
-  char * path;
-  char errbuf[SH_ERRBUF_SIZE];
+static int do_truncate (char * path)
+{
+  int         caperr;
+  int result;
 
   if (0 != chdir("/"))
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, errno,
 		       MSG_SUID_ERROR,
-		       sh_error_message(errno, errbuf, sizeof(errbuf)));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
+		       sh_error_message(errno));
     }
 
   if (0 != (caperr = sl_get_cap_qdel()))
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-		      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+		      sh_error_message (caperr), 
 		      _("sl_get_cap_qdel"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-
-  path   = sh_util_strdup  (path_in);
+    }
+
   result = do_truncate_int (path, 0);
-  SH_FREE(path);
 
   if (0 != (caperr = sl_drop_cap_qdel()))
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle((-1), FIL__, __LINE__, caperr, MSG_E_SUBGEN,
-		      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
+		      sh_error_message (caperr), 
 		      _("sl_drop_cap_qdel"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
     }
 
   if (0 != chdir("/"))
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, errno,
 		       MSG_SUID_ERROR,
-		       sh_error_message(errno, errbuf, sizeof(errbuf)));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
+		       sh_error_message(errno));
     }
   return result;
 }
-
-/* This variable is not used anywhere. It only exists
- * to assign &dirlist to it, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-static void * sh_dummy_tmp = NULL;
-
-static void sh_q_delete(const char * fullpath)
-{
-  int    status;
-  char * msg;
-  char * tmp;
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_tmp = (void*) &tmp;
-
-  if (do_truncate (fullpath) == -1)
-    {
-      status = errno;
-      msg    = SH_ALLOC(SH_BUFSIZE);
-      tmp    = sh_util_safe_name(fullpath);
-
-      (void) sl_snprintf(msg, SH_BUFSIZE, 
-			 _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), 
-			 status);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle (ShSuidchkSeverity,
-		       FIL__, __LINE__, 
-		       status,
-		       MSG_SUID_QREPORT, msg,
-		       tmp );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(tmp);
-      SH_FREE(msg);
-    }
-  else
-    {
-      tmp    = sh_util_safe_name(fullpath);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle (ShSuidchkSeverity,
-		       FIL__, __LINE__, 0,
-		       MSG_SUID_QREPORT,
-		       _("Quarantine method applied"),
-		       tmp );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(tmp);
-    }
-  return;
-}
-
-/* This variable is not used anywhere. It only exists
- * to assign &dirlist to it, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-static void * sh_dummy_mtmp = NULL;
-static void * sh_dummy_mmsg = NULL;
-
-static void sh_q_move(const char * fullpath, file_type * theFile, 
-		      const char * timestrc, const char * timestra, 
-		      const char * timestrm)
-{
-  volatile int  status;
-  int           readFile  = -1;
-  volatile int  writeFile = -1;
-  struct stat   fileInfo;
-  ssize_t       count;
-  char        * msg;
-  char        * tmp;
-  char        * basetmp;
-  char        * filetmp;
-  char          buffer[1024];
-  char        * dir = SH_ALLOC(PATH_MAX+1);
-  mode_t        umask_old;
-  FILE *        filePtr = NULL;
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_mtmp = (void*) &tmp;
-  sh_dummy_mmsg = (void*) &msg;
-
-  (void) sl_strlcpy (dir, DEFAULT_QDIR, PATH_MAX+1);
-
-  if (retry_stat (FIL__, __LINE__, dir, &fileInfo) != 0)
-    {
-      /* Quarantine directory does not exist,
-       */
-      status = errno;
-      msg    = SH_ALLOC(SH_BUFSIZE);
-      tmp    = sh_util_safe_name(fullpath);
-
-      (void) sl_snprintf(msg, SH_BUFSIZE, 
-			 _("Problem quarantining file.  File NOT quarantined.  errno = %ld (stat)"), 
-			 status);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle (ShSuidchkSeverity,
-		       FIL__, __LINE__, 
-		       status,
-		       MSG_SUID_QREPORT, msg,
-		       tmp );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(tmp);
-      SH_FREE(msg);
-    }
-  else
-    {
-      if (retry_lstat (FIL__, __LINE__, 
-		       fullpath, &fileInfo) == -1)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld(stat)"), status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT,
-			   msg, tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	}
-      else
-	{
-	  basetmp = sh_util_strdup(fullpath);
-	  filetmp = SH_ALLOC(PATH_MAX+1);
-	  tmp     = sh_util_basename(basetmp);
-
-	  (void) sl_snprintf(filetmp, PATH_MAX+1, "%s/%s", 
-			     DEFAULT_QDIR, tmp);
-	  SH_FREE(tmp);
-	  SH_FREE(basetmp);
-	  
-	  readFile  = open (fullpath, O_RDONLY);
-	  if (readFile != -1)
-	    writeFile = open (filetmp, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IXUSR);
-	  
-	  if ((readFile == -1) || (writeFile == -1))
-	    {
-	      status = errno;
-	      msg    = SH_ALLOC(SH_BUFSIZE);
-	      tmp    = sh_util_safe_name(fullpath);
-
-	      (void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld (open)"), status);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (ShSuidchkSeverity,
-			       FIL__, __LINE__, status,
-			       MSG_SUID_QREPORT,
-			       msg, tmp );
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      SH_FREE(tmp);
-	      SH_FREE(msg);
-	    }
-	  else
-	    { 
-	      /* sizeof(buffer) is 1024 
-	       */
-	      while ((count = (int) read (readFile, buffer, sizeof (buffer))) > 0)
-		{
-		  if ((int) write (writeFile, buffer, (size_t) count) != count)
-		    {
-		      status = errno;
-		      msg    = SH_ALLOC(SH_BUFSIZE);
-		      tmp    = sh_util_safe_name(fullpath);
-
-		      (void) sl_snprintf(msg, SH_BUFSIZE, 
-					 _("I/O error.  errno = %ld (write)"), status);
-		      SH_MUTEX_LOCK(mutex_thread_nolog);
-		      sh_error_handle (ShSuidchkSeverity,
-				       FIL__,
-				       __LINE__,
-				       status,
-				       MSG_SUID_QREPORT,
-				       msg, tmp );
-		      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		      SH_FREE(tmp);
-		      SH_FREE(msg);
-		    }
-		}
-	    }
-
-	  (void) sl_close_fd (FIL__, __LINE__, readFile);
-	  (void) fchmod(writeFile, S_IRUSR | S_IWUSR | S_IXUSR);
-	  (void) sl_close_fd (FIL__, __LINE__, writeFile);
-
-	  if (do_truncate (fullpath) == -1)
-	    {
-	      status = errno;
-	      msg    = SH_ALLOC(SH_BUFSIZE);
-	      tmp    = sh_util_safe_name(fullpath);
-
-	      (void) sl_snprintf(msg, SH_BUFSIZE, 
-				 _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), 
-				 status);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (ShSuidchkSeverity,
-			       FIL__, __LINE__, status,
-			       MSG_SUID_QREPORT,
-			       msg, tmp );
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      SH_FREE(tmp);
-	      SH_FREE(msg);
-	    }
-	  else
-	    {
-	      tmp = sh_util_basename(fullpath);
-
-	      (void) sl_snprintf(filetmp, PATH_MAX+1, "%s/%s.info", 
-				 DEFAULT_QDIR, 
-				 tmp);
-
-	      SH_FREE(tmp);
-	      /*
-	       * avoid chmod by setting umask
-	       */
-	      umask_old = umask (0077);
-	      filePtr   = fopen (filetmp, "w+");
-
-	      /*@-usedef@*/
-	      if (filePtr)
-		{
-		  fprintf(filePtr, 
-			  _("File Info:\n filename=%s\n size=%lu\n owner=%s(%d)\n group=%s(%d)\n ctime=%s\n atime=%s\n mtime=%s\n"), 
-			  fullpath, 
-			  (unsigned long) theFile->size, 
-			  theFile->c_owner, (int) theFile->owner, 
-			  theFile->c_group, (int) theFile->group, 
-			  timestrc, timestra, timestrm);
-		  (void) sl_fclose (FIL__, __LINE__, filePtr);
-		}
-	      /*@+usedef@*/
-	      umask (umask_old);
-	      
-	      tmp    = sh_util_safe_name(fullpath);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (ShSuidchkSeverity,
-			       FIL__,__LINE__,
-			       0, MSG_SUID_QREPORT,
-			       _("Quarantine method applied"),
-			       tmp );
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      SH_FREE(tmp);
-	    }
-	  SH_FREE(filetmp);
-	}
-    }
-  SH_FREE(dir);
-  return;
-}
-
-/* This variable is not used anywhere. It only exists
- * to assign &dirlist to it, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-static void * sh_dummy_ctmp = NULL;
-static void * sh_dummy_cmsg = NULL;
-
-static void sh_q_changeperm(const char * fullpath)
-{
-  volatile int    caperr;
-  volatile int    status;
-  char          * msg;
-  char          * tmp;
-  struct stat     fileInfo;
-  struct stat     fileInfo_F;
-  int             cperm_status = 0;
-  volatile int    file_d       = -1;
-  char errbuf[SH_ERRBUF_SIZE];
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_ctmp = (void*) &tmp;
-  sh_dummy_cmsg = (void*) &msg;
-
-  if (retry_lstat(FIL__, __LINE__, fullpath, &fileInfo) == -1)
-    {
-      status = errno;
-      msg    = SH_ALLOC(SH_BUFSIZE);
-      tmp    = sh_util_safe_name(fullpath);
-
-      (void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld"), status);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle (ShSuidchkSeverity,
-		       FIL__, __LINE__, 
-		       status,
-		       MSG_SUID_QREPORT, msg,
-		       tmp );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(tmp);
-      SH_FREE(msg);
-      cperm_status = -1;
-    }
-  
-  if (cperm_status == 0)
-    {
-      if (0 != (caperr = sl_get_cap_qdel()))
-	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle((-1), FIL__, __LINE__, 
-			  caperr, MSG_E_SUBGEN,
-			  sh_error_message (caperr, errbuf, sizeof(errbuf)), 
-			  _("sl_get_cap_qdel"));
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  cperm_status = -1;
-	}
-    }
-  
-  if (cperm_status == 0)
-    {
-      file_d = aud_open (FIL__, __LINE__, SL_YESPRIV,
-			 fullpath, O_RDONLY, 0);
-      if (-1 == file_d)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld"), status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT, msg,
-			   tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	  cperm_status = -1;
-	}
-    }
-  
-  if (cperm_status == 0)
-    {
-      if (retry_fstat(FIL__, __LINE__, file_d, &fileInfo_F) == -1)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, 
-			     _("I/O error.  errno = %ld"), status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT, msg,
-			   tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	  cperm_status = -1;
-	}
-    }
-  
-  if (cperm_status == 0)
-    {
-      if (fileInfo_F.st_ino  != fileInfo.st_ino ||
-	  fileInfo_F.st_dev  != fileInfo.st_dev ||
-	  fileInfo_F.st_mode != fileInfo.st_mode)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, 
-			     _("Race detected.  errno = %ld"), status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT, msg,
-			   tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	  cperm_status = -1;
-	}
-    }
-  
-  if ((fileInfo.st_mode & S_ISUID) > 0)
-    fileInfo.st_mode -= S_ISUID;
-  if ((fileInfo.st_mode & S_ISGID) > 0)
-    fileInfo.st_mode -= S_ISGID;
-  
-  if (cperm_status == 0)
-    {
-      if (fchmod(file_d, fileInfo.st_mode) == -1)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, 
-			     _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), 
-			     status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT,
-			   msg, tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	}
-      else
-	{
-	  tmp    = sh_util_safe_name(fullpath);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   0,
-			   MSG_SUID_QREPORT,
-			   _("Quarantine method applied"),
-			   tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	}
-    }
-  
-  if (0 != (caperr = sl_drop_cap_qdel()))
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle((-1), FIL__, __LINE__, 
-		      caperr, MSG_E_SUBGEN,
-		      sh_error_message (caperr, errbuf, sizeof(errbuf)), 
-		      _("sl_drop_cap_qdel"));
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
-  
-  if (file_d != -1)
-    {
-      do {
-	status = sl_close_fd (FIL__, __LINE__, file_d);
-      } while (status == -1 && errno == EINTR);
-      
-      if (-1 == status)
-	{
-	  status = errno;
-	  msg    = SH_ALLOC(SH_BUFSIZE);
-	  tmp    = sh_util_safe_name(fullpath);
-
-	  (void) sl_snprintf(msg, SH_BUFSIZE, 
-			     _("I/O error.  errno = %ld"), status);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle (ShSuidchkSeverity,
-			   FIL__, __LINE__, 
-			   status,
-			   MSG_SUID_QREPORT, msg,
-			   tmp );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp);
-	  SH_FREE(msg);
-	}
-    }
-  return;
-}
-
-static void report_file (const char * tmpcat, file_type * theFile, 
-			 char * timestrc, char * timestra, char * timestrm)
-{
-  char * msg = SH_ALLOC(SH_BUFSIZE);
-  char * tmp = sh_util_safe_name(tmpcat);
-
-  msg[0] = '\0';
-  /*@-usedef@*/
-
-#ifdef SH_USE_XML
-  (void) sl_snprintf(msg, SH_BUFSIZE, _("owner_new=\"%s\" iowner_new=\"%ld\" group_new=\"%s\" igroup_new=\"%ld\" size_new=\"%lu\" ctime_new=\"%s\" atime_new=\"%s\" mtime_new=\"%s\""), 
-		     theFile->c_owner, theFile->owner, 
-		     theFile->c_group, theFile->group, 
-		     (unsigned long) theFile->size, 
-		     timestrc, timestra, timestrm);
-#else
-  (void) sl_snprintf(msg, SH_BUFSIZE, _("owner_new=<%s>, iowner_new=<%ld>, group_new=<%s>, igroup_new=<%ld>, filesize=<%lu>, ctime=<%s>, atime=<%s>, mtime=<%s>"), 
-		     theFile->c_owner, theFile->owner, 
-		     theFile->c_group, theFile->group, 
-		     (unsigned long) theFile->size, 
-		     timestrc, timestra, timestrm);
-#endif
-  /*@+usedef@*/
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle (ShSuidchkSeverity, FIL__, __LINE__, 
-		   0, MSG_SUID_POLICY,
-		   _("suid/sgid file not in database"),
-		   tmp, msg );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  SH_FREE(tmp);
-  SH_FREE(msg);
-  return;
-}
-
-/* This variable is not used anywhere. It only exists
- * to assign &dirlist to it, which keeps gcc from
- * putting it into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_idirlist = NULL;
-void * sh_dummy_itmp     = NULL;
-
 
 static
 int sh_suidchk_check_internal (char * iname)
 {
+  int             caperr;
   DIR *           thisDir = NULL;
+  FILE *          filePtr = NULL;
   struct dirent * thisEntry;
   char          * tmpcat;
   char          * tmp;
+  char          * msg;
+  char          * dir;
+  char          * filetmp;
+  char          * basetmp;
   char            timestrc[32];
   char            timestra[32];
   char            timestrm[32];
+  char            buffer[1024];
   struct stat     buf;
-  volatile int    status;
-  int             fflags;
+  int             status;
+  int             count;
+  int             readFile = -1;
+  int             writeFile = -1;
   char          * fs;
-  volatile long   sl_status;
-  file_type     * theFile = NULL;
-  char            fileHash[2*(KEY_LEN + 1)];
-
-  struct sh_dirent * dirlist;
-  struct sh_dirent * dirlist_orig;
-  char errbuf[SH_ERRBUF_SIZE];
+  long            sl_status = SL_ENONE;
+  struct stat     fileInfo;
+
+  file_type       theFile;
+  char            fileHash[KEY_LEN + 1];
 
   SL_ENTER(_("sh_suidchk_check_internal"));
@@ -1029,10 +431,4 @@
   }
 
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_idirlist = (void*) &dirlist;
-  sh_dummy_itmp     = (void*) &tmp;
-
   thisDir = opendir (iname);
 
@@ -1041,23 +437,17 @@
       status = errno;
       tmp = sh_util_safe_name(iname);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle (ShDFLevel[SH_ERR_T_DIR], FIL__, __LINE__, status, 
 		       MSG_E_OPENDIR,
-		       sh_error_message (status, errbuf, sizeof(errbuf)), tmp);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
+		       sh_error_message (status), tmp);
       SH_FREE(tmp);
-      sh_dummy_idirlist = NULL;
-      sh_dummy_itmp     = NULL;
       SL_RETURN( (-1), _("sh_suidchk_check_internal"));
     }
 
-  /* Loop over directory entries
-   */
-  SH_MUTEX_LOCK(mutex_readdir);
-
-  dirlist      = NULL;
-  dirlist_orig = NULL;
-
   do {
+
+    if (sig_urgent > 0) {
+      SL_RETURN( (0), _("sh_suidchk_check_internal"));
+    }
+
 
     thisEntry = readdir (thisDir);
@@ -1071,325 +461,427 @@
 	continue;
 
-      dirlist = addto_sh_dirlist (thisEntry, dirlist);
-    }
-
-  } while (thisEntry != NULL);
-
-  SH_MUTEX_UNLOCK(mutex_readdir);
-
-  closedir(thisDir);
-
-  dirlist_orig = dirlist;
-
-  sl_status = SL_ENONE;
-
-  do {
-
-    /* If the directory is empty, dirlist = NULL
-     */
-    if (!dirlist)
-      break;
-
-    if (sig_urgent > 0) {
-      SL_RETURN( (0), _("sh_suidchk_check_internal"));
-    }
-
-    tmpcat = SH_ALLOC(PATH_MAX);
-    (void) sl_strlcpy(tmpcat, iname, PATH_MAX);
-    
-    if ((sl_strlen(tmpcat) != sl_strlen(iname)) || (tmpcat[0] == '\0'))
-      {
+      tmpcat = SH_ALLOC(PATH_MAX);
+      (void) sl_strlcpy(tmpcat, iname, PATH_MAX);
+
+      if ((sl_strlen(tmpcat) != sl_strlen(iname)) || (tmpcat[0] == '\0'))
 	sl_status = SL_ETRUNC;
-      }
-    else
-      {
-	if (tmpcat[1] != '\0') 
-	  sl_status = sl_strlcat(tmpcat, "/",                 PATH_MAX);
-      }
-
-    if (! SL_ISERROR(sl_status))
-      sl_status = sl_strlcat(tmpcat, dirlist->sh_d_name,   PATH_MAX);
-
-    if (SL_ISERROR(sl_status))
-      {
-	tmp = sh_util_safe_name(tmpcat);
-	SH_MUTEX_LOCK(mutex_thread_nolog);
-	sh_error_handle ((-1), FIL__, __LINE__, (int) sl_status, 
-			 MSG_E_SUBGPATH,
-			 _("path too long"),
-			 _("sh_suidchk_check_internal"), tmp );
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	SH_FREE(tmp);
-	SH_FREE(tmpcat);
-	dirlist = dirlist->next;
-	continue;
-      }
-
-    ++FileLimNum;
-    ++FileLimTotal;
-
-    /* Rate limit (Fps == Files per second)
-     */
-    if ((ShSuidchkFps > 0 && FileLimNum > ShSuidchkFps) &&
-	(ShSuidchkYield == S_FALSE))
-      {
-	FileLimNum  = 0;
-	FileLimNow  = time(NULL);
-	
-	if ( (FileLimNow  - FileLimStart) > 0 && 
-	     FileLimTotal/(FileLimNow  - FileLimStart) > ShSuidchkFps )
-	  (void) retry_msleep((int)((FileLimTotal/(FileLimNow-FileLimStart))/
-				    ShSuidchkFps) , 0);
-      }
-
-    status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf);
-
-    if (status != 0)
-      {
-	volatile int elevel = SH_ERR_ERR;
-	size_t tlen;
-
-	status = errno;
-	tmp = sh_util_safe_name(tmpcat);
-	tlen = strlen(tmp);
-	if (tlen >= 6 && 0 == strcmp(&tmp[tlen-6], _("/.gvfs")))
-	  elevel = SH_ERR_NOTICE;
-	else if (tlen >= 5 && 0 == strcmp(&tmp[tlen-5], _("/gvfs")))
-	  elevel = SH_ERR_NOTICE;
-
-        /* If we are scanning a temporary directory where dirs and files
-	 * can be created/deleted, an lstat() error is something which
-	 * may occur frequently. As a missing dir/file is not an important
-	 * problem for the suidcheck, the error level is only SH_ERR_NOTICE. 
-	 */
-        if (status == ENOENT)
-          elevel = SH_ERR_NOTICE;
-
-	SH_MUTEX_LOCK(mutex_thread_nolog);
-	sh_error_handle (elevel, FIL__, __LINE__, status, MSG_ERR_LSTAT,
-			 sh_error_message(status, errbuf, sizeof(errbuf)),
-			 tmp );
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	SH_FREE(tmp);
-      }
-    else
-      {
-	if (/*@-usedef@*/S_ISDIR(buf.st_mode)/*@+usedef@*/ &&
-	    (ShSuidchkExclude == NULL || 
-	     NULL == zAVL_string_get(ShSuidchkExclude, tmpcat)))
-	  {
-	    /* fs is a STATIC string or NULL
-	     */
-	    fs = filesystem_type (tmpcat, tmpcat, &buf);
-
-	    if (fs != NULL 
-#ifndef SH_SUIDTESTDIR
-		&& 
-		0 != strncmp (_("afs"),     fs, 3) && 
-		0 != strncmp (_("devfs"),   fs, 5) &&
-		0 != strncmp (_("fdesc"),   fs, 5) &&
-		0 != strncmp (_("iso9660"), fs, 7) &&
-		0 != strncmp (_("cd9660"),  fs, 6) &&
-		0 != strncmp (_("lustre"),  fs, 6) &&
-		0 != strncmp (_("mmfs"),    fs, 4) && 
-		0 != strncmp (_("msdos"),   fs, 5) &&
-		0 != strncmp (_("nfs"),     fs, 3) &&
-		0 != strncmp (_("proc"),    fs, 4) &&
-		0 != strncmp (_("sysfs"),   fs, 5) &&
-		0 != strncmp (_("vfat"),    fs, 4)
-#endif 
-		)
-	      {
-		if ((ShSuidchkNosuid == S_TRUE) || 
-		    (0 != strncmp (_("nosuid"),  fs, 6)))
+      else
+	{
+	  if (tmpcat[1] != '\0') 
+	    sl_status = sl_strlcat(tmpcat, "/",                 PATH_MAX);
+	}
+      if (! SL_ISERROR(sl_status))
+	sl_status = sl_strlcat(tmpcat, thisEntry->d_name,   PATH_MAX);
+      if (SL_ISERROR(sl_status))
+	{
+	  tmp = sh_util_safe_name(tmpcat);
+	  sh_error_handle ((-1), FIL__, __LINE__, (int) sl_status, 
+			   MSG_E_SUBGPATH,
+			   _("path too long"),
+			   _("sh_suidchk_check_internal"), tmp );
+	  SH_FREE(tmp);
+	  continue;
+	}
+
+      ++FileLimNum;
+      ++FileLimTotal;
+
+      if ((ShSuidchkFps > 0 && FileLimNum > ShSuidchkFps && FileLimTotal > 0)&&
+	  (ShSuidchkYield == S_FALSE))
+	{
+	  FileLimNum  = 0;
+	  FileLimNow  = time(NULL);
+ 
+	  if ( (FileLimNow  - FileLimStart) > 0 && 
+	       FileLimTotal/(FileLimNow  - FileLimStart) > ShSuidchkFps )
+	    (void) retry_msleep((int)((FileLimTotal/(FileLimNow-FileLimStart))/
+		   ShSuidchkFps) , 0);
+	}
+	      
+      status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf);
+
+      if (status != 0)
+	{
+	  status = errno;
+	  tmp = sh_util_safe_name(tmpcat);
+	  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, status, MSG_ERR_LSTAT,
+			   sh_error_message(status),
+			   tmpcat );
+	  SH_FREE(tmp);
+	}
+      else
+	{
+	  if (/*@-usedef@*/S_ISDIR(buf.st_mode)/*@+usedef@*/ &&
+	      (ShSuidchkExclude == NULL || 
+	      0 != strncmp(tmpcat, ShSuidchkExclude, (size_t) ExcludeLen)))
+	    {
+	      /* fs is a STATIC string
+	       */
+	      fs = filesystem_type (tmpcat, tmpcat, &buf);
+	      if (fs != NULL && 
+		  0 != strncmp (_("nfs"),     fs, 3) && 
+		  0 != strncmp (_("proc"),    fs, 4) &&
+		  0 != strncmp (_("iso9660"), fs, 7) &&
+		  0 != strncmp (_("vfat"),    fs, 4) &&
+		  0 != strncmp (_("msdos"),   fs, 5) &&
+		  0 != strncmp (_("devfs"),   fs, 5) &&
+		  0 != strncmp (_("nosuid"),  fs, 6) 
+		  )
+		{
 		  /* fprintf(stderr, "%s: %s\n", fs, tmpcat); */
 		  (void) sh_suidchk_check_internal(tmpcat);
-	      }
-	  }
-	else if (S_ISREG(buf.st_mode) &&
-		 (0 !=(S_ISUID & buf.st_mode) ||
+		}
+	    }
+	  else if (S_ISREG(buf.st_mode) &&
+		   (0 !=(S_ISUID & buf.st_mode) ||
 #if defined(HOST_IS_LINUX)
-		  (0 !=(S_ISGID & buf.st_mode) && 
-		   0 !=(S_IXGRP & buf.st_mode)) 
+		    (0 !=(S_ISGID & buf.st_mode) && 
+		     0 !=(S_IXGRP & buf.st_mode)) 
 #else  
-		  0 !=(S_ISGID & buf.st_mode)
-#endif
-		  )
-		 )
-	  {
-	    int dummy;
-	    int class;
-	    unsigned long check_flags = 0;
-
-	    theFile = SH_ALLOC(sizeof(file_type));
-
-	    (void) sl_strlcpy (theFile->fullpath, tmpcat, PATH_MAX);
-	    theFile->check_flags  = sh_files_maskof(SH_LEVEL_READONLY);
-	    CLEAR_SH_FFLAG_REPORTED(theFile->file_reported);
-	    theFile->attr_string = NULL;
-	    theFile->link_path   = NULL;
-	    
-	    sh_files_search_file(tmpcat, &class,  &check_flags, &dummy);
-	    if ((check_flags & MODI_PREL) != 0)
-	      MODI_SET(theFile->check_flags, MODI_PREL);
-
-	    status = sh_unix_getinfo (ShDFLevel[SH_ERR_T_RO], 
-				      dirlist->sh_d_name,
-				      theFile, fileHash, 0);
-	    
-	    tmp = sh_util_safe_name(tmpcat);
-	    
-	    if (status != 0)
-	      {
-		SH_MUTEX_LOCK(mutex_thread_nolog);
-		sh_error_handle (ShSuidchkSeverity, FIL__, __LINE__, 
-				 0, MSG_E_SUBGPATH,
-				 _("Could not check suid/sgid file"),
-				 _("sh_suidchk_check_internal"),
-				 tmp);
-		SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      }
-	    else
-	      {
-		
-		if ( sh.flag.update   == S_TRUE && 
-		     (sh.flag.checkSum == SH_CHECK_INIT  || 
-		      sh.flag.checkSum == SH_CHECK_CHECK))
-		  {
-		    int compret;
-
-		    /* Updating database. Report new files that
-		     * are not in database already. Then compare
-		     * to database and report changes.
-		     */
-		    if (-1 == sh_hash_have_it (tmpcat))
-		      {
-			SH_MUTEX_LOCK(mutex_thread_nolog);
-			sh_error_handle ((-1), FIL__, __LINE__, 
-					 0, MSG_SUID_FOUND, tmp );
-			SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		      }
-		    else
-		      {
-			SH_MUTEX_LOCK(mutex_thread_nolog);
-			sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-					 0, MSG_SUID_FOUND, tmp );
-			SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		      }
-		    
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    compret = sh_hash_compdata (SH_LEVEL_READONLY, 
-						theFile, fileHash,
-						_("[SuidCheck]"), 
-						ShSuidchkSeverity);
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-
-		    if (compret == 0)
-		      {
-			sh_hash_pushdata_memory (theFile, fileHash); /* no call to sh_error_handle */
-		      }
-		    
-		    sh_hash_set_flag(tmpcat, SH_FFLAG_SUIDCHK); /* no call to sh_error_handle */
-		    
-		  }
-		
-		else if (sh.flag.checkSum == SH_CHECK_INIT  && 
-			 sh.flag.update == S_FALSE )
-		  {
-		    /* Running init. Report on files detected.
-		     */
-		    sh_dbIO_rootfs_strip(theFile->fullpath);
-		    sh_dbIO_data_write (theFile, fileHash); /* no call to sh_error_handle */
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle ((-1), FIL__, __LINE__, 
-				     0, MSG_SUID_FOUND, tmp );
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		  }
-		
-		else if (sh.flag.checkSum == SH_CHECK_CHECK )
-		  {
-		    /* Running file check. Report on new files
-		     * detected, and quarantine them.
-		     */
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
-				     0, MSG_SUID_FOUND, tmp );
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		    
-		    fflags = sh_hash_getflags(tmpcat); /* no call to sh_error_handle */
-		    
-		    if ( (-1 == fflags) || (!SH_FFLAG_SUIDCHK_SET(fflags)))
-		      {
-			if (-1 == fflags)
-			  {
-			    (void) sh_unix_gmttime (theFile->ctime, timestrc, sizeof(timestrc)); 
-			    (void) sh_unix_gmttime (theFile->atime, timestra, sizeof(timestra)); 
-			    (void) sh_unix_gmttime (theFile->mtime, timestrm, sizeof(timestrm));
-
-			    report_file(tmpcat, theFile, timestrc, timestra, timestrm);
-			  }
-			/* Quarantine file according to configured method
-			 */
-			if (ShSuidchkQEnable == S_TRUE)
-			  {
-			    switch (ShSuidchkQMethod)
-			      {
-			      case SH_Q_DELETE:
-				sh_q_delete(theFile->fullpath);
-				break;
-			      case SH_Q_CHANGEPERM:
-				sh_q_changeperm(theFile->fullpath);
-				break;
-			      case SH_Q_MOVE:
-				sh_q_move(theFile->fullpath, theFile, timestrc, timestra, timestrm);
-				break;
-			      default:
-				SH_MUTEX_LOCK(mutex_thread_nolog);
-				sh_error_handle (ShSuidchkSeverity, FIL__,
-						 __LINE__, 0, MSG_SUID_QREPORT,
-						 _("Bad quarantine method"), tmp);
-				SH_MUTEX_UNLOCK(mutex_thread_nolog);
-				break;
-			      }
-			  }
-			else
-			  {
-			    /* 1.8.1 push file to in-memory database
-			     */
-			    SH_MUTEX_LOCK(mutex_thread_nolog);
-			    (void) sh_hash_compdata (SH_LEVEL_READONLY,
-						     theFile, fileHash,
-						     _("[SuidCheck]"),
-						     ShSuidchkSeverity);
-			    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-			    
-			    sh_hash_set_flag(tmpcat, SH_FFLAG_SUIDCHK); /* no call to sh_error_handle */
-			    
-			  }
-		      }
-		    else
-		      {
-			/* File exists. Check for modifications.
-			 */
-			SH_MUTEX_LOCK(mutex_thread_nolog);
-			(void) sh_hash_compdata (SH_LEVEL_READONLY, 
-						 theFile, fileHash,
-						 _("[SuidCheck]"),
-						 ShSuidchkSeverity);
-			SH_MUTEX_UNLOCK(mutex_thread_nolog);	
-			sh_hash_set_flag(tmpcat, SH_FFLAG_SUIDCHK); /* no call to sh_error_handle */
-			
-		      }
-		  }
-	      }
-	    SH_FREE(tmp);
-	    if (theFile->attr_string) SH_FREE(theFile->attr_string);
-	    if (theFile->link_path)   SH_FREE(theFile->link_path);
-	    SH_FREE(theFile);
-	  }
-      }
-    SH_FREE(tmpcat);
-
-  
+		    0 !=(S_ISGID & buf.st_mode)
+#endif
+		    )
+		   )
+	    {
+	      
+	      (void) sl_strlcpy (theFile.fullpath, tmpcat, PATH_MAX);
+	      theFile.check_mask = sh_files_maskof(SH_LEVEL_READONLY);
+	      theFile.reported   = S_FALSE;
+	      status = sh_unix_getinfo (ShDFLevel[SH_ERR_T_RO], 
+					thisEntry->d_name,
+					&theFile, fileHash, 0);
+
+	      tmp = sh_util_safe_name(tmpcat);
+
+	      if (status != 0)
+		{
+		  sh_error_handle (ShSuidchkSeverity, FIL__, __LINE__, 
+				   0, MSG_E_SUBGPATH,
+				   _("Could not check suid/sgid file"),
+				   _("sh_suidchk_check_internal"),
+				   tmp);
+		}
+	      else
+		{
+		  if (sh.flag.update == S_TRUE && 
+		      (sh.flag.checkSum == SH_CHECK_INIT  || 
+		       sh.flag.checkSum == SH_CHECK_CHECK))
+		    {
+		      if (-1 == sh_hash_have_it (tmpcat))
+			{
+			  sh_error_handle ((-1), FIL__, __LINE__, 
+					   0, MSG_SUID_FOUND,
+					   tmp );
+			}
+		      else
+			{
+			  sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
+					   0, MSG_SUID_FOUND,
+					   tmp );
+			}
+		      if (0 == sh_hash_compdata (SH_LEVEL_READONLY, 
+						 &theFile, fileHash,
+						 _("[SuidCheck]"), 
+						 ShSuidchkSeverity))
+			{
+			  sh_hash_pushdata_memory (&theFile, fileHash);
+			}
+		    }
+		  else if (sh.flag.checkSum == SH_CHECK_INIT  && 
+			   sh.flag.update == S_FALSE )
+		    {
+		      sh_hash_pushdata (&theFile, fileHash);
+		      sh_error_handle ((-1), FIL__, __LINE__, 
+				       0, MSG_SUID_FOUND,
+				       tmp );
+		    }
+		  else if (sh.flag.checkSum == SH_CHECK_CHECK )
+		    {
+		      sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
+				       0, MSG_SUID_FOUND,
+				       tmp );
+		      if (-1 == sh_hash_have_it (tmpcat))
+			{
+			  msg = SH_ALLOC(SH_BUFSIZE);
+			  msg[0] = '\0';
+			  /*@-usedef@*/
+			  (void) sl_strlcpy (timestrc, 
+					     sh_unix_gmttime (theFile.ctime), 
+					     32);
+			  (void) sl_strlcpy (timestra, 
+					     sh_unix_gmttime (theFile.atime), 
+					     32);
+			  (void) sl_strlcpy (timestrm, 
+					     sh_unix_gmttime (theFile.mtime), 
+					     32);
+#ifdef SH_USE_XML
+			  (void) sl_snprintf(msg, SH_BUFSIZE, _("owner_new=\"%s\" iowner_new=\"%ld\" group_new=\"%s\" igroup_new=\"%ld\" size_new=\"%lu\" ctime_new=\"%s\" atime_new=\"%s\" mtime_new=\"%s\""), 
+				      theFile.c_owner, theFile.owner, 
+				      theFile.c_group, theFile.group, 
+				      (unsigned long) theFile.size, 
+				      timestrc, timestra, timestrm);
+#else
+			  (void) sl_snprintf(msg, SH_BUFSIZE, _("owner_new=<%s>, iowner_new=<%ld>, group_new=<%s>, igroup_new=<%ld>, filesize=<%lu>, ctime=<%s>, atime=<%s>, mtime=<%s>"), 
+				      theFile.c_owner, theFile.owner, 
+				      theFile.c_group, theFile.group, 
+				      (unsigned long) theFile.size, 
+				      timestrc, timestra, timestrm);
+#endif
+			  /*@+usedef@*/
+
+			  sh_error_handle (ShSuidchkSeverity, FIL__, __LINE__, 
+					   0, MSG_SUID_POLICY,
+					   _("suid/sgid file not in database"),
+					   tmp, msg );
+			  SH_FREE(msg);
+
+			  /* Quarantine file according to configured method
+                          */
+			  if (ShSuidchkQEnable == S_TRUE)
+			    {
+			      switch (ShSuidchkQMethod)
+				{
+				  case SH_Q_DELETE:
+				    /* if (unlink (theFile.fullpath) == -1) */
+				    if (do_truncate (theFile.fullpath) == -1)
+				      {
+					status = errno;
+					msg = SH_ALLOC(SH_BUFSIZE);
+					(void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), status);
+					sh_error_handle (ShSuidchkSeverity,
+							 FIL__, __LINE__, 
+							 status,
+							 MSG_SUID_QREPORT, msg,
+							 tmp );
+					SH_FREE(msg);
+				      }
+				    else
+				      {
+				        sh_error_handle (ShSuidchkSeverity,
+							 FIL__, __LINE__, 0,
+							 MSG_SUID_QREPORT,
+							 _("Quarantine method applied"),
+							 tmp );
+				      }
+				    break;
+				  case SH_Q_CHANGEPERM:
+				    if (retry_lstat(FIL__, __LINE__, tmpcat, &fileInfo) == -1)
+				      {
+					status = errno;
+					msg = SH_ALLOC(SH_BUFSIZE);
+					(void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld"), status);
+					sh_error_handle (ShSuidchkSeverity,
+							 FIL__, __LINE__, 
+							 status,
+							 MSG_SUID_QREPORT, msg,
+							 tmp );
+					SH_FREE(msg);
+				      }
+				    else
+				      {
+					if (0 != (caperr = sl_get_cap_qdel()))
+					  {
+					    sh_error_handle((-1), FIL__, __LINE__, 
+							    caperr, MSG_E_SUBGEN,
+							    sh_error_message (caperr), 
+							    _("sl_get_cap_qdel"));
+					  }
+
+					if ((fileInfo.st_mode & S_ISUID) > 0)
+					  fileInfo.st_mode -= S_ISUID;
+					if ((fileInfo.st_mode & S_ISGID) > 0)
+					  fileInfo.st_mode -= S_ISGID;
+					if (chmod(tmpcat, fileInfo.st_mode) == -1)
+					  {
+					    status = errno;
+					    msg = SH_ALLOC(SH_BUFSIZE);
+					    (void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), status);
+					    sh_error_handle (ShSuidchkSeverity,
+							     FIL__, __LINE__, 
+							     status,
+							     MSG_SUID_QREPORT,
+							     msg, tmp );
+					    SH_FREE(msg);
+					  }
+					else
+					  {
+					    sh_error_handle (ShSuidchkSeverity,
+							     FIL__, __LINE__, 
+							     0,
+							     MSG_SUID_QREPORT,
+							     _("Quarantine method applied"),
+							     tmp );
+					  }
+					if (0 != (caperr = sl_drop_cap_qdel()))
+					  {
+					    sh_error_handle((-1), FIL__, __LINE__, 
+							    caperr, MSG_E_SUBGEN,
+							    sh_error_message (caperr), 
+							    _("sl_drop_cap_qdel"));
+					  }
+				      }
+				    break;
+				  case SH_Q_MOVE:
+				    dir = SH_ALLOC(PATH_MAX+1);
+				    (void) sl_strlcpy (dir, DEFAULT_QDIR, PATH_MAX+1);
+				    if (access (dir, F_OK) != 0)
+				      {
+					status = errno;
+					msg = SH_ALLOC(SH_BUFSIZE);
+					(void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld (access)"), status);
+					sh_error_handle (ShSuidchkSeverity,
+							 FIL__, __LINE__, 
+							 status,
+							 MSG_SUID_QREPORT, msg,
+							 tmp );
+					SH_FREE(msg);
+				      }
+				    else
+				      {
+					if (retry_lstat (FIL__, __LINE__, 
+							theFile.fullpath, &fileInfo) == -1)
+					  {
+					    status = errno;
+					    msg = SH_ALLOC(SH_BUFSIZE);
+					    (void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld(stat)"), status);
+					    sh_error_handle (ShSuidchkSeverity,
+							     FIL__, __LINE__, 
+							     status,
+							     MSG_SUID_QREPORT,
+							     msg, tmp );
+					    SH_FREE(msg);
+					  }
+					else
+					  {
+					    basetmp = SH_ALLOC(1 + sl_strlen(theFile.fullpath));
+					    (void) sl_strlcpy(basetmp, theFile.fullpath, 
+						       1 + sl_strlen(theFile.fullpath));
+					    filetmp = SH_ALLOC(PATH_MAX+1);
+					    (void) sl_snprintf(filetmp, PATH_MAX+1, "%s/%s", 
+							DEFAULT_QDIR, basename(basetmp));
+					    SH_FREE(basetmp);
+					    
+					    readFile  = open (theFile.fullpath, O_RDONLY);
+					    if (readFile != -1)
+					      writeFile = open (filetmp, O_WRONLY|O_CREAT);
+
+					    if ((readFile == -1) || (writeFile == -1))
+					      {
+						status = errno;
+						msg = SH_ALLOC(SH_BUFSIZE);
+						(void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld (open)"), status);
+						sh_error_handle (ShSuidchkSeverity,
+								 FIL__, __LINE__, status,
+								 MSG_SUID_QREPORT,
+								 msg, tmp );
+						SH_FREE(msg);
+					      }
+					    else
+					      { 
+						/* sizeof(buffer) is 1024 */
+						while ((count = (int) read (readFile, buffer, sizeof (buffer))) > 0)
+						  if ((int) write (writeFile, buffer, (size_t) count) != count)
+						    {
+						      status = errno;
+						      msg = SH_ALLOC(SH_BUFSIZE);
+					    	      (void) sl_snprintf(msg, SH_BUFSIZE, _("I/O error.  errno = %ld (write)"), status);
+						      sh_error_handle (ShSuidchkSeverity,
+								       FIL__,
+								       __LINE__,
+								       status,
+								       MSG_SUID_QREPORT,
+								       msg, tmp );
+						      SH_FREE(msg);
+						    }
+					      }
+					    (void) close (readFile);
+					    (void) fchmod(writeFile, S_IRUSR | S_IWUSR | S_IXUSR);
+					    (void) close (writeFile);
+					    /* if (unlink (theFile.fullpath) == -1) */
+					    if (do_truncate (theFile.fullpath) == -1)
+					      {
+						status = errno;
+						msg = SH_ALLOC(SH_BUFSIZE);
+						(void) sl_snprintf(msg, SH_BUFSIZE, _("Problem quarantining file.  File NOT quarantined.  errno = %ld"), status);
+						sh_error_handle (ShSuidchkSeverity,
+								 FIL__, __LINE__, status,
+								 MSG_SUID_QREPORT,
+								 msg, tmp );
+						SH_FREE(msg);
+					      }
+					    else
+					      {
+						(void) sl_snprintf(filetmp, PATH_MAX+1, "%s/%s.info", 
+								   DEFAULT_QDIR, 
+								   basename(theFile.fullpath));
+						filePtr = fopen (filetmp, "w+");
+						/*@-usedef@*/
+						if (filePtr)
+						  {
+						    fprintf(filePtr, _("File Info:\n filename=%s\n size=%lu\n owner=%s(%d)\n group=%s(%d)\n ctime=%s\n atime=%s\n mtime=%s\n"), 
+							    theFile.fullpath, 
+							    (unsigned long) theFile.size, 
+							    theFile.c_owner, (int) theFile.owner, 
+							    theFile.c_group, (int) theFile.group, 
+							    timestrc, timestra, timestrm);
+						    (void) fclose (filePtr);
+						  }
+						/*@+usedef@*/
+					
+						sh_error_handle (ShSuidchkSeverity,
+							 	 FIL__,__LINE__,
+								 0, MSG_SUID_QREPORT,
+								 _("Quarantine method applied"),
+								 tmp );
+						if (chmod(filetmp, S_IRUSR | S_IWUSR) == -1)
+						  {
+						    status = errno;
+						    msg = SH_ALLOC(SH_BUFSIZE);
+						    (void) sl_snprintf(msg, SH_BUFSIZE, _("Problem setting permissions on quarantined file.  errno = %ld"), status);
+						    sh_error_handle (ShSuidchkSeverity,
+								     FIL__,__LINE__,
+								     status, MSG_SUID_QREPORT,
+								     msg, tmp );
+						    SH_FREE(msg);
+						  }
+					      }
+					    SH_FREE(filetmp);
+					  }
+				      }
+				    SH_FREE(dir);
+				    break;
+				  default:
+				    sh_error_handle (ShSuidchkSeverity, FIL__,
+						     __LINE__, 0, MSG_SUID_QREPORT,
+						     _("Bad quarantine method"),
+						     tmp);
+				    break;
+				}
+			    }
+			  else
+			    {
+			      /* 1.8.1 push file to in-memory database
+			       */
+			      (void) sh_hash_compdata (SH_LEVEL_READONLY,
+						       &theFile, fileHash,
+						       _("[SuidCheck]"),
+						       ShSuidchkSeverity);
+			    }
+			}
+		      else
+			{
+			  (void) sh_hash_compdata (SH_LEVEL_READONLY, 
+						   &theFile, fileHash,
+						   _("[SuidCheck]"),
+						   ShSuidchkSeverity);
+			}
+		    }
+		}
+	      SH_FREE(tmp);
+
+	    }
+	}
+      SH_FREE(tmpcat);
+    }
 #ifdef HAVE_SCHED_YIELD
     if (ShSuidchkYield == S_TRUE)
@@ -1398,23 +890,14 @@
 	  {
 	    status = errno;
-	    SH_MUTEX_LOCK(mutex_thread_nolog);
 	    sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_SUBGEN,
-			     _("Failed to release time slice"),
+		             _("Failed to release time slice"),
 			     _("sh_suidchk_check_internal") );
-	    SH_MUTEX_UNLOCK(mutex_thread_nolog);
+	    
 	  }
       }
 #endif
-  
-    dirlist = dirlist->next;
-
-  }  while (dirlist != NULL);
-
-
-  kill_sh_dirlist (dirlist_orig);
-
-  sh_dummy_idirlist = NULL;
-  sh_dummy_itmp     = NULL;
-
+  }  while (thisEntry != NULL);
+
+  (void) closedir (thisDir);
   SL_RETURN( (0), _("sh_suidchk_check_internal"));
 }
@@ -1425,28 +908,8 @@
  *
  *************/
-int sh_suidchk_init (struct mod_type * arg)
-{
-#ifndef HAVE_PTHREAD
-  (void) arg;
-#endif
-
+int sh_suidchk_init ()
+{
   if (ShSuidchkActive == S_FALSE)
-    return SH_MOD_FAILED;
-
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 &&
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      return SH_MOD_THREAD;
-    }
-#endif
+    return (-1);
 
   return (0);
@@ -1500,16 +963,11 @@
 int sh_suidchk_check ()
 {
-  volatile int status;
+  int status;
 
   SL_ENTER(_("sh_suidchk_check"));
 
-  if (ShSuidchkActive == S_FALSE)
-    SL_RETURN(-1, _("sh_suidchk_check"));
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
+  sh_error_handle (SH_ERR_NOTICE, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
 		   _("Checking for SUID programs"),
-		   _("sh_suidchk_check") );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+		   _("suidchk_check") );
 
   FileLimNow        = time(NULL);
@@ -1518,15 +976,9 @@
   FileLimTotal      = 0;
 
-#ifdef SH_SUIDTESTDIR
-  status = sh_suidchk_check_internal (SH_SUIDTESTDIR);
-#else
   status = sh_suidchk_check_internal ("/");
-#endif
-
-  SH_MUTEX_LOCK(mutex_thread_nolog);
+
   sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_SUID_SUMMARY,
 		   FileLimTotal,
 		   (long) (time(NULL) - FileLimStart) );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 
   SL_RETURN(status, _("sh_suidchk_check"));
@@ -1539,5 +991,5 @@
  *************/
 
-int sh_suidchk_set_severity  (const char * c)
+int sh_suidchk_set_severity  (char * c)
 {
   int retval;
@@ -1551,9 +1003,7 @@
 }
 
-int sh_suidchk_set_exclude (const char * c)
-{
-  int ret = 0;
+int sh_suidchk_set_exclude (char * c)
+{
   SL_ENTER(_("sh_suidchk_set_exclude"));
-
   if (c == NULL || c[0] == '\0')
     {
@@ -1564,16 +1014,33 @@
     {
       if (ShSuidchkExclude != NULL)
-	sh_suid_exclude_free();
+	SH_FREE(ShSuidchkExclude);
+      ShSuidchkExclude = NULL;
       SL_RETURN(0, _("sh_suidchk_set_exclude"));
     }
 
-  ret = sh_suid_exclude_add(c);
-
-  SL_RETURN(ret, _("sh_suidchk_set_exclude"));
-}
-
-int sh_suidchk_set_timer (const char * c)
-{
-  volatile long val;
+  if (ShSuidchkExclude != NULL)
+    SH_FREE(ShSuidchkExclude);
+
+  /* 1.8.1 add trailing slash
+   */
+  ExcludeLen       = (int) sl_strlen(c);
+  if (c[ExcludeLen-1] != '/')
+    {
+      ExcludeLen++;
+      if ((ExcludeLen <= 0) || (ExcludeLen+1 <= 0)) /* may overflow */
+	{
+	  SL_RETURN(-1, _("sh_suidchk_set_exclude"));
+	}
+    }
+  ShSuidchkExclude = SH_ALLOC((size_t) ExcludeLen + 1);
+  (void) sl_strlcpy(ShSuidchkExclude, c, (size_t)(ExcludeLen + 1));
+  ShSuidchkExclude[ExcludeLen-1] = '/';
+
+  SL_RETURN(0, _("sh_suidchk_set_exclude"));
+}
+
+int sh_suidchk_set_timer (char * c)
+{
+  long val;
 
   SL_ENTER(_("sh_suidchk_set_timer"));
@@ -1581,10 +1048,7 @@
   val = strtol (c, (char **)NULL, 10);
   if (val <= 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("suidchk timer"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
+    sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
+                      _("suidchk timer"), c);
+
   val = (val <= 0 ? 7200 : val);
 
@@ -1594,5 +1058,5 @@
 
 
-static void sh_suidchk_free_schedule (void)
+int sh_suidchk_free_schedule ()
 {
   sh_schedule_t * current = ShSuidchkSched;
@@ -1606,17 +1070,8 @@
     }
   ShSuidchkSched = NULL;
-  return;
-}
-
-int sh_suidchk_reconf ()
-{
-  SH_MUTEX_LOCK(mutex_suid_check);
-  sh_suidchk_free_schedule();
-  set_defaults();
-  SH_MUTEX_UNLOCK(mutex_suid_check);
   return 0;
 }
 
-int sh_suidchk_set_schedule (const char * str)
+int sh_suidchk_set_schedule (char * str)
 {
   int status;
@@ -1656,7 +1111,7 @@
 
 
-int sh_suidchk_set_fps (const char * c)
-{
-  volatile long val;
+int sh_suidchk_set_fps (char * c)
+{
+  long val;
 
   SL_ENTER(_("sh_suidchk_set_fps"));
@@ -1664,10 +1119,7 @@
   val = strtol (c, (char **)NULL, 10);
   if (val < 0)
-    {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
-		       _("suidchk fps"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-    }
+    sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
+                      _("suidchk fps"), c);
+
   val = (val < 0 ? 0 : val);
 
@@ -1676,5 +1128,5 @@
 }
 
-int sh_suidchk_set_yield (const char * c)
+int sh_suidchk_set_yield (char * c)
 {
   int i;
@@ -1689,5 +1141,5 @@
 }
 
-int sh_suidchk_set_activate (const char * c)
+int sh_suidchk_set_activate (char * c)
 {
   int i;
@@ -1697,13 +1149,5 @@
 }
 
-int sh_suidchk_set_nosuid (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_suidchk_set_nosuid"));
-  i = sh_util_flagval(c, &ShSuidchkNosuid);
-  SL_RETURN(i, _("sh_suidchk_set_nosuid"));
-}
-
-int sh_suidchk_set_quarantine (const char * c)
+int sh_suidchk_set_quarantine (char * c)
 {
   int i;
@@ -1713,5 +1157,5 @@
 }
 
-int sh_suidchk_set_qdelete (const char * c)
+int sh_suidchk_set_qdelete (char * c)
 {
   int i;
@@ -1721,9 +1165,8 @@
 }
 
-int sh_suidchk_set_qmethod (const char * c)
-{
-  volatile long val;
-  volatile int  ret = 0;
-  struct stat buf;
+int sh_suidchk_set_qmethod (char * c)
+{
+  long val;
+  int  ret = 0;
 
   SL_ENTER(_("sh_suidchk_set_qmethod"));
@@ -1732,8 +1175,6 @@
   if (val < 0)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
 		       _("suidchk qmethod"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       ret = -1;
     }
@@ -1749,13 +1190,11 @@
           break;
         case SH_Q_MOVE:
-          if (retry_stat (FIL__, __LINE__, DEFAULT_QDIR, &buf) != 0)
+          if (access (DEFAULT_QDIR, F_OK) != 0)
 	    {
 	      if (mkdir (DEFAULT_QDIR, 0750) == -1)
 		{
-		  SH_MUTEX_LOCK(mutex_thread_nolog);
 		  sh_error_handle ((-1), FIL__, __LINE__, EINVAL,
 				   MSG_SUID_ERROR,
 				   _("Unable to create quarantine directory"));
-		  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 		}
 	    }
@@ -1763,8 +1202,6 @@
           break;
         default:
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
 			   _("suidchk qmethod"), c);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
           ShSuidchkQMethod = -1;
 	  ret = -1;
@@ -1943,5 +1380,5 @@
 
 #ifdef FSTYPE_MNTENT		/* 4.3BSD etc.  */
-static int xatoi (const char *cp);
+static int xatoi (char *cp);
 #endif
 
@@ -1992,87 +1429,35 @@
   switch (t)
     {
-#ifdef MOUNT_UFS
     case MOUNT_UFS:
       return _("ufs");
+    case MOUNT_NFS:
+      return _("nfs");
+#ifdef MOUNT_PC
+    case MOUNT_PC:
+      return _("pc");
+#endif
+#ifdef MOUNT_MFS
+    case MOUNT_MFS:
+      return _("mfs");
+#endif
+#ifdef MOUNT_LO
+    case MOUNT_LO:
+      return _("lofs");
+#endif
+#ifdef MOUNT_TFS
+    case MOUNT_TFS:
+      return _("tfs");
+#endif
+#ifdef MOUNT_TMP
+    case MOUNT_TMP:
+      return _("tmp");
+#endif
+#ifdef MOUNT_MSDOS
+    case MOUNT_MSDOS:
+      return _("msdos");
 #endif
 #ifdef MOUNT_ISO9660
     case MOUNT_ISO9660:
       return _("iso9660fs");
-#endif
-#ifdef MOUNT_CD9660
-    case MOUNT_CD9660:
-      return _("cd9660");
-#endif
-#ifdef MOUNT_NFS
-    case MOUNT_NFS:
-      return _("nfs");
-#endif
-#ifdef MOUNT_PC
-    case MOUNT_PC:
-      return _("pc");
-#endif
-#ifdef MOUNT_MFS
-    case MOUNT_MFS:
-      return _("mfs");
-#endif
-#ifdef MOUNT_LO
-    case MOUNT_LO:
-      return _("lofs");
-#endif
-#ifdef MOUNT_TFS
-    case MOUNT_TFS:
-      return _("tfs");
-#endif
-#ifdef MOUNT_TMP
-    case MOUNT_TMP:
-      return _("tmp");
-#endif
-#ifdef MOUNT_MSDOS
-    case MOUNT_MSDOS:
-      return _("msdos");
-#endif
-#ifdef MOUNT_LFS
-    case MOUNT_LFS:
-      return _("lfs");
-#endif
-#ifdef MOUNT_LOFS
-    case MOUNT_LOFS:
-      return _("lofs");
-#endif
-#ifdef MOUNT_FDESC
-    case MOUNT_FDESC:
-      return _("fdesc");
-#endif
-#ifdef MOUNT_PORTAL
-    case MOUNT_PORTAL:
-      return _("portal");
-#endif
-#ifdef MOUNT_NULL
-    case MOUNT_NULL:
-      return _("null");
-#endif
-#ifdef MOUNT_UMAP
-    case MOUNT_UMAP:
-      return _("umap");
-#endif
-#ifdef MOUNT_KERNFS
-    case MOUNT_KERNFS:
-      return _("kernfs");
-#endif
-#ifdef MOUNT_PROCFS
-    case MOUNT_PROCFS:
-      return _("procfs");
-#endif
-#ifdef MOUNT_DEVFS
-    case MOUNT_DEVFS:
-      return _("devfs");
-#endif
-#ifdef MOUNT_EXT2FS
-    case MOUNT_EXT2FS:
-      return _("ext2fs");
-#endif
-#ifdef MOUNT_UNION
-    case MOUNT_UNION:
-      return _("union");
 #endif
     default:
@@ -2198,5 +1583,6 @@
    Return "unknown" if its filesystem type is unknown.  */
 
-static char * filesystem_type (char * path, char * relpath, struct stat * statp)
+static char *
+filesystem_type (char * path, char * relpath, struct stat * statp)
 {
   static char *current_fstype = NULL;
@@ -2211,5 +1597,4 @@
   current_dev = statp->st_dev;
   current_fstype = filesystem_type_uncached (path, relpath, statp);
-  
   return current_fstype;
 }
@@ -2220,7 +1605,9 @@
    Return "unknown" if its filesystem type is unknown.  */
 
-void * sh_dummy_2229_type;
-
-static char * filesystem_type_uncached (char * path, char * relpath, struct stat * statp)
+static char *
+filesystem_type_uncached (path, relpath, statp)
+     char *path;
+     char *relpath;
+     struct stat *statp;
 {
   char * type = NULL;
@@ -2229,5 +1616,5 @@
 #endif
 
-#ifdef FSTYPE_MNTENT		/* 4.3BSD, SunOS, HP-UX, Dynix, Irix,Linux  */
+#ifdef FSTYPE_MNTENT		/* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
   char *table = MOUNTED;
   FILE *mfp;
@@ -2237,18 +1624,10 @@
     return NULL;
 
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_2229_type = (void *) &type;
-
   mfp = setmntent (table, "r");
   if (mfp == NULL)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
 		       _("setmntent() failed"),
 		       _("filesystem_type_uncached") );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      sh_dummy_2229_type = NULL;
       return NULL;
     }
@@ -2258,5 +1637,5 @@
   while (type == NULL && (mnt = getmntent (mfp)) != NULL)
     {
-      const char *devopt;
+      char *devopt;
       dev_t dev;
       struct stat disk_stats;
@@ -2289,23 +1668,8 @@
 	  if (stat (mnt->mnt_dir, &disk_stats) == -1)
 	    {
-	      char errmsg[256];
-	      volatile int  elevel = SH_ERR_ERR;
-	      size_t tlen = strlen(mnt->mnt_dir);
-	      
-	      if (tlen >= 6 && 0 == strcmp(&((mnt->mnt_dir)[tlen-6]), _("/.gvfs")))
-		elevel = SH_ERR_NOTICE;
-	      else if (tlen >= 5 && 0 == strcmp(&((mnt->mnt_dir)[tlen-5]), _("/gvfs")))
-		elevel = SH_ERR_NOTICE;
-	      else if (0 == strcmp (mnt->mnt_type, _("tracefs")))
-		elevel = SH_ERR_NOTICE;
-	      
-	      sl_snprintf(errmsg, sizeof(errmsg), _("stat(%s) failed"),
-			  mnt->mnt_dir);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (elevel, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-			       errmsg,
+	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
+			       _("stat() failed"),
 			       _("filesystem_type_uncached") );
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      continue;
+	      return NULL;
 	    }
 	  dev = disk_stats.st_dev;
@@ -2316,12 +1680,8 @@
 	  /* check for the "nosuid" option
 	   */
-#ifdef HAVE_HASMNTOPT
-	  if (NULL == hasmntopt(mnt, "nosuid") || (ShSuidchkNosuid == S_TRUE))
+	  if (NULL == hasmntopt(mnt, "nosuid"))
 	    type = mnt->mnt_type;
 	  else
-	    type = _("nosuid"); /* hasmntopt (nosuid) */
-#else
-	  type = mnt->mnt_type;
-#endif
+	    type = _("nosuid");
 	}
     }
@@ -2329,9 +1689,7 @@
   if (endmntent (mfp) == 0)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
 		       _("endmntent() failed"),
 		       _("filesystem_type_uncached") );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
     }
 #endif
@@ -2344,9 +1702,4 @@
     return NULL;
 
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_2229_type = (void*) &type;
-
   while (type == NULL
 	 && getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY, 0) > 0)
@@ -2364,9 +1717,4 @@
     return NULL;
 
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_2229_type = (void*) &type;
-
   if (statfs (relpath, &fss, sizeof (struct statfs), 0) == -1)
     {
@@ -2374,10 +1722,7 @@
       if (errno != ENOENT)
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
 			   _("statfs() failed"),
 			   _("filesystem_type_uncached") );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2392,9 +1737,4 @@
   if (path == NULL || relpath == NULL)
     return NULL;
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_2229_type = (void*) &type;
 
   if (statvfs (relpath, &fss) == -1)
@@ -2403,10 +1743,7 @@
       if (errno != ENOENT)
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
 			   _("statvfs() failed"),
 			   _("filesystem_type_uncached") );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2418,5 +1755,5 @@
        /* patch by Konstantin Khrooschev <nathoo@co.ru> 
 	*/
-       if( (fss.f_flag & ST_NOSUID)  && (ShSuidchkNosuid == S_FALSE))
+       if( fss.f_flag & ST_NOSUID )
          type = _("nosuid");
     }
@@ -2435,9 +1772,4 @@
     return NULL;
 
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_2229_type = (void*) &type;
-
   if (S_ISLNK (statp->st_mode))
     p = sh_dirname (relpath);
@@ -2451,10 +1783,7 @@
       if (errno != ENOENT)
 	{
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, errno, MSG_E_SUBGEN,
 			   _("statfs() failed"),
 			   _("filesystem_type_uncached") );
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  sh_dummy_2229_type = NULL;
 	  return NULL;
 	}
@@ -2476,7 +1805,7 @@
 #ifdef MNT_VISFLAGMASK
       flags = fss.f_flags & MNT_VISFLAGMASK;
-      if ((flags & MNT_NOSUID) && (ShSuidchkNosuid == S_FALSE))
+      if (flags & MNT_NOSUID)
 #else 
-      if ((fss.f_flags & MNT_NOSUID) && (ShSuidchkNosuid == S_FALSE)) 
+      if (fss.f_flags & MNT_NOSUID) 
 #endif
          type = _("nosuid");
@@ -2496,5 +1825,4 @@
   fstype_known = (int)(type != NULL);
 
-  sh_dummy_2229_type = NULL;
   return sh_util_strdup (type ? type : "unknown");
 }
@@ -2505,5 +1833,7 @@
    part of CP. */
 
-static int xatoi (const char * cp)
+static int
+xatoi (cp)
+     char *cp;
 {
   int val;
Index: trunk/src/sh_tiger0.c
===================================================================
--- trunk/src/sh_tiger0.c	(revision 591)
+++ trunk/src/sh_tiger0.c	(revision 1)
@@ -24,16 +24,10 @@
 #include "sh_error.h"
 #include "sh_utils.h"
-#include "sh_pthread.h"
-#include "sh_string.h"
-
-#define PRIV_MAX  32768
-
-#if defined(TIGER_64_BIT)
+
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
 #if defined(HAVE_LONG_64)
 typedef unsigned long int word64;
-#elif defined(HAVE_LONG_LONG_64)
+#else
 typedef unsigned long long int word64;
-#else
-#error No 64 bit type found !
 #endif
 #endif
@@ -52,27 +46,16 @@
 #define GPGFORMAT (_("%08X %08X %08X  %08X %08X %08X"))
 #else
-#error No 32 bit type found !
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#undef  SH_GNUC_ALIGN8
-#define SH_GNUC_ALIGN8   __attribute__((aligned(8)))
-#else
-#undef  SH_GNUC_ALIGN8
-#define SH_GNUC_ALIGN8
-#endif
-
+#error No 32 byte type found !
+#endif
 
 typedef unsigned char sh_byte;
-
-#define SH_KEY_NULL _("000000000000000000000000000000000000000000000000")
 
 #undef  FIL__
 #define FIL__  _("sh_tiger0.c")
 
-#if defined(TIGER_64_BIT)
-
-void tiger_t(const word64 *str, word64 length, word64 * res);
-void tiger(const word64 *str, word64 length, word64 * res);
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+/* #ifdef HAVE_LONG_64 */
+void tiger_t(word64 *str, word64 length, word64 * res);
+void tiger(word64 *str, word64 length, word64 * res);
 
 #ifdef TIGER_DBG
@@ -84,6 +67,6 @@
 #endif
 #else
-void tiger(const sh_word32 *str, sh_word32 length, sh_word32 * res);
-void tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 * res);
+void tiger(sh_word32 *str, sh_word32 length, sh_word32 * res);
+void tiger_t(sh_word32 *str, sh_word32 length, sh_word32 * res);
 
 #ifdef TIGER_DBG
@@ -110,28 +93,28 @@
  * implementation
  */
-
-/* static sh_byte buffer[PRIV_MAX + 72]; */
-
-#if defined(TIGER_64_BIT)
+SL_TICKET tiger_fd = (-1);
+
+
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+/* #ifdef HAVE_LONG_64 */
 static
-word64 * sh_tiger_hash_val (const char * filename, TigerType what, 
-			    UINT64 * Length, int timeout, word64 * res)
+word64 * sh_tiger_hash_val (char * filename, TigerType what, 
+			    unsigned long Length, int timeout)
 #else
 static
-sh_word32 * sh_tiger_hash_val (const char * filename, TigerType what, 
-			       UINT64 * Length, int timeout, sh_word32 * res)
+sh_word32 * sh_tiger_hash_val (char * filename, TigerType what, 
+			       unsigned long Length, int timeout)
 #endif
 {
   SL_TICKET  fd;
-  sh_string * content = NULL;
-  int  i, j, tt;
+  int  i, j;
   int  count = 0;
   int  blk;
   char    * tmp;
   sh_byte * bptr;
-  sh_byte   SH_GNUC_ALIGN8 bbuf[64];
-  UINT64    bcount = 0;
-
-  sh_byte * buffer = SH_ALLOC(PRIV_MAX + 72);
+  sh_byte buffer[PRIV_MAX + 72];
+  sh_byte bbuf[64];
+
+  unsigned long pages_read;
   uid_t   euid;
 
@@ -140,5 +123,4 @@
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-  unsigned long pages_read;
   /*@-nestedextern@*/
   extern long IO_Limit;
@@ -146,13 +128,14 @@
 #endif
 
-#if defined(TIGER_64_BIT)
-#define TIGER_CAST (const word64*)
-  /* word64 res[3]; */
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+  /* #ifdef HAVE_LONG_64 */
+#define TIGER_CAST (word64*)
+  static word64 res[3];
   res[0]= (word64) 0x0123456789ABCDEFLL;
   res[1]= (word64) 0xFEDCBA9876543210LL;
   res[2]= (word64) 0xF096A5B4C3B2E187LL;
 #else
-#define TIGER_CAST (const sh_word32*)
-  /* sh_word32 res[6]; */
+#define TIGER_CAST (sh_word32*)
+  static sh_word32 res[6];
   res[0]= (sh_word32) 0x89ABCDEF;
   res[1]= (sh_word32) 0x01234567;
@@ -165,22 +148,21 @@
   SL_ENTER(_("sh_tiger_hash_val"));
 
-  if (what >= TIGER_FILE) 
-    {
-      if (what > TIGER_FILE)
+  if (what == TIGER_FILE || what == TIGER_FD) 
+    {
+      if (what == TIGER_FILE)
 	{
-	  fd      = what;
-	  content = sl_get_content(fd);
-	  TPT((0,FIL__, __LINE__, _("msg=<TIGER_FD>, fd=<%ld>\n"), fd));
+	  TPT((0,FIL__, __LINE__, _("msg=<TIGER_FILE>, path=<%s>\n"),
+	       (filename == NULL ? _("(null)") : filename) ));
+	  fd = sl_open_read (filename, SL_YESPRIV);
 	}
       else
 	{
-	  TPT((0,FIL__, __LINE__, _("msg=<TIGER_FILE>, path=<%s>\n"),
-	       (filename == NULL ? _("(null)") : filename) ));
-	  fd = sl_open_read (FIL__, __LINE__, filename, SL_YESPRIV);
+	  fd = tiger_fd;
+	  TPT((0,FIL__, __LINE__, _("msg=<TIGER_FD>, fd=<%ld>\n"), tiger_fd));
 	}
 
       if (SL_ISERROR (fd)) 
 	{
-	  TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), fd));
+	  TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), tiger_fd));
 	  tmp = sh_util_safe_name (filename);
 	  (void) sl_get_euid(&euid);
@@ -188,28 +170,16 @@
 			   MSG_E_ACCESS, (long) euid, tmp);
 	  SH_FREE(tmp);
-	  SH_FREE(buffer);
-	  *Length = 0;
 	  SL_RETURN( NULL, _("sh_tiger_hash_val"));
 	}
-
+      
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-    if (skey->mlock_failed == S_FALSE) 
+    if (skey->mlock_failed == SL_FALSE) 
       {
-        if ( (-1) == sh_unix_mlock(FIL__, __LINE__, 
-				   (char *)buffer, 
-				   (PRIV_MAX)*sizeof(sh_byte))) 
-	  {
-	    SH_MUTEX_LOCK_UNSAFE(mutex_skey);  
-	    skey->mlock_failed = S_TRUE;
-	    SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-	  }
+        if ( (-1) == sh_unix_mlock((char *)buffer,(PRIV_MAX)*sizeof(sh_byte))) 
+          skey->mlock_failed = SL_TRUE;
       }
 #else
-    if (skey->mlock_failed == S_FALSE)
-      {
-	SH_MUTEX_LOCK_UNSAFE(mutex_skey);  
-	skey->mlock_failed = S_TRUE;
-	SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-      }
+    if (skey->mlock_failed == SL_FALSE)
+      skey->mlock_failed = SL_TRUE;
 #endif
 
@@ -218,27 +188,18 @@
 #endif
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
     pages_read = 0;
-#endif
-
-    while (1) 
+
+    while (1 == 1) 
       {
 	if (timeout > 0)
-	  count = sl_read_timeout (fd, buffer, PRIV_MAX, timeout, S_TRUE);
+	  count = sl_read_timeout (fd, buffer, PRIV_MAX, timeout);
 	else
 	  count = sl_read         (fd, buffer, PRIV_MAX);
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
 	++pages_read;
-#endif
 
 	if (SL_ISERROR (count)) 
 	  {
-	    int error = errno;
-
 	    if (sig_termfast == 1) {
-	      sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-	      SH_FREE(buffer);
-	      *Length = 0;
 	      SL_RETURN( NULL, _("sh_tiger_hash_val"));
 	    }
@@ -253,36 +214,12 @@
 	      }
 	    else
-	      {
-		char errbuf[SH_ERRBUF_SIZE];
-		char errbuf2[SH_ERRBUF_SIZE];
-		sl_strlcpy(errbuf, sl_error_string(count), sizeof(errbuf));
-		sh_error_message(error, errbuf2, sizeof(errbuf2));
-		sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, 
-				 count, MSG_E_READ, errbuf, errbuf2, tmp);
-	      }
+	      sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, 
+			       count, MSG_E_READ, tmp);
 	    SH_FREE(tmp);
-	    memset (bbuf,   0, 64);
-	    memset (buffer, 0, PRIV_MAX);
-
-	    sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-	    SH_FREE(buffer);
-	    *Length = 0;
+	    (void) sh_unix_munlock((char*)buffer, (PRIV_MAX)*sizeof(sh_byte));
 	    SL_RETURN( NULL, _("sh_tiger_hash_val"));
 	  }
 
-	if (content)
-	  sh_string_cat_lchar(content, (char*)buffer, count);
-
-	bcount += count;
-
-	if (*Length != TIGER_NOLIM)
-	  {
-	    if (bcount > *Length)
-	      {
-		count   = count - (bcount - (*Length));
-		bcount  = *Length;
-		count = (count < 0) ? 0 : count;
-	      }
-	  }
+	/* TPT((0, FIL__, __LINE__ , _("msg=<Read %ld bytes>\n"), count)); */
 
 	blk      = (count / 64); /* number of 64-byte words */
@@ -291,18 +228,14 @@
 	 * count cannot be negative here, see 'if (SL_ISERROR (count))'
 	 */
-	tt = blk*64;
-
-	ncount = (unsigned long) (count - tt);
-
-	nblocks += blk;
-	/* MAY_LOCK */
-	sh.statistics.bytes_hashed += tt;
+	ncount = (unsigned long) (count - ((count/64)*64));
 	
-	tt = 0;
+	bptr = buffer;
 	for (i = 0; i < blk; ++i)
 	  {
-	    bptr = &buffer[tt]; tt += 64;
+	    bptr = &buffer[64 * i];
 	    
 	    tiger_t(TIGER_CAST bptr, 64, res);
+	    ++nblocks;
+	    sh.statistics.bytes_hashed += 64;
 	    
 #ifdef TIGER_DBG
@@ -311,5 +244,5 @@
 	  }
 	
-	if (blk < (PRIV_MAX / 64)) /* this must be (PRIV_MAX / 64) */
+	if (blk < 64) /* this must be (PRIV_MAX / 64) */
 	  break;
 
@@ -319,7 +252,6 @@
 	    memset (bbuf,   0, 64);
 	    memset (buffer, 0, PRIV_MAX);
-	    sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-	    SH_FREE(buffer);
-	    *Length = 0;
+	    (void) sh_unix_munlock( (char *) buffer, 
+				    (PRIV_MAX) * sizeof(sh_byte));
 	    SL_RETURN( NULL, _("sh_tiger_hash_val"));
 	  }
@@ -336,12 +268,6 @@
     /* copy incomplete block
      */
-    j = 0; 
-    for (i = 0; i < 64; i += 4) 
-      {
-	bbuf[i]   = (sh_byte) '\0';
-	bbuf[i+1] = (sh_byte) '\0';
-	bbuf[i+2] = (sh_byte) '\0';
-	bbuf[i+3] = (sh_byte) '\0';
-      }
+    j = 0; for (i = 0; i < 64; ++i) 
+      bbuf[i] = (sh_byte) '\0';
     for (i = (count/64) * 64; i < count; ++i)
       /*@-usedef@*/bbuf[j++] = buffer[i];/*@+usedef@*/
@@ -376,10 +302,6 @@
 	  bbuf[j++] = (sh_byte) 0;
 	tiger_t(TIGER_CAST bbuf, 64, res);
-	/* MAY_LOCK */
 	sh.statistics.bytes_hashed += 64;
-	++nblocks; 
-#ifdef TIGER_DBG
-	ncount = 0;
-#endif
+	++nblocks; ncount = 0;
         memset(bbuf, 0, 56 ); 
       }
@@ -405,12 +327,15 @@
 #endif
 
-    memset (bbuf,   0, sizeof(bbuf));
-    memset (buffer, 0, sizeof(buffer));
+    memset (bbuf,   0, 64);
+    memset (buffer, 0, PRIV_MAX);
+
+    (void) sh_unix_munlock( (char *) buffer, (PRIV_MAX) * sizeof(sh_byte));
 
     if (what == TIGER_FILE)
       (void) sl_close (fd);
-    sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-    SH_FREE(buffer);
-    *Length = bcount;
+    else
+      tiger_fd = (-1);
+
+
     SL_RETURN( res, _("sh_tiger_hash_val"));
   }
@@ -418,12 +343,8 @@
   if (what == TIGER_DATA && filename != NULL) 
     {
-      tiger(TIGER_CAST filename, (sh_word32) *Length, res);
-      sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-      SH_FREE(buffer);
+      /* TPT((0, FIL__, __LINE__, _("msg=<TIGER_DATA>\n"))); */
+      tiger(TIGER_CAST filename,  (sh_word32) Length, res); 
       SL_RETURN(res, _("sh_tiger_hash_val"));
     }
-  sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
-  SH_FREE(buffer);
-  *Length = 0;
   SL_RETURN( NULL, _("sh_tiger_hash_val"));
 }
@@ -434,449 +355,302 @@
 #ifdef USE_MD5
 /*@-type@*/
-/* md5.c - Functions to compute MD5 message digest of files or memory blocks
- *         according to the definition of MD5 in RFC 1321 from April 1992.
- * Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/************************************************************************
  *
- * NOTE: The canonical source of this file is maintained with the GNU C
- * Library.  Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+ *  md5.h - Declaration of functions and data types used for MD5 sum
+ *  computing library functions. 
  *
- * 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.  */
-
+ ************************************************************************/
+
+/* Written Bob Deblier <bob@virtualunlimited.com>         */
 /* Hacked to work with samhain by R. Wichmann             */
-
-typedef UINT32 md5_uint32;
+/* Need for 64bit type removed, fix for Mac OS X compiler */
+
+typedef sh_word32     uint32;
+typedef unsigned char uint8;
+
+
+
 
 
 /* Structure to save state of computation between the single steps.  */
-typedef struct md5_ctx
-{
-  md5_uint32 A;
-  md5_uint32 B;
-  md5_uint32 C;
-  md5_uint32 D;
-
-  md5_uint32 total[2];
-  md5_uint32 buflen;
-  char buffer[128];
+typedef struct
+{
+        uint32 h[4];
+        uint32 data[16];
+        uint8  offset;
+        uint32  nblocks;
+        int  count;
 } md5Param;
 
-/*
- * The following three functions are build up the low level used in
- * the functions `md5_stream' and `md5_buffer'.
- */
-
-/* Initialize structure containing state of computation.
-   (RFC 1321, 3.3: Step 3)  */
-static void md5_init_ctx (struct md5_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
-   initialization function update the context for the next LEN bytes
-   starting at BUFFER.
-   It is necessary that LEN is a multiple of 64!!! */
-static void md5_process_block (const void *buffer, size_t len,
-				    struct md5_ctx *ctx);
-
-/* Starting with the result of former calls of this function (or the
-   initialization function update the context for the next LEN bytes
-   starting at BUFFER.
-   It is NOT required that LEN is a multiple of 64.  */
-static void md5_process_bytes (const void *buffer, size_t len,
-				    struct md5_ctx *ctx);
-
-/* Process the remaining bytes in the buffer and put result from CTX
-   in first 16 bytes following RESBUF.  The result is always in little
-   endian byte order, so that a byte-wise output yields to the wanted
-   ASCII representation of the message digest.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-static void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf);
-
-
-/* Put result from CTX in first 16 bytes following RESBUF.  The result is
-   always in little endian byte order, so that a byte-wise output yields
-   to the wanted ASCII representation of the message digest.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-static void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf);
-
-#if WORDS_BIGENDIAN
-static md5_uint32 swapu32(md5_uint32 n)
-{
-  return (    ((n & 0xffU) << 24) |
-	      ((n & 0xff00U) << 8) |
-	      ((n & 0xff0000U) >> 8) |
-	      ((n & 0xff000000U) >> 24) );
-}
-#define SWAP(n) swapu32(n)
-#else
-#define SWAP(n) (n)
-#endif
-
-/* This array contains the bytes used to pad the buffer to the next
-   64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
-static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */  };
-
-/* Initialize structure containing state of computation.
-   (RFC 1321, 3.3: Step 3)  */
-static void md5_init_ctx(struct md5_ctx *ctx)
-{
-  ctx->A = 0x67452301;
-  ctx->B = 0xefcdab89;
-  ctx->C = 0x98badcfe;
-  ctx->D = 0x10325476;
-
-  ctx->total[0] = ctx->total[1] = 0;
-  ctx->buflen = 0;
-}
-
-/* Put result from CTX in first 16 bytes following RESBUF.  The result
-   must be in little endian byte order.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-static void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf)
-{
-  ((md5_uint32 *) resbuf)[0] = SWAP(ctx->A);
-  ((md5_uint32 *) resbuf)[1] = SWAP(ctx->B);
-  ((md5_uint32 *) resbuf)[2] = SWAP(ctx->C);
-  ((md5_uint32 *) resbuf)[3] = SWAP(ctx->D);
-
-  return resbuf;
-}
-
-/* Process the remaining bytes in the internal buffer and the usual
-   prolog according to the standard and write the result to RESBUF.
-
-   IMPORTANT: On some systems it is required that RESBUF is correctly
-   aligned for a 32 bits value.  */
-static void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf)
-{
-  /* Take yet unprocessed bytes into account.  */
-  md5_uint32 bytes = ctx->buflen;
-  size_t pad;
-  md5_uint32 temp;
-
-  /* Now count remaining bytes.  */
-  ctx->total[0] += bytes;
-  if (ctx->total[0] < bytes)
-    ++ctx->total[1];
-
-  pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
-  memcpy(&ctx->buffer[bytes], fillbuf, pad);
-
-  /* Put the 64-bit file length in *bits* at the end of the buffer.  */
-  temp = SWAP(ctx->total[0] << 3);
-  memcpy(&(ctx->buffer[bytes + pad]), &temp, sizeof(temp));
-  temp = SWAP((ctx->total[1] << 3) | (ctx->total[0] >> 29));
-  memcpy(&(ctx->buffer[bytes + pad + 4]), &temp, sizeof(temp));
-
-  /* Process last bytes.  */
-  md5_process_block(ctx->buffer, bytes + pad + 8, ctx);
-
-  return md5_read_ctx(ctx, resbuf);
-}
-
-/* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
-   result is always in little endian byte order, so that a byte-wise
-   output yields to the wanted ASCII representation of the message
-   digest.  */
-void *md5_buffer(const char *buffer, size_t len, void *resblock)
-{
-  struct md5_ctx ctx;
-
-  /* Initialize the computation context.  */
-  md5_init_ctx(&ctx);
-
-  /* Process whole buffer but last len % 64 bytes.  */
-  md5_process_bytes(buffer, len, &ctx);
-
-  /* Put result in desired memory area.  */
-  return md5_finish_ctx(&ctx, resblock);
-}
-
-static void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx)
-{
-  /* When we already have some bits in our internal buffer concatenate
-     both inputs first.  */
-  if (ctx->buflen != 0) {
-    size_t left_over = ctx->buflen;
-    size_t add = 128 - left_over > len ? len : 128 - left_over;
-
-    memcpy(&ctx->buffer[left_over], buffer, add);
-    ctx->buflen += add;
-
-    if (left_over + add > 64) {
-      md5_process_block(ctx->buffer, (left_over + add) & ~63, ctx);
-      /* The regions in the following copy operation cannot overlap.  */
-      memcpy(ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
-	     (left_over + add) & 63);
-      ctx->buflen = (left_over + add) & 63;
-    }
-
-    buffer = (const char *) buffer + add;
-    len -= add;
-  }
-
-  /* Process available complete blocks.  */
-  if (len > 64) {
-    md5_process_block(buffer, len & ~63, ctx);
-    buffer = (const char *) buffer + (len & ~63);
-    len &= 63;
-  }
-
-  /* Move remaining bytes in internal buffer.  */
-  if (len > 0) {
-    memcpy(ctx->buffer, buffer, len);
-    ctx->buflen = len;
-  }
-}
-
-/* These are the four functions used in the four steps of the MD5 algorithm
-   and defined in the RFC 1321.  The first function is a little bit optimized
-   (as found in Colin Plumbs public domain implementation).  */
-/* #define FF(b, c, d) ((b & c) | (~b & d)) */
-#define FF(b, c, d) (d ^ (b & (c ^ d)))
-#define FG(b, c, d) FF (d, b, c)
-#define FH(b, c, d) (b ^ c ^ d)
-#define FI(b, c, d) (c ^ (b | ~d))
-
-/* Process LEN bytes of BUFFER, accumulating context into CTX.
-   It is assumed that LEN % 64 == 0.  */
-static void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx)
-{
-  md5_uint32 correct_words[16];
-  const md5_uint32 *words = buffer;
-  size_t nwords = len / sizeof(md5_uint32);
-  const md5_uint32 *endp = words + nwords;
-  md5_uint32 A = ctx->A;
-  md5_uint32 B = ctx->B;
-  md5_uint32 C = ctx->C;
-  md5_uint32 D = ctx->D;
-
-  /* First increment the byte count.  RFC 1321 specifies the possible
-     length of the file up to 2^64 bits.  Here we only compute the
-     number of bytes.  Do a double word increment.  */
-  ctx->total[0] += len;
-  if (ctx->total[0] < len)
-    ++ctx->total[1];
-
-  /* Process all bytes in the buffer with 64 bytes in each round of
-     the loop.  */
-  while (words < endp) {
-    md5_uint32 *cwp = correct_words;
-    md5_uint32 A_save = A;
-    md5_uint32 B_save = B;
-    md5_uint32 C_save = C;
-    md5_uint32 D_save = D;
-
-    /* First round: using the given function, the context and a constant
-       the next context is computed.  Because the algorithms processing
-       unit is a 32-bit word and it is determined to work on words in
-       little endian byte order we perhaps have to change the byte order
-       before the computation.  To reduce the work for the next steps
-       we store the swapped words in the array CORRECT_WORDS.  */
-
-#define OP(a, b, c, d, s, T)						\
-      do								\
-        {								\
-	  a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T;		\
-	  ++words;							\
-	  CYCLIC (a, s);						\
-	  a += b;							\
-        }								\
-      while (0)
-
-    /* It is unfortunate that C does not provide an operator for
-       cyclic rotation.  Hope the C compiler is smart enough.  */
-#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
-
-    /* Before we start, one word to the strange constants.
-       They are defined in RFC 1321 as
-
-       T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
-    */
-
-    /* Round 1.  */
-    OP(A, B, C, D, 7, 0xd76aa478);
-    OP(D, A, B, C, 12, 0xe8c7b756);
-    OP(C, D, A, B, 17, 0x242070db);
-    OP(B, C, D, A, 22, 0xc1bdceee);
-    OP(A, B, C, D, 7, 0xf57c0faf);
-    OP(D, A, B, C, 12, 0x4787c62a);
-    OP(C, D, A, B, 17, 0xa8304613);
-    OP(B, C, D, A, 22, 0xfd469501);
-    OP(A, B, C, D, 7, 0x698098d8);
-    OP(D, A, B, C, 12, 0x8b44f7af);
-    OP(C, D, A, B, 17, 0xffff5bb1);
-    OP(B, C, D, A, 22, 0x895cd7be);
-    OP(A, B, C, D, 7, 0x6b901122);
-    OP(D, A, B, C, 12, 0xfd987193);
-    OP(C, D, A, B, 17, 0xa679438e);
-    OP(B, C, D, A, 22, 0x49b40821);
-    /* For the second to fourth round we have the possibly swapped words
-       in CORRECT_WORDS.  Redefine the macro to take an additional first
-       argument specifying the function to use.  */
-#undef OP
-#define OP(f, a, b, c, d, k, s, T)					\
-      do 								\
-	{								\
-	  a += f (b, c, d) + correct_words[k] + T;			\
-	  CYCLIC (a, s);						\
-	  a += b;							\
-	}								\
-      while (0)
-
-    /* Round 2.  */
-    OP(FG, A, B, C, D, 1, 5, 0xf61e2562);
-    OP(FG, D, A, B, C, 6, 9, 0xc040b340);
-    OP(FG, C, D, A, B, 11, 14, 0x265e5a51);
-    OP(FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
-    OP(FG, A, B, C, D, 5, 5, 0xd62f105d);
-    OP(FG, D, A, B, C, 10, 9, 0x02441453);
-    OP(FG, C, D, A, B, 15, 14, 0xd8a1e681);
-    OP(FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
-    OP(FG, A, B, C, D, 9, 5, 0x21e1cde6);
-    OP(FG, D, A, B, C, 14, 9, 0xc33707d6);
-    OP(FG, C, D, A, B, 3, 14, 0xf4d50d87);
-    OP(FG, B, C, D, A, 8, 20, 0x455a14ed);
-    OP(FG, A, B, C, D, 13, 5, 0xa9e3e905);
-    OP(FG, D, A, B, C, 2, 9, 0xfcefa3f8);
-    OP(FG, C, D, A, B, 7, 14, 0x676f02d9);
-    OP(FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
-
-    /* Round 3.  */
-    OP(FH, A, B, C, D, 5, 4, 0xfffa3942);
-    OP(FH, D, A, B, C, 8, 11, 0x8771f681);
-    OP(FH, C, D, A, B, 11, 16, 0x6d9d6122);
-    OP(FH, B, C, D, A, 14, 23, 0xfde5380c);
-    OP(FH, A, B, C, D, 1, 4, 0xa4beea44);
-    OP(FH, D, A, B, C, 4, 11, 0x4bdecfa9);
-    OP(FH, C, D, A, B, 7, 16, 0xf6bb4b60);
-    OP(FH, B, C, D, A, 10, 23, 0xbebfbc70);
-    OP(FH, A, B, C, D, 13, 4, 0x289b7ec6);
-    OP(FH, D, A, B, C, 0, 11, 0xeaa127fa);
-    OP(FH, C, D, A, B, 3, 16, 0xd4ef3085);
-    OP(FH, B, C, D, A, 6, 23, 0x04881d05);
-    OP(FH, A, B, C, D, 9, 4, 0xd9d4d039);
-    OP(FH, D, A, B, C, 12, 11, 0xe6db99e5);
-    OP(FH, C, D, A, B, 15, 16, 0x1fa27cf8);
-    OP(FH, B, C, D, A, 2, 23, 0xc4ac5665);
-
-    /* Round 4.  */
-    OP(FI, A, B, C, D, 0, 6, 0xf4292244);
-    OP(FI, D, A, B, C, 7, 10, 0x432aff97);
-    OP(FI, C, D, A, B, 14, 15, 0xab9423a7);
-    OP(FI, B, C, D, A, 5, 21, 0xfc93a039);
-    OP(FI, A, B, C, D, 12, 6, 0x655b59c3);
-    OP(FI, D, A, B, C, 3, 10, 0x8f0ccc92);
-    OP(FI, C, D, A, B, 10, 15, 0xffeff47d);
-    OP(FI, B, C, D, A, 1, 21, 0x85845dd1);
-    OP(FI, A, B, C, D, 8, 6, 0x6fa87e4f);
-    OP(FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
-    OP(FI, C, D, A, B, 6, 15, 0xa3014314);
-    OP(FI, B, C, D, A, 13, 21, 0x4e0811a1);
-    OP(FI, A, B, C, D, 4, 6, 0xf7537e82);
-    OP(FI, D, A, B, C, 11, 10, 0xbd3af235);
-    OP(FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
-    OP(FI, B, C, D, A, 9, 21, 0xeb86d391);
-
-    /* Add the starting values of the context.  */
-    A += A_save;
-    B += B_save;
-    C += C_save;
-    D += D_save;
-  }
-
-  /* Put checksum in context given as argument.  */
-  ctx->A = A;
-  ctx->B = B;
-  ctx->C = C;
-  ctx->D = D;
-}
-
-
-/*----------------------------------------------------------------------------
- *--------end of md5.c
- *----------------------------------------------------------------------------*/
+static uint32 md5hinit[4] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 };
 
  
 int md5Reset(register md5Param* p)
 {
-        unsigned int i;
-
-        md5_init_ctx(p);
-	
-        for (i = 0; i < 16; i += 8)
-	  {
-	    p->buffer[i]   = 0x00;
-	    p->buffer[i+1] = 0x00;
-	    p->buffer[i+2] = 0x00;
-	    p->buffer[i+3] = 0x00;
-	    p->buffer[i+4] = 0x00;
-	    p->buffer[i+5] = 0x00;
-	    p->buffer[i+6] = 0x00;
-	    p->buffer[i+7] = 0x00;
-	  }
-	
+        memcpy(p->h, md5hinit, 16);
+        memset(p->data, 0x00, 64);
+        p->offset = (uint8) 0;
+	p->nblocks = 0;
         return 0;
 }
 
+#if defined(__GNUC__) && defined(__i386__)
+static inline UINT32
+ROTL32( UINT32 x, int s)
+{
+        __asm__("roll %%cl,%0"
+                :"=r" (x)
+                :"0" (x),"c" (s));
+        return x;
+}
+#else
+#define ROTL32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
+#endif
+
+
+#define FF(a, b, c, d, w, s, t) \
+        a += ((b&(c^d))^d) + w + t;     \
+        a = ROTL32(a, s);       \
+        a += b;
+
+#define GG(a, b, c, d, w, s, t) \
+        a += ((d&(b^c))^c) + w + t;     \
+        a = ROTL32(a, s);       \
+        a += b;
+
+#define HH(a, b, c, d, w, s, t) \
+        a += (b^c^d) + w + t;   \
+        a = ROTL32(a, s);       \
+        a += b;
+
+#define II(a, b, c, d, w, s, t) \
+        a += (c^(b|~d)) + w + t;        \
+        a = ROTL32(a, s);       \
+        a += b;
+
+#if WORDS_BIGENDIAN
+uint32 swapu32(uint32 n)
+{
+        return (    ((n & 0xffU) << 24) |
+                                ((n & 0xff00U) << 8) |
+                                ((n & 0xff0000U) >> 8) |
+                                ((n & 0xff000000U) >> 24) );
+}
+#endif
+
+static
+void md5Process(md5Param* p)
+{
+        register uint32 a,b,c,d;
+        register uint32* w;
+        #if WORDS_BIGENDIAN
+        register sh_byte t;
+        #endif
+
+        w = p->data;
+        #if WORDS_BIGENDIAN
+        t = 16;
+        while (t--)
+        {
+                register uint32 temp = swapu32(*w);
+                *(w++) = temp;
+        }
+        w = p->data;
+        #endif
+
+        a = p->h[0]; b = p->h[1]; c = p->h[2]; d = p->h[3];
+
+        FF(a, b, c, d, (*w++),  7, 0xd76aa478);
+        FF(d, a, b, c, (*w++), 12, 0xe8c7b756);
+        FF(c, d, a, b, (*w++), 17, 0x242070db);
+        FF(b, c, d, a, (*w++), 22, 0xc1bdceee);
+        FF(a, b, c, d, (*w++),  7, 0xf57c0faf);
+        FF(d, a, b, c, (*w++), 12, 0x4787c62a);
+        FF(c, d, a, b, (*w++), 17, 0xa8304613);
+        FF(b, c, d, a, (*w++), 22, 0xfd469501);
+        FF(a, b, c, d, (*w++),  7, 0x698098d8);
+        FF(d, a, b, c, (*w++), 12, 0x8b44f7af);
+        FF(c, d, a, b, (*w++), 17, 0xffff5bb1);
+        FF(b, c, d, a, (*w++), 22, 0x895cd7be);
+        FF(a, b, c, d, (*w++),  7, 0x6b901122);
+        FF(d, a, b, c, (*w++), 12, 0xfd987193);
+        FF(c, d, a, b, (*w++), 17, 0xa679438e);
+        FF(b, c, d, a, (*w++), 22, 0x49b40821);
+
+	w = p->data;
+
+        GG(a, b, c, d, w[ 1],  5, 0xf61e2562);
+        GG(d, a, b, c, w[ 6],  9, 0xc040b340);
+        GG(c, d, a, b, w[11], 14, 0x265e5a51);
+        GG(b, c, d, a, w[ 0], 20, 0xe9b6c7aa);
+        GG(a, b, c, d, w[ 5],  5, 0xd62f105d);
+        GG(d, a, b, c, w[10],  9, 0x02441453);
+        GG(c, d, a, b, w[15], 14, 0xd8a1e681);
+        GG(b, c, d, a, w[ 4], 20, 0xe7d3fbc8);
+        GG(a, b, c, d, w[ 9],  5, 0x21e1cde6);
+        GG(d, a, b, c, w[14],  9, 0xc33707d6);
+        GG(c, d, a, b, w[ 3], 14, 0xf4d50d87);
+        GG(b, c, d, a, w[ 8], 20, 0x455a14ed);
+        GG(a, b, c, d, w[13],  5, 0xa9e3e905);
+        GG(d, a, b, c, w[ 2],  9, 0xfcefa3f8);
+        GG(c, d, a, b, w[ 7], 14, 0x676f02d9);
+        GG(b, c, d, a, w[12], 20, 0x8d2a4c8a);
+
+        HH(a, b, c, d, w[ 5],  4, 0xfffa3942);
+        HH(d, a, b, c, w[ 8], 11, 0x8771f681);
+        HH(c, d, a, b, w[11], 16, 0x6d9d6122);
+        HH(b, c, d, a, w[14], 23, 0xfde5380c);
+        HH(a, b, c, d, w[ 1],  4, 0xa4beea44);
+        HH(d, a, b, c, w[ 4], 11, 0x4bdecfa9);
+        HH(c, d, a, b, w[ 7], 16, 0xf6bb4b60);
+        HH(b, c, d, a, w[10], 23, 0xbebfbc70);
+        HH(a, b, c, d, w[13],  4, 0x289b7ec6);
+        HH(d, a, b, c, w[ 0], 11, 0xeaa127fa);
+        HH(c, d, a, b, w[ 3], 16, 0xd4ef3085);
+        HH(b, c, d, a, w[ 6], 23, 0x04881d05);
+        HH(a, b, c, d, w[ 9],  4, 0xd9d4d039);
+        HH(d, a, b, c, w[12], 11, 0xe6db99e5);
+        HH(c, d, a, b, w[15], 16, 0x1fa27cf8);
+        HH(b, c, d, a, w[ 2], 23, 0xc4ac5665);
+
+        II(a, b, c, d, w[ 0],  6, 0xf4292244);
+        II(d, a, b, c, w[ 7], 10, 0x432aff97);
+        II(c, d, a, b, w[14], 15, 0xab9423a7);
+        II(b, c, d, a, w[ 5], 21, 0xfc93a039);
+        II(a, b, c, d, w[12],  6, 0x655b59c3);
+        II(d, a, b, c, w[ 3], 10, 0x8f0ccc92);
+        II(c, d, a, b, w[10], 15, 0xffeff47d);
+        II(b, c, d, a, w[ 1], 21, 0x85845dd1);
+        II(a, b, c, d, w[ 8],  6, 0x6fa87e4f);
+        II(d, a, b, c, w[15], 10, 0xfe2ce6e0);
+        II(c, d, a, b, w[ 6], 15, 0xa3014314);
+        II(b, c, d, a, w[13], 21, 0x4e0811a1);
+        II(a, b, c, d, w[ 4],  6, 0xf7537e82);
+        II(d, a, b, c, w[11], 10, 0xbd3af235);
+        II(c, d, a, b, w[ 2], 15, 0x2ad7d2bb);
+        II(b, c, d, a, w[ 9], 21, 0xeb86d391);
+
+        p->h[0] += a;
+        p->h[1] += b;
+        p->h[2] += c;
+        p->h[3] += d;
+}
+
 int md5Update(md5Param* p, const sh_byte* data, int size)
 {
-  md5_process_bytes(data, size, p);
-  return 0;
-}
-
-static void md5Finish(md5Param* p, void *resblock)
-{
-  (void) md5_finish_ctx(p, resblock);
-}
-
-int md5Digest(md5Param* p, md5_uint32* data)
-{
-        md5Finish(p, data);
+        register int proclength;
+
+        while (size > 0)
+        {
+	  proclength = (((int)p->offset + size) > 64) ? 
+	    (64 - (int)p->offset) : size;
+	  memcpy(((sh_byte *) p->data) + p->offset, data, (size_t) proclength);
+	  size -= proclength;
+	  data += proclength;
+	  p->offset += proclength;
+	  
+	  if (p->offset == (uint8) 64)
+	    {
+	      md5Process(p);
+	      p->offset = (uint8) 0;
+	      p->nblocks++;
+	    }
+        }
+        return 0;
+}
+
+static void md5Finish(md5Param* p)
+{
+        uint32 t, msb, lsb;
+	uint8 * pp;
+        register uint8 *ptr;
+
+        msb = 0;
+	t = p->nblocks;
+	if( (lsb = t << 6) < t ) /* multiply by 64 to make a byte count */
+	  msb++;
+	msb += t >> 26;
+	t = lsb;
+	if( (lsb = t + (uint32)p->offset) < t ) /* add the count */
+	  msb++;
+	t = lsb;
+	if( (lsb = t << 3) < t ) /* multiply by 8 to make a bit count */
+	  msb++;
+	msb += t >> 29;
+
+	ptr = ((uint8 *) p->data) + p->offset++;
+
+ 
+        *(ptr++) = (uint8) 0x80;
+
+        if (p->offset > (uint8)56)
+        {
+                while (p->offset++ < 64)
+                        *(ptr++) = 0;
+
+                md5Process(p);
+                p->offset = 0;
+        }
+
+        ptr = ((uint8 *) p->data) + p->offset;
+        while (p->offset++ < 56)
+                *(ptr++) = 0;
+
+	/* append the 64 bit count */
+	*(ptr++) = lsb	   ;
+	*(ptr++) = lsb >>  8;
+	*(ptr++) = lsb >> 16;
+	*(ptr++) = lsb >> 24;
+	*(ptr++) = msb	   ;
+	*(ptr++) = msb >>  8;
+	*(ptr++) = msb >> 16;
+	*(ptr++) = msb >> 24;
+
+        md5Process(p);
+
+	pp = (uint8 *) p->data;
+#ifdef WORDS_BIGENDIAN
+#define X(a) do { *pp++ = (*p).a; *pp++ = (*p).a >> 8;      \
+		  *pp++ = (*p).a >> 16; *pp++ = (*p).a >> 24; } while(0)
+#else /* little endian */
+    /*#define X(a) do { *(uint32*)p = p->##a ; p += 4; } while(0)*/
+    /* Unixware's cpp doesn't like the above construct so we do it his way:
+     * (reported by Allan Clark) */
+#define X(a) do { *(uint32*)pp = (*p).a ; pp += 4; } while(0)
+#endif
+	X(h[0]);
+	X(h[1]);
+	X(h[2]);
+	X(h[3]);
+#undef X
+
+        p->offset = 0;
+}
+
+int md5Digest(md5Param* p, uint32* data)
+{
+        md5Finish(p);
+        memcpy(data, p->h, 16);
         (void) md5Reset(p);
         return 0;
 }
 /*@+type@*/
-
 
 /* Compute MD5 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 16 bytes
    beginning at RESBLOCK.  */
-static int md5_stream(char * filename, void *resblock, 
-		      UINT64 * Length, int timeout, SL_TICKET fd)
+static int md5_stream(char * filename, void *resblock, int timeout)
 {
   /* Important: BLOCKSIZE must be a multiple of 64.  */
   static const int BLOCKSIZE = 8192;
-  struct md5_ctx ctx;
-  char * buffer = SH_ALLOC(8264); /* BLOCKSIZE + 72  AIX compiler chokes */
-  size_t sum;
-
+  md5Param ctx;
+  char buffer[8264]; /* BLOCKSIZE + 72  AIX compiler chokes */
+  off_t sum = 0;
+  SL_TICKET  fd;
   char * tmp;
   uid_t   euid;
-  UINT64  bcount = 0;
-  sh_string * content;
-
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
+
   unsigned long pages_read;
-
+#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
   /*@-nestedextern@*/
   extern long IO_Limit;
@@ -887,7 +661,9 @@
   (void) md5Reset (&ctx);
 
+  fd = tiger_fd;
+
   if (SL_ISERROR (fd))
     {
-      TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), fd));
+      TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), tiger_fd));
       tmp = sh_util_safe_name (filename);
       (void) sl_get_euid(&euid);
@@ -895,17 +671,11 @@
 		       MSG_E_ACCESS, (long) euid, tmp);
       SH_FREE(tmp);
-      *Length = 0;
-      SH_FREE(buffer);
       return -1;
     }
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
   pages_read = 0;
-#endif
-  
-  content = sl_get_content(fd);
 
   /* Iterate over full file contents.  */
-  while (1) {
+  while (1 == 1) {
     /* We read the file in blocks of BLOCKSIZE bytes.  One call of the
        computation function processes the whole buffer so that with the
@@ -918,15 +688,10 @@
 
       n = (off_t) sl_read_timeout (fd, buffer + sum, 
-				   (size_t) BLOCKSIZE - sum, timeout, S_FALSE);
+				   (size_t) BLOCKSIZE - sum, timeout);
 
       if (SL_ISERROR (n))
 	{
-	  int error = errno;
-
 	  if (sig_termfast == 1)
-	    {
-	      SH_FREE(buffer);
-	      return -1;
-	    }
+	    return -1;
 	  TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n));
 	  tmp = sh_util_safe_name (filename);
@@ -939,41 +704,16 @@
 	    }
 	  else
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      char errbuf2[SH_ERRBUF_SIZE];
-	      sl_strlcpy(errbuf, sl_error_string(n), sizeof(errbuf));
-	      sh_error_message(error, errbuf2, sizeof(errbuf2));
-	      sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, n,
-			       MSG_E_READ, errbuf, errbuf2, tmp);
-	    }
+	    sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, n,
+			     MSG_E_READ, tmp);
 	  SH_FREE(tmp);
-	  *Length = 0;
-	  SH_FREE(buffer);
 	  return -1;
 	}
 
-      if (content)
-	sh_string_cat_lchar(content, buffer, n);
-
-      bcount += n;
-
-      if (*Length != TIGER_NOLIM)
-	{
-	  if (bcount > *Length) 
-	    {
-	      n = n - (bcount - (*Length));
-	      bcount = *Length;
-	      n = (n < 0) ? 0 : n;
-	    }
-	}
-
       sum += n;
     }
-    while (sum < (size_t) BLOCKSIZE 
+    while (sum < (off_t) BLOCKSIZE 
 	   && n != 0);
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
     ++pages_read;
-#endif
 
     /* If end of file is reached, end the loop.  */
@@ -984,5 +724,5 @@
        BLOCKSIZE % 64 == 0
     */
-    md5_process_block(buffer, BLOCKSIZE, &ctx);
+    (void) md5Update(&ctx, (sh_byte*) buffer, BLOCKSIZE);
     sh.statistics.bytes_hashed += BLOCKSIZE;
 
@@ -995,6 +735,4 @@
     if (sig_termfast == 1) 
       {
-	*Length = 0;
-	SH_FREE(buffer);
 	return -1;
       }
@@ -1005,5 +743,5 @@
   if (sum > 0)
     {
-      md5_process_bytes(buffer, sum, &ctx);
+      (void) md5Update(&ctx, (sh_byte*) buffer, (int) sum);
       sh.statistics.bytes_hashed += BLOCKSIZE;
     }
@@ -1012,6 +750,4 @@
   (void) md5Digest(&ctx, resblock);
 
-  *Length = bcount;
-  SH_FREE(buffer);
   return 0;
 }
@@ -1019,22 +755,29 @@
 static
 char * sh_tiger_md5_hash  (char * filename, TigerType what, 
-			   UINT64 * Length, int timeout, char * out, size_t len)
-{
-  int cnt;
-  char outbuf[KEY_LEN+1];
+			   unsigned long Length, int timeout)
+{
+  int cnt = (int) Length;
+  static char out[KEY_LEN+1];
   unsigned char md5buffer[16];
 
-  (void) md5_stream (filename, md5buffer, Length, timeout, what);
+  if (what != TIGER_FD)
+    {
+      sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, 0,
+		       MSG_E_SUBGEN, _("Not TIGER_FD"), 
+		       _("sh_tiger_md5_hash"));
+      return out;
+    }
+
+  (void) md5_stream (filename, md5buffer, timeout);
 
   /*@-bufferoverflowhigh -usedef@*/
   for (cnt = 0; cnt < 16; ++cnt)
-    sl_snprintf (&outbuf[cnt*2], 3, _("%02X"),                 /* known to fit  */
-	      (unsigned int) md5buffer[cnt]);
+    sprintf (&out[cnt*2], _("%02X"),                 /* known to fit  */
+	     (unsigned int) md5buffer[cnt]);
   /*@+bufferoverflowhigh +usedef@*/
   for (cnt = 32; cnt < KEY_LEN; ++cnt)
-    outbuf[cnt] = '0';
-  outbuf[KEY_LEN] = '\0';
-
-  sl_strlcpy(out, outbuf, len);
+    out[cnt] = '0';
+  out[KEY_LEN] = '\0';
+
   return out;
 }
@@ -1403,29 +1146,20 @@
 /*@+type@*/
 
-#include "sh_checksum.h"
-
-#define SH_VAR_SHA1   0
-#define SH_VAR_SHA256 1
-
 /* Compute SHA1 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 16 bytes
    beginning at RESBLOCK.  */
-static int SHA_stream(char * filename, void *resblock, 
-		      UINT64 * Length, int timeout, SL_TICKET fd, int variant)
+static int sha1_stream(char * filename, void *resblock, int timeout)
 {
   /* Important: BLOCKSIZE must be a multiple of 64.  */
   static const int BLOCKSIZE = 4096;
   struct sha_ctx ctx;
-  SHA256_CTX ctx_sha2;
-  char * buffer = SH_ALLOC(4168); /* BLOCKSIZE + 72 AIX compiler chokes */
+  char buffer[4168]; /* BLOCKSIZE + 72 AIX compiler chokes */
   off_t sum = 0;
+  SL_TICKET  fd;
   char * tmp;
-  uid_t  euid;
-  UINT64 bcount = 0;
-  sh_string * content;
-
+  uid_t   euid;
+
+  unsigned long pages_read;
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
-  unsigned long pages_read;
-
   /*@-nestedextern@*/
   extern long IO_Limit;
@@ -1434,12 +1168,11 @@
 
   /* Initialize the computation context.  */
-  if (variant == SH_VAR_SHA256)
-    (void) SHA256_Init(&ctx_sha2);
-  else
-    (void) sha_init(&ctx);
+  (void) sha_init(&ctx);
+
+  fd = tiger_fd;
 
   if (SL_ISERROR (fd))
     {
-      TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), fd));
+      TPT((0, FIL__, __LINE__, _("msg=<SL_ISERROR (%ld)>\n"), tiger_fd));
       tmp = sh_util_safe_name (filename);
       (void) sl_get_euid(&euid);
@@ -1447,6 +1180,4 @@
 		       MSG_E_ACCESS, (long) euid, tmp);
       SH_FREE(tmp);
-      *Length = 0;
-      SH_FREE(buffer);
       return -1;
     }
@@ -1454,9 +1185,5 @@
   /* Iterate over full file contents.  */
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
   pages_read = 0;
-#endif
-  
-  content = sl_get_content(fd);
 
   while (1 == 1) {
@@ -1470,15 +1197,10 @@
     do {
       n = (off_t) sl_read_timeout(fd, buffer + sum, 
-				  (size_t) BLOCKSIZE - sum, timeout, S_FALSE);
+				  (size_t) BLOCKSIZE - sum, timeout);
 
       if (SL_ISERROR (n))
 	{
-	  int error = errno;
-
 	  if (sig_termfast == 1)
-	    {
-	      SH_FREE(buffer);
-	      return -1;
-	    }
+	    return -1;
 
 	  TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n));
@@ -1493,32 +1215,11 @@
 	  else 
 	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      char errbuf2[SH_ERRBUF_SIZE];
-	      sl_strlcpy(errbuf, sl_error_string(n), sizeof(errbuf));
-	      sh_error_message(error, errbuf2, sizeof(errbuf2));
 	      sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, n,
-			       MSG_E_READ, errbuf, errbuf2, tmp);
+			       MSG_E_READ, tmp);
 	    }
 	  SH_FREE(tmp);
-	  *Length = 0;
-	  SH_FREE(buffer);
 	  return -1;
 	}
 
-      if (content)
-	sh_string_cat_lchar(content, buffer, n);
-
-      bcount += n;
-
-      if (*Length != TIGER_NOLIM)
-	{
-	  if (bcount > *Length)
-	    {
-	      n = n - (bcount - (*Length));
-	      bcount = *Length;
-	      n = (n < 0) ? 0 : n;
-	    }
-	}
-
       sum += n;
     }
@@ -1526,8 +1227,6 @@
 	   && n != 0);
 
-#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
     ++pages_read;
-#endif
-    
+
     /* If end of file is reached, end the loop.  */
     if (n == 0)
@@ -1537,8 +1236,5 @@
        BLOCKSIZE % 64 == 0
     */
-    if (variant == SH_VAR_SHA256)
-      SHA256_Update(&ctx_sha2, (sha2_byte*) buffer, (size_t) BLOCKSIZE);
-    else
-      sha_update(&ctx, (sha_word8*) buffer, (sha_word32) BLOCKSIZE);
+    sha_update(&ctx, (sha_word8*) buffer, (sha_word32) BLOCKSIZE);
     sh.statistics.bytes_hashed += BLOCKSIZE;
 
@@ -1551,6 +1247,4 @@
     if (sig_termfast == 1) 
       {
-	*Length = 0;
-	SH_FREE(buffer);
 	return -1;
       }
@@ -1562,24 +1256,12 @@
   if (sum > 0)
     {
-      if (variant == SH_VAR_SHA256)
-	SHA256_Update(&ctx_sha2, (sha2_byte*) buffer, (size_t) sum);
-      else
-	sha_update(&ctx, (sha_word8*) buffer, (sha_word32) sum);
+      sha_update(&ctx, (sha_word8*) buffer, (sha_word32) sum);
       sh.statistics.bytes_hashed += sum;
     }
 
+  sha_final (&ctx);
+
   /* Construct result in desired memory.  */
-  if (variant == SH_VAR_SHA256)
-    {
-      SHA256_End(&ctx_sha2, resblock);
-    }
-  else
-    {
-      sha_final (&ctx);
-      sha_digest (&ctx, resblock);
-    }
-
-  *Length = bcount;
-  SH_FREE(buffer);
+  sha_digest (&ctx, resblock);
   return 0;
 }
@@ -1587,42 +1269,36 @@
 
 static char * sh_tiger_sha1_hash  (char * filename, TigerType what, 
-				   UINT64 * Length, int timeout, 
-				   char * out, size_t len)
-{
-  int cnt;
-  char outbuf[KEY_LEN+1];
+				   unsigned long Length, int timeout)
+{
+  int cnt = (int) Length;  /* fix compiler warning */
+  static char out[KEY_LEN+1];
   unsigned char sha1buffer[20];
 
-  (void) SHA_stream (filename, sha1buffer, Length, timeout, what, SH_VAR_SHA1);
+  if (what != TIGER_FD)
+    {
+      sh_error_handle (ShDFLevel[SH_ERR_T_FILE], FIL__, __LINE__, 0,
+		       MSG_E_SUBGEN, _("Not TIGER_FD"), 
+		       _("sh_tiger_sha1_hash"));
+      return out;
+    }
+
+  (void) sha1_stream (filename, sha1buffer, timeout);
 
   /*@-bufferoverflowhigh -usedef@*/
   for (cnt = 0; cnt < 20; ++cnt)
-    sl_snprintf (&outbuf[cnt*2], 3, _("%02X"),              /* known to fit  */
+    sprintf (&out[cnt*2], _("%02X"),                 /* known to fit  */
 	     (unsigned int) sha1buffer[cnt]);
   /*@+bufferoverflowhigh +usedef@*/
   for (cnt = 40; cnt < KEY_LEN; ++cnt)
-    outbuf[cnt] = '0';
-  outbuf[KEY_LEN] = '\0';
-
-  sl_strlcpy(out, outbuf, len);
+    out[cnt] = '0';
+  out[KEY_LEN] = '\0';
+
   return out;
 }
 
-static char * sh_tiger_sha256_hash  (char * filename, TigerType what, 
-				     UINT64 * Length, int timeout, 
-				     char * out, size_t len)
-{
-  char outbuf[KEYBUF_SIZE];
-
-  (void) SHA_stream (filename, outbuf, Length, timeout, what, SH_VAR_SHA256);
-
-  sl_strlcpy(out, outbuf, len);
-  return out;
-}
-
 /* ifdef USE_SHA1 */
 #endif
 
-static int hash_type = SH_TIGER192;
+static int hash_type = 0;
 
 int sh_tiger_get_hashtype ()
@@ -1631,34 +1307,5 @@
 }
 
-void sh_tiger_get_mask_hashtype(unsigned long * mask)
-{
-  if (hash_type == SH_TIGER192) 
-    *mask |= MODI_TIGER192;
-  else if (hash_type == SH_SHA1)
-    *mask |= MODI_SHA1;
-  else if (hash_type == SH_MD5)
-    *mask |= MODI_MD5;
-  else if (hash_type == SH_SHA256)
-    *mask |= MODI_SHA256;
-  return;
-}
-
-void sh_tiger_set_hashtype_mask(unsigned long mask)
-{
-  unsigned long type = mask & MODI_HASHTYPE;
-
-  if (type == MODI_TIGER192)
-    hash_type = SH_TIGER192;
-  else if (type == MODI_SHA1)
-    hash_type = SH_SHA1;
-  else if (type == MODI_MD5)
-    hash_type = SH_MD5;
-  else if (type == MODI_SHA256)
-    hash_type = SH_SHA256;
-  return;
-}
-
-
-int sh_tiger_hashtype (const char * c)
+int sh_tiger_hashtype (char * c)
 {
   SL_ENTER( _("sh_tiger_hashtype"));
@@ -1670,53 +1317,41 @@
 
   if (0 == strcmp(c, _("TIGER192")))
-    hash_type = SH_TIGER192;
+    hash_type = 0;
+#ifdef USE_MD5
+  else if (0 == strcmp(c, _("SHA1")))    
+    hash_type = 1;
+#endif
 #ifdef USE_SHA1
-  else if (0 == strcmp(c, _("SHA1")))    
-    hash_type = SH_SHA1;
+  else if (0 == strcmp(c, _("MD5")))    
+    hash_type = 2;
+#endif
+  else
+    {
+      SL_RETURN( -1, _("sh_tiger_hashtype"));
+    }
+  SL_RETURN( 0, _("sh_tiger_hashtype"));
+}
+
+static char * sh_tiger_hash_internal (char * filename, TigerType what, 
+				      unsigned long Length, int timeout);
+
+char * sh_tiger_hash (char * filename, TigerType what, 
+		      unsigned long Length)
+{
+  return sh_tiger_hash_internal (filename, what, Length, 0);
+}
+
+char * sh_tiger_generic_hash (char * filename, TigerType what, 
+			      unsigned long Length, int timeout)
+{
+#ifdef USE_SHA1
+  if (hash_type == 1)
+    return sh_tiger_sha1_hash    (filename, what, Length, timeout);
 #endif
 #ifdef USE_MD5
-  else if (0 == strcmp(c, _("MD5")))    
-    hash_type = SH_MD5;
-#endif
-#ifdef USE_SHA1
-  else if (0 == strcmp(c, _("SHA256")))    
-    hash_type = SH_SHA256;
-#endif
-  else
-    {
-      SL_RETURN( -1, _("sh_tiger_hashtype"));
-    }
-  SL_RETURN( 0, _("sh_tiger_hashtype"));
-}
-
-static char * sh_tiger_hash_internal (const char * filename, TigerType what, 
-				      UINT64 * Length, int timeout,
-				      char * out, size_t len);
-
-char * sh_tiger_hash (const char * filename, TigerType what, 
-		      UINT64 Length, char * out, size_t len)
-{
-  UINT64 local_length = Length;
-  char * retval = sh_tiger_hash_internal (filename, what, &local_length, 0, out,len);
-  return retval;
-}
-
-char * sh_tiger_generic_hash (char * filename, TigerType what, 
-			      UINT64 * Length, int timeout,
-			      char * out, size_t len)
-{
-#ifdef USE_SHA1
-  if (hash_type == SH_SHA1)
-    return sh_tiger_sha1_hash    (filename, what, Length, timeout, out, len);
-#endif
-#ifdef USE_MD5
-  if (hash_type == SH_MD5)
-    return sh_tiger_md5_hash     (filename, what, Length, timeout, out, len);
-#endif
-#ifdef USE_SHA1
-  if (hash_type == SH_SHA256)
-    return sh_tiger_sha256_hash  (filename, what, Length, timeout, out, len);
-#endif
-  return sh_tiger_hash_internal  (filename, what, Length, timeout, out, len);
+  if (hash_type == 2)
+    return sh_tiger_md5_hash     (filename, what, Length, timeout);
+#endif
+  return sh_tiger_hash_internal  (filename, what, Length, timeout);
 }
 
@@ -1724,95 +1359,103 @@
  * -------   end new ---------  */
   
-static char * sh_tiger_hash_internal (const char * filename, TigerType what, 
-				      UINT64 * Length, int timeout, 
-				      char * out, size_t len)
-{
-#if defined(TIGER_64_BIT)
-  word64 res[3];
+static char * sh_tiger_hash_internal (char * filename, TigerType what, 
+				      unsigned long Length, int timeout)
+{
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+  /* #ifdef HAVE_LONG_64 */
+  word64 * res;
 #else
-  sh_word32 res[6];
-#endif
-
-  SL_ENTER( _("sh_tiger_hash_internal"));
-
-  SH_VALIDATE_GE(len, (KEY_LEN+1));
-
-  if (NULL != sh_tiger_hash_val (filename, what, Length, timeout, res))
-    {
-#if defined(TIGER_64_BIT)
-      sl_snprintf(out, len,
-		  MYFORMAT,
-		  (sh_word32)(res[0]>>32), 
-		  (sh_word32)(res[0]), 
-		  (sh_word32)(res[1]>>32), 
-		  (sh_word32)(res[1]), 
-		  (sh_word32)(res[2]>>32), 
-		  (sh_word32)(res[2]) );
+  sh_word32 * res;
+#endif
+  static char out[KEY_LEN+1];
+
+  SL_ENTER( _("sh_tiger_hash"));
+
+  res = sh_tiger_hash_val (filename, what, Length, timeout);
+
+  if (res != NULL)
+    {
+      /*@-bufferoverflowhigh -formatconst@*/
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+      /* #ifdef HAVE_LONG_64 */
+      sprintf(out,                                   /* known to fit  */
+	      MYFORMAT,
+	      (sh_word32)(res[0]>>32), 
+	      (sh_word32)(res[0]), 
+	      (sh_word32)(res[1]>>32), 
+	      (sh_word32)(res[1]), 
+	      (sh_word32)(res[2]>>32), 
+	      (sh_word32)(res[2]) );
 #else
-      sl_snprintf(out, len,
-		  MYFORMAT,
-		  (sh_word32)(res[1]), 
-		  (sh_word32)(res[0]), 
-		  (sh_word32)(res[3]), 
-		  (sh_word32)(res[2]), 
-		  (sh_word32)(res[5]), 
-		  (sh_word32)(res[4]) );
-#endif
-      out[len-1] = '\0';
-      SL_RETURN( out, _("sh_tiger_hash_internal"));
-
-    }
-
-   SL_RETURN( SH_KEY_NULL, _("sh_tiger_hash_internal"));
-}
-
-char * sh_tiger_hash_gpg (const char * filename, TigerType what, 
-			  UINT64 Length)
+      sprintf(out,                                   /* known to fit  */
+	      MYFORMAT,
+	      (sh_word32)(res[1]), 
+	      (sh_word32)(res[0]), 
+	      (sh_word32)(res[3]), 
+	      (sh_word32)(res[2]), 
+	      (sh_word32)(res[5]), 
+	      (sh_word32)(res[4]) );
+#endif
+      /*@+bufferoverflowhigh@*/
+      out[KEY_LEN] = '\0';
+      SL_RETURN( out, _("sh_tiger_hash"));
+
+    }
+
+   SL_RETURN( _("000000000000000000000000000000000000000000000000"), 
+	      _("sh_tiger_hash"));
+}
+
+char * sh_tiger_hash_gpg (char * filename, TigerType what, 
+			  unsigned long Length)
 {
   size_t  len;
   char * out;
   char   outhash[48+6+1];
-#if defined(TIGER_64_BIT)
-  word64 res[3];
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+  /* #ifdef HAVE_LONG_64 */
+  word64 * res;
 #else
-  sh_word32 res[6];
-#endif
-  UINT64 local_length = Length;
+  sh_word32 * res;
+#endif
 
   SL_ENTER(_("sh_tiger_hash_gpg"));
 
-  if (NULL != sh_tiger_hash_val (filename, what, &local_length, 0, res))
-    {
-#if defined(TIGER_64_BIT)
-      sl_snprintf(outhash,
-		  sizeof(outhash),
-		  GPGFORMAT,
-		  (sh_word32)(res[0]>>32), 
-		  (sh_word32)(res[0]), 
-		  (sh_word32)(res[1]>>32), 
-		  (sh_word32)(res[1]), 
-		  (sh_word32)(res[2]>>32), 
-		  (sh_word32)(res[2]) );
+  res = sh_tiger_hash_val (filename, what, Length, 0);
+  if (res != NULL)
+    {
+      /*@-bufferoverflowhigh -formatconst@*/
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+      /* #ifdef HAVE_LONG_64 */
+      sprintf(outhash,                               /* known to fit  */
+	      GPGFORMAT,
+	      (sh_word32)(res[0]>>32), 
+	      (sh_word32)(res[0]), 
+	      (sh_word32)(res[1]>>32), 
+	      (sh_word32)(res[1]), 
+	      (sh_word32)(res[2]>>32), 
+	      (sh_word32)(res[2]) );
 #else
-      sl_snprintf(outhash,
-		  sizeof(outhash),
-		  GPGFORMAT,
-		  (sh_word32)(res[1]), 
-		  (sh_word32)(res[0]), 
-		  (sh_word32)(res[3]), 
-		  (sh_word32)(res[2]), 
-		  (sh_word32)(res[5]), 
-		  (sh_word32)(res[4]) );
-#endif
-      outhash[sizeof(outhash)-1] = '\0';
+      sprintf(outhash,                               /* known to fit  */
+	      GPGFORMAT,
+	      (sh_word32)(res[1]), 
+	      (sh_word32)(res[0]), 
+	      (sh_word32)(res[3]), 
+	      (sh_word32)(res[2]), 
+	      (sh_word32)(res[5]), 
+	      (sh_word32)(res[4]) );
+#endif
+      /*@+bufferoverflowhigh@*/
+      outhash[48 + 6] = '\0';
     }
   else
     {
-      sl_strlcpy(outhash,
-		 _("00000000 00000000 00000000  00000000 00000000 00000000"),
-		 sizeof(outhash));
-    }
-
-  if (what == TIGER_FILE && sl_ok_adds(sl_strlen (filename), (2 + 48 + 6)))
+      /*@-bufferoverflowhigh@*/
+      sprintf(outhash,                               /* known to fit  */
+	      _("00000000 00000000 00000000  00000000 00000000 00000000"));
+      /*@+bufferoverflowhigh@*/
+    }
+
+  if (what == TIGER_FILE)
     len = sl_strlen (filename) + 2 + 48 + 6;
   else
@@ -1837,23 +1480,25 @@
 UINT32 * sh_tiger_hash_uint32 (char * filename, 
 			       TigerType what, 
-			       UINT64 Length, UINT32 * out, size_t len)
-{
-#if defined(TIGER_64_BIT)
-  word64 res[3];
+			       unsigned long Length)
+{
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+  /* #ifdef HAVE_LONG_64 */
+  word64 * res;
 #else
-  sh_word32 res[6];
-#endif
-  UINT64 local_length = Length;
+  sh_word32 * res;
+#endif
+
+  static UINT32 out[6];
 
   SL_ENTER(_("sh_tiger_hash_uint32"));
 
-  SH_VALIDATE_GE(len, 6);
-
-  out[0] = 0; out[1] = 0; out[2] = 0;
-  out[3] = 0; out[4] = 0; out[5] = 0;
-
-  if (NULL != sh_tiger_hash_val (filename,  what,  &local_length, 0, res))
-    {
-#if defined(TIGER_64_BIT)
+  memset(out, 0, 6 * sizeof(UINT32));
+
+  res = sh_tiger_hash_val (filename,  what,  Length, 0);
+
+  if (res != NULL)
+    {
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+      /* #ifdef HAVE_LONG_64 */
 	out[0] =  (UINT32)(res[0]>>32); 
 	out[1] =  (UINT32)(res[0]);
Index: trunk/src/sh_tiger1.c
===================================================================
--- trunk/src/sh_tiger1.c	(revision 591)
+++ trunk/src/sh_tiger1.c	(revision 1)
@@ -5,9 +5,6 @@
 #include "config_xor.h"
 
-/* we already inline in the function used for file checksums */
-/* #define UNROLL_COMPRESS */
-#undef UNROLL_COMPRESS
-
-#if !defined(TIGER_64_BIT)
+
+#if !defined(HAVE_LONG_64) && !defined(HAVE_LONG_LONG_64)
 
 /* Tiger: A Fast New Hash Function
@@ -40,5 +37,5 @@
 typedef unsigned short sh_word32;
 #else
-#error No 32 bit type found !
+#error No 32 byte type found !
 #endif
 
@@ -49,4 +46,9 @@
 #define BIG_ENDIAN
 #endif
+
+/* NOTE that this code is NOT FULLY OPTIMIZED for any  */
+/* machine. Assembly code might be much faster on some */
+/* machines, especially if the code is compiled with   */
+/* gcc.                                                */
 
 /* The number of passes of the hash function.          */
@@ -63,5 +65,5 @@
 #define t4 (tiger_table+256*3)
 
-#define sub64(s0, s1, p0, p1) \
+#define sh_sub64(s0, s1, p0, p1) \
       temps0 = (p0); \
       tcarry = s0 < temps0; \
@@ -69,5 +71,5 @@
       s1 -= (p1) + tcarry;
 
-#define add64(s0, s1, p0, p1) \
+#define sh_add64(s0, s1, p0, p1) \
       temps0 = (p0); \
       s0 += temps0; \
@@ -75,26 +77,26 @@
       s1 += (p1) + tcarry;
 
-#define xor64(s0, s1, p0, p1) \
+#define sh_xor64(s0, s1, p0, p1) \
       s0 ^= (p0); \
       s1 ^= (p1);
 
-#define mul5(s0, s1) \
+#define sh_mul5(s0, s1) \
       tempt0 = s0<<2; \
       tempt1 = (s1<<2)|(s0>>30); \
-      add64(s0, s1, tempt0, tempt1);
-
-#define mul7(s0, s1) \
+      sh_add64(s0, s1, tempt0, tempt1);
+
+#define sh_mul7(s0, s1) \
       tempt0 = s0<<3; \
       tempt1 = (s1<<3)|(s0>>29); \
-      sub64(tempt0, tempt1, s0, s1); \
+      sh_sub64(tempt0, tempt1, s0, s1); \
       s0 = tempt0; \
       s1 = tempt1;
 
-#define mul9(s0, s1) \
+#define sh_mul9(s0, s1) \
       tempt0 = s0<<3; \
       tempt1 = (s1<<3)|(s0>>29); \
-      add64(s0, s1, tempt0, tempt1);
-
-#define save_abc \
+      sh_add64(s0, s1, tempt0, tempt1);
+
+#define sh_save_abc \
       aa0 = a0; \
       aa1 = a1; \
@@ -104,6 +106,6 @@
       cc1 = c1;
 
-#define roundX(a0,a1,b0,b1,c0,c1,x0,x1) \
-      xor64(c0, c1, x0, x1); \
+#define sh_round(a0,a1,b0,b1,c0,c1,x0,x1,mul) \
+      sh_xor64(c0, c1, x0, x1); \
       temp0  = t1[((c0)>>(0*8))&0xFF][0] ; \
       temp1  = t1[((c0)>>(0*8))&0xFF][1] ; \
@@ -114,5 +116,5 @@
       temp0 ^= t4[((c1)>>(2*8))&0xFF][0] ; \
       temp1 ^= t4[((c1)>>(2*8))&0xFF][1] ; \
-      sub64(a0, a1, temp0, temp1); \
+      sh_sub64(a0, a1, temp0, temp1); \
       temp0  = t4[((c0)>>(1*8))&0xFF][0] ; \
       temp1  = t4[((c0)>>(1*8))&0xFF][1] ; \
@@ -123,108 +125,79 @@
       temp0 ^= t1[((c1)>>(3*8))&0xFF][0] ; \
       temp1 ^= t1[((c1)>>(3*8))&0xFF][1] ; \
-      add64(b0, b1, temp0, temp1); 
-
-
-#define round5(a0,a1,b0,b1,c0,c1,x0,x1) \
-      roundX(a0,a1,b0,b1,c0,c1,x0,x1); \
-      mul5(b0, b1);
-
-#define round7(a0,a1,b0,b1,c0,c1,x0,x1) \
-      roundX(a0,a1,b0,b1,c0,c1,x0,x1); \
-      mul7(b0, b1);
-
-#define round9(a0,a1,b0,b1,c0,c1,x0,x1) \
-      roundX(a0,a1,b0,b1,c0,c1,x0,x1); \
-      mul9(b0, b1);
-
-
-/* mixed with key_schedule
- */
-#define pass5(a0,a1,b0,b1,c0,c1) \
-      round5(a0,a1,b0,b1,c0,c1,x00,x01); \
-      sub64(x00, x01, x70^0xA5A5A5A5, x71^0xA5A5A5A5); \
-      round5(b0,b1,c0,c1,a0,a1,x10,x11); \
-      xor64(x10, x11, x00, x01); \
-      round5(c0,c1,a0,a1,b0,b1,x20,x21); \
-      add64(x20, x21, x10, x11); \
-      round5(a0,a1,b0,b1,c0,c1,x30,x31); \
-      sub64(x30, x31, x20^((~x10)<<19), ~x21^(((x11)<<19)|((x10)>>13))); \
-      round5(b0,b1,c0,c1,a0,a1,x40,x41); \
-      xor64(x40, x41, x30, x31); \
-      round5(c0,c1,a0,a1,b0,b1,x50,x51); \
-      add64(x50, x51, x40, x41); \
-      round5(a0,a1,b0,b1,c0,c1,x60,x61); \
-      sub64(x60, x61, ~x50^(((x40)>>23)|((x41)<<9)), x51^((~x41)>>23)); \
-      round5(b0,b1,c0,c1,a0,a1,x70,x71);
-
-/* mixed with key_schedule
- */
-#define pass7(a0,a1,b0,b1,c0,c1) \
-      round7(a0,a1,b0,b1,c0,c1,x00,x01); \
-      sub64(x00, x01, x70^0xA5A5A5A5, x71^0xA5A5A5A5); \
-      round7(b0,b1,c0,c1,a0,a1,x10,x11); \
-      xor64(x10, x11, x00, x01); \
-      round7(c0,c1,a0,a1,b0,b1,x20,x21); \
-      add64(x20, x21, x10, x11); \
-      round7(a0,a1,b0,b1,c0,c1,x30,x31); \
-      sub64(x30, x31, x20^((~x10)<<19), ~x21^(((x11)<<19)|((x10)>>13))); \
-      round7(b0,b1,c0,c1,a0,a1,x40,x41); \
-      xor64(x40, x41, x30, x31); \
-      round7(c0,c1,a0,a1,b0,b1,x50,x51); \
-      add64(x50, x51, x40, x41); \
-      round7(a0,a1,b0,b1,c0,c1,x60,x61); \
-      sub64(x60, x61, ~x50^(((x40)>>23)|((x41)<<9)), x51^((~x41)>>23)); \
-      round7(b0,b1,c0,c1,a0,a1,x70,x71);
-
-/* mixed with key_schedule
- */
-#define pass9(a0,a1,b0,b1,c0,c1) \
-      round9(a0,a1,b0,b1,c0,c1,x00,x01); \
-      sub64(x00, x01, x70^0xA5A5A5A5, x71^0xA5A5A5A5); \
-      round9(b0,b1,c0,c1,a0,a1,x10,x11); \
-      xor64(x10, x11, x00, x01); \
-      round9(c0,c1,a0,a1,b0,b1,x20,x21); \
-      add64(x20, x21, x10, x11); \
-      round9(a0,a1,b0,b1,c0,c1,x30,x31); \
-      sub64(x30, x31, x20^((~x10)<<19), ~x21^(((x11)<<19)|((x10)>>13))); \
-      round9(b0,b1,c0,c1,a0,a1,x40,x41); \
-      xor64(x40, x41, x30, x31); \
-      round9(c0,c1,a0,a1,b0,b1,x50,x51); \
-      add64(x50, x51, x40, x41); \
-      round9(a0,a1,b0,b1,c0,c1,x60,x61); \
-      sub64(x60, x61, ~x50^(((x40)>>23)|((x41)<<9)), x51^((~x41)>>23)); \
-      round9(b0,b1,c0,c1,a0,a1,x70,x71);
-
-#define key_schedule \
-      xor64(x70, x71, x60, x61); \
-      add64(x00, x01, x70, x71); \
-      sub64(x10, x11, x00^((~x70)<<19), ~x01^(((x71)<<19)|((x70)>>13))); \
-      xor64(x20, x21, x10, x11); \
-      add64(x30, x31, x20, x21); \
-      sub64(x40, x41, ~x30^(((x20)>>23)|((x21)<<9)), x31^((~x21)>>23)); \
-      xor64(x50, x51, x40, x41); \
-      add64(x60, x61, x50, x51); \
-      sub64(x70, x71, x60^0x89ABCDEF, x61^0x01234567);
-
-#define feedforward \
-      xor64(a0, a1, aa0, aa1); \
-      sub64(b0, b1, bb0, bb1); \
-      add64(c0, c1, cc0, cc1);
-
-#define compress \
-      pass5(a0,a1,b0,b1,c0,c1); \
-      key_schedule; \
-      pass7(c0,c1,a0,a1,b0,b1); \
-      key_schedule; \
-      pass9(b0,b1,c0,c1,a0,a1); \
-      feedforward
+      sh_add64(b0, b1, temp0, temp1); \
+      if((mul)==5) \
+	{sh_mul5(b0, b1);} \
+      else \
+	if((mul)==7) \
+	  {sh_mul7(b0, b1);} \
+	else \
+	  {sh_mul9(b0, b1)};
+
+#define sh_pass(a0,a1,b0,b1,c0,c1,mul) \
+      sh_round(a0,a1,b0,b1,c0,c1,x00,x01,mul); \
+      sh_round(b0,b1,c0,c1,a0,a1,x10,x11,mul); \
+      sh_round(c0,c1,a0,a1,b0,b1,x20,x21,mul); \
+      sh_round(a0,a1,b0,b1,c0,c1,x30,x31,mul); \
+      sh_round(b0,b1,c0,c1,a0,a1,x40,x41,mul); \
+      sh_round(c0,c1,a0,a1,b0,b1,x50,x51,mul); \
+      sh_round(a0,a1,b0,b1,c0,c1,x60,x61,mul); \
+      sh_round(b0,b1,c0,c1,a0,a1,x70,x71,mul);
+
+#define sh_key_schedule \
+      sh_sub64(x00, x01, x70^0xA5A5A5A5, x71^0xA5A5A5A5); \
+      sh_xor64(x10, x11, x00, x01); \
+      sh_add64(x20, x21, x10, x11); \
+      sh_sub64(x30, x31, x20^((~x10)<<19), ~x21^(((x11)<<19)|((x10)>>13))); \
+      sh_xor64(x40, x41, x30, x31); \
+      sh_add64(x50, x51, x40, x41); \
+      sh_sub64(x60, x61, ~x50^(((x40)>>23)|((x41)<<9)), x51^((~x41)>>23)); \
+      sh_xor64(x70, x71, x60, x61); \
+      sh_add64(x00, x01, x70, x71); \
+      sh_sub64(x10, x11, x00^((~x70)<<19), ~x01^(((x71)<<19)|((x70)>>13))); \
+      sh_xor64(x20, x21, x10, x11); \
+      sh_add64(x30, x31, x20, x21); \
+      sh_sub64(x40, x41, ~x30^(((x20)>>23)|((x21)<<9)), x31^((~x21)>>23)); \
+      sh_xor64(x50, x51, x40, x41); \
+      sh_add64(x60, x61, x50, x51); \
+      sh_sub64(x70, x71, x60^0x89ABCDEF, x61^0x01234567);
+
+#define sh_feedforward \
+      sh_xor64(a0, a1, aa0, aa1); \
+      sh_sub64(b0, b1, bb0, bb1); \
+      sh_add64(c0, c1, cc0, cc1);
+
+#ifdef UNROLL_COMPRESS
+#define sh_compress \
+      sh_save_abc \
+      sh_pass(a0,a1,b0,b1,c0,c1,5); \
+      sh_key_schedule; \
+      sh_pass(c0,c1,a0,a1,b0,b1,7); \
+      sh_key_schedule; \
+      sh_pass(b0,b1,c0,c1,a0,a1,9); \
+      for(pass_no=3; pass_no<PASSES; pass_no++) { \
+        sh_key_schedule \
+	sh_pass(a0,a1,b0,b1,c0,c1,9); \
+	tmpa=a0; a0=c0; c0=b0; b0=tmpa; \
+	tmpa=a1; a1=c1; c1=b1; b1=tmpa;} \
+      sh_feedforward
+#else
+#define sh_compress \
+      sh_save_abc \
+      for(pass_no=0; pass_no<PASSES; pass_no++) { \
+        if(pass_no != 0) {sh_key_schedule} \
+	sh_pass(a0,a1,b0,b1,c0,c1,(pass_no==0?5:pass_no==1?7:9)) \
+	tmpa=a0; a0=c0; c0=b0; b0=tmpa; \
+	tmpa=a1; a1=c1; c1=b1; b1=tmpa;} \
+      sh_feedforward
+#endif
 
 #define tiger_compress_macro(str, state) \
 { \
-  register sh_word32 a0, a1, b0, b1, c0, c1; \
+  register sh_word32 a0, a1, b0, b1, c0, c1, tmpa; \
   sh_word32 aa0, aa1, bb0, bb1, cc0, cc1; \
   sh_word32 x00, x01, x10, x11, x20, x21, x30, x31, \
-                  x40, x41, x50, x51, x60, x61, x70, x71; \
-  sh_word32 temp0, temp1, tempt0, tempt1, temps0, tcarry; \
+         x40, x41, x50, x51, x60, x61, x70, x71; \
+  register sh_word32 temp0, temp1, tempt0, tempt1, temps0, tcarry; \
+  int pass_no; \
 \
   a0 = state[0]; \
@@ -235,6 +208,4 @@
   c1 = state[5]; \
 \
-      save_abc \
-\
   x00=str[0*2]; x01=str[0*2+1]; x10=str[1*2]; x11=str[1*2+1]; \
   x20=str[2*2]; x21=str[2*2+1]; x30=str[3*2]; x31=str[3*2+1]; \
@@ -242,5 +213,5 @@
   x60=str[6*2]; x61=str[6*2+1]; x70=str[7*2]; x71=str[7*2+1]; \
 \
-  compress; \
+  sh_compress; \
 \
   state[0] = a0; \
@@ -252,11 +223,10 @@
 }
 
-#if defined(UNROLL_COMPRESS)
+#ifdef UNROLL_COMPRESS
 /* The compress function is inlined */
 #define tiger_compress(str, state) \
   tiger_compress_macro(((sh_word32*)str), ((sh_word32*)state))
-
-#else
-
+#else
+/* The compress function is a function */
 void
 tiger_compress(sh_word32 *str, sh_word32 state[6])
@@ -267,5 +237,5 @@
 
 void
-tiger_t(const sh_word32 *str, sh_word32 length, sh_word32 res[6])
+tiger_t(sh_word32 *str, sh_word32 length, sh_word32 res[6])
 {
   register sh_word32 i;
@@ -279,8 +249,8 @@
 #ifdef BIG_ENDIAN
       for(j=0; j<64; j++)
-        temp[j^3] = ((sh_byte*)str)[j];
-      tiger_compress_macro(((sh_word32*)temp), res);
-#else
-      tiger_compress_macro(str, res);
+	temp[j^3] = ((sh_byte*)str)[j];
+      tiger_compress(((sh_word32*)temp), res);
+#else
+      tiger_compress(str, res);
 #endif
       str += 16;
@@ -288,18 +258,9 @@
 }
 
-
-void tiger(sh_word32 *str, sh_word32 length, sh_word32 res[6])
+void
+tiger(sh_word32 *str, sh_word32 length, sh_word32 res[6])
 {
   register sh_word32 i, j;
   sh_byte temp[64];
-
-  /*
-   * res[0]=0x89ABCDEF;
-   * res[1]=0x01234567;
-   * res[2]=0x76543210;
-   * res[3]=0xFEDCBA98;
-   * res[4]=0xC3B2E187;
-   * res[5]=0xF096A5B4;
-   */
 
   for(i=length; i>=64; i-=64)
@@ -346,4 +307,18 @@
 }
 
-#endif
-
+#else
+void dummy_1 (int a)
+{
+  (void) a;
+  return;
+}
+#endif
+
+
+
+
+
+
+
+
+
Index: trunk/src/sh_tiger1.s
===================================================================
--- trunk/src/sh_tiger1.s	(revision 591)
+++ 	(revision )
@@ -1,5756 +1,0 @@
-	.file	"sh_tiger1.c"
-	.text
-.globl tiger_compress
-	.type	tiger_compress, @function
-tiger_compress:
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%edi
-	pushl	%esi
-	pushl	%ebx
-	subl	$1140, %esp
-	movl	12(%ebp), %ecx
-	movl	12(%ebp), %esi
-	call	__i686.get_pc_thunk.bx
-	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
-	movl	8(%ebp), %eax
-	movl	(%ecx), %edi
-	movl	12(%ebp), %ecx
-	movl	%edi, -1088(%ebp)
-	movl	4(%esi), %edx
-	movl	12(%ebp), %esi
-	movl	%edx, -1092(%ebp)
-	movl	8(%ecx), %edi
-	movl	12(%ebp), %ecx
-	movl	%edi, -1096(%ebp)
-	movl	12(%esi), %edx
-	movl	-1096(%ebp), %esi
-	movl	%edx, -1100(%ebp)
-	movl	16(%ecx), %edx
-	movl	20(%ecx), %edi
-	movl	%esi, -16(%ebp)
-	movl	%edx, -20(%ebp)
-	movl	%edi, -1104(%ebp)
-	movl	(%eax), %ecx
-	movl	%ecx, -24(%ebp)
-	movl	4(%eax), %edi
-	movl	%edi, -28(%ebp)
-	movl	8(%eax), %esi
-	movl	%esi, -32(%ebp)
-	movl	12(%eax), %ecx
-	movl	%ecx, -36(%ebp)
-	movl	16(%eax), %edi
-	movl	%edi, -40(%ebp)
-	movl	20(%eax), %esi
-	movl	%esi, -44(%ebp)
-	movl	24(%eax), %ecx
-	movl	%ecx, -48(%ebp)
-	movl	28(%eax), %edi
-	movl	%edi, -52(%ebp)
-	movl	32(%eax), %esi
-	movl	%esi, -56(%ebp)
-	movl	36(%eax), %ecx
-	movl	%ecx, -60(%ebp)
-	movl	40(%eax), %edi
-	movl	%edi, -64(%ebp)
-	movl	44(%eax), %esi
-	movl	%esi, -68(%ebp)
-	movl	48(%eax), %ecx
-	movl	%ecx, -72(%ebp)
-	movl	52(%eax), %edi
-	movl	%edi, -76(%ebp)
-	movl	56(%eax), %esi
-	movl	-28(%ebp), %edi
-	movl	%esi, -80(%ebp)
-	movl	60(%eax), %ecx
-	movl	-24(%ebp), %eax
-	movl	-1104(%ebp), %esi
-	movl	%ecx, -84(%ebp)
-	xorl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%edx, -152(%ebp)
-	movl	%edx, %eax
-	xorl	%edi, %esi
-	movl	%esi, -156(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	%ecx, %esi
-	movl	2048(%eax,%ecx), %edx
-	movl	(%ecx,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-156(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-156(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-1088(%ebp), %edi
-	cmpl	%ecx, -1088(%ebp)
-	setb	%al
-	subl	%ecx, %edi
-	movl	%edi, -168(%ebp)
-	movl	-1092(%ebp), %ecx
-	addl	%eax, %edx
-	subl	%edx, %ecx
-	movl	-152(%ebp), %edx
-	movl	%ecx, -172(%ebp)
-	movzbl	%dh, %eax
-	leal	0(,%eax,8), %ecx
-	movl	%edx, %eax
-	movl	6144(%ecx,%esi), %edi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6148(%ecx,%esi), %ecx
-	movl	4096(%eax,%esi), %edx
-	xorl	%edi, %edx
-	movl	4100(%eax,%esi), %edi
-	movl	-156(%ebp), %eax
-	xorl	%edi, %ecx
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %edx
-	movl	2052(%eax,%esi), %edi
-	movl	-156(%ebp), %eax
-	xorl	%edi, %ecx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %edx
-	movl	4(%esi,%eax,8), %edi
-	movl	-1096(%ebp), %esi
-	xorl	%eax, %eax
-	xorl	%edi, %ecx
-	addl	%edx, %esi
-	cmpl	%edx, %esi
-	movl	-1100(%ebp), %edx
-	setb	%al
-	movl	%esi, %edi
-	leal	(%ecx,%eax), %eax
-	addl	%edx, %eax
-	leal	0(,%esi,4), %ecx
-	movl	%eax, %edx
-	movl	%eax, -160(%ebp)
-	addl	%ecx, %esi
-	shrl	$30, %edi
-	movl	%esi, -164(%ebp)
-	sall	$2, %edx
-	xorl	%eax, %eax
-	orl	%edi, %edx
-	cmpl	%ecx, %esi
-	movl	-80(%ebp), %edi
-	setb	%al
-	xorl	%ecx, %ecx
-	addl	%eax, %edx
-	movl	-160(%ebp), %eax
-	xorl	$-1515870811, %edi
-	movl	-24(%ebp), %esi
-	addl	%eax, %edx
-	movl	-84(%ebp), %eax
-	cmpl	%edi, -24(%ebp)
-	movl	%edx, -184(%ebp)
-	movl	-32(%ebp), %edx
-	setb	%cl
-	xorl	$-1515870811, %eax
-	subl	%edi, %esi
-	addl	%ecx, %eax
-	movl	%esi, -196(%ebp)
-	movl	-28(%ebp), %ecx
-	movl	-36(%ebp), %edi
-	movl	-172(%ebp), %esi
-	subl	%eax, %ecx
-	movl	-168(%ebp), %eax
-	movl	%ecx, -200(%ebp)
-	movl	tiger_table@GOT(%ebx), %ecx
-	xorl	%edi, %esi
-	movl	%esi, -180(%ebp)
-	xorl	%edx, %eax
-	movzbl	%al,%edi
-	movl	%eax, -176(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%ecx, %esi
-	movl	2048(%eax,%ecx), %edx
-	movl	(%ecx,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-180(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-180(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-164(%ebp), %edi
-	cmpl	%ecx, -164(%ebp)
-	setb	%al
-	subl	%ecx, %edi
-	movl	%edi, -204(%ebp)
-	movl	-176(%ebp), %ecx
-	movl	-184(%ebp), %edi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %edi
-	movl	%edi, -208(%ebp)
-	leal	0(,%eax,8), %edi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%edi,%esi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-180(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-180(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-152(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-156(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -188(%ebp)
-	leal	0(,%edi,4), %ecx
-	addl	%ecx, %edi
-	movl	%edi, -192(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-188(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	movl	-32(%ebp), %ecx
-	addl	%edi, %edx
-	movl	-200(%ebp), %eax
-	movl	%edx, -220(%ebp)
-	movl	-36(%ebp), %edi
-	movl	-196(%ebp), %edx
-	xorl	%eax, %edi
-	xorl	%edx, %ecx
-	movl	%edi, -240(%ebp)
-	movl	-40(%ebp), %edx
-	movl	%ecx, -232(%ebp)
-	movl	-204(%ebp), %eax
-	movl	-44(%ebp), %ecx
-	movl	-208(%ebp), %edi
-	xorl	%edx, %eax
-	movl	%eax, -212(%ebp)
-	xorl	%ecx, %edi
-	movl	%edi, -216(%ebp)
-	movzbl	%al,%edi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-216(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-216(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-192(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -192(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -244(%ebp)
-	movl	-220(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-212(%ebp), %edx
-	movl	%edi, -248(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-216(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-216(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-176(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-180(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,4), %ecx
-	movl	%edx, -224(%ebp)
-	addl	%ecx, %edi
-	shrl	$30, %eax
-	movl	%edi, -228(%ebp)
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-224(%ebp), %ecx
-	setb	%al
-	movl	-232(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-232(%ebp), %eax
-	movl	-240(%ebp), %ecx
-	movl	%edx, -260(%ebp)
-	movl	-40(%ebp), %edx
-	addl	%eax, %edx
-	movl	%edx, -236(%ebp)
-	xorl	%eax, %eax
-	cmpl	%edi, %edx
-	movl	-44(%ebp), %edi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-48(%ebp), %edx
-	addl	%edi, %eax
-	movl	-52(%ebp), %ecx
-	movl	%eax, -272(%ebp)
-	movl	-248(%ebp), %edi
-	movl	-244(%ebp), %eax
-	xorl	%ecx, %edi
-	xorl	%edx, %eax
-	movl	%edi, -256(%ebp)
-	movzbl	%al,%edi
-	movl	%eax, -252(%ebp)
-	shrl	$13, %eax
-	movl	(%esi,%edi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-256(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-256(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-228(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -228(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -276(%ebp)
-	movl	-260(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-252(%ebp), %edx
-	movl	%edi, -280(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-256(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-256(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-212(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-216(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,4), %ecx
-	movl	%edx, -264(%ebp)
-	addl	%ecx, %edi
-	shrl	$30, %eax
-	movl	%edi, -268(%ebp)
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	setb	%al
-	addl	%eax, %edx
-	movl	-264(%ebp), %eax
-	movl	-236(%ebp), %edi
-	addl	%eax, %edx
-	movl	-232(%ebp), %eax
-	movl	%edx, -292(%ebp)
-	movl	-48(%ebp), %edx
-	notl	%eax
-	sall	$19, %eax
-	xorl	%edi, %eax
-	cmpl	%eax, -48(%ebp)
-	setb	%cl
-	movzbl	%cl, %edi
-	subl	%eax, %edx
-	movl	-232(%ebp), %ecx
-	movl	-240(%ebp), %eax
-	movl	%edx, -304(%ebp)
-	movl	-272(%ebp), %edx
-	shrl	$13, %ecx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%edx
-	xorl	%eax, %edx
-	movl	-52(%ebp), %eax
-	addl	%edi, %edx
-	movl	-60(%ebp), %ecx
-	subl	%edx, %eax
-	movl	-280(%ebp), %edi
-	movl	%eax, -308(%ebp)
-	movl	-56(%ebp), %edx
-	movl	-276(%ebp), %eax
-	xorl	%ecx, %edi
-	xorl	%edx, %eax
-	movl	%eax, -284(%ebp)
-	movl	%edi, -288(%ebp)
-	movzbl	%al,%edi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-288(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-288(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-268(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -268(%ebp)
-	movl	-292(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	subl	%ecx, %esi
-	subl	%edx, %edi
-	movl	%esi, -312(%ebp)
-	movl	-284(%ebp), %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%edi, -316(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-288(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-288(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-252(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-256(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,4), %ecx
-	movl	%edx, -296(%ebp)
-	addl	%ecx, %edi
-	shrl	$30, %eax
-	movl	%edi, -300(%ebp)
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-296(%ebp), %edi
-	setb	%al
-	movl	-56(%ebp), %ecx
-	addl	%eax, %edx
-	addl	%edi, %edx
-	movl	%edx, -328(%ebp)
-	movl	-304(%ebp), %edx
-	xorl	%edx, %ecx
-	movl	%ecx, -340(%ebp)
-	movl	-308(%ebp), %eax
-	movl	-60(%ebp), %edi
-	movl	-64(%ebp), %edx
-	movl	-68(%ebp), %ecx
-	xorl	%eax, %edi
-	movl	%edi, -348(%ebp)
-	movl	-312(%ebp), %eax
-	movl	-316(%ebp), %edi
-	xorl	%edx, %eax
-	xorl	%ecx, %edi
-	movl	%edi, -324(%ebp)
-	movzbl	%al,%edi
-	movl	%eax, -320(%ebp)
-	shrl	$13, %eax
-	movl	(%esi,%edi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-324(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-324(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-300(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -300(%ebp)
-	movl	-328(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	subl	%ecx, %esi
-	subl	%edx, %edi
-	movl	%esi, -352(%ebp)
-	movl	-320(%ebp), %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%edi, -356(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-324(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-324(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-284(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-288(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,4), %ecx
-	movl	%edx, -332(%ebp)
-	addl	%ecx, %edi
-	shrl	$30, %eax
-	movl	%edi, -336(%ebp)
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-332(%ebp), %ecx
-	setb	%al
-	movl	-340(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-340(%ebp), %eax
-	movl	-348(%ebp), %ecx
-	movl	%edx, -368(%ebp)
-	movl	-64(%ebp), %edx
-	addl	%eax, %edx
-	movl	%edx, -344(%ebp)
-	xorl	%eax, %eax
-	cmpl	%edi, %edx
-	movl	-68(%ebp), %edi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-72(%ebp), %edx
-	addl	%edi, %eax
-	movl	-76(%ebp), %ecx
-	movl	%eax, -380(%ebp)
-	movl	-356(%ebp), %edi
-	movl	-352(%ebp), %eax
-	xorl	%ecx, %edi
-	xorl	%edx, %eax
-	movl	%edi, -364(%ebp)
-	movzbl	%al,%edi
-	movl	%eax, -360(%ebp)
-	shrl	$13, %eax
-	movl	(%esi,%edi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-364(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-364(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-336(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -336(%ebp)
-	movl	-368(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	subl	%ecx, %esi
-	subl	%edx, %edi
-	movl	%esi, -384(%ebp)
-	movl	-360(%ebp), %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%edi, -388(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-364(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-364(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-320(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	setb	%al
-	leal	0(,%edi,4), %ecx
-	addl	%eax, %edx
-	movl	-324(%ebp), %eax
-	movl	%edi, %esi
-	shrl	$30, %esi
-	addl	%ecx, %edi
-	addl	%eax, %edx
-	xorl	%eax, %eax
-	movl	%edx, -372(%ebp)
-	sall	$2, %edx
-	orl	%esi, %edx
-	movl	%edi, -376(%ebp)
-	cmpl	%ecx, %edi
-	movl	-372(%ebp), %esi
-	setb	%al
-	movl	-344(%ebp), %ecx
-	addl	%eax, %edx
-	addl	%esi, %edx
-	movl	-340(%ebp), %eax
-	notl	%ecx
-	movl	%edx, -400(%ebp)
-	movl	-348(%ebp), %edx
-	shrl	$23, %eax
-	movl	-72(%ebp), %edi
-	sall	$9, %edx
-	movl	-380(%ebp), %esi
-	orl	%edx, %eax
-	xorl	%eax, %ecx
-	xorl	%edx, %edx
-	cmpl	%ecx, -72(%ebp)
-	movl	-348(%ebp), %eax
-	notl	%eax
-	setb	%dl
-	subl	%ecx, %edi
-	shrl	$23, %eax
-	movl	%edi, -412(%ebp)
-	movl	-76(%ebp), %ecx
-	xorl	%esi, %eax
-	addl	%edx, %eax
-	movl	-80(%ebp), %edx
-	movl	-84(%ebp), %edi
-	subl	%eax, %ecx
-	movl	-384(%ebp), %eax
-	movl	-388(%ebp), %esi
-	movl	%ecx, -416(%ebp)
-	xorl	%edx, %eax
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%eax, -392(%ebp)
-	xorl	%edi, %esi
-	movzbl	%al,%edi
-	movl	%esi, -396(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%ecx, %esi
-	movl	2048(%eax,%ecx), %edx
-	movl	(%ecx,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-396(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-396(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-376(%ebp), %edi
-	cmpl	%ecx, -376(%ebp)
-	setb	%al
-	addl	%eax, %edx
-	movl	-400(%ebp), %eax
-	subl	%ecx, %edi
-	movl	%edi, -488(%ebp)
-	subl	%edx, %eax
-	movl	%eax, -492(%ebp)
-	movl	-392(%ebp), %ecx
-	movzbl	%ch, %edi
-	movl	%ecx, %eax
-	sall	$3, %edi
-	shrl	$24, %eax
-	movl	%edi, -88(%ebp)
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %ecx
-	movl	-88(%ebp), %edx
-	movl	%esi, %edi
-	movl	%ecx, -1116(%ebp)
-	movl	4100(%eax,%esi), %eax
-	xorl	6144(%edx,%esi), %ecx
-	movl	%eax, %edx
-	movl	-88(%ebp), %eax
-	xorl	6148(%eax,%esi), %edx
-	movl	-396(%ebp), %eax
-	movzbl	%ah, %eax
-	movl	%eax, -1112(%ebp)
-	sall	$3, %eax
-	xorl	2048(%eax,%esi), %ecx
-	xorl	2052(%eax,%esi), %edx
-	movl	-396(%ebp), %eax
-	shrl	$24, %eax
-	xorl	(%esi,%eax,8), %ecx
-	xorl	4(%esi,%eax,8), %edx
-	movl	-360(%ebp), %esi
-	xorl	%eax, %eax
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-364(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	%edx, -404(%ebp)
-	leal	0(,%esi,4), %ecx
-	movl	%esi, %eax
-	shrl	$30, %eax
-	addl	%ecx, %esi
-	sall	$2, %edx
-	movl	%esi, -408(%ebp)
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	setb	%al
-	movl	-412(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-404(%ebp), %eax
-	movl	-416(%ebp), %esi
-	addl	%eax, %edx
-	xorl	%eax, %eax
-	movl	%edx, -504(%ebp)
-	movl	-80(%ebp), %edx
-	xorl	%ecx, %edx
-	movl	%edx, -420(%ebp)
-	movl	-84(%ebp), %ecx
-	xorl	%esi, %ecx
-	movl	%ecx, -428(%ebp)
-	movl	-196(%ebp), %esi
-	addl	%edx, %esi
-	movl	%esi, -424(%ebp)
-	cmpl	%edx, %esi
-	setb	%al
-	addl	%ecx, %eax
-	addl	-200(%ebp), %eax
-	movl	%eax, -432(%ebp)
-	movl	%edx, %eax
-	notl	%eax
-	sall	$19, %eax
-	xorl	%edx, %edx
-	xorl	%esi, %eax
-	cmpl	%eax, -232(%ebp)
-	setb	%dl
-	movl	%edx, -436(%ebp)
-	movl	-232(%ebp), %esi
-	movl	-436(%ebp), %edx
-	subl	%eax, %esi
-	movl	%ecx, %eax
-	movl	-420(%ebp), %ecx
-	movl	%esi, -440(%ebp)
-	movl	-432(%ebp), %esi
-	sall	$19, %eax
-	shrl	$13, %ecx
-	orl	%ecx, %eax
-	notl	%esi
-	xorl	%eax, %esi
-	movl	-240(%ebp), %ecx
-	addl	%edx, %esi
-	movl	-272(%ebp), %edx
-	subl	%esi, %ecx
-	movl	-440(%ebp), %eax
-	movl	%ecx, -444(%ebp)
-	movl	-236(%ebp), %esi
-	xorl	%ecx, %edx
-	movl	%edx, -456(%ebp)
-	movl	-304(%ebp), %edx
-	xorl	%eax, %esi
-	movl	%esi, -448(%ebp)
-	movl	-456(%ebp), %ecx
-	xorl	%eax, %eax
-	addl	%esi, %edx
-	cmpl	%esi, %edx
-	setb	%al
-	movl	%edx, -452(%ebp)
-	addl	%ecx, %eax
-	movl	-308(%ebp), %ecx
-	addl	%ecx, %eax
-	movl	%edx, %ecx
-	notl	%ecx
-	movl	%eax, -460(%ebp)
-	movl	%esi, %eax
-	movl	-456(%ebp), %esi
-	shrl	$23, %eax
-	xorl	%edx, %edx
-	sall	$9, %esi
-	orl	%esi, %eax
-	xorl	%eax, %ecx
-	movl	-340(%ebp), %esi
-	cmpl	%ecx, -340(%ebp)
-	movl	-456(%ebp), %eax
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-460(%ebp), %ecx
-	notl	%eax
-	movl	%esi, -464(%ebp)
-	shrl	$23, %eax
-	xorl	%ecx, %eax
-	movl	-344(%ebp), %ecx
-	addl	%edx, %eax
-	movl	-348(%ebp), %edx
-	xorl	%esi, %ecx
-	movl	-380(%ebp), %esi
-	subl	%eax, %edx
-	movl	%edx, -468(%ebp)
-	movl	%ecx, -472(%ebp)
-	xorl	%edx, %esi
-	movl	-412(%ebp), %edx
-	movl	%esi, -480(%ebp)
-	addl	%ecx, %edx
-	cmpl	%ecx, %edx
-	movl	%edx, -476(%ebp)
-	setb	%cl
-	movzbl	%cl, %eax
-	addl	%esi, %eax
-	movl	-476(%ebp), %edx
-	movl	-416(%ebp), %esi
-	movl	-420(%ebp), %ecx
-	xorl	$-1985229329, %edx
-	addl	%esi, %eax
-	movl	%eax, -484(%ebp)
-	xorl	%eax, %eax
-	cmpl	%edx, -420(%ebp)
-	setb	%al
-	subl	%edx, %ecx
-	movl	%ecx, -524(%ebp)
-	movl	-484(%ebp), %esi
-	movl	-428(%ebp), %ecx
-	movl	-424(%ebp), %edx
-	xorl	$19088743, %esi
-	addl	%eax, %esi
-	subl	%esi, %ecx
-	movl	-432(%ebp), %eax
-	movl	-492(%ebp), %esi
-	movl	%ecx, -528(%ebp)
-	movl	-488(%ebp), %ecx
-	xorl	%eax, %esi
-	movl	%esi, -500(%ebp)
-	xorl	%edx, %ecx
-	movl	-408(%ebp), %esi
-	movl	%ecx, -496(%ebp)
-	movl	%ecx, %eax
-	movzbl	%cl,%edx
-	movl	%edx, -92(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %ecx
-	movl	%ecx, -1120(%ebp)
-	movl	2052(%eax,%edi), %eax
-	xorl	(%edi,%edx,8), %ecx
-	movl	%eax, %edx
-	movl	-92(%ebp), %eax
-	xorl	4(%edi,%eax,8), %edx
-	movzbl	-500(%ebp),%eax
-	sall	$3, %eax
-	xorl	4096(%eax,%edi), %ecx
-	xorl	4100(%eax,%edi), %edx
-	movl	-500(%ebp), %eax
-	shrl	$13, %eax
-	andl	$2040, %eax
-	xorl	6144(%eax,%edi), %ecx
-	xorl	6148(%eax,%edi), %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, -408(%ebp)
-	setb	%al
-	addl	%eax, %edx
-	movl	-504(%ebp), %eax
-	subl	%ecx, %esi
-	movl	%esi, -532(%ebp)
-	subl	%edx, %eax
-	movl	-496(%ebp), %edx
-	movl	%eax, -536(%ebp)
-	movzbl	%dh, %esi
-	movl	%edx, %eax
-	sall	$3, %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	%esi, -96(%ebp)
-	movl	4096(%eax,%edi), %ecx
-	movl	-96(%ebp), %esi
-	movl	%ecx, -1124(%ebp)
-	movl	4100(%eax,%edi), %eax
-	xorl	6144(%esi,%edi), %ecx
-	movl	%eax, %edx
-	movl	-500(%ebp), %eax
-	xorl	6148(%esi,%edi), %edx
-	movzbl	%ah, %eax
-	movl	%eax, -1112(%ebp)
-	sall	$3, %eax
-	movl	-392(%ebp), %esi
-	xorl	2048(%eax,%edi), %ecx
-	xorl	2052(%eax,%edi), %edx
-	movl	-500(%ebp), %eax
-	shrl	$24, %eax
-	xorl	(%edi,%eax,8), %ecx
-	xorl	4(%edi,%eax,8), %edx
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	%esi, -508(%ebp)
-	setb	%al
-	movl	-396(%ebp), %ecx
-	movzbl	%al, %esi
-	addl	%esi, %edx
-	movl	-508(%ebp), %eax
-	addl	%ecx, %edx
-	movl	-508(%ebp), %esi
-	movl	%edx, -512(%ebp)
-	movl	-512(%ebp), %ecx
-	shrl	$29, %eax
-	movl	-508(%ebp), %edx
-	sall	$3, %ecx
-	sall	$3, %edx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	-508(%ebp), %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	%edx, -516(%ebp)
-	movl	-512(%ebp), %esi
-	movl	-524(%ebp), %edx
-	addl	%esi, %eax
-	xorl	$-1515870811, %edx
-	subl	%eax, %ecx
-	movl	%ecx, -520(%ebp)
-	xorl	%eax, %eax
-	cmpl	%edx, -424(%ebp)
-	movl	-424(%ebp), %ecx
-	movl	-528(%ebp), %esi
-	setb	%al
-	subl	%edx, %ecx
-	xorl	$-1515870811, %esi
-	movl	%ecx, -564(%ebp)
-	movl	-432(%ebp), %ecx
-	addl	%eax, %esi
-	movl	-440(%ebp), %edx
-	movl	-444(%ebp), %eax
-	subl	%esi, %ecx
-	movl	%ecx, -568(%ebp)
-	movl	-532(%ebp), %ecx
-	movl	-536(%ebp), %esi
-	xorl	%edx, %ecx
-	xorl	%eax, %esi
-	movl	%ecx, %eax
-	movl	%esi, -544(%ebp)
-	movzbl	%cl,%edx
-	shrl	$13, %eax
-	movl	%edx, -100(%ebp)
-	andl	$2040, %eax
-	movl	-516(%ebp), %esi
-	movl	%ecx, -540(%ebp)
-	movl	2048(%eax,%edi), %ecx
-	movl	%ecx, -1128(%ebp)
-	movl	2052(%eax,%edi), %eax
-	xorl	(%edi,%edx,8), %ecx
-	movl	%eax, %edx
-	movl	-100(%ebp), %eax
-	xorl	4(%edi,%eax,8), %edx
-	movzbl	-544(%ebp),%eax
-	sall	$3, %eax
-	xorl	4096(%eax,%edi), %ecx
-	xorl	4100(%eax,%edi), %edx
-	movl	-544(%ebp), %eax
-	shrl	$13, %eax
-	andl	$2040, %eax
-	xorl	6144(%eax,%edi), %ecx
-	xorl	6148(%eax,%edi), %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, -516(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -572(%ebp)
-	addl	%eax, %edx
-	movl	-520(%ebp), %eax
-	subl	%edx, %eax
-	movl	-540(%ebp), %edx
-	movl	%eax, -576(%ebp)
-	movzbl	%dh, %esi
-	movl	%edx, %eax
-	sall	$3, %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	%esi, -104(%ebp)
-	movl	4096(%eax,%edi), %ecx
-	movl	-104(%ebp), %esi
-	movl	%ecx, -1132(%ebp)
-	movl	4100(%eax,%edi), %eax
-	xorl	6144(%esi,%edi), %ecx
-	movl	%eax, %edx
-	movl	-544(%ebp), %eax
-	xorl	6148(%esi,%edi), %edx
-	movzbl	%ah, %eax
-	movl	%eax, -1112(%ebp)
-	sall	$3, %eax
-	xorl	2048(%eax,%edi), %ecx
-	xorl	2052(%eax,%edi), %edx
-	movl	-544(%ebp), %eax
-	shrl	$24, %eax
-	xorl	(%edi,%eax,8), %ecx
-	xorl	4(%edi,%eax,8), %edx
-	movl	-496(%ebp), %eax
-	addl	%ecx, %eax
-	movl	%eax, -548(%ebp)
-	cmpl	%ecx, %eax
-	setb	%cl
-	movzbl	%cl, %eax
-	movl	-500(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-548(%ebp), %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -552(%ebp)
-	movl	-552(%ebp), %ecx
-	movl	-548(%ebp), %edx
-	sall	$3, %ecx
-	sall	$3, %edx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	-548(%ebp), %edx
-	setb	%al
-	subl	-548(%ebp), %edx
-	movl	%edx, -556(%ebp)
-	movl	-552(%ebp), %edx
-	addl	%edx, %eax
-	subl	%eax, %ecx
-	movl	-440(%ebp), %edx
-	movl	-568(%ebp), %eax
-	movl	%ecx, -560(%ebp)
-	movl	-564(%ebp), %ecx
-	xorl	%ecx, %edx
-	movl	%edx, -604(%ebp)
-	movl	-444(%ebp), %ecx
-	xorl	%eax, %ecx
-	movl	%ecx, -612(%ebp)
-	movl	-448(%ebp), %edx
-	movl	-572(%ebp), %eax
-	movl	-456(%ebp), %ecx
-	xorl	%edx, %eax
-	movl	-576(%ebp), %edx
-	movl	%eax, -580(%ebp)
-	xorl	%ecx, %edx
-	movzbl	%al,%ecx
-	movl	%edx, -584(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%ecx, -108(%ebp)
-	movl	2048(%eax,%edi), %esi
-	movl	-108(%ebp), %edx
-	movl	2052(%eax,%edi), %eax
-	movl	%esi, %ecx
-	movl	-556(%ebp), %esi
-	xorl	(%edi,%edx,8), %ecx
-	movl	%eax, %edx
-	movl	-108(%ebp), %eax
-	xorl	4(%edi,%eax,8), %edx
-	movzbl	-584(%ebp),%eax
-	sall	$3, %eax
-	xorl	4096(%eax,%edi), %ecx
-	xorl	4100(%eax,%edi), %edx
-	movl	-584(%ebp), %eax
-	shrl	$13, %eax
-	andl	$2040, %eax
-	xorl	6144(%eax,%edi), %ecx
-	xorl	6148(%eax,%edi), %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, -556(%ebp)
-	setb	%al
-	addl	%eax, %edx
-	movl	-560(%ebp), %eax
-	subl	%ecx, %esi
-	movl	%esi, -616(%ebp)
-	subl	%edx, %eax
-	movl	-580(%ebp), %edx
-	movl	%eax, -620(%ebp)
-	movzbl	%dh, %esi
-	movl	%edx, %eax
-	sall	$3, %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	%esi, -112(%ebp)
-	movl	4096(%eax,%edi), %ecx
-	movl	-112(%ebp), %esi
-	movl	%ecx, -1140(%ebp)
-	movl	4100(%eax,%edi), %eax
-	xorl	6144(%esi,%edi), %ecx
-	movl	%eax, %edx
-	movl	-584(%ebp), %eax
-	xorl	6148(%esi,%edi), %edx
-	movzbl	%ah, %eax
-	movl	%eax, -1112(%ebp)
-	sall	$3, %eax
-	xorl	2048(%eax,%edi), %ecx
-	xorl	2052(%eax,%edi), %edx
-	movl	-584(%ebp), %eax
-	shrl	$24, %eax
-	xorl	(%edi,%eax,8), %ecx
-	xorl	4(%edi,%eax,8), %edx
-	movl	-540(%ebp), %eax
-	addl	%ecx, %eax
-	movl	%eax, -588(%ebp)
-	cmpl	%ecx, %eax
-	setb	%cl
-	movzbl	%cl, %eax
-	movl	-544(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-588(%ebp), %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -592(%ebp)
-	movl	-592(%ebp), %ecx
-	movl	-588(%ebp), %edx
-	sall	$3, %ecx
-	sall	$3, %edx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	-588(%ebp), %edx
-	setb	%al
-	subl	-588(%ebp), %edx
-	movl	%edx, -596(%ebp)
-	movl	-592(%ebp), %edx
-	addl	%edx, %eax
-	subl	%eax, %ecx
-	movl	-448(%ebp), %edx
-	movl	-604(%ebp), %eax
-	movl	%ecx, -600(%ebp)
-	movl	-604(%ebp), %ecx
-	addl	%eax, %edx
-	movl	%edx, -608(%ebp)
-	xorl	%eax, %eax
-	cmpl	%ecx, %edx
-	movl	-612(%ebp), %edx
-	setb	%al
-	movl	-456(%ebp), %ecx
-	addl	%edx, %eax
-	addl	%ecx, %eax
-	movl	-452(%ebp), %edx
-	movl	%eax, -644(%ebp)
-	movl	-616(%ebp), %eax
-	movl	-460(%ebp), %ecx
-	xorl	%edx, %eax
-	movl	-620(%ebp), %edx
-	movl	%eax, -624(%ebp)
-	xorl	%ecx, %edx
-	movzbl	%al,%ecx
-	movl	%edx, -628(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%ecx, -116(%ebp)
-	movl	2048(%eax,%edi), %esi
-	movl	-116(%ebp), %edx
-	movl	2052(%eax,%edi), %eax
-	movl	%esi, %ecx
-	movl	-596(%ebp), %esi
-	xorl	(%edi,%edx,8), %ecx
-	movl	%eax, %edx
-	movl	-116(%ebp), %eax
-	xorl	4(%edi,%eax,8), %edx
-	movzbl	-628(%ebp),%eax
-	sall	$3, %eax
-	xorl	4096(%eax,%edi), %ecx
-	xorl	4100(%eax,%edi), %edx
-	movl	-628(%ebp), %eax
-	shrl	$13, %eax
-	andl	$2040, %eax
-	xorl	6144(%eax,%edi), %ecx
-	xorl	6148(%eax,%edi), %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, -596(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -652(%ebp)
-	addl	%eax, %edx
-	movl	-600(%ebp), %eax
-	subl	%edx, %eax
-	movl	-624(%ebp), %edx
-	movl	%eax, -656(%ebp)
-	movzbl	%dh, %esi
-	movl	%edx, %eax
-	sall	$3, %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	%esi, -120(%ebp)
-	movl	4096(%eax,%edi), %ecx
-	movl	-120(%ebp), %esi
-	movl	%ecx, -1148(%ebp)
-	movl	4100(%eax,%edi), %eax
-	xorl	6144(%esi,%edi), %ecx
-	movl	%eax, %edx
-	movl	-628(%ebp), %eax
-	xorl	6148(%esi,%edi), %edx
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-628(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-580(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-584(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	%edx, -632(%ebp)
-	movl	%esi, %eax
-	movl	-632(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	shrl	$29, %eax
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-632(%ebp), %esi
-	movl	%edx, -636(%ebp)
-	xorl	%edx, %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-604(%ebp), %eax
-	movl	-452(%ebp), %esi
-	movl	%ecx, -640(%ebp)
-	movl	-608(%ebp), %ecx
-	notl	%eax
-	sall	$19, %eax
-	xorl	%ecx, %eax
-	movl	-604(%ebp), %ecx
-	cmpl	%eax, -452(%ebp)
-	setb	%dl
-	subl	%eax, %esi
-	movl	%esi, -680(%ebp)
-	movl	-612(%ebp), %eax
-	shrl	$13, %ecx
-	movl	%edx, -648(%ebp)
-	movl	-644(%ebp), %esi
-	movl	-648(%ebp), %edx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%esi
-	xorl	%eax, %esi
-	movl	-460(%ebp), %eax
-	addl	%edx, %esi
-	subl	%esi, %eax
-	movl	%eax, -684(%ebp)
-	movl	-464(%ebp), %ecx
-	movl	-652(%ebp), %eax
-	movl	-468(%ebp), %edx
-	movl	-656(%ebp), %esi
-	xorl	%ecx, %eax
-	movl	%eax, -660(%ebp)
-	movzbl	%al,%ecx
-	xorl	%edx, %esi
-	movl	%esi, -664(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%ecx, -124(%ebp)
-	movl	%ecx, %esi
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%ecx,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-664(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-664(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-636(%ebp), %esi
-	cmpl	%ecx, -636(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -688(%ebp)
-	movl	-660(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-640(%ebp), %eax
-	movzbl	%ch, %esi
-	sall	$3, %esi
-	movl	%esi, -128(%ebp)
-	subl	%edx, %eax
-	movl	-128(%ebp), %esi
-	movl	%eax, -692(%ebp)
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6144(%esi,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-664(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-664(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-624(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-628(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -668(%ebp)
-	movl	-668(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	%edx, -672(%ebp)
-	movl	-668(%ebp), %esi
-	movl	-464(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-468(%ebp), %esi
-	movl	%ecx, -676(%ebp)
-	movl	-684(%ebp), %eax
-	movl	-680(%ebp), %ecx
-	xorl	%eax, %esi
-	xorl	%ecx, %edx
-	movl	-688(%ebp), %eax
-	movl	%edx, -716(%ebp)
-	movl	-472(%ebp), %ecx
-	movl	-480(%ebp), %edx
-	movl	%esi, -724(%ebp)
-	movl	-692(%ebp), %esi
-	xorl	%ecx, %eax
-	movl	%eax, -696(%ebp)
-	movzbl	%al,%ecx
-	shrl	$13, %eax
-	movl	%ecx, -132(%ebp)
-	xorl	%edx, %esi
-	andl	$2040, %eax
-	movl	%esi, -700(%ebp)
-	movl	2048(%eax,%edi), %edx
-	movl	%ecx, %esi
-	movl	(%edi,%ecx,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-700(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-700(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-672(%ebp), %esi
-	cmpl	%ecx, -672(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -728(%ebp)
-	movl	-696(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-676(%ebp), %eax
-	movzbl	%ch, %esi
-	subl	%edx, %eax
-	movl	%eax, -732(%ebp)
-	sall	$3, %esi
-	movl	%ecx, %eax
-	movl	%esi, -136(%ebp)
-	movl	-136(%ebp), %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	6144(%esi,%edi), %ecx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-700(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-700(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-660(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-664(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -704(%ebp)
-	movl	-704(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	%edx, -708(%ebp)
-	movl	-704(%ebp), %esi
-	movl	-472(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-716(%ebp), %eax
-	movl	%ecx, -712(%ebp)
-	movl	-716(%ebp), %ecx
-	movl	-480(%ebp), %esi
-	addl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edx
-	movl	%edx, -720(%ebp)
-	movl	-724(%ebp), %edx
-	setb	%al
-	movl	-476(%ebp), %ecx
-	addl	%edx, %eax
-	addl	%esi, %eax
-	movl	%eax, -756(%ebp)
-	movl	-728(%ebp), %eax
-	movl	-484(%ebp), %edx
-	movl	-732(%ebp), %esi
-	xorl	%ecx, %eax
-	movzbl	%al,%ecx
-	movl	%eax, -736(%ebp)
-	xorl	%edx, %esi
-	shrl	$13, %eax
-	movl	%esi, -740(%ebp)
-	andl	$2040, %eax
-	movl	%ecx, %esi
-	movl	%ecx, -140(%ebp)
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%ecx,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-740(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-740(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-708(%ebp), %esi
-	cmpl	%ecx, -708(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -760(%ebp)
-	movl	-736(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-712(%ebp), %eax
-	movzbl	%ch, %esi
-	sall	$3, %esi
-	movl	%esi, -144(%ebp)
-	subl	%edx, %eax
-	movl	-144(%ebp), %esi
-	movl	%eax, -764(%ebp)
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6144(%esi,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-740(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	%edi, %esi
-	movl	2048(%eax,%edi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-740(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-696(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-700(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -744(%ebp)
-	shrl	$29, %eax
-	movl	-744(%ebp), %ecx
-	leal	0(,%edi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%edi, %edx
-	setb	%al
-	subl	%edi, %edx
-	movl	-744(%ebp), %edi
-	movl	%edx, -748(%ebp)
-	movl	-724(%ebp), %edx
-	addl	%edi, %eax
-	subl	%eax, %ecx
-	movl	-716(%ebp), %eax
-	sall	$9, %edx
-	movl	%ecx, -752(%ebp)
-	movl	-720(%ebp), %ecx
-	shrl	$23, %eax
-	orl	%edx, %eax
-	movl	-476(%ebp), %edi
-	notl	%ecx
-	xorl	%eax, %ecx
-	xorl	%eax, %eax
-	movl	-756(%ebp), %edx
-	cmpl	%ecx, -476(%ebp)
-	setb	%al
-	subl	%ecx, %edi
-	movl	%edi, -788(%ebp)
-	movl	-724(%ebp), %edi
-	movl	-484(%ebp), %ecx
-	notl	%edi
-	shrl	$23, %edi
-	xorl	%edx, %edi
-	addl	%eax, %edi
-	movl	-524(%ebp), %edx
-	subl	%edi, %ecx
-	movl	%ecx, -792(%ebp)
-	movl	-760(%ebp), %ecx
-	xorl	%edx, %ecx
-	movl	%ecx, -768(%ebp)
-	movl	-528(%ebp), %eax
-	movl	-764(%ebp), %edi
-	xorl	%eax, %edi
-	movl	%ecx, %eax
-	shrl	$13, %eax
-	movl	%edi, -772(%ebp)
-	andl	$2040, %eax
-	movzbl	%cl,%edi
-	movl	2048(%eax,%esi), %edx
-	movl	(%esi,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-772(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-772(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-748(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -748(%ebp)
-	movl	-752(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	subl	%ecx, %esi
-	subl	%edx, %edi
-	movl	%esi, -860(%ebp)
-	movl	-768(%ebp), %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	movl	%edi, -864(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-772(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-772(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	movl	-740(%ebp), %esi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-736(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	setb	%al
-	leal	0(,%edi,8), %ecx
-	addl	%eax, %edx
-	addl	%esi, %edx
-	movl	%edi, %eax
-	movl	%edx, -776(%ebp)
-	shrl	$29, %eax
-	movl	-776(%ebp), %esi
-	sall	$3, %esi
-	orl	%eax, %esi
-	xorl	%eax, %eax
-	cmpl	%edi, %ecx
-	setb	%al
-	subl	%edi, %ecx
-	movl	%ecx, -780(%ebp)
-	movl	-776(%ebp), %edx
-	movl	-788(%ebp), %ecx
-	movl	-568(%ebp), %edi
-	addl	%edx, %eax
-	movl	-524(%ebp), %edx
-	subl	%eax, %esi
-	xorl	%eax, %eax
-	xorl	%ecx, %edx
-	movl	%esi, -784(%ebp)
-	movl	-528(%ebp), %ecx
-	movl	-792(%ebp), %esi
-	movl	%edx, -796(%ebp)
-	xorl	%esi, %ecx
-	movl	-564(%ebp), %esi
-	movl	%ecx, -804(%ebp)
-	addl	%edx, %esi
-	cmpl	%edx, %esi
-	movl	%esi, -800(%ebp)
-	setb	%al
-	addl	%ecx, %eax
-	addl	%edi, %eax
-	movl	%eax, -808(%ebp)
-	movl	%edx, %eax
-	notl	%eax
-	sall	$19, %eax
-	xorl	%esi, %eax
-	movl	-604(%ebp), %esi
-	cmpl	%eax, -604(%ebp)
-	setb	%dl
-	movzbl	%dl, %edi
-	subl	%eax, %esi
-	movl	%ecx, %edx
-	movl	-796(%ebp), %ecx
-	movl	%esi, -812(%ebp)
-	movl	-808(%ebp), %esi
-	sall	$19, %edx
-	movl	-612(%ebp), %eax
-	shrl	$13, %ecx
-	orl	%ecx, %edx
-	notl	%esi
-	movl	-680(%ebp), %ecx
-	xorl	%edx, %esi
-	addl	%edi, %esi
-	movl	-812(%ebp), %edi
-	subl	%esi, %eax
-	movl	%eax, -816(%ebp)
-	movl	-608(%ebp), %esi
-	movl	-684(%ebp), %edx
-	xorl	%edi, %esi
-	movl	-644(%ebp), %edi
-	addl	%esi, %ecx
-	movl	%ecx, -824(%ebp)
-	movl	%esi, -820(%ebp)
-	xorl	%eax, %edi
-	cmpl	%esi, %ecx
-	movl	%edi, -828(%ebp)
-	setb	%al
-	movzbl	%al, %ecx
-	addl	%edi, %ecx
-	movl	%esi, %eax
-	addl	%edx, %ecx
-	movl	%ecx, -832(%ebp)
-	movl	-824(%ebp), %ecx
-	movl	%edi, %esi
-	sall	$9, %esi
-	xorl	%edx, %edx
-	shrl	$23, %eax
-	orl	%esi, %eax
-	notl	%ecx
-	xorl	%eax, %ecx
-	cmpl	%ecx, -716(%ebp)
-	movl	%edi, %eax
-	movl	-716(%ebp), %esi
-	notl	%eax
-	movl	-724(%ebp), %edi
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-832(%ebp), %ecx
-	shrl	$23, %eax
-	movl	%esi, -836(%ebp)
-	xorl	%ecx, %eax
-	addl	%edx, %eax
-	subl	%eax, %edi
-	movl	%edi, -840(%ebp)
-	movl	-720(%ebp), %edx
-	movl	-788(%ebp), %ecx
-	xorl	%esi, %edx
-	movl	-756(%ebp), %esi
-	addl	%edx, %ecx
-	movl	%edx, -844(%ebp)
-	movl	%ecx, -848(%ebp)
-	xorl	%edi, %esi
-	cmpl	%edx, %ecx
-	movl	%esi, -852(%ebp)
-	setb	%al
-	movl	-792(%ebp), %edx
-	movzbl	%al, %eax
-	movl	%ecx, %edi
-	addl	%esi, %eax
-	addl	%edx, %eax
-	xorl	$-1985229329, %edi
-	movl	-796(%ebp), %esi
-	movl	%eax, -856(%ebp)
-	xorl	%ecx, %ecx
-	cmpl	%edi, -796(%ebp)
-	movl	-856(%ebp), %eax
-	movl	-800(%ebp), %edx
-	setb	%cl
-	xorl	$19088743, %eax
-	subl	%edi, %esi
-	movl	%esi, -884(%ebp)
-	addl	%ecx, %eax
-	movl	-804(%ebp), %ecx
-	movl	-808(%ebp), %edi
-	movl	-864(%ebp), %esi
-	subl	%eax, %ecx
-	movl	%ecx, -888(%ebp)
-	movl	-860(%ebp), %eax
-	movl	tiger_table@GOT(%ebx), %ecx
-	xorl	%edi, %esi
-	xorl	%edx, %eax
-	movzbl	%al,%edi
-	movl	%eax, -868(%ebp)
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	%esi, -872(%ebp)
-	movl	2048(%eax,%ecx), %edx
-	movl	%ecx, %esi
-	movl	(%ecx,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-872(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-872(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-780(%ebp), %edi
-	cmpl	%ecx, -780(%ebp)
-	setb	%al
-	subl	%ecx, %edi
-	movl	%edi, -892(%ebp)
-	movl	-868(%ebp), %ecx
-	movl	-784(%ebp), %edi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %edi
-	movl	%edi, -896(%ebp)
-	leal	0(,%eax,8), %edi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%edi,%esi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-872(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-872(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-768(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-772(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -876(%ebp)
-	leal	0(,%edi,8), %ecx
-	addl	%ecx, %edi
-	movl	%edi, -880(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-876(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	-812(%ebp), %eax
-	addl	%ecx, %edx
-	movl	-816(%ebp), %edi
-	movl	%edx, -908(%ebp)
-	movl	-892(%ebp), %edx
-	movl	-896(%ebp), %ecx
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%edi, %ecx
-	movl	%ecx, -904(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	movl	%edx, -900(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%esi), %edx
-	movl	(%esi,%edi,8), %ecx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-904(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-904(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-880(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -880(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -920(%ebp)
-	movl	-908(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-900(%ebp), %edx
-	movl	%edi, -924(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-904(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-904(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-868(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-872(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,8), %ecx
-	movl	%edx, -912(%ebp)
-	addl	%ecx, %edi
-	shrl	$29, %eax
-	movl	%edi, -916(%ebp)
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-912(%ebp), %ecx
-	setb	%al
-	movl	-828(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-820(%ebp), %eax
-	movl	-924(%ebp), %ecx
-	movl	%edx, -936(%ebp)
-	movl	-920(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -932(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -928(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-932(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-932(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-916(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -916(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -948(%ebp)
-	movl	-936(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-928(%ebp), %edx
-	movl	%edi, -952(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-932(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-932(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-900(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-904(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,8), %ecx
-	movl	%edx, -940(%ebp)
-	addl	%ecx, %edi
-	shrl	$29, %eax
-	movl	%edi, -944(%ebp)
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-940(%ebp), %ecx
-	setb	%al
-	movl	-832(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-824(%ebp), %eax
-	movl	-952(%ebp), %ecx
-	movl	%edx, -964(%ebp)
-	movl	-948(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -960(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -956(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-960(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-960(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-944(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -944(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -976(%ebp)
-	movl	-964(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-956(%ebp), %edx
-	movl	%edi, -980(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-960(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-960(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-928(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-932(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,8), %ecx
-	movl	%edx, -968(%ebp)
-	addl	%ecx, %edi
-	shrl	$29, %eax
-	movl	%edi, -972(%ebp)
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-968(%ebp), %ecx
-	setb	%al
-	movl	-840(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-836(%ebp), %eax
-	movl	-980(%ebp), %ecx
-	movl	%edx, -992(%ebp)
-	movl	-976(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -988(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -984(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-988(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-988(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-972(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -972(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -1004(%ebp)
-	movl	-992(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-984(%ebp), %edx
-	movl	%edi, -1008(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-988(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-988(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-956(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-960(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,8), %ecx
-	movl	%edx, -996(%ebp)
-	addl	%ecx, %edi
-	shrl	$29, %eax
-	movl	%edi, -1000(%ebp)
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-996(%ebp), %ecx
-	setb	%al
-	movl	-852(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-844(%ebp), %eax
-	movl	-1008(%ebp), %ecx
-	movl	%edx, -1020(%ebp)
-	movl	-1004(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -1016(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -1012(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-1016(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-1016(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-1000(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -1000(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -1032(%ebp)
-	movl	-1020(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-1012(%ebp), %edx
-	movl	%edi, -1036(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-1016(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-1016(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	movl	%esi, -148(%ebp)
-	xorl	%edi, %edx
-	movl	-984(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-988(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	%edx, -1024(%ebp)
-	leal	0(,%edi,8), %ecx
-	movl	%edi, %eax
-	shrl	$29, %eax
-	addl	%ecx, %edi
-	sall	$3, %edx
-	movl	%edi, -1028(%ebp)
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-1024(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	-848(%ebp), %eax
-	movl	-856(%ebp), %edi
-	addl	%ecx, %edx
-	movl	-1036(%ebp), %ecx
-	movl	%edx, -1048(%ebp)
-	movl	-1032(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -1044(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -1040(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-1044(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-1044(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-1028(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -1028(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -1060(%ebp)
-	movl	-1048(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-1040(%ebp), %edx
-	movl	%edi, -1064(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-1044(%ebp), %eax
-	movzbl	%ah, %edi
-	leal	0(,%edi,8), %eax
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-1044(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	movl	-1012(%ebp), %edi
-	addl	%ecx, %edi
-	cmpl	%ecx, %edi
-	movl	-1016(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%edi, %eax
-	addl	%ecx, %edx
-	leal	0(,%edi,8), %ecx
-	movl	%edx, -1052(%ebp)
-	addl	%ecx, %edi
-	shrl	$29, %eax
-	movl	%edi, -1056(%ebp)
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %edi
-	movl	-1052(%ebp), %ecx
-	setb	%al
-	movl	-888(%ebp), %edi
-	addl	%eax, %edx
-	addl	%ecx, %edx
-	movl	-884(%ebp), %eax
-	movl	-1064(%ebp), %ecx
-	movl	%edx, -1076(%ebp)
-	movl	-1060(%ebp), %edx
-	xorl	%edi, %ecx
-	movl	%ecx, -1072(%ebp)
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	movl	%edx, -1068(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%edi
-	andl	$2040, %eax
-	movl	(%esi,%edi,8), %ecx
-	movl	2048(%eax,%esi), %edx
-	movl	2052(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	4(%esi,%edi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-1072(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	4100(%eax,%esi), %edi
-	movl	-1072(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	6148(%eax,%esi), %edi
-	xorl	%eax, %eax
-	movl	-1056(%ebp), %esi
-	xorl	%edi, %edx
-	cmpl	%ecx, -1056(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -1080(%ebp)
-	movl	-1076(%ebp), %edi
-	addl	%eax, %edx
-	movl	tiger_table@GOT(%ebx), %ecx
-	subl	%edx, %edi
-	movl	-1068(%ebp), %edx
-	movl	%edi, -1084(%ebp)
-	movl	%edx, %eax
-	movzbl	%dh, %esi
-	shrl	$24, %eax
-	leal	0(,%esi,8), %edi
-	movl	%ecx, %esi
-	sall	$3, %eax
-	movl	4096(%eax,%ecx), %edx
-	movl	6144(%edi,%ecx), %ecx
-	movl	4100(%eax,%esi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%edi,%esi), %edx
-	xorl	%eax, %edx
-	movl	-1072(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	-148(%ebp), %esi
-	movl	2048(%eax,%esi), %edi
-	xorl	%edi, %ecx
-	movl	2052(%eax,%esi), %edi
-	movl	-1072(%ebp), %eax
-	xorl	%edi, %edx
-	shrl	$24, %eax
-	movl	(%esi,%eax,8), %edi
-	xorl	%edi, %ecx
-	movl	4(%esi,%eax,8), %edi
-	movl	-1040(%ebp), %esi
-	xorl	%eax, %eax
-	xorl	%edi, %edx
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-1044(%ebp), %edi
-	setb	%al
-	addl	%eax, %edx
-	leal	0(,%esi,8), %ecx
-	addl	%edx, %edi
-	movl	%esi, %eax
-	leal	0(,%edi,8), %edx
-	addl	%ecx, %esi
-	shrl	$29, %eax
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	setb	%al
-	addl	%eax, %edx
-	leal	(%edi,%edx), %ecx
-	movl	-1088(%ebp), %edi
-	movl	-1092(%ebp), %edx
-	xorl	%esi, %edi
-	movl	-16(%ebp), %esi
-	xorl	%edx, %ecx
-	cmpl	%esi, -1068(%ebp)
-	movl	%ecx, -1108(%ebp)
-	movl	-16(%ebp), %edx
-	movl	-1068(%ebp), %esi
-	movl	-1100(%ebp), %ecx
-	setb	%al
-	subl	%edx, %esi
-	movl	-1072(%ebp), %edx
-	movzbl	%al, %eax
-	addl	%ecx, %eax
-	movl	-1080(%ebp), %ecx
-	subl	%eax, %edx
-	movl	-20(%ebp), %eax
-	addl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	-20(%ebp), %ecx
-	setb	%al
-	addl	-1104(%ebp), %eax
-	addl	-1084(%ebp), %eax
-	movl	%eax, -1152(%ebp)
-	movl	12(%ebp), %eax
-	movl	%edi, (%eax)
-	movl	-1108(%ebp), %edi
-	movl	%esi, 8(%eax)
-	movl	%edx, 12(%eax)
-	movl	%edi, 4(%eax)
-	movl	%ecx, 16(%eax)
-	movl	-1152(%ebp), %edx
-	movl	%edx, 20(%eax)
-	addl	$1140, %esp
-	popl	%ebx
-	popl	%esi
-	popl	%edi
-	popl	%ebp
-	ret
-	.size	tiger_compress, .-tiger_compress
-.globl tiger_t
-	.type	tiger_t, @function
-tiger_t:
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%edi
-	pushl	%esi
-	pushl	%ebx
-	subl	$1032, %esp
-	movl	12(%ebp), %eax
-	call	__i686.get_pc_thunk.bx
-	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
-	movl	%eax, -16(%ebp)
-	cmpl	$63, %eax
-	jbe	.L8
-	movl	tiger_table@GOT(%ebx), %edi
-.L6:
-	movl	16(%ebp), %esi
-	movl	16(%ebp), %edx
-	movl	(%esi), %ecx
-	movl	16(%ebp), %esi
-	movl	%ecx, -948(%ebp)
-	movl	4(%edx), %eax
-	movl	16(%ebp), %edx
-	movl	%eax, -952(%ebp)
-	movl	8(%esi), %ecx
-	movl	16(%ebp), %esi
-	movl	%ecx, -956(%ebp)
-	movl	12(%edx), %eax
-	movl	-956(%ebp), %edx
-	movl	%eax, -960(%ebp)
-	movl	16(%esi), %eax
-	movl	20(%esi), %ecx
-	movl	%edx, -20(%ebp)
-	movl	8(%ebp), %esi
-	movl	8(%ebp), %edx
-	movl	%eax, -24(%ebp)
-	movl	%ecx, -964(%ebp)
-	movl	(%esi), %ecx
-	movl	%ecx, -968(%ebp)
-	movl	4(%edx), %esi
-	movl	8(%ebp), %ecx
-	movl	%esi, -972(%ebp)
-	movl	8(%ecx), %edx
-	movl	8(%ebp), %esi
-	movl	%edx, -976(%ebp)
-	movl	12(%esi), %ecx
-	movl	8(%ebp), %edx
-	movl	%ecx, -980(%ebp)
-	movl	16(%edx), %esi
-	movl	%esi, -984(%ebp)
-	movl	8(%ebp), %ecx
-	movl	8(%ebp), %esi
-	movl	20(%ecx), %edx
-	movl	%edx, -988(%ebp)
-	movl	24(%esi), %ecx
-	movl	8(%ebp), %edx
-	movl	%ecx, -992(%ebp)
-	movl	28(%edx), %esi
-	movl	8(%ebp), %ecx
-	movl	%esi, -996(%ebp)
-	movl	32(%ecx), %edx
-	movl	8(%ebp), %esi
-	movl	%edx, -1000(%ebp)
-	movl	36(%esi), %ecx
-	movl	8(%ebp), %edx
-	movl	%ecx, -1004(%ebp)
-	movl	40(%edx), %esi
-	movl	8(%ebp), %ecx
-	movl	%esi, -1008(%ebp)
-	movl	44(%ecx), %edx
-	movl	8(%ebp), %esi
-	movl	%edx, -1012(%ebp)
-	movl	48(%esi), %ecx
-	movl	8(%ebp), %edx
-	movl	%ecx, -1016(%ebp)
-	movl	52(%edx), %esi
-	movl	8(%ebp), %ecx
-	movl	%esi, -1020(%ebp)
-	movl	56(%ecx), %edx
-	movl	8(%ebp), %esi
-	movl	%edx, -1024(%ebp)
-	movl	-968(%ebp), %edx
-	movl	60(%esi), %ecx
-	xorl	%edx, %eax
-	movl	%ecx, -1028(%ebp)
-	movl	%eax, -28(%ebp)
-	movl	-972(%ebp), %esi
-	movl	-964(%ebp), %ecx
-	movl	-28(%ebp), %eax
-	xorl	%esi, %ecx
-	shrl	$13, %eax
-	movzbl	-28(%ebp),%esi
-	movl	%ecx, -32(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	movl	(%edi,%esi,8), %ecx
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-32(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-32(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-948(%ebp), %esi
-	cmpl	%ecx, -948(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -44(%ebp)
-	movl	-952(%ebp), %ecx
-	addl	%eax, %edx
-	subl	%edx, %ecx
-	movl	-28(%ebp), %edx
-	movl	%ecx, -48(%ebp)
-	movzbl	%dh, %eax
-	leal	0(,%eax,8), %ecx
-	movl	%edx, %eax
-	movl	6144(%ecx,%edi), %esi
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6148(%ecx,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	xorl	%esi, %edx
-	movl	4100(%eax,%edi), %esi
-	movl	-32(%ebp), %eax
-	xorl	%esi, %ecx
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %edx
-	movl	2052(%eax,%edi), %esi
-	movl	-32(%ebp), %eax
-	xorl	%esi, %ecx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %edx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %ecx
-	movl	-956(%ebp), %esi
-	addl	%edx, %esi
-	cmpl	%edx, %esi
-	movl	-960(%ebp), %edx
-	setb	%al
-	leal	(%ecx,%eax), %eax
-	addl	%edx, %eax
-	movl	%eax, -36(%ebp)
-	leal	0(,%esi,4), %ecx
-	movl	%eax, %edx
-	movl	%esi, %eax
-	sall	$2, %edx
-	addl	%ecx, %esi
-	movl	%esi, -40(%ebp)
-	shrl	$30, %eax
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-36(%ebp), %eax
-	xorl	%ecx, %ecx
-	movl	-968(%ebp), %esi
-	addl	%eax, %edx
-	movl	-1028(%ebp), %eax
-	movl	%edx, -60(%ebp)
-	movl	-1024(%ebp), %edx
-	xorl	$-1515870811, %edx
-	cmpl	%edx, -968(%ebp)
-	setb	%cl
-	subl	%edx, %esi
-	movl	%esi, -72(%ebp)
-	movl	-972(%ebp), %esi
-	xorl	$-1515870811, %eax
-	addl	%ecx, %eax
-	movl	-976(%ebp), %edx
-	movl	-980(%ebp), %ecx
-	subl	%eax, %esi
-	movl	-44(%ebp), %eax
-	movl	%esi, -76(%ebp)
-	movl	-48(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -52(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -56(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-56(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-56(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-40(%ebp), %esi
-	cmpl	%ecx, -40(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -80(%ebp)
-	movl	-52(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-60(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -84(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-56(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-56(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-28(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-32(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -64(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -68(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-64(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-976(%ebp), %ecx
-	addl	%esi, %edx
-	movl	-76(%ebp), %eax
-	movl	%edx, -96(%ebp)
-	movl	-980(%ebp), %esi
-	movl	-72(%ebp), %edx
-	xorl	%eax, %esi
-	xorl	%edx, %ecx
-	movl	%esi, -116(%ebp)
-	movl	-984(%ebp), %edx
-	movl	%ecx, -108(%ebp)
-	movl	-80(%ebp), %eax
-	movl	-988(%ebp), %ecx
-	movl	-84(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -88(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -92(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-92(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-92(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-68(%ebp), %esi
-	cmpl	%ecx, -68(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -120(%ebp)
-	movl	-88(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-96(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -124(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-92(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-92(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-52(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-56(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -100(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -104(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-100(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	-108(%ebp), %eax
-	addl	%ecx, %edx
-	movl	-108(%ebp), %esi
-	movl	%edx, -136(%ebp)
-	movl	-984(%ebp), %edx
-	movl	-116(%ebp), %ecx
-	addl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	movl	%edx, -112(%ebp)
-	movl	-988(%ebp), %esi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-992(%ebp), %edx
-	movl	-996(%ebp), %ecx
-	addl	%esi, %eax
-	movl	-124(%ebp), %esi
-	movl	%eax, -148(%ebp)
-	movl	-120(%ebp), %eax
-	xorl	%ecx, %esi
-	movl	%esi, -132(%ebp)
-	xorl	%edx, %eax
-	movzbl	%al,%esi
-	movl	%eax, -128(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-132(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-132(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-104(%ebp), %esi
-	cmpl	%ecx, -104(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -152(%ebp)
-	movl	-128(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-136(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -156(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-132(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-132(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-88(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-92(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -140(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -144(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	setb	%al
-	movl	-112(%ebp), %esi
-	addl	%eax, %edx
-	movl	-140(%ebp), %eax
-	addl	%eax, %edx
-	movl	-108(%ebp), %eax
-	movl	%edx, -168(%ebp)
-	movl	-992(%ebp), %edx
-	notl	%eax
-	sall	$19, %eax
-	xorl	%esi, %eax
-	cmpl	%eax, -992(%ebp)
-	setb	%cl
-	movzbl	%cl, %esi
-	subl	%eax, %edx
-	movl	-108(%ebp), %ecx
-	movl	-116(%ebp), %eax
-	movl	%edx, -180(%ebp)
-	movl	-148(%ebp), %edx
-	shrl	$13, %ecx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%edx
-	xorl	%eax, %edx
-	movl	-996(%ebp), %eax
-	addl	%esi, %edx
-	movl	-1004(%ebp), %ecx
-	subl	%edx, %eax
-	movl	-156(%ebp), %esi
-	movl	%eax, -184(%ebp)
-	movl	-1000(%ebp), %edx
-	movl	-152(%ebp), %eax
-	xorl	%ecx, %esi
-	movl	%esi, -164(%ebp)
-	xorl	%edx, %eax
-	movzbl	%al,%esi
-	movl	%eax, -160(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-164(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-164(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-144(%ebp), %esi
-	cmpl	%ecx, -144(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -188(%ebp)
-	movl	-168(%ebp), %esi
-	addl	%eax, %edx
-	subl	%edx, %esi
-	movl	%esi, -192(%ebp)
-	movl	-160(%ebp), %ecx
-	movzbl	%ch, %eax
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6144(%esi,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-164(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-164(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-128(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-132(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	leal	0(,%esi,4), %ecx
-	movl	%edx, -172(%ebp)
-	addl	%ecx, %esi
-	shrl	$30, %eax
-	movl	%esi, -176(%ebp)
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-172(%ebp), %esi
-	setb	%al
-	movl	-1000(%ebp), %ecx
-	addl	%eax, %edx
-	addl	%esi, %edx
-	movl	-184(%ebp), %eax
-	movl	-1004(%ebp), %esi
-	movl	%edx, -204(%ebp)
-	movl	-180(%ebp), %edx
-	xorl	%eax, %esi
-	movl	%esi, -224(%ebp)
-	movl	-188(%ebp), %eax
-	xorl	%edx, %ecx
-	movl	%ecx, -216(%ebp)
-	movl	-1008(%ebp), %edx
-	movl	-1012(%ebp), %ecx
-	movl	-192(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -196(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -200(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-200(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-200(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-176(%ebp), %esi
-	cmpl	%ecx, -176(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -228(%ebp)
-	movl	-196(%ebp), %ecx
-	movl	-204(%ebp), %esi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -232(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-200(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-200(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-160(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-164(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -208(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -212(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-208(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	-216(%ebp), %eax
-	addl	%ecx, %edx
-	movl	-216(%ebp), %esi
-	movl	%edx, -244(%ebp)
-	movl	-1008(%ebp), %edx
-	movl	-224(%ebp), %ecx
-	addl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	movl	%edx, -220(%ebp)
-	movl	-1012(%ebp), %esi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-1016(%ebp), %edx
-	movl	-1020(%ebp), %ecx
-	addl	%esi, %eax
-	movl	-232(%ebp), %esi
-	movl	%eax, -256(%ebp)
-	movl	-228(%ebp), %eax
-	xorl	%ecx, %esi
-	movl	%esi, -240(%ebp)
-	xorl	%edx, %eax
-	movzbl	%al,%esi
-	movl	%eax, -236(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-240(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-240(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-212(%ebp), %esi
-	cmpl	%ecx, -212(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -260(%ebp)
-	movl	-236(%ebp), %ecx
-	movl	-244(%ebp), %esi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -264(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-240(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-240(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-196(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-200(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -248(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -252(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-248(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-216(%ebp), %eax
-	addl	%esi, %edx
-	movl	-220(%ebp), %ecx
-	movl	%edx, -276(%ebp)
-	movl	-224(%ebp), %edx
-	shrl	$23, %eax
-	notl	%ecx
-	movl	-1016(%ebp), %esi
-	sall	$9, %edx
-	orl	%edx, %eax
-	xorl	%eax, %ecx
-	xorl	%edx, %edx
-	cmpl	%ecx, -1016(%ebp)
-	movl	-224(%ebp), %eax
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-256(%ebp), %ecx
-	notl	%eax
-	movl	%esi, -288(%ebp)
-	shrl	$23, %eax
-	movl	-1020(%ebp), %esi
-	xorl	%ecx, %eax
-	addl	%edx, %eax
-	movl	-1028(%ebp), %ecx
-	subl	%eax, %esi
-	movl	-1024(%ebp), %edx
-	movl	-260(%ebp), %eax
-	movl	%esi, -292(%ebp)
-	movl	-264(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -268(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -272(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-272(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-272(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-252(%ebp), %esi
-	cmpl	%ecx, -252(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -360(%ebp)
-	movl	-268(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-276(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -364(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-272(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-272(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-236(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-240(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -280(%ebp)
-	leal	0(,%esi,4), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -284(%ebp)
-	shrl	$30, %eax
-	sall	$2, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-280(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	-288(%ebp), %esi
-	addl	%ecx, %edx
-	movl	%edx, -376(%ebp)
-	movl	-1024(%ebp), %edx
-	xorl	%esi, %edx
-	movl	%edx, -296(%ebp)
-	movl	-72(%ebp), %ecx
-	movl	-292(%ebp), %eax
-	movl	-1028(%ebp), %esi
-	addl	%edx, %ecx
-	movl	%ecx, -300(%ebp)
-	xorl	%eax, %esi
-	cmpl	%edx, %ecx
-	movl	%esi, -304(%ebp)
-	setb	%al
-	movl	-76(%ebp), %ecx
-	movzbl	%al, %eax
-	addl	%esi, %eax
-	addl	%ecx, %eax
-	movl	%eax, -308(%ebp)
-	movl	-300(%ebp), %esi
-	movl	%edx, %eax
-	notl	%eax
-	movl	-108(%ebp), %edx
-	sall	$19, %eax
-	xorl	%esi, %eax
-	cmpl	%eax, -108(%ebp)
-	setb	%cl
-	movzbl	%cl, %esi
-	subl	%eax, %edx
-	movl	-296(%ebp), %ecx
-	movl	-304(%ebp), %eax
-	movl	%edx, -312(%ebp)
-	movl	-308(%ebp), %edx
-	shrl	$13, %ecx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%edx
-	xorl	%eax, %edx
-	movl	-112(%ebp), %ecx
-	addl	%esi, %edx
-	movl	-116(%ebp), %esi
-	subl	%edx, %esi
-	movl	-312(%ebp), %edx
-	movl	%esi, -316(%ebp)
-	xorl	%edx, %ecx
-	movl	-148(%ebp), %edx
-	movl	%ecx, -320(%ebp)
-	xorl	%esi, %edx
-	movl	-180(%ebp), %esi
-	movl	%edx, -328(%ebp)
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	%esi, -324(%ebp)
-	setb	%al
-	movl	-184(%ebp), %ecx
-	movzbl	%al, %eax
-	addl	%edx, %eax
-	addl	%ecx, %eax
-	movl	%eax, -332(%ebp)
-	movl	-320(%ebp), %eax
-	sall	$9, %edx
-	movl	%esi, %ecx
-	notl	%ecx
-	movl	-216(%ebp), %esi
-	shrl	$23, %eax
-	orl	%edx, %eax
-	xorl	%eax, %ecx
-	xorl	%edx, %edx
-	cmpl	%ecx, -216(%ebp)
-	movl	-328(%ebp), %eax
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-332(%ebp), %ecx
-	notl	%eax
-	movl	%esi, -336(%ebp)
-	shrl	$23, %eax
-	xorl	%ecx, %eax
-	addl	%edx, %eax
-	movl	-336(%ebp), %esi
-	movl	-224(%ebp), %edx
-	movl	-220(%ebp), %ecx
-	subl	%eax, %edx
-	xorl	%esi, %ecx
-	movl	%edx, -340(%ebp)
-	movl	%ecx, -344(%ebp)
-	movl	-256(%ebp), %eax
-	xorl	%edx, %eax
-	movl	%eax, -352(%ebp)
-	movl	-288(%ebp), %edx
-	movl	-352(%ebp), %esi
-	xorl	%eax, %eax
-	addl	%ecx, %edx
-	cmpl	%ecx, %edx
-	movl	%edx, -348(%ebp)
-	movl	-292(%ebp), %ecx
-	setb	%al
-	addl	%esi, %eax
-	xorl	$-1985229329, %edx
-	movl	-296(%ebp), %esi
-	addl	%ecx, %eax
-	xorl	%ecx, %ecx
-	cmpl	%edx, -296(%ebp)
-	movl	%eax, -356(%ebp)
-	movl	-356(%ebp), %eax
-	setb	%cl
-	subl	%edx, %esi
-	xorl	$19088743, %eax
-	addl	%ecx, %eax
-	movl	%esi, -392(%ebp)
-	movl	-304(%ebp), %esi
-	movl	-300(%ebp), %edx
-	movl	-308(%ebp), %ecx
-	subl	%eax, %esi
-	movl	-360(%ebp), %eax
-	movl	%esi, -396(%ebp)
-	movl	-364(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -368(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -372(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-372(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-372(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-284(%ebp), %esi
-	cmpl	%ecx, -284(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -400(%ebp)
-	movl	-376(%ebp), %esi
-	addl	%eax, %edx
-	subl	%edx, %esi
-	movl	%esi, -404(%ebp)
-	movl	-368(%ebp), %ecx
-	movzbl	%ch, %eax
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6144(%esi,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-372(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-372(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-268(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-272(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -380(%ebp)
-	movl	-380(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	%edx, -384(%ebp)
-	movl	-380(%ebp), %esi
-	movl	-392(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	xorl	$-1515870811, %edx
-	movl	%ecx, -388(%ebp)
-	xorl	%ecx, %ecx
-	cmpl	%edx, -300(%ebp)
-	movl	-300(%ebp), %esi
-	movl	-396(%ebp), %eax
-	setb	%cl
-	subl	%edx, %esi
-	xorl	$-1515870811, %eax
-	movl	%esi, -428(%ebp)
-	movl	-308(%ebp), %esi
-	addl	%ecx, %eax
-	movl	-312(%ebp), %edx
-	movl	-316(%ebp), %ecx
-	subl	%eax, %esi
-	movl	%esi, -432(%ebp)
-	movl	-400(%ebp), %eax
-	movl	-404(%ebp), %esi
-	xorl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -412(%ebp)
-	movzbl	%al,%esi
-	movl	%eax, -408(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-412(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-412(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-384(%ebp), %esi
-	cmpl	%ecx, -384(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -436(%ebp)
-	movl	-408(%ebp), %ecx
-	movl	-388(%ebp), %esi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -440(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-412(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-412(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-368(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-372(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -416(%ebp)
-	shrl	$29, %eax
-	movl	-416(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-416(%ebp), %esi
-	movl	%edx, -420(%ebp)
-	movl	-428(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-316(%ebp), %esi
-	movl	-432(%ebp), %eax
-	movl	%ecx, -424(%ebp)
-	movl	-312(%ebp), %ecx
-	xorl	%eax, %esi
-	movl	%esi, -472(%ebp)
-	movl	-436(%ebp), %eax
-	xorl	%edx, %ecx
-	movl	%ecx, -464(%ebp)
-	movl	-320(%ebp), %edx
-	movl	-328(%ebp), %ecx
-	movl	-440(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -444(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -448(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-448(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-448(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-420(%ebp), %esi
-	cmpl	%ecx, -420(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -476(%ebp)
-	movl	-444(%ebp), %ecx
-	movl	-424(%ebp), %esi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -480(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-448(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-448(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-408(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-412(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -452(%ebp)
-	shrl	$29, %eax
-	movl	-452(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-452(%ebp), %esi
-	movl	%edx, -456(%ebp)
-	movl	-320(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-464(%ebp), %eax
-	movl	-464(%ebp), %esi
-	movl	%ecx, -460(%ebp)
-	addl	%eax, %edx
-	movl	-472(%ebp), %ecx
-	movl	%edx, -468(%ebp)
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	movl	-328(%ebp), %esi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-324(%ebp), %edx
-	addl	%esi, %eax
-	movl	-332(%ebp), %ecx
-	movl	%eax, -504(%ebp)
-	movl	-480(%ebp), %esi
-	movl	-476(%ebp), %eax
-	xorl	%ecx, %esi
-	xorl	%edx, %eax
-	movl	%esi, -488(%ebp)
-	movzbl	%al,%esi
-	movl	%eax, -484(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-488(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-488(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-456(%ebp), %esi
-	cmpl	%ecx, -456(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -508(%ebp)
-	movl	-484(%ebp), %ecx
-	movl	-460(%ebp), %esi
-	addl	%eax, %edx
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -512(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-488(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-488(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-444(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-448(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -492(%ebp)
-	shrl	$29, %eax
-	movl	-492(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-468(%ebp), %esi
-	movl	%edx, -496(%ebp)
-	movl	-492(%ebp), %edx
-	addl	%edx, %eax
-	subl	%eax, %ecx
-	movl	-464(%ebp), %eax
-	movl	-324(%ebp), %edx
-	movl	%ecx, -500(%ebp)
-	notl	%eax
-	sall	$19, %eax
-	xorl	%esi, %eax
-	cmpl	%eax, -324(%ebp)
-	setb	%cl
-	movzbl	%cl, %esi
-	subl	%eax, %edx
-	movl	-464(%ebp), %ecx
-	movl	-472(%ebp), %eax
-	movl	%edx, -536(%ebp)
-	movl	-504(%ebp), %edx
-	shrl	$13, %ecx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%edx
-	xorl	%eax, %edx
-	movl	-332(%ebp), %eax
-	addl	%esi, %edx
-	movl	-340(%ebp), %ecx
-	subl	%edx, %eax
-	movl	-512(%ebp), %esi
-	movl	%eax, -540(%ebp)
-	movl	-336(%ebp), %edx
-	movl	-508(%ebp), %eax
-	xorl	%ecx, %esi
-	xorl	%edx, %eax
-	movl	%eax, -516(%ebp)
-	movl	%esi, -520(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-520(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-520(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-496(%ebp), %esi
-	cmpl	%ecx, -496(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -544(%ebp)
-	movl	-516(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-500(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -548(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-520(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-520(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-484(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-488(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -524(%ebp)
-	shrl	$29, %eax
-	movl	-524(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-524(%ebp), %esi
-	movl	%edx, -528(%ebp)
-	movl	-536(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	%ecx, -532(%ebp)
-	movl	-336(%ebp), %ecx
-	xorl	%edx, %ecx
-	movl	%ecx, -572(%ebp)
-	movl	-540(%ebp), %eax
-	movl	-340(%ebp), %esi
-	movl	-344(%ebp), %edx
-	movl	-352(%ebp), %ecx
-	xorl	%eax, %esi
-	movl	%esi, -580(%ebp)
-	movl	-544(%ebp), %eax
-	movl	-548(%ebp), %esi
-	xorl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -556(%ebp)
-	movzbl	%al,%esi
-	movl	%eax, -552(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-556(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-556(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-528(%ebp), %esi
-	cmpl	%ecx, -528(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -584(%ebp)
-	movl	-552(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-532(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -588(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-556(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-556(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-516(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-520(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -560(%ebp)
-	movl	-560(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	shrl	$29, %eax
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-560(%ebp), %esi
-	movl	%edx, -564(%ebp)
-	movl	-344(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-572(%ebp), %eax
-	movl	-572(%ebp), %esi
-	movl	%ecx, -568(%ebp)
-	addl	%eax, %edx
-	movl	-580(%ebp), %ecx
-	movl	%edx, -576(%ebp)
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	movl	-352(%ebp), %esi
-	setb	%al
-	addl	%ecx, %eax
-	movl	-348(%ebp), %edx
-	addl	%esi, %eax
-	movl	-356(%ebp), %ecx
-	movl	%eax, -612(%ebp)
-	movl	-588(%ebp), %esi
-	movl	-584(%ebp), %eax
-	xorl	%ecx, %esi
-	xorl	%edx, %eax
-	movl	%esi, -596(%ebp)
-	movzbl	%al,%esi
-	movl	%eax, -592(%ebp)
-	shrl	$13, %eax
-	movl	(%edi,%esi,8), %ecx
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-596(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-596(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-564(%ebp), %esi
-	cmpl	%ecx, -564(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -616(%ebp)
-	movl	-592(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-568(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -620(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-596(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-596(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-552(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-556(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -600(%ebp)
-	movl	-600(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	shrl	$29, %eax
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	-600(%ebp), %esi
-	movl	%edx, -604(%ebp)
-	movl	-580(%ebp), %edx
-	addl	%esi, %eax
-	subl	%eax, %ecx
-	movl	-572(%ebp), %eax
-	sall	$9, %edx
-	movl	%ecx, -608(%ebp)
-	movl	-576(%ebp), %ecx
-	shrl	$23, %eax
-	orl	%edx, %eax
-	xorl	%edx, %edx
-	notl	%ecx
-	xorl	%eax, %ecx
-	movl	-348(%ebp), %esi
-	movl	-580(%ebp), %eax
-	cmpl	%ecx, -348(%ebp)
-	notl	%eax
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-612(%ebp), %ecx
-	shrl	$23, %eax
-	movl	%esi, -644(%ebp)
-	movl	-356(%ebp), %esi
-	xorl	%ecx, %eax
-	addl	%edx, %eax
-	movl	-396(%ebp), %ecx
-	movl	-392(%ebp), %edx
-	subl	%eax, %esi
-	movl	-616(%ebp), %eax
-	movl	%esi, -648(%ebp)
-	movl	-620(%ebp), %esi
-	xorl	%edx, %eax
-	movl	%eax, -624(%ebp)
-	xorl	%ecx, %esi
-	movl	%esi, -628(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-628(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-628(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-604(%ebp), %esi
-	cmpl	%ecx, -604(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -716(%ebp)
-	movl	-608(%ebp), %esi
-	addl	%eax, %edx
-	subl	%edx, %esi
-	movl	%esi, -720(%ebp)
-	movl	-624(%ebp), %ecx
-	movzbl	%ch, %eax
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	sall	$3, %eax
-	movl	6144(%esi,%edi), %ecx
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-628(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-628(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-592(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-596(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	shrl	$29, %eax
-	movl	%edx, -632(%ebp)
-	movl	-632(%ebp), %ecx
-	leal	0(,%esi,8), %edx
-	sall	$3, %ecx
-	orl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	%esi, %edx
-	setb	%al
-	subl	%esi, %edx
-	movl	%edx, -636(%ebp)
-	movl	-632(%ebp), %edx
-	movl	-644(%ebp), %esi
-	addl	%edx, %eax
-	movl	-392(%ebp), %edx
-	subl	%eax, %ecx
-	movl	%ecx, -640(%ebp)
-	movl	-428(%ebp), %ecx
-	movl	-648(%ebp), %eax
-	xorl	%esi, %edx
-	movl	-396(%ebp), %esi
-	addl	%edx, %ecx
-	movl	%ecx, -656(%ebp)
-	movl	%edx, -652(%ebp)
-	xorl	%eax, %esi
-	cmpl	%edx, %ecx
-	movl	%esi, -660(%ebp)
-	setb	%al
-	movl	-432(%ebp), %ecx
-	movzbl	%al, %eax
-	addl	%esi, %eax
-	addl	%ecx, %eax
-	movl	%eax, -664(%ebp)
-	movl	-656(%ebp), %esi
-	movl	%edx, %eax
-	notl	%eax
-	movl	-464(%ebp), %edx
-	sall	$19, %eax
-	xorl	%esi, %eax
-	cmpl	%eax, -464(%ebp)
-	setb	%cl
-	movzbl	%cl, %esi
-	subl	%eax, %edx
-	movl	-652(%ebp), %ecx
-	movl	-660(%ebp), %eax
-	movl	%edx, -668(%ebp)
-	movl	-664(%ebp), %edx
-	shrl	$13, %ecx
-	sall	$19, %eax
-	orl	%ecx, %eax
-	notl	%edx
-	xorl	%eax, %edx
-	addl	%esi, %edx
-	movl	-472(%ebp), %esi
-	subl	%edx, %esi
-	movl	%esi, -672(%ebp)
-	movl	-668(%ebp), %edx
-	movl	-468(%ebp), %ecx
-	xorl	%edx, %ecx
-	movl	-504(%ebp), %edx
-	movl	%ecx, -676(%ebp)
-	xorl	%esi, %edx
-	movl	-536(%ebp), %esi
-	movl	%edx, -684(%ebp)
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	%esi, -680(%ebp)
-	setb	%al
-	movl	-540(%ebp), %ecx
-	movzbl	%al, %eax
-	addl	%edx, %eax
-	addl	%ecx, %eax
-	movl	%eax, -688(%ebp)
-	movl	-676(%ebp), %eax
-	sall	$9, %edx
-	movl	%esi, %ecx
-	notl	%ecx
-	movl	-572(%ebp), %esi
-	shrl	$23, %eax
-	orl	%edx, %eax
-	xorl	%eax, %ecx
-	xorl	%edx, %edx
-	cmpl	%ecx, -572(%ebp)
-	movl	-684(%ebp), %eax
-	setb	%dl
-	subl	%ecx, %esi
-	movl	-688(%ebp), %ecx
-	notl	%eax
-	movl	%esi, -692(%ebp)
-	shrl	$23, %eax
-	xorl	%ecx, %eax
-	addl	%edx, %eax
-	movl	-580(%ebp), %edx
-	movl	-692(%ebp), %esi
-	movl	-576(%ebp), %ecx
-	subl	%eax, %edx
-	movl	-612(%ebp), %eax
-	movl	%edx, -696(%ebp)
-	xorl	%esi, %ecx
-	movl	%ecx, -700(%ebp)
-	xorl	%edx, %eax
-	movl	-644(%ebp), %edx
-	movl	%eax, -708(%ebp)
-	movl	-708(%ebp), %esi
-	xorl	%eax, %eax
-	addl	%ecx, %edx
-	cmpl	%ecx, %edx
-	movl	-648(%ebp), %ecx
-	movl	%edx, -704(%ebp)
-	setb	%al
-	addl	%esi, %eax
-	xorl	$-1985229329, %edx
-	addl	%ecx, %eax
-	movl	-652(%ebp), %esi
-	movl	%eax, -712(%ebp)
-	xorl	%ecx, %ecx
-	movl	-712(%ebp), %eax
-	cmpl	%edx, -652(%ebp)
-	setb	%cl
-	subl	%edx, %esi
-	movl	%esi, -740(%ebp)
-	movl	-660(%ebp), %esi
-	xorl	$19088743, %eax
-	addl	%ecx, %eax
-	movl	-656(%ebp), %edx
-	subl	%eax, %esi
-	movl	%esi, -744(%ebp)
-	movl	-716(%ebp), %eax
-	xorl	%edx, %eax
-	movl	%eax, -724(%ebp)
-	movl	-664(%ebp), %ecx
-	movl	-720(%ebp), %esi
-	xorl	%ecx, %esi
-	movl	%esi, -728(%ebp)
-	movzbl	%al,%esi
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-728(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-728(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-636(%ebp), %esi
-	cmpl	%ecx, -636(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -748(%ebp)
-	movl	-724(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-640(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -752(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-728(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-728(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-624(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-628(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -732(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -736(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-732(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	addl	%esi, %edx
-	movl	%edx, -764(%ebp)
-	movl	-668(%ebp), %eax
-	movl	-748(%ebp), %edx
-	movl	-672(%ebp), %ecx
-	movl	-752(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, -756(%ebp)
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -760(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	andl	$2040, %eax
-	movl	(%edi,%esi,8), %ecx
-	movl	2048(%eax,%edi), %edx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-760(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-760(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-736(%ebp), %esi
-	cmpl	%ecx, -736(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -776(%ebp)
-	movl	-756(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-764(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -780(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-760(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-760(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-724(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-728(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -768(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -772(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-768(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-676(%ebp), %eax
-	addl	%esi, %edx
-	movl	-684(%ebp), %ecx
-	movl	%edx, -792(%ebp)
-	movl	-776(%ebp), %edx
-	movl	-780(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -788(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -784(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-788(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-788(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-772(%ebp), %esi
-	cmpl	%ecx, -772(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -804(%ebp)
-	movl	-784(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-792(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -808(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-788(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-788(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-756(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-760(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -796(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -800(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-796(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-680(%ebp), %eax
-	addl	%esi, %edx
-	movl	-688(%ebp), %ecx
-	movl	%edx, -820(%ebp)
-	movl	-804(%ebp), %edx
-	movl	-808(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -816(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -812(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-816(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-816(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-800(%ebp), %esi
-	cmpl	%ecx, -800(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -832(%ebp)
-	movl	-812(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-820(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -836(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-816(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-816(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-784(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-788(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -824(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -828(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-824(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-692(%ebp), %eax
-	addl	%esi, %edx
-	movl	-696(%ebp), %ecx
-	movl	%edx, -848(%ebp)
-	movl	-832(%ebp), %edx
-	movl	-836(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -844(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -840(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-844(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-844(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-828(%ebp), %esi
-	cmpl	%ecx, -828(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -860(%ebp)
-	movl	-840(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-848(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -864(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-844(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-844(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-812(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-816(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -852(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -856(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-852(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-700(%ebp), %eax
-	addl	%esi, %edx
-	movl	-708(%ebp), %ecx
-	movl	%edx, -876(%ebp)
-	movl	-860(%ebp), %edx
-	movl	-864(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -872(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -868(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-872(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-872(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-856(%ebp), %esi
-	cmpl	%ecx, -856(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -888(%ebp)
-	movl	-868(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-876(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -892(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-872(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-872(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-840(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-844(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -880(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -884(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-880(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-704(%ebp), %eax
-	addl	%esi, %edx
-	movl	-712(%ebp), %ecx
-	movl	%edx, -904(%ebp)
-	movl	-888(%ebp), %edx
-	movl	-892(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -900(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -896(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-900(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-900(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-884(%ebp), %esi
-	cmpl	%ecx, -884(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -916(%ebp)
-	movl	-896(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-904(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -920(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-900(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-900(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-868(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-872(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -908(%ebp)
-	leal	0(,%esi,8), %ecx
-	addl	%ecx, %esi
-	movl	%esi, -912(%ebp)
-	shrl	$29, %eax
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	movl	-908(%ebp), %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-740(%ebp), %eax
-	addl	%esi, %edx
-	movl	-744(%ebp), %ecx
-	movl	%edx, -932(%ebp)
-	movl	-916(%ebp), %edx
-	movl	-920(%ebp), %esi
-	xorl	%eax, %edx
-	movl	%edx, %eax
-	xorl	%ecx, %esi
-	movl	%esi, -928(%ebp)
-	shrl	$13, %eax
-	movzbl	%dl,%esi
-	movl	%edx, -924(%ebp)
-	andl	$2040, %eax
-	movl	2048(%eax,%edi), %edx
-	movl	(%edi,%esi,8), %ecx
-	movl	2052(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	4(%edi,%esi,8), %edx
-	xorl	%eax, %edx
-	movzbl	-928(%ebp),%eax
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	4100(%eax,%edi), %esi
-	movl	-928(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$13, %eax
-	andl	$2040, %eax
-	movl	6144(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	6148(%eax,%edi), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-912(%ebp), %esi
-	cmpl	%ecx, -912(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	%esi, -940(%ebp)
-	movl	-924(%ebp), %ecx
-	addl	%eax, %edx
-	movl	-932(%ebp), %esi
-	movzbl	%ch, %eax
-	subl	%edx, %esi
-	movl	%esi, -944(%ebp)
-	leal	0(,%eax,8), %esi
-	movl	%ecx, %eax
-	shrl	$24, %eax
-	movl	6144(%esi,%edi), %ecx
-	sall	$3, %eax
-	movl	4096(%eax,%edi), %edx
-	movl	4100(%eax,%edi), %eax
-	xorl	%edx, %ecx
-	movl	6148(%esi,%edi), %edx
-	xorl	%eax, %edx
-	movl	-928(%ebp), %eax
-	movzbl	%ah, %esi
-	leal	0(,%esi,8), %eax
-	movl	2048(%eax,%edi), %esi
-	xorl	%esi, %ecx
-	movl	2052(%eax,%edi), %esi
-	movl	-928(%ebp), %eax
-	xorl	%esi, %edx
-	shrl	$24, %eax
-	movl	(%edi,%eax,8), %esi
-	xorl	%esi, %ecx
-	movl	4(%edi,%eax,8), %esi
-	xorl	%eax, %eax
-	xorl	%esi, %edx
-	movl	-896(%ebp), %esi
-	addl	%ecx, %esi
-	cmpl	%ecx, %esi
-	movl	-900(%ebp), %ecx
-	setb	%al
-	addl	%eax, %edx
-	movl	%esi, %eax
-	addl	%ecx, %edx
-	movl	%edx, -936(%ebp)
-	leal	0(,%esi,8), %ecx
-	shrl	$29, %eax
-	addl	%ecx, %esi
-	sall	$3, %edx
-	orl	%eax, %edx
-	xorl	%eax, %eax
-	cmpl	%ecx, %esi
-	setb	%al
-	addl	%eax, %edx
-	movl	-936(%ebp), %eax
-	movl	-20(%ebp), %ecx
-	addl	%edx, %eax
-	movl	-948(%ebp), %edx
-	xorl	%edx, %esi
-	movl	%esi, -1032(%ebp)
-	movl	-952(%ebp), %esi
-	movl	-960(%ebp), %edx
-	xorl	%esi, %eax
-	movl	-924(%ebp), %esi
-	movl	%eax, -1036(%ebp)
-	xorl	%eax, %eax
-	cmpl	%ecx, -924(%ebp)
-	setb	%al
-	subl	%ecx, %esi
-	movl	-928(%ebp), %ecx
-	addl	%edx, %eax
-	movl	-964(%ebp), %edx
-	subl	%eax, %ecx
-	movl	-24(%ebp), %eax
-	movl	%ecx, -1040(%ebp)
-	movl	-940(%ebp), %ecx
-	addl	%eax, %ecx
-	xorl	%eax, %eax
-	cmpl	-24(%ebp), %ecx
-	setb	%al
-	addl	%edx, %eax
-	movl	-944(%ebp), %edx
-	addl	%edx, %eax
-	movl	-1032(%ebp), %edx
-	movl	%eax, -1044(%ebp)
-	movl	16(%ebp), %eax
-	movl	%edx, (%eax)
-	movl	-1036(%ebp), %edx
-	movl	%esi, 8(%eax)
-	movl	%edx, 4(%eax)
-	movl	-1040(%ebp), %esi
-	movl	%ecx, 16(%eax)
-	movl	%esi, 12(%eax)
-	movl	-1044(%ebp), %edx
-	movl	%edx, 20(%eax)
-	subl	$64, -16(%ebp)
-	addl	$64, 8(%ebp)
-	cmpl	$63, -16(%ebp)
-	ja	.L6
-.L8:
-	addl	$1032, %esp
-	popl	%ebx
-	popl	%esi
-	popl	%edi
-	popl	%ebp
-	ret
-	.size	tiger_t, .-tiger_t
-.globl tiger
-	.type	tiger, @function
-tiger:
-	pushl	%ebp
-	movl	%esp, %ebp
-	pushl	%edi
-	pushl	%esi
-	subl	$72, %esp
-	movl	12(%ebp), %edi
-	movl	8(%ebp), %esi
-	cmpl	$63, %edi
-	jbe	.L33
-.L42:
-	movl	%esi, (%esp)
-	movl	16(%ebp), %eax
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%eax, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	ja	.L132
-.L33:
-	xorl	%ecx, %ecx
-	cmpl	%edi, %ecx
-	jb	.L140
-.L35:
-	movb	$1, -72(%ecx,%ebp)
-	leal	1(%ecx), %edx
-	testb	$7, %dl
-	je	.L37
-.L44:
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	jne	.L135
-.L37:
-	cmpl	$56, %edx
-	jbe	.L23
-	cmpl	$63, %edx
-	jbe	.L141
-.L39:
-	movl	16(%ebp), %ecx
-	leal	-72(%ebp), %edx
-	movl	%edx, (%esp)
-	movl	%ecx, 4(%esp)
-	call	tiger_compress
-	xorl	%edx, %edx
-.L23:
-	cmpl	$55, %edx
-	ja	.L41
-	movb	$0, -72(%ebp,%edx)
-	movl	%edx, %eax
-	leal	1(%edx), %ecx
-	notl	%eax
-	andl	$7, %eax
-	cmpl	$55, %ecx
-	ja	.L41
-	testl	%eax, %eax
-	je	.L46
-	cmpl	$1, %eax
-	je	.L143
-	cmpl	$2, %eax
-	je	.L144
-	cmpl	$3, %eax
-	je	.L145
-	cmpl	$4, %eax
-	je	.L146
-	cmpl	$5, %eax
-	je	.L147
-	cmpl	$6, %eax
-	je	.L148
-	movb	$0, -72(%ebp,%ecx)
-	leal	2(%edx), %ecx
-.L148:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L147:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L146:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L145:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L144:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L143:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-	cmpl	$55, %ecx
-	ja	.L41
-.L46:
-	movb	$0, -72(%ebp,%ecx)
-	movb	$0, -71(%ecx,%ebp)
-	movb	$0, -70(%ecx,%ebp)
-	movb	$0, -69(%ecx,%ebp)
-	movb	$0, -68(%ecx,%ebp)
-	movb	$0, -67(%ecx,%ebp)
-	movb	$0, -66(%ecx,%ebp)
-	movb	$0, -65(%ecx,%ebp)
-	addl	$8, %ecx
-	cmpl	$55, %ecx
-	ja	.L41
-	jmp	.L46
-.L141:
-	movb	$0, -72(%ebp,%edx)
-	movl	%edx, %eax
-	leal	1(%edx), %ecx
-	notl	%eax
-	andl	$7, %eax
-	cmpl	$63, %ecx
-	ja	.L39
-	testl	%eax, %eax
-	je	.L45
-	cmpl	$1, %eax
-	je	.L149
-	cmpl	$2, %eax
-	je	.L150
-	cmpl	$3, %eax
-	je	.L151
-	cmpl	$4, %eax
-	je	.L152
-	cmpl	$5, %eax
-	je	.L153
-	cmpl	$6, %eax
-	je	.L154
-	movb	$0, -72(%ebp,%ecx)
-	leal	2(%edx), %ecx
-.L154:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L153:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L152:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L151:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L150:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-.L149:
-	movb	$0, -72(%ebp,%ecx)
-	incl	%ecx
-	cmpl	$63, %ecx
-	ja	.L39
-.L45:
-	movb	$0, -72(%ebp,%ecx)
-	movb	$0, -71(%ecx,%ebp)
-	movb	$0, -70(%ecx,%ebp)
-	movb	$0, -69(%ecx,%ebp)
-	movb	$0, -68(%ecx,%ebp)
-	movb	$0, -67(%ecx,%ebp)
-	movb	$0, -66(%ecx,%ebp)
-	movb	$0, -65(%ecx,%ebp)
-	addl	$8, %ecx
-	cmpl	$63, %ecx
-	ja	.L39
-	jmp	.L45
-.L135:
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	movb	$0, -72(%ebp,%edx)
-	incl	%edx
-	testb	$7, %dl
-	je	.L37
-	jmp	.L44
-.L140:
-	movl	%ecx, %eax
-	notl	%eax
-	addl	%edi, %eax
-	movl	%eax, %edx
-	andl	$7, %edx
-	movzbl	(%esi,%ecx), %eax
-	movb	%al, -72(%ebp,%ecx)
-	incl	%ecx
-	cmpl	%edi, %ecx
-	jae	.L35
-	testl	%edx, %edx
-	je	.L43
-	cmpl	$1, %edx
-	je	.L155
-	cmpl	$2, %edx
-	je	.L156
-	cmpl	$3, %edx
-	je	.L157
-	cmpl	$4, %edx
-	je	.L158
-	cmpl	$5, %edx
-	je	.L159
-	cmpl	$6, %edx
-	je	.L160
-	movzbl	(%esi,%ecx), %edx
-	movb	%dl, -72(%ebp,%ecx)
-	incl	%ecx
-.L160:
-	movzbl	(%esi,%ecx), %eax
-	movb	%al, -72(%ebp,%ecx)
-	incl	%ecx
-.L159:
-	movzbl	(%esi,%ecx), %edx
-	movb	%dl, -72(%ebp,%ecx)
-	incl	%ecx
-.L158:
-	movzbl	(%esi,%ecx), %eax
-	movb	%al, -72(%ebp,%ecx)
-	incl	%ecx
-.L157:
-	movzbl	(%esi,%ecx), %edx
-	movb	%dl, -72(%ebp,%ecx)
-	incl	%ecx
-.L156:
-	movzbl	(%esi,%ecx), %eax
-	movb	%al, -72(%ebp,%ecx)
-	incl	%ecx
-.L155:
-	movzbl	(%esi,%ecx), %edx
-	movb	%dl, -72(%ebp,%ecx)
-	incl	%ecx
-	cmpl	%edi, %ecx
-	jae	.L35
-.L43:
-	movzbl	(%esi,%ecx), %edx
-	movb	%dl, -72(%ebp,%ecx)
-	leal	1(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	2(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	3(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	4(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	5(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	6(%ecx), %edx
-	movzbl	(%esi,%edx), %eax
-	movb	%al, -72(%ebp,%edx)
-	leal	7(%ecx), %edx
-	addl	$8, %ecx
-	movzbl	(%esi,%edx), %eax
-	cmpl	%edi, %ecx
-	movb	%al, -72(%ebp,%edx)
-	jae	.L35
-	jmp	.L43
-.L132:
-	movl	%esi, (%esp)
-	movl	16(%ebp), %ecx
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%ecx, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %eax
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%eax, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %edx
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%edx, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %ecx
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%ecx, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %eax
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%eax, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %edx
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%edx, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	movl	%esi, (%esp)
-	movl	16(%ebp), %ecx
-	subl	$64, %edi
-	addl	$64, %esi
-	movl	%ecx, 4(%esp)
-	call	tiger_compress
-	cmpl	$63, %edi
-	jbe	.L33
-	jmp	.L42
-.L41:
-	movl	$0, -12(%ebp)
-	movl	12(%ebp), %eax
-	leal	-72(%ebp), %esi
-	movl	%esi, (%esp)
-	movl	16(%ebp), %edi
-	sall	$3, %eax
-	movl	%edi, 4(%esp)
-	movl	%eax, -16(%ebp)
-	call	tiger_compress
-	addl	$72, %esp
-	popl	%esi
-	popl	%edi
-	popl	%ebp
-	ret
-	.size	tiger, .-tiger
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-.globl __i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
-	.type	__i686.get_pc_thunk.bx, @function
-__i686.get_pc_thunk.bx:
-	movl	(%esp), %ebx
-	ret
-	.section	.note.GNU-stack,"",@progbits
-	.ident	"GCC: (GNU) 3.4.0"
Index: trunk/src/sh_tiger1_64.c
===================================================================
--- trunk/src/sh_tiger1_64.c	(revision 591)
+++ trunk/src/sh_tiger1_64.c	(revision 1)
@@ -5,25 +5,13 @@
 #include "config_xor.h"
 
-#if defined(__clang__)
-#undef TIGER_OPT_ASM
-#endif
-
-#if defined(TIGER_64_BIT)
-
-#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
-#if ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 6))
-#pragma GCC optimize ("O1")
-#endif
-#endif
-
-
-/* #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) */
-
-#undef USE_MEMSET
-
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
+
+/*@-incondefs -macroparens -macroassign -macroparams -macrostmt @*/
+/*@-fixedformalarray +charindex -type -paramuse -predboolint -exportlocal@*/
 /* Big endian:                                         */
 #ifdef WORDS_BIGENDIAN
 #define BIG_ENDIAN
 #endif
+
 
 /* Tiger: A Fast New Hash Function
@@ -50,8 +38,6 @@
 #if defined(HAVE_LONG_64)
 typedef unsigned long int word64;
-#elif defined(HAVE_LONG_LONG_64)
+#else
 typedef unsigned long long int word64;
-#else
-#error No 64 bit type found !
 #endif
 
@@ -63,26 +49,34 @@
 typedef unsigned short sh_word32;
 #else
-#error No 32 bit type found !
+#error No 32 byte type found !
 #endif
 
 typedef unsigned char sh_byte;
 
-#if defined(TIGER_OPT_ASM)
-#define TIGER_ASM64_2 1
-#else
-#define TIGER_C 1
-#endif
-
-/* The number of passes of the hash function.		   */
-/* Three passes are recommended.			   */
-/* Use four passes when you need extra security.	   */
-/* Must be at least three.				   */
+/* Big endian:                                         
+   #if !(defined(__alpha)||defined(__i386__)||defined(__vax__))
+   #define BIG_ENDIAN
+   #endif
+*/
+
+/* The following macro denotes that an optimization    */
+/* for Alpha is required. It is used only for          */
+/* optimization of time. Otherwise it does nothing.    */
+#ifdef __alpha
+#define OPTIMIZE_FOR_ALPHA
+#endif
+
+/* NOTE that this code is NOT FULLY OPTIMIZED for any  */
+/* machine. Assembly code might be much faster on some */
+/* machines, especially if the code is compiled with   */
+/* gcc.                                                */
+
+/* The number of passes of the hash function.          */
+/* Three passes are recommended.                       */
+/* Use four passes when you need extra security.       */
+/* Must be at least three.                             */
 #define PASSES 3
 
 extern word64 tiger_table[4*256];
-
-/* Volatile can help if compiler is smart enough to use memory operand */
-static /*volatile*/ const word64 XOR_CONST1=0xA5A5A5A5A5A5A5A5LL;
-static /*volatile*/ const word64 XOR_CONST2=0x0123456789ABCDEFLL;
 
 #define t1 (tiger_table)
@@ -91,279 +85,97 @@
 #define t4 (tiger_table+256*3)
 
-#define pass_start
-#define pass_end
-
-
-
 #define save_abc \
-	  aa = a; \
-	  bb = b; \
-	  cc = c;
-
-#ifdef TIGER_C
-
-#define BN(x,n) (((x)>>((n)*8))&0xFF)
-
-
-/* Depending on outer code one of these two can be better*/
-#define roundX(a,b,c,x) \
-	c ^= x; \
-	a -= t1[BN(c,0)] ^ t2[BN(c,2)] ^ \
-	     t3[BN(c,4)] ^ t4[BN(c,6)] ; \
-	b += t4[BN(c,1)] ^ t3[BN(c,3)] ^ \
-	     t2[BN(c,5)] ^ t1[BN(c,7)] ;
-
-#define round5(a,b,c,x) roundX(a,b,c,x) b = b+b*4;
-#define round7(a,b,c,x) roundX(a,b,c,x) b = b*8-b;
-#define round9(a,b,c,x) roundX(a,b,c,x) b = b+b*8;
-
-#endif
-
-
-#ifdef TIGER_OPT_ASM
-
-#define MASK0		0xFFL
-#define MASK8		0xFF00L
-#define MASK16		0xFF0000L
-#define MASK32		0xFF00000000LL
-#define MASK40		0xFF0000000000LL
-#define MASK48		0xFF000000000000LL
-
-#define roundstart	__asm__ (
-
-/* a will be moved into different reg each round
- * using register substitution feature of  GCC asm
- * b will be moved in 2-nd pass rounds only
- */
-
-
-#define roundend(a,b,c,x) \
- : "+r" (a), "+r" (b), "+r" (c) \
- : "g" (a), "g" (b), "g" (c), "m" (x), "r" (&tiger_table),\
-  "i" (MASK0), "i" (MASK8), "i" (MASK16), "r" (MASK32), "r" (MASK40), "r" (MASK48) \
- : "3", "%rax","%rbx","%rcx","%rdx","%rsi", "%edi", "%r8"  );
-
-
-/*	c ^= x; 
-	a -= t1[BN(c,0)] ^ t2[BN(c,2)] ^ 
-	t3[BN(c,4)] ^ t4[BN(c,6)] ; 
-	b += t4[BN(c,1)] ^ t3[BN(c,3)] ^ 
-	t2[BN(c,5)] ^ t1[BN(c,7)] ; 	*/
-
-#define roundX(a,b,c,x)   \
-"	movl	%10, %%ebx	\n"\
-"	movq	%11, %%rcx	\n"\
-"	movq	%13, %%rdx	\n"\
-"	movq	%6, %%r8  \n"\
-"	xorq	%%r8, %2		 \n" \
-"	andq	%2, %%rbx  \n"\
-"	andq	%2, %%rcx  \n"\
-"	andq	%2, %%rdx  \n"\
-"	shrl	$(16-3), %%ebx	\n"\
-"	shrq	$(32-3), %%rcx	\n"\
-"	shrq	$(48-3), %%rdx	\n"\
-"	movzbl	%2b, %%eax	\n"\
-"	movzwl	%2w, %%edi	\n"\
-"	movq	(%7,%%rax,8), %%rsi  \n"\
-"	shrl	$(8), %%edi  \n" \
-"	movq	%2, %%rax  \n" \
-"	xorq	(2048*1)(%7,%%rbx), %%rsi  \n"\
-"	movq	%2, %%rbx  \n"\
-"	shrl	$24, %%eax \n"\
-"	andq	%12, %%rbx	\n"\
-"	xorq	(2048*2)(%7,%%rcx), %%rsi  \n"\
-"	shrq	$(40-3), %%rbx \n"\
-"	movq	%2, %%rcx  \n"\
-"	xorq	(2048*3)(%7,%%rdx), %%rsi  \n"\
-"	movq	(2048*3)(%7,%%rdi,8), %%rdx  \n"\
-"	shrq	$56, %%rcx \n"\
-"	xorq	(2048*2)(%7,%%rax,8), %%rdx  \n"\
-"	xorq	(2048*1)(%7,%%rbx), %%rdx  \n" \
-"	subq	 %%rsi, %0 \n"\
-"	xorq	(%7,%%rcx,8), %%rdx  \n"\
-"	addq	 %%rdx, %1 \n"
-
-#define round5(a,b,c,x) \
-	roundstart \
-	roundX(a,b,c,x) \
-	/* b*=5; */ \
-	"leaq	(%1,%1,4), %1\n" \
-	roundend(a,b,c,x)
-
-
-#define round7(a,b,c,x) \
-	roundstart \
-	roundX(a,b,c,x) \
-	roundend(a,b,c,x) \
-	/* b*=7; */ \
-	__asm__ ( \
-	"leaq	(%1,%1,8), %0\n" \
-	"addq  %1, %1 \n" \
-	"subq  %1, %0 " \
-	:"=&r" (b): "r"(b): "1" );
-
-#define round9(a,b,c,x) \
-	roundstart \
-	roundX(a,b,c,x) \
-	"leaq	(%1,%1,8), %1\n" \
-	roundend(a,b,c,x)
-
-#endif
-
-
-
-
-/* ============== Common macros ================== */
+      aa = a; \
+      bb = b; \
+      cc = c;
+
+#ifdef OPTIMIZE_FOR_ALPHA
+/* This is the official definition of round */
+#define round(a,b,c,x,mul) \
+      c ^= x; \
+      a -= t1[((c)>>(0*8))&0xFF] ^ t2[((c)>>(2*8))&0xFF] ^ \
+	   t3[((c)>>(4*8))&0xFF] ^ t4[((c)>>(6*8))&0xFF] ; \
+      b += t4[((c)>>(1*8))&0xFF] ^ t3[((c)>>(3*8))&0xFF] ^ \
+	   t2[((c)>>(5*8))&0xFF] ^ t1[((c)>>(7*8))&0xFF] ; \
+      b *= mul;
+#else
+/* This code works faster when compiled on 32-bit machines */
+/* (but works slower on Alpha) */
+#define round(a,b,c,x,mul) \
+      c ^= x; \
+      a -= t1[(sh_byte)(c)] ^ \
+           t2[(sh_byte)(((sh_word32)(c))>>(2*8))] ^ \
+	   t3[(sh_byte)((c)>>(4*8))] ^ \
+           t4[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(2*8))] ; \
+      b += t4[(sh_byte)(((sh_word32)(c))>>(1*8))] ^ \
+           t3[(sh_byte)(((sh_word32)(c))>>(3*8))] ^ \
+	   t2[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(1*8))] ^ \
+           t1[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(3*8))]; \
+      b *= mul;
+#endif
+
+#define pass(a,b,c,mul) \
+      round(a,b,c,x0,mul) \
+      round(b,c,a,x1,mul) \
+      round(c,a,b,x2,mul) \
+      round(a,b,c,x3,mul) \
+      round(b,c,a,x4,mul) \
+      round(c,a,b,x5,mul) \
+      round(a,b,c,x6,mul) \
+      round(b,c,a,x7,mul)
 
 #define key_schedule \
-	x0 -= x7 ^ XOR_CONST1; \
-	x1 ^= x0; \
-	x2 += x1;\
-	x3 -= x2 ^ ((~x1)<<19);\
-	x4 ^= x3;\
-	x5 += x4;\
-	x6 -= x5 ^ ((~x4)>>23); \
-	x7 ^= x6; \
-	x0 += x7; \
-	x1 -= x0 ^ ((~x7)<<19); \
-	x2 ^= x1; \
-	x3 += x2; \
-	x4 -= x3 ^ ((~x2)>>23); \
-	x5 ^= x4; \
-	x6 += x5; \
-	x7 -= x6 ^ XOR_CONST2;
-
-#define pass5n(a,b,c) \
-	  round5(a,b,c,x0) \
-	x0 -= x7 ^ XOR_CONST1; \
-	  round5(b,c,a,x1) \
-	x1 ^= x0; \
-	  round5(c,a,b,x2) \
-	x2 += x1; \
-	  round5(a,b,c,x3) \
-	x3 -= x2 ^ ((~x1)<<19); \
-	  round5(b,c,a,x4) \
-	x4 ^= x3; \
-	  round5(c,a,b,x5) \
-	x5 += x4; \
-	  round5(a,b,c,x6) \
-	x6 -= x5 ^ ((~x4)>>23); \
-	  round5(b,c,a,x7) \
-	x7 ^= x6; \
-	x0 += x7; \
-	x1 -= x0 ^ ((~x7)<<19); \
-	x2 ^= x1; \
-	x3 += x2; \
-	x4 -= x3 ^ ((~x2)>>23); \
-	x5 ^= x4; \
-	x6 += x5; \
-	x7 -= x6 ^ XOR_CONST2;
-
-#define pass7n(a,b,c) \
-	  round7(a,b,c,x0) \
-	x0 -= x7 ^ XOR_CONST1; \
-	  round7(b,c,a,x1) \
-	x1 ^= x0; \
-	  round7(c,a,b,x2) \
-	x2 += x1; \
-	  round7(a,b,c,x3) \
-	x3 -= x2 ^ ((~x1)<<19); \
-	  round7(b,c,a,x4) \
-	x4 ^= x3; \
-	  round7(c,a,b,x5) \
-	x5 += x4; \
-	  round7(a,b,c,x6) \
-	x6 -= x5 ^ ((~x4)>>23); \
-	  round7(b,c,a,x7) \
-	x7 ^= x6; \
-	x0 += x7; \
-	x1 -= x0 ^ ((~x7)<<19); \
-	x2 ^= x1; \
-	x3 += x2; \
-	x4 -= x3 ^ ((~x2)>>23); \
-	x5 ^= x4; \
-	x6 += x5; \
-	x7 -= x6 ^ XOR_CONST2;
-
-#define pass5(a,b,c) \
-	pass_start \
-	  round5(a,b,c,x0) \
-	  round5(b,c,a,x1) \
-	  round5(c,a,b,x2) \
-	  round5(a,b,c,x3) \
-	  round5(b,c,a,x4) \
-	  round5(c,a,b,x5) \
-	  round5(a,b,c,x6) \
-	  round5(b,c,a,x7) \
-	pass_end
-
-#define pass7(a,b,c) \
-	pass_start \
-	  round7(a,b,c,x0) \
-	  round7(b,c,a,x1) \
-	  round7(c,a,b,x2) \
-	  round7(a,b,c,x3) \
-	  round7(b,c,a,x4) \
-	  round7(c,a,b,x5) \
-	  round7(a,b,c,x6) \
-	  round7(b,c,a,x7) \
-	pass_end
-
-
-#define pass9(a,b,c) \
-	pass_start \
-	  round9(a,b,c,x0) \
-	  round9(b,c,a,x1) \
-	  round9(c,a,b,x2) \
-	  round9(a,b,c,x3) \
-	  round9(b,c,a,x4) \
-	  round9(c,a,b,x5) \
-	  round9(a,b,c,x6) \
-	  round9(b,c,a,x7) \
-	pass_end
+      x0 -= x7 ^ 0xA5A5A5A5A5A5A5A5LL; \
+      x1 ^= x0; \
+      x2 += x1; \
+      x3 -= x2 ^ ((~x1)<<19); \
+      x4 ^= x3; \
+      x5 += x4; \
+      x6 -= x5 ^ ((~x4)>>23); \
+      x7 ^= x6; \
+      x0 += x7; \
+      x1 -= x0 ^ ((~x7)<<19); \
+      x2 ^= x1; \
+      x3 += x2; \
+      x4 -= x3 ^ ((~x2)>>23); \
+      x5 ^= x4; \
+      x6 += x5; \
+      x7 -= x6 ^ 0x0123456789ABCDEFLL;
 
 #define feedforward \
-	  a ^= aa; \
-	  b -= bb; \
-	  c += cc;
-
-
-/* This version works ok with C variant and also with new asm version 
- * that just wastes a register r8 
- * reason? who knows, write forwarding is faster than keeping value 
- * in register? :) 
- */
+      a ^= aa; \
+      b -= bb; \
+      c += cc;
+
+#ifdef OPTIMIZE_FOR_ALPHA
+/* The loop is unrolled: works better on Alpha */
 #define compress \
-	save_abc \
-	  pass5n(a,b,c) \
-	  pass7n(c,a,b) \
-	  pass9(b,c,a) \
-	  for(pass_no=3; pass_no<PASSES; pass_no++) { \
-		key_schedule \
-		pass9(a,b,c) \
-		tmpa=a; a=c; c=b; b=tmpa; \
-	  } \
-	feedforward
-
-#define compress_old \
-	save_abc \
-	  pass5(a,b,c) \
-	  key_schedule \
-	  pass7(c,a,b) \
-	  key_schedule \
-	  pass9(b,c,a) \
-	  for(pass_no=3; pass_no<PASSES; pass_no++) { \
-		key_schedule \
-		pass9(a,b,c) \
-		tmpa=a; a=c; c=b; b=tmpa; \
-	  } \
-	feedforward
+      save_abc \
+      pass(a,b,c,5) \
+      key_schedule \
+      pass(c,a,b,7) \
+      key_schedule \
+      pass(b,c,a,9) \
+      for(pass_no=3; pass_no<PASSES; pass_no++) { \
+        key_schedule \
+	pass(a,b,c,9) \
+	tmpa=a; a=c; c=b; b=tmpa;} \
+      feedforward
+#else
+/* loop: works better on PC and Sun (smaller cache?) */
+#define compress \
+      save_abc \
+      for(pass_no=0; pass_no<PASSES; pass_no++) { \
+        if(pass_no != 0) {key_schedule} \
+	pass(a,b,c,(pass_no==0?5:pass_no==1?7:9)); \
+	tmpa=a; a=c; c=b; b=tmpa;} \
+      feedforward
+#endif
 
 #define tiger_compress_macro(str, state) \
 { \
-  register word64 a, b, c; \
-  register word64 tmpa; \
+  register word64 a, b, c, tmpa; \
   word64 aa, bb, cc; \
-  word64 x0, x1, x2, x3, x4, x5, x6, x7; \
+  register word64 x0, x1, x2, x3, x4, x5, x6, x7; \
   int pass_no; \
 \
@@ -382,10 +194,21 @@
 }
 
-void tiger_compress(const word64 *str, word64 state[3])
+/* The compress function is a function. Requires smaller cache?    */
+void tiger_compress(word64 *str, word64 state[3])
 {
-  tiger_compress_macro(((const word64*)str), ((word64*)state));
-}
-
-void tiger_t(const word64 *str, word64 length, word64 res[3])
+#ifndef S_SPLINT_S
+  tiger_compress_macro(((word64*)str), ((word64*)state));
+#endif
+}
+
+#ifdef OPTIMIZE_FOR_ALPHA
+/* The compress function is inlined: works better on Alpha.        */
+/* Still leaves the function above in the code, in case some other */
+/* module calls it directly.                                       */
+#define tiger_compress(str, state) \
+  tiger_compress_macro(((word64*)str), ((word64*)state))
+#endif
+
+void tiger_t(word64 *str, word64 length, word64 res[3])
 {
   register word64 i;
@@ -397,8 +220,8 @@
 
   /*
-   * res[0]=0x0123456789ABCDEFLL;
-   * res[1]=0xFEDCBA9876543210LL;
-   * res[2]=0xF096A5B4C3B2E187LL;
-   */
+    res[0]=0x0123456789ABCDEFLL;
+    res[1]=0xFEDCBA9876543210LL;
+    res[2]=0xF096A5B4C3B2E187LL;
+  */
 
   for(i=length; i>=64; i-=64)
@@ -406,5 +229,5 @@
 #ifdef BIG_ENDIAN
       for(j=0; j<64; j++)
-        temp[j^7] = ((sh_byte*)str)[j];
+	temp[j^7] = ((sh_byte*)str)[j];
       tiger_compress(((word64*)temp), res);
 #else
@@ -413,24 +236,18 @@
       str += 8;
     }
-}
-
-void tiger(const word64 *str, word64 length, word64 res[3])
+
+}
+
+void tiger(word64 *str, word64 length, word64 res[3])
 {
   register word64 i;
   register word64 j = 0;
-  union {
-    word64 w64_temp[8];
-    unsigned char temp[64];
-  } dd;
-  union {
-    word64 itmp;
-    unsigned char ctmp[8];
-  } uu;
+  unsigned char temp[64];
 
   /*
-   * res[0]=0x0123456789ABCDEFLL;
-   * res[1]=0xFEDCBA9876543210LL;
-   * res[2]=0xF096A5B4C3B2E187LL;
-   */
+    res[0]=0x0123456789ABCDEFLL;
+    res[1]=0xFEDCBA9876543210LL;
+    res[2]=0xF096A5B4C3B2E187LL;
+  */
 
   for(i=length; i>=64; i-=64)
@@ -438,6 +255,6 @@
 #ifdef BIG_ENDIAN
       for(j=0; j<64; j++)
-        dd.temp[j^7] = ((sh_byte*)str)[j];
-      tiger_compress((dd.w64_temp), res);
+	temp[j^7] = ((sh_byte*)str)[j];
+      tiger_compress(((word64*)temp), res);
 #else
       tiger_compress(str, res);
@@ -448,51 +265,48 @@
 #ifdef BIG_ENDIAN
   for(j=0; j<i; j++)
-    dd.temp[j^7] = ((sh_byte*)str)[j];
-
-  dd.temp[j^7] = 0x01;
+    temp[j^7] = ((sh_byte*)str)[j];
+
+  temp[j^7] = 0x01;
   j++;
   for(; j&7; j++)
-    dd.temp[j^7] = 0;
-#else
-
-#ifndef USE_MEMSET
+    temp[j^7] = 0;
+#else
   for(j=0; j<i; j++)
-    dd.temp[j] = ((const sh_byte*)str)[j];
-#else
-  memcpy( dd.temp, str, j=i );
-#endif
-  dd.temp[j++] = 0x01;
+    temp[j] = ((sh_byte*)str)[j];
+
+  temp[j++] = 0x01;
   for(; j&7; j++)
-	dd.temp[j] = 0;
-
-#endif
-
+    temp[j] = 0;
+#endif
   if(j>56)
     {
-#ifndef USE_MEMSET
       for(; j<64; j++)
-	dd.temp[j] = 0;
-#else
-      memset( (dd.temp)+j, 0, 64-j);
-#endif
-      tiger_compress((dd.w64_temp), res);
+	temp[j] = 0;
+      tiger_compress(((word64*)temp), res);
       j=0;
     }
 
-#ifndef USE_MEMSET
   for(; j<56; j++)
-    dd.temp[j] = 0;
-#else
-  memset( (dd.temp)+j, 0, 56-j);
-#endif
-
-  /* Avoid gcc warning for type-punned pointer 
-   */
-  uu.itmp = ((word64)length)<<3;
-  for (j=0; j<8; j++)
-        dd.temp[56+j] = uu.ctmp[j];
-
-  tiger_compress((dd.w64_temp), res);
-}
-
-#endif
+    temp[j] = 0;
+  ((word64*)(&(temp[56])))[0] = ((word64)length)<<3;
+  tiger_compress(((word64*)temp), res);
+}
+
+#else
+
+void dummy_1_64 (int a)
+{
+  (void) a;
+  return;
+}
+
+#endif
+
+
+
+
+
+
+
+
+
Index: trunk/src/sh_tiger2.c
===================================================================
--- trunk/src/sh_tiger2.c	(revision 591)
+++ trunk/src/sh_tiger2.c	(revision 1)
@@ -23,20 +23,10 @@
 
 
-#if !defined(TIGER_64_BIT)
+#if !defined(HAVE_LONG_64) && !defined(HAVE_LONG_LONG_64)
 
-/* #if !defined(HAVE_LONG_64) && !defined(HAVE_LONG_LONG_64) */
 
 /* sboxes32.c: Tiger S boxes for 32-bit-only compilers */
-#if defined(HAVE_INT_32)
-typedef unsigned int sh_word32;
-#elif defined(HAVE_LONG_32)
-typedef unsigned long sh_word32;
-#elif defined(HAVE_SHORT_32)
-typedef unsigned short sh_word32;
-#else
-#error No 32 bit type found !
-#endif
-
-sh_word32 tiger_table[4*256][2] = {
+typedef unsigned long word32;
+word32 tiger_table[4*256][2] = {
   { 0xF7E90C5E, 0x02AAB17C /*    0 */},  {  0xE243A8EC, 0xAC424B03 /*    1 */},
   { 0x0DD5FCD3, 0x72CD5BE3 /*    2 */},  {  0xF6F97F3A, 0x6D019B93 /*    3 */},
Index: trunk/src/sh_tiger2_64.c
===================================================================
--- trunk/src/sh_tiger2_64.c	(revision 591)
+++ trunk/src/sh_tiger2_64.c	(revision 1)
@@ -22,7 +22,6 @@
 #include "config_xor.h"
 
-#if defined(TIGER_64_BIT)
-
-/* #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) */
+
+#if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64)
 
 /*@-type@*/
@@ -31,8 +30,6 @@
 #if defined(HAVE_LONG_64)
 typedef unsigned long int word64;
-#elif defined(HAVE_LONG_LONG_64)
+#else
 typedef unsigned long long int word64;
-#else
-#error No 64 bit type found !
 #endif
 
Index: trunk/src/sh_tools.c
===================================================================
--- trunk/src/sh_tools.c	(revision 591)
+++ trunk/src/sh_tools.c	(revision 1)
@@ -70,5 +70,5 @@
 #endif
 #ifndef FD_ZERO
-#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
+#define FD_ZERO(p)      memset((char *)(p), '\0', sizeof(*(p)))
 #endif
 
@@ -77,6 +77,4 @@
 #include <sys/mman.h>
 #endif
-
-#define SH_REAL_SET
 
 #include "samhain.h"
@@ -88,166 +86,53 @@
 #define SH_NEED_GETHOSTBYXXX
 #include "sh_static.h"
-#include "sh_pthread.h"
-#include "sh_ipvx.h"
 
 #undef  FIL__
 #define FIL__  _("sh_tools.c")
 
-static int tools_debug = 0;
-
 #ifdef SH_ENCRYPT
 #include "rijndael-api-fst.h"
-char * errorExplain (int err_num, char * buffer, size_t len)
-{
-  char * p;
-
+char * errorExplain (int err_num)
+{
   if      (err_num == BAD_KEY_DIR)
-    p = (_("Key direction is invalid"));
+    return (_("Key direction is invalid"));
   else if (err_num == BAD_KEY_MAT) 
-    p = (_("Key material not of correct length"));
+    return (_("Key material not of correct length"));
   else if (err_num == BAD_KEY_INSTANCE) 
-    p = (_("Key passed is not valid"));
+    return (_("Key passed is not valid"));
   else if (err_num == BAD_CIPHER_MODE) 
-    p = (_("Params struct passed to rijndael_cipherInit invalid"));
+    return (_("Params struct passed to cipherInit invalid"));
   else if (err_num == BAD_CIPHER_STATE) 
-    p = (_("Cipher in wrong state"));
+    return (_("Cipher in wrong state"));
   else if (err_num == BAD_BLOCK_LENGTH) 
-    p = (_("Bad block length"));
+    return (_("Bad block length"));
   else if (err_num == BAD_CIPHER_INSTANCE) 
-    p = (_("Bad cipher instance"));
+    return (_("Bad cipher instance"));
   else if (err_num == BAD_DATA) 
-    p = (_("Data contents are invalid"));
+    return (_("Data contents are invalid"));
   else  
-    p = (_("Unknown error"));
-  sl_strlcpy (buffer, p, len);
-  return buffer;
-}
-
-#endif
-
-/* --- check for an interface ---
+    return (_("Unknown error"));
+}
+
+#endif
+
+/* --- recode all \blah escapes to '=XX' format, and also code all
+ *     remaining unprintable chars                                 ---
  */
-int sh_tools_iface_is_present(char *str)
-{
-#if defined(USE_IPVX)
-  struct addrinfo *ai;
-  struct addrinfo hints;
-  int             res;
-
-  memset (&hints, 0, sizeof (hints));
-  hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
-  hints.ai_socktype = SOCK_STREAM;
-  res = getaddrinfo (str, _("2543"), &hints, &ai);
-  
-  if (res == 0)
-    {
-      struct addrinfo *p = ai;
-      while (p != NULL)
-	{
-	  int fd = socket (p->ai_family, p->ai_socktype,
-			   p->ai_protocol);
-
-	  if (fd < 0)
-	    {
-	      freeaddrinfo (ai);
-	      return 0;
-	    }
-
-	  if (bind (fd, p->ai_addr, p->ai_addrlen) != 0)
-	    {
-	      /* bind() fails for access reasons, iface exists
-	       */
-	      if (errno == EACCES || errno == EADDRINUSE)
-		{
-		  sl_close_fd (FIL__, __LINE__, fd);
-		  freeaddrinfo (ai);
-		  return 1;
-		}
-
-	      sl_close_fd (FIL__, __LINE__, fd);
-	      freeaddrinfo (ai);
-	      return 0;
-	    }
-
-	  sl_close_fd (FIL__, __LINE__, fd);
-	  freeaddrinfo (ai);
-	  return 1;
-	  /* p = p->ai_next; */ 
-	}
-    }
-#else
-  struct sockaddr_in sin;
-  int sd;
-
-  memset(&sin, 0, sizeof(sin));
-  sin.sin_family = AF_INET;
-  if (inet_aton(str, &(sin.sin_addr)))
-    {
-      sin.sin_port = htons(2543);
-
-      if (-1 == (sd = socket(AF_INET, SOCK_STREAM, 0)))
-	{
-	  /* cppcheck-suppress resourceLeak */
-	  return 0;
-	}
-
-      if (-1 == bind(sd, (struct sockaddr *)&sin, sizeof(sin)))
-	{
-	  int retval = 0;
-
-	  /* bind() fails for access reasons, iface exists
-	   */
-	  if (errno == EACCES || errno == EADDRINUSE)
-	    retval = 1;
-	  sl_close_fd (FIL__, __LINE__, sd);
-	  return retval;
-	}
-
-      /* bind() succeeds, iface exists
-       */
-      sl_close_fd(FIL__, __LINE__, sd);
-      return 1;
-    }
-#endif
-  return 0;
-}
-
-/* --- recode all \blah escapes to qp (quoted printable) '=XX' format, and 
- *     also code all remaining unprintable chars                           ---
- */
-#define SH_PUT_4(p, a, b, c) (p)[0] = (a); (p)[1] = (b); (p)[2] = (c);
-  
 char * sh_tools_safe_name (const char * instr, int flag)
 {
-  unsigned char c, d;
+  unsigned char c;
   const  char * p;
   char   tmp[4];
   char * outstr;
-  size_t len = 1;
+  int    len;
   int    i = 0;
   unsigned char   val_octal = '\0';
-  static char ctable[16] = { '0', '1', '2', '3', '4', '5', '6', '7', 
-			     '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; 
 
   SL_ENTER(_("sh_tools_safe_name"));
 
   if (instr)
-    {
-      len = strlen(instr);
-      if (sl_ok_muls (3, len) && sl_ok_adds ((3*len), 4))
-	{
-	  len = (3 * len) + 4;
-	  p = instr;
-	}
-      else
-	{
-	  len = 1;
-	  p   = NULL;
-	}
-    }
+    len = (3 * strlen(instr)) + 4;
   else
-    {
-      p = NULL;
-    }
+    len = 1;
 
   outstr = SH_ALLOC(len);
@@ -256,12 +141,7 @@
   tmp[3]    = '\0';
 
-#if !defined(SH_USE_XML)
-  (void) flag; /* fix compiler warning */
-#endif
-
-  if (!p)
-    goto end;
-
-  while (*p)
+  p = instr;
+
+  while (p && *p)
     {
       c = *p;
@@ -274,53 +154,44 @@
 
 #ifdef SH_USE_XML
-      if (flag == 1)
-	{
-	  if ((*p) == '"')
-	    { 
-	      SH_PUT_4(&outstr[i], '=', '2', '2');
-	      i+=3; ++p;
-	      continue;
-	    } 
-	  else if ((*p) == '&')
-	    { 
-	      SH_PUT_4(&outstr[i], '=', '2', '6');
-	      i+=3; ++p;
-	      continue;
-	    } 
-	  else if ((*p) == '<') 
-	    {     /* left angle       */
-	      SH_PUT_4(&outstr[i], '=', '3', 'c');
-	      i+=3; ++p;
-	      continue;
-	    } 
-	  else if ((*p) == '>') 
-	    {     /* right angle      */
-	      SH_PUT_4(&outstr[i], '=', '3', 'e');
-	      i+=3; ++p;
-	      continue;
-	    }
+      if (flag == 1 && (*p) == '"')
+	{ 
+	  sprintf(&outstr[i], "=%02x", c);   i+=3; ++p;  /* known to fit  */
+	  continue;
+	} 
+      else if (flag == 1 && (*p) == '&')
+	{ 
+	  sprintf(&outstr[i], "=%02x", c);   i+=3; ++p;  /* known to fit  */
+	  continue;
+	} 
+      else if (flag == 1 && (*p) == '<') 
+	{     /* left angle       */
+	  sprintf(&outstr[i], "=%02x", c);   i+=3; ++p;  /* known to fit  */
+	  continue;
+	} 
+      else if (flag == 1 && (*p) == '>') 
+	{     /* right angle      */
+	  sprintf(&outstr[i], "=%02x", c);   i+=3; ++p;  /* known to fit  */
+	  continue;
 	}
+#else
+      (void) flag; /* fix compiler warning */
 #endif
 
       if ( (*p) != '\\' && (*p) != '&' && (*p) != '='  && (*p) != '\'') 
         {
-	  outstr[i] = *p; ++i;
-	  ++p;
-	      
-	  if (c < 32 || c > 126)
+	  if (c < 31 || c > 126)
 	    {
-	      --i;
-	      d = c % 16; c = c / 16;
-	      outstr[i] = '=';       ++i;
-	      outstr[i] = ctable[c]; ++i;
-	      outstr[i] = ctable[d]; ++i;
+	      sprintf(&outstr[i], "=%02x", c); i+=3; ++p;/* known to fit  */
 	    }
-
+	  else
+	    {
+	      outstr[i] = *p;
+	      ++i; ++p;
+	    }
 	  continue;
 	}
       else if ((*p) == '\'')
 	{
-	  SH_PUT_4(&outstr[i], '=', '2', '7');
-	  i+=3; ++p;
+	  sprintf(&outstr[i], "=%02x", c);   i+=3; ++p;  /* known to fit  */
 	}
       else if (*p == '=')
@@ -328,6 +199,5 @@
 	  if (p[1] != '"' && p[1] != '<')
 	    { 
-	      SH_PUT_4(&outstr[i], '=', '3', 'd');
-	      i+=3; ++p;
+	      sprintf(&outstr[i], "=%02x", c); i+=3; ++p;/* known to fit  */
 	    }
 	  else
@@ -342,49 +212,48 @@
 	    break;
 
-
+	  c = *p;
 
 	  switch (*p) {
 	  case '\\':
-	    SH_PUT_4(&outstr[i], '=', '5', 'c');
-	    i+=3; ++p;
+	    sprintf(&outstr[i], "=%02x", c);  i+=3; ++p; /* known to fit  */
 	    break;
 	  case 'n':
-	    SH_PUT_4(&outstr[i], '=', '0', 'a');
+	    sprintf(&outstr[i], "=%02x", '\n');          /* known to fit  */
 	    i+=3; ++p;
 	    break;
 	  case 'b':
-	    SH_PUT_4(&outstr[i], '=', '0', '8');
+	    sprintf(&outstr[i], "=%02x", '\b');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case 'r':		       
-	    SH_PUT_4(&outstr[i], '=', '0', 'd');
+	    sprintf(&outstr[i], "=%02x", '\r');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case 't':		       
-	    SH_PUT_4(&outstr[i], '=', '0', '9');
+	    sprintf(&outstr[i], "=%02x", '\t');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case 'v':		       
-	    SH_PUT_4(&outstr[i], '=', '0', 'b');
+	    sprintf(&outstr[i], "=%02x", '\v');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case 'f':		       
-	    SH_PUT_4(&outstr[i], '=', '0', 'c');
+	    sprintf(&outstr[i], "=%02x", '\f');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case '\'':		       
-	    SH_PUT_4(&outstr[i], '=', '2', '7');
+	    sprintf(&outstr[i], "=%02x", '\'');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
-	  case '"':	/* also encode quoted '"' */ 	       
-	    SH_PUT_4(&outstr[i], '=', '2', '2');
+	  case '\"':	/* also encode quoted '"' */ 	       
+	    sprintf(&outstr[i], "=%02x", '\"');          /* known to fit  */
 	    i+=3; ++p;
 	    break;		       
 	  case ' ':		       
-	    SH_PUT_4(&outstr[i], '=', '2', '0');
+	    sprintf(&outstr[i], "=%02x", ' ');           /* known to fit  */
 	    i+=3; ++p;
 	    break;
 	  default:
-	    if (strlen(p) < 3) /* certainly not an octal number, skip */
+	    if (strlen(p) < 3)
 	      {
 		p += strlen(p);
@@ -396,8 +265,6 @@
 		if (val_octal != '\0') { 
 		  c = val_octal;
-		  d = c % 16; c = c / 16;
-		  outstr[i] = '=';       ++i;
-		  outstr[i] = ctable[c]; ++i;
-		  outstr[i] = ctable[d]; ++i;
+		  sprintf(&outstr[i], "=%02x", c);       /* known to fit  */
+		  i+=3;
 		} 
 		p += 3;
@@ -405,16 +272,13 @@
 	  }
 	}
-      else if (*p == '&')
+      else /* *p == '&' */
 	{
 	  ++p;
-	  if (!p || !(*p))
-	    {
-	      outstr[i] = '&'; ++i;
-	      break;
-	    }
+	  if (!p || !(*p)) 
+	    break;
 
 	  if (p[0] == 'a' && p[1] == 'm' && p[2] == 'p' && p[3] == ';')
 	    {
-	      SH_PUT_4(&outstr[i], '=', '2', '6');
+	      sprintf(&outstr[i], "=%02x", '&');         /* known to fit  */
 	      i+=3; p += 4;
 	    }
@@ -422,15 +286,15 @@
 		   p[4] == ';')
 	    {
-	      SH_PUT_4(&outstr[i], '=', '2', '2');
+	      sprintf(&outstr[i], "=%02x", '"');         /* known to fit  */
 	      i+=3; p += 5;
 	    }
 	  else if (p[0] == 'l' && p[1] == 't' && p[2] == ';')
 	    {
-	      SH_PUT_4(&outstr[i], '=', '3', 'c');
+	      sprintf(&outstr[i], "=%02x", '<');         /* known to fit  */
 	      i+=3; p += 3;
 	    }
 	  else if (p[0] == 'g' && p[1] == 't' && p[2] == ';')
 	    {
-	      SH_PUT_4(&outstr[i], '=', '3', 'e');
+	      sprintf(&outstr[i], "=%02x", '>');         /* known to fit  */
 	      i+=3; p += 3;
 	    }
@@ -439,13 +303,6 @@
 	      outstr[i] = '&'; ++i;
 	    }
-	}
-      else
-	{
-	  outstr[i] = *p; ++i;
-	  ++p;
-	}
+	}     
     } /* while (p && *p) */
-
- end:
   
   outstr[i] = '\0';
@@ -456,26 +313,35 @@
 /* extern int h_errno; */ 
 
-char * sh_tools_errmessage (int tellme, char * errbuf, size_t len)
-{
-  char * p = NULL;
+char * sh_tools_errmessage (int tellme)
+{
+
 #ifdef HOST_NOT_FOUND
     if (tellme == HOST_NOT_FOUND)  
-      p = _("The specified host is unknown: ");
+      return _("The specified host is unknown: ");
 #endif
 #ifdef NO_ADDRESS
     if (tellme == NO_ADDRESS)  
-      p = _("The requested name is valid but does not have an IP address: ");
+      return _("The requested name is valid but does not have an IP address: ");
 #endif
 #ifdef NO_RECOVERY
     if (tellme == NO_RECOVERY)  
-      p = _("A non-recoverable name server error occurred: ");
+      return _("A non-recoverable name server error occurred: ");
 #endif
 #ifdef TRY_AGAIN
     if (tellme == TRY_AGAIN)  
-      p = _("A temporary error occurred on an authoritative name server. The specified host is unknown: ");
-#endif
-    if (!p) p =  _("Unknown error");
-    sl_strlcpy(errbuf, p, len);
-    return errbuf;
+      return _("A temporary error occurred on an authoritative name server. The specified host is unknown: ");
+#endif
+    return _("Unknown error");
+}
+
+int is_numeric (const char * address)
+{
+  int j;
+  int len = sl_strlen(address);
+  
+  for (j = 0; j < len; ++j)
+    if ( (address[j] < '0' || address[j] > '9') && address[j] != '.')
+      return (1 == 0);
+  return (1 == 1);
 }
 
@@ -509,5 +375,5 @@
 typedef struct _sin_cache {
   char * address;
-  struct sh_sockaddr  saddr;
+  struct sockaddr_in sin;
   struct _sin_cache * next;
 } sin_cache;
@@ -519,5 +385,5 @@
 {
   sin_cache * check_cache = conn_cache;
-  sin_cache * old_entry;
+  sin_cache * old_entry   = conn_cache;
 
   SL_ENTER(_("delete_cache"));
@@ -539,10 +405,9 @@
 int DoReverseLookup = S_TRUE;
 
-int set_reverse_lookup (const char * c)
+int set_reverse_lookup (char * c)
 {
   return sh_util_flagval(c, &DoReverseLookup);
 }
 
-#if !defined(USE_IPVX)
 int connect_port (char * address, int port, 
 		  char * ecall, int * errnum, char * errmsg, int errsiz)
@@ -555,20 +420,14 @@
   char   * host_name;
 
-  volatile int    fd = (-1);
+  int    fd = (-1);
   int    status;
-  volatile int    fail   = 0;
+  int    fail   = 0;
   int    cached = 0;
 
   int    retval;
-  char   errbuf[SH_ERRBUF_SIZE];
 
   sin_cache * check_cache = conn_cache;
 
   SL_ENTER(_("connect_port"));
-
-  if (tools_debug)
-    fprintf(stderr, _("-00- <%s> <%d> no IPv6 support\n"), address, port);
-
-  if (errsiz > 0) errmsg[0] = '\0';
 
   /* paranoia -- should not happen
@@ -581,26 +440,12 @@
       while (check_cache && check_cache->address)
 	{
-          if (tools_debug)
-            fprintf(stderr, _("-01- <%s> <%s>\n"), 
-                    address, check_cache->address);
-
 	  if ( 0 == sl_strncmp(check_cache->address, 
-			       address, sl_strlen(address)) )
+			       address, sl_strlen(address)))
 	    {
-	      memcpy (&sinr, &((check_cache->saddr).sin), sizeof(struct sockaddr_in));
+	      memcpy (&sinr, &(check_cache->sin), sizeof(struct sockaddr_in));
 	      sinr.sin_family = AF_INET;
 	      sinr.sin_port   = htons (port);
 	      cached = 1;
 	      break;
-	    }
-	  if (tools_debug)
-	    {
-	      char eaddr[SH_IP_BUF];
-	      sl_strlcpy(eaddr, 
-			 inet_ntoa(*(struct in_addr *) &(sinr.sin_addr)), 
-			 sizeof(eaddr));
-	      fprintf(stderr, _("-02- <AF_INET> <%s> <%d> <%d>\n"), 
-		      eaddr,
-		      port, cached);
 	    }
 	  if (check_cache->next)
@@ -615,6 +460,4 @@
   if (cached == 0)
     {
-      if (tools_debug)
-        fputs(_("-03- not cached\n"), stderr); 
 #ifdef HAVE_INET_ATON
       if (0 == inet_aton(address, &haddr))
@@ -623,8 +466,5 @@
 #endif
 	{
-	  SH_MUTEX_LOCK(mutex_resolv);
-
-	  host_name = NULL;
-
+      
 	  host_entry = sh_gethostbyname(address);
 
@@ -637,5 +477,5 @@
 	      *errnum = 666;
 #endif
-	      (void) sh_tools_errmessage (*errnum, errmsg, errsiz);
+	      sl_strlcpy(errmsg, sh_tools_errmessage (*errnum), errsiz);
 	      sl_strlcat(errmsg, address, errsiz); 
 	      fail = (-1);
@@ -647,11 +487,4 @@
 	      sinr.sin_addr   = *(struct in_addr *) host_entry->h_addr;
 
-	      if (tools_debug)
-                fprintf(stderr, 
-			_("-04- <%s> <%s> hostent->h_name %s <%s> hostent->h_addr\n"), 
-                        address, 
-			(host_entry->h_name == NULL) ? _("NULL") : host_entry->h_name,
-			(host_entry->h_addrtype == AF_INET) ? _("AF_INET") : _("AF_INET6"),
-			inet_ntoa(*(struct in_addr *) &(sinr.sin_addr)));
 
 	      /* reverse DNS lookup
@@ -666,5 +499,10 @@
 		  else
 		    {
-		      host_name = sh_util_strdup(host_entry->h_name);
+		      host_name = SH_ALLOC(sl_strlen(host_entry->h_name) + 1);
+		      if (sl_strlen(host_entry->h_name) > 0)
+			strcpy(host_name,                /* known to fit  */
+			       host_entry->h_name);
+		      else
+			host_name[0] = '\0';
 		    }
 
@@ -680,5 +518,6 @@
 		      *errnum = 666;
 #endif
-		      (void) sh_tools_errmessage (*errnum, errmsg, errsiz);
+		      sl_strlcpy(errmsg, 
+				 sh_tools_errmessage (*errnum), errsiz);
 		      sl_strlcat(errmsg, 
 				 inet_ntoa (*(struct in_addr *) &(sinr.sin_addr)),
@@ -690,5 +529,5 @@
 		      *errnum = 0;
 		      if (sl_strlen(host_entry->h_name) == 0 || 
-			  (*errnum = sl_strcasecmp(host_name,host_entry->h_name)) != 0)
+			  (*errnum = sl_strcmp(host_name,host_entry->h_name)) != 0)
 			{ 
 			  if (*errnum)
@@ -696,5 +535,5 @@
 			  else
 			    sl_strlcpy(ecall, _("strlen"), SH_MINIBUF);
-			  sl_strlcpy(errmsg, _("Reverse lookup failed: "), 
+			  sl_strlcpy(errmsg, _("Reverse lookup failed."), 
 				     errsiz);
 			  sl_strlcat(errmsg, address, errsiz);
@@ -706,8 +545,8 @@
 			}
 		    }
+
+		  SH_FREE(host_name);
 		}
 	    }
-	  SH_MUTEX_UNLOCK(mutex_resolv);
-	  if (host_name) SH_FREE(host_name);
 	}
   
@@ -717,10 +556,4 @@
 	  sinr.sin_port   = htons (port);
 	  sinr.sin_addr   = haddr;
-
-	  if (tools_debug)
-	    fprintf(stderr, 
-		    _("-04- <%s> is_numeric AF_INET <%s> \n"), 
-		    address, 
-		    inet_ntoa(*(struct in_addr *) &(sinr.sin_addr)));
 	}
 
@@ -733,7 +566,5 @@
 	  check_cache->address = SH_ALLOC(sl_strlen(address) + 1);
 	  sl_strlcpy (check_cache->address, address, sl_strlen(address) + 1);
-
-	  sh_ipvx_save(&(check_cache->saddr), AF_INET, (struct sockaddr *) &sinr);
-
+	  memcpy(&(check_cache->sin), &sinr, sizeof(struct sockaddr_in));
 	  ++cached_addr;
 	  
@@ -763,5 +594,5 @@
 	sl_strlcpy(ecall, _("socket"), SH_MINIBUF);
 	*errnum = status;
-	sl_strlcpy(errmsg, sh_error_message (status, errbuf, sizeof(errbuf)), errsiz);
+	sl_strlcpy(errmsg, sh_error_message (status), errsiz);
 	sl_strlcat(errmsg, _(", address "), errsiz);
 	sl_strlcat(errmsg, address, errsiz);
@@ -777,11 +608,8 @@
 	sl_strlcpy(ecall, _("connect"), SH_MINIBUF);
 	*errnum = status;
-	sl_strlcpy(errmsg, sh_error_message (status, errbuf, sizeof(errbuf)), errsiz);
-	sl_strlcat(errmsg, 
-		   (sinr.sin_family == AF_INET) ? _(", AF_INET ") : _(", AF_INET6 "),
-		   errsiz);
+	sl_strlcpy(errmsg, sh_error_message (status), errsiz);
 	sl_strlcat(errmsg, _(", address "), errsiz);
 	sl_strlcat(errmsg, address, errsiz);
-	sl_close_fd(FIL__, __LINE__, fd);
+	close(fd);
 	fail = (-1); 
       }
@@ -791,291 +619,4 @@
   SL_RETURN(retval, _("connect_port"));
 }
-#else
-int connect_port (char * address, int port, 
-		  char * ecall, int * errnum, char * errmsg, int errsiz)
-{
-  struct sockaddr_in *sin;
-  struct sockaddr_in6 *sin6;
-  struct sh_sockaddr ss;
-  sin_cache * check_cache = conn_cache;
-  int    cached = 0;
-  int    fail   = 0;
-  int    fd     = -1;
-  int    status = 0;
-
-  int    retval;
-  char   errbuf[SH_ERRBUF_SIZE];
-
-  SL_ENTER(_("connect_port"));
-
-  /* paranoia -- should not happen
-   */
-  if (cached_addr > 128)
-    delete_cache();
-
-  if (tools_debug)
-    fprintf(stderr, _("-00- <%s> <%d>\n"), address, port);
-
-  if (check_cache != NULL)
-    {
-      while (check_cache && check_cache->address)
-	{
-	  if (tools_debug)
-	    fprintf(stderr, _("-01- <%s> <%s>\n"), 
-		    address, check_cache->address);
-
-	  if ( 0 == sl_strcmp(check_cache->address, address) )
-	    {
-	      memcpy (&ss, &(check_cache->saddr), sizeof(struct sh_sockaddr));
-	      switch (ss.ss_family) 
-		{
-		case AF_INET:
-		  sin = &(ss.sin);
-		  sin->sin_port   = htons (port);
-		  cached = 1;
-		  break;
-		case AF_INET6:
-		  sin6 = &(ss.sin6);
-		  sin6->sin6_port  = htons (port);
-		  cached = 1;
-		  break;
-		default:
-		  break;
-		}
-	      if (tools_debug)
-		{
-		  char eaddr[SH_IP_BUF];
-		  sh_ipvx_ntoa(eaddr, sizeof(eaddr), &ss);
-		  fprintf(stderr, _("-02- <%s> <%s> <%d> <%d>\n"), 
-			  (ss.ss_family == AF_INET) ? _("AF_INET") : _("AF_INET6"),
-			  eaddr,
-			  port, cached);
-		}
-	      break;
-	    }
-	  if (check_cache->next)
-	    check_cache = check_cache->next;
-	  else
-	    check_cache = NULL;
-	}
-    }
-
-  if (cached != 0)
-    {
-      if (tools_debug)
-	fputs(_("-03- cached\n"), stderr); 
-      /* cppcheck-suppress uninitStructMember */
-      fd = socket(ss.ss_family, SOCK_STREAM, 0);
-      if (fd < 0) 
-	{
-	  status = errno;
-	  fail   = (-1);
-	  sl_strlcpy(ecall, _("socket"), SH_MINIBUF);
-	  *errnum = status;
-	  sl_strlcpy(errmsg, sh_error_message (status, errbuf, sizeof(errbuf)), errsiz);
-	  sl_strlcat(errmsg, _(", address "), errsiz);
-	  sl_strlcat(errmsg, address, errsiz);
-	}
-
-
-      if (fail != (-1)) 
-	{
-	  /* cppcheck-suppress uninitStructMember */
-	  int addrlen = SH_SS_LEN(ss);
-
-	  if ( retry_connect(FIL__, __LINE__, fd, 
-			     sh_ipvx_sockaddr_cast(&ss), addrlen) < 0) 
-	    {
-	      status = errno;
-	      sl_strlcpy(ecall, _("connect"), SH_MINIBUF);
-	      *errnum = status;
-	      sl_strlcpy(errmsg, sh_error_message (status, errbuf, sizeof(errbuf)), errsiz);
-	      sl_strlcat(errmsg, _(", address "), errsiz);
-	      sl_strlcat(errmsg, address, errsiz);
-	      sl_close_fd(FIL__, __LINE__, fd);
-	      fail = (-1); 
-	    }
-	}
-
-      if (fail != 0)
-	{
-	  delete_cache();
-	  cached = 0;
-	}
-    }
-
-  if (cached == 0)
-    {
-      int    res;
-      char   sport[32];
-      struct addrinfo *ai;
-      struct addrinfo hints;
-
-      if (tools_debug)
-	fputs(_("-03- not cached\n"), stderr);
-
-      memset (&hints, 0, sizeof (hints));
-      hints.ai_flags = AI_ADDRCONFIG;
-#if defined(AI_CANONNAME)
-      hints.ai_flags |= AI_CANONNAME;
-#endif 
-      hints.ai_family   = AF_UNSPEC;
-      hints.ai_socktype = SOCK_STREAM;
-      sl_snprintf(sport, sizeof(sport), "%d", port);
-
-      res = getaddrinfo (address, sport, &hints, &ai);
-      if (res != 0)
-	{
-	  fail = (-1);
-	  status = errno;
-	  sl_strlcpy(ecall, _("getaddrinfo"), SH_MINIBUF);
-	  *errnum = status;
-	  sl_strlcpy(errmsg, gai_strerror (res), errsiz);
-	  sl_strlcat(errmsg, _(", address "), errsiz);
-	  sl_strlcat(errmsg, address, errsiz);
-	}
-
-      if (fail != (-1) && (DoReverseLookup == S_TRUE) && !sh_ipvx_is_numeric(address))
-	{
-	  struct addrinfo *p = ai;
-	  int    success = 0;
-	  char hostname[SH_BUFSIZE];
-	  const char * canonical;
-
-
-#if defined(AI_CANONNAME)
-	  if (ai->ai_canonname && strlen(ai->ai_canonname) > 0)
-	    {
-	      canonical = ai->ai_canonname;
-	      if (tools_debug)
-		fprintf(stderr, _("-04- <%s> <%s> ai->ai_canonname\n"), 
-			address, canonical);
-	    }
-	  else
-	    {
-	      canonical = address;
-	      if (tools_debug)
-		fprintf(stderr, _("-04- <%s> <%s> defined ai_canonname\n"), 
-			address, canonical);
-	    }
-#else
-	  canonical = address;
-	  if (tools_debug)
-	    fprintf(stderr, _("-04- <%s> <%s> not defined ai_canonname\n"), 
-		    address, canonical);
-#endif
-
-	  while (p != NULL)
-	    {
-	      int e = getnameinfo (p->ai_addr, p->ai_addrlen, 
-				   hostname, sizeof(hostname),
-				   NULL, 0, NI_NAMEREQD);
-	      
-	      if (e == 0)
-		{
-		  if (tools_debug)
-		    {
-		      fprintf(stderr, _("-05- <%s> <%s> <%s>\n"), 
-			      (p->ai_family == AF_INET) ? _("AF_INET") : _("AF_INET6"),
-			      sh_ipvx_print_sockaddr (p->ai_addr, p->ai_family),
-			      hostname);
-		    }
-
-		  if (sl_strcasecmp(hostname, canonical) == 0)
-		    {
-		      if (tools_debug)
-			fprintf(stderr, _("-06- <%s> <%s> match\n"), 
-				hostname, canonical);
-		      success = 1;
-		      break;
-		    }
-
-		}
-	    
-	      p = p->ai_next;
-	    }
-
-	  if (success == 0)
-	    {
-	      sl_strlcpy(ecall, _("strcmp"), SH_MINIBUF);
-	      sl_strlcpy(errmsg, _("Reverse lookup failed: "), 
-			 errsiz);
-	      sl_strlcat(errmsg, address, errsiz);
-	      fail = -1;
-	      freeaddrinfo (ai);
-	    }
-	}
-
-      if (fail != (-1))
-	{
-	  struct addrinfo *p = ai;
-
-	  while (p != NULL)
-	    {
-	      if ( (SOCK_STREAM == p->ai_socktype) &&
-		   ((p->ai_family == AF_INET) || (p->ai_family == AF_INET6)) )
-		{
-		
-		  fd = socket(p->ai_family, SOCK_STREAM, 0);
-		  
-		  if (fd != (-1))
-		    {
-		      if (retry_connect(FIL__, __LINE__, fd, 
-					p->ai_addr, p->ai_addrlen) >= 0)
-			{
-			  /* put it into the cache
-			   */
-			  check_cache          = SH_ALLOC(sizeof(sin_cache));
-			  check_cache->address = SH_ALLOC(sl_strlen(address) + 1);
-			  sl_strlcpy (check_cache->address, address, sl_strlen(address) + 1);
-			  
-			  sh_ipvx_save(&(check_cache->saddr), p->ai_family, p->ai_addr);
-			  
-			  ++cached_addr;
-			  
-			  if (conn_cache)
-			    {
-			      if (conn_cache->next)
-				check_cache->next    = conn_cache->next;
-			      else
-				check_cache->next    = NULL;
-			      conn_cache->next     = check_cache;
-			    }
-			  else
-			    {
-			      check_cache->next    = NULL;
-			      conn_cache           = check_cache;
-			    }
-			  
-			  freeaddrinfo (ai);
-			  goto end;
-			}
-		      status = errno;
-		      sl_close_fd(FIL__, __LINE__, fd);
-		    }
-		  else
-		    {
-		      status = errno;
-		    }
-		}
-	      p = p->ai_next;
-	    }
-	  fail = (-1);
-	  freeaddrinfo (ai);
-
-	  sl_strlcpy(ecall, _("connect"), SH_MINIBUF);
-	  *errnum = status;
-	  sl_strlcpy(errmsg, sh_error_message (status, errbuf, sizeof(errbuf)), errsiz);
-	  sl_strlcat(errmsg, _(", address "), errsiz);
-	  sl_strlcat(errmsg, address, errsiz);
-	}
-    }
-
- end:
-  retval = (fail < 0) ? (-1) : fd;
-  SL_RETURN(retval, _("connect_port"));
-
-}
-#endif
 
 int connect_port_2 (char * address1, char * address2, int port, 
@@ -1117,5 +658,5 @@
 }
 
-#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT)
 static
 int sh_write_select(int type, int sockfd, 
@@ -1129,8 +670,14 @@
   int    num_sel;
   
-  char    errbuf[SH_ERRBUF_SIZE];
+  struct  sigaction  new_act;
+  struct  sigaction  old_act;
 
   SL_ENTER(_("sh_write_select"));
 
+  /* ignore SIGPIPE (instead get EPIPE if connection is closed)
+   */
+  new_act.sa_handler = SIG_IGN;
+  sigaction (SIGPIPE, &new_act, &old_act);
+  
   FD_ZERO(&fds);
   FD_SET(sockfd, &fds);
@@ -1157,13 +704,10 @@
 		continue;
 	      }
-	    if ( errno == EINTR || errno == EINPROGRESS ) /* try again */
+	    if ( errno == EINTR) /* try again */
 	      continue;
 	    *w_error = errno;
-
-	    sh_error_message(*w_error, errbuf, sizeof(errbuf));
-	    sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			     errbuf,
-			     _("sh_write_select (ws)") ); 
-	    TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), errbuf ));
+	    TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), 
+		  sh_error_message(*w_error)));
+	    sigaction (SIGPIPE, &old_act, NULL);
 	    SL_RETURN( countbytes, _("sh_write_select"));
 	  }
@@ -1178,13 +722,10 @@
 		continue;
 	      }
-	    if ( errno == EINTR || errno == EINPROGRESS ) /* try again */
+	    if ( errno == EINTR ) /* try again */
 	      continue;
 	    *w_error = errno;
-
-	    sh_error_message(*w_error, errbuf, sizeof(errbuf));
-	    sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			     errbuf,
-			     _("sh_write_select (rs)") ); 
-	    TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), errbuf ));
+	    TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), 
+		  sh_error_message(*w_error)));
+	    sigaction (SIGPIPE, &old_act, NULL);
 	    SL_RETURN( countbytes, _("sh_write_select"));
 	  }
@@ -1210,5 +751,5 @@
 	    *w_error = 0;
 #endif
-
+	    sigaction (SIGPIPE, &old_act, NULL);
 	    TPT(( 0, FIL__, __LINE__, _("msg=<Timeout>\n")));
 	    SL_RETURN( countbytes, _("sh_write_select"));
@@ -1236,10 +777,5 @@
 	  {
 	    *w_error = errno;
-
-	    sh_error_message(*w_error, errbuf, sizeof(errbuf));
-	    sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN,
-			     errbuf,
-			     (type == SH_DO_WRITE) ? 
-			     _("sh_write_select (w)") : _("sh_write_select (r)")); 
+	    sigaction (SIGPIPE, &old_act, NULL);
 	    TPT(( 0, FIL__, __LINE__, _("msg=<count < 0>\n")));
 	    SL_RETURN( countbytes, _("sh_write_select"));
@@ -1248,5 +784,5 @@
 	  {
 	    *w_error = errno;
-
+	    sigaction (SIGPIPE, &old_act, NULL);
 	    TPT(( 0, FIL__, __LINE__, _("msg=<count == 0>\n")));
 	    SL_RETURN( countbytes, _("sh_write_select"));
@@ -1255,4 +791,9 @@
   }
 
+
+  /* restore signal handler
+   */
+  sigaction (SIGPIPE, &old_act, NULL);
+
   *w_error = 0;
 
@@ -1262,9 +803,10 @@
 #endif
 
-#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined (SH_WITH_CLIENT)
 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 
 			  int * w_error, int timeout)
 {
   unsigned long bytes;
+  char errmsg[256];
 
   SL_ENTER(_("write_port"));
@@ -1273,8 +815,7 @@
   if (*w_error != 0)
     {
-      char errbuf[SH_ERRBUF_SIZE];
+      sl_strlcpy(errmsg, sh_error_message (*w_error), sizeof(errmsg));
       sh_error_handle((-1), FIL__, __LINE__, *w_error, MSG_TCP_NETRP, 
-		      sh_error_message (*w_error, errbuf, sizeof(errbuf)),
-		      (long) sockfd, _("write_port"));
+		      errmsg, (long) sockfd, _("write_port"));
     }
   SL_RETURN( bytes, _("write_port"));
@@ -1282,5 +823,5 @@
 #endif
 
-#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT)
 
 unsigned long read_port (int sockfd, char *buf, unsigned long nbytes, 
@@ -1288,4 +829,5 @@
 {
   unsigned long bytes;
+  char errmsg[256];
 
   SL_ENTER(_("read_port"));
@@ -1294,8 +836,7 @@
   if (*w_error != 0)
     {
-      char errbuf[SH_ERRBUF_SIZE];
+      sl_strlcpy(errmsg, sh_error_message (*w_error), sizeof(errmsg));
       sh_error_handle((-1), FIL__, __LINE__, *w_error, MSG_TCP_NETRP, 
-		      sh_error_message (*w_error, errbuf, sizeof(errbuf)),
-		      (long) sockfd, _("read_port"));
+		      errmsg, (long) sockfd, _("read_port"));
     }
   SL_RETURN( bytes, _("read_port"));
@@ -1318,5 +859,5 @@
 #endif
 
-#if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined (SH_WITH_CLIENT)
 
 int check_request (char * have, char * need)
@@ -1372,95 +913,9 @@
 #endif
 
-#if defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER)
-
 #if defined (SH_WITH_CLIENT)
 
-static int           probe_done = S_FALSE;
-static unsigned char probe_flag = '\0';
-
-void sh_tools_probe_reset()
-{
-  probe_done = S_FALSE;
-  probe_flag = '\0';
-  return;
-}
-
-#ifdef SH_ENCRYPT
-static int probe_ok(int flag)
-{
-  (void) flag;
-  if ((probe_flag & SH_PROTO_IVA) != 0)
-    return S_TRUE;
-  return S_FALSE;
-}
-#endif
-
-static unsigned char probe_header_set(unsigned char protocol)
-{
-  if (probe_done || (protocol & SH_PROTO_SRP) == 0)
-    return 0;
-
-  return (char) SH_PROTO_IVA;
-}
-
-static void probe_header_get(unsigned char protocol)
-{
-  if (probe_done || (protocol & SH_PROTO_SRP) == 0)
-    return;
-
-  /* If the server doesn't know about it,
-   * it will simply mirror it back. */
-  
-  if ((protocol & SH_PROTO_IVA) != 0)
-    {
-      /* probe was mirrored */;
-    }
-  else
-    {
-      /* probe was UNset */
-      probe_flag |= SH_PROTO_IVA;
-    }
-  probe_done = S_TRUE;
-  return;
-}
-
-#else
-static unsigned char probe_header_set(unsigned char protocol) { 
-  (void) protocol; return 0; }
-static void probe_header_get(unsigned char protocol) { 
-  (void) protocol; return; }
-void sh_tools_probe_reset() { return; }
-
-unsigned char sh_tools_probe_store(unsigned char protocol, int * probe_flag)
-{
-  if ((protocol & SH_PROTO_SRP) == 0)
-    return protocol;
-
-  if ((protocol & SH_PROTO_IVA) != 0)
-    {
-      /* probe received */
-      *probe_flag |=  SH_PROTO_IVA;
-      protocol    &= ~SH_PROTO_IVA;
-    }
-  return protocol; 
-}
-
-#ifdef SH_ENCRYPT
-static int probe_ok(int flag)
-{
-  if ((flag & SH_PROTO_IVA) != 0)
-    return S_TRUE;
-  return S_FALSE;
-}
-#endif
-
-#endif
-
-
 void get_header (unsigned char * head, unsigned long * bytes, char * u)
 {
   SL_ENTER(_("get_header"));
-
-  probe_header_get(head[0]);
 
   *bytes = 
@@ -1482,5 +937,5 @@
 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
 
-#ifdef  SH_ENCRYPT
+#ifdef  SH_ENCRYPT_2
 #define TRANS_BYTES 65120
 #else
@@ -1488,8 +943,7 @@
 #endif
 
-void put_header (unsigned char * head, const int protocol, 
+void put_header (unsigned char * head, int protocol, 
 		 unsigned long * length, char * u)
 {
-  unsigned char probe = probe_header_set(protocol);
 
   /* static long transfer_limit = (8 * SH_BUFSIZE); V0.8 */
@@ -1498,5 +952,5 @@
   SL_ENTER(_("put_header"));
 
-  head[0]   = protocol|probe;
+  head[0]   = protocol;
 
   ASSERT((*length < transfer_limit), _("*length < transfer_limit"))
@@ -1524,4 +978,5 @@
   SL_RET0(_("put_header"));
 }
+#endif
 
 /* ------------------------------------------
@@ -1538,10 +993,13 @@
  * (msg_size = payload_size - key_len = payload_size - 48)
  */ 
-
-/* 
- * only SH_V2_FULLSIZE is used, and only once
- */
-
+#ifdef SH_WITH_SERVER
+#define SH_V2_FULLSIZE  240
+#define SH_V2_PAYLOAD   224
+#define SH_V2_MESSAGE   176
+#else
 #define SH_V2_FULLSIZE 1024
+#define SH_V2_PAYLOAD  1008
+#define SH_V2_MESSAGE   960
+#endif
 
 #ifdef SH_ENCRYPT
@@ -1577,8 +1035,8 @@
       SH_IS_ASCII(head[5]) && isalpha(head[5]) &&			   
       SH_IS_ASCII(head[6]) && isalpha(head[6])) {
-    fprintf(stderr, _("%c %3o %s %5d  %c  %c  %c  %c\n"), sign,
+    fprintf(stderr, "%c %3o %s %5d  %c  %c  %c  %c\n", sign,
 	    head[0], code, msg_size, head[3], head[4], head[5], head[6]); 
   } else {
-    fprintf(stderr, _("%c %3o %s %5d %2X %2X %2X %2X\n"), sign,
+    fprintf(stderr, "%c %3o %s %5d %2X %2X %2X %2X\n", sign,
 	    head[0], code, msg_size, head[3], head[4], head[5], head[6]); 
   }
@@ -1587,5 +1045,4 @@
 
 #ifdef SH_ENCRYPT
-
 /*
  * #define DEBUG_EN2
@@ -1594,29 +1051,25 @@
  * last 4 bytes of outgoing header are set to dummy value
  */
-char * sh_tools_makePack (unsigned char * header, int flag,
-			  char * payload, unsigned long payload_size,
+char * sh_tools_makePack (unsigned char * header, 
+			  char * payload, int payload_size,
 			  keyInstance * keyInstE)
 {
-  BYTE            inBlock[B_SIZ]; 
-  BYTE            outBlock[B_SIZ];
-  char            ivBlock[B_SIZ];
-
-  UINT32          rpad[3];
+  UINT32 rpad[3];
   unsigned char   head[16];
-  double          epad;
-  unsigned long   i_epad = 0;
-  unsigned long   i_blk = payload_size / 16;
-  unsigned long   i_blkmax = SH_V2_FULLSIZE / 16;
-  unsigned long   pads = 0;
-  size_t          full_size;
-  char          * full_ret;
-
-  unsigned char * p;
-  int             j;
-  cipherInstance  cipherInst;
-  int             err_num;
-  int             blkfac;
-  int             oflow = 0;
-  char expbuf[SH_ERRBUF_SIZE];
+  double epad;
+  int    i_epad = 0;
+  int    i_blk = payload_size / 16;
+  int    i_blkmax = SH_V2_FULLSIZE / 16;
+  int    pads = 0;
+  int    full_size;
+  char * full_ret;
+
+  char                  * p;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
+  int                     j;
+  cipherInstance          cipherInst;
+  int                     err_num;
+  int                     blkfac;
 
   /* 
@@ -1624,13 +1077,19 @@
   */
   if ((i_blk * 16) != payload_size) ++i_blk;
-
+#ifdef DEBUG_EN2
+  fprintf(stderr, "SEND <%d> blocks <%d>\n", payload_size, i_blk);
+#endif
   /* random_pad
    */
-  rpad[1] = taus_get ();
+  rpad[1] = taus_get (&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
   memcpy (head,      &rpad[1],    4);
-  rpad[0] = taus_get ();
+  rpad[0] = taus_get (&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
   memcpy (&head[4],  &rpad[0],    4);
-  rpad[2] = taus_get ();
+  rpad[2] = taus_get (&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
   memcpy (&head[8],  &rpad[2],    4);
+
+  /* protocol
+   */
+  /* memcpy (&head[8],  &header[3], 4); */
 
   /* size (payload)
@@ -1643,38 +1102,39 @@
   if (i_blk < i_blkmax) 
   {
-    pads   = i_blkmax - i_blk;
-    epad   = taus_get_double (&rpad);
-    i_epad = (unsigned long) (pads * epad);
+    pads = i_blkmax - i_blk;
+    /* memcpy((char *) &rpad[2], &head[12], 4); */
+    epad = taus_get_double (&rpad);
+#ifdef DEBUG_EN2
+    fprintf(stderr, "PAD1 <%d> <%f>\n", pads, epad);
+#endif
+    i_epad = (int) (pads * epad);
+#ifdef DEBUG_EN2
+    fprintf(stderr, "PAD2 <%d> <%d>\n", i_epad, (i_epad*16));
+#endif
   }
 
-  full_size =  16;                        /* head     */
-  if (sl_ok_muls(i_blk, 16) && sl_ok_adds(full_size, (i_blk*16)))
-    full_size =  full_size + (i_blk*16);  /* payload  */
-  else
-    oflow = 1;
-  if (sl_ok_adds(full_size, (i_epad*16)))
-    full_size =  full_size + (i_epad*16); /* pad      */
-  else
-    i_epad = 0;
-
-  if (oflow)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      _("integer overflow"), 
-		      _("sh_tools_makePack"));
-    }
+  full_size = 
+  /* head     */ 16 + 
+  /* payload  */ (i_blk*16) + /* payload_size + */ 
+  /* pad      */ (i_epad * 16);
 
   full_ret = SH_ALLOC(full_size);
-
   memcpy(full_ret,                   head,    16);
-  if (payload != NULL && !oflow)
-    memcpy(&full_ret[16],              payload, payload_size);
-
-  if ((i_blk*16) > payload_size && !oflow) 
-    {
-      memset(&full_ret[16+payload_size], 0, (i_blk*16) - payload_size);
+  if (payload != NULL)
+    {
+      memcpy(&full_ret[16],              payload, payload_size);
+    }
+  if ((i_blk*16) > payload_size) 
+    {
+#ifdef DEBUG_EN2
+      fprintf(stderr, "SEN2 <%d>\n", (i_blk*16) - payload_size);
+#endif
+      memset(&full_ret[16+payload_size], '\0', (i_blk*16) - payload_size);
       payload_size = i_blk * 16;
     }
-  memset(&full_ret[16+payload_size], 0, i_epad*16);
+  memset(&full_ret[16+payload_size], '\0', i_epad*16);
+#ifdef DEBUG_EN2
+  fprintf(stderr, "SEN3 <%d> <%d>\n", full_size, i_epad*16);
+#endif
 
   /* rewrite header
@@ -1682,46 +1142,31 @@
   header[1]   = (unsigned int)(full_size/256);
   header[2]   = (unsigned int)(full_size - (256 * header[1]));
-
-  p      = (unsigned char *) full_ret; 
-  blkfac = full_size / B_SIZ;
-
-  err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, NULL);
+  /* don't erase protocol from header 
+     memset(&header[3], '\0', 4);
+  */
+  p = full_ret; blkfac = full_size / 16;
+
+  err_num = cipherInit (&cipherInst, MODE_CBC, NULL);
   
-  if (err_num < 0) {
-    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		    errorExplain(err_num, expbuf, sizeof(expbuf)), 
-		    _("sh_tools_makePack: rijndael_cipherInit")); }
-
-  if (probe_ok(flag)) {
-    memcpy(inBlock, p, B_SIZ);
-    err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 
-				    inBlock, 128, outBlock);
-    if (err_num >= 0) {
-      memcpy(p, outBlock, B_SIZ); p += B_SIZ;
-      memcpy(ivBlock, outBlock, sizeof(ivBlock));
-      err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, ivBlock);
-      if (err_num >= 0) {
-	err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 
-					p, 128*(blkfac-1), p);
-      }
-    }
-  }
-
-  else {
-    for (j = 0; j < blkfac; ++j) {
+  if (err_num < 0) 
+    {
+      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+		      errorExplain(err_num), 
+		      _("sh_tools_makePack: cipherInit"));
+    }
+  for (j = 0; j < blkfac; ++j)
+    {
       memcpy(inBlock, p, B_SIZ);
-      err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 
-				      inBlock, 128, outBlock);
-      
-      if (err_num < 0) {
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("sh_tools_makePack: rijndael_blockEncrypt"));
-	break; }
-      
+      err_num = blockEncrypt(&cipherInst, keyInstE, 
+			     inBlock, 128 * BNUM, outBlock);
+      if (err_num < 0)
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			  errorExplain(err_num), 
+			  _("sh_tools_makePack: blockEncrypt"));
+	}
       memcpy(p, outBlock, B_SIZ);
       p += B_SIZ;
     }
-  }
 
   return full_ret;
@@ -1731,68 +1176,55 @@
  * last 4 bytes of incoming header are dummy
  */
-char * sh_tools_revertPack (unsigned char * header, int flag, char * message, 
+char * sh_tools_revertPack (unsigned char * header, char * message, 
 			    keyInstance * keyInstD,
 			    unsigned long message_size)
 {
-  BYTE                    inBlock[B_SIZ]; 
-  BYTE                    outBlock[B_SIZ];
-  char                    ivBlock[B_SIZ];
   unsigned long   msg_size;
   char          * msg_ret;
 
-  unsigned char         * p;
+  char                  * p;
+  RIJ_BYTE                    inBlock[B_SIZ]; 
+  RIJ_BYTE                    outBlock[B_SIZ];
   int                     j;
   cipherInstance          cipherInst;
   int                     err_num;
   int                     blkfac;
-  char expbuf[SH_ERRBUF_SIZE];
 
   msg_size = (256 * (unsigned int)header[1] + (unsigned int)header[2]);
-  if (msg_size > message_size) 
+#ifdef DEBUG_EN2
+  fprintf(stderr, "RECV <%lu>\n", msg_size);
+#endif
+  if (msg_size > message_size) {
     msg_size = message_size;
-
-  p = (unsigned char *) message; blkfac = msg_size / 16;
-
-  err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, NULL);
+#ifdef DEBUG_EN2
+    fprintf(stderr, "RECV TRUNC1 <%lu>\n", msg_size);
+#endif
+  }
+
+  p = message; blkfac = msg_size / 16;
+
+  err_num = cipherInit (&cipherInst, MODE_CBC, NULL);
   
   if (err_num < 0) 
     {
       sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      errorExplain(err_num, expbuf, sizeof(expbuf)), 
-		      _("sh_tools_revertPack: rijndael_cipherInit"));
-    }
-
-  if (probe_ok(flag)) {
-    memcpy(inBlock, p, B_SIZ);
-    err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 
-				    inBlock, 128, outBlock);
-    if (err_num >= 0) {
-      memcpy(p, outBlock, B_SIZ); p += B_SIZ;
-      memcpy(ivBlock, inBlock, sizeof(ivBlock));
-      err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, ivBlock);
-      if (err_num >= 0) {
-	err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 
-					p, 128*(blkfac-1), p);
-      }
-    }
-  }
-
-  else {
-    for (j = 0; j < blkfac; ++j) {
+		      errorExplain(err_num), 
+		      _("sh_tools_revertPack: cipherInit"));
+    }
+  for (j = 0; j < blkfac; ++j)
+    {
       memcpy(inBlock, p, B_SIZ);
-      err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 
-				      inBlock, 128, outBlock);
-  
-      if (err_num < 0) {
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("sh_tools_revertPack: rijndael_blockDecrypt"));
-	break; }
-      
+      err_num = blockDecrypt(&cipherInst, keyInstD, 
+			     inBlock, 128 * BNUM, outBlock);
+      if (err_num < 0)
+	{
+	  sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
+			  errorExplain(err_num), 
+			  _("sh_tools_revertPack: blockDecrypt"));
+	}
       memcpy(p, outBlock, B_SIZ);
       p += B_SIZ;
     }
-  }
-
+  
   /* rewrite size in header
    */
@@ -1806,5 +1238,14 @@
       header[1]   = (unsigned int)(msg_size/256);
       header[2]   = (unsigned int)(msg_size - (256 * header[1]));
-    }
+#ifdef DEBUG_EN2
+      fprintf(stderr, "RECV TRUNC2 <%lu>\n", msg_size);
+#endif
+    }
+#ifdef DEBUG_EN2
+  fprintf(stderr, "REC2 <%lu>\n", msg_size);
+#endif
+  /* protocol
+   */
+  /* memcpy(&header[3], &message[8], 4); */
 
   /* payload 
@@ -1812,20 +1253,24 @@
   msg_ret = SH_ALLOC(msg_size+1);
   if (msg_size > 0)
-    memcpy(msg_ret, &message[16], msg_size);
+    {
+      memcpy(msg_ret, &message[16], msg_size);
+    }
   msg_ret[msg_size] = '\0';
-
+#ifdef DEBUG_EN2
+  fprintf(stderr, "REC3 <%lu>\n", msg_size);
+#endif
   SH_FREE(message);
+
   return msg_ret;
 }
-#endif /* #ifdef SH_ENCRYPT */
+#endif
 
 int sh_tools_hash_add(char * key, char * buf, int buflen)
 {
   char         * theSig;
-  char sigbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_tools_hash_add"));
 
-  theSig = sh_util_siggen (key, buf, buflen, sigbuf, sizeof(sigbuf));
+  theSig = sh_util_siggen (key, buf, buflen);
   sl_strlcat(buf, theSig, buflen + KEY_LEN + 1);
       
@@ -1841,9 +1286,8 @@
   register int   i;
   char         * theSig;
-  char sigbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_tools_hash_vfy"));
 
-  theSig = sh_util_siggen (key, buf, buflen, sigbuf, sizeof(sigbuf));
+  theSig = sh_util_siggen (key, buf, buflen);
   sl_strlcpy(hash, theSig, KEY_LEN+1);
 
@@ -1856,7 +1300,4 @@
   SL_RETURN((1), _("sh_tools_hash_vfy"));
 }
-
-#endif /* defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) */
-
 
 /* ------------------------------------------ */
@@ -1869,9 +1310,8 @@
 {
   char           hash[KEY_LEN+1];
-  char         * temp = NULL;
+  char         * temp;
   register int   i;
   int            total = 0;
   char         * theSig;
-  char sigbuf[KEYBUF_SIZE];
 
 
@@ -1887,30 +1327,22 @@
   ASSERT_RET((buflen >= 0), _("buflen >= 0"), (NULL));
 
-  theSig = sh_util_siggen (key, buf, buflen, sigbuf, sizeof(sigbuf));
+  theSig = sh_util_siggen (key, buf, buflen);
   sl_strlcpy(hash, theSig, KEY_LEN+1);
 
-  if (sl_ok_adds(buflen, KEY_LEN))
-    {
-      total = KEY_LEN + buflen;
-      temp  = SH_ALLOC (total);
-
-      for (i = 0; i < KEY_LEN; ++i)
-	temp[i] = hash[i];
-
-      for (i = 0; i < buflen; ++i)
-	temp[i+KEY_LEN] = buf[i];
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      _("integer overflow"), 
-		      _("hash_me"));
-      temp = sh_util_strdup(buf);
-    }
+
+  total = KEY_LEN + buflen;
+  temp  = SH_ALLOC (total);
+
+  for (i = 0; i < KEY_LEN; ++i)
+    temp[i] = hash[i];
+
+  for (i = 0; i < buflen; ++i)
+    temp[i+KEY_LEN] = buf[i];
+
   SL_RETURN(temp, _("hash_me"));
 }
 #endif
 
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
+#if defined (SH_WITH_CLIENT)
 
 /* verify the checksum of a buffer; checksum comes first
@@ -1922,5 +1354,4 @@
   register int   i;
   char         * theSig;
-  char sigbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("hash_check"));
@@ -1930,6 +1361,5 @@
 	  (key == NULL) ? "NULL" : key, buflen);
 #endif
-  theSig = sh_util_siggen (key, &buf[KEY_LEN], buflen-KEY_LEN,
-			   sigbuf, sizeof(sigbuf));
+  theSig = sh_util_siggen (key, &buf[KEY_LEN], buflen-KEY_LEN);
   sl_strlcpy(hash, theSig, KEY_LEN+1);
       
@@ -1946,8 +1376,8 @@
 #if defined (SH_WITH_SERVER)
 
-char * get_client_conf_file (const char * peer, unsigned long * length)
+char * get_client_conf_file (char * peer, unsigned long * length)
 {
   char * ret;
-  int    status;
+  int    size, status;
   struct stat buf;
   char * base;
@@ -1955,10 +1385,18 @@
   SL_ENTER(_("get_client_conf_file"));
 
-  base = sh_util_strdup(DEFAULT_DATAROOT);
-  ret = sh_util_strconcat(base, _("/rc."), peer, NULL);
-  if (!ret) 
-    { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_conf_file")); }
-
+  size = sl_strlen(DEFAULT_DATAROOT);
+  base = SH_ALLOC(size + 1);
+  sl_strlcpy(base, DEFAULT_DATAROOT, size + 1); 
+
+  size = sl_strlen(base) + sl_strlen(peer) + 5;
+  ++size;
+
+  ret = SH_ALLOC(size);
+  sl_strlcpy(ret, base, size);
+  sl_strlcat(ret, _("/rc."), size);
+  sl_strlcat(ret, peer, size);
+  
   status = retry_stat (FIL__, __LINE__, ret, &buf);
+
   if (status == 0)
     goto lab_end;
@@ -1967,9 +1405,9 @@
 		    (long) sh.effective.uid, ret);
 
-  SH_FREE(ret); ret = sh_util_strconcat(base, _("/rc"), NULL);
-  if (!ret) 
-    { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_conf_file")); }
+  sl_strlcpy(ret, base, size);
+  sl_strlcat(ret, "/rc", size);
   
   status = retry_stat (FIL__, __LINE__, ret, &buf);
+
   if (status == 0)
     goto lab_end;
@@ -1978,5 +1416,6 @@
 		    (long) sh.effective.uid, ret);
 
-  SH_FREE(base); SH_FREE(ret); *length=0;
+  SH_FREE(base);
+  *length=0;
   SL_RETURN(NULL, _("get_client_conf_file"));
 
@@ -1986,27 +1425,37 @@
       sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN,
 		    _("File too large"), _("get_client_conf_file"));
-      SH_FREE(base); SH_FREE(ret); *length = 0;
+      SH_FREE(base);
       SL_RETURN(NULL, _("get_client_conf_file"));
     }
-
-  SH_FREE(base); *length = (unsigned long) buf.st_size;
+  *length = (unsigned long) buf.st_size;
+  SH_FREE(base);
   SL_RETURN(ret, _("get_client_conf_file"));
 }
 
-char * get_client_data_file (const char * peer, unsigned long * length)
+char * get_client_data_file (char * peer, unsigned long * length)
 {
   char * ret;
-  int    status;
+  int    size, status;
   struct stat buf;
+
   char * base;
 
   SL_ENTER(_("get_client_data_file"));
 
-  base = sh_util_strdup(DEFAULT_DATAROOT);
-  ret = sh_util_strconcat(base, _("/file."), peer, NULL);
-  if (!ret) 
-    { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_data_file")); }
-
+  size = sl_strlen(DEFAULT_DATAROOT);
+  base = SH_ALLOC(size + 1);
+  sl_strlcpy(base, DEFAULT_DATAROOT, size + 1); 
+
+  size = sl_strlen(base) + sl_strlen(peer) + 7;
+
+  ++size;
+
+  ret = SH_ALLOC(size);
+  sl_strlcpy(ret, base, size);
+  sl_strlcat(ret, _("/file."), size);
+  sl_strlcat(ret, peer, size);
+  
   status = retry_stat (FIL__, __LINE__, ret, &buf);
+
   if (status == 0)
     goto lab1_end;
@@ -2015,10 +1464,10 @@
 		    (long) sh.effective.uid, ret);
 
-  SH_FREE(ret); 
-  ret = sh_util_strconcat(base, _("/file"), NULL);
-  if (!ret) 
-    { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_data_file")); }
-
+
+  sl_strlcpy(ret, base, size);
+  sl_strlcat(ret, _("/file"), size);
+  
   status = retry_stat (FIL__, __LINE__, ret, &buf);
+
   if (status == 0)
     goto lab1_end;
@@ -2027,5 +1476,7 @@
 		    (long) sh.effective.uid, ret);
 
-  *length = 0; SH_FREE(base); SH_FREE(ret);
+
+  *length = 0;
+  SH_FREE(base);
   SL_RETURN(NULL, _("get_client_data_file"));
 
@@ -2035,50 +1486,15 @@
       sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN,
 		    _("File too large"), _("get_client_data_file"));
-      SH_FREE(base); SH_FREE(ret); *length = 0;
+      SH_FREE(base);
       SL_RETURN(NULL, _("get_client_data_file"));
     }
-
-  *length = (unsigned long) buf.st_size; SH_FREE(base);
+  *length = (unsigned long) buf.st_size;
+  SH_FREE(base);
   SL_RETURN(ret, _("get_client_data_file"));
-}
-
-char * get_client_uuid_file (const char * peer, unsigned long * length, const char * uuid)
-{
-  char * ret;
-  int    status;
-  struct stat buf;
-  char * base;
-
-  SL_ENTER(_("get_client_uuid_file"));
-
-  base = sh_util_strdup(DEFAULT_DATAROOT);
-  ret = sh_util_strconcat(base, _("/file."), peer, ".", uuid, NULL);
-  SH_FREE(base);
-  if (!ret) 
-    { *length = 0; SL_RETURN(NULL, _("get_client_uuid_file")); }
-
-  status = retry_stat (FIL__, __LINE__, ret, &buf);
-  if (status != 0)
-    {
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_ACCESS,
-		      (long) sh.effective.uid, ret);
-      SH_FREE(ret); *length = 0;
-      SL_RETURN(NULL, _("get_client_uuid_file"));
-    }
-  else if (buf.st_size > 0x7fffffff)
-    {
-      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN,
-		    _("File too large"), _("get_client_uuid_file"));
-      SH_FREE(ret); *length = 0;
-      SL_RETURN(NULL, _("get_client_data_file"));
-    }
-
-  *length = (unsigned long) buf.st_size;
-  SL_RETURN(ret, _("get_client_uuid_file"));
-}
-
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_SIG)
+  
+}
+#endif
+
+#if defined(SH_WITH_CLIENT) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)
 
 /* --------- secure temporary file ------------ */
@@ -2093,15 +1509,21 @@
   int           status = BAD;
   char        * my_tmp_dir;
-  char hashbuf[KEYBUF_SIZE];
+  int           len;
 
   SL_ENTER(_("open_tmp"));
 
 #if defined(SH_TMPDIR)
-  my_tmp_dir = sh_util_strdup(SH_TMPDIR); 
+  len        = sl_strlen(SH_TMPDIR) + 1;
+  my_tmp_dir = SH_ALLOC(len);
+  sl_strlcpy(my_tmp_dir, SH_TMPDIR, len); 
 #else
 #if defined(SH_WITH_SERVER)
-  my_tmp_dir = sh_util_strdup(DEFAULT_LOGDIR); 
+  len        = sl_strlen(DEFAULT_LOGDIR) + 1;
+  my_tmp_dir = SH_ALLOC(len);
+  sl_strlcpy(my_tmp_dir, DEFAULT_LOGDIR, len); 
 #else
-  my_tmp_dir = sh_util_strdup(sh.effective.home);
+  len        = sl_strlen(sh.effective.home) + 1;
+  my_tmp_dir = SH_ALLOC(len);
+  sl_strlcpy(my_tmp_dir, sh.effective.home, len);
 #endif 
 #endif
@@ -2123,15 +1545,13 @@
     /* create random filename in effective users home directory
      */
-    ticks = taus_get ();
+    ticks = taus_get (&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
     if (my_tmp_dir[0] == '/' && my_tmp_dir[1] == '\0')
       file = sh_util_strconcat (my_tmp_dir, 
-				sh_tiger_hash( (char *) &ticks, TIGER_DATA, 4,
-					       hashbuf, sizeof(hashbuf)),
+				sh_tiger_hash( (char *) &ticks, TIGER_DATA, 4),
 				NULL);
     else
       file = sh_util_strconcat (my_tmp_dir, 
 				"/", 
-				sh_tiger_hash( (char *) &ticks, TIGER_DATA, 4,
-					       hashbuf, sizeof(hashbuf)),
+				sh_tiger_hash( (char *) &ticks, TIGER_DATA, 4),
 				NULL);
 
@@ -2148,6 +1568,4 @@
 	SH_FREE (file);
 	SH_FREE(my_tmp_dir);
-	sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			_("Error (lstat) while opening temporary file"), _("open_tmp"));
 	TPT(( 0, FIL__, __LINE__, _("msg=<Unexpected error %d>\n"), error));
 	SL_RETURN((-1), _("open_tmp"));
@@ -2175,12 +1593,13 @@
   } while (status == BAD);
 
-  fd = sl_open_safe_rdwr (FIL__, __LINE__, file, SL_YESPRIV);
+  fd = sl_open_safe_rdwr (file, SL_YESPRIV);
   if (SL_ISERROR(fd))
     {
-      sh_error_handle((-1), FIL__, __LINE__, fd, MSG_E_SUBGEN, 
+      sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, fd, MSG_E_SUBGEN, 
 		      _("Error opening temporary file"), _("open_tmp"));
       TPT(( 0, FIL__, __LINE__, _("msg=<Error %d temporary file %s>\n"), 
 	    fd, file));
     }
+  
 
   SH_FREE (file);
@@ -2216,72 +1635,2 @@
 }
 #endif
-
-/********************************************************
- * Search rotated logfile
- */
-#include <unistd.h>
-#include <libgen.h>
-#include <dirent.h>
-
-char * sh_rotated_log_search(const char * path, struct stat * buf)
-{
-
-  size_t size;
-  int    i;
-  char * searchpath;
-  struct stat sbuf;
-  DIR  * dp;
-  char * dname;
-  char * bname;
-
-  dname  = sh_util_dirname(path);
-  bname  = sh_util_basename(path);
-
-  size = strlen(dname) + strlen(bname) + 4;
-  searchpath = SH_ALLOC(size);
-
-  for (i = 0; i < 2; ++i)
-    {
-      snprintf(searchpath, size, "%s/%s.%1d", dname, bname, i);
-      if (0 == stat(searchpath, &sbuf) && sbuf.st_ino == buf->st_ino)
-	{
-	  SH_FREE(dname);
-	  SH_FREE(bname);
-	  return searchpath;
-	}
-    }
-
-  SH_FREE(searchpath);
-
-  if (NULL != (dp = opendir(dname)))
-    {
-      struct dirent * de;
-
-      while (NULL != (de = readdir(dp)))
-	{
-	  if (0 == strcmp(de->d_name, ".") || 0 == strcmp(de->d_name, ".."))
-	    continue;
-
-	  size = strlen(dname) + strlen(de->d_name) + 2;
-	  searchpath = SH_ALLOC(size);
-	  snprintf(searchpath, size, "%s/%s", dname, de->d_name);
-
-	  if (0 == stat(searchpath, &sbuf) && sbuf.st_ino == buf->st_ino)
-	    {
-	      SH_FREE(dname);
-	      SH_FREE(bname);
-	      closedir(dp);
-	      return searchpath;
-	    }
-	  
-	  SH_FREE(searchpath);
-	}
-      closedir(dp);
-    }
-
-  SH_FREE(dname);
-  SH_FREE(bname);
-
-  return NULL;
-}
-
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 591)
+++ trunk/src/sh_unix.c	(revision 1)
@@ -18,6 +18,4 @@
 /*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
 
-/* cppcheck-suppress-file unknownMacro */
-
 #include "config_xor.h"
 
@@ -27,7 +25,5 @@
 #include <string.h>
 #include <ctype.h>
-#ifdef HAVE_LINUX_FS_H
-#include <linux/fs.h>
-#endif
+
 
 #ifdef HAVE_MEMORY_H
@@ -45,10 +41,4 @@
 #include <fcntl.h>
 #include <unistd.h>
-/* need to undef these, since the #define's may be picked up from
- * linux/wait.h, and will clash with a typedef in sys/wait.h
- */
-#undef P_ALL
-#undef P_PID
-#undef P_PGID
 #include <sys/wait.h>
 
@@ -60,8 +50,14 @@
 #endif
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
 
 #ifdef HAVE_SYS_SELECT_H
@@ -79,5 +75,5 @@
 #endif
 #ifndef FD_ZERO
-#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
+#define FD_ZERO(p)      memset((char *)(p), '\0', sizeof(*(p)))
 #endif
 
@@ -94,10 +90,6 @@
 #include "sh_hash.h"
 #include "sh_tools.h"
-#include "sh_restrict.h"
-#include "sh_ipvx.h"
 #include "sh_tiger.h"
 #include "sh_prelink.h"
-#include "sh_pthread.h"
-#include "sh_sem.h"
 
 /* moved here from far below
@@ -129,22 +121,4 @@
 #endif
 
-#if defined(S_IFDOOR) && !defined(S_ISDOOR)
-#define S_ISDOOR(mode) (((mode) & S_IFMT) == S_IFDOOR)
-#else
-#if !defined(S_ISDOOR)
-#define S_ISDOOR(mode) (0)
-#endif
-#endif
-
-#if defined(S_IFPORT) && !defined(S_ISPORT)
-#define S_ISPORT(mode) (((mode) & S_IFMT) == S_IFPORT)
-#else
-#if !defined(S_ISPORT)
-#define S_ISPORT(mode) (0)
-#endif
-#endif
-
-#define SH_KEY_NULL _("000000000000000000000000000000000000000000000000")
-
 #undef  FIL__
 #define FIL__  _("sh_unix.c")
@@ -153,7 +127,4 @@
 unsigned long mask_USER0        = MASK_USER_;
 unsigned long mask_USER1        = MASK_USER_;
-unsigned long mask_USER2        = MASK_USER_;
-unsigned long mask_USER3        = MASK_USER_;
-unsigned long mask_USER4        = MASK_USER_;
 unsigned long mask_ALLIGNORE    = MASK_ALLIGNORE_;
 unsigned long mask_ATTRIBUTES   = MASK_ATTRIBUTES_;
@@ -171,7 +142,4 @@
   mask_USER0        = MASK_USER_;
   mask_USER1        = MASK_USER_;
-  mask_USER2        = MASK_USER_;
-  mask_USER3        = MASK_USER_;
-  mask_USER4        = MASK_USER_;
   mask_ALLIGNORE    = MASK_ALLIGNORE_;
   mask_ATTRIBUTES   = MASK_ATTRIBUTES_;
@@ -339,6 +307,6 @@
     *p = '0' + (u % 10);
     u /= 10;
-  } while (u && (p != str));
-  if ((iisneg == 1) && (p != str)) {
+  } while (u);
+  if (iisneg == 1) {
     --p;
     *p = '-';
@@ -355,7 +323,7 @@
 extern int OnlyStderr; 
 
-int safe_logger (int thesignal, int method, char * details)
-{
-  unsigned int i = 0;
+int safe_logger (int signal, int method, pid_t thepid)
+{
+  int i = 0;
   int status = -1;
   struct stat buf;
@@ -363,19 +331,17 @@
   char  str[128];
   char  * p;
-  
+
   char l0[64], l1[64], l2[64], l3[64];
-  char a0[32];
+  char a0[32], a1[32], a2[32];
   char e0[128];
   char msg[128];
-  
+
   char * locations[] = { NULL, NULL, NULL, NULL, NULL };
   char * envp[]      = { NULL, NULL };
-  char * argp[]      = { NULL, NULL, NULL };
-  
-  pid_t  thepid = getpid();
-  
+  char * argp[]      = { NULL, NULL, NULL, NULL, NULL };
+
   if ((sh.flag.isdaemon == S_FALSE) || (OnlyStderr == S_TRUE))
     method = 1;
-  
+
   /* seems that solaris cc needs this way of initializing ...
    */
@@ -384,25 +350,35 @@
   locations[2] = l2;
   locations[3] = l3;
-  
+
   envp[0] = e0;
+
   argp[0] = a0;
-  
+  argp[1] = a1;
+  argp[2] = a2;
+
+  strcpy (l0, _("/usr/bin/logger"));                   /* known to fit  */
+  strcpy (l1, _("/usr/sbin/logger"));                  /* known to fit  */
+  strcpy (l2, _("/usr/ucb/logger"));                   /* known to fit  */
+  strcpy (l3, _("/bin/logger"));                       /* known to fit  */
+
+  strcpy (a0, _("logger"));                            /* known to fit  */
+  strcpy (a1, _("-p"));                                /* known to fit  */
+  strcpy (a2, _("daemon.alert"));                      /* known to fit  */
+
+  strcpy (e0,                                          /* known to fit  */
+	  _("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ucb:/usr/local/bin"));
+
   sl_strlcpy(msg, _("samhain["), 128);
   p = safe_itoa((int) thepid, str, 128);
   if (p && *p)
     sl_strlcat(msg, p, 128);
-  if (thesignal == 0)
-    {
-      if (details == NULL) {
-	sl_strlcat(msg, _("]: out of memory"), 128);
-      } else {
-	sl_strlcat(msg, _("]: "), 128);
-	sl_strlcat(msg, details, 128);
-      }
+  if (signal == 0)
+    {
+      sl_strlcat(msg, _("]: out of memory"), 128);
     }
   else 
     {
       sl_strlcat(msg, _("]: exit on signal "), 128);
-      p = safe_itoa(thesignal, str, 128);
+      p = safe_itoa(signal, str, 128);
       if (p && *p)
 	sl_strlcat(msg, p, 128);
@@ -413,24 +389,8 @@
 #define STDERR_FILENO 2
 #endif
-    int retval = 0;
-    do {
-      retval = write(STDERR_FILENO,  msg, strlen(msg));
-    } while (retval < 0 && errno == EINTR);
-    do {
-      retval = write(STDERR_FILENO, "\n", 1);
-    } while (retval < 0 && errno == EINTR);
+    write(STDERR_FILENO,  msg, strlen(msg));
+    write(STDERR_FILENO, "\n", 1);
     return 0;
   }
-
-  sl_strlcpy (l0, _("/usr/bin/logger"), 64);
-  sl_strlcpy (l1, _("/usr/sbin/logger"), 64);
-  sl_strlcpy (l2, _("/usr/ucb/logger"), 64);
-  sl_strlcpy (l3, _("/bin/logger"), 64);
-
-  sl_strlcpy (a0, _("logger"), 32);
-  sl_strlcpy (e0,
-	      _("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ucb:/usr/local/bin"),
-	      128);
-
   while (locations[i] != NULL) {
     status = stat(locations[i], &buf);
@@ -441,5 +401,5 @@
 
   if (locations[i] != NULL) {
-    argp[1] = msg;
+    argp[3] = msg;
     newpid = fork();
     if (newpid == 0) {
@@ -454,27 +414,4 @@
 }
 
-void safe_fatal (const char * details, 
-		 const char * file, int line)
-{
-  char msg[128];
-  char str[128];
-  char * p;
-  int  thesignal = 0;
-  int  method = 0;
-
-  p = safe_itoa((int) line, str, 128);
-  sl_strlcpy(msg, _("FATAL: "), 128);
-  sl_strlcat(msg, file, 128);
-  sl_strlcat(msg, ": ", 128);
-  if (p && (*p)) {
-    sl_strlcat(msg, p   , 128);
-    sl_strlcat(msg, ": ", 128);
-  }
-  sl_strlcat(msg, details, 128);
-  (void) safe_logger (thesignal, method, msg);
-
-  close_ipc ();
-  raise(SIGKILL);
-}
 
 extern char sh_sig_msg[64];
@@ -510,17 +447,11 @@
       ++immediate_exit_normal;
       if ((skey != NULL) && (immediate_exit_normal == 2))
-	memset (skey, 0, sizeof(sh_key_t));
+	memset (skey, '\0', sizeof(sh_key_t));
       if (immediate_exit_normal == 2)
 	{
-	  int val_return;
-
-	  do {
-	    val_return = chdir ("/");
-	  } while (val_return < 0 && errno == EINTR);
-
-          close_ipc ();
-	  safe_logger (mysignal, 0, NULL);
+	  chdir ("/");
+	  safe_logger (mysignal, 0, getpid());
 	}
-      raise(SIGKILL);
+      _exit(mysignal);
     }
   else
@@ -553,8 +484,4 @@
 #endif
 {
-#if defined(SL_DEBUG) && (defined(USE_SYSTEM_MALLOC) || !defined(USE_MALLOC_LOCK))
-  int retval;
-#endif
-
 #if defined(SA_SIGACTION_WORKS)
   if (signal_info != NULL && signal_info->si_code == SI_USER)
@@ -572,11 +499,11 @@
   /* Check whether the heap is ok; otherwise _exit 
    */
-#if !defined(SL_DEBUG) || (!defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK))
+#if !defined(SL_DEBUG)
   ++immediate_exit_fast;
   if (skey != NULL && immediate_exit_fast < 2)
-    memset (skey, 0, sizeof(sh_key_t));
+    memset (skey, '\0', sizeof(sh_key_t));
   if (immediate_exit_fast < 2)
-    safe_logger (mysignal, 0, NULL);
-  raise(SIGKILL);
+    safe_logger (mysignal, 0, getpid());
+  _exit(mysignal);
 #else
 
@@ -587,22 +514,20 @@
       ++immediate_exit_fast;
       if (skey != NULL)
-	memset (skey, 0, sizeof(sh_key_t));
+	memset (skey, '\0', sizeof(sh_key_t));
+#ifdef WITH_MESSAGE_QUEUE
       close_ipc ();
-      safe_logger (mysignal, 0, NULL);
-      do {
-	retval = chdir ("/");
-      } while (retval < 0 && errno == EINTR);
+#endif
+      safe_logger (mysignal, 0, getpid());
+      chdir ("/");
       raise(SIGFPE);
     }
   else if (immediate_exit_fast == 2)
     {
-      do {
-	retval = chdir ("/");
-      } while (retval < 0 && errno == EINTR);
+      chdir ("/");
       raise(SIGFPE);
     }
   else if (immediate_exit_fast != 0)
     {
-      raise(SIGKILL);
+      _exit(mysignal);
     }
 
@@ -617,5 +542,4 @@
   strncpy (sh_sig_msg, sh_unix_siglist(mysignal), 40);
 #endif
-  sh_sig_msg[63] = '\0';
 
   sl_stack_print();
@@ -627,11 +551,10 @@
 
   if (skey != NULL)
-    memset (skey, 0, sizeof(sh_key_t));
+    memset (skey, '\0', sizeof(sh_key_t));
+#ifdef WITH_MESSAGE_QUEUE
   close_ipc ();
-
-  do {
-    retval = chdir ("/");
-  } while (retval < 0 && errno == EINTR);
-
+#endif
+
+  chdir ("/");
   raise(SIGFPE);
 #endif
@@ -650,5 +573,5 @@
   if (mysignal == SIGUSR2)
     {
-      ++sig_suspend_switch;
+      sig_suspend_switch    = 1;
       ++sig_urgent;
     }
@@ -659,14 +582,6 @@
 #endif
 #ifdef SIGTTOU
-  if (mysignal == SIGTTOU) {
-    sig_force_check = 1; sh_sem_trylock(); }
-#endif
-#ifdef SIGTSTP
-  if (mysignal == SIGTSTP) {
-    sig_force_check = 1; sig_force_silent = 1; sh_sem_trylock(); }
-#endif
-#ifdef SIGTTIN
-  if (mysignal == SIGTTIN)
-    sig_fresh_trail = 1;
+  if (mysignal == SIGTTOU)
+    sig_force_check = 1;
 #endif
 #ifdef SIGABRT
@@ -676,5 +591,8 @@
 #ifdef SIGQUIT
   if (mysignal == SIGQUIT)
-    sig_terminate       = 1;
+    {
+      sig_terminate         = 1;
+      ++sig_urgent;
+    }
 #endif
 #ifdef SIGTERM
@@ -690,18 +608,4 @@
 }
 
-void sh_unix_ign_sigpipe()
-{
-  struct sigaction ignact;
-
-  ignact.sa_handler = SIG_IGN;            /* signal action           */
-  sigemptyset( &ignact.sa_mask );         /* set an empty mask       */
-  ignact.sa_flags = 0;                    /* init sa_flags           */
-
-#ifdef SIGPIPE
-  retry_sigaction(FIL__, __LINE__, SIGPIPE,   &ignact, NULL);
-#endif
-
-  return;
-}
 static
 void sh_unix_siginstall (int goDaemon)
@@ -810,5 +714,5 @@
 #endif
 #ifdef SIGTERM
-  retry_sigaction(FIL__, __LINE__, SIGTERM,    &act,  &oldact);
+  retry_sigaction(FIL__, __LINE__, SIGTERM,     &act,  &oldact);
 #endif
 
@@ -836,10 +740,15 @@
 #endif
 #ifdef SIGPIPE
-  retry_sigaction(FIL__, __LINE__, SIGPIPE,   &ignact, &oldact);
+  retry_sigaction(FIL__, __LINE__, SIGPIPE,      &act, &oldact);
 #endif
 #ifdef SIGALRM
   retry_sigaction(FIL__, __LINE__, SIGALRM,   &ignact, &oldact);
 #endif
-
+#ifdef SIGTSTP
+  retry_sigaction(FIL__, __LINE__, SIGTSTP,   &ignact, &oldact);
+#endif
+#ifdef SIGTTIN
+  retry_sigaction(FIL__, __LINE__, SIGTTIN,   &ignact, &oldact);
+#endif
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
 #ifdef SIGTTOU
@@ -849,25 +758,7 @@
     retry_sigaction(FIL__, __LINE__, SIGTTOU,   &ignact, &oldact);
 #endif
-#ifdef SIGTSTP
-  if (goDaemon == 1)
-    retry_sigaction(FIL__, __LINE__, SIGTSTP,     &act2, &oldact);
-  else
-    retry_sigaction(FIL__, __LINE__, SIGTSTP,   &ignact, &oldact);
-#endif
-#ifdef SIGTTIN
-  if (goDaemon == 1)
-    retry_sigaction(FIL__, __LINE__, SIGTTIN,     &act2, &oldact);
-  else
-    retry_sigaction(FIL__, __LINE__, SIGTTIN,   &ignact, &oldact);
-#endif
 #else
-#ifdef SIGTSTP
-  retry_sigaction(FIL__, __LINE__, SIGTSTP,   &ignact, &oldact);
-#endif
 #ifdef SIGTTOU
   retry_sigaction(FIL__, __LINE__, SIGTTOU,   &ignact, &oldact);
-#endif
-#ifdef SIGTTIN
-  retry_sigaction(FIL__, __LINE__, SIGTTIN,   &ignact, &oldact);
 #endif
 #endif
@@ -928,8 +819,7 @@
 /* checksum the own binary
  */
-int sh_unix_self_hash (const char * c)
+int sh_unix_self_hash (char * c)
 {
   char message[512];
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_unix_self_hash"));
@@ -943,5 +833,5 @@
 
   sl_strlcpy(sh.exec.hash,
-	     sh_tiger_hash (c, TIGER_FILE, TIGER_NOLIM, hashbuf, sizeof(hashbuf)), 
+	     sh_tiger_hash (c, TIGER_FILE, 0), 
 	     KEY_LEN+1);
   sl_snprintf(message, 512, _("%s has checksum: %s"),
@@ -950,5 +840,7 @@
   sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN,
 		  message, _("sh_unix_self_hash"));
-  if (0 == sl_strcmp(sh.exec.hash, SH_KEY_NULL ))
+  if (0 == sl_strcmp(sh.exec.hash,
+		     _("000000000000000000000000000000000000000000000000")
+		     ))
     {
       dlog(1, FIL__, __LINE__, 
@@ -966,26 +858,15 @@
   char newhash[KEY_LEN+1];
   char message[512];
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_unix_self_check"));
-  if (sh.exec.path[0] == '\0')
+  if (sh.exec.path == NULL || sh.exec.path[0] == '\0')
     SL_RETURN((0), _("sh_unix_self_check"));
 
-  sl_strlcpy(newhash, 
-	     sh_tiger_hash (sh.exec.path, TIGER_FILE, TIGER_NOLIM, hashbuf, sizeof(hashbuf)), 
-	     KEY_LEN+1);
-  if (0 == sl_strncmp(sh.exec.hash, newhash, KEY_LEN))
-    {
-      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      _("Checksum ok"), _("sh_unix_self_check"));
-      SL_RETURN((0), _("sh_unix_self_check"));
-    }
-
-  if (0 == sl_strncmp(SH_KEY_NULL, newhash, KEY_LEN))
-    {
-      sh_error_handle(SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      _("Could not read samhain executable"), _("sh_unix_self_check"));
-      SL_RETURN((0), _("sh_unix_self_check"));
-    }
+  sl_strlcpy(newhash, sh_tiger_hash (sh.exec.path, TIGER_FILE, 0), KEY_LEN+1);
+  if (0 == sl_strncmp(sh.exec.hash, 
+		      newhash,
+		      KEY_LEN))
+    SL_RETURN((0), _("sh_unix_self_check"));
+
  
   dlog(1, FIL__, __LINE__, 
@@ -1008,121 +889,17 @@
 /* ---------------------------------------------------------------- */
 
-long sh_group_to_gid (const char * g, int * fail)
-{
-  struct group *           w;
-  gid_t                    gid  = 0;
-  int                      status = 0;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  struct group     grp;
-  char           * buffer;
-  static size_t    gbufsize = SH_GRBUF_SIZE;       
-#endif
-
-  *fail = -1;
-
-  if (g)
-    {
-      size_t i;
-      size_t len = strlen(g);
-
-      *fail = 0;
-
-      for (i = 0; i < len; ++i)
-	{
-	  char c = g[i];
-
-	  if (!isdigit((int) c))
-	    goto is_a_name;
-	}
-      return atol(g);
-
-    is_a_name:
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-
-      buffer = SH_ALLOC(gbufsize);
-      status = sh_getgrnam_r(g, &grp, buffer, gbufsize, &w);
-
-      if ((status == ERANGE) && (w == NULL)) 
-	{
-	  if (S_TRUE ==  sl_ok_adds( gbufsize, SH_GRBUF_SIZE ))
-	    {
-	      SH_FREE(buffer);
-	      gbufsize += SH_GRBUF_SIZE;
-	      goto is_a_name;
-	    }
-	}
-
-#else
-
-      errno = 0;
-      w = sh_getgrnam(g);
-      status = errno;
-
-#endif
-
-      if ((status == ERANGE) && (w == NULL)) 
-	{
-	  static int seen = 0;
-	  
-	  if (seen == 0)
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-
-	      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
-			       sh_error_message(status, errbuf, sizeof(errbuf)),
-			       _("sh_group_to_gid"), (long) -1, _("line too long in group entry"));
-	      ++seen;
-	    }
-	  *fail = -1;
-	}
-      else if (w == NULL)
-	{
-	  char * tmp = sh_util_strdup(g);
-	  sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 
-			   _("sh_group_to_gid"), tmp);
-	  SH_FREE(tmp);
-	  *fail = -1;
-	}
-      else
-	{
-	  gid = w->gr_gid;
-	}
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
-    }
-
-  return gid;
-}
-
-/* ---------------------------------------------------------------- */
-
 
 /* added    Tue Feb 22 10:36:44 NFT 2000 Rainer Wichmann            */
-static int tf_add_trusted_user_int(const char * c)
-{
-  struct passwd *          w;
+static int tf_add_trusted_user_int(char * c)
+{
+  register struct passwd *          w;
   int                           count;
   uid_t                     pwid  = (uid_t)-1;
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  struct passwd    pwd;
-  char           * buffer;
-#endif
-  
   SL_ENTER(_("tf_add_trusted_user_int"));
 
   /* First check for a user name.
    */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-  sh_getpwnam_r(c, &pwd, buffer, SH_PWBUF_SIZE, &w);
-#else
-  w = sh_getpwnam(c);
-#endif
-
-  if ((w != NULL) && ((pwid = w->pw_uid) > 0))
+  if ((w = sh_getpwnam(c)) != NULL && ((pwid = w->pw_uid) > 0))
     goto succe;
 	
@@ -1135,33 +912,20 @@
   sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS, 
 		   _("add trusted user"), c);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  SH_FREE(buffer);
-#endif
   SL_RETURN((-1), _("tf_add_trusted_user_int"));
 
  succe:
   count = sl_trust_add_user(pwid);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  SH_FREE(buffer);
-#endif
   SL_RETURN((count), _("tf_add_trusted_user_int"));
 }
 
-int tf_add_trusted_user(const char * c)
+int tf_add_trusted_user(char * c)
 {
   int    i;
   char * q;
   char * p = sh_util_strdup (c);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  char * saveptr;
-#endif
-
+  
   SL_ENTER(_("tf_add_trusted_user"));
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-  q = strtok_r(p, ", \t", &saveptr);
-#else
   q = strtok(p, ", \t");
-#endif
   if (!q)
     {
@@ -1177,9 +941,5 @@
 	  SL_RETURN((i), _("tf_add_trusted_user"));
 	}
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R)
-      q = strtok_r(NULL, ", \t", &saveptr);
-#else
       q = strtok(NULL, ", \t");
-#endif
     }
   SH_FREE(p);
@@ -1187,9 +947,9 @@
 }
 
-extern uid_t   sl_trust_baduid(void);
-extern gid_t   sl_trust_badgid(void);
+extern uid_t   sl_trust_baduid();
+extern gid_t   sl_trust_badgid();
 
 #if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-int tf_trust_check (const char * file, int mode)
+int tf_trust_check (char * file, int mode)
 {
   (void) file;
@@ -1198,5 +958,5 @@
 }
 #else
-int tf_trust_check (const char * file, int mode)
+int tf_trust_check (char * file, int mode)
 {
   char * tmp;
@@ -1205,7 +965,5 @@
   int    status;
   int    level;
-  uid_t  ff_euid = (uid_t) -1;
-  uid_t  baduid;
-  gid_t  badgid;
+  uid_t  ff_euid;
 
   SL_ENTER(_("tf_trust_check"));
@@ -1219,12 +977,5 @@
   if (0 == sl_ret_euid())   /* privileges not dropped yet */
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      struct passwd    pwd;
-      char          *  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-      struct passwd *  tempres;
-      sh_getpwnam_r(DEFAULT_IDENT, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
       struct passwd * tempres = sh_getpwnam(DEFAULT_IDENT);
-#endif
 
       if (!tempres)
@@ -1235,11 +986,5 @@
 	  aud_exit (FIL__, __LINE__, EXIT_FAILURE);
 	}
-      else
-	{
-	  ff_euid = tempres->pw_uid;
-	}
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      SH_FREE(buffer);
-#endif
+      ff_euid = tempres->pw_uid;
     }
 #endif
@@ -1254,12 +999,9 @@
 	level = SH_ERR_ERR;
 
-      tmp    = sh_util_safe_name (file);
-      p      = sh_util_strdup(sl_trust_errfile());
-      baduid = sl_trust_baduid();
-      badgid = sl_trust_badgid();
-      
+      tmp  = sh_util_safe_name (file);
+      p    = sl_trust_errfile();
       if (p && *p != '\0')
 	{
-	  tmp2  = sh_util_safe_name (p);
+	  tmp2  = sh_util_safe_name (sl_trust_errfile());
 	  sh_error_handle(level, FIL__, __LINE__, status, MSG_E_TRUST2,
 			  sl_error_string(status), tmp, tmp2);
@@ -1271,4 +1013,5 @@
 			  sl_error_string(status), tmp);
 	}
+      SH_FREE(tmp);
 
       if (status == SL_EBADUID   || status == SL_EBADGID || 
@@ -1282,35 +1025,41 @@
 	    break;
 	  case SL_ETRUNC:
+	    tmp  = sh_util_safe_name (file);
 	    dlog(1, FIL__, __LINE__, 
 		 _("A filename truncation occured in the trustfile function.\nProbably the normalized filename for %s\nis too long. This may be due e.g. to deep or circular softlinks.\n"), 
 		 tmp);
+	    SH_FREE(tmp);
 	    break;
 	  case SL_EBADOTH:
+	    tmp  = sh_util_safe_name (file);
+	    p    = sl_trust_errfile();
 	    dlog(1, FIL__, __LINE__, 
 		 _("The path element: %s\nin the filename: %s is world writeable.\n"),
-		 (p) ? p : _("(null)"), tmp);
+		 p, tmp);
+	    SH_FREE(tmp);
 	    break;
 	  case SL_EBADUID:
+	    tmp  = sh_util_safe_name (file);
+	    p    = sl_trust_errfile();
 	    dlog(1, FIL__, __LINE__, 
 		 _("The owner (UID = %ld) of the path element: %s\nin the filename: %s\nis not in the list of trusted users.\nTo fix the problem, you can:\n - run ./configure again with the option --with-trusted=0,...,UID\n   where UID is the UID of the untrusted user, or\n - use the option TrustedUser=UID in the configuration file.\n"),
-		 (UID_CAST)baduid, (p) ? p : _("(null)"), tmp);
+		 (UID_CAST)sl_trust_baduid(), p, tmp);
+	    SH_FREE(tmp);
 	    break;
 	  case SL_EBADGID:
+	    tmp  = sh_util_safe_name (file);
+	    p    = sl_trust_errfile();
 	    dlog(1, FIL__, __LINE__, 
 		 _("The path element: %s\nin the filename: %s\nis group writeable (GID = %ld), and at least one of the group\nmembers (UID = %ld) is not in the list of trusted users.\nTo fix the problem, you can:\n - run ./configure again with the option --with-trusted=0,...,UID\n   where UID is the UID of the untrusted user, or\n - use the option TrustedUser=UID in the configuration file.\n"),
-		 (p) ? p : _("(null)"), tmp, (UID_CAST)badgid, 
-		 (UID_CAST)baduid);
+		 p, tmp, (UID_CAST)sl_trust_badgid(), 
+		 (UID_CAST)sl_trust_baduid());
+	    SH_FREE(tmp);
 	    break;
 	  default:
 	    break;
 	  }
-	  SH_FREE(tmp);
-	  if (p) SH_FREE(p);
+	    
 	  SL_RETURN((-1), _("tf_trust_check"));
 	}
-      else {
-	SH_FREE(tmp);
-	if (p) SH_FREE(p);
-      }
     }
 
@@ -1348,13 +1097,14 @@
 
 #ifdef HAVE_INITGROUPS
-char *  sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len);
+char *  sh_unix_getUIDname (int level, uid_t uid);
 int  sh_unix_initgroups2 (uid_t in_pid, gid_t in_gid)
 {
   int status  = -1;
-  char user[SH_MINIBUF];
+  char * user = NULL;
 
   SL_ENTER(_("sh_unix_initgroups2"));
 
-  if (NULL == sh_unix_getUIDname (SH_ERR_ERR, in_pid, user, sizeof(user)))
+  user = sh_unix_getUIDname (SH_ERR_ERR, in_pid);
+  if (user == NULL)
     SL_RETURN((-1), _("sh_unix_initgroups2"));
   status = sh_initgroups (user, in_gid);
@@ -1377,5 +1127,5 @@
 #endif
 
-void sh_unix_closeall (int fd, int except, int inchild)
+void sh_unix_closeall (int fd, int except)
 {
   int fdx = fd;
@@ -1395,13 +1145,8 @@
    */
   if (fdlimit < 0)
-    fdlimit = 20;  /* POSIX lower limit */
+    fdlimit = 8;  /* POSIX lower limit */
 
   if (fdlimit > 65536)
     fdlimit = 65536;
-
-  if (!inchild)
-    sl_dropall (fdx, except);
-  else
-    sl_dropall_dirty (fdx, except);
 
   /* Close everything from fd (inclusive) up to fdlimit (exclusive). 
@@ -1414,6 +1159,8 @@
 	fd++;
       else
-	sl_close_fd(FIL__, __LINE__, fd++);
-    }
+	close(fd++);
+    }
+
+  sl_dropall (fdx, except);
 
   SL_RET0(_("sh_unix_closeall"));
@@ -1446,4 +1193,9 @@
 #ifdef RLIMIT_NPROC
   setrlimit (RLIMIT_NPROC,   &limits);
+#endif
+#if defined(RLIMIT_NOFILE)
+  setrlimit (RLIMIT_NOFILE,  &limits);
+#elif defined(RLIMIT_OFILE)
+  setrlimit (RLIMIT_OFILE,   &limits);
 #endif
 #ifdef RLIMIT_MEMLOCK
@@ -1465,12 +1217,4 @@
 #endif
 
-  limits.rlim_cur = 1024;
-  limits.rlim_max = 1024;
-
-#if defined(RLIMIT_NOFILE)
-  setrlimit (RLIMIT_NOFILE,  &limits);
-#elif defined(RLIMIT_OFILE)
-  setrlimit (RLIMIT_OFILE,   &limits);
-#endif
 
   SL_RET0(_("sh_unix_setlimits"));
@@ -1482,5 +1226,4 @@
   char ** env1;
   int   envlen = 0;
-  size_t len;
 
   SL_ENTER(_("sh_unix_copyenv"));
@@ -1493,5 +1236,5 @@
 
   /* printf("-> %2d: slots allocated\n", envlen); */
-  env1 = calloc(1,sizeof(char *) * envlen);      /* only once */
+  env1 = malloc (sizeof(char *) * envlen);      /* only once */
   if (env1 == NULL)
     {
@@ -1502,16 +1245,12 @@
   envlen = 0;
 
-  while (env0 != NULL && env0[envlen] != NULL) {
-    len = strlen(env0[envlen]) + 1;
-    env1[envlen] = calloc(1,len); /* only once */
+  while (env0 != NULL && env0[envlen] != NULL) { 
+    env1[envlen] = malloc (strlen(env0[envlen]) + 1); /* only once */
     if (env1[envlen] == NULL)
       {
-	int i;
 	fprintf(stderr, _("%s: %d: Out of memory\n"), FIL__, __LINE__);
-	for (i = 0; i < envlen; ++i) free(env1[len]);
-	free(env1);
 	SL_RET0(_("sh_unix_copyenv"));
       }
-    sl_strlcpy(env1[envlen], env0[envlen], len);
+    strcpy(env1[envlen], env0[envlen]);                /* known to fit  */
     ++envlen;
   }
@@ -1545,26 +1284,10 @@
 	continue;
       }
-    if (0 == sl_strncmp((*env), _("MYSQL_TCP_PORT="), 15))
-      {
-	++(env);
-	continue;
-      }
-    if (0 == sl_strncmp((*env), _("MYSQL_HOME="), 11))
-      {
-	++(env);
-	continue;
-      }
 #endif
 #ifdef WITH_ORACLE
     /* 
-     * Skip the ORACLE_HOME and TNS_ADMIN environment variables; 
-     * Oracle may need them.
+     * Skip the ORACLE_HOME environment variable; Oracle may need it.
      */
     if (0 == sl_strncmp((*env), _("ORACLE_HOME="), 12))
-      {
-	++(env);
-	continue;
-      }
-    if (0 == sl_strncmp((*env), _("TNS_ADMIN="), 10))
       {
 	++(env);
@@ -1591,8 +1314,4 @@
   }
 
-#ifdef HAVE_TZSET
-  tzset();
-#endif
-
   SL_RET0(_("sh_unix_zeroenv"));
 }
@@ -1629,9 +1348,6 @@
 #endif
   int  test;
+  struct sigaction act, oldact;
   int  status;
-  struct sigaction act;
-#if !defined(SH_PROFILE)
-  struct sigaction oldact;
-#endif
 
   sigset_t set_proc;
@@ -1646,5 +1362,5 @@
   do {
     errno = 0;
-    test  = SH_SETSIGMASK(SIG_UNBLOCK, &set_proc, NULL);
+    test  = sigprocmask(SIG_UNBLOCK, &set_proc, NULL);
   } while (test < 0 && errno == EINTR);
 
@@ -1666,8 +1382,7 @@
       if ((test == -1) && (errno != EINVAL)) 
 	{
-	  char errbuf[SH_ERRBUF_SIZE];
 	  status = errno;
 	  sh_error_handle ((-1), FIL__, __LINE__, status, MSG_W_SIG,
-			   sh_error_message (status, errbuf, sizeof(errbuf)), sig_num);
+			   sh_error_message (status), sig_num);
 	}
     }
@@ -1678,18 +1393,4 @@
 /* Get the local hostname (FQDN)
  */
-static char * sh_tolower (char * s)
-{
-  char * ret = s;
-  if (s)
-    {
-      for (; *s; ++s)
-	{ 
-	  *s = tolower((unsigned char) *s);
-	}
-    }
-  return ret;
-}
-
-
 #include <sys/socket.h> 
 
@@ -1701,18 +1402,4 @@
 
 #include <arpa/inet.h>
-
-const char * sh_unix_h_name (struct hostent * host_entry)
-{
-	char ** p;
-	if (strchr(host_entry->h_name, '.')) {
-		return host_entry->h_name;
-	} else {
-		for (p = host_entry->h_aliases; *p; ++p) {
-			if (strchr(*p, '.'))
-				return *p;
-		}
-	}
-	return host_entry->h_name;
-}
 
 /* uname() on FreeBSD is broken, because the 'nodename' buf is too small
@@ -1724,11 +1411,10 @@
 {
   struct utsname   buf;
+  struct hostent * he1;
   int              i;
-  unsigned int     ddot;
+  int              ddot = 0;
   int              len;
   char           * p;
   char             hostname[256];
-  char             numeric[SH_IP_BUF];
-  char           * canonical;
 
 
@@ -1736,5 +1422,5 @@
 
   (void) uname (&buf);
-  /* flawfinder: ignore */ /* ff bug, ff sees system() */
+
   sl_strlcpy (sh.host.system,  buf.sysname, SH_MINIBUF);
   sl_strlcpy (sh.host.release, buf.release, SH_MINIBUF);
@@ -1776,34 +1462,37 @@
     }
 
-  canonical = sh_ipvx_canonical(hostname, numeric, sizeof(numeric));
-
-  if (canonical == NULL)
-    {
+  he1 = sh_gethostbyname(hostname);
+
+  if (he1 == NULL)
+    {
+      dlog(1, FIL__, __LINE__, 
+	   _("According to uname, your nodename is %s, but your resolver\nlibrary cannot resolve this nodename to a FQDN. For more information, see the entry about self-resolving under 'Most frequently' in the FAQ that you will find in the docs/ subdirectory.\n"),
+	   hostname);
       sl_strlcpy (sh.host.name, hostname,    SH_PATHBUF);
-      sh_tolower (sh.host.name);
     }
   else
     {
-      sl_strlcpy (sh.host.name, canonical,   SH_PATHBUF);
-      SH_FREE(canonical);
-    }
+      sl_strlcpy (sh.host.name, he1->h_name, SH_PATHBUF);
+    }
+  
 
   /* check whether it looks like a FQDN
    */
   len = sl_strlen(sh.host.name);
-  ddot = 0;
   for (i = 0; i < len; ++i) 
     if (sh.host.name[i] == '.') ++ddot; 
 
-  if (ddot == 0)
+  if (ddot == 0 && he1 != NULL)
     { 
       dlog(1, FIL__, __LINE__, 
 	   _("According to uname, your nodename is %s, but your resolver\nlibrary cannot resolve this nodename to a FQDN.\nRather, it resolves this to %s.\nFor more information, see the entry about self-resolving under\n'Most frequently' in the FAQ that you will find in the docs/ subdirectory.\n"),
 	   hostname, sh.host.name);
-      sl_strlcpy (sh.host.name, numeric, SH_PATHBUF);
+      sl_strlcpy (sh.host.name, 
+		  inet_ntoa (*(struct in_addr *) he1->h_addr), 
+		  SH_PATHBUF);
       SL_RET0(_("sh_unix_localhost"));
     } 
 
-  if (sh_ipvx_is_numeric(sh.host.name)) 
+  if (is_numeric(sh.host.name)) 
     {
       dlog(1, FIL__, __LINE__, 
@@ -1814,49 +1503,31 @@
   SL_RET0(_("sh_unix_localhost"));
 }
-
 #else
-
-/* 
- * --FreeBSD code 
- */
-#if defined(HAVE_UNAME)
-#include <sys/utsname.h>
-#endif
 void sh_unix_localhost()
 {
-#if defined(HAVE_UNAME)
-  struct utsname   buf;
-#endif
+  struct hostent * he1;
   int              i;
-  int              ddot;
+  int              ddot = 0;
   int              len;
   char             hostname[1024];
-  char             numeric[SH_IP_BUF];
-  char           * canonical;
+
 
   SL_ENTER(_("sh_unix_localhost"));
-
-#if defined(HAVE_UNAME)
-  (void) uname (&buf);
-  /* flawfinder: ignore */ /* ff bug, ff sees system() */
-  sl_strlcpy (sh.host.system,  buf.sysname, SH_MINIBUF);
-  sl_strlcpy (sh.host.release, buf.release, SH_MINIBUF);
-  sl_strlcpy (sh.host.machine, buf.machine, SH_MINIBUF);
-#endif
 
   (void) gethostname (hostname, 1024);
   hostname[1023] = '\0';
-
-  canonical = sh_ipvx_canonical(hostname, numeric, sizeof(numeric));
-
-  if (canonical == NULL)
-    {
-      sl_strlcpy (sh.host.name, hostname, SH_PATHBUF);
-      sh_tolower (sh.host.name);
+  he1 = sh_gethostbyname(hostname);
+
+  if (he1 != NULL)
+    {
+      sl_strlcpy (sh.host.name, he1->h_name, SH_PATHBUF);
     }
   else
     {
-      sl_strlcpy (sh.host.name, canonical,   SH_PATHBUF);
-      SH_FREE(canonical);
+      dlog(1, FIL__, __LINE__, 
+	   _("According to gethostname, your nodename is %s, but your resolver\nlibrary cannot resolve this nodename to a FQDN.\nFor more information, see the entry about self-resolving under\n'Most frequently' in the FAQ that you will find in the docs/ subdirectory.\n"),
+	   hostname);
+      sl_strlcpy (sh.host.name, _("localhost"), SH_PATHBUF);
+      SL_RET0(_("sh_unix_localhost"));
     }
 
@@ -1864,5 +1535,4 @@
    */
   len = sl_strlen(sh.host.name);
-  ddot = 0;
   for (i = 0; i < len; ++i) 
     if (sh.host.name[i] == '.') ++ddot; 
@@ -1872,9 +1542,11 @@
 	   _("According to uname, your nodename is %s, but your resolver\nlibrary cannot resolve this nodename to a FQDN.\nRather, it resolves this to %s.\nFor more information, see the entry about self-resolving under\n'Most frequently' in the FAQ that you will find in the docs/ subdirectory.\n"),
 	   hostname, sh.host.name);
-      sl_strlcpy (sh.host.name, numeric, SH_PATHBUF);
+      sl_strlcpy (sh.host.name, 
+		  inet_ntoa (*(struct in_addr *) he1->h_addr), 
+		  SH_PATHBUF);
       SL_RET0(_("sh_unix_localhost"));
     }
 
-  if (sh_ipvx_is_numeric(sh.host.name)) 
+  if (is_numeric(sh.host.name)) 
     {
       dlog(1, FIL__, __LINE__, 
@@ -1895,20 +1567,15 @@
    */
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-  if (skey->mlock_failed == S_FALSE)
-    {
-      if ( (-1) == sh_unix_mlock( FIL__, __LINE__, 
-				  (char *) skey, sizeof (sh_key_t)) ) 
+  if (skey->mlock_failed == SL_FALSE)
+    {
+      if ( (-1) == sh_unix_mlock( (char *) skey, sizeof (sh_key_t)) ) 
 	{
-	  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-	  skey->mlock_failed = S_TRUE;
-	  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
+	  skey->mlock_failed = SL_TRUE;
 	}
     }
 #else
-  if (skey->mlock_failed == S_FALSE)
-    {
-      SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-      skey->mlock_failed = S_TRUE;
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
+  if (skey->mlock_failed == SL_FALSE)
+    {
+      skey->mlock_failed = SL_TRUE;
     }
 #endif
@@ -1920,5 +1587,5 @@
 char * chroot_dir = NULL;
 
-int sh_unix_set_chroot(const char * str)
+int sh_unix_set_chroot(char * str)
 {
   size_t len;
@@ -1931,5 +1598,5 @@
     {
       len = strlen(str) + 1;
-      chroot_dir = calloc(1,strlen(str) + 1);  /* only once */
+      chroot_dir = malloc(strlen(str) + 1);  /* only once */
       if (!chroot_dir)
 	{
@@ -1944,5 +1611,5 @@
 }
 
-int sh_unix_chroot(void)
+int sh_unix_chroot()
 {
   int status;
@@ -1953,11 +1620,9 @@
       if ( (-1) == status ) 
 	{
-	  char errbuf[SH_ERRBUF_SIZE];
 	  status = errno;
 	  sh_error_handle ((-1), FIL__, __LINE__, status, MSG_W_CHDIR,
-			   sh_error_message (status, errbuf, sizeof(errbuf)), chroot_dir);
+			   sh_error_message (status), chroot_dir);
 	  aud_exit(FIL__, __LINE__, EXIT_FAILURE);
 	}
-      /* flawfinder: ignore */
       return (chroot(chroot_dir));
     }
@@ -1966,5 +1631,5 @@
 /* #ifdef SH_WITH_SERVER */
 #else
-int sh_unix_chroot(void) { return 0; }
+int sh_unix_chroot() { return 0; }
 #endif
 
@@ -1973,5 +1638,5 @@
 static int block_setdeamon = 0;
 
-int sh_unix_setdeamon(const char * dummy)
+int sh_unix_setdeamon(char * dummy)
 {
   int    res = 0;
@@ -1983,5 +1648,5 @@
 
   if (dummy == NULL)
-    sh.flag.isdaemon = S_TRUE;
+    sh.flag.isdaemon = ON;
   else 
     res = sh_util_flagval (dummy, &sh.flag.isdaemon);
@@ -1996,8 +1661,8 @@
 #endif
 
-int sh_unix_setnodeamon(const char * dummy)
+int sh_unix_setnodeamon(char * dummy)
 {
   int    res = 0;
-  
+
   SL_ENTER(_("sh_unix_setnodeamon"));
 
@@ -2006,5 +1671,5 @@
 
   if (dummy == NULL)
-    sh.flag.isdaemon = S_FALSE;
+    sh.flag.isdaemon = OFF;
   else 
     res = sh_util_flagval (dummy, &sh.flag.isdaemon);
@@ -2022,9 +1687,6 @@
   pid_t  oldpid = getpid();
 #if defined(SH_WITH_SERVER) 
-  extern int sh_socket_open_int (void);
-#endif
-  char errbuf[SH_ERRBUF_SIZE];
-
-  extern void sh_kill_sub();
+  extern int sh_socket_open_int ();
+#endif
 
   SL_ENTER(_("sh_unix_init"));
@@ -2037,7 +1699,5 @@
     case 0:  break;                             /* child process continues */
     case -1: SL_RETURN((-1),_("sh_unix_init")); /* error                   */
-    default:                                    /* parent process exits    */
-      sh_kill_sub(); 
-      aud__exit(FIL__, __LINE__, 0);
+    default: aud__exit(FIL__, __LINE__, 0);     /* parent process exits    */
     }
 
@@ -2048,12 +1708,9 @@
 
     setsid();            /* should not fail         */
-    sh.pid = (UINT64) getpid();
 
     switch (aud_fork(FIL__, __LINE__)) {
     case 0:  break;                             /* child process continues */
     case -1: SL_RETURN((-1),_("sh_unix_init")); /* error                   */
-    default:                                    /* parent process exits    */
-      sh_kill_sub(); 
-      aud__exit(FIL__, __LINE__, 0);
+    default: aud__exit(FIL__, __LINE__, 0);     /* parent process exits    */
     }
 
@@ -2061,5 +1718,4 @@
      */
     sh_unix_memlock();
-    sh.pid = (UINT64) getpid();
 
   } else {
@@ -2078,5 +1734,5 @@
       status = errno;
       sh_error_handle ((-1), FIL__, __LINE__, status, MSG_W_CHDIR,
-		       sh_error_message (status, errbuf, sizeof(errbuf)), "/");
+		       sh_error_message (status), "/");
       aud_exit(FIL__, __LINE__, EXIT_FAILURE);
     }
@@ -2107,40 +1763,14 @@
   sh_unix_zeroenv();
 
+
+  /* close all file descriptors, and 
+   * open first three streams to /dev/null 
+   */
   if (goDaemon == 1)
     {
-      /* Close first tree file descriptors 
-       */ 
-      sl_close_fd (FIL__, __LINE__, 0);  /* if running as daemon */
-      sl_close_fd (FIL__, __LINE__, 1);  /* if running as daemon */
-      sl_close_fd (FIL__, __LINE__, 2);  /* if running as daemon */
-
-      /* Enable full error logging
-       */
-      sh_error_only_stderr (S_FALSE);
-
-      /* open first three streams to /dev/null 
-       */
-      status = aud_open(FIL__, __LINE__, SL_NOPRIV, _("/dev/null"), O_RDWR, 0);
-      if (status < 0)
-	{
-	  status = errno;
-	  sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			  sh_error_message(status, errbuf, sizeof(errbuf)), _("open"));
-	  aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-
-      status = retry_aud_dup(FIL__, __LINE__, 0); 
-      if (status >= 0)
-	retry_aud_dup(FIL__, __LINE__, 0);
-
-      if (status < 0)
-	{
-	  status = errno;
-	  sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			  sh_error_message(status, errbuf, sizeof(errbuf)), _("dup"));
-	  aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-
-      sh_error_enable_unsafe (S_TRUE);
+      sh_unix_closeall (0, -1);  /* if running as daemon */
+      aud_open(FIL__, __LINE__, SL_NOPRIV, _("/dev/null"), O_RDWR, 0);
+      retry_aud_dup(FIL__, __LINE__, 0); 
+      retry_aud_dup(FIL__, __LINE__, 0);
 #if defined(HAVE_LIBPRELUDE)
       sh_prelude_reset ();
@@ -2175,5 +1805,5 @@
   else
     {
-      sh_error_enable_unsafe (S_TRUE);
+      sh_unix_closeall(3, -1);  /* if not daemon */
 #if defined(HAVE_LIBPRELUDE)
       sh_prelude_reset ();
@@ -2191,5 +1821,5 @@
       status = errno;
       sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGEN, 
-			  sh_error_message(status, errbuf, sizeof(errbuf)), _("chroot"));
+			  sh_error_message(status), _("chroot"));
       aud_exit(FIL__, __LINE__, EXIT_FAILURE);
     }
@@ -2200,75 +1830,4 @@
 
   SL_RETURN((0),_("sh_unix_init"));
-}
-
-/* --- run a command, securely --- */
-
-int sh_unix_run_command (const char * str)
-{
-  pid_t  pid;
-  char * arg[4];
-  char * env[5];
-  char * path = sh_util_strdup(_("/bin/sh"));
-
-  int  status = -1;
-
-  arg[0] = sh_util_strdup(_("/bin/sh"));
-  arg[1] = sh_util_strdup(_("-c"));
-  arg[2] = sh_util_strdup(str);
-  arg[3] = NULL;
-
-  env[0] = sh_util_strdup(_("PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/ucb"));
-  env[1] = sh_util_strdup(_("SHELL=/bin/sh"));
-  env[2] = sh_util_strdup(_("IFS= \t\n"));
-  if (getenv("TZ")) {                         /* flawfinder: ignore */
-    char * tz = sh_util_strdup(getenv("TZ")); /* flawfinder: ignore */
-    size_t tzlen = strlen(tz);
-    if (S_TRUE == sl_ok_adds (4, tzlen)) {
-	env[3] = SH_ALLOC(4+tzlen);
-	sl_strlcpy(env[3], "TZ=", 4);
-	sl_strlcat(env[3], tz   , 4+tzlen);
-    } else {
-      env[3] = NULL;
-    }
-  } else {
-    env[3] = NULL;
-  }
-  env[4] = NULL;
-
-  pid = fork();
-
-  if (pid == (pid_t)(-1))
-    {
-      return -1;
-    }
-
-  else if (pid == 0) /* child */
-    {
-      memset(skey, 0, sizeof(sh_key_t));
-      (void) umask(S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH);
-      sh_unix_closeall (3, -1, S_TRUE); /* in child process */
-      execve(path, arg, env);
-      _exit(EXIT_FAILURE);
-    }
-
-  else /* parent */
-    {
-      int r;
-
-      while((r = waitpid(pid, &status, WUNTRACED)) != pid && r != -1) ;
-
-#if !defined(USE_UNO)
-      if (r == -1 || !WIFEXITED(status)) 
-	{
-	  status = -1;
-	}
-      else
-	{
-	  status = WEXITSTATUS(status);
-	}
-#endif
-     }
-
-  return status;
 }
 
@@ -2286,8 +1845,5 @@
   struct tm   aa;
   struct tm   bb;
-
-  struct tm * aptr;
-  struct tm * bptr;
-
+  struct tm * cc;
   int  sign =  0;
   int  diff =  0;
@@ -2297,50 +1853,32 @@
   SL_ENTER(_("t_zone"));
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
-  aptr = gmtime_r (xx, &aa);
-#else
-  aptr = gmtime(xx);
-  if (aptr)
-    memcpy (&aa, aptr, sizeof(struct tm));
-#endif
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  bptr = localtime_r (xx, &bb);
-#else
-  bptr = localtime(xx);
-  if (bptr) 
-    memcpy (&bb, bptr, sizeof(struct tm));
-#endif
-
-  if (bptr && aptr)
-    {
-      /* Check for datum wrap-around.
-       */
-      if      ((aa.tm_mday == 1) && (aa.tm_mday < bb.tm_mday) && (aa.tm_hour < bb.tm_hour))
-	sign = ( 1);
-      else if (aa.tm_year < bb.tm_year)
-	sign = (-1);
-      else if (aa.tm_mon  < bb.tm_mon)
-	sign = (-1);
-      else if (aa.tm_mday < bb.tm_mday)
-	sign = (-1);
-      else if (bb.tm_year < aa.tm_year)
-	sign = ( 1);
-      else if (bb.tm_mon  < aa.tm_mon)
-	sign = ( 1);
-      else if (bb.tm_mday < aa.tm_mday)
-	sign = ( 1);
-      
-      diff = aa.tm_hour * 60 + aa.tm_min;
-      diff = (bb.tm_hour * 60 + bb.tm_min) - diff;
-      diff = diff - (sign * 24 * 60);   /* datum wrap-around correction */
-      hh = diff / 60;
-      mm = diff - (hh * 60);
-      sl_snprintf (tz, sizeof(tz), _("%+03d%02d"), hh, mm);                /* known to fit  */
-    }
-  else
-    {
-      sl_snprintf (tz, sizeof(tz), _("%+03d%02d"), 0, 0);
-    }
+
+  cc = gmtime (xx);
+  memcpy (&aa, cc, sizeof(struct tm));
+  cc = localtime (xx);
+  memcpy (&bb, cc, sizeof(struct tm));
+
+  /* Check for datum wrap-around.
+   */
+  if      (aa.tm_year < bb.tm_year)
+    sign = (-1);
+  else if (aa.tm_mon  < bb.tm_mon)
+    sign = (-1);
+  else if (aa.tm_mday < bb.tm_mday)
+    sign = (-1);
+  else if (bb.tm_year < aa.tm_year)
+    sign = ( 1);
+  else if (bb.tm_mon  < aa.tm_mon)
+    sign = ( 1);
+  else if (bb.tm_mday < aa.tm_mday)
+    sign = ( 1);
+
+  diff = aa.tm_hour * 60 + aa.tm_min;
+  diff = (bb.tm_hour * 60 + bb.tm_min) - diff;
+  diff = diff - (sign * 24 * 60);   /* datum wrap-around correction */
+  hh = diff / 60;
+  mm = diff - (hh * 60);
+  sprintf (tz, _("%+03d%02d"), hh, mm);                /* known to fit  */
+
   SL_RETURN(tz, _("t_zone"));
 }
@@ -2371,5 +1909,5 @@
 }
 
-int sh_unix_settimeserver (const char * address)
+int sh_unix_settimeserver (char * address)
 {
 
@@ -2408,14 +1946,13 @@
 #endif
 
-char * sh_unix_time (time_t thetime, char * buffer, size_t len)
+char * sh_unix_time (time_t thetime)
 {
 
   int           status;
-  char          AsciiTime[81];                       /* local time   */
+
   time_t        time_now;
-  struct tm   * time_ptr = NULL;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-  struct tm     time_tm;
-#endif
+  struct tm   * time_ptr;
+  static char   AsciiTime[81];                       /* local time   */
+  static char   RetTime[81];                         /* local time   */
 #ifdef SH_USE_XML
   static char   deftime[] = N_("0000-00-00T00:00:00"); /* default time */
@@ -2447,17 +1984,4 @@
       else /* have a timeserver address */
 	{ 
-	  /* don't call timeserver more than once per second */
-	  static time_t  time_old   = 0;
-	  time_t         time_new;
-	  static time_t  time_saved = 0;
-	  (void) time (&time_new);
-	  if ((time_new == time_old) && (time_saved != 0))
-	    {
-	      time_now = time_saved;
-	      goto end;
-	    }
-	  time_old = time_new;
-
-
 	  fd = connect_port_2 (sh.srvtime.name, sh.srvtime.alt, 
 			       IPPORT_TIMESERVER, 
@@ -2472,5 +1996,5 @@
 				   _("time"), sh.srvtime.name);
 		}
-	      sl_close_fd(FIL__, __LINE__, fd);
+	      close(fd);
 	    }
 	  else
@@ -2479,5 +2003,4 @@
 			       MSG_E_NET, errmsg, error_call,
 			       _("time"), sh.srvtime.name);
-	      errflag = error_num;
 	      fail = 1;
 	    }
@@ -2485,10 +2008,6 @@
 	  if (fail == 0) 
 	    { 
-	      unsigned long   ltmp;
-	      UINT32          ttmp;
-	      memcpy(&ttmp, net_time, sizeof(UINT32)); ltmp = ttmp;
-	      time_now = ntohl(ltmp) - UNIXEPOCH;
-	      time_saved = time_now;
-
+	      time_now = ntohl(* (long *) net_time) - UNIXEPOCH;
+	      /* fprintf(stderr, "TIME IS %ld\n", time_now); */
 	      if (failerr == 1) {
 		failerr = 0;
@@ -2501,6 +2020,4 @@
 	    {
 	      (void) time (&time_now);
-	      time_saved = 0;
-
 	      if (failerr == 0)
 		{
@@ -2511,6 +2028,4 @@
 		}
 	    }
-	end:
-	  ; /* 'label at end of compound statement' */
 	}
     }
@@ -2535,21 +2050,12 @@
 #endif
 
-  if (time_now == (-1) )
-    {
-      sl_strlcpy(buffer, _(deftime), len);
-      SL_RETURN(buffer, _("sh_unix_time"));
-    }
+  if (time_now == (-1) ) 
+    SL_RETURN( _(deftime), _("sh_unix_time"));
   else
-    {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-      time_ptr   = localtime_r (&time_now, &time_tm);
-#else
-      time_ptr   = localtime (&time_now);
-#endif
-    }
+    time_ptr   = localtime (&time_now);
 
   if (time_ptr != NULL) 
     {
-      status = strftime (AsciiTime, sizeof(AsciiTime),
+      status = strftime (AsciiTime, 80,
 #ifdef SH_USE_XML
 			 _("%Y-%m-%dT%H:%M:%S%%s"),
@@ -2559,28 +2065,22 @@
 			 time_ptr);
 
-      sl_snprintf(buffer, len, AsciiTime, t_zone(&time_now));
-
-      if ( (status == 0) || (status == sizeof(AsciiTime)) )
-	{
-	  sl_strlcpy(buffer, _(deftime), len);
-	  SL_RETURN( buffer, _("sh_unix_time"));
-	}
+      sl_snprintf(RetTime, 80, AsciiTime, t_zone(&time_now));
+
+      if ( (status == 0) || (status == 80) ) 
+	SL_RETURN( _(deftime), _("sh_unix_time"));
       else
-	{
-	  SL_RETURN(buffer, _("sh_unix_time"));
-	}
+	SL_RETURN( &RetTime[0], _("sh_unix_time"));
     }
 
   /* last resort
    */
-  sl_strlcpy(buffer, _(deftime), len);
-  SL_RETURN( buffer, _("sh_unix_time"));
+  SL_RETURN( _(deftime), _("sh_unix_time"));
 }
 
 static int sh_unix_use_localtime = S_FALSE;
 
-/* whether to use localtime for file timestamps in logs
+/* whether to use localtime for file timesatams in logs
  */
-int sh_unix_uselocaltime (const char * c)
+int sh_unix_uselocaltime (char * c)
 {
   int i;
@@ -2591,5 +2091,5 @@
 }
     
-char * sh_unix_gmttime (time_t thetime, char * buffer, size_t len)
+char * sh_unix_gmttime (time_t thetime)
 {
 
@@ -2597,8 +2097,5 @@
 
   struct tm   * time_ptr;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS)
-  struct tm     time_tm;
-#endif
-  char   AsciiTime[81];                       /* GMT time   */
+  static char   AsciiTime[81];                       /* GMT time   */
 #ifdef SH_USE_XML
   static char   deftime[] = N_("0000-00-00T00:00:00"); /* default time */
@@ -2610,19 +2107,8 @@
 
   if (sh_unix_use_localtime == S_FALSE)
-    {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
-      time_ptr   = gmtime_r (&thetime, &time_tm);
-#else
-      time_ptr   = gmtime (&thetime);
-#endif
-    }
+    time_ptr   = gmtime (&thetime);
   else
-    {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R)
-      time_ptr   = localtime_r (&thetime, &time_tm);
-#else
-      time_ptr   = localtime (&thetime);
-#endif
-    }
+    time_ptr   = localtime (&thetime);
+
   if (time_ptr != NULL) 
     {
@@ -2635,375 +2121,117 @@
 			 time_ptr);
 
-      if ( (status == 0) || (status == 80) )
-	sl_strlcpy(buffer, _(deftime), len);
+      if ( (status == 0) || (status == 80) ) 
+	SL_RETURN( _(deftime), _("sh_unix_gmttime"));
       else
-	sl_strlcpy(buffer, AsciiTime, len);
-      SL_RETURN( buffer, _("sh_unix_gmttime"));
+	SL_RETURN( &AsciiTime[0], _("sh_unix_gmttime"));
     }
 
   /* last resort
    */
-  sl_strlcpy(buffer, _(deftime), len);
-  SL_RETURN( buffer, _("sh_unix_gmttime"));
-}
-
-
-char *  sh_unix_getUIDdir (int level, uid_t uid, char * out, size_t len)
+  SL_RETURN( _(deftime), _("sh_unix_gmttime"));
+}
+
+
+
+char *  sh_unix_getUIDdir (int level, uid_t uid)
 {
   struct passwd * tempres;
   int    status = 0;
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
-  struct passwd pwd;
-  char   * buffer;
-#endif
-  char errbuf[SH_ERRBUF_SIZE];
-
   SL_ENTER(_("sh_unix_getUIDdir"));
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
-  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-  sh_getpwuid_r(uid, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
   errno = 0;
   tempres = sh_getpwuid(uid);
   status = errno;
-#endif
 
   if (tempres == NULL) {
     sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
-		     sh_error_message(status, errbuf, sizeof(errbuf)),
+		     sh_error_message(status),
 		     _("getpwuid"), (long) uid, _("completely missing"));
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-    SH_FREE(buffer);
-#endif
     SL_RETURN( NULL, _("sh_unix_getUIDdir"));
   }
 
   if (tempres->pw_dir != NULL) {
-    sl_strlcpy(out, tempres->pw_dir, len);
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-    SH_FREE(buffer);
-#endif
-    SL_RETURN( out, _("sh_unix_getUIDdir"));
+    SL_RETURN( tempres->pw_dir, _("sh_unix_getUIDdir"));
   } else {
     sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
-		     sh_error_message(status, errbuf, sizeof(errbuf)),
+		     sh_error_message(status),
 		     _("getpwuid"), (long) uid, _("pw_dir"));
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-    SH_FREE(buffer);
-#endif
     SL_RETURN( NULL, _("sh_unix_getUIDdir"));
   }
 }
 
-/* ------------------- Caching ----------------*/
-#include "zAVLTree.h"
-
-#define CACHE_GID 0
-#define CACHE_UID 1
-
-struct user_id {
-  char  * name;
-  uid_t   id;
-  struct user_id * next;
-};
-
-static struct user_id  * uid_list = NULL;
-static struct user_id  * gid_list = NULL;
-
-SH_MUTEX_STATIC(mutex_cache, PTHREAD_MUTEX_INITIALIZER);
-
-static void sh_userid_free(struct user_id * item)
-{
-  while (item)
-    {
-      struct user_id * user = item;
-      item = item->next;
-
-      SH_FREE(user->name);
-      SH_FREE(user);
-    }
-  return;
-}
-
-void sh_userid_destroy ()
-{
-  struct user_id * tmp_uid;
-  struct user_id * tmp_gid;
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_cache);
-  tmp_gid  = gid_list;
-  gid_list = NULL;
-  tmp_uid  = uid_list;
-  uid_list = NULL;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_cache);
-
-  sh_userid_free(tmp_uid);
-  sh_userid_free(tmp_gid);
-  return;
-}
-
-static void sh_userid_additem(struct user_id * list, struct user_id * item)
-{
-  if (list)
-    {
-      while (list && list->next)
-	list = list->next;
-      list->next = item;
-    }
-  return;
-}
-
-static void sh_userid_add(uid_t id, char * username, int which)
-{
-  size_t len;
-  struct user_id * user = SH_ALLOC(sizeof(struct user_id));
-
-  if (username)
-    len  = strlen(username) + 1;
-  else
-    len = 1;
-
-  user->name = SH_ALLOC(len);
-  user->id   = id;
-  if (username)
-    sl_strlcpy(user->name, username, len);
-  else
-    user->name[0] = '\0';
-  user->next = NULL;
-
-  SH_MUTEX_LOCK(mutex_cache);
-  if (which == CACHE_UID)
-    {
-      if (!uid_list)
-	uid_list = user;
-      else
-	sh_userid_additem(uid_list, user);
-    }
-  else
-    {
-      if (!gid_list)
-	gid_list = user;
-      else
-	sh_userid_additem(gid_list, user);
-    }
-  SH_MUTEX_UNLOCK(mutex_cache);
-
-  return;
-}
-
-static char * sh_userid_search(struct user_id * list, uid_t id)
-{
-  while (list)
-    {
-      if (list->id == id)
-	return list->name;
-      list = list->next;
-    }
-  return NULL;
-}
-
-static char * sh_userid_get (uid_t id, int which, char * out, size_t len)
-{
-  char * user = NULL;
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_cache);
-  if (which == CACHE_UID)
-    user = sh_userid_search(uid_list, id);
-  else
-    user = sh_userid_search(gid_list, id);
-  if (user)
-    {
-      sl_strlcpy(out, user, len);
-      user = out;
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_cache);
-
-  return user;
-}
-
-/* --------- end caching code --------- */
-
-#include "sh_subuid.h"
-
-char *  sh_unix_getUIDname (int level, uid_t uid, char * out, size_t len)
+char *  sh_unix_getUIDname (int level, uid_t uid)
 {
   struct passwd * tempres;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
-  struct passwd pwd;
-  char   * buffer;
-#endif
   int             status = 0;
-  char errbuf[SH_ERRBUF_SIZE];
-  char * tmp;
+  static uid_t    old_uid;
+  static char     name[32] = { '\0' };
 
   SL_ENTER(_("sh_unix_getUIDname"));
 
-  tmp = sh_userid_get(uid, CACHE_UID, out, len);
-
-  if (tmp)
-    {
-      if (tmp[0] != '\0')
-	{
-	  SL_RETURN( out, _("sh_unix_getUIDname"));
-	}
-      else
-	{
-	  SL_RETURN( NULL, _("sh_unix_getUIDname"));
-	}
-    }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
-  buffer = SH_ALLOC(SH_PWBUF_SIZE);
-  sh_getpwuid_r(uid, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
+  if ((uid == old_uid) && (name[0] != '\0')) {
+    SL_RETURN( name, _("sh_unix_getUIDname"));
+  }
+
   errno = 0;
   tempres = sh_getpwuid(uid);
   status = errno;
-#endif
-
-  /* case 1: we have it
-   */
-  if (tempres && tempres->pw_name != NULL) 
-    {
-
-      sl_strlcpy(out, tempres->pw_name, len);
-      sh_userid_add(uid, out, CACHE_UID);
-      
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-      SH_FREE(buffer);
-#endif
-
-      SL_RETURN( out, _("sh_unix_getUIDname"));
-    }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  SH_FREE(buffer);
-#endif
-  
-  if (tempres == NULL) 
-    {
-      char * pwname = sh_get_subuid ((unsigned long) uid);
-
-      if (pwname)
-	{
-	  sl_strlcpy(out, pwname, len);
-	  sh_userid_add(uid, out, CACHE_UID);
-	  SL_RETURN( out, _("sh_unix_getUIDname"));
-	}
-
-      sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
-		       sh_error_message(status, errbuf, sizeof(errbuf)),
-		       _("getpwuid"), (long) uid, _("completely missing"));
-      sh_userid_add(uid, NULL, CACHE_UID);
-      SL_RETURN( NULL, _("sh_unix_getUIDname"));
-    }
-
-
-  /* getwpuid returns struct, but no pw_name
-   */
-  sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
-		   sh_error_message(status, errbuf, sizeof(errbuf)),
-		   _("getpwuid"), (long) uid, _("pw_user"));
-  SL_RETURN( NULL, _("sh_unix_getUIDname"));
-}
-
-char *  sh_unix_getGIDname (int level, gid_t gid, char * out, size_t len)
+ 
+  if (tempres == NULL) {
+    sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
+		     sh_error_message(status),
+		     _("getpwuid"), (long) uid, _("completely missing"));
+    SL_RETURN( NULL, _("sh_unix_getUIDname"));
+  }
+
+
+  if (tempres->pw_name != NULL) {
+    sl_strlcpy(name, tempres->pw_name, sizeof(name));
+    old_uid = uid;
+    SL_RETURN( name, _("sh_unix_getUIDname"));
+  } else {
+    sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_PWNULL,
+		     sh_error_message(status),
+		     _("getpwuid"), (long) uid, _("pw_user"));
+    SL_RETURN( NULL, _("sh_unix_getUIDname"));
+  }
+}
+
+char *  sh_unix_getGIDname (int level, gid_t gid)
 {
   struct group  * tempres;
   int             status = 0;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  struct group    grp;
-  char          * buffer;
-#endif
-  char errbuf[SH_ERRBUF_SIZE];
-  char * tmp;
+  static gid_t    old_gid;
+  static char     name[32] = { '\0' };
+
+  SL_ENTER(_("sh_unix_getGIDname"));
+
+  if ((gid == old_gid) && (name[0] != '\0')) {
+    SL_RETURN( name, _("sh_unix_getUIDname"));
+  }
   
-  SL_ENTER(_("sh_unix_getGIDname"));
-
-  tmp = sh_userid_get((uid_t)gid, CACHE_GID, out, len);
-
-  if (tmp)
-    {
-      if (tmp[0] != '\0')
-	{
-	  SL_RETURN( out, _("sh_unix_getGIDname"));
-	}
-      else
-	{
-	  SL_RETURN( NULL, _("sh_unix_getGIDname"));
-	}
-    }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  buffer = SH_ALLOC(SH_GRBUF_SIZE);
-  status = sh_getgrgid_r(gid, &grp, buffer, SH_GRBUF_SIZE, &tempres);
-#else
   errno = 0;
   tempres = sh_getgrgid(gid);
   status = errno;
-#endif
-
-  if (status == ERANGE) 
-    {
-      static int seen = 0;
-
-      if (seen == 0)
-	{
-	  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
-			   sh_error_message(status, errbuf, sizeof(errbuf)),
-			   _("getgrgid"), (long) gid, _("line too long in group entry"));
-	  ++seen;
-	}
+
+  if (tempres == NULL) {
+    sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
+		     sh_error_message(status),
+		     _("getgrgid"), (long) gid, _("completely missing"));
       
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-      SH_FREE(buffer);
-#endif
-
-      sh_userid_add(gid, NULL, CACHE_GID);
-      SL_RETURN( NULL, _("sh_unix_getGIDname"));
-    }
-
-  if (tempres && tempres->gr_name != NULL) 
-    {
-
-      sl_strlcpy(out, tempres->gr_name, len);
-      sh_userid_add((uid_t)gid, out, CACHE_GID);
-      
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-      SH_FREE(buffer);
-#endif
-
-      SL_RETURN( out, _("sh_unix_getGIDname"));
-    } 
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  SH_FREE(buffer);
-#endif
-
-  if (tempres == NULL) 
-    {
-      char * grname = sh_get_subgid ((unsigned long) gid);
-
-      if (grname)
-	{
-	  sl_strlcpy(out, grname, len);
-	  sh_userid_add((uid_t)gid, out, CACHE_GID);
-	  SL_RETURN( out, _("sh_unix_getGIDname"));
-	}
-
-      sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
-		       sh_error_message(status, errbuf, sizeof(errbuf)),
-		       _("getgrgid"), (long) gid, _("completely missing"));
-      sh_userid_add(gid, NULL, CACHE_GID);
-      SL_RETURN( NULL, _("sh_unix_getGIDname"));
-    }
-
-  sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
-		   sh_error_message(status, errbuf, sizeof(errbuf)),
-		   _("getgrgid"), (long) gid, _("gr_name"));
-  SL_RETURN( NULL, _("sh_unix_getGIDname"));
+    SL_RETURN( NULL, _("sh_unix_getGIDname"));
+  }
+
+  if (tempres->gr_name != NULL) {
+    sl_strlcpy(name, tempres->gr_name, sizeof(name));
+    old_gid = gid;
+    SL_RETURN( name, _("sh_unix_getGIDname"));
+  } else {
+    sh_error_handle (level, FIL__, __LINE__, EINVAL, MSG_E_GRNULL,
+		     sh_error_message(status),
+		     _("getgrgid"), (long) gid, _("gr_name"));
+    SL_RETURN( NULL, _("sh_unix_getGIDname"));
+  }
 }
 
@@ -3012,6 +2240,4 @@
   char          * p;
   uid_t  seuid, sruid;
-  char   user[USER_MAX];
-  char   dir[SH_PATHBUF];
 
   SL_ENTER(_("sh_unix_getUser"));
@@ -3021,5 +2247,5 @@
   sh.effective.uid = seuid;
 
-  p = sh_unix_getUIDdir (SH_ERR_ERR, seuid, dir, sizeof(dir));
+  p = sh_unix_getUIDdir (SH_ERR_ERR, seuid);
 
   if (p == NULL)
@@ -3040,5 +2266,5 @@
   sh.real.uid = sruid;
 
-  p = sh_unix_getUIDname (SH_ERR_ERR, sruid, user, sizeof(user));
+  p = sh_unix_getUIDname (SH_ERR_ERR, sruid);
   if (p == NULL)
     SL_RETURN((-1), _("sh_unix_getUser"));
@@ -3054,5 +2280,5 @@
     }
 
-  p = sh_unix_getUIDdir (SH_ERR_ERR, sruid, dir, sizeof(dir));
+  p = sh_unix_getUIDdir (SH_ERR_ERR, sruid);
 
   if (p == NULL)
@@ -3074,5 +2300,5 @@
 }
 
-/* return >0 on success, -1 on EOF */
+
 int sh_unix_getline (SL_TICKET fd, char * line, int sizeofline)
 {
@@ -3084,9 +2310,7 @@
 
   if (sizeofline < 2) {
-    line[0] = '\0';
+    line[n] = '\0';
     SL_RETURN((0), _("sh_unix_getline"));
   }
-
-  --sizeofline;
 
   while (n < sizeofline) {
@@ -3136,7 +2360,7 @@
  **************************************************************/
 
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-
-#if defined(__linux__)
+#if defined(__linux__) 
+
+#if defined(HAVE_LINUX_EXT2_FS_H) || defined(HAVE_EXT2FS_EXT2_FS_H)
 
 /* --- Determine ext2fs file attributes. ---
@@ -3145,9 +2369,6 @@
 #if defined(HAVE_EXT2FS_EXT2_FS_H)
 #include <ext2fs/ext2_fs.h>
-#elif defined(HAVE_LINUX_EXT2_FS_H)
+#else
 #include <linux/ext2_fs.h>
-#endif
-
-/* __linux__ includes */
 #endif
 
@@ -3156,5 +2377,5 @@
 			  unsigned long * flags, 
 			  char * c_attr,
-			  int fd, struct stat * buf)
+			  int fd)
 {
 
@@ -3172,4 +2393,6 @@
 
 #ifdef HAVE_STAT_FLAGS
+  struct stat buf;
+  int    i;
 
   SL_ENTER(_("sh_unix_getinfo_attr"));
@@ -3177,76 +2400,30 @@
   *flags = 0;
 
-  /* cast to void to avoid compiler warning about unused parameters */
-  (void) fd;
-  (void) name;
-
+  i = retry_stat (FIL__, __LINE__, name, &buf);
+
+  if (i == -1)
+    SL_RETURN(-1, _("sh_unix_getinfo_attr"));
+
+#ifdef UF_IMMUTABLE
+  if (buf.st_flags & UF_IMMUTABLE)
+    *flags |= EXT2_IMMUTABLE_FL;
+#endif
+#ifdef UF_APPEND
+  if (buf.st_flags & UF_APPEND)
+    *flags |= EXT2_APPEND_FL;
+#endif
 #ifdef UF_NODUMP
-  if (buf->st_flags & UF_NODUMP) {
-    *flags |= UF_NODUMP;
-    c_attr[0] = 'd';
-  }
-#endif
-#ifdef UF_IMMUTABLE
-  if (buf->st_flags & UF_IMMUTABLE) {
-    *flags |= UF_IMMUTABLE;
-    c_attr[1] = 'i';
-  }
-#endif
-#ifdef UF_APPEND
-  if (buf->st_flags & UF_APPEND) {
-    *flags |= UF_APPEND;
-    c_attr[2] = 'a';
-  }
-#endif
-#ifdef UF_NOUNLINK
-  if (buf->st_flags & UF_NOUNLINK) {
-    *flags |= UF_NOUNLINK;
-    c_attr[3] = 'u';
-  }
-#endif
-#ifdef UF_OPAQUE
-  if (buf->st_flags & UF_OPAQUE) {
-    *flags |= UF_OPAQUE;
-    c_attr[4] = 'o';
-  }
-#endif
-#ifdef SF_ARCHIVED
-  if (buf->st_flags & SF_ARCHIVED) {
-    *flags |= SF_ARCHIVED;
-    c_attr[5] = 'R';
-  }
-    
-#endif
-#ifdef SF_IMMUTABLE
-  if (buf->st_flags & SF_IMMUTABLE) {
-    *flags |= SF_IMMUTABLE;
-    c_attr[6] = 'I';
-  }
-#endif
-#ifdef SF_APPEND
-  if (buf->st_flags & SF_APPEND) {
-    *flags |= SF_APPEND;
-    c_attr[7] = 'A';
-  }
-#endif
-#ifdef SF_NOUNLINK
-  if (buf->st_flags & SF_NOUNLINK) {
-    *flags |= SF_NOUNLINK;
-    c_attr[8] = 'U';
-  }
-#endif
-
-  /* ! HAVE_STAT_FLAGS */
+  if (buf.st_flags & UF_NODUMP)
+    *flags |= EXT2_NODUMP_FL;
+#endif
+
 #else
 
 #ifdef HAVE_EXT2_IOCTLS
   int /* fd, */ r, f;
-  unsigned long keep_flags = 0;
   
   SL_ENTER(_("sh_unix_getinfo_attr"));
 
   *flags = 0;
-  
-  (void) buf;
 
   /* open() -> aud_open() R.Wichmann 
@@ -3258,16 +2435,13 @@
 
   
-  r = ioctl (fd, FS_IOC_GETFLAGS, &f);
-  /* sl_close_fd (FIL__, __LINE__, fd); */
+  r = ioctl (fd, EXT2_IOC_GETFLAGS, &f);
+  /* close (fd); */
 
   if (r == -1)
     SL_RETURN(-1, _("sh_unix_getinfo_attr"));
 
-  if (f == 0)
-    SL_RETURN(0, _("sh_unix_getinfo_attr"));
-
   *flags = f;
 
-/* ! HAVE_FS_IOCTLS */
+/* ! HAVE_EXT2_IOCTLS */
 #else 
 
@@ -3276,6 +2450,7 @@
   *flags = 0;                                     /* modified by R.Wichmann */
 
-/* ! HAVE_FS_IOCTLS */
+/* ! HAVE_EXT2_IOCTLS */
 #endif 
+#endif
 /*
  * END
@@ -3284,57 +2459,57 @@
  */
 
-  if (*flags == 0)
-    goto theend;
-
-#ifdef FS_SECRM_FL
-  if ( (*flags & FS_SECRM_FL) != 0  )  { c_attr[0] = 's'; keep_flags |= FS_SECRM_FL; }
-#endif
-#ifdef FS_UNRM_FL 
-  if ( (*flags & FS_UNRM_FL) != 0   )  { c_attr[1] = 'u'; keep_flags |= FS_UNRM_FL; }
-#endif
-#ifdef FS_SYNC_FL
-  if ( (*flags & FS_SYNC_FL) != 0    ) { c_attr[2] = 'S'; keep_flags |= FS_SYNC_FL; }
-#endif
-#ifdef FS_IMMUTABLE_FL
-  if ( (*flags & FS_IMMUTABLE_FL) != 0) { c_attr[3] = 'i'; keep_flags |= FS_IMMUTABLE_FL; }
-#endif
-#ifdef FS_APPEND_FL
-  if ( (*flags & FS_APPEND_FL) != 0  )  { c_attr[4] = 'a'; keep_flags |= FS_APPEND_FL; }
-#endif
-#ifdef FS_NODUMP_FL
-  if ( (*flags & FS_NODUMP_FL) != 0  )  { c_attr[5] = 'd'; keep_flags |= FS_NODUMP_FL; }
-#endif
-#ifdef FS_NOATIME_FL
-  if ( (*flags & FS_NOATIME_FL) != 0)   { c_attr[6] = 'A'; keep_flags |= FS_NOATIME_FL; }
-#endif
-#ifdef FS_COMPR_FL
-  if ( (*flags & FS_COMPR_FL) != 0   )  { c_attr[7] = 'c'; keep_flags |= FS_COMPR_FL; }
-#endif
-
-#ifdef FS_TOPDIR_FL
-  if ( (*flags & FS_TOPDIR_FL) != 0  )  { c_attr[8] = 'T'; keep_flags |= FS_TOPDIR_FL; }
-#endif
-#ifdef FS_DIRSYNC_FL
-  if ( (*flags & FS_DIRSYNC_FL) != 0 )  { c_attr[9] = 'D'; keep_flags |= FS_DIRSYNC_FL; }
-#endif
-#ifdef FS_NOTAIL_FL
-  if ( (*flags & FS_NOTAIL_FL) != 0  )  { c_attr[10] = 't'; keep_flags |= FS_NOTAIL_FL; }
-#endif
-#ifdef FS_JOURNAL_DATA_FL
-  if ( (*flags & FS_JOURNAL_DATA_FL) != 0)  { c_attr[11] = 'j'; keep_flags |= FS_JOURNAL_DATA_FL; }
-#endif
-
-  *flags = keep_flags;
-  
- theend:
-  /* !HAVE_STAT_FLAGS */
-#endif
-
-  c_attr[ATTRBUF_USED] = '\0';
+#ifdef EXT2_SECRM_FL
+  if ( (*flags & EXT2_SECRM_FL) != 0  )   c_attr[0] = 's';
+#endif
+#ifdef EXT2_UNRM_FL 
+  if ( (*flags & EXT2_UNRM_FL) != 0   )   c_attr[1] = 'u';
+#endif
+#ifdef EXT2_SYNC_FL
+  if ( (*flags & EXT2_SYNC_FL) != 0    )  c_attr[2] = 'S';
+#endif
+#ifdef EXT2_IMMUTABLE_FL
+  if ( (*flags & EXT2_IMMUTABLE_FL) != 0) c_attr[3] = 'i';
+#endif
+#ifdef EXT2_APPEND_FL
+  if ( (*flags & EXT2_APPEND_FL) != 0  )  c_attr[4] = 'a';
+#endif
+#ifdef EXT2_NODUMP_FL
+  if ( (*flags & EXT2_NODUMP_FL) != 0  )  c_attr[5] = 'd';
+#endif
+#ifdef EXT2_NOATIME_FL
+  if ( (*flags & EXT2_NOATIME_FL) != 0)   c_attr[6] = 'A';
+#endif
+#ifdef EXT2_COMPR_FL
+  if ( (*flags & EXT2_COMPR_FL) != 0   )  c_attr[7] = 'c';
+#endif
+#ifdef EXT2_COMPRBLK_FL
+  if ( (*flags & EXT2_COMPRBLK_FL) != 0)  c_attr[8] = 'B';
+#endif
+#ifdef EXT2_DIRTY_FL
+  if ( (*flags & EXT2_DIRTY_FL) != 0   )  c_attr[9] = 'D';
+#endif
+#ifdef EXT2_NOCOMPR_FL
+  if ( (*flags & EXT2_NOCOMPR_FL) != 0 )  c_attr[10] = 'D';
+#endif
+#ifdef EXT2_ECOMPR_FL
+  if ( (*flags & EXT2_ECOMPR_FL) != 0  )  c_attr[11] = 'D';
+#endif
+
+  c_attr[12] = '\0';
 
   SL_RETURN(0, _("sh_unix_getinfo_attr"));
 }
-
-/* defined(__linux__) || defined(HAVE_STAT_FLAGS) */
+#else
+static 
+int sh_unix_getinfo_attr (char * name, 
+			  unsigned long * flags, 
+			  char * c_attr,
+			  int fd)
+{
+  return 0;
+}
+#endif
+
+/* __LINUX__ */
 #endif
 
@@ -3376,12 +2551,4 @@
     c_mode[0] = 's';
   }
-  else if ( S_ISDOOR(buf->st_mode) ) {
-    (*type)   = SH_FILE_DOOR;
-    c_mode[0] = 'D';
-  }
-  else if ( S_ISPORT(buf->st_mode) ) {
-    (*type)   = SH_FILE_PORT;
-    c_mode[0] = 'P';
-  }
   else                              {
     (*type)   = SH_FILE_UNKNOWN;
@@ -3394,5 +2561,5 @@
 int sh_unix_get_ftype(char * fullpath)
 {
-  char        c_mode[CMODE_SIZE];
+  char        c_mode[16];
   struct stat buf;
   ShFileType  type;
@@ -3483,4 +2650,5 @@
 	      someval *= 1000;  /* milliseconds in a second */
 	      sometime = (unsigned long) someval;
+	      /* fprintf(stderr, "FIXME PAUSE %ld\n", sometime); */
 	      retry_msleep(0, sometime);
 	    }
@@ -3488,4 +2656,5 @@
 	    {
 	      sometime = (unsigned long) someval;
+	      /* fprintf(stderr, "FIXME PAUSE %ld sec\n", sometime); */
 	      retry_msleep (sometime, 0);
 	    }
@@ -3495,5 +2664,5 @@
 }
 
-int sh_unix_set_io_limit (const char * c)
+int sh_unix_set_io_limit (char * c)
 {
   long val;
@@ -3518,308 +2687,5 @@
 #include "sh_ignore.h"
 
-int sh_unix_checksum_size (char * filename, off_t size, int is_max_size, 
-			   char * fileHash, int alert_timeout, SL_TICKET fd, unsigned long mask)
-{
-  file_type * tmpFile;
-  int status;
-
-  SL_ENTER(_("sh_unix_checksum_size"));
-
-  tmpFile = SH_ALLOC(sizeof(file_type));
-  tmpFile->link_path = NULL;
-
-  if (sh.flag.checkSum != SH_CHECK_INIT)
-    {
-      /* lookup file in database */
-      if (is_max_size == S_TRUE) {
-	status = sh_hash_get_it (filename, tmpFile, NULL);
-	if ((status != 0) || (tmpFile->size > size)) {
-	  goto out;
-	}
-      } else {
-	tmpFile->size = size;
-      }
-    }
-  else
-    {
-      tmpFile->size = size;
-    }
-
-  /* if last <= current get checksum */
-  if (tmpFile->size <= size)
-    {
-      char hashbuf[KEYBUF_SIZE];
-      UINT64 local_length = (UINT64) (tmpFile->size < 0 ? 0 : tmpFile->size);
-      if (sh.flag.opts == S_TRUE) sh_tiger_set_hashtype_mask(mask);
-      sl_strlcpy(fileHash,
-		 sh_tiger_generic_hash (filename, fd, &(local_length), 
-					alert_timeout, hashbuf, sizeof(hashbuf)),
-		 KEY_LEN+1);
-      
-       /* return */
-      if (tmpFile->link_path)   SH_FREE(tmpFile->link_path);
-      SH_FREE(tmpFile);
-      SL_RETURN( 0, _("sh_unix_checksum_size"));
-    }
-
- out:
-  if (tmpFile->link_path)   SH_FREE(tmpFile->link_path);
-  SH_FREE(tmpFile);
-  sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
-  SL_RETURN( -1, _("sh_unix_checksum_size"));
-}
-
-/********************************************************
- * Search rotated logfile
- */
-extern char * sh_rotated_log_search(const char * path, struct stat * buf);
-
-int sh_check_rotated_log (const char * path,  
-			  UINT64 old_size, UINT64 old_inode, const char * old_hash, unsigned long mask)
-{
-  struct stat obuf;
-  UINT64 length_nolim = TIGER_NOLIM;
-  int retval = S_FALSE;
-
-  if (old_size != length_nolim)
-    {
-      char hashbuf[KEYBUF_SIZE];
-      char * rotated_file;
-
-      obuf.st_ino = old_inode;
-      rotated_file = sh_rotated_log_search(path, &obuf);
-
-      if (rotated_file && (0 != strcmp(path, rotated_file)))
-	{
-	  SL_TICKET fd = sl_open_fastread (FIL__, __LINE__, rotated_file, SL_YESPRIV);
-	  if (!SL_ISERROR(fd))
-	    {
-	      sh_unix_checksum_size (rotated_file, old_size, S_FALSE, 
-				     hashbuf, 120 /* alert_timeout */, fd, mask);
-	      
-	      sl_close(fd);
-	      
-	      if (strncmp (old_hash, hashbuf, KEY_LEN) == 0) {
-		retval = S_TRUE;
-	      }
-	    }
-	}
-      if (rotated_file) {
-	SH_FREE(rotated_file);
-      }
-    }
-  return retval;
-}
-
-
-int sh_unix_check_selinux = S_FALSE;
-int sh_unix_check_acl     = S_FALSE;
-int sh_unix_check_attributes  = S_TRUE;
-
-#ifdef USE_ACL
-
-#include <sys/acl.h>
-static char * sh_unix_getinfo_acl (char * path, int fd, struct stat * buf)
-{
-  /* system.posix_acl_access, system.posix_acl_default
-   */
-  char *  out  = NULL;
-  char *  collect = NULL;
-  char *  tmp;
-  char *  out_compact;
-  ssize_t len;
-  acl_t   result;
-
-  SL_ENTER(_("sh_unix_getinfo_acl"));
-
-  result = (fd == -1) ? 
-    acl_get_file (path, ACL_TYPE_ACCESS) :
-    acl_get_fd   (fd);
-
-  if (result)
-    {
-      out = acl_to_text (result, &len);
-      if (out && (len > 0)) {
-	out_compact = sh_util_acl_compact (out, len);
-	acl_free(out);
-	if (out_compact) 
-	  {
-	    collect = sh_util_strconcat (_("acl_access:"), out_compact, NULL);
-	    SH_FREE(out_compact);
-	  }
-      }
-      acl_free(result);
-    }
-  
-  
-  if ( S_ISDIR(buf->st_mode) ) 
-    {
-      result = acl_get_file (path, ACL_TYPE_DEFAULT);
-      
-      if (result)
-	{
-	  out = acl_to_text (result, &len);
-	  if (out && (len > 0)) {
-	    out_compact = sh_util_acl_compact (out, len);
-	    acl_free(out);
-	    if (out_compact) {
-	      if (collect) {
-		tmp = sh_util_strconcat (_("acl_default:"), 
-					 out_compact, ":", collect, NULL);
-		SH_FREE(collect);
-	      }
-	      else {
-		tmp = sh_util_strconcat (_("acl_default:"), out_compact, NULL);
-	      }
-	      SH_FREE(out_compact);
-	      collect = tmp;
-	    }
-	  }
-	  acl_free(result);
-	}
-    }
-  
-  SL_RETURN((collect),_("sh_unix_getinfo_acl"));
-}
-#endif
-
-#ifdef USE_XATTR
-
-#include <attr/xattr.h>
-static char * sh_unix_getinfo_xattr_int (char * path, int fd, char * name)
-{
-  char *  out   = NULL;
-  char *  tmp   = NULL;
-  size_t  size  = 256;
-  ssize_t result;
-
-  SL_ENTER(_("sh_unix_getinfo_xattr_int"));
-
-  out = SH_ALLOC(size);
-
-  result = (fd == -1) ? 
-    lgetxattr (path, name, out, size-1) :
-    fgetxattr (fd,   name, out, size-1);
-
-  if (result == -1 && errno == ERANGE) 
-    {
-      SH_FREE(out);
-      result = (fd == -1) ? 
-	lgetxattr (path, name, NULL, 0) :
-	fgetxattr (fd,   name, NULL, 0);
-      size = result + 1;
-      out  = SH_ALLOC(size);
-      result = (fd == -1) ? 
-	lgetxattr (path, name, out, size-1) :
-	fgetxattr (fd,   name, out, size-1);
-    }
-
-  if ((result > 0) && ((size_t)result < size))
-    {
-      out[size-1] = '\0';
-      tmp = out;
-    }
-  else
-    {
-      SH_FREE(out);
-    }
-
-  SL_RETURN((tmp),_("sh_unix_getinfo_xattr_int"));
-}
-
-
-static char * sh_unix_getinfo_xattr (char * path, int fd, struct stat * buf)
-{
-  /* system.posix_acl_access, system.posix_acl_default, security.selinux 
-   */
-  char *  tmp;
-  char *  out  = NULL;
-  char *  collect = NULL;
-
-  SL_ENTER(_("sh_unix_getinfo_xattr"));
-
-#ifdef USE_ACL
-  /*
-   * we need the acl_get_fd/acl_get_file functions, getxattr will only
-   * yield the raw bytes
-   */
-  if (sh_unix_check_acl == S_TRUE) 
-    {
-      out = sh_unix_getinfo_acl(path, fd, buf);
-      
-      if (out)
-	{
-	  collect = out;
-	}
-  }
-#else
-  (void) buf;
-#endif
-
-  if (sh_unix_check_selinux == S_TRUE)
-    {
-      out = sh_unix_getinfo_xattr_int(path, fd, _("security.selinux"));
-
-      if (out)
-	{
-	  if (collect) {
-	    tmp = sh_util_strconcat(_("selinux:"), out, ":", collect, NULL);
-	    SH_FREE(collect);
-	  }
-	  else {
-	    tmp = sh_util_strconcat(_("selinux:"), out, NULL);
-	  }
-	  SH_FREE(out);
-	  collect = tmp;
-	}
-    }
-
-  SL_RETURN((collect),_("sh_unix_getinfo_xattr"));
-}
-#endif
-
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
-int sh_unix_setcheckattributes (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_unix_setcheckattributes"));
-  i = sh_util_flagval(c, &(sh_unix_check_attributes));
-
-  SL_RETURN(i, _("sh_unix_setcheckattributes"));
-}
-#endif
-
-#ifdef USE_XATTR
-int sh_unix_setcheckselinux (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_unix_setcheckselinux"));
-  i = sh_util_flagval(c, &(sh_unix_check_selinux));
-
-  SL_RETURN(i, _("sh_unix_setcheckselinux"));
-}
-#endif
-
-#ifdef USE_ACL
-int sh_unix_setcheckacl (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_unix_setcheckacl"));
-  i = sh_util_flagval(c, &(sh_unix_check_acl));
-
-  SL_RETURN(i, _("sh_unix_setcheckacl"));
-}
-#endif
-
-#ifdef HAVE_LIBZ
-#include <zlib.h>
-#endif    
-
-
-static void * sh_dummy_filename;
-void * sh_dummy_tmp;
-void * sh_dummy_tmp2;
-
-int sh_unix_getinfo (int level, const char * filename, file_type * theFile, 
+int sh_unix_getinfo (int level, char * filename, file_type * theFile, 
 		     char * fileHash, int policy)
 {
@@ -3829,27 +2695,24 @@
   struct stat   lbuf;
   struct stat   fbuf;
-  volatile int  stat_return;
-  volatile int  stat_errno = 0;
-
+  int           stat_return;
+  register int  i;
   ShFileType    type;
   unsigned int  mode;
+  char        * name;
   char        * tmp;
   char        * tmp2;
-
+  /* char        * p; */
   char        * linknamebuf;
-  volatile int  linksize;
+  int           linksize;
 
   extern int get_the_fd (SL_TICKET ticket);
 
-  volatile SL_TICKET     rval_open;
-  volatile int           err_open = 0;
-
-  volatile int           fd;
-  volatile int           fstat_return;
-  volatile int           fstat_errno = 0;
-  volatile int           try         = 0;
-
-  sh_string   * content = NULL;
-      
+  SL_TICKET     rval_open;
+  int           fd;
+#if defined(__linux__)
+  int           fd_2;
+#endif
+  int           fstat_return;
+
   time_t        tend;
   time_t        tstart;
@@ -3858,83 +2721,44 @@
   char * path = NULL;
 
-  volatile int alert_timeout   = 120;
+  int alert_timeout   = 120;
 
   path = theFile->fullpath;
 
+#if 0
+  {
+    char pwd[256];
+    printf("%d %s %s %s (%s)\n", flagrel, theFile->fullpath, filename, path,
+	   getcwd (pwd, 256)); 
+  }
+#endif
+
   SL_ENTER(_("sh_unix_getinfo"));
 
-  if (!MODI_INITIALIZED(theFile->check_flags))
-    {
-      tmp2 = sh_util_safe_name (theFile->fullpath);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
-		       _("Uninitialized check mask"), _("sh_unix_getinfo"),
-		       tmp2);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SH_FREE(tmp2);
-      SL_RETURN((-1),_("sh_unix_getinfo"));
-    }
-
-  /* Take the address to keep gcc from putting it into a register. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_filename = (void *) &filename;
-  sh_dummy_tmp      = (void *) &tmp;
-  sh_dummy_tmp2     = (void *) &tmp2;
-
   /* --- Stat the file, and get checksum. ---
    */
   tstart = time(NULL);
-
   stat_return = retry_lstat (FIL__, __LINE__, 
 			     path /* theFile->fullpath */, &buf);
 
-  if (stat_return)
-    stat_errno = errno;
-
-  theFile->link_path = NULL;
-
- try_again:
-
-  fd           = -1;
-  fstat_return = -1;
-  rval_open    = -1;
-
   if (stat_return == 0 && S_ISREG(buf.st_mode)) 
     {
-      rval_open = sl_open_fastread (FIL__, __LINE__, 
-				    path /* theFile->fullpath */, SL_YESPRIV);
-      if (SL_ISERROR(rval_open))
-	{
-	  char * stale = sl_check_stale();
-	  
-	  if (stale)
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, err_open, MSG_E_SUBGEN,
-			      stale, _("sh_unix_getinfo_open"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-
-	  if (errno == EBADF && try == 0) /* obsolete, but we keep this, just in case */
-	    {
-	      /* cppcheck-suppress syntaxError */
-	      ++try;
-	      goto try_again;
-	    }
-	  err_open = errno;
-	}
+      rval_open = sl_open_fastread (path /* theFile->fullpath */, SL_YESPRIV);
 
       alert_timeout = 120; /* this is per 8K block now ! */
 
-      if (path[1] == 'p' && path[5] == '/' && path[2] == 'r' &&
-	  path[3] == 'o' && path[4] == 'c' && path[0] == '/')
+      if (path[0] == '/' && path[1] == 'p' && path[2] == 'r' &&
+	  path[3] == 'o' && path[4] == 'c' && path[5] == '/')
 	{
 	  /* seven is magic */
 	  alert_timeout = 7;
 	}
-
-      fd = get_the_fd(rval_open);
-    }
+    }
+  else
+    rval_open = -1;
+
+  if (SL_ISERROR(rval_open))
+    fd = -1;
+  else
+    fd = get_the_fd(rval_open);
 
   tend = time(NULL);
@@ -3946,45 +2770,21 @@
     {
       tmp2 = sh_util_safe_name (theFile->fullpath);
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_TOOLATE,
 		       (long)(tend - tstart), tmp2);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       SH_FREE(tmp2);
     }
-
+      
   if (fd >= 0) 
     {
       fstat_return = retry_fstat (FIL__, __LINE__, fd, &fbuf);
-
-      if (fstat_return)
-	{
-	  char * stale;
-
-	  fstat_errno = errno;
-
-	  stale = sl_check_stale();
-
-	  if (stale)
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, fstat_errno, 
-			      MSG_E_SUBGEN,
-			      stale, _("sh_unix_getinfo_fstat"));
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-
-	  if (try == 0) /* obsolete, but we keep this, just in case */
-	    {
-	      ++try;
-	      sl_close(rval_open);
-	      goto try_again;
-	    }
-	}
     }
   else
     {
-      fd = -1;
-    }
-      
+      fstat_return = -1;
+      fd           = -1;
+    }
+#if defined(__linux__)
+  fd_2 = fd;
+#endif
 
   /* ---  case 1: lstat failed  --- 
@@ -3997,24 +2797,11 @@
       if (sh.flag.checkSum == SH_CHECK_INIT || 
 	  (sh_hash_have_it (theFile->fullpath) >= 0 && 
-	   (!SH_FFLAG_REPORTED_SET(theFile->file_reported))))
+	   theFile->reported == S_FALSE))
 	{
 	  if (S_FALSE == sh_ignore_chk_del(theFile->fullpath)) {
-	    int flags = sh_hash_getflags (theFile->fullpath);
-
-	    if ((flags >= 0) && (flags & SH_FFLAG_ENOENT) == 0) {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      uid_t euid;
-	      (void) sl_get_euid(&euid);
-	      tmp2 = sh_util_safe_name (theFile->fullpath);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (level, FIL__, __LINE__, stat_return, MSG_FI_STAT,
-			       _("lstat"),
-			       sh_error_message (stat_errno, errbuf, sizeof(errbuf)),
-			       (long) euid,
-			       tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	      SH_FREE(tmp2);
-	      sh_hash_set_flag (theFile->fullpath, SH_FFLAG_ENOENT);
-	    }
+	    tmp2 = sh_util_safe_name (theFile->fullpath);
+	    sh_error_handle (level, FIL__, __LINE__, stat_return, MSG_FI_LSTAT,
+			     sh_error_message (stat_return), tmp2);
+	    SH_FREE(tmp2);
 	  }
 	}
@@ -4022,10 +2809,11 @@
     }
 
-  /* ---  case 2: not a regular file  --- 
+  /* ---  case 2: not a regular file, or [IgnoreAll]  --- 
    */
   else if (! S_ISREG(buf.st_mode))
     {
       if (fileHash != NULL)
-	sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
+	strcpy(fileHash,                              /* known to fit */
+	       _("000000000000000000000000000000000000000000000000"));
     }
   
@@ -4041,50 +2829,24 @@
       if (fileHash != NULL)
 	{
-	  if ((theFile->check_flags & MODI_CHK) == 0 ||
-	      sh_restrict_this(theFile->fullpath, (UINT64) fbuf.st_size, 
-			       (UINT64) fbuf.st_mode, rval_open))
+	  if ((theFile->check_mask & MODI_CHK) == 0)
 	    {
-	      sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
+	      strcpy(fileHash,                         /* known to fit */
+		     _("000000000000000000000000000000000000000000000000"));
 	    }
-	  else if ((theFile->check_flags & MODI_PREL) != 0 &&
+	  else if (policy == SH_LEVEL_PRELINK && 
 		   S_TRUE == sh_prelink_iself(rval_open, fbuf.st_size, 
-					      alert_timeout, theFile->fullpath))
+					      alert_timeout))
 	    {
 	      if (0 != sh_prelink_run (theFile->fullpath, 
-				       fileHash, alert_timeout, theFile->check_flags))
-		sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
+				       fileHash, alert_timeout))
+		strcpy(fileHash,                       /* known to fit */
+		       _("000000000000000000000000000000000000000000000000"));
 	    }
 	  else
 	    {
-	      char hashbuf[KEYBUF_SIZE];
-	      UINT64 length_current = TIGER_NOLIM;
-
-	      if (MODI_TXT_ENABLED(theFile->check_flags) && fbuf.st_size < (10 * SH_TXT_MAX))
-		{
-		  sl_init_content (rval_open, fbuf.st_size);
-		}
-
-	      if (sh.flag.opts == S_TRUE) sh_tiger_set_hashtype_mask(theFile->check_flags);
-	      sl_strlcpy(fileHash,
-			 sh_tiger_generic_hash (theFile->fullpath, 
-						rval_open, &length_current, 
-						alert_timeout, 
-						hashbuf, sizeof(hashbuf)),
-			 KEY_LEN+1);
-
-	      content = sl_get_content(rval_open);
-	      content = sh_string_copy(content);
-
-	      if ((theFile->check_flags & MODI_SGROW) != 0)
-		{
-		  /* Update size so it matches the one for which the checksum
-		     has been computed */
-		  fbuf.st_size = length_current;
-		  buf.st_size  = fbuf.st_size;
-		  sl_rewind(rval_open);
-		  sh_unix_checksum_size (theFile->fullpath, length_current, S_TRUE,
-					 &fileHash[KEY_LEN + 1], 
-					 alert_timeout, rval_open, theFile->check_flags);
-		}
+	      tiger_fd = rval_open;
+	      strcpy(fileHash,                         /* known to fit */
+		     sh_tiger_generic_hash (theFile->fullpath, TIGER_FD, 0, 
+					    alert_timeout));
 	    }
 	}
@@ -4099,50 +2861,25 @@
       if (fileHash != NULL)
 	{
-	  if ((theFile->check_flags & MODI_CHK) == 0 ||
-	      sh_restrict_this(theFile->fullpath, (UINT64) fbuf.st_size, 
-			       (UINT64) fbuf.st_mode, rval_open))
+	  if ((theFile->check_mask & MODI_CHK) == 0)
 	    {
-	      sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
+	      strcpy(fileHash,                         /* known to fit */
+		     _("000000000000000000000000000000000000000000000000"));
 	    }
 	  else if (policy == SH_LEVEL_PRELINK &&
 		   S_TRUE == sh_prelink_iself(rval_open, fbuf.st_size, 
-					      alert_timeout, theFile->fullpath))
+					      alert_timeout))
 	    {
 	      if (0 != sh_prelink_run (theFile->fullpath, 
-				       fileHash, alert_timeout, theFile->check_flags))
-		sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
+				       fileHash, alert_timeout))
+		strcpy(fileHash,                       /* known to fit */
+		       _("000000000000000000000000000000000000000000000000"));
 	    }
 	  else
 	    {
-	      char hashbuf[KEYBUF_SIZE];
-	      UINT64 length_current = TIGER_NOLIM;
-
-	      if (MODI_TXT_ENABLED(theFile->check_flags) && fbuf.st_size < (10 * SH_TXT_MAX))
-		{
-		  sl_init_content (rval_open, fbuf.st_size);
-		}
-
-	      if (sh.flag.opts == S_TRUE) sh_tiger_set_hashtype_mask(theFile->check_flags);
+	      tiger_fd = rval_open;
 	      sl_strlcpy(fileHash, 
-			 sh_tiger_generic_hash (theFile->fullpath, rval_open, 
-						&length_current,
-						alert_timeout,
-						hashbuf, sizeof(hashbuf)),
+			 sh_tiger_generic_hash (theFile->fullpath, TIGER_FD, 0,
+						alert_timeout),
 			 KEY_LEN + 1);
-
-	      content = sl_get_content(rval_open);
-	      content = sh_string_copy(content);
-
-	      if ((theFile->check_flags & MODI_SGROW) != 0) 
-		{
-		  /* Update size so it matches the one for which the checksum
-		     has been computed */
-		  fbuf.st_size = length_current;
-		  buf.st_size  = fbuf.st_size;
-		  sl_rewind(rval_open);
-		  sh_unix_checksum_size (theFile->fullpath, length_current, S_TRUE,
-					 &fileHash[KEY_LEN + 1], 
-					 alert_timeout, rval_open, theFile->check_flags);
-		}
 	    }
 	}
@@ -4152,49 +2889,16 @@
    */
 
-  else    /* fstat_return != 0 or !S_ISREG(fbuf.st_mode) or open() failed */
-    {
-      uid_t   euid;
-
+  else    /* fstat_return != 0 or !S_ISREG(fbuf->st_mode) */
+    {
+      fstat_return = errno;
       if (fileHash != NULL)
-	sl_strlcpy(fileHash, SH_KEY_NULL, KEY_LEN+1);
-
-      if ((theFile->check_flags & MODI_CHK) != 0)
-	{
-	  tmp2 = sh_util_safe_name (theFile->fullpath);
-
-
-	  if (fd >= 0 && fstat_return != 0)
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      (void) sl_get_euid(&euid);
-
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (level, FIL__, __LINE__, stat_return, MSG_FI_STAT,
-			       _("fstat"),
-			       sh_error_message (fstat_errno, errbuf, sizeof(errbuf)),
-			       (long) euid,
-			       tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  else if (fd >= 0 && !S_ISREG(fbuf.st_mode))
-	    {
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (level, FIL__, __LINE__, fstat_errno, 
-			       MSG_E_NOTREG, tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  else
-	    {
-	      char errbuf[SH_ERRBUF_SIZE];
-	      char errbuf2[SH_ERRBUF_SIZE];
-	      sl_strlcpy(errbuf, sl_error_string(rval_open), sizeof(errbuf));
-	      sh_error_message(err_open, errbuf2, sizeof(errbuf2));
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (level, FIL__, __LINE__, err_open, 
-			       MSG_E_READ, errbuf, errbuf2, tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  SH_FREE(tmp2);
-	}
+	sl_strlcpy(fileHash, 
+		   _("000000000000000000000000000000000000000000000000"), 
+		   KEY_LEN + 1);
+
+      tmp2 = sh_util_safe_name (theFile->fullpath);
+      sh_error_handle (level, FIL__, __LINE__, fstat_return, MSG_E_READ,
+		       tmp2);
+      SH_FREE(tmp2);
     }	  
 
@@ -4202,43 +2906,25 @@
   /* --- Determine file type. ---
    */
-  memset (theFile->c_mode, '-', CMODE_SIZE-1);
-  theFile->c_mode[CMODE_SIZE-1] = '\0';
-
-  memset (theFile->link_c_mode, '-', CMODE_SIZE-1);
-  theFile->link_c_mode[CMODE_SIZE-1] = '\0';
+  for (i = 0; i < 10; ++i) theFile->c_mode[i] = '-';
+  theFile->c_mode[10] = '\0';
+  for (i = 0; i < 11; ++i) theFile->link_c_mode[i] = '-';
+  theFile->link_c_mode[10] = '\0';
 
   sh_unix_getinfo_type (&buf, &type, theFile->c_mode);
   theFile->type = type;
 
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
+#if defined(__linux__)
 
   /* --- Determine file attributes. ---
    */
-  memset (theFile->c_attributes, '-', ATTRBUF_SIZE);
-  theFile->c_attributes[ATTRBUF_USED] = '\0';
+  for (i = 0; i < 12; ++i) theFile->c_attributes[i] = '-';
+  theFile->c_attributes[12] = '\0';
   theFile->attributes      =    0;
 
-#if defined(__linux__) || defined(HAVE_STAT_FLAGS)
   if (theFile->c_mode[0] != 'c' && theFile->c_mode[0] != 'b' &&
-      theFile->c_mode[0] != 'l' ) {
-    if (sh_unix_check_attributes == S_TRUE)
-      sh_unix_getinfo_attr(theFile->fullpath, 
-			   &theFile->attributes, theFile->c_attributes, 
-			   fd, &buf);
-  }
-#endif
-#endif
-
-#if defined(USE_XATTR) && defined(USE_ACL)
-  if (sh_unix_check_selinux == S_TRUE || sh_unix_check_acl == S_TRUE)
-    theFile->attr_string = sh_unix_getinfo_xattr (theFile->fullpath, fd, &buf);
-#elif defined(USE_XATTR)
-  if (sh_unix_check_selinux == S_TRUE)
-    theFile->attr_string = sh_unix_getinfo_xattr (theFile->fullpath, fd, &buf);
-#elif defined(USE_ACL)
-  if (sh_unix_check_acl == S_TRUE)
-    theFile->attr_string = sh_unix_getinfo_acl (theFile->fullpath, fd, &buf);
-#else
-  theFile->attr_string = NULL;
+      theFile->c_mode[0] != 'l' )
+    sh_unix_getinfo_attr(theFile->fullpath, 
+			 &theFile->attributes, theFile->c_attributes, fd_2);
+
 #endif
 
@@ -4281,5 +2967,8 @@
    */
 
-  if (NULL == sh_unix_getGIDname(SH_ERR_ALL, buf.st_gid, theFile->c_group, GROUP_MAX+1)) {
+  if ( (name = sh_unix_getGIDname(SH_ERR_ALL,
+				  buf.st_gid)) != NULL) {
+    sl_strlcpy (theFile->c_group, name, GROUP_MAX+1);
+  } else {
 
     tmp2 = sh_util_safe_name (theFile->fullpath);
@@ -4287,17 +2976,13 @@
     if (policy == SH_LEVEL_ALLIGNORE)
       {
-	SH_MUTEX_LOCK(mutex_thread_nolog);
 	sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, ENOENT, 
 			 MSG_FI_NOGRP,
 			 (long) buf.st_gid, tmp2);
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
       }
     else
       {
-	SH_MUTEX_LOCK(mutex_thread_nolog);
 	sh_error_handle (ShDFLevel[SH_ERR_T_NAME], FIL__, __LINE__, ENOENT, 
 			 MSG_FI_NOGRP,
 			 (long) buf.st_gid, tmp2);
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
       }
     SH_FREE(tmp2);
@@ -4306,5 +2991,8 @@
 
   
-  if (NULL == sh_unix_getUIDname(SH_ERR_ALL, buf.st_uid, theFile->c_owner, USER_MAX+1)) {
+  if ( (name = sh_unix_getUIDname(SH_ERR_ALL,
+				  buf.st_uid)) != NULL) {
+    sl_strlcpy (theFile->c_owner, name, USER_MAX+1);
+  } else {
 
     tmp2 = sh_util_safe_name (theFile->fullpath);
@@ -4312,17 +3000,13 @@
     if (policy == SH_LEVEL_ALLIGNORE)
       {
-	SH_MUTEX_LOCK(mutex_thread_nolog);
 	sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, ENOENT, 
 			 MSG_FI_NOUSR,
 			 (long) buf.st_uid, tmp2);
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
       }
     else
       {
-	SH_MUTEX_LOCK(mutex_thread_nolog);
 	sh_error_handle (ShDFLevel[SH_ERR_T_NAME], FIL__, __LINE__, ENOENT, 
 			 MSG_FI_NOUSR,
 			 (long) buf.st_uid, tmp2);
-	SH_MUTEX_UNLOCK(mutex_thread_nolog);
       }
     SH_FREE(tmp2);
@@ -4332,10 +3016,9 @@
   /* --- Output the file. ---
    */
-  if (flag_err_debug == S_TRUE)
+  if (flag_err_debug == SL_TRUE)
     {
       tmp2 = sh_util_safe_name ((filename == NULL) ? 
 				theFile->fullpath : filename);
-      (void) sh_unix_time(theFile->mtime, timestr, sizeof(timestr));
-      SH_MUTEX_LOCK(mutex_thread_nolog);
+      sl_strlcpy(timestr, sh_unix_time(theFile->mtime), 81);
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_LIST,
 		       theFile->c_mode,
@@ -4346,5 +3029,4 @@
 		       timestr,
 		       tmp2);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       SH_FREE(tmp2);
     }
@@ -4354,7 +3036,7 @@
   if (theFile->c_mode[0] == 'l') 
     {
+
       linknamebuf = SH_ALLOC(PATH_MAX);
 
-      /* flawfinder: ignore */
       linksize    = readlink (theFile->fullpath, linknamebuf, PATH_MAX-1);
 
@@ -4366,165 +3048,92 @@
       if (linksize < 0) 
 	{
-	  char errbuf[SH_ERRBUF_SIZE];
 	  linksize = errno;
 	  tmp2 = sh_util_safe_name (theFile->fullpath);
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle (level, FIL__, __LINE__, linksize, MSG_FI_RDLNK,
-			   sh_error_message (linksize, errbuf, sizeof(errbuf)), tmp2);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
+			   sh_error_message (linksize), tmp2);
 	  SH_FREE(tmp2);
 	  SH_FREE(linknamebuf);
-	  theFile->link_path = sh_util_strdup("-");
 	  SL_RETURN((-1),_("sh_unix_getinfo"));
 	}
-
-      if (linknamebuf[0] == '/') 
-	{
-	  theFile->link_path = sh_util_strdup (linknamebuf);
-	} 
-      else 
-	{
-	  tmp = sh_util_dirname(theFile->fullpath);
-	  if (tmp) {
-	    theFile->link_path = SH_ALLOC(PATH_MAX);
-	    sl_strlcpy (theFile->link_path, tmp, PATH_MAX);
-	    SH_FREE(tmp);
-	  } else {
-	    theFile->link_path = SH_ALLOC(PATH_MAX);
-	    theFile->link_path[0] = '\0';
+    
+    if (linknamebuf[0] == '/') 
+      {
+	sl_strlcpy (theFile->linkpath, linknamebuf, PATH_MAX);
+      } 
+    else 
+      {
+	tmp = sh_util_basename(theFile->fullpath);
+	sl_strlcpy (theFile->linkpath, 
+		    tmp, 
+		    PATH_MAX);
+	SH_FREE(tmp);
+	sl_strlcat (theFile->linkpath, 
+		    "/", PATH_MAX);
+	sl_strlcat (theFile->linkpath, 
+		    linknamebuf, 
+		    PATH_MAX);
+      }
+    
+    /* stat the link
+     */
+    stat_return = retry_lstat (FIL__, __LINE__, theFile->linkpath, &lbuf); 
+
+    /* check for error
+     */
+    if (stat_return != 0) 
+      { 
+	stat_return = errno;
+	tmp  = sh_util_safe_name (theFile->fullpath);
+	tmp2 = sh_util_safe_name (theFile->linkpath);
+	if (stat_return != ENOENT)
+	  { 
+	    sh_error_handle (level, FIL__, __LINE__, stat_return, 
+			     MSG_FI_LSTAT,
+			     sh_error_message (stat_return), tmp2);
 	  }
-	  /*
-	   * Only attach '/' if not root directory. Handle "//", which
-	   * according to POSIX is implementation-defined, and may be
-	   * different from "/" (however, three or more '/' will collapse
-	   * to one).
-	   */
-	  tmp = theFile->link_path; while (*tmp == '/') ++tmp;
-	  if (*tmp != '\0')
-	    {
-	      sl_strlcat (theFile->link_path, "/", PATH_MAX);
-	    }
-	  sl_strlcat (theFile->link_path, linknamebuf, PATH_MAX);
-	}
+	else 
+	  {
+	    /* a dangling link -- everybody seems to have plenty of them 
+	     */
+	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DLNK,
+			     tmp, tmp2);
+	  }
+	theFile->linkisok = BAD;
+	SH_FREE(tmp);
+	SH_FREE(tmp2);
+	SH_FREE(linknamebuf);
+	/* 
+	 * changed Tue Feb 10 16:16:13 CET 2004:
+	 *  add dangling symlinks into database
+	 * SL_RETURN((-1),_("sh_unix_getinfo")); 
+	 */
+	theFile->linkmode = 0;
+	SL_RETURN((0),_("sh_unix_getinfo")); 
+      }
+
+    theFile->linkisok = GOOD;
       
-      /* stat the link
-       */
-      stat_return = retry_lstat (FIL__, __LINE__, theFile->link_path, &lbuf); 
-      
-      /* check for error
-       */
-      if (stat_return != 0) 
-	{ 
-	  stat_return = errno;
-	  tmp  = sh_util_safe_name (theFile->fullpath);
-	  tmp2 = sh_util_safe_name (theFile->link_path);
-	  if (stat_return != ENOENT)
-	    { 
-	      uid_t euid;
-	      char errbuf[SH_ERRBUF_SIZE];
-
-	      (void) sl_get_euid(&euid);
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle (level, FIL__, __LINE__, stat_return, 
-			       MSG_FI_STAT,
-			       _("lstat (link target)"),
-			       sh_error_message (stat_return,errbuf, sizeof(errbuf)), 
-			       (long) euid,
-			       tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  else 
-	    {
-	      /* a dangling link -- everybody seems to have plenty of them 
-	       */
-	      SH_MUTEX_LOCK(mutex_thread_nolog);
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DLNK,
-			       tmp, tmp2);
-	      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	    }
-	  theFile->linkisok = BAD;
-	  SH_FREE(tmp);
-	  SH_FREE(tmp2);
-	  SH_FREE(linknamebuf);
-	  /* 
-	   * changed Tue Feb 10 16:16:13 CET 2004:
-	   *  add dangling symlinks into database
-	   * SL_RETURN((-1),_("sh_unix_getinfo")); 
-	   */
-	  theFile->linkmode = 0;
-	  SL_RETURN((0),_("sh_unix_getinfo")); 
-	}
-      
-      theFile->linkisok = GOOD;
-      
-      
-      /* --- Determine file type. ---
-       */
-      sh_unix_getinfo_type (&lbuf, &type, theFile->link_c_mode);
-      theFile->type = type;
-      
-      /* --- Determine permissions. ---
-       */
-      sh_unix_getinfo_mode (&lbuf, &mode, theFile->link_c_mode);
-      theFile->linkmode = lbuf.st_mode;
-      
-      /* --- Output the link. ---
-       */
-      if (theFile->linkisok == GOOD) 
-	{
-	  tmp2 = sh_util_safe_name (linknamebuf);      
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_LLNK,
-			   theFile->link_c_mode, tmp2);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-	  SH_FREE(tmp2);
-	}
-      SH_FREE(linknamebuf);
-    }
-  else /* not a link, theFile->c_mode[0] != 'l' */
-    {
-      if (content)
-	{
-#ifdef HAVE_LIBZ
-	  unsigned long   clen;
-	  unsigned char * compressed;
-#ifdef HAVE_COMPRESSBOUND
-	  clen       = compressBound(sh_string_len(content));
-#else
-	  if (sh_string_len(content) > 10*SH_TXT_MAX)
-	    clen = SH_TXT_MAX;
-	  else
-	    clen = 13 + (int)(1.0001*sh_string_len(content));
-#endif
-	  compressed = SH_ALLOC(clen);
-	  if (Z_OK == compress(compressed, &clen, 
-			       (unsigned char *) sh_string_str(content), 
-			       sh_string_len(content)))
-	      {
-		if (clen < SH_TXT_MAX)
-		  {
-		    sh_util_base64_enc_alloc (&(theFile->link_path), 
-					      (char *) compressed, clen);
-		  }
-		else
-		  {
-		    char tmsg[128];
-		    char * tpath = sh_util_safe_name (theFile->fullpath);
-		    sl_snprintf(tmsg, sizeof(tmsg), 
-				_("compressed file too large (%lu bytes)"),
-				clen);
-		    SH_MUTEX_LOCK(mutex_thread_nolog);
-		    sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, -1, 
-				     MSG_E_SUBGPATH, tmsg, 
-				     _("sh_unix_getinfo"), tpath);
-		    SH_MUTEX_UNLOCK(mutex_thread_nolog);
-		    SH_FREE(tpath);
-		  }
-	      }
-	  SH_FREE(compressed);
-#endif
-	  sh_string_destroy(&content);
-	}
-    } 
+
+    /* --- Determine file type. ---
+     */
+    sh_unix_getinfo_type (&lbuf, &type, theFile->link_c_mode);
+    theFile->type = type;
+  
+    /* --- Determine permissions. ---
+     */
+    sh_unix_getinfo_mode (&lbuf, &mode, theFile->link_c_mode);
+    theFile->linkmode = lbuf.st_mode;
+
+    /* --- Output the link. ---
+     */
+    if (theFile->linkisok == GOOD) 
+      {
+	tmp2 = sh_util_safe_name (linknamebuf);      
+	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_LLNK,
+			 theFile->link_c_mode, tmp2);
+	SH_FREE(tmp2);
+      }
+    SH_FREE(linknamebuf);
+  }  
   SL_RETURN((0),_("sh_unix_getinfo"));
 }
@@ -4533,128 +3142,6 @@
 #endif
 
-int sh_unix_unlock(char * lockfile, char * flag)
-{
-  int         error = 0;
-  
-  SL_ENTER(_("sh_unix_unlock"));
-
-  if (sh.flag.isdaemon == S_FALSE && flag == NULL)
-    SL_RETURN((0),_("sh_unix_unlock"));
-
-  /* --- Logfile is not locked to us. ---
-   */
-  if (sh.flag.islocked == BAD && flag != NULL) 
-    SL_RETURN((-1),_("sh_unix_unlock"));
-
-  /* --- Check whether the directory is secure. ---
-   */
-  if (0 != tf_trust_check (lockfile, SL_YESPRIV))
-    SL_RETURN((-1),_("sh_unix_unlock"));
-
-  /* --- Delete the lock file. --- 
-   */
-  error = retry_aud_unlink (FIL__, __LINE__, lockfile);
-  
-  if (error == 0)
-    {
-      if (flag != NULL)
-	sh.flag.islocked = BAD; /* not locked anymore */
-    }
-  else if (flag != NULL)
-    {
-      char errbuf[SH_ERRBUF_SIZE];
-      error = errno;
-      sh_error_handle ((-1), FIL__, __LINE__, error, MSG_E_UNLNK,
-		       sh_error_message(error, errbuf, sizeof(errbuf)), 
-		       lockfile);
-      SL_RETURN((-1),_("sh_unix_unlock"));
-    }
-  SL_RETURN((0),_("sh_unix_unlock"));
-}
-
-int sh_unix_check_piddir (char * pidpath)
-{
-  static        struct stat   buf;
-  int           status = 0;
-  char        * pid_dir;
-  
-  SL_ENTER(_("sh_unix_check_piddir"));
-
-  pid_dir = sh_util_dirname (pidpath);
-
-  status = retry_lstat (FIL__, __LINE__, pid_dir, &buf);
-
-  if (status < 0 && errno == ENOENT)
-    {
-      status = mkdir (pid_dir, 0777);
-      if (status < 0)
-	{
-	  sh_error_handle ((-1), FIL__, __LINE__, status,
-			   MSG_E_SUBGEN, 
-			   _("Cannot create PID directory"),
-			   _("sh_unix_check_piddir"));
-	  SH_FREE(pid_dir);
-	  SL_RETURN((-1),_("sh_unix_check_piddir"));
-	}
-    }
-  else if (!S_ISDIR(buf.st_mode))
-    {
-      sh_error_handle ((-1), FIL__, __LINE__, status,
-		       MSG_E_SUBGEN, 
-		       _("Path of PID directory refers to a non-directory object"),
-		       _("sh_unix_check_piddir"));
-      SH_FREE(pid_dir);
-      SL_RETURN((-1),_("sh_unix_check_piddir"));
-    }
-  SH_FREE(pid_dir);
-  SL_RETURN((0),_("sh_unix_check_piddir"));
-}
-
-int sh_unix_lock (char * lockfile, char * flag)
-{
-  int filed;
-  int errnum;
-  char myPid[64];
-  SL_TICKET  fd;
-  extern int get_the_fd (SL_TICKET ticket);
-
-  SL_ENTER(_("sh_unix_lock"));
-
-  sl_snprintf (myPid, sizeof(myPid), "%ld\n", (long) sh.pid);             /* known to fit  */
-
-  if (flag == NULL) /* PID file, check for directory */
-    {
-      if (0 != sh_unix_check_piddir (lockfile))
-	{
-	  SL_RETURN((-1),_("sh_unix_lock"));
-	}
-    }
-
-  fd = sl_open_safe_rdwr (FIL__, __LINE__, 
-			  lockfile, SL_YESPRIV);      /* fails if file exists */
-
-  if (!SL_ISERROR(fd))
-    {
-      errnum = sl_write (fd, myPid, sl_strlen(myPid));
-      filed = get_the_fd(fd);
-      fchmod (filed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
-      sl_close (fd);
-
-      if (!SL_ISERROR(errnum))
-	{
-	  if (flag != NULL)
-	    sh.flag.islocked = GOOD;
-	  SL_RETURN((0),_("sh_unix_lock"));
-	}
-    }
-
-  TPT((0, FIL__, __LINE__, _("msg=<open pid file failed>\n")));
-  if (flag != NULL)
-    sh.flag.islocked       = BAD;
-  SL_RETURN((-1),_("sh_unix_lock"));
-
-  /* notreached */
-}
-
+int sh_unix_unlock (char * lockfile, char * flag);
+int sh_unix_lock   (char * lockfile, char * flag);
 
 /* check whether file is locked
@@ -4670,4 +3157,14 @@
 
   SL_ENTER(_("sh_unix_test_and_lock"));
+
+  if (filename != NULL)
+    {
+      status = retry_lstat (FIL__, __LINE__, filename, &buf);
+
+      /* no logfile to lock
+       */
+      if (status < 0)
+	SL_RETURN((-1),_("sh_unix_test_and_lock"));
+    }
 
   status = retry_lstat (FIL__, __LINE__, lockfile, &buf);
@@ -4683,12 +3180,4 @@
 	    sh.flag.islocked = GOOD;
 	  SL_RETURN((0),_("sh_unix_test_and_lock"));
-	}
-      else
-	{
-	  sh_error_handle ((-1), FIL__, __LINE__, status,
-			   MSG_E_SUBGEN, 
-			   (filename == NULL) ? _("Cannot create PID file (1)") : _("Cannot create lock file (1)"),
-			   _("sh_unix_test_and_lock"));
-	  SL_RETURN((-1),_("sh_unix_test_and_lock"));
 	}
     }
@@ -4708,8 +3197,8 @@
       else
 	{
-	  sh_error_handle ((-1), FIL__, __LINE__, status,
-			   MSG_E_SUBGEN, 
-			   (filename == NULL) ? _("Cannot create PID file (2)") : _("Cannot create lock file (2)"),
-			   _("sh_unix_test_and_lock"));
+	   sh_error_handle ((-1), FIL__, __LINE__, status,
+			    MSG_E_SUBGEN, 
+			    (filename == NULL) ? _("Cannot create PID file") : _("Cannot create lock file"),
+			    _("sh_unix_test_and_lock"));
 	  SL_RETURN((-1),_("sh_unix_test_and_lock"));
 	}
@@ -4721,5 +3210,5 @@
   if (status >= 0)
     {
-       fd = sl_open_read (FIL__, __LINE__, lockfile, SL_YESPRIV);
+       fd = sl_open_read (lockfile, SL_YESPRIV);
        if (SL_ISERROR(fd))
 	 sh_error_handle ((-1), FIL__, __LINE__, fd,
@@ -4735,6 +3224,5 @@
       /* read the PID in the lock file
        */
-      status = sl_read (fd, line_in, sizeof(line_in));
-      line_in[sizeof(line_in)-1] = '\0';
+      status = sh_unix_getline (fd, line_in, sizeof(line_in)-1);
 
       /* convert to numeric
@@ -4763,5 +3251,5 @@
       sl_close(fd);
 
-      if (status > 0 && (unsigned int) status == sh.pid)
+      if (status == (int) getpid())
 	{
 	  if (filename != NULL)
@@ -4799,5 +3287,5 @@
 		       sh_error_handle ((-1), FIL__, __LINE__, status,
 					MSG_E_SUBGEN, 
-					(filename == NULL) ? _("Cannot create PID file (3)") : _("Cannot create lock file (3)"),
+					(filename == NULL) ? _("Cannot create PID file") : _("Cannot create lock file"),
 					_("sh_unix_test_and_lock"));
 		    }
@@ -4831,6 +3319,5 @@
 int sh_unix_write_lock_file(char * filename)
 {
-  size_t len;
-  int    res;
+  int i;
   char * lockfile;
 
@@ -4838,13 +3325,46 @@
     return (-1);
 
-  len = sl_strlen(filename);
-  if (sl_ok_adds(len, 6))
-    len += 6;
-  lockfile = SH_ALLOC(len);
-  sl_strlcpy(lockfile, filename,   len);
-  sl_strlcat(lockfile, _(".lock"), len);
-  res = sh_unix_test_and_lock(filename, lockfile);
+  i        = 6 + sl_strlen(filename);
+  lockfile = SH_ALLOC(i);
+  sl_strlcpy(lockfile, filename,   i);
+  sl_strlcat(lockfile, _(".lock"), i);
+  i = sh_unix_test_and_lock(filename, lockfile);
   SH_FREE(lockfile);
-  return res;
+  return i;
+}
+
+int sh_unix_unlock(char * lockfile, char * flag)
+{
+  int         error = 0;
+  
+  SL_ENTER(_("sh_unix_unlock"));
+
+  /* --- Logfile is not locked to us. ---
+   */
+  if (sh.flag.islocked == BAD && flag != NULL) 
+    SL_RETURN((-1),_("sh_unix_unlock"));
+
+  /* --- Check whether the directory is secure. ---
+   */
+  if (0 != tf_trust_check (lockfile, SL_YESPRIV))
+    SL_RETURN((-1),_("sh_unix_unlock"));
+
+  /* --- Delete the lock file. --- 
+   */
+  error = retry_aud_unlink (FIL__, __LINE__, lockfile);
+  
+  if (error == 0)
+    {
+      if (flag != NULL)
+	sh.flag.islocked = BAD; /* not locked anymore */
+    }
+  else if (flag != NULL)
+    {
+      error = errno;
+      sh_error_handle ((-1), FIL__, __LINE__, error, MSG_E_UNLNK,
+		       sh_error_message(error), lockfile);
+      SL_RETURN((-1),_("sh_unix_unlock"));
+    }
+  SL_RETURN((0),_("sh_unix_unlock"));
 }
 
@@ -4853,6 +3373,5 @@
 int sh_unix_rm_lock_file(char * filename)
 {
-  size_t len;
-  int res;
+  int i;
   char * lockfile;
 
@@ -4860,14 +3379,11 @@
     return (-1);
 
-  len = sl_strlen(filename);
-  if (sl_ok_adds(len, 6))
-    len += 6;
-  lockfile = SH_ALLOC(len);
-  sl_strlcpy(lockfile, filename,   len);
-  sl_strlcat(lockfile, _(".lock"), len);
-
-  res = sh_unix_unlock(lockfile, filename);
+  i        = 6 + sl_strlen(filename);
+  lockfile = SH_ALLOC(i);
+  sl_strlcpy(lockfile, filename,   i);
+  sl_strlcat(lockfile, _(".lock"), i);
+  i = sh_unix_unlock(lockfile, filename);
   SH_FREE(lockfile);
-  return res;
+  return i;
 }
 
@@ -4879,34 +3395,89 @@
 }
 
+int sh_unix_lock (char * lockfile, char * flag)
+{
+  struct stat buf;
+  int status;
+  int filed;
+  int errnum;
+  char myPid[64];
+  SL_TICKET  fd;
+  extern int get_the_fd (SL_TICKET ticket);
+
+
+  status = retry_lstat (FIL__, __LINE__, lockfile, &buf);
+  
+  SL_ENTER(_("sh_unix_lock"));
+
+  if (0 == status) 
+    {
+      if (flag != NULL)
+	sh.flag.islocked       = BAD;
+      SL_RETURN((-1),_("sh_unix_lock"));
+    }
+
+  sprintf (myPid, "%ld\n", (long) getpid());           /* known to fit  */
+
+  fd = sl_open_write (lockfile, SL_YESPRIV);
+
+  if (!SL_ISERROR(fd))
+    {
+      errnum = sl_write (fd, myPid, sl_strlen(myPid));
+      filed = get_the_fd(fd);
+      fchmod (filed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+      sl_close (fd);
+
+      if (!SL_ISERROR(errnum))
+	{
+	  if (flag != NULL)
+	    sh.flag.islocked = GOOD;
+	  SL_RETURN((0),_("sh_unix_lock"));
+	}
+    }
+
+  TPT((0, FIL__, __LINE__, _("msg=<open pid file failed>\n")));
+  if (flag != NULL)
+    sh.flag.islocked       = BAD;
+  SL_RETURN((-1),_("sh_unix_lock"));
+
+  /* notreached */
+}
+
 /* Test whether file exists
  */
-int sh_unix_file_exists(char * path)
+int sh_unix_file_stat(char * path)
 {
   struct stat buf;
 
+  SL_ENTER(_("sh_unix_file_stat"));
+
+  if (-1 == retry_stat(FIL__, __LINE__, path, &buf))
+    SL_RETURN(  (0), _("sh_unix_file_stat"));
+  else 
+    SL_RETURN( (-1), _("sh_unix_file_stat"));
+}
+
+
+/* Test whether file exists, is a character device, allows read
+ * access, and is not world writeable.
+ */
+int sh_unix_file_exists(int fd)
+{
+  struct stat buf;
+
   SL_ENTER(_("sh_unix_file_exists"));
 
-  if (0 == retry_lstat(FIL__, __LINE__, path, &buf))
-    SL_RETURN( S_TRUE,   _("sh_unix_file_exists"));
-
-  SL_RETURN( S_FALSE,  _("sh_unix_file_exists"));
-}
-
-
-/* Test whether file exists, is a character device, and allows read
- * access.
- */
-int sh_unix_device_readable(int fd)
-{
-  struct stat buf;
-
-  SL_ENTER(_("sh_unix_device_readable"));
-
   if (retry_fstat(FIL__, __LINE__, fd, &buf) == -1)
-    SL_RETURN( (-1), _("sh_unix_device_readable"));
-  if ( S_ISCHR(buf.st_mode) &&  0 != (S_IROTH & buf.st_mode) ) 
-    SL_RETURN( (0), _("sh_unix_device_readable"));
-
-  SL_RETURN( (-1), _("sh_unix_device_readable"));
+    SL_RETURN( (-1), _("sh_unix_file_exists"));
+  else if ( S_ISCHR(buf.st_mode) &&  0 != (S_IROTH & buf.st_mode)
+	    /*
+	     * #if !defined(__CYGWIN32__) && !defined(__CYGWIN__) 
+	     * && 0 == (S_IWOTH & buf.st_mode)
+	     * #endif
+	     */
+	    ) 
+    SL_RETURN( (0), _("sh_unix_file_exists"));
+  else 
+    SL_RETURN( (-1), _("sh_unix_file_exists"));
 }
 
@@ -4918,5 +3489,4 @@
 {
   static int init = 0;
-  struct stat buf;
 
   SL_ENTER(_("file_is_remote"));
@@ -4929,26 +3499,4 @@
   if (0 == sl_strncmp (sh.data.path, preq, 15))
     {
-      if (sh.data.path[15] != '\0') /* should be start of path */
-	{
-	  if (0 == stat(&(sh.data.path[15]), &buf))
-	    {
-	      SL_RETURN( S_FALSE, _("file_is_remote"));
-	    }
-	  else
-	    {
-	      char * tmp  = sh_util_safe_name (&(sh.data.path[15]));
-	      sh_error_handle((-1), FIL__, __LINE__, S_FALSE, MSG_E_SUBGPATH, 
-			      _("No local baseline database at expected path"), 
-			      _("file_is_remote"),
-			      tmp);
-	      SH_FREE(tmp);
-	    }
-	}
-      else
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, S_FALSE, MSG_E_SUBGEN, 
-			  _("No local baseline database path known"), 
-			  _("file_is_remote"));
-	}
       SL_RETURN( S_TRUE, _("file_is_remote"));
     }
@@ -5042,6 +3590,4 @@
   unsigned long  page_start;
   int            page_refcount;
-  char           file[64];
-  int            line;
   struct sh_page_lt * next;
 } sh_page_l;
@@ -5087,13 +3633,10 @@
 
 #if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-
-SH_MUTEX_STATIC(mutex_mlock,PTHREAD_MUTEX_INITIALIZER);
-
-int sh_unix_mlock (const char * file, int line, void * in_addr, size_t len)
+int sh_unix_mlock (void * in_addr, size_t len)
 {
   int         num_pages;
   int         status = 0;
   int         pagesize;
-  sh_page_l * page_list;
+  sh_page_l * page_list = sh_page_locked;
   unsigned long addr;
 #ifdef TEST_MLOCK
@@ -5103,16 +3646,8 @@
   SL_ENTER(_("sh_unix_mlock"));
 
-  /* There's no cancellation point here, except if tracing is on
-   */
-  SH_MUTEX_LOCK_UNSAFE(mutex_mlock);
-
-  page_list = sh_page_locked;
-
   if (0 != page_locking)
     {
-      status = -1;
-      goto exit_mlock;
-    }
-
+      SL_RETURN((-1), _("sh_unix_mlock"));
+    }
   page_locking = 1;
 
@@ -5128,5 +3663,4 @@
    * addr is first page; num_pages is #(consecutive pages) to lock
    */
-
   while ((page_list != NULL) && (num_pages > 0))
     {
@@ -5163,17 +3697,13 @@
       page_list->page_start = addr;
       page_list->page_refcount = 1;
-      sl_strlcpy(page_list->file, file, 64);
-      page_list->line = line;
       status = mlock( (void *) addr, pagesize);
       if (status != 0)
 	{
 #ifdef TEST_MLOCK
-	  char errbuf[SH_ERRBUF_SIZE];
-	  fprintf(stderr, "mlock: error: %s\n", 
-		  sh_error_message(errno, errbuf, sizeof(errbuf)));
+	  fprintf(stderr, "mlock: error: %s\n", sh_error_message(errno));
 #endif
 	  SH_FREE(page_list);
 	  page_locking = 0;
-	  goto exit_mlock;
+	  SL_RETURN((status), _("sh_unix_mlock"));
 	}
       page_list->next = sh_page_locked;
@@ -5182,15 +3712,11 @@
       addr += pagesize;
     }
+
   page_locking = 0;
-
- exit_mlock:
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_mlock);
-
   SL_RETURN((status), _("sh_unix_mlock"));
 }
 #else
-int sh_unix_mlock (const char * file, int line, void * in_addr, size_t len)
-{
-  (void) file;    (void) line;
+int sh_unix_mlock (void * in_addr, size_t len)
+{
   (void) in_addr; (void) len;
   return -1;
@@ -5202,8 +3728,8 @@
 {
   int         num_pages;
-  int         unlocked;
-  int         status;
+  int         unlocked = 0;
+  int         status   = 0;
   int         pagesize;
-  sh_page_l * page_list;
+  sh_page_l * page_list = sh_page_locked;
   sh_page_l * page_last;
   unsigned long addr;
@@ -5219,16 +3745,7 @@
   SL_ENTER(_("sh_unix_munlock"));
 
-  /* There's no cancellation point here, except if tracing is on
-   */
-  SH_MUTEX_LOCK_UNSAFE(mutex_mlock);
-
-  unlocked  = 0;
-  status    = 0;
-  page_list = sh_page_locked;
-
   if (0 != page_locking)
     {
-      status = -1;
-      goto exit_munlock;
+      SL_RETURN((-1), _("sh_unix_munlock"));
     }
   page_locking = 1;
@@ -5335,7 +3852,4 @@
 
   page_locking = 0;
-
- exit_munlock:
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_mlock);
   SL_RETURN((status), _("sh_unix_munlock"));
 }
@@ -5350,48 +3864,17 @@
 int sh_unix_count_mlock()
 {
-  unsigned int i = 0;
-  char str[32][64];
-  sh_page_l * page_list;
+  int i = 0;
+  char str[128];
+  sh_page_l * page_list = sh_page_locked;
 
   SL_ENTER(_("sh_unix_count_mlock"));
-
-#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-  /* There's no cancellation point here, except if tracing is on
-   */
-  SH_MUTEX_LOCK_UNSAFE(mutex_mlock);
-#endif
-
-  page_list = sh_page_locked;
-
   while (page_list != NULL)
     {
-#ifdef WITH_TPT
-      if (i < 32)
-	sl_snprintf(str[i], 64, _("file: %s line: %d page: %d"), 
-		    page_list->file, page_list->line, i+1);
-#endif
       page_list = page_list->next;
       ++i;
     }
-
-#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_mlock);
-#endif
-
-#ifdef WITH_TPT
-  {
-    unsigned int j = 0;
-    while (j < i && j < 32)
-      {
-	sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, j, MSG_E_SUBGEN,
-			str[j], _("sh_unix_count_mlock"));
-	++j;
-      }
-  }
-#endif
-
-  sl_snprintf(str[0], 64, _("%d pages locked"), i);
-  sh_error_handle(SH_ERR_ALL, FIL__, __LINE__, i, MSG_E_SUBGEN,
-		  str[0], _("sh_unix_count_mlock"));
+  sprintf(str, _("%d pages locked"), i);               /* known to fit  */
+  sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, i, MSG_E_SUBGEN,
+		  str, _("sh_unix_count_mlock"));
   SL_RETURN((i), _("sh_unix_count_mlock"));
 }
@@ -5414,7 +3897,9 @@
 #if  !defined(SH_STEALTH_MICRO)
 
-
-int hideout_hex_block(SL_TICKET fd, unsigned char * str, int len,
-		      unsigned long * bytes_read);
+static unsigned long off_data = 0;
+static unsigned long max_data = 0;
+static int           stealth_init = BAD;
+
+int hideout_hex_block(SL_TICKET fd, unsigned char * str, int len);
 unsigned long first_hex_block(SL_TICKET fd, unsigned long * max);
 
@@ -5424,21 +3909,7 @@
 int sh_unix_getline_stealth (SL_TICKET fd, char * str, int len)
 {
-  int                  add_off = 0, llen;
-  unsigned long        bread;
-  static unsigned long off_data   = 0;
-  static unsigned long max_data   = 0;
-  static unsigned long bytes_read = 0;
-  static int           stealth_init = BAD;
+  int add_off, llen;
 
   SL_ENTER(_("sh_unix_getline_stealth"));
-
-  if (str == NULL)
-    {
-      off_data   = 0;
-      max_data   = 0;
-      bytes_read = 0;
-      stealth_init = BAD;
-      SL_RETURN(0, _("sh_unix_getline_stealth"));
-    }
 
   /* --- Initialize. ---
@@ -5456,28 +3927,15 @@
 	}
       stealth_init = GOOD;
-      max_data += off_data;
     }
   
   /* --- Seek to proper position. ---
    */
-  if (bytes_read >= max_data || add_off < 0)
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("The capacity of the container image file for the stealth config file seems to be too small. Your config file is likely truncated.\n"));
-      sh_error_handle ((-1), FIL__, __LINE__,  EIO, MSG_P_NODATA,
-		       _("Stealth config file."));
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
   sl_seek(fd, off_data);
      
   /* --- Read one line. ---
    */
-  add_off   = hideout_hex_block(fd, (unsigned char *) str, len, &bread);
-  if (add_off > 0)
-    off_data += add_off;
-  bytes_read += bread;
-
-  if (bread == 0 || add_off <= 0) /* EOF */
-    str[0] = '\0';
+  add_off   = hideout_hex_block(fd, (unsigned char *) str, len);
+  off_data += add_off;
+
 
   llen = sl_strlen(str);
@@ -5485,6 +3943,5 @@
 }
 
-int hideout_hex_block(SL_TICKET fd, unsigned char * str, int len, 
-		      unsigned long * bytes_read)
+int hideout_hex_block(SL_TICKET fd, unsigned char * str, int len)
 {
 
@@ -5495,13 +3952,6 @@
   unsigned long here   = 0;
   unsigned long retval = 0;
-  unsigned long bread  = 0;
 
   SL_ENTER(_("hideout_hex_block"));
-
-  ASSERT_RET((len > 1), _("len > 1"), (0));
-
-  str[0] = '\0';
-  *bytes_read = 0;
-  --len;
 
   i = 0;
@@ -5520,15 +3970,9 @@
 	      do {
 		do {
-		  errno = 0;
 		  num = sl_read (fd, &c, 1);
 		} while (num == 0 && errno == EINTR);
-		if (num > 0)
-		  ++here;
-		else if (num == 0) {
+		if (num == 0) 
 		  SL_RETURN((-1), _("hideout_hex_block"));
-		}
-		else {
-		  SL_RETURN((-1), _("hideout_hex_block"));
-		}
+		++here; 
 	      } while (c == '\n' || c == '\t' || c == '\r' || 
 		       c == ' ');
@@ -5544,5 +3988,4 @@
 	    str[i] &= ~mask[j];
 
-	  bread += 1;
 	}
       if (str[i] == '\n') break;
@@ -5552,10 +3995,7 @@
   if (i != 0)
     str[i] = '\0';
-  else if (str[0] == '\n')
-    str[i+1] = '\0'; /* keep newline and terminate */
   else
-    str[0] = '\0';
+    str[i+1] = '\0';
   retval += here;
-  *bytes_read += (bread/8);
 
   SL_RETURN(retval, _("hideout_hex_block"));
@@ -5566,11 +4006,10 @@
 unsigned long first_hex_block(SL_TICKET fd, unsigned long * max)
 {
-  unsigned int  i;
-  long          num = 1;
-  unsigned long lnum;
+  int           i;
+  register int  num = 1;
   char          c;
   int           nothex = 0;
   unsigned long retval = 0;
-  unsigned int  this_line = 0;
+  int           this_line = 0;
   char          theline[SH_BUFSIZE];
 
@@ -5584,5 +4023,5 @@
       this_line  = 0;
       c          = '\0';
-      while (c != '\n' && this_line < (sizeof(theline)-1))
+      while (c != '\n' && num > 0)
 	{
 	  do {
@@ -5593,5 +4032,5 @@
 	  else           
 	    SL_RETURN((0), _("first_hex_block"));
-	  ++this_line;
+	  this_line += num;
 	}
       theline[this_line] = '\0';
@@ -5622,17 +4061,13 @@
 	      num = sl_read (fd, theline, SH_BUFSIZE);
 	    } while (num == 0 && errno == EINTR);
-	    if (num > 0)
-	      {
-		lnum = (unsigned long) num;
-		for (i = 0; i < lnum; ++i)
-		  { 
-		    c = theline[i];
-		    if (c == '\n' || c == '\t' || c == '\r' || c == ' ') 
-		      ;
-		    else if (!isxdigit((int)c))
-		      break;
-		    else
-		      *max += 1;
-		  }
+	    for (i = 0; i < num; ++i)
+	      { 
+		c = theline[i];
+		if (c == '\n' || c == '\t' || c == '\r' || c == ' ') 
+		  ;
+		else if (!isxdigit((int)c))
+		  break;
+		else
+		  *max += 1;
 	      }
 	  } while (num > 0);
@@ -5656,93 +4091,23 @@
  */
 #if defined(SCREW_IT_UP)
-
-#if defined(HAVE_PTHREAD)
-
-static pthread_key_t  gSigtrapVariables_key;
-static pthread_once_t gSigtrapVariables_key_once = PTHREAD_ONCE_INIT;
-
-static inline void make_gSigtrapVariables_key()
-{
-    (void) pthread_key_create(&gSigtrapVariables_key, free);
-}
-
-struct sh_sigtrap_variables * sh_sigtrap_variables_get()
-{
-  void * ptr;
-
-  (void) pthread_once(&gSigtrapVariables_key_once, make_gSigtrapVariables_key);
- 
-  ptr = pthread_getspecific(gSigtrapVariables_key);
-  if (ptr == NULL) {
-    ptr = calloc(1,sizeof(struct sh_sigtrap_variables));
-    if (ptr == NULL) {
-      return NULL;
-    }
-    (void) pthread_setspecific(gSigtrapVariables_key, ptr);
-  }
-
-  return (struct sh_sigtrap_variables *) ptr;
-}
-
-/* !defined(HAVE_PTHREAD) */
-#else
-
-static struct sh_sigtrap_variables global_sigtrap_variables;
-struct sh_sigtrap_variables * sh_sigtrap_variables_get()
-{
-  return &global_sigtrap_variables;
-}
-
-#endif
-
-int sh_sigtrap_max_duration_set (const char * str)
-{
-  /* For security (prevent reloading with larger value)
-   * this value can only be set once.
-   */
-  static int once = 0;
-  int i;
-
-  SL_ENTER(_("sh_sigtrap_max_duration_set"));
-
-  i = atoi (str);
-
-  if (i >= 0 && once == 0)
-    {
-      sh.sigtrap_max_duration = i;
-      once = 1;
-    }
-  else
-    {
-      SL_RETURN ((-1), _("sh_sigtrap_max_duration_set"));
-    }
-  SL_RETURN( (0), _("sh_sigtrap_max_duration_set"));
-}
+volatile int sh_not_traced = 0;
+
+#ifdef HAVE_GETTIMEOFDAY
+struct timeval  save_tv;
+#endif
 
 void sh_sigtrap_handler (int signum)
 {
-  struct sh_sigtrap_variables * sigtrap_variables;
-  sigtrap_variables = sh_sigtrap_variables_get();
-  if (sigtrap_variables == NULL) {
-    /* Perhaps, it's better to not die, and to continue using Samhain,
-       even if this part does not work. */
-    return;
-  }
-
 #ifdef HAVE_GETTIMEOFDAY
-  {
-    struct timeval  tv;
-    long   difftv;
-    
-    gettimeofday(&tv, NULL);
-    difftv = (tv.tv_sec - sigtrap_variables->save_tv.tv_sec) * 1000000 + 
-      (tv.tv_usec - sigtrap_variables->save_tv.tv_usec);
-    if (difftv > sh.sigtrap_max_duration)
-      raise(SIGKILL);
-  }
-#endif
-
-  sigtrap_variables->not_traced = signum;
-  /* cppcheck-suppress memleak */
+  struct timeval  tv;
+  long   difftv;
+  
+  gettimeofday(&tv, NULL);
+  difftv = (tv.tv_sec - save_tv.tv_sec) * 1000000 + 
+    (tv.tv_usec - save_tv.tv_usec);
+  if (difftv > 500000)
+    _exit(6);
+#endif
+  sh_not_traced += signum;
   return;
 }
Index: trunk/src/sh_userfiles.c
===================================================================
--- trunk/src/sh_userfiles.c	(revision 591)
+++ trunk/src/sh_userfiles.c	(revision 1)
@@ -30,4 +30,5 @@
 #include <pwd.h>
 
+
 #include "samhain.h"
 #include "sh_modules.h"
@@ -38,7 +39,4 @@
 #include "sh_hash.h"
 #include "sh_files.h"
-#define SH_NEED_PWD_GRP 1
-#include "sh_static.h"
-#include "sh_pthread.h"
 
 #ifdef SH_USE_USERFILES
@@ -117,8 +115,8 @@
 }
   
-int sh_userfiles_set_uid (const char * str)
+int sh_userfiles_set_uid (char * str)
 {
   char * end;
-  const  char * p = str;
+  char * p = str;
   unsigned long lower;
   unsigned long upper = 0;
@@ -185,5 +183,5 @@
  * directory that should be checked. */
 
-int sh_userfiles_add_file(const char *c) {
+int sh_userfiles_add_file(char *c) {
     struct userfileslist *new;
     char *s, *orig;
@@ -215,16 +213,13 @@
      * So, compare longest strings first */
     if( s == NULL ) /* The default */          new->level = default_level;
-    else if ( strstr(s, _("attributes"))!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
-    else if ( strstr(s, _("allignore")) != NULL ) new->level = SH_LEVEL_ALLIGNORE;
-    else if ( strstr(s, _("noignore"))  != NULL ) new->level = SH_LEVEL_NOIGNORE;
-    else if ( strstr(s, _("logfiles"))  != NULL ) new->level = SH_LEVEL_LOGFILES;
-    else if ( strstr(s, _("readonly"))  != NULL ) new->level = SH_LEVEL_READONLY;
-    else if ( strstr(s, _("loggrow"))   != NULL ) new->level = SH_LEVEL_LOGGROW;
-    else if ( strstr(s, _("user0"))     != NULL ) new->level = SH_LEVEL_USER0;
-    else if ( strstr(s, _("user1"))     != NULL ) new->level = SH_LEVEL_USER1;
-    else if ( strstr(s, _("user2"))     != NULL ) new->level = SH_LEVEL_USER2;
-    else if ( strstr(s, _("user3"))     != NULL ) new->level = SH_LEVEL_USER3;
-    else if ( strstr(s, _("user4"))     != NULL ) new->level = SH_LEVEL_USER4;
-    else if ( strstr(s, _("prelink"))   != NULL ) new->level = SH_LEVEL_PRELINK;
+    else if ( strstr(s, "attributes")!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
+    else if ( strstr(s, "allignore") != NULL ) new->level = SH_LEVEL_ALLIGNORE;
+    else if ( strstr(s, "noignore")  != NULL ) new->level = SH_LEVEL_NOIGNORE;
+    else if ( strstr(s, "logfiles")  != NULL ) new->level = SH_LEVEL_LOGFILES;
+    else if ( strstr(s, "readonly")  != NULL ) new->level = SH_LEVEL_READONLY;
+    else if ( strstr(s, "loggrow")   != NULL ) new->level = SH_LEVEL_LOGGROW;
+    else if ( strstr(s, "user0")     != NULL ) new->level = SH_LEVEL_USER0;
+    else if ( strstr(s, "user1")     != NULL ) new->level = SH_LEVEL_USER1;
+    else if ( strstr(s, "prelink")   != NULL ) new->level = SH_LEVEL_PRELINK;
     else            /* The default */          new->level = default_level;
 
@@ -234,11 +229,21 @@
 }
 
-/* Decide if we're active. 
- */
-int sh_userfiles_set_active(const char *c) {
+/* Decide if we're active.  1 means yes, all else means no */
+
+int sh_userfiles_set_active(char *c) {
     int value;
     
     SL_ENTER(_("sh_userfiles_set_active"));
+
     value = sh_util_flagval(c, &ShUserfilesActive);
+
+    /*
+    if( value == 1 ) {
+        ShUserfilesActive = S_TRUE;
+    } else {
+        ShUserfilesActive = S_FALSE;
+    }
+    */
+
     SL_RETURN((value), _("sh_userfiles_set_active"));
 }
@@ -246,11 +251,9 @@
 /* Build the list of users, then use this to construct the filenames to
  * be checked. */
-int sh_userfiles_init(struct mod_type * arg) {
+int sh_userfiles_init(void) {
     struct passwd *cur_user;
     struct userhomeslist *end;
     struct userhomeslist *new;
     struct userhomeslist *homes;
-    char * filepath;
-    (void) arg;
 
     SL_ENTER(_("sh_userfiles_init"));
@@ -269,9 +272,8 @@
     /* We build a list in here because the samhain internals want to use
      * getpwent() too */
-    SH_MUTEX_LOCK(mutex_pwent);
     /*@-unrecog@*/
-    sh_setpwent();
+    setpwent();
     /*@+unrecog@*/
-    while( ( cur_user = /*@-unrecog@*/sh_getpwent()/*@+unrecog@*/ ) != NULL ) {
+    while( ( cur_user = /*@-unrecog@*/getpwent()/*@+unrecog@*/ ) != NULL ) {
         int found = 0;
 
@@ -295,11 +297,8 @@
         }
     }
-    sh_endpwent();
-    SH_MUTEX_UNLOCK(mutex_pwent);
-
-    filepath = SH_ALLOC(PATH_MAX);
 
     for (homes = userHomes; homes != NULL; homes = homes->next ) {
         struct userfileslist *file_ptr;
+        char filepath[PATH_MAX];
 
         for (file_ptr = userFiles; file_ptr != NULL; file_ptr = file_ptr->next) {
@@ -333,13 +332,4 @@
                     (void) sh_files_pushfile_user1(filepath);
                     break;
-                case SH_LEVEL_USER2:
-                    (void) sh_files_pushfile_user2(filepath);
-                    break;
-                case SH_LEVEL_USER3:
-                    (void) sh_files_pushfile_user3(filepath);
-                    break;
-                case SH_LEVEL_USER4:
-                    (void) sh_files_pushfile_user4(filepath);
-                    break;
                 case SH_LEVEL_PRELINK:
                     (void) sh_files_pushfile_prelink(filepath);
@@ -350,6 +340,4 @@
         }
     }
-
-    SH_FREE(filepath);
 
     SL_RETURN(0, _("sh_userfiles_init"));
@@ -393,7 +381,4 @@
     userHomes = NULL;
     userFiles = NULL;
-    userUids  = NULL;
-
-    ShUserfilesActive   = S_TRUE;
 
     SL_RETURN(0, _("sh_userfiles_reconf"));
Index: trunk/src/sh_utils.c
===================================================================
--- trunk/src/sh_utils.c	(revision 591)
+++ trunk/src/sh_utils.c	(revision 1)
@@ -27,8 +27,15 @@
 #include <unistd.h>
 
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
+
 
 #include "samhain.h"
@@ -38,5 +45,4 @@
 #include "sh_tiger.h"
 #include "sh_entropy.h"
-#include "sh_pthread.h"
 
 #undef  FIL__
@@ -45,5 +51,5 @@
 UINT32 ErrFlag[2];
 
-int sh_util_flagval(const char * c, int * fval)
+int sh_util_flagval(char * c, int * fval)
 {
   SL_ENTER(_("sh_util_flagval"));
@@ -95,45 +101,15 @@
 static int sh_ask_update = S_FALSE;
 
-int sh_util_set_interactive(const char * str)
-{
-  (void) str;
-
-  sh_ask_update = S_TRUE;
+int sh_util_set_interactive(char * str)
+{
+  if (str == NULL)
+    sh_ask_update = S_TRUE;
+  else
+    sh_ask_update = S_TRUE;
+
   sh_unix_setnodeamon(NULL);
 
   return 0;
 }
-
-static char * sh_update_file = NULL;
-
-int sh_util_update_file (const char * str)
-{
-  if (str)
-    {
-      if (0 == access(str, R_OK)) /* flawfinder: ignore */
-	{
-	  if (NULL != sh_update_file)
-	    SH_FREE(sh_update_file);
-	  sh_update_file = sh_util_strdup(str);
-	  sh_ask_update = S_TRUE;
-	  sh_unix_setnodeamon(NULL);
-	  return 0;
-	}
-      else
-	{
-	  char ebuf[SH_ERRBUF_SIZE];
-	  int  errnum = errno;
-
-	  sh_error_message(errnum, ebuf, sizeof(ebuf));
-	  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-			   ebuf, _("sh_util_update_file") );
-	  
-	  return -1;
-	}
-    }
-
-  return -1;
-}
-
 
 #if !defined(STDIN_FILENO)
@@ -144,54 +120,5 @@
 #endif
 
-/* Returns S_FALSE if no update desired 
- */
-int sh_util_update_checkfile(const char * path)
-{
-  FILE * fd = fopen(sh_update_file, "r");
-  char * line;
-
-  if (!fd)
-    {
-      uid_t  euid;
-      int errnum = errno;
-      sl_get_euid(&euid);
-      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_NOACCESS,
-		       (long) euid, sh_update_file);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-      return S_FALSE;
-    }
-
-  line = SH_ALLOC(8192);
-
-  while (NULL != fgets(line, 8192, fd))
-    {
-      char * nl = strrchr(line, '\n');
-
-      if (nl)
-	{
-	  *nl = '\0';
-
-	  /* Check for MS Windows line terminator 
-	   */
-	  if (nl > line) --nl;
-	  if (*nl == '\r')
-	    *nl = '\0';
-	}
-
-      if (0 == sl_strcmp(line, path))
-	{
-	  SH_FREE(line);
-	  fclose(fd);
-	  return S_TRUE;
-	}
-    }
-  SH_FREE(line);
-  fclose(fd);
-  return S_FALSE;
-}
-
-/* Returns S_FALSE if no update desired 
- */
-int sh_util_ask_update(const char * path)
+int sh_util_ask_update(char * path)
 {
   int    inchar, c;
@@ -206,10 +133,4 @@
     }
 
-  if (sh_update_file)
-    {
-      i = sh_util_update_checkfile(path);
-      SL_RETURN(i, _("sh_util_ask_update"));
-    }
-
 #ifdef HAVE_TTYNAME
   if (!ttyname(STDIN_FILENO))
@@ -217,5 +138,4 @@
       if (NULL != ttyname(STDERR_FILENO))
         {
-	  /* cppcheck-suppress leakReturnValNotUsed */
           if (NULL == freopen(ttyname(STDERR_FILENO), "r", stdin))
             {
@@ -261,5 +181,5 @@
 	  else
 	    {
-	      fprintf(stderr, "%s", _("Please answer y(es) or n(o)\n"));
+	      fprintf(stderr, _("Please answer y(es) or n(o)\n"));
 	    }
 	  /*@-charintliteral@*/
@@ -270,5 +190,5 @@
 }
 
-int sh_util_hidesetup(const char * c)
+int sh_util_hidesetup(char * c)
 {
   int i;
@@ -278,98 +198,5 @@
   SL_RETURN(i, _("sh_util_hidesetup"));
 }
-
-char * sh_util_acl_compact(char * buf, ssize_t len)
-{
-  unsigned char  * p = (unsigned char *) buf;
-  int       state = 0;
-  ssize_t   rem = 0;
-  char    * out;
-  
-  SH_VALIDATE_NE(buf, NULL);
-  SH_VALIDATE_GE(len, 0);
-
-  out = SH_ALLOC(len + 1);
-
-  while (*p != '\0')  {
-
-    /* -- not at start or after newline
-     */
-    if (state == 1) {
-      if (*p == '\n' || *p == ' ' || *p == '\t' || *p == '#') {
-	while (*p != '\n') {
-	  ++p;
-	  if (*p == '\0') {
-	    goto exit_it;
-	  }
-	}
-	out[rem] = ','; ++rem;    /* <-- ensures (rem > 0) is true    */ 
-	while (p[1] == '\n') ++p; /* scan over consecutive newlines   */
-	state = 0;
-	if (p[1] == '\0') {
-	  out[rem-1] = '\0';      /* rem > 0 because of 4 lines above */
-	  break;
-	}
-      }
-      else {
-	if (*p <= 0x7F && isgraph((int) *p)) {
-	  out[rem] = (char) *p; ++rem;
-	}
-      }
-    }
-
-    /* -- at start or after newline
-     */
-    else /* if (state == 0) */ {
-      if        (0 == strncmp((char *) p, "user", 4)) {
-	out[rem] = 'u'; ++rem;
-	p += 3;
-      } else if (0 == strncmp((char *) p, "group", 5)) {
-	out[rem] = 'g'; ++rem;
-	p += 4; 
-      } else if (0 == strncmp((char *) p, "mask", 4)) {
-	out[rem] = 'm'; ++rem;
-	p += 3;
-      } else if (0 == strncmp((char *) p, "other", 5)) {
-	out[rem] = 'o';
-	p += 4; ++rem;
-      } else if (*p == '\0') {
-	if (rem > 0) { out[rem-1] = '\0'; }
-	break;
-      } else {
-	if (*p <= 0x7F && isprint((int) *p)) {
-	  out[rem] = (char) *p; ++rem;
-	}
-      }
-      state = 1;
-    }
-    ++p;
-  }
- exit_it:
-  out[rem] = '\0';
-  return out;
-}
-
-
-char * sh_util_strdup_l (const char * str, size_t len)
-{
-  char * p = NULL;
-
-  SL_ENTER(_("sh_util_strdup_l"));
-
-  SH_VALIDATE_NE(str, NULL);
-  SH_VALIDATE_NE(len, 0);
-
-  if (str && sl_ok_adds (len, 1))
-    {
-      p   = SH_ALLOC (len + 1);
-      (void) memcpy (p, str, len+1);
-    }
-  else
-    {
-      safe_fatal(_("integer overflow in sh_util_strdup_l"), FIL__, __LINE__);
-    }
-  SL_RETURN( p, _("sh_util_strdup_l"));
-}
-
+    
 char * sh_util_strdup (const char * str) 
 {
@@ -379,31 +206,11 @@
   SL_ENTER(_("sh_util_strdup"));
 
-  SH_VALIDATE_NE(str, NULL);
-
-  if (str)
+  if (str != NULL)
     {
       len = sl_strlen(str);
       p   = SH_ALLOC (len + 1);
-      (void) memcpy (p, str, len+1);
+      (void) sl_strlcpy (p, str, len+1);
     }
   SL_RETURN( p, _("sh_util_strdup"));
-}
-
-char * sh_util_strdup_track (const char * str, char * file, int line) 
-{
-  char * p = NULL;
-  size_t len;
-
-  SL_ENTER(_("sh_util_strdup_track"));
-
-  SH_VALIDATE_NE(str, NULL);
-
-  if (str)
-    {
-      len = sl_strlen(str);
-      p   = SH_OALLOC (len + 1, file, line);
-      (void) memcpy (p, str, len+1);
-    }
-  SL_RETURN( p, _("sh_util_strdup_track"));
 }
 
@@ -413,24 +220,22 @@
 char * sh_util_strsep (char **str, const char *delim) 
 {
-  char *ret, *c;
-  const char *d;
+  char *ret, *c, *d;
 
   SL_ENTER(_("sh_util_strsep"));
   ret = *str;
 
-  SH_VALIDATE_NE(ret, NULL);
-
-  if (*str)
-    {
-      for (c = *str; *c != '\0'; c++) {
-	for (d = delim; *d != '\0'; d++) {
-	  if (*c == *d) {
-	    *c = '\0';
-	    *str = c + 1;
-	    SL_RETURN(ret, _("sh_util_strsep"));
-	  }
-	}
+  if (ret == NULL) {
+    SL_RETURN(ret, _("sh_util_strsep"));
+  }
+
+  for (c = *str; *c != '\0'; c++) {
+    for (d = (char *) delim; *d != '\0'; d++) {
+      if (*c == *d) {
+        *c = '\0';
+        *str = c + 1;
+        SL_RETURN(ret, _("sh_util_strsep"));
       }
     }
+  }
 
   /* If we get to here, there's no delimiters in the string */
@@ -440,5 +245,5 @@
 
 
-/* returned string must be free'd by caller.
+/* returned string must be free'd by caller
  */
 char * sh_util_formatted (const char * formatt, st_format * ftab)
@@ -455,11 +260,10 @@
   time_t inpp;
 
-  char * clist[16] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-		       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+  char * clist[16];
   int    nn = 0;
 
   SL_ENTER(_("sh_util_formatted"));
 
-  if (formatt == NULL || ftab == NULL || *formatt == '\0')
+  if (formatt == NULL || ftab == NULL)
     SL_RETURN(NULL, _("sh_util_formatted"));
 
@@ -467,21 +271,25 @@
    */
   size = sl_strlen(formatt);
-
-  if (!sl_ok_adds(size, 1))
+  if (size > 0)
+    {
+      fmt = (char *) SH_ALLOC(size + 1);
+      (void) sl_strlcpy(fmt, formatt, size + 1);
+    }
+  else
     SL_RETURN(NULL, _("sh_util_formatted"));
 
-  ++size;
-  fmt = SH_ALLOC(size);
-  (void) sl_strlcpy(fmt, formatt, size);
-
   p = fmt;
 
   j = 0;
-  while (ftab[j].fchar != '\0') {
-    if (ftab[j].type != S_FMT_STRING)
-      ftab[j].data_str = NULL;
-    ++j;
-  }
- 
+  while (ftab[j].fchar != '\0')
+    {
+      if (ftab[j].type != S_FMT_STRING)
+	ftab[j].data_str = NULL;
+      ++j;
+    }
+
+  for (j = 0; j < 16; ++j)
+    clist[j] = NULL;
+
   while (p != NULL && *p != '\0' && NULL != (q = strchr(p, '%')))
     {
@@ -516,10 +324,8 @@
 	      i  = 1;
 	      
-	      switch(ftab[j].type) {
-
-	      case S_FMT_STRING:
+	      if (ftab[j].type == S_FMT_STRING)
 		{
 		  isiz = sl_strlen(ftab[j].data_str);
-		  if (isiz > 0 && sl_ok_adds(size, isiz))
+		  if (isiz > 0)
 		    {
 		      size += isiz;
@@ -529,9 +335,7 @@
 		  else
 		    *q = '%';
-		  goto endsrch;
+		  break;
 		}
-		break;
-
-	      case S_FMT_ULONG:
+	      else if (ftab[j].type == S_FMT_ULONG)
 		{
 		  ftab[j].data_str = (char *) SH_ALLOC(64);
@@ -541,5 +345,5 @@
 		  /*@+bufferoverflowhigh@*/
 		  isiz = sl_strlen(ftab[j].data_str);
-		  if (isiz > 0 && sl_ok_adds(size, isiz))
+		  if (isiz > 0)
 		    {
 		      size += isiz;
@@ -549,9 +353,7 @@
 		  else
 		    *q = '%';
-		  goto endsrch;
+		  break;
 		}
-		break;
-
-	      case S_FMT_LONG:
+	      else if (ftab[j].type == S_FMT_LONG)
 		{
 		  ftab[j].data_str = (char *) SH_ALLOC(64);
@@ -561,5 +363,5 @@
 		  /*@+bufferoverflowhigh@*/
 		  isiz = sl_strlen(ftab[j].data_str);
-		  if (isiz > 0 && sl_ok_adds(size, isiz))
+		  if (isiz > 0)
 		    {
 		      size += isiz;
@@ -569,9 +371,7 @@
 		  else
 		    *q = '%';
-		  goto endsrch;
+		  break;
 		}
-		break;
-
-	      case S_FMT_TIME:
+	      else if (ftab[j].type == S_FMT_TIME)
 		{
 		  ftab[j].data_str = (char *) SH_ALLOC(64);
@@ -593,5 +393,5 @@
 		    }
 		  isiz = sl_strlen(ftab[j].data_str);
-		  if (isiz > 0 && sl_ok_adds(size, isiz))
+		  if (isiz > 0)
 		    {
 		      size += isiz;
@@ -601,19 +401,11 @@
 		  else
 		    *q = '%';
-		  goto endsrch;
+		  break;
 		}
-		break;
-
-	      default:
-		/* do nothing */;
-	      }
 
 	    }
-	  ++j;
-	}
-
-    endsrch:
-
-      p = q;
+	  else
+	    ++j;
+	}
 
       /* -- not found -- */
@@ -621,7 +413,11 @@
 	{
 	  *q = '%';
+	  p = q;
 	  ++p;
 	}
-
+      else
+	{
+	  p = q;
+	}
     }
 
@@ -633,6 +429,5 @@
   /* -- closing '\0' --
    */
-  if (sl_ok_adds(size, 1))
-    size++;
+  size++;
   outstr = (char *) SH_ALLOC(size);
 
@@ -644,14 +439,14 @@
 		      clist[8],  clist[9], clist[10], clist[11], 
 		      clist[12], clist[13], clist[14], clist[15]); 
-  outstr[size-1] = '\0';
-
+  
   /* -- cleanup --
    */
   j = 0;
-  while (ftab[j].fchar != '\0') {
-    if (ftab[j].type != S_FMT_STRING && ftab[j].data_str != NULL)
-      SH_FREE(ftab[j].data_str);
-    ++j;
-  }
+  while (ftab[j].fchar != '\0')
+    {
+      if (ftab[j].type != S_FMT_STRING && ftab[j].data_str != NULL)
+	SH_FREE(ftab[j].data_str);
+      ++j;
+    }
   SH_FREE(fmt);
 
@@ -659,8 +454,7 @@
 }
 
-/* read a hexchar, return int value (0-15)
- * can't inline (AIX)
- */
-int sh_util_hexchar( const char c )
+/* can't inline (AIX)
+ */
+int sh_util_hexchar( char c )
 {
   /*@+charint@*/
@@ -675,51 +469,24 @@
 }
 
-char * sh_util_charhex( unsigned char i , char * i2h)
-{
-  int j, k;
-
-  j = i / 16;
-  k = i - (j*16);
-
-  if (j < 10) i2h[0] = '0'+j;
-  else        i2h[0] = 'A'+(j-10);
-  
-  if (k < 10) i2h[1] = '0'+k;
-  else        i2h[1] = 'A'+(k-10);
-
-  return i2h;
-}
-
 /* read a hexadecimal key, convert to binary
  */
-int sh_util_hextobinary (char * binary, const char * hex, int bytes)
+int sh_util_hextobinary (char * binary, char * hex, int bytes)
 {
   int i = 0, j, k, l = 0;
-  char c;
-
-#define SH_HEXCHAR(x, y) \
-    c = (x); \
-    if ( c >= '0' && c <= '9' ) \
-      y = c - '0'; \
-    else if ( c >= 'a' && c <= 'f' ) \
-      y = c - 'a' + 10; \
-    else if ( c >= 'A' && c <= 'F' ) \
-      y = c - 'A' + 10; \
-    else \
-      SL_RETURN((-1), _("sh_util_hextobinary"))
-
 
   SL_ENTER(_("sh_util_hextobinary"));
 
-  if (bytes < 2)
-    SL_RETURN((-1), _("sh_util_hextobinary"));
-
-  while (i < (bytes-1))
-    {
-      SH_HEXCHAR(hex[i],   k);
-      SH_HEXCHAR(hex[i+1], j);
-      
-      binary[l] = (char)(k * 16 + j);
-      ++l; i+= 2;
+  while (i < bytes)
+    {
+      k = sh_util_hexchar(hex[i]); j = sh_util_hexchar(hex[i+1]); 
+      if (k != -1 && j != -1) 
+        {
+          binary[l] = (char)(k * 16 + j);
+          ++l; i+= 2;
+        }
+      else
+        {
+	  SL_RETURN((-1), _("sh_util_hextobinary"));
+        }
     }
   
@@ -746,6 +513,5 @@
  */
 static char * sh_util_hmac_tiger (char * hexkey,  
-				  char * text, size_t textlen,
-				  char * res, size_t len)
+				  char * text, size_t textlen)
 {
   static char opad[KEY_BLOCK] = { 
@@ -761,102 +527,84 @@
     (char)0x36, (char)0x36, (char)0x36, (char)0x36, (char)0x36, (char)0x36
   };
-  static char  zap[KEY_BLOCK] = { 
-    (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00,  
-    (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00,  
-    (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00,  
-    (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00, (char)0x00
-  };
   char        K[KEY_BLOCK];
   char        outer[KEY_BLOCK];
-  char      * inner = NULL;
+  char      * inner;
   UINT32    * h1;
   UINT32    * h2;
   UINT32      cc[KEY_LEN/4];
-  UINT32      kbuf[KEY_BYT/sizeof(UINT32)];
-  char hashbuf[KEYBUF_SIZE];
-
-  int         result;
+  char      * res;
+
   size_t      i;
 
   SL_ENTER(_("sh_util_hmac_tiger"));
-
-  ASSERT((KEY_BLOCK <= (KEY_LEN/2)), _("KEY_BLOCK <= (KEY_LEN/2)"));
-
-  memcpy (K, zap, KEY_BLOCK);
-
-  result = sh_util_hextobinary (K, hexkey, KEY_LEN);
-
-  ASSERT((result >= 0), _("result >= 0"));
-
-  if ((result >= 0) && sl_ok_adds(textlen, KEY_BLOCK))
-    {
-      inner = (char *) SH_ALLOC (textlen + KEY_BLOCK); 
-
-      for (i = 0; i < KEY_BLOCK; ++i)
-	{
-	  outer[i]  = K[i] ^ opad[i];
-	  inner[i]  = K[i] ^ ipad[i];
-	}
-      for (i = KEY_BLOCK; i < (KEY_BLOCK+textlen); ++i)
-	{
-	  inner[i] = text[i - KEY_BLOCK];
-	}
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      _("integer overflow"), 
-		      _("sh_util_hmac_tiger"));
-      (void) sh_tiger_hash (NULL, TIGER_DATA, 0, hashbuf, sizeof(hashbuf));
-      sl_strlcpy(res, hashbuf, len);
+  ASSERT((KEY_BLOCK <= (KEY_LEN/2)), _("KEY_BLOCK <= (KEY_LEN/2)"))
+
+  if (KEY_BLOCK > (KEY_LEN/2))
+    {
+      res = sh_tiger_hash (NULL, TIGER_DATA, 0);
       SL_RETURN(res, _("sh_util_hmac_tiger"));
+    }
+
+  memset (K, 0x00, KEY_BLOCK);
+
+  if (sh_util_hextobinary (K, hexkey, KEY_LEN) < 0)
+    {
+      res = sh_tiger_hash (NULL, TIGER_DATA, 0);
+      SL_RETURN(res, _("sh_util_hmac_tiger"));
+    }
+
+  inner = (char *) SH_ALLOC (textlen + KEY_BLOCK); 
+
+  for (i = 0; i < KEY_BLOCK; ++i)
+    {
+      outer[i]  = K[i] ^ opad[i];
+      inner[i]  = K[i] ^ ipad[i];
+    }
+  for (i = KEY_BLOCK; i < (KEY_BLOCK+textlen); ++i)
+    {
+      inner[i] = text[i - KEY_BLOCK];
     }
 
   /* now compute the hash 
    */
-  h1 = sh_tiger_hash_uint32 ( outer, TIGER_DATA, KEY_BLOCK,
-			      kbuf, KEY_BYT/sizeof(UINT32));
+  h1 = sh_tiger_hash_uint32 ( outer,
+			      TIGER_DATA,
+			      KEY_BLOCK);
   for (i = 0; i < (KEY_LEN/8); ++i)
-    copy_four ( (unsigned char *) &(cc[i]), h1[i]);
-
-  /* cppcheck-suppress uninitvar */
-  h2 = sh_tiger_hash_uint32 ( inner, TIGER_DATA,
-			      (unsigned long) KEY_BLOCK+textlen,
-			      kbuf, KEY_BYT/sizeof(UINT32));
+    {
+      /* cc[i] = h1[i]; */
+      copy_four ( (unsigned char *) &(cc[i]), h1[i]);
+    }
+
+  h2 = sh_tiger_hash_uint32 ( inner,
+			      TIGER_DATA,
+			      (unsigned long) KEY_BLOCK+textlen);
   for (i = KEY_LEN/8; i < (KEY_LEN/4); ++i)
-    copy_four ( (unsigned char *) &(cc[i]), h2[i - (KEY_LEN/8)]);
-
-  /* cppcheck-suppress uninitvar */
+    {
+      copy_four ( (unsigned char *) &(cc[i]), h2[i - (KEY_LEN/8)]);
+      /* cc[i] = h2[i - (KEY_LEN/8)]; */
+    }
   SH_FREE(inner);
   
-  (void) sh_tiger_hash ((char *) &cc[0],
-			TIGER_DATA,
-			(unsigned long) (KEY_LEN/4 * sizeof(UINT32)),
-			hashbuf, sizeof(hashbuf));
-
-  sl_strlcpy(res, hashbuf, len);
+  res = sh_tiger_hash ((char *) &cc[0],
+		       TIGER_DATA,
+		       (unsigned long) (KEY_LEN/4 * sizeof(UINT32)));
+
   SL_RETURN(res, _("sh_util_hmac_tiger"));
 }
 
 static char * sh_util_hash_tiger ( char * hexkey,  
-				   char * text, size_t textlen,
-				   char * res, size_t len)
-{
+				   char * text, size_t textlen)
+{
+  char         * res;
   char           h2[2*KEY_LEN+1];
-  char hashbuf[KEYBUF_SIZE];
-
   SL_ENTER(_("sh_util_hash_tiger"));
 
   (void) sl_strlcpy(h2, hexkey, KEY_LEN+1); 
-  (void) sl_strlcat(h2, 
-		    sh_tiger_hash(text, TIGER_DATA, 
-				  (unsigned long) textlen,
-				  hashbuf, sizeof(hashbuf)), 
-		    2*KEY_LEN+1
-		    );
-
-  (void) sh_tiger_hash(h2, TIGER_DATA, 2*KEY_LEN, hashbuf, sizeof(hashbuf));
-
-  sl_strlcpy(res, hashbuf, len);
+  (void) sl_strlcat(h2, sh_tiger_hash(text, TIGER_DATA, 
+				      (unsigned long) textlen), 2*KEY_LEN+1);
+
+  res = sh_tiger_hash(h2, TIGER_DATA, 2*KEY_LEN);
+
   SL_RETURN(res, _("sh_util_hash_tiger"));
 }
@@ -869,5 +617,5 @@
 static int sigtype = TYPE_HMAC;
 
-int sh_util_sigtype (const char * c)
+int sh_util_sigtype (char * c)
 {
   SL_ENTER(_("sh_util_sigtype"));
@@ -886,6 +634,5 @@
 
 char * sh_util_siggen (char * hexkey,  
-		       char * text, size_t textlen,
-		       char * res, size_t len)  
+		       char * text, size_t textlen)  
 {
   char * p;
@@ -894,15 +641,16 @@
   if (sigtype == TYPE_HMAC)
     p = sh_util_hmac_tiger (hexkey,  
-			    text, textlen, res, len);
+			    text, textlen);
   else
     p = sh_util_hash_tiger (hexkey,  
-			    text, textlen, res, len);
+			    text, textlen);
   SL_RETURN(p, _("sh_util_siggen"));
 }    
 
+  
  
 /* a simple compressor
  */
-size_t sh_util_compress (char * dest, char * src, size_t dest_size)
+long sh_util_compress (char * dest, char * src, size_t dest_size)
 {
   char * add;
@@ -945,5 +693,5 @@
 
   dest[dest_size-1] = '\0'; /* paranoia       */
-  SL_RETURN((count), _("sh_util_compress")); /* no of chars copied */    
+  SL_RETURN(((long)count), _("sh_util_compress")); /* no of chars copied */    
 }
 
@@ -959,8 +707,4 @@
     char c[sizeof(long)];
   } u;
-#ifdef WORDS_BIGENDIAN
-  unsigned char swap;
-  unsigned char * ii = (unsigned char *) dest;
-#endif
 
   SL_ENTER(_("sh_util_cpylong"));    
@@ -985,8 +729,4 @@
       ++i;
     }
-#ifdef WORDS_BIGENDIAN
-  swap = ii[0]; ii[0] = ii[3]; ii[3] = swap;
-  swap = ii[1]; ii[1] = ii[2]; ii[2] = swap;
-#endif
   SL_RET0(_("sh_util_cpylong"));
 }
@@ -1012,5 +752,5 @@
 
 
-/* interval [0, 4294967295]
+/* interval [0, 4294967296]
  */
 static UINT32 taus_get_long (void *vstate)
@@ -1018,8 +758,6 @@
   UINT32 * state = (UINT32 *) vstate;
 
-  /*
   if (skey->rngI == BAD)
     (void)taus_seed();
-  */
 
 #define TAUSWORTHE(s,a,b,c,d) ((s &c) <<d) ^ (((s <<a) ^s) >>b)
@@ -1035,53 +773,28 @@
  * input for a one-way hash function.
  */
-
-UINT32 taus_get ()
-{
-#define TAUS_SAMPLE 12
-
-  UINT32   taus_svec[TAUS_SAMPLE];
+UINT32 taus_get (void *state1, void *state2, void *state3)
+{
+  UINT32   svec[6];
   UINT32   retval;
   UINT32 * res;
-  UINT32 * res_vec = &(skey->res_vec[0]);
-  static   int      res_num = 0;
   register int i;
-  UINT32       kbuf[KEY_BYT/sizeof(UINT32)];
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-  if (res_num > 0)
-    {
-      retval  = res_vec[res_num];
-      res_num = (res_num == 5) ? 0 : (res_num + 1);
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); /* alternative path */
-      return  retval;
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-
-  (void)taus_seed();
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-  for (i = 0; i < (TAUS_SAMPLE/3); ++i)
-    {
-      taus_svec[i*3]   = taus_get_long (&(skey->rng0[0]));
-      taus_svec[i*3+1] = taus_get_long (&(skey->rng1[0]));
-      taus_svec[i*3+2] = taus_get_long (&(skey->rng2[0]));
-    }
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-
-  res     = sh_tiger_hash_uint32 ( (char *) &taus_svec[0], 
+
+  svec[0] = taus_get_long (state1);
+  svec[1] = taus_get_long (state2);
+  svec[2] = taus_get_long (state3);
+  svec[3] = taus_get_long (state1);
+  svec[4] = taus_get_long (state2);
+  svec[5] = taus_get_long (state3);
+
+  res     = sh_tiger_hash_uint32 ( (char *) &svec[0], 
 				   TIGER_DATA, 
-				   (unsigned long)(TAUS_SAMPLE * sizeof(UINT32)),
-				   kbuf, KEY_BYT/sizeof(UINT32));
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-  for (i = 1; i < 6; ++i)
-    { 
-      res_vec[i] = res[i];
-    }
-  retval  = res[0];
-  res_num = 1;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
-
-  memset(taus_svec, 0, TAUS_SAMPLE * sizeof(UINT32));
+				   (unsigned long)(6 * sizeof(UINT32)));
+
+  for (i = 1; i < KEY_BYT/4; ++i)
+    res[0] ^= res[i];
+  retval = res[0];
+
+  memset (res,  0,            KEY_BYT);
+  memset (svec, 0, 6 * sizeof(UINT32));
 
   return retval;
@@ -1139,7 +852,5 @@
   char                 bufx[9 * sizeof(UINT32) + 1];
   int                  status;
-  static unsigned long seed_time    = 0;
-  static unsigned long seed_counter = 3000;
-  unsigned long        gtime;
+  static unsigned long seed_time = 0;
 
   SL_ENTER(_("taus_seed"));
@@ -1147,13 +858,9 @@
   if (skey->rngI == GOOD)
     {
-      ++seed_counter;
-
-      if ( ((sh_unix_longtime () - seed_time) < 1800) &&
-	   ( seed_counter                     < 3000))
+      if ( (sh_unix_longtime () - seed_time) < 3600)
 	SL_RETURN( (0), _("taus_seed"));
     }
   
-  seed_time    = sh_unix_longtime ();
-  seed_counter = 0;
+  seed_time = sh_unix_longtime ();
 
   status = sh_entropy (24, bufx);
@@ -1161,5 +868,5 @@
   if (!SL_ISERROR(status))
     {
-      SH_MUTEX_LOCK_UNSAFE(mutex_skey);
+      skey->rngI = GOOD;
       memcpy (&skey->rng0[0], &bufx[0],                  2*sizeof(UINT32));
       memcpy (&skey->rng1[0], &bufx[2*sizeof(UINT32)],   2*sizeof(UINT32));
@@ -1175,6 +882,4 @@
       taus_set_from_state( &(skey->rng2[0]), &(skey->rng2[0]));
 
-      skey->rngI = GOOD;
-      SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
       SL_RETURN( (0), _("taus_seed"));
     }
@@ -1185,16 +890,13 @@
   /* emergency backup - unsafe !
    */
+  skey->rngI = GOOD;
 #ifdef HAVE_GETTIMEOFDAY
-  gtime = sh_unix_notime();
+  taus_set_from_ulong ( &(skey->rng0[0]), LCG (sh_unix_notime())      );
 #else
-  gtime = seed_time;
-#endif
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_skey);
-  taus_set_from_ulong ( &(skey->rng0[0]), LCG (gtime)          );
+  taus_set_from_ulong ( &(skey->rng0[0]), LCG (seed_time)      );
+#endif
   taus_set_from_ulong ( &(skey->rng1[0]), LCG (skey->rng0[0])  );
   taus_set_from_ulong ( &(skey->rng2[0]), LCG (skey->rng1[0])  );
   skey->rngI = BAD;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_skey);
 
   SL_RETURN( (-1), _("taus_seed"));
@@ -1206,5 +908,5 @@
 static void copy_four (unsigned char * dest, UINT32 in);
 
-int sh_util_set_newkey (const char * new_in)
+int sh_util_set_newkey (char * new)
 {
   size_t i, j = 0;
@@ -1213,6 +915,6 @@
   SL_TICKET fout;
   char * key;
-  char * path = NULL;
-  char * outpath = NULL;
+  char * path;
+  char * outpath;
   unsigned char * image = NULL;
   long s = 0;
@@ -1220,9 +922,8 @@
   long ii, k = 0;
   UINT32    * h1;
-  char * new = NULL;
 
   if (0 != sl_is_suid())
     {
-      fprintf(stderr, "%s", _("ERROR: insufficient privilege\n"));
+      fprintf(stderr, _("ERROR: insufficient privilege\n"));
       _exit (EXIT_FAILURE);
       /*@notreached@*/
@@ -1230,7 +931,7 @@
     }
         
-  if (new_in == NULL || new_in[0] == '\0')
-    {
-      fprintf(stderr, "%s", 
+  if (new == NULL || new[0] == '\0')
+    {
+      fprintf(stderr, 
 	      _("ERROR: no key given\n Argument must be 'key@path'\n"));
       _exit (EXIT_FAILURE);
@@ -1238,10 +939,4 @@
       return -1;
     }
-
-  len = strlen(new_in) + 1;
-  if (NULL == (new = calloc(1, len)))
-    goto bail_mem;
-  memcpy(new, new_in, len);
-
   key = new;
   len = strlen(new);
@@ -1255,7 +950,6 @@
   if (j == 0)
     {
-      fprintf(stderr, "%s",
+      fprintf(stderr, 
 	      _("ERROR: no path to executable given\n Argument must be 'key@path'\n"));
-      free(new);
       _exit (EXIT_FAILURE);
       /*@notreached@*/
@@ -1264,18 +958,17 @@
   else
     path = &new[j];
-
-  len = strlen(path) + 1 + 4;
   /*@-usedef@*/
-  if (NULL == (outpath = calloc(1,len)))
+  if (NULL == (outpath = malloc(strlen(path) + 1 + 4)))
     goto bail_mem;
   /*@-usedef@*/
-  sl_snprintf (outpath, len, _("%s.out"), path);
-
-  fp = sl_open_read(FIL__, __LINE__, path, SL_NOPRIV);
+  /*@-bufferoverflowhigh@*/
+  sprintf (outpath, _("%s.out"), path);               /* known to fit  */ 
+  /*@+bufferoverflowhigh@*/
+
+  fp = sl_open_read(path, SL_NOPRIV);
   if (SL_ISERROR(fp))
     {
       fprintf(stderr, 
 	      _("ERROR: cannot open %s for read (errnum = %ld)\n"), path, fp);
-      free(new); free (outpath);
       _exit (EXIT_FAILURE);
       /*@notreached@*/
@@ -1283,10 +976,9 @@
     }
   
-  fout = sl_open_write(FIL__, __LINE__, outpath, SL_NOPRIV);
+  fout = sl_open_write(outpath, SL_NOPRIV);
   if (SL_ISERROR(fout))
     {
       fprintf(stderr, 
 	      _("ERROR: cannot open %s (errnum = %ld)\n"), outpath, fout);
-      free(new); free (outpath);
       _exit (EXIT_FAILURE);
       /*@notreached@*/
@@ -1295,17 +987,12 @@
 
 
-  image = calloc(1,4096);
+  image = malloc (4096);
   if (!image)
     goto bail_mem;
   while (0 < (ii = sl_read (fp, &image[s], 4096)))
     {
-      unsigned char * ptr;
       ilen += ii;
       s    += 4096;
-      ptr = realloc (image, (size_t) (4096 + s));
-      if (ptr)
-	image = ptr;
-      else
-	{ free(image); image = NULL; }
+      image = realloc (image, (size_t) (4096 + s));
       if (!image)
 	goto bail_mem;
@@ -1326,10 +1013,7 @@
 	  image[k+7] == new_key[7])
 	{
-	  UINT32 kbuf[KEY_BYT/sizeof(UINT32)];
-
-	  printf("%s", _("old key found\n")); 
+	  printf(_("old key found\n")); 
 	  h1 = sh_tiger_hash_uint32 (key, TIGER_DATA, 
-				     (unsigned long)strlen(key),
-				     kbuf, KEY_BYT/sizeof(UINT32));
+				     (unsigned long)strlen(key));
 	  copy_four( (unsigned char *) &(image[k]),   h1[0]);
 	  copy_four( (unsigned char *) &(image[k+4]), h1[1]);
@@ -1337,5 +1021,4 @@
 	  (void) sl_close (fout);
 	  printf(_("new file %s written\n"), outpath);
-	  free(new); free (outpath); free(image);
 	  _exit (EXIT_SUCCESS);
 	  /*@notreached@*/
@@ -1344,7 +1027,6 @@
     }
 
-  fprintf(stderr, "%s",
+  fprintf(stderr, 
 	  _("ERROR: old key not found\n"));
-  free(new); free (outpath); free(image);
   _exit (EXIT_FAILURE);
   /*@notreached@*/
@@ -1353,9 +1035,6 @@
 
  bail_mem:
-  fprintf(stderr, "%s",
+  fprintf(stderr, 
 	  _("ERROR: out of memory\n"));
-  if (new) free(new); 
-  if (outpath) free (outpath);
-  if (image) free (image);
   _exit (EXIT_FAILURE);
   /*@notreached@*/
@@ -1378,5 +1057,4 @@
   register int    i, j, j1 = 0, j2 = 0, j3;
   char          * dez; 
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_util_encode"));
@@ -1398,16 +1076,13 @@
 
   (void) sl_strlcpy(skey->vernam, 
-		    sh_tiger_hash(skey->vernam, TIGER_DATA, KEY_LEN,
-				  hashbuf, sizeof(hashbuf)), 
+		    sh_tiger_hash(skey->vernam, TIGER_DATA, KEY_LEN), 
 		    KEY_LEN+1);
 
   (void) sl_strlcpy(skey->vernam, 
-		    sh_util_hmac_tiger (skey->vernam, salt, strlen(salt),
-					hashbuf, sizeof(hashbuf)),
-		    KEY_LEN+1);
+		    sh_util_hmac_tiger (skey->vernam, salt, strlen(salt)),
+	     KEY_LEN+1);
 
   (void) sl_strlcpy(skey->vernam, 
-		    sh_util_hmac_tiger (skey->vernam, (char*) new_key, 8,
-					hashbuf, sizeof(hashbuf)),
+		    sh_util_hmac_tiger (skey->vernam, (char*) new_key, 8),
 		    KEY_LEN+1);
 
@@ -1441,15 +1116,17 @@
 /* server mode 
  */
-int sh_util_setserver (const char * dummy)
+int sh_util_setserver (char * dummy)
 {
   SL_ENTER(_("sh_util_setserver"));
 
-  (void) dummy;
-  sh.flag.isserver = GOOD;
+  if (dummy)
+    sh.flag.isserver = GOOD;
+  else
+    sh.flag.isserver = GOOD;
   SL_RETURN((0),_("sh_util_setserver"));
 }
 
 
-int sh_util_setlooptime (const char * str)
+int sh_util_setlooptime (char * str)
 {
   int i = atoi (str);
@@ -1468,5 +1145,5 @@
 
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
-int  sh_util_setchecksum (const char * str)
+int  sh_util_setchecksum (char * str)
 {
   static int reject = 0;
@@ -1566,5 +1243,4 @@
   int          status = 0;
   char       * p;
-  char hashbuf[KEYBUF_SIZE];
 
   SL_ENTER(_("sh_util_keyinit"));
@@ -1584,9 +1260,9 @@
 
   for (i = 0; i < 6; ++i)
-    bufy[i] = taus_get();
+    bufy[i] = taus_get(&(skey->rng0[0]), &(skey->rng1[0]), &(skey->rng2[0]));
 
   p = sh_tiger_hash ((char *) bufy, TIGER_DATA, 
-		     (unsigned long)(6*sizeof(UINT32)),
-		     hashbuf, sizeof(hashbuf));
+		     (unsigned long)(6*sizeof(UINT32)));
+  p[size-1] = '\0';
 
   i = sl_strlcpy(buf, p, (size_t)size);
@@ -1607,160 +1283,11 @@
 
 static unsigned char sh_obscure_index[256];
-static int sh_obscure_no_check = S_FALSE;
-
-int sh_util_valid_utf8 (const unsigned char * str) 
-{
-  const int     sh_val_utf8_1 = 1;
-  const int     sh_val_utf8_2 = 2;
-  const int     sh_val_utf8_3 = 3;
-  const int     sh_val_utf8_4 = 4;
-
-  size_t        len = strlen((const char *)str);
-  size_t        l   = 0;
-  int           typ = 0;
-  unsigned char c     = '\0';
-  unsigned char c2[2] = { 0x00, 0x00 };
-  unsigned char c3[3] = { 0x00, 0x00, 0x00 };
-
-
-#define SH_VAL_UTF8_1 ((c != '\0') && ((c & 0x80) == 0x00))
-#define SH_VAL_UTF8_2 ((c != '\0') && ((c & 0xE0) == 0xC0)) /* 110x xxxx */
-#define SH_VAL_UTF8_3 ((c != '\0') && ((c & 0xF0) == 0xE0)) /* 1110 xxxx */
-#define SH_VAL_UTF8_4 ((c != '\0') && ((c & 0xF8) == 0xF0)) /* 1111 0xxx */
-#define SH_VAL_UTF8_N ((c != '\0') && ((c & 0xC0) == 0x80)) /* 10xx xxxx */
-#define SH_VAL_BAD    ((c == '"')  || (c == '\t') || (c == '\b') || \
-                       (c == '\f') || (c == '\n') || \
-                       (c == '\r') || (c == '\v') || iscntrl((int) c) || \
-                       (c != ' ' && !isgraph ((int) c)))
-   
-  while(l < len) 
-    {
-      c = str[l];
-
-      if      (SH_VAL_UTF8_1) 
-	{
-	  if (!(SH_VAL_BAD && (sh_obscure_index[c] != 1)))
-	    {
-	      typ = sh_val_utf8_1;
-	      ++l; continue;
-	    }
-	  else
-	    {
-	      return S_FALSE;
-	    }
-	} 
-      else if (SH_VAL_UTF8_2) 
-	{ 
-	  typ = sh_val_utf8_2;
-	  c2[0] = c;
-	  if ((c & 0x3e) != 0x00) /* !(overlong 2-byte seq.) */
-	    {
-	      ++l; 
-	      if (l != len) {
-		c = str[l];
-		if(SH_VAL_UTF8_N) {
-		  c2[1] = c;
-		  ++l; continue;
-		} 
-		else {
-		  return S_FALSE;
-		} 
-	      } 
-	      else {
-		return S_FALSE; 
-	      }
-	    }
-	  else
-	    {
-	      return S_FALSE; /* overlong 2-byte seq. */
-	    }
-	} 
-      else if (SH_VAL_UTF8_3) 
-	{
-	  typ = sh_val_utf8_3;
-	  c3[0] = c;
-	  ++l; if (l == len) return S_FALSE; c = str[l];
-	  if(!SH_VAL_UTF8_N) return S_FALSE;
-	  if (((str[l-1] & 0x1F) == 0x00) && ((c & 0x60) == 0x00))
-	    return S_FALSE; /* overlong 3-byte seq. */
-	  c3[1] = c;
-	  ++l; if (l == len) return S_FALSE; c = str[l];
-	  if(!SH_VAL_UTF8_N) return S_FALSE;
-	  c3[2] = c;
-	  ++l; continue;
-	} 
-      else if (SH_VAL_UTF8_4) 
-	{
-	  typ = sh_val_utf8_4;
-	  ++l; if (l == len) return S_FALSE; c = str[l];
-	  if(!SH_VAL_UTF8_N) return S_FALSE;
-	  if (((str[l-1] & 0x0F) == 0x00) && ((c & 0x70) == 0x00))
-	    return S_FALSE; /* overlong 4-byte seq. */
-	  ++l; if (l == len) return S_FALSE; c = str[l];
-	  if(!SH_VAL_UTF8_N) return S_FALSE;
-	  ++l; if (l == len) return S_FALSE; c = str[l];
-	  if(!SH_VAL_UTF8_N) return S_FALSE;
-	  ++l; continue;
-	}
-      return S_FALSE;
-    }
-
-  /* last character is invisible (space or else)
-   */
-  if (typ == sh_val_utf8_1)
-    { 
-      if (c != ' ')
-	return S_TRUE;
-      else
-	return S_FALSE;
-    }
-  else if (typ == sh_val_utf8_2)
-    {
-      if (c2[0] == 0xC2 && c2[1] == 0xA0) /* nbsp */
-	return S_FALSE;
-      else
-	return S_TRUE;
-    }
-  else if (typ == sh_val_utf8_3)
-    {
-      if (c3[0] == 0xE2) 
-	{
-	  if (c3[1] == 0x80 && c3[2] >= 0x80 && c3[2] <= 0x8F)
-	    return S_FALSE; /* various spaces, left-to-right, right-to-left */
-	  else if (c3[1] == 0x80 && (c3[2] == 0xA8 || c3[2] == 0xA9 || 
-				     c3[2] == 0xAD || c3[2] == 0xAF))
-	    return S_FALSE; /* line sep, para sep, zw word joiner, nnbsp */
-	  else if (c3[1] == 0x81 && (c3[2] == 0xA0 || c3[2] == 0xA1 || 
-				     c3[2] == 0x9F))
-	    return S_FALSE; /* word joiner, function app, math space */
-	  else
-	    return S_TRUE;
-	}
-      else if (c3[0] == 0xE3 && c3[1] == 0x80 && c3[2] == 0x80)
-	{
-	  return S_FALSE; /* ideographic space */
-	}
-      else if (c3[0] == 0xEF && c3[1] == 0xBB && c3[2] == 0xBF)
-	{
-	  return S_FALSE; /* zwnbsp */
-	}
-      else
-	{
-	  return S_TRUE;
-	}
-    }
-  else
-    {
-      return S_TRUE;
-    }
-}
-
-
-int sh_util_obscure_ok (const char * str)
+
+int sh_util_obscure_ok (char * str)
 {
   unsigned long   i;
-  char * endptr = NULL;
-
-  SL_ENTER(_("sh_util_obscure_ok"));
+  char * endptr = str;
+
+  SL_ENTER(_("sh_util_obscure_ex"));
 
   if (0 == sl_strncmp("all", str, 3))
@@ -1770,9 +1297,6 @@
 	  sh_obscure_index[i] = (unsigned char)1;
 	}
-      sh_obscure_no_check = S_TRUE;
-      SL_RETURN(0, _("sh_util_obscure_ok"));
-    }
-
-  sh_obscure_no_check = S_FALSE;
+      SL_RETURN(0, _("sh_util_obscure_ex"));
+    }
 
   for (i = 0; i < 255; ++i)
@@ -1780,13 +1304,4 @@
       sh_obscure_index[i] = (unsigned char)0;
     }
-
-  i = strtoul (str, &endptr, 0);
-  if (i > 255)
-    {
-      SL_RETURN(-1, _("sh_util_obscure_ok"));
-    }
-  sh_obscure_index[i] = (unsigned char)1;
-  if (*endptr == ',')
-    ++endptr;
 
   while (*endptr != '\0')
@@ -1795,5 +1310,5 @@
       if (i > 255)
 	{
-	  SL_RETURN(-1, _("sh_util_obscure_ok"));
+	  SL_RETURN(-1, _("sh_util_obscure_ex"));
 	}
       sh_obscure_index[i] = (unsigned char)1;
@@ -1801,26 +1316,12 @@
 	++endptr;
     }
-  SL_RETURN(0, _("sh_util_obscure_ok"));
-}
-
-static int sh_obscure_check_utf8 = S_FALSE;
-
-int sh_util_obscure_utf8 (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_util_obscure_utf8"));
-  i = sh_util_flagval(c, &(sh_obscure_check_utf8));
-  if (sh_obscure_check_utf8 == S_TRUE)
-    sh_obscure_no_check = S_FALSE;
-  SL_RETURN(i, _("sh_util_obscure_utf8"));
-}
-
-
-int sh_util_obscurename (ShErrLevel level, const char * name_orig, int flag)
-{
-  const unsigned char * name = (const unsigned char *) name_orig;
+  SL_RETURN(0, _("sh_util_obscure_ex"));
+}
+
+int sh_util_obscurename (ShErrLevel level, char * name_orig, int flag)
+{
+  char * name = name_orig;
   char * safe;
   unsigned int i;
-  size_t len = 0;
 
   SL_ENTER(_("sh_util_obscurename"));
@@ -1828,184 +1329,93 @@
   ASSERT_RET((name != NULL), _("name != NULL"), (0))
 
-  if (sh_obscure_no_check == S_FALSE)
-    {
-      if (sh_obscure_check_utf8 != S_TRUE)
-	{
-	  /* -- Check name. --
-	   */
-	  while (*name != '\0') 
+  /* -- Check name. --
+   */
+  while (*name != '\0') 
+    {
+      if ( (*name) == '"'  || (*name) == '\t' ||
+	   (*name) == '\b' || (*name) == '\f' || 
+	   (*name) == '\n' || (*name) == '\r' ||
+	   (*name) == '\v' || iscntrl((int) *name) || 
+	   ((*name) != ' ' && !isgraph ((int) *name)) ) 
+	{
+	  i = (unsigned char) *name;
+	  if (sh_obscure_index[i] != (unsigned char)1)
 	    {
-	      if ( (*name) >  0x7F || (*name) == '"'  || (*name) == '\t' ||
-		   (*name) == '\b' || (*name) == '\f' || 
-		   (*name) == '\n' || (*name) == '\r' ||
-		   (*name) == '\v' || iscntrl((int) *name) || 
-		   ((*name) != ' ' && !isgraph ((int) *name)) ) 
+	      if (flag == S_TRUE)
 		{
-		  i = (unsigned char) *name;
-		  if (sh_obscure_index[i] != (unsigned char)1)
-		    {
-		      goto err;
-		    }
+		  safe = sh_util_safe_name (name_orig);  
+		  sh_error_handle (level, FIL__, __LINE__, 0, MSG_FI_OBSC, 
+				   safe);
+		  SH_FREE(safe);
 		}
-	      name++; ++len;
+	      SL_RETURN((-1),_("sh_util_obscurename"));
 	    }
-
-	  /* Check for blank at end of name
-	   */
-	  if ((len > 0) && (name_orig[len-1] == ' '))
-	    {
-	      goto err;
-	    }
-	}
-      else
-	{
-	  if (S_FALSE == sh_util_valid_utf8(name))
-	    {
-	      goto err;
-	    }
-	  SL_RETURN((0),_("sh_util_obscurename"));
-	}
-    }
-      
+	}
+      name++;
+    }
+
   SL_RETURN((0),_("sh_util_obscurename"));
-
- err:
-  
-  if (flag == S_TRUE)
-    {
-      safe = sh_util_safe_name (name_orig);  
-      sh_error_handle (level, FIL__, __LINE__, 0, MSG_FI_OBSC, 
-		       safe);
-      SH_FREE(safe);
-    }
-  SL_RETURN((-1),_("sh_util_obscurename"));
-}
-
+}
 #endif
 
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_dirname(const char * fullpath)
+char * sh_util_basename(char * fullpath)
 {
   char * retval;
-  size_t len;
-  char * tmp;
-
-  SL_ENTER(_("sh_util_dirname"));
+  size_t i;
+
+  SL_ENTER(_("sh_util_basename"));
 
   ASSERT_RET ((fullpath != NULL), _("fullpath != NULL"), (NULL))
-  ASSERT_RET ((*fullpath == '/'), _("*fullpath == '/'"), (NULL))
-
-  retval = sh_util_strdup(fullpath);
-
-  tmp    = retval;
-  while (*tmp == '/') ++tmp;
-
-  /* (1) only leading slashes -- return exact copy 
+
+  i = sl_strlen (fullpath);  /* fullpath[i] is terminating '\0' */
+
+  while (i > 0) {
+    --i;
+    if (fullpath[i] == '/') break;
+  }
+
+  /* -- Not a valid path. --
    */
-  if (*tmp == '\0')
-    {
-      SL_RETURN(retval, _("sh_util_dirname"));
-    }
-
-  /* (2) there are non-slash characters, so delete trailing slashes
-   */
-  len    = sl_strlen (retval);     /* retval[len] is terminating '\0' */
-
-  while (len > 1 && retval[len-1] == '/')    /* delete trailing slash */
-    {
-      retval[len-1] = '\0';
-      --len;
-    }
-
-  /* (3) now delete all non-slash characters up to the preceding slash
-   */
-  while (len > 1 && retval[len-1] != '/') {
-    retval[len-1] = '\0';
-    --len;
-  }
-
-  /* (4a) only leading slashes left, so return this
-   */
-  if (&(retval[len]) == tmp)
-    {
-      SL_RETURN(retval, _("sh_util_dirname"));
-    }
-
-  /* (4b) strip trailing slash(es) of parent directory
-   */
-  while (len > 1 && retval[len-1] == '/') {
-    retval[len-1] = '\0';
-    --len;
-  }
-  SL_RETURN(retval, _("sh_util_dirname"));
-
+  if ((fullpath[i] != '/') && (i == 0) ) 
+    SL_RETURN(NULL, _("sh_util_basename"));
+
+  retval = SH_ALLOC(i + 1);
+
+  (void) sl_strlcpy (retval, fullpath, i+1);
+
+  SL_RETURN(retval, _("sh_util_basename"));
 }
 
 /* returns freshly allocated memory, return value should be free'd
  */
-char * sh_util_basename(const char * fullpath)
-{
-  char       * retval = NULL;
-  const char * tmp;
-  char       * tmp2;
-  char       * c;
-  size_t       len;
-
-  SL_ENTER(_("sh_util_basename"));
+char * sh_util_filename(char * fullpath)
+{
+  char * retval;
+  char * c;
+  size_t i;
+
+  SL_ENTER(_("sh_util_filename"));
 
   ASSERT_RET ((fullpath != NULL), _("fullpath != NULL"), (NULL))
 
-  tmp = fullpath; while (*tmp == '/') ++tmp;
-  if (*tmp == '\0')
-    {
-      retval = sh_util_strdup(fullpath);
-    }
-  else
-    {
-      tmp2 = sh_util_strdup(tmp);
-      len  = sl_strlen (tmp2);
-
-      while (len > 1 && tmp2[len-1] == '/')
-	{
-	  tmp2[len-1] = '\0';
-	  --len;
-	}
-
-      if (tmp2) /* for llvm/clang analyzer */
-	{
-	  c = strrchr(tmp2, '/');
-	  if (c)
-	    {
-	      retval = sh_util_strdup(++c);
-	      SH_FREE(tmp2);
-	    }
-	  else
-	    {
-	      retval = tmp2;
-	    }
-	}
-    }
-
-  SL_RETURN(retval, _("sh_util_basename"));
-}
-
-#define SH_ESCAPE_SPACE      1
-#define SH_DONT_ESCAPE_SPACE 0    
-char * sh_util_safe_name_int (const char * name, int escape_space);
-
+  c = strrchr(fullpath, '/');
+  i = sl_strlen (c);
+  if (i <= 1) SL_RETURN(NULL, _("sh_util_filename")); /* ends in '/' */
+  ++c;
+  --i;
+
+  retval = SH_ALLOC(i + 1);
+
+  (void) sl_strlcpy (retval, c, i+1);
+
+  SL_RETURN(retval, _("sh_util_filename"));
+}
+
+    
+/* returns freshly allocated memory, return value should be free'd
+ */
 char * sh_util_safe_name (const char * name)
-{
-  return sh_util_safe_name_int (name, SH_ESCAPE_SPACE); 
-}
-
-char * sh_util_safe_name_keepspace (const char * name)
-{
-  return sh_util_safe_name_int (name, SH_DONT_ESCAPE_SPACE); 
-}
-
-/* returns freshly allocated memory, return value should be free'd
- */
-char * sh_util_safe_name_int (const char * name, int escape_space)
 {
   register int  i = 0;
@@ -2014,5 +1424,4 @@
   char          oct[32];
   char          format[16];
-  size_t        len;
 
   SL_ENTER(_("sh_util_safe_name"));
@@ -2031,32 +1440,13 @@
   */
 
-  len = sl_strlen(name);
-  p   = name;
-
 #ifdef SH_USE_XML
-  if (sl_ok_muls (6, len) && sl_ok_adds ((6*len), 2))
-    { retval = SH_ALLOC(6 * len + 2); }
-  else
-    {
-      /* return an allocated array
-       */
-      retval = SH_ALLOC(11);
-      (void) sl_strlcpy(retval, _("(overflow)"), 11);
-      SL_RETURN(retval, _("sh_util_safe_name"));
-    }
+  retval = SH_ALLOC(6 * sl_strlen(name) + 2);
 #else
-  if (sl_ok_muls (4, len) && sl_ok_adds ((4*len), 2))
-    { retval = SH_ALLOC(4 * len + 2); }
-  else
-    {
-      /* return an allocated array
-       */
-      retval = SH_ALLOC(11);
-      (void) sl_strlcpy(retval, _("(overflow)"), 11);
-      SL_RETURN(retval, _("sh_util_safe_name"));
-    }
+  retval = SH_ALLOC(4 * sl_strlen(name) + 2);
 #endif 
 
   (void) sl_strncpy(format, _("%c%03o"), 16);
+
+  p = name;
 
   while (*p != '\0') {
@@ -2094,11 +1484,6 @@
 #endif
     } else if ( (*p) == ' ') {     /* space            */
-      if (escape_space) {
-	retval[i] = '\\'; ++i; 
-	retval[i] = ' ';
-      }
-      else {
-	retval[i] = *p;
-      }
+      retval[i] = '\\'; ++i; 
+      retval[i] = ' ';
 #ifdef SH_USE_XML
     } else if ( (*p) == '"') {     /* double quote     */
@@ -2132,5 +1517,4 @@
     } else if (!isgraph ((int) *p)) {    /* not printable    */
       /*@-bufferoverflowhigh -formatconst@*/
-      /* flawfinder: ignore */
       sprintf(oct, format, '\\',                 /* known to fit  */
 	      (unsigned char) *p);
@@ -2150,7 +1534,7 @@
 }
 
-int sh_util_isnum (const char *str)
-{
-  const char *p = str;
+int sh_util_isnum (char *str)
+{
+  char *p = str;
 
   SL_ENTER(_("sh_util_isnum"));
@@ -2168,5 +1552,5 @@
 char * sh_util_strconcat (const char * arg1, ...)
 {
-  size_t    length, l2;
+  size_t    length;
   char    * s;
   char    * strnew;
@@ -2183,19 +1567,10 @@
   while (s != NULL)
     {
-      l2 = sl_strlen (s);
-      if (sl_ok_adds(length, l2))
-	length += l2;
-      else
-	SL_RETURN(NULL, _("sh_util_strconcat"));
+      length = length + sl_strlen (s);
       s = va_arg (vl, char * );
     }
   va_end (vl);
 
-  if (sl_ok_adds(length, 2))
-    strnew = SH_ALLOC( length + 2 );
-  else
-    SL_RETURN(NULL, _("sh_util_strconcat"));
-
-  /* cppcheck-suppress uninitvar */
+  strnew = SH_ALLOC( length + 2 ); 
   strnew[0] = '\0';
 
@@ -2212,172 +1587,4 @@
 
   SL_RETURN(strnew, _("sh_util_strconcat"));
-}
-
-static const char bto64_0[] = N_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789()");
-static char bto64[65] = { '\0' };
-
-  
-size_t sh_util_base64_enc (unsigned char * out, 
-			   const unsigned char * instr, 
-			   size_t lin)
-{
-  int             ll;
-  unsigned char   a, b, c;
-  size_t          len  = 0;
-  size_t          j    = 0;
-
- start:
-  if (bto64[0] != '\0')
-    {
-      if (instr /* && *instr *//* need to handle binary data */)
-	{
-	  if (lin == 0)
-	    lin = strlen((const char *)instr);
-
-	  if (lin > 0)
-	    {
-	      do {
-		ll = 0;
-		
-		if (len < lin) 
-		  { a = *instr; ++instr; ++len; ++ll; }
-		else 
-		  { a = 0; }
-		if (len < lin) 
-		  { b = *instr; ++instr; ++len; ++ll; }
-		else 
-		  { b = 0; }
-		if (len < lin) 
-		  { c = *instr; ++instr; ++len; ++ll; }
-		else 
-		  { c = 0; }
-		
-		*out = bto64[ a >> 2 ];
-		++j; ++out;
-		*out = bto64[ ((a & 0x03) << 4) | ((b & 0xf0) >> 4) ];
-		++j; ++out;
-		*out = (unsigned char) (ll > 1 ? bto64[ ((b & 0x0f) << 2) | ((c & 0xc0) >> 6) ] : '?');
-		++j; ++out;
-		*out = (unsigned char) (ll > 2 ? bto64[ c & 0x3f ] : '?');
-		++j; ++out;
-	      } while (len < lin);
-	    }
-	}
-      *out = '\0';
-      return j;
-    }
-
-  memcpy(bto64, _(bto64_0), 65);
-  goto start;
-}
-
-size_t sh_util_base64_enc_alloc (char **out, const char *in, size_t inlen)
-{
-  size_t outlen = SH_B64_SIZ(inlen);
-
-  if (inlen > outlen) /* overflow */
-    {
-      *out = NULL;
-      return 0;
-    }
-
-  *out = SH_ALLOC(outlen);
-  return sh_util_base64_enc((unsigned char *)*out, (const unsigned char *)in, inlen);
-}
-
-size_t sh_util_base64_dec (unsigned char *out, 
-			   const unsigned char *in, 
-			   size_t lin)
-{
-  size_t i;
-  unsigned char c;
-  unsigned char b;
-  size_t lout = 0;
-  unsigned int  w = 0;
-
-  if (out && in)
-    {
-      if (lin == 0)
-	lin = strlen((const char *)in);
-
-      for (i = 0; i < lin; i++)
-	{
-	  c = *in; ++in;
-	  b = 0;
-	  
-	  if ((c >= 'A') && (c <= 'Z'))
-	    {
-	      b = (c - 'A');
-	    }
-	  else if ((c >= 'a') && (c <= 'z'))
-	    {
-	      b = (c - 'a' + 26);
-	    }
-	  else if ((c >= '0') && (c <= '9'))
-	    {
-	      b = (c - '0' + 52);
-	    }
-	  else if (c == '(' || c == '+')
-	    {
-	      b = 62;
-	    }
-	  else if (c == ')' || c == '/')
-	    {
-	      b = 63;
-	    }
-	  else if (c == '?' || c == '=')
-	    {
-	      /* last byte was written to, but will now get
-	       * truncated
-	       */
-	      if (lout > 0) --lout;
-	      break;
-	    }
-	  
-	  if (w == 0)
-	    {
-	      *out = (b << 2) & 0xfc;
-	      ++lout;
-	    }
-	  else if (w == 1)
-	    {
-	      *out |= (b >> 4) & 0x03;
-	      ++out;
-	      *out = (b << 4) & 0xf0;
-	      ++lout;
-	    }
-	  else if (w == 2)
-	    {
-	      *out |= (b >> 2) & 0x0f;
-	      ++out;
-	      *out = (b << 6) & 0xc0;
-	      ++lout;
-	    }
-	  else if (w == 3)
-	    {
-	      *out |= b & 0x3f;
-	      ++out;
-	    }
-	  
-	  ++w;
-	  
-	  if (w == 4)
-	    {
-	      w = 0;
-	    }
-	}
-      *out = '\0';
-    }
-  return lout;
-}
-
-size_t sh_util_base64_dec_alloc (unsigned char **out, const unsigned char *in, 
-				 size_t lin)
-{
-  size_t lout = 3 * (lin / 4) + 2;
-
-  *out = SH_ALLOC(lout);
-
-  return sh_util_base64_dec (*out, in, lin);
 }
 
@@ -2412,7 +1619,7 @@
   if (status != 0 && status != REG_NOMATCH) 
     {
-      errbuf = SH_ALLOC(BUFSIZ);
+      errbuf = SH_ALLOC(BUFSIZ+2);
       (void) regerror(status, &preg, errbuf, BUFSIZ); 
-      errbuf[BUFSIZ-1] = '\0';
+      errbuf[BUFSIZ] = '\0';
       sh_error_handle ((-1), FIL__, __LINE__, status, MSG_E_REGEX,
 		       errbuf, regex_str);
Index: trunk/src/sh_utmp.c
===================================================================
--- trunk/src/sh_utmp.c	(revision 591)
+++ trunk/src/sh_utmp.c	(revision 1)
@@ -79,8 +79,5 @@
 #include "sh_modules.h"
 #include "sh_utmp.h"
-#include "sh_pthread.h"
-#include "sh_inotify.h"
-
-SH_MUTEX_EXTERN(mutex_thread_nolog);
+
 
 #ifdef TM_IN_SYS_TIME
@@ -141,42 +138,57 @@
 #ifdef HAVE_UTMPX_H
 
-#if defined(_PATH_UTMPX)
-#define SH_PATH_UTMP _PATH_UTMPX
-#elif defined(UTMPX_FILE)
-#define SH_PATH_UTMP UTMPX_FILE
-#elif defined(_PATH_UTMP)
-#define SH_PATH_UTMP _PATH_UTMP
-#else
+#ifndef _PATH_UTMP
+#ifdef   UTMPX_FILE
+#define _PATH_UTMP   UTMPX_FILE
+#else  
 #error  You must define UTMPX_FILE in the file config.h 
 #endif
-
-#else
-
-#if defined(_PATH_UTMP)
-#define SH_PATH_UTMP _PATH_UTMP
-#elif defined(UTMP_FILE)
-#define SH_PATH_UTMP UTMP_FILE
+#endif
+#ifndef _PATH_WTMP
+#ifdef   WTMPX_FILE
+#define _PATH_WTMP   WTMPX_FILE
+#else
+#error  You must define WTMPX_FILE in the file config.h
+#endif
+#endif
+
+#else
+
+#ifndef _PATH_UTMP
+#ifdef   UTMP_FILE
+#define _PATH_UTMP   UTMP_FILE
 #else  
 #error  You must define UTMP_FILE in the file config.h 
 #endif
+#endif
+#ifndef _PATH_WTMP
+#ifdef   WTMP_FILE
+#define _PATH_WTMP   WTMP_FILE
+#else
+#error  You must define WTMP_FILE in the file config.h
+#endif
+#endif
 
 #endif
 
 typedef struct log_user {
-  time_t              last_checked;
   char                ut_tty[UT_LINESIZE+1];    
   char                name[UT_NAMESIZE+1];
   char                ut_host[UT_HOSTSIZE+1];
-  char                ut_ship[SH_IP_BUF]; /* IP address */
+  char                ut_ship[16]; /* IP address */
   time_t              time;
   struct log_user   * next;
 } blah_utmp;
 
-static char * utmp_path = SH_PATH_UTMP;
+#ifdef HAVE_UTTYPE
+static char   terminated_line[UT_HOSTSIZE]; 
+#endif
+
+static struct SH_UTMP_S save_utmp;
 
 static void sh_utmp_logout_morechecks(struct log_user   * user);
 static void sh_utmp_login_morechecks(struct SH_UTMP_S * ut);
-static void sh_utmp_checklogin (struct SH_UTMP_S * ut, time_t start_read);
-static void sh_utmp_check_internal();
+static void sh_utmp_addlogin (struct SH_UTMP_S * ut);
+static void sh_utmp_check_internal(int mode);
 
 static int    ShUtmpLoginSolo    = SH_ERR_INFO;
@@ -208,20 +220,4 @@
   },
   {
-    N_("logincheckfirst"),
-    sh_login_set_checklevel
-  },
-  {
-    N_("logincheckoutlier"),
-    sh_login_set_siglevel
-  },
-  {
-    N_("logincheckdate"),
-    sh_login_set_def_allow
-  },
-  {
-    N_("logincheckuserdate"),
-    sh_login_set_user_allow
-  },
-  {
     NULL,
     NULL
@@ -229,28 +225,17 @@
 };
 
-static void set_defaults(void)
-{
-  ShUtmpLoginSolo    = SH_ERR_INFO;
-  ShUtmpLoginMulti   = SH_ERR_WARN;
-  ShUtmpLogout       = SH_ERR_INFO;
-  ShUtmpActive       = S_TRUE;
-  ShUtmpInterval     = 300;
-
-  sh_login_reset();
-  return;
-}
-
-#if defined(HAVE_UTMPX_H) && defined(HAVE_GETUTXENT)
-#define USE_SETUTENT 1
-#elif defined(HAVE_GETUTENT)
-#define USE_SETUTENT 1
-#endif
-
-
-#if defined (USE_SETUTENT)
-
-#ifdef HAVE_UTMPX_H 
-
-#define sh_utmp_utmpname(a)  (void)(a)
+int sh_utmp_null()
+{
+  return 0;
+}
+
+
+
+
+#if defined (HAVE_SETUTENT) && defined (USE_SETUTENT)
+
+#ifdef HAVE_UTMPX_H
+
+#define sh_utmp_utmpname     utmpxname
 #define sh_utmp_setutent     setutxent
 #define sh_utmp_endutent     endutxent
@@ -281,6 +266,10 @@
 
 static FILE * sh_utmpfile = NULL;
-static char   sh_utmppath[80] = SH_PATH_UTMP;
-
+static char   sh_utmppath[80] = _PATH_UTMP;
+
+/* sh_utmp_feed_forward is for optimizing
+ * (fseek instead of getutent loop)
+ */
+static long   sh_utmp_feed_forward = 0;
 
 static void sh_utmp_utmpname(const char * str)
@@ -289,9 +278,9 @@
   if (sh_utmpfile != NULL)
     {
-      (void) sl_fclose (FIL__, __LINE__, sh_utmpfile);
+      (void) fclose (sh_utmpfile);
       sh_utmpfile = NULL;
     }
 
-  (void) sl_strlcpy (sh_utmppath, str, sizeof(sh_utmppath));
+  (void) sl_strlcpy (sh_utmppath, str, 80);
   SL_RET0(_("sh_utmp_utmpname"));
 }
@@ -304,10 +293,13 @@
   SL_ENTER(_("sh_utmp_setutent"));
 
+  ASSERT((sh_utmppath != NULL), _("sh_utmppath != NULL"));
+
+  if (sh_utmppath == NULL)
+    SL_RET0(_("sh_utmp_setutent"));
+
   if (sh_utmpfile == NULL) 
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       fd = (int) aud_open (FIL__, __LINE__, SL_NOPRIV, 
 			   sh_utmppath, O_RDONLY, 0);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
       if (fd >= 0)
 	{
@@ -321,12 +313,15 @@
 	{
 	  error = errno;
-	  SH_MUTEX_LOCK(mutex_thread_nolog);
 	  sh_error_handle ((-1), FIL__, __LINE__, error, MSG_E_ACCESS,
 			   (long) sh.real.uid, sh_utmppath);
-	  SH_MUTEX_UNLOCK(mutex_thread_nolog);
 	  SL_RET0(_("sh_utmp_setutent"));
 	}
     }
   (void) fseek (sh_utmpfile, 0L, SEEK_SET);
+  if (-1 == fseek (sh_utmpfile, sh_utmp_feed_forward, SEEK_CUR))
+    {
+      sh_utmp_feed_forward = 0; /* modified Apr 4, 2004 */
+      (void) fseek (sh_utmpfile, 0L, SEEK_SET);
+    }
   clearerr (sh_utmpfile);
   SL_RET0(_("sh_utmp_setutent"));
@@ -336,6 +331,5 @@
 {
   SL_ENTER(_("sh_utmp_endutent"));
-  if (NULL != sh_utmpfile)
-    (void) sl_fclose(FIL__, __LINE__, sh_utmpfile);
+  (void) fclose(sh_utmpfile);
   sh_utmpfile = NULL;
   SL_RET0(_("sh_utmp_endutent"));
@@ -368,36 +362,84 @@
 }
 
+#ifdef USE_UNUSED
+
+static struct SH_UTMP_S * sh_utmp_getutline(struct SH_UTMP_S * ut)
+{
+  struct SH_UTMP_S * out;
+ 
+  while (1) {
+      if ((out = sh_utmp_getutent()) == NULL) {
+       	return NULL;
+      }
+#ifdef HAVE_UTTYPE  
+      if (out->ut_type == USER_PROCESS || out->ut_type == LOGIN_PROCESS)
+	if (sl_strcmp(ut->ut_line, out->ut_line) == 0) 
+	  return out;
+#else
+      if ( 0 != sl_strncmp (out->ut_name, "reboot",   6) &&
+	   0 != sl_strncmp (out->ut_name, "shutdown", 8) &&
+	   0 != sl_strncmp (out->ut_name, "date",     4) )
+	return out;
+#endif
+  }
+  return NULL;
+}
+
+static struct SH_UTMP_S * sh_utmp_getutid(struct SH_UTMP_S * ut)
+{
+#ifdef HAVE_UTTYPE  
+  struct SH_UTMP_S * out;
+
+  if (ut->ut_type == RUN_LVL  || ut->ut_type == BOOT_TIME ||
+      ut->ut_type == NEW_TIME || ut->ut_type == OLD_TIME) 
+    {
+      while (1) {
+	if ((out = sh_utmp_getutent()) == NULL) {
+	  return NULL;
+	}
+	if (out->ut_type == ut->ut_type) 
+	  return out;
+      }
+    } 
+  else if (ut->ut_type == INIT_PROCESS || ut->ut_type == LOGIN_PROCESS ||
+	   ut->ut_type == USER_PROCESS || ut->ut_type == DEAD_PROCESS ) 
+    {
+      while (1) {
+	if ((out = sh_utmp_getutent()) == NULL) {
+	  return NULL;
+	}
+	if (sl_strcmp(ut->ut_id, out->ut_id) == 0) 
+	  return out;
+      }
+    }
+#endif
+  return NULL;
+}
+/* #ifdef USE_UNUSED */
+#endif
+
 /* #ifdef HAVE_SETUTENT */
 #endif
 
 #ifdef HAVE_UTADDR
-#ifdef HAVE_UTADDR_V6
-static char * my_inet_ntoa(SINT32 * ut_addr_v6, char * buf, size_t buflen)
-{
-  struct in_addr in;
-
-  buf[0] = '\0';
-
-  if (0 == (ut_addr_v6[1] + ut_addr_v6[2] + ut_addr_v6[3]))
-    {
-      memcpy(&in, ut_addr_v6, sizeof(struct in_addr));
-      sl_strlcpy(buf, inet_ntoa(in), buflen);
-    }
-  else
-    {
-      inet_ntop(AF_INET6, ut_addr_v6, buf, buflen);
-    }
-  return buf;
-}
-#else
-static char * my_inet_ntoa(SINT32 ut_addr, char * buf, size_t buflen)
-{
-  struct in_addr in;
-
-  buf[0] = '\0';
-
-  memcpy(&in, ut_addr, sizeof(struct in_addr));
-  sl_strlcpy(buf, inet_ntoa(in), buflen);
-  return buf;
+#ifdef HAVE_INET_ATON
+static char * my_inet_ntoa(struct in_addr in)
+{
+  return /*@-unrecog@*/inet_ntoa(in)/*@+unrecog@*/;
+}
+#else
+static char * my_inet_ntoa(struct in_addr in)
+{
+  unsigned char a, b, c, d;
+  static char   foo[16];
+  char          bar[4];
+  memcpy (bar, &(in.s_addr), 4); /* memory alignment (?) */
+  memcpy (&a, &bar[0], 1);
+  memcpy (&b, &bar[1], 1);
+  memcpy (&c, &bar[2], 1);
+  memcpy (&d, &bar[3], 1);
+  sprintf(foo, "%d.%d.%d.%d",                          /* known to fit  */
+	  (int) a, (int) b, (int) c, (int) d);
+  return foo;
 }
 #endif
@@ -412,5 +454,4 @@
 static struct log_user   * userlist   = NULL;
 static time_t  lastcheck;
-static int     init_done = 0;
 
 /*************
@@ -419,7 +460,7 @@
  *
  *************/
-
-static int sh_utmp_init_internal (void)
-{
+int sh_utmp_init ()
+{
+  static int done = 0;
 
   SL_ENTER(_("sh_utmp_init"));
@@ -429,37 +470,14 @@
   /* do not re-initialize after a re-configuration
    */
-  if (init_done == 1) {
+  if (done == 1) {
     SL_RETURN( (0), _("sh_utmp_init"));
   }
   lastcheck  = time (NULL);
   userlist   = NULL;
-  sh_utmp_check_internal (); /* current logins */
-  init_done = 1;
+  memset (&save_utmp, 0, sizeof(struct SH_UTMP_S));
+  sh_utmp_check_internal (2); /* current logins */
+  sh_utmp_check_internal (0);
+  done = 1;
   SL_RETURN( (0), _("sh_utmp_init"));
-}
-
-int sh_utmp_init (struct mod_type * arg)
-{
-#if !defined(HAVE_PTHREAD)
-  (void) arg;
-#endif
-  if (ShUtmpActive == BAD)
-    return SH_MOD_FAILED;
-#ifdef HAVE_PTHREAD
-  if (arg != NULL && arg->initval < 0 && 
-      (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      if (0 == sh_pthread_create(sh_threaded_module_run, (void *)arg))
-	return SH_MOD_THREAD;
-      else
-	return SH_MOD_FAILED;
-    }
-  else if (arg != NULL && arg->initval == SH_MOD_THREAD &&
-	   (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE))
-    {
-      return SH_MOD_THREAD;
-    }
-#endif
-  return sh_utmp_init_internal();
 }
 
@@ -470,9 +488,5 @@
  *************/
 #ifdef HAVE_UTTYPE
-static int sh_utmp_login_clean(void);
-#endif
-
-#if defined(HAVE_PTHREAD)
-static sh_watches inotify_watch = SH_INOTIFY_INITIALIZER;
+static int sh_utmp_login_clean();
 #endif
 
@@ -493,25 +507,5 @@
   (void) sh_utmp_login_clean();
 #endif
-  /* Reset the flag, such that the module
-   * can be re-enabled.
-   */
-  set_defaults();
-  init_done          = 0;
-
-#if defined(HAVE_PTHREAD)
-  sh_inotify_remove(&inotify_watch);
-#endif
-
   SL_RETURN( (0), _("sh_utmp_end"));
-}
-
-
-int sh_utmp_reconf()
-{
-  set_defaults();
-#if defined(HAVE_PTHREAD)
-  sh_inotify_remove(&inotify_watch);
-#endif
-  return 0;
 }
 
@@ -524,7 +518,4 @@
 int sh_utmp_timer (time_t tcurrent)
 {
-#if !defined(HAVE_PTHREAD)
-  retry_msleep(1, 0);
-
   if ((time_t) (tcurrent - lastcheck) >= ShUtmpInterval)
     {
@@ -533,29 +524,4 @@
     }
   return 0;
-#else
-  int errnum = 0;
-  
-  if ( (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE) &&
-       sh.flag.checkSum != SH_CHECK_INIT )
-    {
-      sh_inotify_wait_for_change(utmp_path, &inotify_watch, 
-				 &errnum, ShUtmpInterval);
-    }
-  
-  lastcheck  = tcurrent;
-
-  if (SH_INOTIFY_ERROR(errnum))
-    {
-      char ebuf[SH_ERRBUF_SIZE];
-
-      SH_MUTEX_LOCK(mutex_thread_nolog);
-      sh_error_message(errnum, ebuf, sizeof(ebuf));
-      sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, errnum, MSG_E_SUBGEN,
-		       ebuf,
-		       _("sh_utmp_timer") );
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);    
-    }
-  return -1;
-#endif
 }
 
@@ -568,15 +534,6 @@
 {
   SL_ENTER(_("sh_utmp_check"));
-  if (ShUtmpActive == BAD)
-    {
-#if defined(HAVE_PTHREAD)
-      sh_inotify_remove(&inotify_watch);
-#endif
-      SL_RETURN( (-1), _("sh_utmp_check"));
-    }
-  SH_MUTEX_LOCK(mutex_thread_nolog);
   sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_UT_CHECK);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-  sh_utmp_check_internal ();
+  sh_utmp_check_internal (1);
 
   SL_RETURN(0, _("sh_utmp_check"));
@@ -589,5 +546,5 @@
  *************/
 
-int sh_utmp_set_login_solo  (const char * c)
+int sh_utmp_set_login_solo  (char * c)
 {
   int retval;
@@ -597,11 +554,9 @@
   tmp[0] = '='; tmp[1] = '\0';
   (void) sl_strlcat (tmp, c, 32);
-  SH_MUTEX_LOCK(mutex_thread_nolog);
   retval = sh_error_set_level (tmp, &ShUtmpLoginSolo);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
   SL_RETURN(retval, _("sh_utmp_set_login_solo"));
 }
 
-int sh_utmp_set_login_multi (const char * c)
+int sh_utmp_set_login_multi (char * c)
 {
   int retval;
@@ -611,11 +566,9 @@
   tmp[0] = '='; tmp[1] = '\0';
   (void) sl_strlcat (tmp, c, 32);
-  SH_MUTEX_LOCK(mutex_thread_nolog);
   retval = sh_error_set_level (tmp, &ShUtmpLoginMulti);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
   SL_RETURN(retval, _("sh_utmp_set_login_multi"));
 }
 
-int sh_utmp_set_logout_good (const char * c)
+int sh_utmp_set_logout_good (char * c)
 {
   int retval;
@@ -625,12 +578,11 @@
   tmp[0] = '='; tmp[1] = '\0';
   (void) sl_strlcat (tmp, c, 32);
-  SH_MUTEX_LOCK(mutex_thread_nolog);
   retval = sh_error_set_level (tmp, &ShUtmpLogout);
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
   SL_RETURN(retval, _("sh_utmp_set_logout_good"));
 }
 
-int sh_utmp_set_login_timer (const char * c)
-{
+int sh_utmp_set_login_timer (char * c)
+{
+  int retval = 0;
   long val;
 
@@ -639,10 +591,10 @@
   if (val <= 0)
     {
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle ((-1), FIL__, __LINE__, EINVAL, MSG_EINVALS,
 		       _("utmp timer"), c);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
-      SL_RETURN((-1), _("sh_utmp_set_login_timer"));
-    }
+      retval = -1;
+    }
+
+  val = (val <= 0 ? 60 : val);
 
   ShUtmpInterval = (time_t) val;
@@ -650,5 +602,5 @@
 }
 
-int sh_utmp_set_login_activate (const char * c)
+int sh_utmp_set_login_activate (char * c)
 {
   int i;
@@ -658,5 +610,5 @@
 }
 
-
+#ifdef HAVE_UTTYPE
 struct login_ct {
   char name[UT_NAMESIZE+1];
@@ -667,5 +619,5 @@
 static struct login_ct * login_ct_list = NULL;
 
-static int sh_utmp_login_clean(void)
+static int sh_utmp_login_clean()
 {
   struct login_ct * list = login_ct_list;
@@ -738,4 +690,5 @@
 }
 
+#endif
 
 
@@ -745,282 +698,297 @@
  *    - link user.ut_record   -> log_record
  */
-
-#include <ctype.h>
+#ifdef HAVE_UTTYPE  
 static int sh_utmp_is_virtual (char * in_utline, char * in_uthost)
 {
-
-  if (in_uthost != NULL   &&
-      in_utline != NULL   &&
+  if (in_utline != NULL)
+    {
+      if (0 == sl_strncmp(in_utline, _("ttyp"), 4))
+	{ return 0; }
+      else if (0 == sl_strncmp(in_utline, _("ttyq"), 4))
+	{ return 0; }
+    }
+  if (in_uthost != NULL   && 
       in_uthost[0] == ':' && 
-      isdigit((int) in_uthost[1]) && 
-      0 == sl_strncmp(in_utline, _("pts/"), 4))
-    {
-      return 1;
-    }
-
-  return 0;
-}
-
-
-static void sh_utmp_log_out(int sev, struct log_user * user, int n)
-{
-  char ttt[TIM_MAX];
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  (void) sh_unix_time (user->time, ttt, TIM_MAX);
-  sh_error_handle( sev, FIL__, __LINE__, 0,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   MSG_UT_LG3X,
-#elif defined(HAVE_UTHOST)
-		   MSG_UT_LG3A,
-#else
-		   MSG_UT_LG3B,
-#endif
-		   user->name,
-		   user->ut_tty,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   user->ut_host,
-		   user->ut_ship,
-#elif defined(HAVE_UTHOST)
-		   user->ut_host,
-#endif
-		   ttt,
-		   n
-		   );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static void sh_utmp_log_multi(int sev, struct log_user * user, int n)
-{
-  char ttt[TIM_MAX];
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  (void) sh_unix_time (user->time, ttt, TIM_MAX);
-  sh_error_handle( sev, FIL__, __LINE__, 0,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   MSG_UT_LG2X,
-#elif defined(HAVE_UTHOST)
-		   MSG_UT_LG2A,
-#else
-		   MSG_UT_LG2B,
-#endif
-		   user->name,
-		   user->ut_tty,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   user->ut_host,
-		   user->ut_ship,
-#elif defined(HAVE_UTHOST)
-		   user->ut_host,
-#endif
-		   ttt,
-		   n
-		   );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static void sh_utmp_log_one(int sev, struct log_user * user, int n)
-{
-  char ttt[TIM_MAX];
-  
-  SH_MUTEX_LOCK(mutex_thread_nolog);
-  (void) sh_unix_time (user->time, ttt, TIM_MAX);
-  sh_error_handle( sev, FIL__, __LINE__, 0,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   MSG_UT_LG1X,
-#elif defined(HAVE_UTHOST)
-		   MSG_UT_LG1A,
-#else
-		   MSG_UT_LG1B,
-#endif
-		   user->name,
-		   user->ut_tty,
-#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
-		   user->ut_host,
-		   user->ut_ship,
-#elif defined(HAVE_UTHOST)
-		   user->ut_host,
-#endif
-		   ttt,
-		   n
-		   );
-  SH_MUTEX_UNLOCK(mutex_thread_nolog);
-}
-
-static void sh_utmp_purge_old (time_t start_read)
+      in_uthost[1] == '0' && 
+      in_uthost[2] == '\0')
+    {
+      /* return 0; */
+      return 1;  /* actually does not seem portable, not even among linuxes */
+    }
+  return 1;
+}
+#endif
+
+static void sh_utmp_addlogin (struct SH_UTMP_S * ut)
 {
   struct log_user   * user     = userlist;
   struct log_user   * userold  = userlist;
-  volatile int        status;
-
-  /* ------- find old entries -------- 
+#ifdef HAVE_UTTYPE  
+  struct log_user   * username = userlist;
+#endif
+
+  char   ttt[TIM_MAX];
+#ifdef HAVE_UTTYPE
+  int    status;
+#endif
+
+  SL_ENTER(_("sh_utmp_addlogin"));
+
+  if (ut->ut_line[0] == '\0')
+    SL_RET0(_("sh_utmp_addlogin"));
+
+  /* for some stupid reason, AIX repeats the wtmp entry for logouts
+   * with ssh
+   */
+  if (memcmp (&save_utmp, ut, sizeof(struct SH_UTMP_S)) == 0)
+    {
+      memset(&save_utmp, (int) '\0', sizeof(struct SH_UTMP_S));
+      SL_RET0(_("sh_utmp_addlogin"));
+    }
+  memcpy (&save_utmp, ut, sizeof(struct SH_UTMP_S));
+
+
+  /* ------- find user -------- 
    */
   while (user != NULL) 
     {
-      if (user->last_checked < start_read)
+      if (0 == sl_strncmp(user->ut_tty, ut->ut_line, UT_LINESIZE) ) 
+	break;
+      userold = user;
+      user = user->next;
+    }
+
+#ifdef HAVE_UTTYPE  
+  while (username != NULL) 
+    {
+      if (0 == sl_strncmp(username->name, ut->ut_name, UT_NAMESIZE) ) 
+	break;
+      username = username->next;
+    }
+#endif
+  
+#ifdef HAVE_UTTYPE  
+  /* ---------- LOGIN -------------- */
+  if (ut->ut_type == USER_PROCESS) 
+    {
+      if (user == NULL)
 	{
-	  /* report logout */
-	  if (0 == sh_utmp_is_virtual(user->ut_tty, user->ut_host))
-	    {
-	      /* reference count down on list of logged in users */
-	      status = sh_utmp_login_r(user->name);
-	      
-	      sh_utmp_log_out(ShUtmpLogout, user, status);
-	      sh_utmp_logout_morechecks((struct log_user *)user);
-	    }
-
-	  /* remove entry */
-	  if (userold == user && userold == userlist)
-	    {
-	      /* first element in userlist, advance userlist & userold */
-	      userold  = user->next;
-	      userlist = user->next;
-	      SH_FREE((struct log_user *)user);
-	      user     = userlist;
-	    }
-	  else
-	    {
-	      /* other element in userlist, cut it out */
-	      userold->next = user->next;
-	      SH_FREE((struct log_user *)user);
-	      user = userold->next;
-	    }
+	  user = SH_ALLOC(sizeof(struct log_user));
+	  user->next       = userlist;
+	  userlist         = user;
+	}
+      (void) sl_strlcpy(user->ut_tty,  ut->ut_line, UT_LINESIZE+1);
+      (void) sl_strlcpy(user->name,    ut->ut_name, UT_NAMESIZE+1);
+#ifdef HAVE_UTHOST
+      (void) sl_strlcpy(user->ut_host, ut->ut_host, UT_HOSTSIZE+1);
+#else
+      user->ut_host[0] = '\0';
+#endif
+#ifdef HAVE_UTADDR
+      /*@-type@*//* ut_addr does exist !!! */
+      (void) sl_strlcpy(user->ut_ship, 
+			my_inet_ntoa(*(struct in_addr*)&(ut->ut_addr)), 16);
+      /*@+type@*/
+#endif
+      user->time = ut->ut_time;
+
+      if (username == NULL                              /* not yet logged in */
+          || 0 == sl_strncmp(ut->ut_line, _("ttyp"), 4) /* in virt. console  */
+          || 0 == sl_strncmp(ut->ut_line, _("ttyq"), 4) /* in virt. console  */
+	  ) {
+	status = sh_utmp_login_a(user->name);
+	(void) sl_strlcpy(ttt, sh_unix_time (user->time), TIM_MAX);
+	sh_error_handle( ShUtmpLoginSolo, FIL__, __LINE__, 0,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			 MSG_UT_LG1X,
+#elif defined(HAVE_UTHOST)
+			 MSG_UT_LG1A,
+#else
+			 MSG_UT_LG1B,
+#endif
+			 user->name,
+			 user->ut_tty,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			 user->ut_host,
+			 user->ut_ship,
+#elif defined(HAVE_UTHOST)
+			 user->ut_host,
+#endif
+			 ttt,
+			 status
+			 );
+      } else
+	if (0 != sh_utmp_is_virtual(ut->ut_line, user->ut_host))
+	  {       
+	    status = sh_utmp_login_a(user->name);
+	    (void) sl_strlcpy(ttt, sh_unix_time (user->time), TIM_MAX);
+	    sh_error_handle( ShUtmpLoginMulti, FIL__, __LINE__, 0,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			     MSG_UT_LG2X,
+#elif defined(HAVE_UTHOST)
+			     MSG_UT_LG2A,
+#else
+			     MSG_UT_LG2B,
+#endif
+			     user->name,
+			     user->ut_tty,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			     user->ut_host,
+			     user->ut_ship,
+#elif defined(HAVE_UTHOST)
+			     user->ut_host,
+#endif
+			     ttt,
+			     status
+			     );
+	  }
+      
+      sh_utmp_login_morechecks(ut);
+      SL_RET0(_("sh_utmp_addlogin"));
+    }
+
+
+  /* ---------  LOGOUT ---------------- */
+  else if (ut->ut_name[0] == '\0'
+	   || ut->ut_type == DEAD_PROCESS  /* solaris does not clear ut_name */
+	   )
+    {
+      if (user != NULL)
+	{
+	  status = sh_utmp_login_r(user->name);
+	  /* sl_strlcpy(ttt, sh_unix_time (user->time), TIM_MAX); */
+	  (void) sl_strlcpy(ttt, sh_unix_time (ut->ut_time), TIM_MAX);
+	  sh_error_handle( ShUtmpLogout, FIL__, __LINE__, 0,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			   MSG_UT_LG3X,
+#elif defined(HAVE_UTHOST)
+			   MSG_UT_LG3A,
+#else
+			   MSG_UT_LG3B,
+#endif
+			   user->name,
+			   user->ut_tty,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+			   user->ut_host,
+			   user->ut_ship,
+#elif defined(HAVE_UTHOST)
+			   user->ut_host,
+#endif
+			   ttt,
+			   status
+			   );
+	  userold->next = user->next;
+	  if (user == userlist)
+	    userlist = user->next;
+	  sh_utmp_logout_morechecks(user);
+	  SH_FREE(user);
+	  user = NULL;
 	}
       else
 	{
-	  userold = user;
-	  user    = user->next;
+	  (void) sl_strlcpy(terminated_line, ut->ut_line, UT_HOSTSIZE);
+	  (void) sl_strlcpy(ttt, sh_unix_time (ut->ut_time), TIM_MAX);
+	  sh_error_handle( ShUtmpLogout, FIL__, __LINE__, 0,
+			   MSG_UT_LG3C,
+			   terminated_line,
+			   ttt, 0
+			   );
 	}
-    }
-  return;
-}
-
-/* These variables are not used anywhere. They only exist
- * to assign &userold, &user to them, which keeps gcc from
- * putting them into a register, and avoids the 'clobbered
- * by longjmp' warning. And no, 'volatile' proved insufficient.
- */
-void * sh_dummy_850_userold = NULL;
-void * sh_dummy_851_user    = NULL;
-
-
-static void sh_utmp_checklogin (struct SH_UTMP_S * ut, time_t start_read)
-{
-  struct log_user   * user     = userlist;
-  struct log_user   * userold  = userlist;
-
-  struct log_user   * username = userlist;
-  volatile int    status;
-
-
-  SL_ENTER(_("sh_utmp_checklogin"));
-
-  if (ut->ut_line[0] == '\0')
-    SL_RET0(_("sh_utmp_checklogin"));
-
-  /* Take the address to keep gcc from putting them into registers. 
-   * Avoids the 'clobbered by longjmp' warning. 
-   */
-  sh_dummy_850_userold = (void*) &userold;
-  sh_dummy_851_user    = (void*) &user;
-
-  /* ------- find user -------- 
-   */
-  while (user != NULL) 
-    {
-      if (0 == sl_strncmp(user->ut_tty, ut->ut_line, UT_LINESIZE) &&
-	  0 == sl_strncmp(user->name, ut->ut_name, UT_NAMESIZE)) 
-	break;
-      userold = user;
-      user = user->next;
-    }
-
-
-  while (username != NULL) 
-    {
-      if (0 == sl_strncmp(username->name, ut->ut_name, UT_NAMESIZE) ) 
-	break;
-      username = username->next;
-    }
-
-  
-  if (user == NULL)
+      SL_RET0(_("sh_utmp_addlogin"));
+    }
+
+  /* default */
+  SL_RET0(_("sh_utmp_addlogin"));
+
+  /* #ifdef HAVE_UTTYPE                   */
+#else
+
+  if (user == NULL)   /* probably a login */
     {
       user = SH_ALLOC(sizeof(struct log_user));
+      sl_strlcpy(user->ut_tty,  ut->ut_line, UT_LINESIZE+1);
+      sl_strlcpy(user->name,    ut->ut_name, UT_NAMESIZE+1);
+#ifdef HAVE_UTHOST
+      sl_strlcpy(user->ut_host, ut->ut_host, UT_HOSTSIZE+1);
+#endif
+#ifdef HAVE_UTADDR
+      sl_strlcpy(user->ut_ship,my_inet_ntoa((struct in_addr)ut->ut_addr),16);
+#endif
+      user->time       = ut->ut_time;
       user->next       = userlist;
-      userlist         = (struct log_user *) user;
-    }
-  else if ( (user->time == ut->ut_time) &&
-	    0 == sl_strcmp (user->name, ut->ut_name))
-    {
-      /* we have it on record and nothing has changed */
-      user->last_checked = start_read;
-      goto out;
-    }
-  else
-    {
-      /* we have it on record and something has changed */
-      if (0 == sh_utmp_is_virtual(user->ut_tty, user->ut_host))
-	{
-	  /* reference count down on list of logged in users */
-	  status = sh_utmp_login_r(user->name);
-	  
-	  sh_utmp_log_out(ShUtmpLogout, user, status);
-	  sh_utmp_logout_morechecks((struct log_user *)user);
-	}
-    }
-
-  user->last_checked = start_read;
-  
-  (void) sl_strlcpy(user->ut_tty,  ut->ut_line, UT_LINESIZE+1);
-  (void) sl_strlcpy(user->name,    ut->ut_name, UT_NAMESIZE+1);
-#ifdef HAVE_UTHOST
-  (void) sl_strlcpy(user->ut_host, ut->ut_host, UT_HOSTSIZE+1);
-#else
-  user->ut_host[0] = '\0';
-#endif
-#ifdef HAVE_UTADDR
-#ifdef HAVE_UTADDR_V6
-  my_inet_ntoa(ut->ut_addr_v6, user->ut_ship, SH_IP_BUF);
-#else
-  my_inet_ntoa(ut->ut_addr, user->ut_ship, SH_IP_BUF);
-#endif
-#endif
-  user->time = ut->ut_time;
-  
-  if (username == NULL)        /* not yet logged in */
-    {
-      /* add this username to the list of logged in users */
-      status = sh_utmp_login_a(user->name);
-      
-      sh_utmp_log_one(ShUtmpLoginSolo, user, status);
-      
-    }
-  else if (0 == sh_utmp_is_virtual(user->ut_tty, (char*)user->ut_host))
-    {
-      /* add this username to the list of logged in users */
-      status = sh_utmp_login_a((char*)user->name);
-      
-      sh_utmp_log_multi(ShUtmpLoginMulti, user, status);
-    }
-  sh_utmp_login_morechecks(ut);
-  goto out;
-
-
- out:
-  sh_dummy_851_user    = NULL;
-  sh_dummy_850_userold = NULL;
-
-  SL_RET0(_("sh_utmp_checklogin"));
+      userlist         = user;
+
+      sl_strlcpy(ttt, sh_unix_time (user->time), TIM_MAX);
+
+
+      sh_error_handle( ShUtmpLoginSolo, FIL__, __LINE__, 0,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+		       MSG_UT_LG1X,
+#elif defined(HAVE_UTHOST)
+		       MSG_UT_LG1A,
+#else
+		       MSG_UT_LG1B,
+#endif
+		       user->name,
+		       user->ut_tty,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+		       user->ut_host,
+		       user->ut_ship,
+#elif defined(HAVE_UTHOST)
+		       user->ut_host,
+#endif
+		       ttt,
+		       1
+		       );
+      sh_utmp_login_morechecks(ut);
+    }
+  else  /* probably a logout */
+    {
+      sl_strlcpy(ttt, sh_unix_time (ut->ut_time), TIM_MAX);
+      /* sl_strlcpy(ttt, sh_unix_time (user->time), TIM_MAX); */
+
+      sh_error_handle( ShUtmpLogout, FIL__, __LINE__, 0,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+		       MSG_UT_LG2X,
+#elif defined(HAVE_UTHOST)
+		       MSG_UT_LG2A,
+#else
+		       MSG_UT_LG2B,
+#endif
+		       user->name,
+		       user->ut_tty,
+#if defined(HAVE_UTHOST) && defined(HAVE_UTADDR)
+		       user->ut_host,
+		       user->ut_ship,
+#elif defined(HAVE_UTHOST)
+		       user->ut_host,
+#endif
+		       ttt,
+		       1
+		       );
+      sh_utmp_logout_morechecks(user);
+      userold->next = user->next;
+      if (user == userlist)       /* inserted Apr 4, 2004 */
+	userlist = user->next;
+      SH_FREE(user);
+      user = NULL;
+    }
+
+  SL_RET0(_("sh_utmp_addlogin"));
+#endif
 }
 
 static time_t        lastmod  = 0;
-
-static void sh_utmp_check_internal ()
+static off_t         lastsize = 0;
+static unsigned long lastread = 0;
+
+static char * mode_path[] = { _PATH_WTMP, _PATH_WTMP, _PATH_UTMP };
+
+static void sh_utmp_check_internal (int mode)
 {
   struct stat   buf;
   int           error;
   struct SH_UTMP_S * ut;
-  int           val_retry;
-  time_t        start_read;
+  unsigned long this_read = 0;
 
   SL_ENTER(_("sh_utmp_check_internal"));
@@ -1028,34 +996,60 @@
   /* error if no access
    */
-  do {
-    val_retry = /*@-unrecog@*/lstat ( utmp_path, &buf)/*@+unrecog@*/;
-  } while (val_retry < 0 && errno == EINTR);
-
-  if (0 != val_retry) 
+  if (0 != retry_lstat(FIL__, __LINE__, mode_path[mode], &buf)) 
     {
       error = errno;
-      SH_MUTEX_LOCK(mutex_thread_nolog);
       sh_error_handle((-1), FIL__, __LINE__, error, MSG_E_ACCESS,
-		      (long) sh.real.uid, utmp_path);
-      SH_MUTEX_UNLOCK(mutex_thread_nolog);
+		      (long) sh.real.uid, mode_path[mode]);
       SL_RET0(_("sh_utmp_check_internal"));
     }
 
-  /* check modification time
+  /* modification time
    */
-  if (/*@-usedef@*/buf.st_mtime <= lastmod/*@+usedef@*/)
+  if (mode < 2)
+    {
+      if (/*@-usedef@*/buf.st_mtime <= lastmod/*@+usedef@*/)
+	{ 
+	  SL_RET0(_("sh_utmp_check_internal"));
+	}
+      else
+	lastmod = buf.st_mtime;
+    }
+
+  /* file size
+   */
+  if (/*@-usedef@*/buf.st_size < lastsize/*@+usedef@*/ && mode < 2) 
     { 
-      SL_RET0(_("sh_utmp_check_internal"));
-    }
-  else
-    lastmod = buf.st_mtime;
-
-  sh_utmp_utmpname(utmp_path);
+      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_UT_ROT,
+		      mode_path[mode]);
+      lastread = 0;
+#ifndef USE_SETUTENT
+      sh_utmp_feed_forward = 0L;
+#endif
+    }
+
+  if (mode < 2)
+    lastsize = buf.st_size;
+
+  if (buf.st_size == 0) 
+    SL_RET0(_("sh_utmp_check_internal"));
+
+  sh_utmp_utmpname(mode_path[mode]);
   sh_utmp_setutent();
+
+  /* 
+   * feed forward if initializing
+   * we need to do this here
+   */
+  if (mode < 2)
+    {
+      while (this_read < lastread) {
+	ut = sh_utmp_getutent();
+	++this_read;
+      }
+    }
 
   /* start reading
    */
-  start_read = time(NULL);
-  
+  this_read = 0;
   while (1 == 1) {
     ut = sh_utmp_getutent();
@@ -1063,24 +1057,38 @@
       break;
     /* modified: ut_user --> ut_name */
-    if (ut->ut_name[0] != '\0'
+    if (mode == 1 || (mode == 2 && ut->ut_name[0] != '\0'
 #ifdef HAVE_UTTYPE
-	&& ut->ut_type == USER_PROCESS
-#endif
-	)
-      sh_utmp_checklogin (ut, start_read);
+		      && ut->ut_type != DEAD_PROCESS
+#endif
+		      ))
+      sh_utmp_addlogin (ut);
+    /*************************************************
+    printf("%8s | %10s | %10s | %3d %5d | %16s | %ld\n", 
+	   ut->ut_name, ut->ut_id, ut->ut_line, 
+	   (int) ut->ut_type, (int) ut->ut_pid, 
+	   ut->ut_host, ut->ut_time);
+    ***************************************************/
+    ++this_read;
   }
 
   sh_utmp_endutent();
 
-  sh_utmp_purge_old (start_read);
+  if (mode < 2)
+    {
+      lastread += this_read;
+#ifndef USE_SETUTENT
+      sh_utmp_feed_forward += (long) (this_read * sizeof(struct SH_UTMP_S));
+      lastread = 0;
+#endif
+    }
 
   SL_RET0(_("sh_utmp_check_internal"));
 }
 
-extern void sh_ltrack_check(struct SH_UTMP_S * ut);
 
 static void sh_utmp_login_morechecks(struct SH_UTMP_S * ut)
 {
-  sh_ltrack_check(ut);
+  if (ut)
+    return;
   return;
 }
@@ -1088,5 +1096,6 @@
 static void sh_utmp_logout_morechecks(struct log_user * user)
 {
-  (void) user;
+  if (user)
+    return;
   return;
 }
Index: trunk/src/sh_xfer_client.c
===================================================================
--- trunk/src/sh_xfer_client.c	(revision 591)
+++ 	(revision )
@@ -1,1632 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2000, 2015 Rainer Wichmann                          */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-
-/* Must be early on FreeBSD
- */
-#include <sys/types.h>
-
-/* must be .le. than (1020 * 64)
- * (see sh_tools.c -- put_header)
- *
- * also: must be  (N * 16), otherwise
- * binary files cannot be transferred encrypted
- *
- * 65280 = (1020*64)
- * #define TRANS_BYTES 8000  V0.8
- */
-#ifdef  SH_ENCRYPT
-#define TRANS_BYTES 65120
-#else
-#define TRANS_BYTES 65280
-#endif
-
-/* timeout for session key
- */
-#define TIMEOUT_KEY 7200
-
-/* max time between connection attempts
- */
-#define TIMEOUT_CON 2048 
-
-/* #undef  SRP_DEBUG */
-/* #define SRP_DEBUG */
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-#ifdef  HAVE_UNISTD_H
-#include <errno.h>
-#include <signal.h>
-#include <setjmp.h>
-#include <pwd.h>
-#include <grp.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#endif
-
-#ifndef FD_SET
-#define NFDBITS         32
-#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
-#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
-#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#endif /* !FD_SET */
-#ifndef FD_SETSIZE
-#define FD_SETSIZE      32
-#endif
-#ifndef FD_ZERO
-#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
-#endif
-
-#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-#include <sys/mman.h>
-#endif
-
-
-#include <netdb.h> 
-#include <sys/types.h> 
-#include <netinet/in.h> 
-#include <sys/socket.h> 
-#ifndef S_SPLINT_S
-#include <arpa/inet.h>
-#endif
-
-#include "sh_ipvx.h"
-#include "samhain.h"
-#include "sh_tiger.h"
-#include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_xfer.h"
-#include "sh_srp.h"
-#include "sh_fifo.h"
-#include "sh_tools.h"
-#include "sh_entropy.h"
-#include "sh_html.h"
-#include "sh_nmail.h"
-#include "sh_socket.h"
-#define SH_NEED_GETHOSTBYXXX
-#include "sh_static.h"
-
-#ifdef SH_ENCRYPT
-#include "rijndael-api-fst.h"
-char * sh_tools_makePack (unsigned char * header, int flag,
-			  char * payload, unsigned long payload_size,
-			  keyInstance * keyInstE);
-char * sh_tools_revertPack (unsigned char * header, int flag, char * message,
-			    keyInstance * keyInstE, 
-			    unsigned long message_size);
-#endif
-
-/* define this if you want to debug the client/server communication */
-/* #define SH_DBG_PROT 1 */
-
-#ifdef  SH_DBG_PROT
-#define SH_SHOWPROT(c,d) sh_tools_show_header((c), (d))
-#else
-#define SH_SHOWPROT(c,d) 
-#endif
-
-/* the port client will be connecting to 
- */
-#ifndef SH_DEFAULT_PORT
-#define SH_DEFAULT_PORT 49777    
-#endif
-
-#ifndef SH_SELECT_REPEAT
-#define SH_SELECT_REPEAT 60
-#endif
-
-#ifndef SH_HEADER_SIZE
-#define SH_HEADER_SIZE 7
-#endif
-
-#ifndef SH_CHALLENGE_SIZE
-#define SH_CHALLENGE_SIZE 9
-#endif
-
-#undef  FIL__
-#define FIL__  _("sh_xfer_client.c")
-
-extern int flag_err_debug;
-extern int flag_err_info;
-
-#ifndef SH_STANDALONE
-
-#if defined(WITH_TRACE) || defined(WITH_TPT) 
-char * hu_trans(const char * ihu)
-{
-  static char ohu[17];
-  sprintf(ohu, _("%c%03o"), '\\',                   /* known to fit  */
-	  (unsigned char) ihu[0]);
-  sprintf(&(ohu[4]), _("%c%03o"), '\\',             /* known to fit  */
-	  (unsigned char) ihu[1]);
-  sprintf(&(ohu[8]), _("%c%03o"), '\\',             /* known to fit  */
-	  (unsigned char) ihu[2]);
-  sprintf(&(ohu[12]), _("%c%03o"), '\\',            /* known to fit  */
-	  (unsigned char) ihu[3]);
-  ohu[16] = '\0';
-  return ohu;
-}
-#endif
-/* #ifndef SH_STANDALONE */
-#endif
-
-#if !defined(USE_SRP_PROTOCOL)
-void sh_passwd (char * salt, char * password, char * nounce, char *hash)
-{
-
-  char           *combi;
-  size_t          len;
-  unsigned char * tmp = NULL;
-  char hashbuf[KEYBUF_SIZE];
-
-  if (password == NULL)
-    {
-      tmp = (unsigned char *) &(skey->pw[0]);
-      memcpy(skey->vernam, tmp, PW_LEN);
-      sl_strlcpy (skey->vernam,
-		  sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN,
-				hashbuf, sizeof(hashbuf)), 
-		  KEY_LEN+1);
-    }
-  else if (sl_strlen(password) < PW_LEN)
-    {
-      fprintf(stderr, _("Password has less than %d chars !\n"),
-		   PW_LEN);
-      _exit(EXIT_FAILURE);
-    }
-  else
-    {
-      sl_strlcpy (skey->vernam, password, KEY_LEN+1);
-    }
-
-  len = sl_strlen(salt) + 1;
-  if (sl_ok_adds(len, sl_strlen(skey->vernam)))
-    len += sl_strlen(skey->vernam);
-  if (nounce != NULL && sl_ok_adds(len, sl_strlen(nounce))) 
-    len += sl_strlen(nounce);
-  
-  /* H(s,P)
-   */
-  combi = SH_ALLOC(len);
-  (void) sl_strlcpy (combi, salt, len);
-  (void) sl_strlcat (combi, skey->vernam, len);
-  if (nounce != NULL)
-    (void) sl_strlcat (combi, nounce, len);
-  (void) sl_strlcpy (hash, 
-		     sh_tiger_hash(combi, TIGER_DATA, 
-				   (unsigned long) sl_strlen(combi),
-				   hashbuf, sizeof(hashbuf)),
-		     KEY_LEN+1);
-  SH_FREE (combi);
-  hash[KEY_LEN] = '\0';
-  return;
-}
-#endif
-
-#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
-
-/* Server addresses in use
- */
-static int count_dev_server = 0;
-
-void reset_count_dev_server(void)
-{
-  count_dev_server = 0;
-  return;
-}
-
-int sh_xfer_set_logserver (const char * address)
-{
-  SL_ENTER(_("sh_xfer_set_logserver"));
-
-  if (address != NULL && count_dev_server < 2 
-      && sl_strlen(address) < SH_PATHBUF && sl_strlen(address) > 0) 
-    {
-      if (count_dev_server == 0)
-	(void) sl_strlcpy (sh.srvexport.name, address, SH_PATHBUF);
-      else
-	(void) sl_strlcpy (sh.srvexport.alt,  address, SH_PATHBUF);
-
-      ++count_dev_server;
-      SL_RETURN (0, _("sh_xfer_set_logserver"));
-    }
-  SL_RETURN (-1, _("sh_xfer_set_logserver"));
-}
-
-static
-int xfer_send_intern (int mysocket, const int protocol, char * micro, 
-		      char * msgbuf, unsigned long length, int docrypt)
-{
-  unsigned long           numbytes, countbytes;
-  int                     flag_err = 0;
-  unsigned char           head[SH_HEADER_SIZE];
-  char                  * outbuf;
-#ifdef SH_ENCRYPT
-  char                  * msg2buf = NULL;
-#else
-  (void) docrypt;
-#endif
-
-  SL_ENTER(_("xfer_send_intern"));
-
-#ifdef SH_ENCRYPT
-  if  ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != 0))
-    {
-      put_header (head, protocol, &length, micro);
-      msg2buf  = sh_tools_makePack (head, 0, msgbuf, length, 
-				    &(skey->keyInstE));
-      length   = (unsigned long) (256 * (unsigned int)head[1] + 
-				  (unsigned int)head[2]);
-      outbuf   = msg2buf;
-    }
-  else
-    {
-      outbuf = msgbuf;
-      put_header (head, protocol, &length, micro);
-    }
-#else
-  outbuf = msgbuf;
-  put_header (head, protocol, &length, micro);
-#endif
-
-  SH_SHOWPROT(head,'>');
-  
-  numbytes     = SH_HEADER_SIZE;
-  countbytes   = write_port (mysocket, (char *)head, numbytes, &flag_err, 300);
-
-  if (countbytes == numbytes && outbuf != NULL)
-    {
-      numbytes     = length;
-      countbytes   = write_port (mysocket, outbuf, numbytes, &flag_err, 300);
-    }
-
-#ifdef SH_ENCRYPT
-  if (msg2buf != NULL)
-    SH_FREE(msg2buf);
-#endif
-
-  if (countbytes == numbytes)
-    SL_RETURN( 0, _("xfer_send_intern"));
-  else
-    SL_RETURN( flag_err, _("xfer_send_intern"));
-}
-
-static
-int xfer_send (int mysocket, const int protocol, char * micro, 
-		     char * msgbuf, unsigned long length)
-{
-  int i;
-  SL_ENTER(_("xfer_send"));
-  TPT(( 0, FIL__, __LINE__, _("msg=<Send.>\n")));
-  i =  xfer_send_intern (mysocket, protocol, micro, 
-			       msgbuf, length, S_FALSE);
-  SL_RETURN(i, _("xfer_send"));
-}
-static
-int xfer_send_crypt (int mysocket, const int protocol, char * micro, 
-			   char * msgbuf, unsigned long length)
-{
-  int i;
-  SL_ENTER(_("xfer_send_crypt"));
-#ifdef SH_ENCRYPT
-  TPT(( 0, FIL__, __LINE__, _("msg=<Send encrypted.>\n")));
-#else
-  TPT(( 0, FIL__, __LINE__, _("msg=<Send.>\n")));
-#endif
-  i = xfer_send_intern (mysocket, protocol, micro, 
-			      msgbuf, length, S_TRUE);
-  SL_RETURN(i, _("xfer_send_crypt"));
-}
-
-
-/* receive answer, add a trailing NULL to terminate string
- * decrypt answer
- */
-static
-long xfer_receive_intern (int mysocket, const int protocol, char * micro,     
-			  char *  msgbuf, unsigned long length, 
-			  int docrypt)
-{
-  unsigned long numbytes, countbytes;
-  int           flag_err = -1;
-  unsigned char head[SH_HEADER_SIZE];
-#ifndef SH_ENCRYPT
-  (void) docrypt;
-#endif
-
-  SL_ENTER(_("xfer_receive_intern"));
-
-#ifdef SH_ENCRYPT
-  /* make sure length is not multiple of B_SIZ, see below 
-   */
-  ASSERT_RET((length % B_SIZ != 0), _("length % 16 != 0"), flag_err);
-#endif
-
-  if (micro != NULL)
-    micro[4]     = '\0';
-  if (msgbuf != NULL)
-    msgbuf[0]     = '\0';
-
-  numbytes     = SH_HEADER_SIZE;
-  countbytes   = read_port (mysocket, (char *)head, numbytes, &flag_err, 300);
-
-  if (countbytes != numbytes)
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<countbytes != numbytes>\n")));
-      SL_RETURN(flag_err, _("xfer_receive_intern"));
-    }
-  else if (msgbuf == NULL)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      _("msgbuf is NULL"), _("xfer_receive_intern"));
-      SL_RETURN((-1), _("xfer_receive_intern"));
-    }
-  else if (head[0] != protocol && (head[0] & SH_PROTO_SRP) == 0)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISMATCH);
-      SL_RETURN((-1), _("xfer_receive_intern"));
-    }
-  else
-    {
-      get_header (head, &numbytes, micro);
-      SH_SHOWPROT(head, '<');
-
-      if (numbytes > 0)
-	{
-	  numbytes = (numbytes > length ? length : numbytes);
-
-	  countbytes = read_port (mysocket, msgbuf, numbytes, &flag_err, 300);
-
-	  if (countbytes < length)
-	    msgbuf[countbytes] = '\0';
-	  else
-	    msgbuf[length-1] = '\0';
-
-	  if (flag_err != 0)
-	    {
-	      TPT(( 0, FIL__, __LINE__, _("msg=<read error>\n")));
-	      SL_RETURN((-1), _("xfer_receive_intern"));
-	    }
-	}
-    }
-
-#ifdef SH_ENCRYPT
-  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != 0))
-    {
-      unsigned long head_length;
-      char * tmp = SH_ALLOC((size_t)length);
-
-      memcpy(tmp, msgbuf, (size_t)length);
-      tmp = sh_tools_revertPack (head, 0, tmp, &(skey->keyInstD), countbytes);
-
-      head_length = (unsigned long) (256 * (unsigned int)head[1] + 
-				     (unsigned int)head[2]);
-
-      /* 
-       * revertPack returns header with length <= (original_length-16), so
-       * the following msgbuf[length] = '\0' is always safe.
-       * Nevertheless, check for proper length.
-       */
-      if (head_length <= (length-1))
-	length      = head_length;
-      else
-	--length;
-
-      memcpy(msgbuf, tmp, (size_t)length);
-      msgbuf[length] = '\0';
-      SH_FREE(tmp);
-      if (countbytes == numbytes) 
-	countbytes = length; /* to avoid error on return, see below */
-      numbytes = length;
-    }
-#endif
-
-  if (countbytes == numbytes)
-    SL_RETURN(((long)numbytes), _("xfer_receive_intern"));
-  else
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<short read>\n")));
-      SL_RETURN(flag_err, _("xfer_receive_intern"));
-    }
-}
-
-static
-long xfer_receive (int mysocket, const int protocol, char * micro,     
-		   char * msgbuf, unsigned long length)
-{
-  long i;
-  SL_ENTER(_("xfer_receive"));
-  TPT(( 0, FIL__, __LINE__, _("msg=<Receive.>\n")));
-  i = xfer_receive_intern (mysocket, protocol, micro, 
-			   msgbuf, length, S_FALSE);
-  SL_RETURN(i, _("xfer_receive"));
-}
-
-static
-long xfer_receive_crypt (int mysocket, const int protocol, char * micro,     
-			 char * msgbuf, unsigned long length)
-{
-  long i;
-  SL_ENTER(_("xfer_receive_crypt"));
-#ifdef SH_ENCRYPT
-  TPT(( 0, FIL__, __LINE__, _("msg=<Receive encrypted.>\n")));
-#else
-  TPT(( 0, FIL__, __LINE__, _("msg=<Receive.>\n")));
-#endif
-  i = xfer_receive_intern (mysocket, protocol, micro, 
-			   msgbuf, length, S_TRUE);
-  SL_RETURN(i, _("xfer_receive_crypt"));
-}
-
-/**************************************************
- *
- *
- *  C L I E N T  
- *
- *
- ***************************************************/
-
-
-#include <time.h>
-
-static SH_FIFO * fifo = NULL;
-
-static long xfer_try_report (char * errmsg);
-
-unsigned int ServerPort = SH_DEFAULT_PORT;
-
-int sh_xfer_server_port (const char * str)
-{
-  unsigned long l;
-  char * endptr;
-
-  SL_ENTER(_("sh_xfer_server_port"));
-
-  l = strtoul (str, &endptr, 0);
-  if (l > 65535 || endptr == str)
-    {
-      SL_RETURN (-1, _("sh_xfer_server_port"));
-    }
-  ServerPort = (unsigned int) l;
-  SL_RETURN (0, _("sh_xfer_server_port"));
-}
-
-long sh_xfer_report (char * errmsg)
-{
-  static int have_server = S_TRUE;
-  long   status;
-  char * popmsg;
-  static int nofail = S_TRUE;
-
-  SL_ENTER(_("sh_xfer_report"));
-
-  /* --- No log server available. ---
-   */
-  if (have_server == S_TRUE && sh.srvexport.name[0] == '\0')
-    {
-      have_server = S_FALSE;
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NONAME);
-      SL_RETURN (-1, _("sh_xfer_report"));
-    }
-  else if (have_server == BAD)
-    {
-      SL_RETURN (-1, _("sh_xfer_report"));
-    }
-
-  /* --- Allocate fifo. ---
-   */
-  if (fifo == NULL)
-    {
-      fifo = SH_ALLOC(sizeof(SH_FIFO));
-      fifo_init(fifo);
-    }
-
-  /* --- Check for messages on the queue, and send them first. ---
-   */
-  while (NULL != (popmsg = pop_list(fifo)) )
-    {
-      status = xfer_try_report (popmsg);
-      if (status != 0)
-	{
-	  (void) push_tail_list (fifo, popmsg, 0, NULL); 
-	  SH_FREE(popmsg);
-	  if (SH_FIFO_MAX == push_list (fifo, errmsg, 0,NULL))
-	    SL_RETURN (-2, _("sh_xfer_report"));
-	  SL_RETURN (-1, _("sh_xfer_report"));
-	}
-      SH_FREE(popmsg);
-    }
-
-  /* --- Now send the error message. ---
-   */ 
-  status = xfer_try_report (errmsg);
-  if (status != 0)
-    {
-      if (nofail == S_TRUE)
-	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_SRV_FAIL,
-			 _("log server"), sh.srvexport.name);
-      nofail = S_FALSE;
-      if (SH_FIFO_MAX == push_list (fifo, errmsg, 0, NULL))
-	SL_RETURN (-2, _("sh_xfer_report"));
-      SL_RETURN (-1, _("sh_xfer_report"));
-    }
-
-  nofail = S_TRUE;
-  SL_RETURN (0, _("sh_xfer_report"));  
-}
-
-static long xfer_try_report_int (char * errmsg, const int what);
-
-static long xfer_try_report (char * errmsg)
-{
-  long i;
-  SL_ENTER(_("xfer_try_report"));
-  i = xfer_try_report_int (errmsg, SH_PROTO_MSG);
-  SL_RETURN(i, _("xfer_try_report")); 
-}
-
-long sh_xfer_request_file (const char * file)
-{
-  long i;
-  char tmp_file[64];
-  SL_ENTER(_("sh_xfer_request_file"));
-  sl_strlcpy(tmp_file, file, sizeof(tmp_file));
-  i = xfer_try_report_int (tmp_file, SH_PROTO_BIG);
-  SL_RETURN(i, _("sh_xfer_request_file")); 
-}
-
-static unsigned long sh_throttle_delay = 0;
-
-int sh_xfer_set_throttle_delay (const char * c)
-{
-  long val;
-
-  SL_ENTER(_("sh_xfer_set_throttle_delay"));
-  val = strtol (c, (char **)NULL, 10);
-  if (val < 0)
-    SL_RETURN( (-1), _("sh_xfer_set_throttle_delay"));
-
-  val = (val > 1000) ? 1000 : val;
-
-  sh_throttle_delay = (unsigned long) val;
-  SL_RETURN( (0), _("sh_xfer_set_throttle_delay"));
-}
-
-static time_t xfer_timeout_val =  1;
-
-static int xfer_conn_state(int initialized, int conn_state)
-{
-  static time_t time_now  = 1200;
-  static time_t time_last =    0;
-
-  if (initialized == S_FALSE || conn_state == S_FALSE)
-    {
-      xfer_timeout_val = 
-	((xfer_timeout_val > TIMEOUT_CON) ? TIMEOUT_CON : xfer_timeout_val);
-
-      /* --- Retry bad attempt only after some time. ---
-       */
-      time_now  = time (NULL);
-      if ((time_now - time_last) < xfer_timeout_val) 
-	{
-	  TPT(( 0, FIL__, __LINE__, _("msg=<Within deadtime, no retry.>\n")));
-	  return -1;
-	}
-      TPT(( 0, FIL__, __LINE__, _("msg=<Retry.>\n")));
-    }
-  time_last  = time (NULL);
-  return 0;
-}
-
-static int xfer_connect(int * conn_state)
-{
-  char         error_msg[256];
-  char         error_call[SH_MINIBUF] = { 0 };
-  int          error_num = 0;
-
-  int sockfd = connect_port_2 (sh.srvexport.name, sh.srvexport.alt, ServerPort, 
-			       error_call, &error_num, error_msg, 256);
-
-  if (sockfd < 3)
-    {
-      *conn_state = S_FALSE;
-      xfer_timeout_val *= 2;
-      sh_error_handle ((-1), FIL__, __LINE__, error_num, 
-		       MSG_E_NET, error_msg, error_call,
-		       _("export"), sh.srvexport.name);
-      return -1;
-    }
-
-  *conn_state = S_TRUE;
-  return sockfd;
-}
-
-int xfer_greet_server(int sockfd, char * answer)
-{
-  int    flag_err;
-  char   head_u[5];
-  int    theProto = SH_PROTO_SRP;
-  
-  TPT(( 0, FIL__, __LINE__, _("msg=<c/r: entry>\n")));
-  
-  sl_strlcpy (answer, sh.host.name, 512);
-      
-  flag_err = xfer_send (sockfd, theProto, _("SALT"), 
-			answer,  (unsigned long)sl_strlen(answer));
-      
-  TPT(( 0, FIL__, __LINE__, _("msg=<c/r: sent SALT, flag_err = %d>\n"), 
-	flag_err));
-      
-  /* get nonce from server
-   */
-  if (flag_err == 0)
-    {
-      flag_err = xfer_receive (sockfd, (char)theProto, head_u, 
-				   answer,  511);
-      flag_err = (flag_err < 0) ? flag_err : 0;
-      TPT(( 0, FIL__, __LINE__, 
-	    _("msg=<c/r: rcvt nonce, flag_err = %d>\n"), 
-	    flag_err));
-    }
-  
-  if ( 0 != check_request (head_u, _("INIT")) )
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<srp: u = %03o-%03o-%03o-%03o>\n"), head_u[0], head_u[1], head_u[2], head_u[3]));
-      flag_err = -1;
-    }
-  return flag_err;
-}
-  
-
-#if !defined(USE_SRP_PROTOCOL)
-
-static int xfer_auth(int is_reinit, int * initialized, 
-		     int sockfd, char * answer)
-{
-  /**************************************************
-   *
-   * --- challenge/response authentication ---
-   *
-   **************************************************/
-
-  int                  flag_err = 0;
-  int                  theProto = 0;
-  char   nounce[KEY_LEN+1];
-  char   temp[2*KEY_LEN+1];
-  char   nonce_u[KEY_LEN+1];
-  UINT32 ticks;
-
-  char   head_u[5];
-  char   foo_M1[KEY_LEN+1];
-  char   hashbuf[KEYBUF_SIZE];
-#ifdef SH_ENCRYPT
-  int err_num;
-  char expbuf[SH_ERRBUF_SIZE];
-#endif
-
-  SL_REQUIRE((sockfd > 2), _("sockfd > 2"));
-
-  if (is_reinit == S_FALSE)
-    flag_err = xfer_greet_server(sockfd, answer);
-  else
-    sh_tools_probe_reset();
-
-  /* entry point for jump from message forward if session key must
-   * be re-initialized
-   */	 
-
-  if ( flag_err == 0 && sl_strlen(answer) >  KEY_LEN )
-    (void) sl_strlcpy(nounce, &answer[KEY_LEN], KEY_LEN+1);
-  else
-    flag_err = (-1);
-  
-  TPT(( 0, FIL__, __LINE__, _("msg=<c/r: rcvt INIT, flag_err = %d>\n"), 
-	flag_err));
-  
-  /* verify random nonce v from server H(v, P)v
-   */
-  sh_passwd (nounce, NULL, NULL, temp);
-  if ( 0 != sl_ts_strncmp(temp, answer, KEY_LEN))
-    flag_err = (-1);
-  
-  TPT(( 0, FIL__, __LINE__, _("msg=<c/r: vrfy nonce, flag_err = %d>\n"), 
-	flag_err));
-  
-  
-  /* --- Create own nonce. ---
-   */
-  ticks = (UINT32) taus_get ();
-  
-  (void) sl_strlcpy(nonce_u, 
-		    sh_tiger_hash((char *) &ticks, 
-				  TIGER_DATA, 
-				  (unsigned long)sizeof(UINT32), 
-				  hashbuf, sizeof(hashbuf)),
-		    KEY_LEN+1);
-  
-  /* --- Form the message H(H(u,v),P)u ---
-   */
-  (void) sl_strlcpy(temp, nonce_u, 2*KEY_LEN+1); 
-  (void) sl_strlcat(temp,  nounce, 2*KEY_LEN+1); 
-  (void) sl_strlcpy(temp, 
-		    sh_tiger_hash(temp, 
-				  TIGER_DATA, 
-				  (unsigned long)sl_strlen(temp), 
-				  hashbuf, sizeof(hashbuf)),
-		    KEY_LEN+1);
-  sh_passwd (temp, NULL, NULL, foo_M1);
-  (void) sl_strlcpy(temp, foo_M1, 2*KEY_LEN+1);
-  (void) sl_strlcat(temp, nonce_u, 2*KEY_LEN+1);
-  
-  /* --- Send it to server. ---
-   */
-  if (flag_err == 0)
-    {
-      flag_err = xfer_send (sockfd, 
-			    (theProto|SH_PROTO_SRP), 
-			    _("PASS"), temp, 
-			    (unsigned long)sl_strlen(temp));
-      TPT(( 0, FIL__, __LINE__, _("msg=<c/r: sent PASS, flag_err = %d>\n"),
-	    flag_err));
-    }
-  
-  if (flag_err == 0)
-    {
-      flag_err = xfer_receive (sockfd,
-			       (theProto|SH_PROTO_SRP), 
-			       head_u, answer,  511);  
-      sh_passwd (nounce, NULL, nonce_u, foo_M1);
-      (void) sl_strlcpy (skey->session, foo_M1, KEY_LEN+1);
-#ifdef SH_ENCRYPT
-      err_num = rijndael_makeKey(&(skey->keyInstE), 
-				 (BYTE)DIR_ENCRYPT, 192, skey->session);
-      if (err_num < 0)
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("xfer_try_report_int: makeKey"));
-      
-      err_num = rijndael_makeKey(&(skey->keyInstD), 
-				 (BYTE)DIR_DECRYPT, 192, skey->session);
-      if (err_num < 0)
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("xfer_try_report_int: make_key"));
-#endif
-      *initialized = S_TRUE;
-    }
-  
-  if (*initialized == S_FALSE)
-    {
-      xfer_timeout_val *= 2;
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOAUTH);
-      memset(answer, 0, 512);
-      MUNLOCK(answer, 512);
-      SH_FREE(answer);
-      return -1;
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_AUTH);
-    }
-  return 0;
-}    
-#else
-
-static void noise()
-{
-  UINT32 n = taus_get();
-  retry_msleep(0, (n & 0x0000007F));
-  return;
-}
-  
-
-static int xfer_auth(int is_reinit, int * initialized, 
-		     int sockfd, char * answer)
-{
-  /* This is the SRP authenticated key exchange protocol.
-   * Produces a session key skey->session.
-   */
-  
-  int                  flag_err = 0;
-  int                  theProto = 0;
-
-  char   head_u[5];
-  char   u_real[SH_CHALLENGE_SIZE];
-  char * foo_A;
-  char * foo_Sc;
-  char * M;
-  char   foo_M1[KEY_LEN+1];
-  char   hashbuf[KEYBUF_SIZE];
-#ifdef SH_ENCRYPT
-  int err_num;
-  char expbuf[SH_ERRBUF_SIZE];
-#endif
-
-  SL_REQUIRE((sockfd > 2), _("sockfd > 2"));
-
-  if (is_reinit == S_FALSE)
-    flag_err = xfer_greet_server(sockfd, answer);
-  else
-    sh_tools_probe_reset();
-
-  /* Entry point for jump from message forward if session key must
-   * be re-initialized.
-   */	 
-  TPT(( 0, FIL__, __LINE__, _("msg=<srp: INIT>\n")));
-  
-  if ( flag_err == 0 )
-    {
-      if (0 != sh_srp_init())
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_EBGN);
-      else 
-	{
-	  TPT(( 0, FIL__, __LINE__, _("msg=<srp: bignum initialized>\n")));
-
-	  sh_srp_x (answer, NULL);  /* x        password      */
-	  sh_srp_make_a ();         /* a        random number */
-	  foo_A = sh_srp_A();       /* g^a                    */
-
-	  TPT(( 0, FIL__, __LINE__, _("msg=<srp: A = %s>\n"), foo_A));
-
-	  if (foo_A == NULL)
-	    flag_err = (-1);
-
-	  noise();
-
-	  if (flag_err == 0)
-	    flag_err = xfer_send (sockfd, 
-				  (theProto|SH_PROTO_SRP), 
-				  _("PC01"),
-				  foo_A, sl_strlen(foo_A)+1); 
-	  if (flag_err == 0)
-	    {
-	      flag_err = xfer_receive (sockfd, 
-				       (theProto|SH_PROTO_SRP),
-				       head_u,
-				       answer, 511);
-	      flag_err = (flag_err < 0) ? flag_err : 0;
-	      TPT(( 0, FIL__, __LINE__, _("msg=<srp: B = %s>\n"), answer));
-	      TPT(( 0, FIL__, __LINE__, _("msg=<srp: u = %03o-%03o-%03o-%03o>\n"), head_u[0], head_u[1], head_u[2], head_u[3]));
-	    }
-
-	  /*                     u        nounce        */
-	  /*                     B        answer        */
-	  /*                     S = (B-g^x)^(a+ux)     */
-	  
-    
-	  if (flag_err == 0)
-	    { 
-	      noise();
-
-	      if (0 != sh_srp_check_zero (answer))
-		sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_EZERO);
-	      else 
-		{
-		  sl_strlcpy(u_real, sh_tiger_hash(head_u, TIGER_DATA, 4, 
-						   hashbuf, sizeof(hashbuf)), 
-			     SH_CHALLENGE_SIZE);
-		  foo_Sc = sh_srp_S_c (u_real, answer);
-		  
-		  TPT(( 0, FIL__, __LINE__, _("msg=<srp: U = %s>\n"), 
-			u_real));
-		  TPT(( 0, FIL__, __LINE__, _("msg=<srp:Sc = %s>\n"), 
-			foo_Sc));
-		  
-		  /* --- Now send H(A,B,H(Sc)) and check. --- 
-		   */
-		  if (foo_Sc != NULL && 0 == sh_srp_check_zero (foo_Sc))
-		    {
-		      sh_srp_M(foo_A, 
-			       answer, 
-			       sh_tiger_hash(foo_Sc, 
-					     TIGER_DATA, 
-					     sl_strlen(foo_Sc), 
-					     hashbuf, sizeof(hashbuf)),
-			       foo_M1, KEY_LEN+1);
-		      
-		      
-		      TPT(( 0, FIL__, __LINE__, _("msg=<srp:M1 = %s>\n"), 
-			    foo_M1));
-		      
-		      flag_err = xfer_send(sockfd, 
-					   (theProto|SH_PROTO_SRP), 
-					   _("PC02"),
-					   foo_M1, KEY_LEN+1);
-		    }
-		  else
-		    flag_err = (-1);
-		  
-		  if (flag_err == 0)
-		    {
-		      flag_err = xfer_receive(sockfd, 
-					      (theProto|SH_PROTO_SRP),
-					      head_u, 
-					      answer, 511);
-		      flag_err = (flag_err < 0) ? flag_err : 0;
-		      TPT(( 0, FIL__, __LINE__, _("msg=<srp: M = %s>\n"), 
-			    answer));
-		    }
-		  
-		  if (flag_err == 0   && 0 == check_request (head_u, _("PARP")) )
-		    {
-		      /* ------  verify M2 = H(A, M1, K) --------
-		       */
-		      char M_buf[KEY_LEN+1];
-		      M = sh_srp_M (foo_A, foo_M1,
-				    sh_tiger_hash(foo_Sc,
-						  TIGER_DATA,
-						  sl_strlen(foo_Sc), 
-						  hashbuf, sizeof(hashbuf)),
-				    M_buf, sizeof(M_buf)
-				    );
-		      if (M != NULL && 
-			  0 == sl_ts_strncmp (answer, M, KEY_LEN+1))
-			{
-			  sl_strlcpy (skey->session, 
-				      sh_tiger_hash(foo_Sc, 
-						    TIGER_DATA,
-						    sl_strlen(foo_Sc), 
-						    hashbuf, sizeof(hashbuf)),
-				      KEY_LEN+1);
-			  TPT(( 0, FIL__, __LINE__, 
-				_("msg=<srp: Key = %s>\n"), 
-				skey->session));
-
-#ifdef SH_ENCRYPT
-			  err_num = rijndael_makeKey(&(skey->keyInstE), 
-						     DIR_ENCRYPT, 
-						     192, skey->session);
-			  if (err_num < 0)
-			    sh_error_handle((-1), FIL__, __LINE__, -1, 
-					    MSG_E_SUBGEN,
-					    errorExplain(err_num, expbuf, sizeof(expbuf)), 
-					    _("xfer_try_report_int: makeKey"));
-			  err_num = rijndael_makeKey(&(skey->keyInstD), 
-						     DIR_DECRYPT, 
-						     192, skey->session);
-			  if (err_num < 0)
-			    sh_error_handle((-1), FIL__, __LINE__, -1, 
-					    MSG_E_SUBGEN,
-					    errorExplain(err_num, expbuf, sizeof(expbuf)), 
-					    _("xfer_try_report_int: makeKey"));
-#endif
-			  *initialized = S_TRUE;
-			  noise();
-			}
-		    }
-		  if (foo_Sc != NULL)
-		    SH_FREE(foo_Sc);
-		}
-	    }
-	  if (foo_A != NULL)
-	    SH_FREE(foo_A);
-	  sh_srp_exit();
-	}
-    }
-
-  if (*initialized == S_FALSE)
-    {
-      xfer_timeout_val *= 2;
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOAUTH);
-      memset(answer, 0, 512);
-      MUNLOCK(answer, 512);
-      SH_FREE(answer);
-      return -1;
-    }
-  else
-    {
-      if (flag_err_info == S_TRUE)
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_AUTH);
-    }
-  return 0;
-}
-#endif
-
-int xfer_check_server_cmd(char * answer, char * buffer)
-{
-  int    flag_err;
-  size_t pos;
-  char   sigbuf[KEYBUF_SIZE];
-
-  /* --- SERVER CMD --- */
-  if (answer[KEY_LEN] != '\0' && 
-      sl_strlen(answer) > (2*KEY_LEN))
-    {
-      pos = sl_strlen(answer) - (2*KEY_LEN);
-      /*
-       * buffer is  >= 256
-       * answer has <= 255 bytes
-       */
-      (void) sl_strlcpy(buffer, &answer[KEY_LEN], 
-			pos+1);
-      flag_err = 
-	sl_ts_strncmp(&answer[KEY_LEN+pos],
-		   sh_util_siggen(skey->session, 
-				  buffer,
-				  pos,
-				  sigbuf, sizeof(sigbuf)),
-		   KEY_LEN);
-      
-      TPT((0, FIL__, __LINE__, 
-	   _("CONF RECV <%d> <%s>\n"),
-	   flag_err, &answer[KEY_LEN]));
-      
-      if (flag_err != 0) {
-	sh_error_handle((-1), FIL__, __LINE__, 
-			flag_err,
-			MSG_TCP_NOCONF);
-      } 
-#ifdef SH_WITH_CLIENT
-      else {
-	sh_socket_server_cmd(buffer);
-      }
-#endif
-      flag_err = 0;
-      
-    } else {
-    
-    TPT((0, FIL__, __LINE__, 
-	 _("CONF RECV <0> <[null]>\n")));
-    
-  }
-  /* --- SERVER CMD END --- */
-  return 0;
-}
-
-
-
-int xfer_send_message(char * errmsg, int sockfd, char * answer)
-{
-  char   hash[KEY_LEN+1];
-  size_t len;
-  char * buffer;
-  char   nsrv[KEY_LEN+1];
-  char   sigbuf[KEYBUF_SIZE];
-  char   head_u[5];
-  int    flag_err;
-
-  SL_REQUIRE((sockfd > 2), _("sockfd > 2"));
-
-  /* --- Save the challenge. ---  
-   */
-  (void) sl_strlcpy(nsrv, answer, KEY_LEN + 1);
-  
-  /* --- Hash(msg,challenge,sessionkey). ---  
-   */
-  len    = sl_strlen(errmsg) + sl_strlen(answer) 
-    + KEY_LEN + 1;
-  len = (size_t)((len < 256) ? 256 : len);
-  buffer = SH_ALLOC(len);
-  MLOCK(buffer, len);
-  (void) sl_strlcpy(buffer, errmsg, len);
-  (void) sl_strlcat(buffer, answer, len);
-  (void) sl_strlcpy(hash, 
-		    sh_util_siggen (skey->session, 
-				    buffer, 
-				    sl_strlen(buffer),
-				    sigbuf, sizeof(sigbuf)), 
-		    KEY_LEN+1);
-  TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
-       sh_util_siggen(skey->session, buffer, 
-		      sl_strlen(buffer), sigbuf, sizeof(sigbuf))));
-  
-  (void) sl_strlcpy(buffer, errmsg, len);
-  (void) sl_strlcat(buffer, hash,   len);
-  
-  flag_err = 
-    xfer_send_crypt (sockfd, 
-#ifdef SH_ENCRYPT
-		     (char)(SH_PROTO_MSG|SH_PROTO_ENC),
-#else
-		     (char)(SH_PROTO_MSG),
-#endif
-		     _("MESG"),
-		     buffer, 
-		     (unsigned long)(sl_strlen(buffer)+1));
-  TPT(( 0, FIL__, __LINE__, 
-	_("msg=<Sent %s, status %d.>\n"), 
-	answer, flag_err));
-
-  /* --- Get confirmation. ---
-   */
-  if (flag_err == 0)
-    {
-      flag_err = (int)
-	xfer_receive_crypt (sockfd, 
-#ifdef SH_ENCRYPT
-			    (char)(SH_PROTO_MSG|SH_PROTO_ENC|SH_PROTO_END),
-#else
-			    (char)(SH_PROTO_MSG|SH_PROTO_END),
-#endif
-			    head_u, 
-			    answer, 255);   
-      TPT(( 0, FIL__, __LINE__, 
-	    _("msg=<Rcvt %s, u %s, status %d.>\n"), 
-	    answer, hu_trans(head_u), flag_err));
-      flag_err = (flag_err < 0) ? flag_err : 0;
-    }
-
-  
-  /* --- Check confirmation. ---
-   */
-  if (flag_err == 0)
-    {
-      /*   CLIENT CONF RECV
-       * 
-       *   first KEY_LEN bytes must be
-       *   sig(skey->session (errmsg nsrv))
-       *
-       */
-      (void) sl_strlcpy(buffer, errmsg, len);
-      (void) sl_strlcat(buffer, nsrv,   len);
-      flag_err = sl_ts_strncmp(answer,
-			       sh_util_siggen(skey->session, 
-					      buffer,
-					      sl_strlen(buffer),
-					      sigbuf, sizeof(sigbuf)),
-			       KEY_LEN);
-      TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
-	   sh_util_siggen(skey->session, buffer, 
-			  sl_strlen(buffer), sigbuf, sizeof(sigbuf))));
-      
-      if (flag_err != 0)
-	{
-#ifdef ENOMSG
-	  flag_err = ENOMSG;
-#else
-	  flag_err = EIO;
-#endif
-	  sh_error_handle((-1), FIL__, __LINE__, flag_err,
-			  MSG_TCP_NOCONF);
-	}
-      else
-	{
-#ifdef SH_ENCRYPT
-	  flag_err = xfer_check_server_cmd(answer, buffer);
-#endif
-	  if (flag_err_debug == S_TRUE)
-	    sh_error_handle((-1), FIL__, __LINE__, 0,
-			    MSG_TCP_CONF);
-	}
-    }
-  
-  memset(buffer, 0, len);
-  MUNLOCK(buffer, len);
-  SH_FREE(buffer);
-
-  if (flag_err != 0)
-    return -1;
-  return 0;
-}
-
-
-static SL_TICKET xfer_get_file(int sockfd, char * answer, 
-			       char * nclt, char * foo_M1, const int theProto)
-{
-  /* --- Open a temporary file. ---
-   */
-  int flag_err = 0;
-  SL_TICKET sfd;
-
-  SL_REQUIRE((sockfd > 2), _("sockfd > 2"));
-
-  if ( (sfd = open_tmp ()) < 0)
-    {
-      flag_err = (-1);
-      sh_error_handle((-1), FIL__, __LINE__, flag_err, MSG_TCP_EFIL);
-    }
-  else
-    {
-      /* --- Read from socket into tmp file. ---
-       */
-      int    transfercount = 0;
-      char   head_u[5];
-
-      do {
-	flag_err = (int)
-	  xfer_receive_crypt (sockfd, 
-#ifdef SH_ENCRYPT
-			      (char)(SH_PROTO_BIG|SH_PROTO_ENC),
-#else
-			      (char)(SH_PROTO_BIG),
-#endif
-			      head_u, 
-			      answer, 
-			      TRANS_BYTES + 255);
-	
-	TPT(( 0, FIL__, __LINE__, 
-	      _("msg=<Received: %d bytes, marked %s.>\n"),
-	      flag_err, hu_trans(head_u)));
-
-	if (flag_err > 0 && 0 == check_request_nerr(head_u, _("FILE")))
-	  {
-	    if (0 == hash_check (foo_M1, answer, flag_err))
-	      {
-		(void) sl_write(sfd, &answer[KEY_LEN], 
-				flag_err-KEY_LEN);
-		++transfercount;
-
-		/*  Delay for throughput throttling
-		 */
-		if (sh_throttle_delay > 0)
-		  retry_msleep(sh_throttle_delay/1000, sh_throttle_delay % 1000);
-
-		flag_err = xfer_send_crypt (sockfd, theProto, 
-					    _("RECV"),
-					    nclt, 
-					    (unsigned long)sl_strlen(nclt));
-		
-	      }
-	    else
-	      {
-		TPT(( 0, FIL__, __LINE__, 
-		      _("msg=<File transfer: Hash check failed.>\n")));
-		break;
-	      }
-	  }
-	else
-	  {
-	    TPT(( 0, FIL__, __LINE__, 
-		  _("msg=<File transfer: No more data.>\n")));
-	    break;
-	  }
-      } while (transfercount < 32000); /* 64 Mbyte */
-      
-      if (0 == check_request_nerr(head_u, _("EEOT")) &&
-	  0 <  flag_err                              &&
-	  0 == hash_check (foo_M1, answer, (int)sl_strlen(answer)))
-	{
-	  flag_err = xfer_send_crypt (sockfd, theProto, 
-				      _("EOTE"),
-				      nclt, 
-				      (unsigned int) sl_strlen(nclt));
-	  
-	  (void) rewind_tmp (sfd);
-	  (void) sl_sync(sfd);
-	  if (flag_err_info == S_TRUE)
-	    sh_error_handle((-1), FIL__, __LINE__, flag_err, MSG_TCP_FOK);
-	}
-      else
-	{
-	  (void) sl_close (sfd);
-	  sfd = (-1);
-	}
-    }
-
-  return sfd;
-}
-
-static  long xfer_try_report_int (char * errmsg, const int what)
-{
-  static int           initialized = S_FALSE;
-  static int           conn_state  = S_TRUE;
-  int                  sockfd;
-  int                  flag_err = 0;
-  char               * answer;
-  int                  theProto = 0;
-
-  UINT32 ticks;
-  char   head_u[5];
-  char * buffer;
-  char   nsrv[KEY_LEN+1];
-  char   nclt[KEY_LEN+1];
-  char   foo_M1[KEY_LEN+1];
-
-  char hashbuf[KEYBUF_SIZE];
-  char sigbuf[KEYBUF_SIZE];
-
-  SL_ENTER(_("xfer_try_report_int"));
-
-  /* --- No message to transmit. ---
-   */
-  if (errmsg == NULL && initialized == S_TRUE)
-    SL_RETURN( 0, _("xfer_try_report_int"));
-  
-  /* --- Connection in bad state. ---
-   */
-  if (xfer_conn_state(initialized, conn_state) < 0)
-    SL_RETURN( (-1), _("xfer_try_report_int"));
-
-  /* --- Try to connect to log server. ---
-   */
-  sockfd = xfer_connect(&conn_state);
-  if (sockfd < 0)
-    SL_RETURN( (-1), _("xfer_try_report_int"));
-  
-
-  /*************************
-   *
-   *  initialization
-   * 
-   */
-  flag_err = 0;
-  answer   = SH_ALLOC(512);
-  MLOCK(answer, 512);
-
-  if (initialized == S_FALSE)
-    {
-      if (xfer_auth(S_FALSE, &initialized, sockfd, answer) < 0)
-	SL_RETURN( (-1), _("xfer_try_report_int"));
-    }
-
- retry_send:
-
-  /* no message, just session key negotiated
-   */
-  if (errmsg == NULL)
-    {
-      xfer_timeout_val = 1;
-      memset(answer, 0, 512);
-      MUNLOCK(answer, 512);
-      SH_FREE(answer);
-      TPT(( 0, FIL__, __LINE__, _("msg=<No message.>\n")));
-      SL_RETURN( (0), _("xfer_try_report_int"));
-    }
-  else if (what == SH_PROTO_BIG)
-    {
-      MUNLOCK(answer, 512);
-      SH_FREE (answer);
-      answer   = SH_ALLOC(TRANS_BYTES + 256);
-      MLOCK(answer, TRANS_BYTES + 256);
-      TPT(( 0, FIL__, __LINE__, _("msg=<File transfer.>\n")));
-    }
-
-  sl_strlcpy (answer, 
-	      sh_util_siggen(skey->session,
-			     sh.host.name,
-			     sl_strlen(sh.host.name),
-			     sigbuf, sizeof(sigbuf)), 
-	      KEY_LEN+1);
-
-  TPT((0, FIL__, __LINE__, _("msg=<host %s>\n"), sh.host.name));
-  TPT((0, FIL__, __LINE__, _("msg=<ckey %s>\n"), skey->session));
-  TPT((0, FIL__, __LINE__, _("msg=<sign %s>\n"), answer));
-    
-  sl_strlcat (answer, sh.host.name, 512);
-
-  TPT((0, FIL__, __LINE__, _("msg=<mesg %s>\n"), answer));
-
-  /***********************************************
-   *
-   * send the message
-   *
-   */
-
-  if (what == SH_PROTO_MSG)
-    theProto = SH_PROTO_MSG;
-  else if (what == SH_PROTO_BIG)
-    theProto = SH_PROTO_BIG;
-
-  /* --- Say HELO  ---       
-   */
-  flag_err = xfer_send    (sockfd, theProto, _("HELO"),
-			   answer, sl_strlen(answer));
-  TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s, status %d.>\n"), 
-	answer, flag_err));
-
-  if (flag_err == 0)
-    { 
-      /* --- Get NSRV. ---  
-       */
-      flag_err = (int) xfer_receive (sockfd, theProto, head_u, answer, 255);
-      TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s, u %s, status %d.>\n"), 
-	    answer, hu_trans(head_u), flag_err));
-      flag_err = (flag_err < 0) ? flag_err : 0;
-    }   
-
-  if (what == SH_PROTO_MSG)
-    {
-      if (flag_err == 0)
-	{
-	  /* --- Re-negotiate key. ---
-	   */
-	  if (0 == check_request_nerr(head_u, _("INIT")))
-	    {
-	      flag_err    = 0;
-	      initialized = S_FALSE;
-	      if (xfer_auth(S_TRUE, &initialized, sockfd, answer) == 0)
-		goto retry_send;
-	    }
-	  
-	  else if (0 == check_request(head_u, _("TALK")))
-	    {
-	      flag_err = xfer_send_message(errmsg, sockfd, answer);
-	    }
-
-	  else
-	    {
-	      /* --- Unexpected reply from server. ---
-	       */
-	      sh_error_handle((-1), FIL__, __LINE__, 0,
-			      MSG_TCP_UNEXP);
-	      flag_err = (-1);
-		
-	    }
-	}
-    }
-
-
-  else if (what == SH_PROTO_BIG)
-    {
-      if (flag_err == 0)
-	{
-	  
-	  /* --- Re-negotiate key. ---
-	   */
-	  if (0 == check_request_nerr(head_u, _("INIT")))
-	    {
-	      flag_err    = 0;
-	      initialized = BAD;
-	      if (xfer_auth(S_TRUE, &initialized, sockfd, answer) == 0)
-		goto retry_send;
-	    }
-	  
- 
-	  else if (0 == check_request(head_u, _("NSRV")))
-	    {
-	      size_t buffersize;
-#ifdef SH_ENCRYPT
-	      /* --- Set encryption flag. ---
-	       */
-	      theProto = (SH_PROTO_BIG|SH_PROTO_ENC);
-#endif
-
-	      (void) sl_strlcpy(nsrv, answer, KEY_LEN+1);
-	      
-	      /* --- Generate a nonce. ---
-	       */
-	      ticks = (UINT32) taus_get ();
-              
-	      (void) sl_strlcpy(nclt, 
-				sh_tiger_hash((char *) &ticks, 
-					      TIGER_DATA, 
-					      (unsigned long)sizeof(UINT32), 
-					      hashbuf, sizeof(hashbuf)),
-				KEY_LEN+1);
-
-	      /* --- Compute H(nsrv, nclt, skey). ---
-	       */
-	      buffer = sh_util_strconcat (nsrv, nclt, 
-					  skey->session, NULL);
-	      (void)sl_strlcpy(foo_M1, 
-			       sh_tiger_hash(buffer, TIGER_DATA,
-					     (unsigned long)sl_strlen(buffer), 
-					     hashbuf, sizeof(hashbuf)),
-			       KEY_LEN+1);
-	      memset (buffer, 0, sl_strlen(buffer));
-	      SH_FREE(buffer);
-
-	      /* --- Send (nclt, msg) ---
-	       */
-	      if (S_TRUE == sl_ok_adds(strlen(errmsg), strlen(nclt)+2+KEY_LEN))
-		{
-		  buffersize = strlen(nclt)+strlen(errmsg)+2;
-		  
-#if !defined(SH_ENCRYPT)
-		  buffersize += KEY_LEN;
-#endif
-		  buffer = SH_ALLOC(buffersize);
-
-		  sl_strlcpy(buffer, nclt,   buffersize);
-		  sl_strlcat(buffer, errmsg, buffersize);
-		  
-#if !defined(SH_ENCRYPT)
-		  if (4 == sl_strlen(errmsg)) {  /* backward compatibility   */
-		    buffersize = sl_strlen(buffer);
-		    buffer[buffersize]   = theProto; /* nctl//DATA//theProto */
-		    buffer[buffersize+1] = '\0';
-		  }
-		  sh_tools_hash_add(foo_M1, buffer, buffersize+1);
-#endif
-	      
-		  flag_err = 
-		    xfer_send_crypt (sockfd, (char) theProto, _("NCLT"),
-				     buffer, 
-				     (unsigned long) sl_strlen(buffer));
-		  
-		  TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s, status %d.>\n"), 
-			buffer, flag_err));
-		  SH_FREE (buffer);
-		}
-	      else {
-		flag_err = -1;
-	      }
-	    } 
-	}
-
-      if (flag_err == 0)
-	{
-	  /* --- Receive the file. ---
-	   */
-	  SL_TICKET sfd = xfer_get_file(sockfd, answer, nclt, foo_M1, theProto);
-	  if (!SL_ISERROR(sfd))
-	    {
-	      (void) sl_close_fd (FIL__, __LINE__, sockfd);
-	      memset(answer, 0, TRANS_BYTES + 256);
-	      MUNLOCK(answer, TRANS_BYTES + 256);
-	      SH_FREE(answer);
-	      xfer_timeout_val = 1;
-
-	      SL_RETURN( (sfd), _("xfer_try_report_int"));
-	    }
-	}
-
-      (void) sl_close_fd (FIL__, __LINE__, sockfd);
-      memset(answer, 0, TRANS_BYTES + 256);
-      MUNLOCK(answer, TRANS_BYTES + 256);
-      SH_FREE(answer);
-      xfer_timeout_val *= 2;
-
-      SL_RETURN( (-1), _("xfer_try_report_int"));
-    }
- 
-  (void) sl_close_fd (FIL__, __LINE__, sockfd);
-  memset(answer, 0, 512);
-  MUNLOCK(answer, 512);
-  SH_FREE(answer);
-
-#ifndef EIO
-#define EIO 5
-#endif
-  
-
-#ifdef SH_ERROR_H  
-  if (flag_err != 0)
-    {
-      char errbuf[SH_ERRBUF_SIZE];
-      conn_state = S_FALSE;
-      xfer_timeout_val *= 2;
-      if (flag_err < 0 || NULL == sh_error_message(flag_err, errbuf, sizeof(errbuf)))
-	flag_err = EIO;
-      sh_error_handle((-1), FIL__, __LINE__, flag_err, MSG_TCP_ECONN,
-		      sh_error_message(flag_err, errbuf, sizeof(errbuf)));
-      SL_RETURN( (-1), _("xfer_try_report_int"));
-    }
-#endif
-  xfer_timeout_val = 1;
-
-  SL_RETURN( (0), _("xfer_try_report_int"));
-}
-
-/* #ifdef SH_WITH_CLIENT */
-#endif
-
-
-
-
Index: trunk/src/sh_xfer_server.c
===================================================================
--- trunk/src/sh_xfer_server.c	(revision 591)
+++ 	(revision )
@@ -1,3876 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2000 Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-/* Must be early on FreeBSD
- */
-#include <sys/types.h>
-
-/* must be .le. than (1020 * 64)
- * (see sh_tools.c -- put_header)
- *
- * also: must be  (N * 16), otherwise
- * binary files cannot be transferred encrypted
- *
- * 65280 = (1020*64)
- * #define TRANS_BYTES 8000  V0.8
- */
-#ifdef  SH_ENCRYPT
-#define TRANS_BYTES 65120
-#else
-#define TRANS_BYTES 65280
-#endif
-
-/* timeout for session key
- */
-#define TIMEOUT_KEY 7200
-
-/* max time between connection attempts
- */
-#define TIMEOUT_CON 2048 
-
-/* #undef  SRP_DEBUG */
-/* #define SRP_DEBUG */
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-#ifdef  HAVE_UNISTD_H
-#include <errno.h>
-#include <signal.h>
-#include <setjmp.h>
-#include <pwd.h>
-#include <grp.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#endif
-
-#ifndef FD_SET
-#define NFDBITS         32
-#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
-#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
-#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
-#endif /* !FD_SET */
-#ifndef FD_SETSIZE
-#define FD_SETSIZE      32
-#endif
-#ifndef FD_ZERO
-#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
-#endif
-
-#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
-#include <sys/mman.h>
-#endif
-
-
-#include <netdb.h> 
-#include <sys/types.h> 
-#include <netinet/in.h> 
-#include <sys/socket.h> 
-#ifndef S_SPLINT_S
-#include <arpa/inet.h>
-#endif
-
-#include "sh_ipvx.h"
-#include "samhain.h"
-#include "sh_tiger.h"
-#include "sh_utils.h"
-#include "sh_unix.h"
-#include "sh_xfer.h"
-#include "sh_srp.h"
-#include "sh_fifo.h"
-#include "sh_tools.h"
-#include "sh_entropy.h"
-#include "sh_html.h"
-#include "sh_nmail.h"
-#include "sh_socket.h"
-#define SH_NEED_GETHOSTBYXXX
-#include "sh_static.h"
-#include "sh_guid.h"
-
-#ifdef SH_ENCRYPT
-#include "rijndael-api-fst.h"
-char * sh_tools_makePack (unsigned char * header, int flag,
-			  char * payload, unsigned long payload_size,
-			  keyInstance * keyInstE);
-char * sh_tools_revertPack (unsigned char * header, int flag, char * message,
-			    keyInstance * keyInstE, 
-			    unsigned long message_size);
-#endif
-
-/* define this if you want to debug the client/server communication */
-/* #define SH_DBG_PROT 1 */
-
-#ifdef  SH_DBG_PROT
-#define SH_SHOWPROT(c,d) sh_tools_show_header((c), (d))
-#else
-#define SH_SHOWPROT(c,d) 
-#endif
-
-/* the port client will be connecting to 
- */
-#ifndef SH_DEFAULT_PORT
-#define SH_DEFAULT_PORT 49777    
-#endif
-
-#ifndef SH_SELECT_REPEAT
-#define SH_SELECT_REPEAT 60
-#endif
-
-#ifndef SH_HEADER_SIZE
-#define SH_HEADER_SIZE 7
-#endif
-
-#ifndef SH_CHALLENGE_SIZE
-#define SH_CHALLENGE_SIZE 9
-#endif
-
-#undef  FIL__
-#define FIL__  _("sh_xfer_server.c")
-
-int     clt_class = (-1);
-
-extern int flag_err_debug;
-extern int flag_err_info;
-
-
-#if defined (SH_WITH_SERVER)
-
-#if defined(WITH_TRACE) || defined(WITH_TPT) 
-extern char * hu_trans(const char * ihu);
-#endif
-extern unsigned int ServerPort;
-#if !defined(USE_SRP_PROTOCOL)
-extern void sh_passwd (char * salt, char * password, char * nounce, char *hash);
-#endif
-
-static int StripDomain = S_TRUE;
-
-int sh_xfer_set_strip (const char * str)
-{
-  static int fromcl = 0;
-
-  if (fromcl == 1)
-    return 0;
-  else
-    return (sh_util_flagval(str, &StripDomain));
-}
-
-static char * sh_strip_domain (char *name)
-{
-  char * out = NULL;
-
-  SL_ENTER(_("sh_strip_domain"));
-
-  if (StripDomain == S_FALSE || strchr(name, '.') == NULL) 
-    {
-      out = sh_util_strdup(name);
-      SL_RETURN( out, _("sh_strip_domain"));
-    }
-  else
-    {
-      /* check whether it is in dotted number format
-       * --> last part must be kept
-       */
-      if (0 != sh_ipvx_is_numeric(name))
-	{
-	  out = sh_util_strdup(name);
-	  SL_RETURN( out, _("sh_strip_domain"));
-	}
-      else
-	{
-	  char * p;
-	  out = sh_util_strdup(name);
-	  p   = strchr(out, '.');
-	  if (p) *p = '\0';
-	  SL_RETURN( out, _("sh_strip_domain"));
-	}
-    }
-
-  SL_RETURN( out, _("sh_strip_domain"));
-}
-
-#ifndef USE_SRP_PROTOCOL
-
-int sh_xfer_make_client (const char * str)
-{
-  /* char *          safer; */
-  char            key[KEY_LEN+1];
-  unsigned char   in[PW_LEN+1];
-  int    i = 0, j, k, l = 0;
-  char hashbuf[KEYBUF_SIZE];
-  
-  if (sl_strlen(str) != (PW_LEN * 2)) 
-    {
-      fprintf(stderr, 
-	      _("Input must be a %d digit hexadecimal number"\
-		" (only 0-9, a-f, A-F allowed in input)\n"),
-	      (PW_LEN * 2));
-      _exit(EXIT_FAILURE);
-    }
-  
-  while (i < (PW_LEN * 2))
-    {
-      k = sh_util_hexchar(str[i]); j = sh_util_hexchar(str[i+1]); 
-      if (k != -1 && j != -1) 
-        {
-          in[l] = (k * 16 + j);
-          ++l; i+= 2;
-        }
-      else
-        {
-          fprintf(stderr, _("Invalid char %c\n"), str[i]);
-          _exit(EXIT_FAILURE);
-        }
-    }
-  in[PW_LEN] = '\0';
-
-  sl_strlcpy ((char *)key, 
-	      sh_tiger_hash ((char*)in, TIGER_DATA, PW_LEN, 
-			     hashbuf, sizeof(hashbuf)), 
-	      KEY_LEN+1);
-  key[KEY_LEN] = '\0';
-  
-  fprintf(stdout, _("Client entry: Client=HOSTNAME@00000000@%s\n"), 
-	  key);
-  fflush(stdout);
-
-  _exit(EXIT_SUCCESS);
-  return 0;
-}
-
-#else
-
-int sh_xfer_make_client (const char * str)
-{
-  char * foo_v;
-
-  char   salt[17];
-  char   key[KEY_LEN+1];
-  char   in[PW_LEN];
-  int    i = 0, j, k, l = 0;
-  char hashbuf[KEYBUF_SIZE];
-  
-  if (sl_strlen(str) != (PW_LEN*2)) 
-    {
-      fprintf(stderr, 
-	      _("Input must be a %d digit hexadecimal number"\
-		" (only 0-9, a-f, A-F allowed in input)\n"),
-	      (PW_LEN*2));
-      _exit(EXIT_FAILURE);
-    }
-
-    while (i < (PW_LEN*2))
-      {
-        k = sh_util_hexchar(str[i]); j = sh_util_hexchar(str[i+1]); 
-        if (k != -1 && j != -1) 
-          {
-            in[l] = (k * 16 + j);
-            ++l; i+= 2;
-          }
-        else
-          {
-            fprintf(stderr, _("Invalid char %c\n"), str[i]);
-            _exit(EXIT_FAILURE);
-          }
-      }
-    
-  
-    if (0 == sh_srp_init())
-      {
-	sh_util_keyinit(key, KEY_LEN);
-	sl_strlcpy(salt, sh_tiger_hash(key, TIGER_DATA, KEY_LEN, 
-				       hashbuf, sizeof(hashbuf)), 
-		   17); 
-	sh_srp_x (salt, in);
-	foo_v  = sh_srp_verifier ();
-	fprintf(stdout, _("Client=HOSTNAME@%s@%s\n"), 
-		salt, foo_v);
-	fflush(stdout);
-	SH_FREE(foo_v);
-	sh_srp_exit();
-	_exit(EXIT_SUCCESS);
-      }
-    fprintf(stdout, "%s",_("ERROR initializing BigNum library.\n"));
-    fflush (stdout);
-    _exit(EXIT_FAILURE);
-    return -1;
-}
-#endif
-
-
-int sh_xfer_create_password (const char * dummy)
-{
-  UINT32   val[2]; 
-  char     output[KEY_LEN+1];
-  char hashbuf[KEYBUF_SIZE];
-
-  val[0] = taus_get ();
-  val[1] = taus_get ();
-
-  sl_strlcpy (output, 
-	      sh_tiger_hash((char *)(&val[0]), TIGER_DATA, 2*sizeof(UINT32),
-			    hashbuf, sizeof(hashbuf)),
-	      KEY_LEN);
-
-  output[16] = '\0';
-
-  fprintf(stdout, _("%s\n"), output);
-  fflush (stdout);
-
-  if (dummy)
-    _exit(EXIT_SUCCESS);
-  else
-    _exit(EXIT_SUCCESS);  
-  return (0);  /* avoid compiler warning */
-}
-
-/* #if defined (SH_WITH_SERVER) */
-#endif
-
-/**************************************************
- *
- *
- *  S E R V E R   
- *
- *
- ***************************************************/
-
-#ifdef SH_WITH_SERVER
-
-#include "sh_readconf.h"
-
-
-#define CONN_FREE    0
-#define CONN_READING 1
-#define CONN_SENDING 2
-#define CONN_PAUSE   3
-#define CONN_BUSY    4
-
-char * clt_stat[] = {
-  N_("Inactive"),
-  N_("Started"),
-  N_("ILLEGAL"),
-  N_("FAILED"),
-  N_("Exited"),
-  N_("PANIC"),
-  N_("POLICY"),
-  N_("File_transfer"),
-  N_("Message"),
-  N_("TIMEOUT_EXCEEDED"),
-  N_("Suspended"),
-  N_("Filecheck"),
-};
-
-#include <time.h>
-
-/* in sh_html.h:
- *  typedef struct client_entry {
- *  } client_t;
- */
-
-typedef struct client_alias {
-  char                  * alias;
-  char                  * hostname;
-} alias_t;
-
-#include "zAVLTree.h"
-
-static char * sh_tolower (char * s)
-{
-  char * ret = s;
-  if (s)
-    {
-      for (; *s; ++s)
-	{ 
-	  *s = tolower((unsigned char) *s);
-	}
-    }
-  return ret;
-}
-
-/* Function to return the key for indexing
- * the argument (for the client list)
- */
-zAVLKey sh_avl_key (void const * arg)
-{
-  const client_t * sa = (const client_t *) arg;
-  return (zAVLKey) sa->hostname;
-}
-
-zAVLTree * all_clients = NULL;
-
-/* Function to return the key for indexing
- * the argument (for the aliases list)
- */
-zAVLKey sh_avl_alias (void const * arg)
-{
-  const alias_t * sa = (const alias_t *) arg;
-  return (zAVLKey) sa->alias;
-}
-
-zAVLTree * all_aliases = NULL;
-
-void sh_xfer_html_write()
-{
-  SL_ENTER(_("sh_xfer_html_write"));
-  sh_html_write(all_clients);
-  SL_RET0(_("sh_xfer_html_write"));
-}
-
-
-int sh_xfer_use_clt_class (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_xfer_use_clt_class"));
-  i = sh_util_flagval(c, &(sh.flag.client_class));
-  SL_RETURN(i, _("sh_xfer_use_clt_class"));
-}
-
-int sh_xfer_use_clt_sev (const char * c)
-{
-  int i;
-  SL_ENTER(_("sh_xfer_use_clt_sev"));
-  i = sh_util_flagval(c, &(sh.flag.client_severity));
-  SL_RETURN(i, _("sh_xfer_use_clt_sev"));  
-}
-
-
-/* the destructor (client list item)
- */
-void free_client(void * inptr)
-{
-  client_t * here;
-
-  SL_ENTER(_("free_client"));
-  if (inptr == NULL)
-    SL_RET0(_("free_client"));
-  else
-    here = (client_t *) inptr;
-
-  /* cppcheck-suppress uninitStructMember */
-  if (here->hostname != NULL)
-    SH_FREE(here->hostname);
-  if (here->salt != NULL)
-    SH_FREE(here->salt);
-  if (here->verifier != NULL)
-    SH_FREE(here->verifier);
-  SH_FREE(here);
-  SL_RET0(_("free_client"));
-}
-
-/* the destructor (alias list item)
- */
-void free_alias(void * inptr)
-{
-  alias_t * here;
-
-  SL_ENTER(_("free_alias"));
-  if (inptr == NULL)
-    SL_RET0(_("free_alias"));
-  else
-    here = (alias_t *) inptr;
-
-  /* cppcheck-suppress uninitStructMember */
-  if (here->alias != NULL)
-    SH_FREE(here->alias);
-  if (here->hostname != NULL)
-    SH_FREE(here->hostname);
-  SH_FREE(here);
-  SL_RET0(_("free_alias"));
-}
-
-int sh_xfer_register_alias (const char * str)
-{
-  alias_t    * newalias;
-  alias_t    * testalias;
-
-  const char * ptr;
-  int          sepnum  = 0;
-  int          sep     = 0;
-  register int i       = 0;
-  int          siz_str = 0;
-
-  SL_ENTER(_("sh_xfer_register_alias"));
-
-  ptr = str; 
-  while (*ptr) {
-    if (*ptr == '@' && sepnum < 1) 
-      { 
-	sep = i;
-	++sepnum;
-      } 
-    ++ptr; ++i; 
-  }
-
-  if (all_aliases == NULL)
-    {
-      all_aliases = zAVLAllocTree (sh_avl_alias, zAVL_KEY_STRING);
-      if (all_aliases == NULL) 
-	{
-	  (void) safe_logger (0, 0, NULL);
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-    }
-
-  if ((sepnum == 1) && (sep > 0) && (i > (sep + 1)))
-    {
-      newalias                  = SH_ALLOC (sizeof(alias_t));
-      newalias->alias           = SH_ALLOC (sep+1);
-      newalias->hostname        = SH_ALLOC (sl_strlen(str)-sep);
-
-      /* truncate */
-      sl_strlcpy(newalias->alias,  &str[0],        sep+1);
-      sh_tolower(newalias->alias);
-
-      /* truncate */
-      sl_strlcpy(newalias->hostname,  &str[sep+1], sl_strlen(str)-sep);
-      sh_tolower(newalias->hostname);
-
-      testalias = (alias_t *) zAVLSearch (all_aliases, newalias->alias);
-
-      if (testalias != NULL)
-	{
-	  /* keep the alias but replace the hostname with the new one */
-	  SH_FREE(testalias->hostname);
-	  siz_str = strlen (newalias->hostname) + 1;
-	  testalias->hostname = SH_ALLOC (siz_str);
-	  sl_strlcpy(testalias->hostname, newalias->hostname, siz_str);
-	  
-	  free_alias(newalias);
-	  SL_RETURN( 0, _("sh_xfer_register_alias"));
-	}
-      else
-	{
-	  if (0 == zAVLInsert (all_aliases, newalias))
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_AREG,
-			      newalias->alias, 
-			      newalias->hostname);
-	      SL_RETURN( 0, _("sh_xfer_register_alias"));
-	    }
-	}
-    }
-  SL_RETURN (-1, _("sh_xfer_register_alias"));
-}
-
-
-int sh_xfer_register_client (const char * str)
-{
-  client_t   * newclt;
-  client_t   * testclt;
-
-  const char * ptr;
-  int          sepnum = 0;
-  int          sep[2];
-  register int i = 0;
-  int          siz_str = 0;
-
-  SL_ENTER(_("sh_xfer_register_client"));
-
-  ptr = str; 
-  while (*ptr) {
-    if (*ptr == '@' && sepnum < 2 ) 
-      { 
-	sep[sepnum] = i;
-	++sepnum;
-      } 
-    ++ptr; ++i; 
-  }
-
-  if (all_clients == NULL)
-    {
-      all_clients = zAVLAllocTree (sh_avl_key, zAVL_KEY_STRING);
-      if (all_clients == NULL) 
-	{
-	  (void) safe_logger (0, 0, NULL);
-	  aud__exit(FIL__, __LINE__, EXIT_FAILURE);
-	}
-    }
-  
-  if ((sepnum == 2) && (sep[0] > 0) && (sep[1] > sep[0]))
-    {
-      newclt = SH_ALLOC (sizeof(client_t));
-      newclt->hostname = SH_ALLOC (sep[0]+1);
-      newclt->salt     = SH_ALLOC (sep[1]-sep[0]);
-      newclt->verifier = SH_ALLOC (sl_strlen(str)-sep[1]+1);
-      newclt->exit_flag         = 0;
-      newclt->dead_flag         = 0;
-#ifdef SH_ENCRYPT
-      newclt->encf_flag         = SH_PROTO_ENC;
-      newclt->ency_flag         = SH_PROTO_ENC;
-#else
-      newclt->encf_flag         = 0;
-      newclt->ency_flag         = 0;
-#endif
-      newclt->ivst_flag         = 0;
-      newclt->session_key[0]    = '\0';
-      newclt->last_connect      = (time_t) 0;
-      newclt->session_key_timer = (time_t) 0;
-      newclt->status_now        = CLT_INACTIVE;
-      for (i = 0; i < CLT_MAX; ++i) 
-	newclt->status_arr[i] = CLT_INACTIVE;
-      (void) sh_unix_time(0, newclt->timestamp[CLT_INACTIVE], TIM_MAX);
-
-      /* truncate */
-      sl_strlcpy(newclt->hostname,  &str[0],        sep[0]+1);
-      sh_tolower(newclt->hostname);
-
-      /* truncate */
-      sl_strlcpy(newclt->salt,      &str[sep[0]+1], sep[1]-sep[0]);
-      sl_strlcpy(newclt->verifier,  &str[sep[1]+1], sl_strlen(str)-sep[1]+1);
-
-      testclt = (client_t *) zAVLSearch (all_clients, newclt->hostname);
-
-      if (testclt != NULL)
-	{
-	  SH_FREE(testclt->verifier);
-	  siz_str = strlen (newclt->verifier) + 1;
-	  testclt->verifier = SH_ALLOC (siz_str);
-	  sl_strlcpy(testclt->verifier, newclt->verifier, siz_str);
-
-	  SH_FREE(testclt->salt);
-	  siz_str = strlen (newclt->salt) + 1;
-	  testclt->salt = SH_ALLOC (siz_str);
-	  sl_strlcpy(testclt->salt, newclt->salt, siz_str);
-
-	  testclt->dead_flag = 0;
-	      
-	  free_client(newclt);
-	  SL_RETURN( 0, _("sh_xfer_register_client"));
-	}
-      else
-	{
-	  if (0 == zAVLInsert (all_clients, newclt))
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_CREG,
-			      newclt->hostname, 
-			      newclt->salt, newclt->verifier);
-	      SL_RETURN( 0, _("sh_xfer_register_client"));
-	    }
-	}
-    }
-  SL_RETURN (-1, _("sh_xfer_register_client"));
-}
-
-typedef struct {
-  int             state;
-  int             fd;
-  char          * buf;
-  unsigned char   head[SH_HEADER_SIZE];
-  char            challenge[SH_CHALLENGE_SIZE];
-  char            peer[SH_MINIBUF+1];
-  client_t      * client_entry;
-  char          * K;
-  char          * M1;
-  char          * A;
-  int             headcount;
-  unsigned long   bytecount;
-  unsigned long   bytes_to_send;
-  unsigned long   bytes_to_get;
-  int             pass;
-  unsigned long   timer;
-
-  char          * FileName;
-  unsigned long   FileLength;
-  unsigned long   FileSent;
-  char            FileType[5];
-
-  struct sh_sockaddr addr_peer;
-} sh_conn_t;
-
-
-static char zap_challenge[SH_CHALLENGE_SIZE] = { 0 };
- 
-void sh_xfer_do_free (sh_conn_t * conn)
-{
-  SL_ENTER(_("sh_xfer_do_free"));
-
-  if (conn->K != NULL) 
-    {
-      SH_FREE(conn->K);
-      conn->K           = NULL;
-    }
-  if (conn->A != NULL) 
-    {
-      SH_FREE(conn->A);
-      conn->A           = NULL;
-    }
-  if (conn->M1 != NULL) 
-    {
-      SH_FREE(conn->M1);
-      conn->M1           = NULL;
-    }
-  if (conn->buf != NULL) 
-    {
-      SH_FREE(conn->buf);
-      conn->buf          = NULL;
-    }
-  if (conn->fd != (-1))
-    {
-      sl_close_fd (FIL__, __LINE__, conn->fd);
-      conn->fd            = -1;
-    }
-  memcpy(conn->challenge, zap_challenge, SH_CHALLENGE_SIZE);
-  conn->state         = CONN_FREE;
-  conn->headcount     = 0;
-  conn->bytecount     = 0;
-  conn->bytes_to_send = 0;
-  conn->bytes_to_get  = 0;
-  conn->pass          = 0;
-  conn->timer         = 0;
-  conn->client_entry  = NULL;
-
-  if (conn->FileName != NULL) 
-    {
-      SH_FREE(conn->FileName);
-      conn->FileName     = NULL;
-    }
-  conn->FileLength     = 0;
-  conn->FileSent       = 0;
-  conn->FileType[0] = '\0';
-  conn->FileType[1] = '\0';
-  conn->FileType[2] = '\0';
-  conn->FileType[3] = '\0';
-  conn->FileType[4] = '\0';
-
-  --server_status.conn_open;
-  
-  SL_RET0(_("sh_xfer_do_free"));
-}
-
-/****************************************
- *
- *   -- Reconfiguration. --
- *
- *   (1) Mark all clients as 'dead'.
- *   (2) Reload configuration - clients
- *       in config are non-dead now.
- *   (3) Remove all clients still
- *       marked as 'dead'.
- */
-
-/* -- Mark all clients as dead.
- */
-void sh_xfer_mark_dead (void)
-{
-  zAVLCursor avlcursor;
-  client_t * item;
-
-  SL_ENTER(_("sh_xfer_mark_dead"));
-
-  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
-       item = (client_t *) zAVLNext(&avlcursor))
-    {
-      item->dead_flag = 1;
-    }
-  SL_RET0(_("sh_xfer_mark_dead"));
-}
-
-
-/* -- Clean tree from dead clients.
- */
-void sh_xfer_clean_tree (void)
-{
-  zAVLCursor avlcursor;
-  client_t * item;
-
-  SL_ENTER(_("sh_xfer_clean_tree"));
-
- repeat_search:
-
-  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
-       item = (client_t *) zAVLNext(&avlcursor))
-    {
-      if (item->dead_flag == 1)
-	{
-	  zAVLDelete (all_clients, item->hostname);
-	  free_client (item);
-	  goto repeat_search;
-	}
-    }
-  SL_RET0(_("sh_xfer_clean_tree"));
-}
-
-/*
- *
- **********************************************/
-
-
-
-/* -- SERVER SEND FUNCTION. --
- */
-void sh_xfer_prep_send_int (sh_conn_t * conn, 
-			    char * msg, unsigned long length,
-			    char * u, char protocol,
-			    int docrypt)
-{
-  /* register unsigned long i; */
-  unsigned long           length2;
-
-#if !defined(SH_ENCRYPT)
-  (void) docrypt;
-#endif
-
-  SL_ENTER(_("sh_xfer_prep_send_int"));
-
-  TPT((0, FIL__, __LINE__, _("msg=<%s>, docrypt=<%d>\n"), msg, docrypt ));
-
-  length2 = length;
-
-  conn->headcount     = 0;
-  conn->bytecount     = 0;
-  conn->bytes_to_send = 0;
-  conn->bytes_to_get  = 0;
-
-  if (conn->buf != NULL) 
-    {
-      SH_FREE(conn->buf);
-      conn->buf           = NULL;
-    }
-
-  put_header (conn->head, protocol, &length2, u);
-  SH_SHOWPROT(conn->head,'>');
-
-  TPT((0, FIL__, __LINE__, _("msg=<put_header done>\n") ));
-
-  if (msg == NULL) 
-    length2 = 0;
-  
-#ifdef SH_ENCRYPT
-  if      ((S_TRUE == docrypt) && ((protocol & SH_PROTO_ENC) != 0))
-    {
-      TPT((0, FIL__, __LINE__, _("encrypting (version 2)\n")));
-      
-      conn->buf = sh_tools_makePack (conn->head, conn->client_entry->ivst_flag,
-				     msg, length2,
-				     &(conn->client_entry->keyInstE));
-    }
-  else if (msg == NULL)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-		      _("msg is NULL"), 
-		      _("sh_xfer_prep_send_int: cipherInit"));
-    }
-  else
-    {
-      if ((length2 + 1) < length2) --length2;
-      conn->buf       = SH_ALLOC(length2 + 1);
-
-      memcpy(conn->buf, msg, length2);
-      conn->buf[length2] = '\0';
-      TPT((0, FIL__, __LINE__, _("msg=<no encryption done>\n") ));
-    }
-#else
-  if ((length2 + 1) < length2) --length2;
-  conn->buf       = SH_ALLOC(length2 + 1);
-
-  memcpy(conn->buf, msg, length2);
-  conn->buf[length2] = '\0';
-  TPT((0, FIL__, __LINE__, _("msg=<no encryption done>\n") ));
-#endif
-
-  conn->state     = CONN_SENDING;
-  SL_RET0(_("sh_xfer_prep_send_int"));
-}
-
-/* -- Send/Receive. --
- */
-void sh_xfer_prep_send (sh_conn_t * conn, 
-			   char * msg, unsigned long length,
-			   char * u, char protocol)
-{
-  SL_ENTER(_("sh_xfer_prep_send"));
-  sh_xfer_prep_send_int (conn,  msg, length, u, protocol, S_FALSE);
-  SL_RET0(_("sh_xfer_prep_send"));
-}  
-
-void sh_xfer_send_crypt (sh_conn_t * conn, 
-				 char * msg, unsigned long length,
-				 char * u, char protocol)
-{
-  SL_ENTER(_("sh_xfer_send_crypt"));
-  sh_xfer_prep_send_int (conn,  msg, length, u, protocol, S_TRUE);
-  SL_RET0(_("sh_xfer_send_crypt"));
-}  
-
-/* #include <sys/times.h> */
-
-#if defined(WITH_EXTERNAL)
-#include "sh_extern.h"
-#endif
-
-/* -- Update the client status. --
- *
- * Update the status array for the client,
- * and eventually call external program.
- */
-static void status_update (client_t * conn, int status)
-{ 
-#if defined(WITH_EXTERNAL)
-  char msg[2 * SH_MINIBUF + TIM_MAX + 3];
-#endif
-
-  SL_ENTER(_("status_update"));
-
-  if (conn == NULL || 
-      status < 0   || status >= CLT_MAX)
-    SL_RET0(_("status_update"));
-
-  conn->status_now = status;
-  conn->status_arr[status] = status;
-  (void) sh_unix_time(0, conn->timestamp[status], TIM_MAX);
-
-#if defined(WITH_EXTERNAL)
-  sl_snprintf(msg, sizeof(msg), _("%s %s %s"),
-	      conn->hostname, conn->timestamp[status], _(clt_stat[status]));
-  sh_ext_execute('s', 'r', 'v', msg, 0);
-#endif
-
-  SL_RET0(_("status_update"));
-}
-
-static time_t time_client_limit = 86400;
-
-int sh_xfer_set_time_limit (const char * c)
-{
-  long val;
-
-  SL_ENTER(_("sh_xfer_set_time_limit"));
-
-  val = strtol (c, (char **)NULL, 10);
-  if (val <= 0)
-    SL_RETURN( (-1), _("sh_xfer_set_time_limit"));
-
-  time_client_limit = (time_t) val;
-  SL_RETURN( (0), _("sh_xfer_set_time_limit"));
-}
-
-
-/* -- Check for time limit exceeded. --
- */
-static int client_time_check(void)
-{
-  zAVLCursor avlcursor;
-  client_t * item;
-
-  SL_ENTER(_("client_time_check"));
-
-  if (time_client_limit == (time_t) 0)
-    SL_RETURN( 0, _("client_time_check"));
-
-  for (item = (client_t *) zAVLFirst(&avlcursor, all_clients); item;
-       item = (client_t *) zAVLNext(&avlcursor))
-    {
-      if (item->exit_flag == 0 && item->last_connect != (time_t) 0)
-	{
-	  if ( (time(NULL) - item->last_connect) > time_client_limit)
-	    {
-	      if (item->status_now != CLT_TOOLONG)
-		{
-		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_TIMEXC,
-				  item->hostname);
-		  status_update (item, CLT_TOOLONG);
-		}
-	    }
-	}
-    }
-  SL_RETURN( 0, _("client_time_check"));
-}
-
-static int lookup_err = SH_ERR_SEVERE;
-
-int sh_xfer_lookup_level (const char * c)
-{
-  int ci =  sh_error_convert_level (c);
-
-  SL_ENTER(_("sh_xfer_lookup_level"));
-
-  if (ci >= 0)
-    {
-      lookup_err = ci;
-      SL_RETURN( 0, _("sh_xfer_lookup_level"));
-    }
-  else
-    SL_RETURN( (-1), _("sh_xfer_lookup_level"));
-}
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN  127
-#endif
-
-int check_addr (const char * claim, struct sh_sockaddr * addr_peer)
-{
-  char               h_name[MAXHOSTNAMELEN + 1];
-  char               h_peer[MAXHOSTNAMELEN + 1];
-  char               h_peer_IP[SH_IP_BUF];
-  char               tmp_peer_IP[SH_IP_BUF];
-  char             * canonical;
-  char               numeric[SH_IP_BUF];
-
-  SL_ENTER(_("check_addr"));
-
-  if (claim == NULL)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      _("NULL input"), _("check_addr"));
-      SL_RETURN ((-1), _("check_addr"));
-    }
-
-  /* Make sure we have the canonical name for the client
-   */
-  canonical = sh_ipvx_canonical(claim, numeric, sizeof(numeric));
-
-  /* copy canonical name into h_name
-   */
-  if (canonical != NULL)
-    {
-      sl_strlcpy(h_name, canonical, MAXHOSTNAMELEN + 1);
-      SH_FREE(canonical);
-    }
-  else
-    {
-      sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_RESCLT,
-		      claim);
-      SL_RETURN ((0), _("check_addr"));
-    }
-
-
-  /* get canonical name of socket peer
-   */
-  canonical = sh_ipvx_addrtoname(addr_peer);
-
-  if (canonical)
-    {
-      if (0 == sl_strcmp(canonical, _("localhost")))
-	sl_strlcpy(h_peer, sh.host.name, MAXHOSTNAMELEN + 1);
-      else
-	sl_strlcpy(h_peer, canonical, MAXHOSTNAMELEN + 1);
-      SH_FREE(canonical);
-    }
-  else
-    {
-      sh_ipvx_ntoa (tmp_peer_IP, sizeof(tmp_peer_IP), addr_peer);
-      sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_RESPEER,
-		      claim, tmp_peer_IP);
-      SL_RETURN ((0), _("check_addr"));
-    }
-
-  sh_ipvx_ntoa (h_peer_IP, sizeof(h_peer_IP), addr_peer);
-
-  /* reverse lookup
-   */
-  if (0 == sh_ipvx_reverse_check_ok (h_peer, ServerPort, addr_peer))
-    {
-      sh_ipvx_ntoa (tmp_peer_IP, sizeof(tmp_peer_IP), addr_peer);
-
-      sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_LOOKERS,
-		      claim, h_peer, tmp_peer_IP);
-      SL_RETURN ((0), _("check_addr"));
-    }
-
-  /* Check whether claim and peer are identical
-   */
-  sh_tolower(h_peer); /* Canonical name of what the peer is     */
-  sh_tolower(h_name); /* Canonical name of what the peer claims */
-
-  if ((0 == sl_strcmp(h_peer, h_name)) || (0 == sl_strcmp(h_peer_IP, h_name)))
-    {
-      SL_RETURN ((0), _("check_addr"));
-    }
-#if !defined(USE_IPVX)
-  else
-    {
-      struct hostent   * he = sh_gethostbyname(h_peer);
-      int                i = 0;
-      int                flag = 0;
-
-      while (he->h_aliases[i] != NULL)
-	{
-	  if (0 == sl_strcmp(sh_tolower(he->h_aliases[i]), h_name))
-	    {
-	      flag = 1;
-	      break;
-	    }
-	  ++i;
-	}
-      if (flag == 0) 
-	sh_error_handle(lookup_err, FIL__, __LINE__, 0, MSG_TCP_LOOKUP,
-			claim, h_peer);
-    }
-#endif
-
-  SL_RETURN ((0), _("check_addr"));
-}
-
-static int UseSocketPeer = S_FALSE;
-
-int set_socket_peer (const char * c)
-{
-  return sh_util_flagval(c, &UseSocketPeer);
-}
-
-
-/* -- Search register. --
- */
-client_t * search_register(sh_conn_t * conn, int pos)
-{
-  alias_t  * this_alias;
-  client_t * this_client;
-  char       peer_ip[SH_IP_BUF];
-  char       numerical[SH_IP_BUF];
-  char       peer_name[MAXHOSTNAMELEN+1];
-  char     * search_string;
-
-  struct sh_sockaddr peer_addr;
-  char             * canonical;
-
-  SL_ENTER(_("search_register"));
-
-  if (UseSocketPeer == S_TRUE)
-    {
-      memcpy(&peer_addr, &(conn->addr_peer), sizeof(struct sh_sockaddr));
-      sh_ipvx_ntoa (peer_ip, sizeof(peer_ip), &peer_addr);
-      peer_name[0] = '\0';
-
-      /* get canonical name of socket peer
-       */
-      canonical = sh_ipvx_canonical(peer_ip, numerical, sizeof(numerical));
-
-      if (canonical != NULL)
-	{
-	  if (0 == sl_strcmp(canonical, _("localhost")))
-	    sl_strlcpy(peer_name, sh.host.name, MAXHOSTNAMELEN + 1);
-	  else
-	    sl_strlcpy(peer_name, canonical,    MAXHOSTNAMELEN + 1);
-	  SH_FREE(canonical);
-	}
-
-      if (0 == sh_ipvx_reverse_check_ok (peer_name, ServerPort, &peer_addr))
-	{
-	  sl_strlcpy(peer_name, peer_ip, MAXHOSTNAMELEN + 1);
-	}
-      else
-	{
-	  this_alias = zAVLSearch(all_aliases, peer_name);
-	  if (this_alias)
-	    {
-	      sl_strlcpy(peer_name, this_alias->hostname, MAXHOSTNAMELEN + 1);
-	    }
-	}
-
-      search_string = peer_name;
-    }
-  else
-    {
-      search_string = &(conn->buf[pos]);
-
-      if (0 != check_addr (search_string, &(conn->addr_peer)))
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Reverse lookup failed"), search_string);
-	  sh_xfer_do_free (conn);
-	  SL_RETURN( NULL, _("search_register"));
-	} 
-    }
-
-  sh_tolower(search_string);
-
-  /* ----  search the register  -----
-   */
-  this_client = zAVLSearch(all_clients, search_string);
-
-  if (this_client == NULL)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-		      _("Not in client list"), search_string);
-      sh_xfer_do_free (conn);
-      SL_RETURN( NULL, _("search_register"));
-    } 
-  if (this_client->exit_flag == 1)
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<this_client->exit_flag == 1>\n")));
-      this_client->session_key_timer = (time_t) 0;
-      this_client->session_key[0]    = '\0';
-      this_client->exit_flag         = 0;    
-    }
-  TPT((0, FIL__, __LINE__, _("msg=<search_register: client %s>\n"), 
-       this_client->hostname));
-  TPT((0, FIL__, __LINE__, _("msg=<search_register: key %s>\n"), 
-       this_client->session_key));
-  SL_RETURN( this_client, _("search_register"));
-}  
-
-client_t * do_check_client(sh_conn_t * conn, int * retval)
-{
-  client_t * this_client = NULL; 
-  char sigbuf[KEYBUF_SIZE];
-  
-  *retval = 0;
-
-  TPT(( 0, FIL__, __LINE__, _("msg=<Client connect - HELO (1).>\n")));
-	  
-  if (conn->buf == NULL || sl_strlen(conn->buf) <= KEY_LEN)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
-      sh_xfer_do_free (conn);
-      return NULL;
-    } 
-	  
-  /* ----  search the register  -----
-   */
-  
-  this_client = search_register (conn, KEY_LEN);
-  if (this_client == NULL)
-    return NULL;
-  
-  /* ---- force authentication -----
-   */
-  
-  if (this_client->session_key[0] == '\0' ||
-      (time(NULL) - this_client->session_key_timer) 
-      > (time_t) TIMEOUT_KEY )
-    {
-      size_t len;
-
-      /* fake an auth request and jump there
-       */
-      conn->head[0]  = (conn->head[0] | SH_PROTO_SRP);
-      conn->head[3]  = 'S';
-      conn->head[4]  = 'A';
-      conn->head[5]  = 'L';
-      conn->head[6]  = 'T';
-      if (flag_err_info == S_TRUE)
-	sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FAUTH,
-			&(conn->buf[KEY_LEN]));
-      len = sl_strlen(&(conn->buf[KEY_LEN])) + 1;
-      /* may overlap, thus only memmove is correct */
-      memmove(conn->buf, &(conn->buf[KEY_LEN]), len); 
-      this_client->session_key[0]    = '\0';
-      this_client->session_key_timer = (time_t) 1;
-      *retval = -1;
-      return NULL;
-    }
-
-  /* --- check whether hostname is properly signed ---
-   */ 
-  if (conn->K != NULL) 
-    {
-      SH_FREE(conn->K);
-      conn->K = NULL;
-    }
-  
-  conn->K = SH_ALLOC(KEY_LEN+1);
-  
-  sl_strlcpy (conn->K, 
-	      sh_util_siggen(this_client->session_key,
-			     &(conn->buf[KEY_LEN]),
-			     sl_strlen(&(conn->buf[KEY_LEN])),
-			     sigbuf, sizeof(sigbuf)),
-	      KEY_LEN+1);
-  
-  if (0 != sl_ts_strncmp(conn->K, conn->buf, KEY_LEN))
-    {
-      TPT((0, FIL__, __LINE__, _("msg=<clt %s>\n"), conn->buf));
-      TPT((0, FIL__, __LINE__, _("msg=<srv %s>\n"), conn->K));
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-		      _("Signature mismatch"), 
-		      &(conn->buf[KEY_LEN]));
-      
-      this_client->session_key_timer =
-	time(NULL) - (2*TIMEOUT_KEY);
-      
-      sh_xfer_do_free (conn);
-      return NULL;
-    }
-  SH_FREE(conn->K); 
-  conn->K = NULL;
-
-  return this_client;
-}
-
-/* ------------------------------------------------------
- *
- *  FILE TRANSFER
- *
- * ------------------------------------------------------ */
-
-static void do_file_send_data(sh_conn_t * conn)
-{
-  char     * read_buf = 0;
-  char     * send_buf;
-  int        bytes;
-  SL_TICKET  sfd = -1;
-
-  if (conn == NULL    || conn->FileName == NULL)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, sfd, MSG_TCP_NFILE,
-                      conn->peer, 
-                      (conn->FileName == NULL) ? 
-                      _("(NULL)") : conn->FileName);
-      status_update (conn->client_entry, CLT_FAILED);
-      sh_xfer_do_free (conn);
-      return;
-    }
-
-  if (conn->FileSent == conn->FileLength)
-    {
-      send_buf = hash_me(conn->K, conn->peer, sl_strlen(conn->peer));
-#ifdef SH_ENCRYPT
-      sh_xfer_send_crypt (conn, send_buf, sl_strlen(conn->peer)+KEY_LEN, 
-				  _("EEOT"), SH_PROTO_BIG|conn->client_entry->encf_flag);
-#else
-      sh_xfer_send_crypt (conn, send_buf, sl_strlen(conn->peer)+KEY_LEN, 
-				  _("EEOT"), SH_PROTO_BIG);
-#endif
-      SH_FREE(send_buf);
-    }
-  else
-    {
-      bytes = -1;
-
-      sfd = sl_open_read(FIL__, __LINE__, conn->FileName, SL_YESPRIV);
-
-      if (!SL_ISERROR(sfd))
-	{
-	  read_buf = SH_ALLOC(TRANS_BYTES);
-	  if (conn->FileSent > 0)
-	    sl_seek (sfd, (off_t) conn->FileSent);
-	  bytes = sl_read (sfd, read_buf, TRANS_BYTES);
-	  sl_close(sfd);
-	}
-      else
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, sfd, 
-			  MSG_E_ACCESS, (long) geteuid(), conn->FileName);
-	}
-
-      if (bytes >= 0)
-	{
-	  send_buf = hash_me(conn->K, read_buf,  bytes);
-#ifdef SH_ENCRYPT
-	  sh_xfer_send_crypt (conn, send_buf, bytes+KEY_LEN, _("FILE"),  
-				      SH_PROTO_BIG|conn->client_entry->encf_flag);
-#else
-	  sh_xfer_send_crypt (conn, send_buf, bytes+KEY_LEN, _("FILE"),  
-				      SH_PROTO_BIG);
-#endif
-	  conn->FileSent += bytes;
-	  if (send_buf) /* hash_me() *may* return NULL */
-	    SH_FREE(send_buf);
-	  SH_FREE(read_buf);
-	}
-      else
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NFILE, conn->peer,
-			  (conn->FileName == NULL) ? _("(NULL)") : conn->FileName);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  sh_xfer_do_free (conn);
-	}
-    }
-  return;
-}
-
-static void do_file_initial(sh_conn_t * conn)
-{
-  char     * ptok;
-  char       hashbuf[KEYBUF_SIZE];
-
-  /* --- get client nonce and compute hash ---
-   *
-   *  K = H(NSRV, NCLT, session_key) 
-   */ 
-  if (conn->A != NULL)
-    {
-      SH_FREE(conn->A);
-      conn->A = NULL;
-    }
-  conn->A = SH_ALLOC(3*KEY_LEN+1);
-  sl_strlcpy (conn->A, conn->K, KEY_LEN+1); 
-  sl_strlcat(conn->A, conn->buf, /* truncate */
-	     2*KEY_LEN+1);
-  sl_strlcat(conn->A, conn->client_entry->session_key, 
-	     3*KEY_LEN+1);
-  sl_strlcpy (conn->K, sh_tiger_hash(conn->A,TIGER_DATA,3*KEY_LEN,
-				     hashbuf, sizeof(hashbuf)),
-	      KEY_LEN+1);
-  SH_FREE(conn->A); 
-  conn->A = NULL;
-  
-
-  /* Warn about encryption mismatch
-   */
-#ifdef SH_ENCRYPT
-  if ((conn->client_entry->encf_flag != 0) &&  /* server */
-      ((conn->head[0] & SH_PROTO_ENC) == 0))   /* client */
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
-		      _("file download"), _("version2"), _("none"));
-    }
-
-  else if ((conn->client_entry->encf_flag != 0) && /* server */
-	   ((conn->head[0] & SH_MASK_ENC) !=       /* client */
-	    conn->client_entry->encf_flag))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
-		      _("file download"), _("version2"),
-		      ((conn->head[0] & SH_PROTO_ENC) == SH_PROTO_ENC) ? 
-		      _("version2") : _("invalid"));
-      conn->client_entry->encf_flag = (conn->head[0] & SH_MASK_ENC);
-    }
-#else
-  if ((conn->head[0] & SH_PROTO_ENC) != 0) 
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
-		      _("file download"), _("none"), 
-		      ((conn->head[0] & SH_PROTO_ENC) == SH_PROTO_ENC) ? 
-		      _("version2") : _("invalid"));
-    }
-#endif
-  
-  
-  if (conn->FileName != NULL)
-    {
-      SH_FREE(conn->FileName);
-      conn->FileName = NULL;
-    }
-
-  /* Determine what to send
-   */
-  if (0 == sl_strncmp (_("CONF"), &(conn->buf[KEY_LEN]), 4))
-    {
-      strcpy(conn->FileType, _("CONF"));     /* known to fit  */
-      conn->FileName = get_client_conf_file(conn->peer, &(conn->FileLength));
-      conn->FileSent = 0;
-    }
-  else  if (0 == sl_strncmp (_("DATA"), &(conn->buf[KEY_LEN]), 4))
-    {
-      strcpy(conn->FileType, _("DATA"));     /* known to fit  */
-      conn->FileName = get_client_data_file(conn->peer, &(conn->FileLength));
-      conn->FileSent = 0;
-    }
-  else  if (0 == sh_uuid_check(&(conn->buf[KEY_LEN])))
-    {
-      char * uuid = &(conn->buf[KEY_LEN]);
-      strcpy(conn->FileType, _("UUID"));     /* known to fit  */
-      conn->FileName = get_client_uuid_file(conn->peer, &(conn->FileLength), uuid);
-      conn->FileSent = 0;
-    }
-  else
-    {
-      ptok = sh_util_safe_name(&(conn->buf[KEY_LEN]));
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FFILE,
-		      conn->peer, 
-		      ptok);
-      SH_FREE(ptok);
-      status_update (conn->client_entry, CLT_FAILED);
-      sh_xfer_do_free (conn);
-    }
-
-  return;
-}
-
-
-static int do_file_transfer(sh_conn_t * conn, int state)
-{
-  client_t * this_client; 
-  UINT32     ticks;
-  char       hashbuf[KEYBUF_SIZE];
-
-  SL_ENTER(_("do_file_transfer"));
-
-  if (state == SH_DO_READ)        /* finished reading */
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<File transfer - entry.>\n")));
-      
-      /* -- Client requests challenge. --
-       */
-      if (0 == check_request_nerr ((char *) &(conn->head[3]), _("HELO")))
-	{
-	  int client_state;
-
-	  this_client = do_check_client(conn, &client_state);
-	  if (!this_client)
-	    SL_RETURN(client_state, _("do_file_transfer"));
-
-	  /* --- create and send a nonce ---
-	   */
-	  
-	  conn->client_entry = this_client;
-	  sl_strlcpy (conn->peer, &(conn->buf[KEY_LEN]), SH_MINIBUF+1);
-	  
-	  ticks = (UINT32) taus_get ();
-	  
-	  if (conn->K != NULL) 
-	    {
-	      SH_FREE(conn->K);
-	      conn->K = NULL;
-	    }
-	  conn->K = SH_ALLOC(KEY_LEN+1);
-	  sl_strlcpy (conn->K, 
-		      sh_tiger_hash ((char *) &ticks, 
-				     TIGER_DATA, sizeof(UINT32), 
-				     hashbuf, sizeof(hashbuf)), 
-		      KEY_LEN+1);
-	  
-	  TPT((0, FIL__, __LINE__, _("msg=<send nonce>\n")));
-	  sh_xfer_prep_send (conn, conn->K, KEY_LEN+1, _("NSRV"), 
-				SH_PROTO_BIG);
-	}
-
-      /* --- Client has send a message. Check state and message. ---
-       */
-      else if (0 == check_request_nerr((char *)&(conn->head[3]), _("NCLT")) &&
-	       conn->client_entry != NULL                           &&
-	       sl_strlen(conn->buf) > KEY_LEN                       &&
-	       conn->K != NULL)
-	{
-	  
-	  TPT(( 0, FIL__, __LINE__, 
-		_("msg=<File transfer - NCLT (3).>\n")));
-	  
-          do_file_initial(conn);
-	  do_file_send_data(conn);
-	}
-      
-      else if (0 == check_request_nerr((char *)&(conn->head[3]), 
-				       _("RECV"))                    &&
-	       conn->client_entry != NULL                           &&
-	       conn->K != NULL                                      &&
-	       conn->FileName != NULL)
-	{
-	  
-	  TPT(( 0, FIL__, __LINE__, 
-		_("msg=<File transfer - RCVT (5+).>\n")));
-	  
-	  do_file_send_data(conn);
-	}
-      
-      
-      else if (0 == check_request_nerr((char *)&(conn->head[3]), 
-				       _("EOTE")) &&
-	       conn->client_entry != NULL)
-	{
-	  
-	  TPT(( 0, FIL__, __LINE__, 
-		_("msg=<File transfer - EOTE (7).>\n")));
-	  
-	  if (flag_err_info == S_TRUE)
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_OKFILE,
-			    conn->peer);
-	  
-	  if ((conn->client_entry->status_now != CLT_SUSPEND) &&
-	      (conn->client_entry->status_now != CLT_TOOLONG))
-	    { status_update (conn->client_entry, CLT_FILE); }
-	  else
-	    { conn->client_entry->session_key[0]    = '\0'; }
-	  conn->client_entry->last_connect = time (NULL);
-	  sh_xfer_do_free (conn);
-	}
-      
-      
-      /* client does something unexpected
-       */
-      else  /* ---- ??? ----- */
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
-			  1, conn->pass, conn->peer,  
-			  '\\', conn->head[3], '\\',conn->head[4],
-			  '\\', conn->head[5], '\\',conn->head[6]);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  sh_xfer_do_free (conn);
-	}
-    }
-  
-  else if (state == SH_DO_WRITE)  /* finished writing */
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<File transfer - (wait).>\n")));
-      
-      /* challenge is sent, now wait for message from client
-       */
-      conn->headcount     = 0;
-      conn->bytecount     = 0;
-      conn->bytes_to_send = 0;
-      conn->bytes_to_get  = 0;
-      if (conn->buf != NULL) 
-	{
-	  SH_FREE(conn->buf);
-	  conn->buf           = NULL;
-	}
-      conn->state     = CONN_READING;
-    }
-  SL_RETURN(0, _("do_file_transfer"));
-}
-
-/* ------------------------------------------------------
- *
- *  MESSAGE TRANSFER
- *
- * ------------------------------------------------------ */
-static int do_message_transfer(sh_conn_t * conn, int state)
-{
-  client_t * this_client; 
-  char     * cmd;
-  char       hash[SH_MAXMSGLEN + KEY_LEN + KEY_LEN + 1];
-  char     * buffer;
-  int        clt_sev;
-  char     * ptok;
-  UINT32     ticks;
-  size_t     len;
-  int        i;
-  char     * test;
-  char       sigbuf[KEYBUF_SIZE];
-
-  SL_ENTER(_("do_message_transfer"));
-
-  if (state == SH_DO_READ)        /* finished reading */
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<File transfer - entry.>\n")));
-      
-      /* -- Client requests challenge. --
-       */
-      if (0 == check_request_nerr ((char *) &(conn->head[3]), _("HELO")))
-	{
-	  int client_state;
-	  
-	  this_client = do_check_client(conn, &client_state);
-	  if (!this_client)
-	    SL_RETURN(client_state, _("do_message_transfer"));
-	  
-	  
-	  /* -- create a nonce and send it --
-	   */
-	  conn->client_entry = this_client;
-	  sl_strlcpy (conn->peer, &(conn->buf[KEY_LEN]), SH_MINIBUF+1);
-	  
-	  ticks = (UINT32) taus_get ();
-	  
-	  test = (char *) &ticks;
-	  sh_util_cpylong (conn->challenge, test, 4);
-	  conn->challenge[4] = '\0';
-	  for (i = 0; i < 4; ++i)
-	    if (conn->challenge[i] == '\0')
-	      conn->challenge[i] = 0x01;
-      
-	  sh_xfer_prep_send (conn, conn->challenge, 5, _("TALK"), 
-				SH_PROTO_MSG);
-	  TPT(( 0, FIL__, __LINE__, _("msg=<Sent %s.>\n"), 
-		hu_trans(conn->challenge)));
-	}
-      
-      /* Client has send a message. Check whether we are in proper
-       * state, and verify message.
-       */
-      else if (0 == 
-	       check_request_nerr((char *)&(conn->head[3]), _("MESG")) &&
-	       conn->client_entry != NULL                           &&
-	       conn->client_entry->session_key[0] != '\0'           &&
-	       (len = sl_strlen(conn->buf) - KEY_LEN) > 0           &&
-	       sl_strlen(conn->challenge) == 4)
-	{
-	  TPT(( 0, FIL__, __LINE__, 
-		_("msg=<Message transfer - MESG (3).>\n")));
-	  
-#ifdef SH_ENCRYPT
-	  if (conn->client_entry->encf_flag == 0) {
-	    conn->client_entry->ency_flag = 0;
-	  }
-	  if ((conn->client_entry->ency_flag != 0) && 
-	      ((conn->head[0] & SH_PROTO_ENC) == 0)) 
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_MISENC,
-			      _("message transfer"), 
-			      _("version2"),
-			      _("none"));
-	    }
-	  else if ((conn->client_entry->ency_flag != 0) &&
-		   ((conn->head[0] & SH_MASK_ENC) != 
-		    conn->client_entry->ency_flag))
-	    {
-	      sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, 
-			      MSG_TCP_MISENC,
-			      _("message transfer"), 
-			      _("version2"),
-			      ((conn->head[0] & SH_PROTO_ENC) == SH_PROTO_ENC) ? _("version2") : _("invalid"));
-	      conn->client_entry->ency_flag = 
-		(conn->head[0] & SH_MASK_ENC); 
-	    }
-#else
-	  if ((conn->head[0] & SH_PROTO_ENC) != 0) 
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, 
-			      MSG_TCP_MISENC,
-			      _("message transfer"), 
-			      _("none"), 
-			      ((conn->head[0] & SH_PROTO_ENC) == SH_PROTO_ENC) ? _("version2") : _("invalid"));
-	    }
-#endif
-	  
-	  TPT(( 0, FIL__, __LINE__, _("msg=<Rcvt %s.>\n"), conn->buf));
-	  /* get hash from message end, truncate message
-	   */
-	  sl_strlcpy(hash, &(conn->buf[len]), KEY_LEN+1);
-	  conn->buf[len] = '\0';
-	  
-	  /* verify hash
-	   */
-	  buffer = sh_util_strconcat(conn->buf, conn->challenge, NULL);
-	  i =  sl_ts_strncmp(hash, 
-			     sh_util_siggen(conn->client_entry->session_key,
-					    buffer,
-					    sl_strlen(buffer),
-					    sigbuf, sizeof(sigbuf)),
-			     KEY_LEN);
-	  TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
-	       sh_util_siggen(conn->client_entry->session_key,
-			      buffer,
-			      sl_strlen(buffer),
-			      sigbuf, sizeof(sigbuf))));
-	  
-	  
-	  if (0 != i)
-	    {
-	      TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-	      status_update (conn->client_entry, CLT_FAILED);
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			      _("Msg signature mismatch"), conn->peer);
-	      conn->client_entry->session_key_timer = 
-		time(NULL) - (2*TIMEOUT_KEY);
-	      sh_xfer_do_free (conn);
-	      SL_RETURN(0, _("do_message_transfer"));
-	    }
-	  else
-	    {
-	      conn->client_entry->last_connect = time (NULL);
-	      
-	      if (NULL != sl_strstr(conn->buf,      _("EXIT")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  conn->client_entry->exit_flag = 1;
-		  status_update (conn->client_entry, CLT_EXITED);
-		}
-	      else if (NULL != sl_strstr(conn->buf, _("PANIC")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  status_update (conn->client_entry, CLT_PANIC);
-		}
-	      else if (NULL != sl_strstr(conn->buf, _("SUSPEND")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  status_update (conn->client_entry, CLT_SUSPEND);
-		}
-	      else if (NULL != sl_strstr(conn->buf, _("POLICY")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  status_update (conn->client_entry, CLT_POLICY);
-		}
-	      else if (NULL != sl_strstr(conn->buf, 
-					 _("File check completed")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  status_update (conn->client_entry, CLT_CHECK);
-		}
-	      else if (NULL != sl_strstr(conn->buf, _("START")))
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  sh_socket_add2reload (conn->client_entry->hostname);
-		  if (conn->client_entry->status_now == CLT_SUSPEND) {
-		    status_update (conn->client_entry, CLT_ILLEGAL);
-		    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_ILL,
-				    conn->peer);
-		  }
-		  else
-		    status_update (conn->client_entry, CLT_STARTED);
-		}
-	      else
-		{
-		  TPT((0, FIL__, __LINE__, _("msg=<update status>\n")));
-		  if (NULL != sl_strstr(conn->buf, 
-					_("Runtime configuration reloaded")))
-		    {
-		      sh_socket_add2reload (conn->client_entry->hostname);
-		    }
-		  status_update (conn->client_entry, CLT_MSG);
-		}
-	      
-	      TPT((0, FIL__, __LINE__, _("msg=<status updated>\n")));
-	      clt_sev   = atoi(conn->buf);
-	      clt_class = (-1);
-	      ptok    = strchr(conn->buf, '?');
-	      if (ptok != NULL)
-		{
-		  ++ptok;
-		  if (ptok != NULL && sh.flag.client_class == S_TRUE) 
-		    clt_class = atoi(ptok);  /* is a global */
-		  ptok = strchr(ptok, '?');
-		  if (ptok != NULL) 
-		    ++ptok;
-		}
-	      if (sh.flag.client_severity == S_FALSE)
-		clt_sev = (-1);
-	      
-	      /* here we expect an xml formatted message, thus we don't
-		 escape xml special chars (flag == 0) */
-	      ptok = 
-		sh_tools_safe_name ((ptok!=NULL) ? ptok : conn->buf, 0);
-	      
-	      /* push client name to error routine
-	       */
-#if defined(SH_WITH_SERVER) && defined(HAVE_LIBPRELUDE)
-	      {
-		char peer_ip[SH_IP_BUF];
-		sh_ipvx_ntoa(peer_ip, sizeof(peer_ip), &(conn->addr_peer)); 
-		sh_error_set_peer_ip( peer_ip );
-	      }                        
-#endif
-	      {
-		char * pstrip = sh_strip_domain (conn->peer);
-		sh_error_set_peer(pstrip);
-		sh_error_handle(clt_sev, FIL__, __LINE__, 0, MSG_TCP_MSG,
-				pstrip, 
-				ptok);
-		SH_FREE(pstrip);
-		sh_error_set_peer(NULL);
-	      }
-#if defined(SH_WITH_SERVER) && defined(HAVE_LIBPRELUDE)
-	      sh_error_set_peer_ip(NULL);
-#endif
-	      
-	      TPT((0, FIL__, __LINE__, _("msg=<%s>\n"), ptok));
-	      SH_FREE(ptok);
-	      clt_class = (-1);
-	    }
-	  memset(buffer, 0, sl_strlen(buffer));
-	  SH_FREE(buffer);
-	  
-	  /* SERVER CONF SEND
-	   */
-	  buffer = sh_util_strconcat(conn->buf,
-				     conn->challenge,
-				     NULL);
-	  sl_strlcpy(hash, 
-		     sh_util_siggen ( conn->client_entry->session_key,
-				      buffer,
-				      sl_strlen(buffer),
-				      sigbuf, sizeof(sigbuf)),
-		     KEY_LEN+1);
-	  
-	  /* --- SERVER CMD --- */
-	  cmd = sh_socket_check (conn->peer);
-	  
-	  if (cmd != NULL)
-	    {
-	      /* max cmd size is SH_MAXMSGLEN bytes
-	       */
-	      sl_strlcpy(&hash[KEY_LEN], cmd, SH_MAXMSGLEN);
-	      sl_strlcat(&hash[KEY_LEN],
-			 sh_util_siggen ( conn->client_entry->session_key,
-					  &hash[KEY_LEN],
-					  sl_strlen(&hash[KEY_LEN]),
-					  sigbuf, sizeof(sigbuf)),
-			 SH_MAXMSGLEN+KEY_LEN+1);
-	      
-	      TPT((0, FIL__, __LINE__, _("CONF SEND <0> <%s>\n"), 
-		   &hash[KEY_LEN]));
-	      
-	    } else {
-	    
-	    TPT((0, FIL__, __LINE__, _("CONF SEND <0> <[NULL]>\n")));
-	    
-	  }
-	  /* --- SERVER CMD END --- */
-	  
-	  TPT((0, FIL__, __LINE__, _("msg=<sign %s.>\n"),
-	       sh_util_siggen(conn->client_entry->session_key,
-			      buffer,
-			      sl_strlen(buffer),
-			      sigbuf, sizeof(sigbuf))));
-	  
-#ifdef SH_ENCRYPT
-	  sh_xfer_send_crypt (conn, hash, 
-			      sl_strlen(hash) /* KEY_LEN */, 
-			      _("CONF"), 
-			      SH_PROTO_MSG|SH_PROTO_END|conn->client_entry->ency_flag);
-#else
-	  sh_xfer_send_crypt (conn, hash, 
-			      sl_strlen(hash) /* KEY_LEN */, 
-			      _("CONF"), 
-			      SH_PROTO_MSG|SH_PROTO_END);
-#endif
-	  
-	  memset(buffer, 0, sl_strlen(buffer));
-	  SH_FREE(buffer);
-	  
-	  /* sh_xfer_do_free (conn); */
-	}
-      
-      /* client does something unexpected
-       */
-      else  /* ---- ??? ----- */
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
-			  2, conn->pass, conn->peer,  
-			  '\\', conn->head[3], '\\',conn->head[4],
-			  '\\', conn->head[5], '\\',conn->head[6]);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  sh_xfer_do_free (conn);
-	}
-    }
-
-  else if (state == SH_DO_WRITE)  /* finished writing */
-    {
-      if (0 != (conn->head[0] & SH_PROTO_END))
-	{
-	  if (flag_err_debug == S_TRUE)
-	    {
-	      char * pstrip = sh_strip_domain (conn->peer);
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_OKMSG,
-			      pstrip);
-	      SH_FREE(pstrip);
-	    }
-	  sh_xfer_do_free (conn);
-	  SL_RETURN(0, _("do_message_transfer"));
-	}
-      
-      TPT(( 0, FIL__, __LINE__, _("msg=<Msg transfer - (wait).>\n")));
-      
-      /* challenge is sent, now wait for message from client
-       */
-      conn->headcount     = 0;
-      conn->bytecount     = 0;
-      conn->bytes_to_send = 0;
-      conn->bytes_to_get  = 0;
-      if (conn->buf != NULL) 
-	{
-	  SH_FREE(conn->buf);
-	  conn->buf           = NULL;
-	}
-      conn->state     = CONN_READING;
-    }
-  TPT((0, FIL__, __LINE__, _("msg=<return>\n") ));
-  SL_RETURN(0, _("do_message_transfer"));
-}
-
-/* ------------------------------------------------------
- *
- *  AUTHENTICATION
- *
- * ------------------------------------------------------ */
-
-static void check_probe(sh_conn_t * conn)
-{
-  if (conn && conn->client_entry)
-    {
-      /* If client has sent probe, change ivst_flag and clear probe in head[0].
-       */
-      conn->head[0] = sh_tools_probe_store(conn->head[0], 
-					   &(conn->client_entry->ivst_flag));
-    }
-}
-
-client_t * do_auth_start(sh_conn_t * conn)
-{
-  client_t * this_client;
-
-  TPT((0, FIL__, __LINE__, 
-       _("msg=<Authentication - SALT (1).>\n")));
-  
-  if (conn->buf == NULL || sl_strlen(conn->buf) == 0)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOCLT);
-      sh_xfer_do_free (conn);
-      return NULL;
-    } 
-                  
-  /* search the register
-   */
-  
-  this_client = search_register (conn, 0);
-  if (NULL == this_client)
-    return NULL;
-    
-  conn->client_entry = this_client;
-  sl_strlcpy (conn->peer, conn->buf, SH_MINIBUF+1);
-  
-  if (0 != check_request_s((char *)&(conn->head[3]), 
-			   _("SALT"),conn->peer))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-		      _("No salt requested"), conn->peer);
-      status_update (conn->client_entry, CLT_FAILED);
-      conn->client_entry->session_key_timer = 
-	time(NULL) - (2*TIMEOUT_KEY);
-      sh_xfer_do_free (conn);
-      return NULL;
-    }
-
-  check_probe(conn);
-  return this_client;
-}
-
-#if !defined(USE_SRP_PROTOCOL)
-
-int do_auth(sh_conn_t * conn)
-{
-  client_t * this_client; 
-  UINT32     ticks;
-  char       u[5] = "OOOO";
-#ifdef SH_ENCRYPT
-  int        err_num;
-  char expbuf[SH_ERRBUF_SIZE];
-#endif
-  char       hash[SH_MAXMSGLEN + KEY_LEN + KEY_LEN + 1];
-  char hashbuf[KEYBUF_SIZE];
-
-  /* first pass -- client request salt  
-   */
-  if (conn->pass    == 1) 
-    {
-      this_client = do_auth_start(conn);
-
-      if (!this_client)
-	return -1;
-
-      /* -- create server nounce v --
-       */
-      ticks = (UINT32) taus_get ();
-      
-      if (conn->A != NULL)
-	{
-	  SH_FREE(conn->A);
-	  conn->A = NULL;
-	}
-      conn->A = SH_ALLOC(KEY_LEN+1);
-      
-      sl_strlcpy(conn->A, 
-		 sh_tiger_hash((char *) &ticks, 
-			       TIGER_DATA, sizeof(UINT32), 
-			       hashbuf, sizeof(hashbuf)),
-		 KEY_LEN+1);
-      u[0] = 'I'; u[1] = 'N'; u[2] = 'I'; u[3] = 'T'; u[4] = '\0';
-      
-      if (conn->M1 != NULL)
-	{
-	  SH_FREE(conn->M1);
-	  conn->M1 = NULL;
-	}
-      conn->M1 = SH_ALLOC(2*KEY_LEN+1);
-      
-      /* compute hash key H(v(server), P)v(server)
-       */
-      sh_passwd (conn->A, conn->client_entry->verifier, 
-		 NULL, conn->M1);
-      
-      sl_strlcat(conn->M1, conn->A, 2*KEY_LEN+1);
-      
-      
-      /* --- send H(v(server), P)v(server) ----
-       */
-      sh_xfer_prep_send (conn, 
-			    conn->M1, 
-			    sl_strlen(conn->M1), 
-			    u, 
-			    (conn->head[0]|SH_PROTO_SRP));
-      
-      SH_FREE(conn->M1); 
-      conn->M1 = NULL;
-    }
-  
-  /* client -- third pass
-   * Message is H(H(u,v),P)u
-   *
-   * A := v, verifier := H(password), 
-   */
-  else if (conn->pass    == 3                   && 
-	   conn->client_entry != NULL)
-    {
-      
-      TPT((0, FIL__, __LINE__, 
-	   _("msg=<Authentication - PASS (3).>\n")));
-      
-      if (0 != check_request_s((char *) &(conn->head[3]), _("PASS"), 
-			       conn->peer)                    ||
-	  sl_strlen(conn->buf) <= KEY_LEN                        ||
-	  conn->A == NULL)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Invalid client request"), conn->peer);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  sh_xfer_do_free (conn);
-	  return -1;
-	} 
-
-      check_probe(conn);
-
-      /* store random nonce u from client
-       */
-      if (conn->K != NULL)
-	{
-	  SH_FREE(conn->K);
-	  conn->K = NULL;
-	}
-      conn->K = SH_ALLOC(KEY_LEN+1);
-      sl_strlcpy(conn->K, &(conn->buf[KEY_LEN]), KEY_LEN+1);
-      
-      /* verify random nonce u from client
-       */
-      if (conn->M1 != NULL)
-	{
-	  SH_FREE(conn->M1);
-	  conn->M1 = NULL;
-	}
-      conn->M1 = sh_util_strconcat(conn->K, conn->A, NULL);
-      
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: K = %s>\n"), conn->K));
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: A = %s>\n"), conn->A));
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: M = %s>\n"), conn->M1));
-      
-      sl_strlcpy(hash, sh_tiger_hash (conn->M1, 
-				      TIGER_DATA, 
-				      sl_strlen(conn->M1),
-				      hashbuf, sizeof(hashbuf)), 
-		 KEY_LEN+1); 
-      sh_passwd (hash, conn->client_entry->verifier, NULL, conn->M1);
-      
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: H = %s>\n"), hash));
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: P = %s>\n"), conn->M1));
-      
-      if ( 0 != sl_ts_strncmp(conn->M1, conn->buf, KEY_LEN))
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Session key mismatch"), conn->peer);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  sh_xfer_do_free (conn);
-	  return -1;
-	} 
-      
-      /* ---- compute hash key H(v, P, u) ----
-       */
-      sh_passwd (conn->A, conn->client_entry->verifier, conn->K,
-		 conn->M1);
-      
-      sl_strlcpy(conn->client_entry->session_key, 
-		 conn->M1, KEY_LEN+1);
-      TPT((0, FIL__, __LINE__, _("msg=<c/r: Key = %s>\n"), 
-	   conn->client_entry->session_key));
-      
-#ifdef SH_ENCRYPT
-      err_num = rijndael_makeKey(&(conn->client_entry->keyInstE), 
-				 DIR_ENCRYPT, 192, 
-				 conn->client_entry->session_key);
-      if (err_num < 0)
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("check_protocol: makeKey"));
-      err_num = rijndael_makeKey(&(conn->client_entry->keyInstD), 
-				 DIR_DECRYPT, 192, 
-				 conn->client_entry->session_key);
-      if (err_num < 0)
-	sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			_("check_protocol: makeKey"));
-#endif
-      
-      if (conn->K  != NULL) SH_FREE (conn->K);
-      conn->K  = NULL;
-      if (conn->A  != NULL) SH_FREE (conn->A);
-      conn->A  = NULL;
-      if (conn->M1 != NULL) SH_FREE (conn->M1);
-      conn->M1 = NULL;
-      
-      /* if (conn->client_entry->status_now == CLT_STARTED */
-      if (((conn->client_entry->status_now != CLT_INACTIVE) &&
-	   (conn->client_entry->status_now != CLT_EXITED)   &&
-	   (conn->client_entry->status_now != CLT_SUSPEND))
-	  && conn->client_entry->session_key_timer > (time_t) 1)
-	{
-	  status_update (conn->client_entry, CLT_ILLEGAL);
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_ILL,
-			  conn->peer);
-	}
-      else if (conn->client_entry->session_key_timer == (time_t) 0)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NEW,
-			  conn->peer);
-	  if (conn->client_entry->status_now != CLT_SUSPEND)
-	    status_update (conn->client_entry, CLT_STARTED);
-	}
-      
-      conn->client_entry->session_key_timer = time (NULL);
-      conn->client_entry->last_connect = time (NULL);
-      
-      /* put in read state
-       */
-      sh_xfer_prep_send (conn, 
-			    _("AUTH"),
-			    5, 
-			    _("AUTH"), 
-			    (conn->head[0]|SH_PROTO_SRP));
-      
-    }
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
-		      3, conn->pass, conn->peer, 
-		      '\\', conn->head[3], '\\', conn->head[4],
-		      '\\', conn->head[5], '\\', conn->head[6]);
-      sh_xfer_do_free (conn);
-    }
-  return 0;
-}
-
-#else
-
-static void noise()
-{
-  UINT32 n = taus_get();
-  retry_msleep(0, (n & 0x0000007F));
-  return;
-}
-  
-/* use SRP */
-
-int do_auth(sh_conn_t * conn)
-{
-  client_t * this_client; 
-  UINT32     ticks;
-  char       u[5] = "OOOO";
-#ifdef SH_ENCRYPT
-  int        err_num;
-  char expbuf[SH_ERRBUF_SIZE];
-#endif
-  size_t     len;
-  char     * test;
-  char     * foo_B;
-  char     * foo_Ss;
-  char hashbuf[KEYBUF_SIZE];
-
-  /* use SRP                    
-   */
-  if (conn->pass == 1)
-    {
-      this_client = do_auth_start(conn);
-      if (!this_client)
-	return -1;
-
-      u[0] = 'I'; u[1] = 'N'; u[2] = 'I'; u[3] = 'T'; u[4] = '\0';
-      sh_xfer_prep_send (conn, 
-			    conn->client_entry->salt, 
-			    sl_strlen(conn->client_entry->salt), 
-			    u, 
-			    (conn->head[0]|SH_PROTO_SRP));
-    }
-
-  /* client has sent A -- third pass
-   */
-  else if (conn->pass == 3                    && 
-	   conn->client_entry != NULL)
-    {
-      
-      TPT((0, FIL__, __LINE__, 
-	   _("msg=<Authentication - PC01 (3).>\n")));
-      
-      if (0 != check_request_s((char *)&(conn->head[3]),_("PC01"),conn->peer)||
-	  conn->buf == NULL
-	  )
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Invalid client request"), conn->peer);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  sh_xfer_do_free (conn);
-	  return -1;
-	} 
-      
-      check_probe(conn); noise();
-
-      if (0 != sh_srp_init())
-	{
-	  status_update (conn->client_entry, CLT_FAILED);
-	  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-			  MSG_TCP_EBGN);
-	  sh_xfer_do_free (conn);
-	  return -1;
-	}
-      
-      
-      /* check A, only send B if correct 
-       */
-      if ( sl_strlen(conn->buf) < SH_BUFSIZE && 
-	   0 == sh_srp_check_zero (conn->buf) )
-	{
-	  len = sl_strlen(conn->buf)+1;
-	  
-	  if (conn->A != NULL)
-	    {
-	      SH_FREE(conn->A);
-	      conn->A = NULL;
-	    }
-	  conn->A = SH_ALLOC(len);
-	  sl_strlcpy (conn->A, conn->buf, len);
-	  
-	  /* 
-	   * compute B 
-	   */
-	  if (0 != sh_srp_make_a ())     /* b        random number */
-	    {
-	      status_update (conn->client_entry, CLT_FAILED);
-	      
-	      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-			      MSG_TCP_EBGN);
-	      sh_srp_exit();
-	      sh_xfer_do_free (conn);
-	      return -1;
-	    }
-	  
-	  foo_B = sh_srp_B               /* B = v + g^b            */
-	    (conn->client_entry->verifier);
-	  
-	  if (foo_B == NULL)
-	    {
-	      status_update (conn->client_entry, CLT_FAILED);
-	      
-	      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-			      MSG_TCP_EBGN);
-	      sh_srp_exit();
-	      sh_xfer_do_free (conn);
-	      return -1;
-	    }
-	  
-	  TPT((0, FIL__, __LINE__, _("msg=<srp: A = %s>\n"), conn->A));
-	  TPT((0, FIL__, __LINE__, _("msg=<srp: B = %s>\n"), foo_B));
-	  
-	  /* 
-	   * create nonce u 
-	   */
-	  ticks = (UINT32) taus_get ();
-	  
-	  test = (char *) &ticks;
-	  sh_util_cpylong (u, test, 4);  /* u        nounce        */
-	  u[4] = '\0';
-	  sl_strlcpy(conn->challenge, 
-		     sh_tiger_hash(u, TIGER_DATA, 4, hashbuf, sizeof(hashbuf)),
-		     SH_CHALLENGE_SIZE);
-	  
-	  TPT((0, FIL__, __LINE__, _("msg=<srp: u = %03o-%03o-%03o-%03o>\n"), u[0], u[1], u[2], u[3]));
-	  TPT((0, FIL__, __LINE__, _("msg=<srp: U = %s>\n"), 
-	       conn->challenge));
-	  
-	  /* 
-	   * compute the session key K and M1 = Hash(A,B,K)
-	   */
-	  foo_Ss = sh_srp_S_s (conn->challenge, 
-			       conn->A, 
-			       conn->client_entry->verifier);
-	  
-	  if (foo_Ss == NULL || 0 != sh_srp_check_zero (foo_Ss))
-	    {
-	      status_update (conn->client_entry, CLT_FAILED);
-	      
-	      sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-			      MSG_TCP_EBGN);
-	      sh_srp_exit();
-	      sh_xfer_do_free (conn);
-	      return -1;
-	    }
-	  
-	  if (conn->K != NULL)
-	    {
-	      SH_FREE(conn->K);
-	      conn->K = NULL;
-	    }
-	  conn->K = SH_ALLOC(KEY_LEN+1);
-	  sl_strlcpy(conn->K, 
-		     sh_tiger_hash(foo_Ss, TIGER_DATA, 
-				   sl_strlen(foo_Ss), 
-				   hashbuf, sizeof(hashbuf)),
-		     KEY_LEN+1);
-	  
-	  if (conn->M1 != NULL)
-	    {
-	      SH_FREE(conn->M1);
-	      conn->M1 = NULL;
-	    }
-	  conn->M1 = SH_ALLOC(KEY_LEN+1);
-	  sh_srp_M (conn->A, foo_B, conn->K, conn->M1, KEY_LEN+1);
-	  
-	  TPT((0, FIL__, __LINE__, _("msg=<srp:Ss = %s>\n"), foo_Ss));
-	  TPT((0, FIL__, __LINE__, _("msg=<srp: K = %s>\n"), conn->K));
-	  TPT((0, FIL__, __LINE__, _("msg=<srp:M1 = %s>\n"),conn->M1));
-	  
-	  /*
-	   * send B
-	   */
-	  sh_xfer_prep_send (conn, 
-				foo_B,
-				sl_strlen(foo_B)+1,
-				u,
-				(conn->head[0]|SH_PROTO_SRP));
-	  if (foo_Ss != NULL)
-	    {
-	      SH_FREE(foo_Ss);
-	      foo_Ss = NULL;
-	    }
-	  if (foo_B  != NULL)
-	    {
-	      SH_FREE(foo_B);
-	      foo_B = NULL;
-	    }
-	}
-      else
-	{
-	  status_update (conn->client_entry, CLT_FAILED);
-	  
-	  sh_error_handle(SH_ERR_SEVERE, FIL__, __LINE__, 0, 
-			  MSG_TCP_EZERO);
-	  sh_xfer_do_free (conn);
-	}
-      
-      sh_srp_exit();
-    }
-  
-  /* client has sent M1 -- fifth pass
-   */
-  else if (conn->pass    == 5           && 
-	   conn->client_entry != NULL) 
-    {
-      TPT((0, FIL__, __LINE__, 
-	   _("msg=<Authentication - PC02 (5).>\n")));
-      
-      /* check that the state is valid
-       */
-      if (0 != check_request_s((char *)&(conn->head[3]), _("PC02"),
-			       conn->peer)                   ||
-	  conn->A == NULL || conn->K == NULL || conn->M1 == NULL)
-	{
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Invalid client request"), conn->peer);
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  sh_xfer_do_free (conn);
-	  return -1;
-	} 
-
-      check_probe(conn); noise();
-
-      /* ------ verify M1 = H(A,  B, K) -------
-       * -----    send M2 = H(A, M1, K) -------
-       */
-      if (conn->buf != NULL && 
-	  sl_ts_strncmp(conn->buf, conn->M1, KEY_LEN) == 0)
-	{
-	  /*
-	   * send M2
-	   */
-	  char M_buf[KEY_LEN+1];
-	  sh_xfer_prep_send (conn, 
-				sh_srp_M (conn->A, conn->M1, conn->K,
-					  M_buf, sizeof(M_buf)),
-				KEY_LEN+1,
-				_("PARP"),
-				(conn->head[0]|SH_PROTO_SRP));
-	  
-	  if (conn->A  != NULL)
-	    SH_FREE(conn->A);
-	  conn->A  = NULL;
-	  if (conn->M1 != NULL)
-	    SH_FREE(conn->M1);
-	  conn->M1 = NULL;
-	  sl_strlcpy(conn->client_entry->session_key, 
-		     conn->K, KEY_LEN+1);
-	  TPT((0, FIL__, __LINE__, _("msg=<key %s>\n"), 
-	       conn->client_entry->session_key));
-	  
-#ifdef SH_ENCRYPT
-	  err_num = rijndael_makeKey(&(conn->client_entry->keyInstE), 
-				     DIR_ENCRYPT, 192, 
-				     conn->client_entry->session_key);
-	  if (err_num < 0)
-	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			    errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			    _("sh_xfer_prep_send_int: makeKey"));
-	  err_num = rijndael_makeKey(&(conn->client_entry->keyInstD), 
-				     DIR_DECRYPT, 192, 
-				     conn->client_entry->session_key);
-	  if (err_num < 0)
-	    sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,
-			    errorExplain(err_num, expbuf, sizeof(expbuf)), 
-			    _("sh_xfer_prep_send_int: makeKey"));
-#endif
-	  
-	  if (conn->K  != NULL)
-	    SH_FREE(conn->K);
-	  conn->K  = NULL;
-	  
-	  conn->client_entry->last_connect = time (NULL);
-	  
-	  if (((conn->client_entry->status_now != CLT_INACTIVE) &&
-	       (conn->client_entry->status_now != CLT_EXITED)   &&
-	       (conn->client_entry->status_now != CLT_SUSPEND))
-	      && conn->client_entry->session_key_timer > (time_t) 1)
-	    {
-	      status_update (conn->client_entry, CLT_ILLEGAL);
-	      
-	      sh_error_handle((-1), FIL__, __LINE__, 0, 
-			      MSG_TCP_ILL,
-			      conn->peer);
-	    }
-	  else if (conn->client_entry->session_key_timer == (time_t) 0)
-	    {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, 
-			      MSG_TCP_NEW,
-			      conn->peer);
-	      if (conn->client_entry->status_now != CLT_SUSPEND)
-		status_update (conn->client_entry, CLT_STARTED);
-	    }
-	  conn->client_entry->session_key_timer = time (NULL);
-	  
-	}
-      else
-	{
-	  status_update (conn->client_entry, CLT_FAILED);
-	  conn->client_entry->session_key_timer = 
-	    time(NULL) - (2*TIMEOUT_KEY);
-	  
-	  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_BADCONN,
-			  _("Session key mismatch"), conn->peer);
-	  sh_xfer_do_free (conn);
-	} 
-    }
-  
-  else
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_FINV,
-		      4, conn->pass, conn->peer, 
-		      '\\', conn->head[3], '\\', conn->head[4],
-		      '\\', conn->head[5], '\\', conn->head[6]);
-      sh_xfer_do_free (conn);
-    }
-  return 0;
-}
-#endif
-
-/************************************************************************
- *
- * Here we check the message received, and decide on the answer to send
- * (if any). The connection is in CONN_PAUSED state, thus we must:
- * (i)   define the proper reaction
- * (ii)  reset to CONN_READING or CONN_WRITING or CONN_FREE
- * (iii) eventually reset the connection entry
- *
- *************************************************************************/
-static
-void check_protocol(sh_conn_t * conn, int state)
-{
-  SL_ENTER(_("check_protocol"));
-
-  /* seed / re-seed the PRNG if required
-   */
-  (void) taus_seed();
-
-  /* protocols: 
-   * -- (iii)    file transfer
-   * -- (ii)     authenticated message transfer
-   * -- (i)      SRP key exchange
-   */
-
-  /* --------- FILE TRANSFER  -----------
-   */
-  if ( (conn->head[0] & SH_PROTO_SRP) == 0  &&
-       (conn->head[0] & SH_PROTO_BIG) != 0  /* is set */ )
-    {
-      /* nonzero means re-authentication is required
-       */
-      if (0 == do_file_transfer(conn, state))
-	SL_RET0(_("check_protocol"));
-    }
-  /* --------- END FILE TRANSFER ----------- */
-
-
-  /* ---------  message exchange  -----------
-   */
-  else if ((conn->head[0] & SH_PROTO_SRP) == 0  && 
-	   (conn->head[0] & SH_PROTO_MSG) != 0  /* is set */ )
-    {
-      /* nonzero means re-authentication is required
-       */
-      if (0 == do_message_transfer(conn, state))
-	SL_RET0(_("check_protocol"));
-    }
-  /* ---------  END MESSAGE TRANSFER ------ */
-
-  /* ---------  authentication  -----------
-   */
-  if ( (conn->head[0] & SH_PROTO_SRP) != 0   /* is set */ )
-    {
-      if (state == SH_DO_READ)        /* finished reading */
-	{
-	  do_auth(conn);
-	}
-
-      else if (state == SH_DO_WRITE)  /* finished writing */
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Authentication -- (wait).>\n")));
-
-	  conn->headcount     = 0;
-	  conn->bytecount     = 0;
-	  conn->bytes_to_send = 0;
-	  conn->bytes_to_get  = 0;
-	  if (conn->buf != NULL) 
-	    {
-	      SH_FREE(conn->buf);
-	      conn->buf           = NULL;
-	    }
-	  conn->state     = CONN_READING;
-	}
-    }
-  SL_RET0(_("check_protocol"));
-}
-
-
-/***********************************************************
- *
- *    SERVER RECEIVE FUNCTION
- *
- ***********************************************************
- */
-int sh_xfer_do_read (sh_conn_t * conn)
-{
-  unsigned long   byteread;     /* bytes read         */
-
-  SL_ENTER(_("sh_xfer_do_read"));
-
-  if (conn->state == CONN_SENDING)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_SYNC,
-		      conn->peer);
-      SL_RETURN( (-1), _("sh_xfer_do_read"));
-    }
-
-  if (conn->headcount < SH_HEADER_SIZE) 
-    {
-      conn->bytes_to_get = SH_HEADER_SIZE - conn->headcount;
-      byteread = read (conn->fd, &(conn->head[conn->headcount]),
-		       conn->bytes_to_get);
-      if (byteread > 0 || errno == EINTR) 
-	{
-	  if (byteread > 0) 
-	    conn->headcount += byteread;
-	  if (conn->headcount == SH_HEADER_SIZE)
-	    {
-	      conn->bytes_to_get = (256 * (unsigned int)conn->head[1] + 
-				    (unsigned int)conn->head[2]);
-	      SH_SHOWPROT(conn->head, '<');
-	      conn->bytecount = 0;
-	    }
-	}
-      else
-	goto conn_reset;
-      SL_RETURN( (0), _("sh_xfer_do_read"));
-    }
-
-  /* limit message size
-   */
-  conn->bytes_to_get = (conn->bytes_to_get > TRANS_BYTES) ? 
-    TRANS_BYTES : conn->bytes_to_get;
-
-  if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_get > 0)
-    {
-      if ( conn->bytecount == 0)
-	{
-	  if (conn->buf != NULL)
-	    SH_FREE (conn->buf);
-	  conn->buf = SH_ALLOC(conn->bytes_to_get + 1); /* <= TRANS_BYTES+1 */
-	}
-
-      byteread           = read (conn->fd, &(conn->buf[conn->bytecount]),
-				 conn->bytes_to_get - conn->bytecount);
-      if (byteread > 0 || errno == EINTR) 
-	{
-	  if (byteread > 0) 
-	    conn->bytecount    += byteread;
-	  if (conn->bytecount == conn->bytes_to_get) 
-	    {
-	      ++conn->pass;
-	      /* always terminate with NULL - we might use sl_strcmp() */
-	      conn->buf[conn->bytecount] = '\0';
-	      conn->state                = CONN_PAUSE;
-
-#ifdef SH_ENCRYPT
-	      if ((conn->head[0] & SH_PROTO_ENC) != 0) 
-		{
-		  conn->buf = sh_tools_revertPack (conn->head, 
-						   conn->client_entry->ivst_flag,
-						   conn->buf,
-						   &(conn->client_entry->keyInstD),
-						   conn->bytecount);
-		}
-#endif
-	      /* ------  HERE CALL check_protocol(conn) -------  */
-	      check_protocol(conn, SH_DO_READ);
-	    }
-	}
-      else
-	  goto conn_reset;
-    }
-
-  else if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_get == 0)
-    {
-      if (conn->buf != NULL)
-	SH_FREE (conn->buf);
-      conn->buf       = NULL;
-      conn->bytecount = 0;
-      ++conn->pass;
-      conn->state     = CONN_PAUSE;
-      /* ------  HERE CALL check_protocol(conn) -------  */
-      check_protocol(conn, SH_DO_READ);
-    }
-      
-  SL_RETURN( (0), _("sh_xfer_do_read"));
-
- conn_reset:
-  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_RESET,
-		  conn->peer);
-  sh_xfer_do_free ( conn );
-  SL_RETURN( (-1), _("sh_xfer_do_read"));
-}
-
-#if !defined(O_NONBLOCK)
-#if defined(O_NDELAY)
-#define O_NONBLOCK  O_NDELAY
-#else
-#define O_NONBLOCK  0
-#endif
-#endif
-
-/* send to the client
- */
-int sh_xfer_do_write (sh_conn_t * conn)
-{
-  int    flags;
-  long   arg = 0;
-  long   bytesent;     /* bytes read         */
-
-  SL_ENTER(_("sh_xfer_do_write"));
-
-  /* ---- consistency check ------
-   */
-  if (conn->state == CONN_READING)
-    {
-      sh_error_handle( (-1), FIL__, __LINE__, 0, MSG_TCP_SYNC,
-		      conn->peer);
-      SL_RETURN( (-1), _("sh_xfer_do_write"));
-    }
- 
-  flags = retry_fcntl (FIL__, __LINE__, conn->fd, F_GETFL, arg);
-  retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags|O_NONBLOCK);
-
-  /* ---- send the header ------
-   */
-  if (conn->headcount < SH_HEADER_SIZE) 
-    {
-      conn->bytes_to_send = SH_HEADER_SIZE - conn->headcount;
-      bytesent = write (conn->fd, &(conn->head[conn->headcount]), 
-			conn->bytes_to_send);
-      if (bytesent >= 0 || errno == EINTR || errno == EAGAIN) 
-	{
-	  if (bytesent > 0) 
-	    conn->headcount += bytesent;
-	  if (conn->headcount == SH_HEADER_SIZE) 
-	    conn->bytes_to_send = 
-	      (256 * (int)conn->head[1] + (int)conn->head[2]);
-	}
-      else 
-	goto conn_reset_w;
-
-      if (conn->fd >= 0)
-	retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags);
-      SL_RETURN( (0), _("sh_xfer_do_write"));
-    }
-
-  /* ---- send the body ------
-   */
-
-  if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_send > 0 &&
-      conn->buf != NULL)
-    {
-      bytesent = write (conn->fd, &(conn->buf[conn->bytecount]), 
-			conn->bytes_to_send - conn->bytecount);
-      if (bytesent >= 0 || errno == EINTR || errno == EAGAIN) 
-	{
-	  if (bytesent > 0) 
-	    conn->bytecount    += bytesent;
-	  if (conn->bytecount == conn->bytes_to_send) 
-	    {
-	      ++conn->pass;
-	      conn->state = CONN_PAUSE;
-	      /* ------  HERE CALL check_protocol(conn) -------  */
-	      check_protocol(conn, SH_DO_WRITE);
-	    }
-	}
-      else
-	goto conn_reset_w;
-    }
-      
-  else if (conn->headcount == SH_HEADER_SIZE && conn->bytes_to_send == 0)
-    {
-      ++conn->pass;
-      conn->state = CONN_PAUSE;
-      /* ------  HERE CALL check_protocol(conn) -------  */
-      check_protocol(conn, SH_DO_WRITE);
-    }
-
-  if (conn->fd >= 0)
-    retry_fcntl (FIL__, __LINE__, conn->fd, F_SETFL,  flags);
-  SL_RETURN( (0), _("sh_xfer_do_write"));
-
- conn_reset_w:
-  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_RESET,
-		  conn->peer);
-  sh_xfer_do_free ( conn );
-  SL_RETURN( (-1), _("sh_xfer_do_write"));
-}
-
-/* accept a connection from a client
- */ 
-#include <syslog.h>
-#ifdef SH_USE_LIBWRAP
-#include <tcpd.h>
-
-#ifndef ALLOW_SEVERITY 
-#define ALLOW_SEVERITY LOG_INFO
-#define DENY_SEVERITY  LOG_WARNING
-#endif
-
-int allow_severity;
-int deny_severity;
-#endif
-
-#ifdef SH_USE_LIBWRAP
-static int check_libwrap(int rc, sh_conn_t * newconn)
-{
-  struct request_info request;
-  char                errbuf[128];
-  char                daemon[128];
-
-  sl_strlcpy(daemon, SH_INSTALL_NAME, sizeof(daemon));
-  request_init(&request, RQ_DAEMON, daemon, RQ_FILE, rc, 0);
-  fromhost(&request);
-  if (!hosts_access(&request)) 
-    {
-      sl_strlcpy(errbuf, _("Refused connection from "), sizeof(errbuf));
-      sl_strlcat(errbuf,   eval_client(&request), sizeof(errbuf));
-      
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      errbuf, _("libwrap"));
-      newconn->fd    = -1;
-      newconn->state = CONN_FREE;
-      sl_close_fd(FIL__, __LINE__, rc);
-      return -1;
-    }
-  return 0;
-}
-#endif
-
-int sh_xfer_accept (int sock, sh_conn_t * newconn)
-{
-  int                errflag;
-  int                rc;
-  struct sh_sockaddr addr;
-  
-  /* handle AIX (size_t addrlen) in wrapper
-   */
-  int                addrlen = sizeof(addr);
-
-  SL_ENTER(_("sh_xfer_accept"));
-
-  rc = retry_accept(FIL__, __LINE__, sock, &addr, &addrlen);
-
-  if (rc < 0)
-    {
-      char err_buf[SH_ERRBUF_SIZE];
-      errflag = errno;
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      sh_error_message(errflag,err_buf, sizeof(err_buf)), _("accept"));
-      newconn->fd    = -1;
-      newconn->state = CONN_FREE;
-      SL_RETURN( (-1), _("sh_xfer_accept"));
-    }
-
-  if (addrlen == 0)
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN,
-		      _("Connecting entity unknown"), _("accept"));
-      newconn->fd    = -1;
-      newconn->state = CONN_FREE;
-      sl_close_fd(FIL__, __LINE__, rc);
-      SL_RETURN( (-1), _("sh_xfer_accept"));
-    }
-
-#ifdef SH_USE_LIBWRAP
-  if (check_libwrap(rc, newconn) < 0)
-    SL_RETURN( (-1), _("sh_xfer_accept"));
-#endif
-
-  memcpy (&(newconn->addr_peer), &addr, sizeof(struct sh_sockaddr));
-
-  /* prepare for usage of connection
-   */
-  (void) retry_fcntl( FIL__, __LINE__, rc, F_SETFD, 1 );
-  newconn->fd           = rc;
-  newconn->state        = CONN_READING;
-  newconn->timer        = (unsigned long) time (NULL);
-  
-  if (flag_err_info == S_TRUE)
-    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_CNEW, newconn->fd);
-
-  SL_RETURN( (0), _("sh_xfer_accept"));
-}
-
-extern char sh_sig_msg[64];  /* defined in sh_unix.c */
-
-/* ------------  port and interface -------
- */
-static unsigned int server_port = SH_DEFAULT_PORT;
-
-int sh_xfer_set_port (const char * str)
-{
-  int retval = 0;
-  unsigned long   i;
-  char * endptr;
-  
-  SL_ENTER(_("sh_xfer_set_port"));
-  i = strtoul (str, &endptr, 0);
-  if (endptr == str) {
-    retval = -1;
-  } else if (i > 65535) {
-    retval = -1;
-  } else {
-    server_port = i;
-  }
-  SL_RETURN( (retval), _("sh_xfer_set_port"));
-}
-
-static struct sh_sockaddr server_interface;
-static int            use_server_interface = 0;
-
-int sh_xfer_set_interface (const char * str)
-{
-  if (0 == strcmp(str, _("INADDR_ANY")))
-    {
-      use_server_interface = 0;
-      return 0;
-    }
-
-  if (0 == sh_ipvx_aton(str, &server_interface)) 
-    {
-      use_server_interface = 0;
-      return -1;
-    }
-
-  use_server_interface = 1;
-  return 0;
-}
-
-/* ------------  print error --------------
- */
-struct sock_err_st {
-  char msg[128];
-  int  errnum;
-  int  port;
-  int  line;
-  int  euid;
-};
-
-static struct sock_err_st sock_err[2];
-
-void sh_xfer_printerr(char * str, int errnum, unsigned int port, int line)
-{
-  int slot = 0;
-
-  if (port != server_port)
-    slot = 1;
-  if (str == NULL)
-    sock_err[slot].msg[0] = '\0';
-  else
-    sl_strlcpy(sock_err[slot].msg, str, 128);
-  sock_err[slot].errnum = errnum;
-  sock_err[slot].port   = port;
-  sock_err[slot].line   = line;
-  sock_err[slot].euid   = (int) geteuid();
-}
-
-int sh_xfer_printerr_final(int slot)
-{
-  char errbuf[SH_ERRBUF_SIZE];
-
-  SL_ENTER(_("sh_xfer_printerr_final"));
-  if (sock_err[slot].msg[0] != '\0')
-    {
-      dlog(1, FIL__, __LINE__, 
-	   _("Could not set up the listening socket for the server because of the\nfollowing error: %s\nPossible reasons include:\n - insufficient privilege for UID %d, or\n - the port %d is already used by another program.\n"),
-	   sh_error_message(sock_err[slot].errnum, errbuf, sizeof(errbuf)), 
-	   sock_err[slot].euid, 
-	   sock_err[slot].port);
-      sh_error_handle((-1), FIL__, sock_err[slot].line, 
-		      sock_err[slot].errnum, MSG_EXIT_ABORTS,
-		      sh_error_message(sock_err[slot].errnum, errbuf, sizeof(errbuf)),
-		      sh.prg_name,
-		      sock_err[slot].msg);
-      SL_RETURN((-1), _("sh_xfer_printerr_final"));
-    }
-  SL_RETURN(0, _("sh_xfer_printerr_final"));
-}
-
-#define  TIME_OUT_DEF 900
-static   unsigned long  time_out_val = TIME_OUT_DEF;
-
-int sh_xfer_set_timeout (const char * c)
-{
-  long val;
-
-  SL_ENTER(_("sh_xfer_set_time_out"));
-
-  val = strtol (c, (char **)NULL, 10);
-
-  if (val == 0)
-    {
-      val = TIME_OUT_DEF;
-    }
-  else if (val < 0)
-    {
-      time_out_val = TIME_OUT_DEF;
-      SL_RETURN( (-1), _("sh_xfer_set_time_out"));
-    }
-
-  time_out_val = (unsigned long) val;
-  SL_RETURN( (0), _("sh_xfer_set_time_out"));
-}
-
-
-static   sh_conn_t        * conns = NULL;
-static   int  maxconn = 0;  /* maximum number of simultaneous connections */
-
-
-#ifdef INET_SYSLOG
-#define INET_SUSPEND_TIME 180		/* equal to 3 minutes */
-#define SH_MINSOCK_DEFAULT 3
-int sh_xfer_syslog_sock[SH_SOCKMAX] = { -1 };
-extern int sh_xfer_recv_syslog_socket   (int fd);
-int sh_xfer_syslog_sock_n = 0;
-#else
-#define SH_MINSOCK_DEFAULT 2
-#endif
-
-int SH_MINSOCK = SH_MINSOCK_DEFAULT;
-
-extern int pf_unix_fd;
-
-/* the tcp socket, and the function to establish it
- */
-static int sh_tcp_sock[SH_SOCKMAX] = { -1 };
-static int sh_tcp_sock_n = 0;
-
-static int do_socket(int domain, int type, int protocol,
-		     struct sockaddr * sa, int salen)
-{
-  int sock = -1;
-  int errnum = 0;
-  int flag   = 1; /* non-zero to enable an option */
-
-  /* create the socket, bind() it and listen()
-   */
-  if ((sock = socket(domain, type, protocol)) < 0 )
-    {
-      errnum = errno; 
-      sh_xfer_printerr (_("socket"), errnum, server_port, __LINE__);
-      return -1;
-    }
-  (void) retry_fcntl( FIL__, __LINE__, sock, F_SETFD, 1 );
- 
-  if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		  (void *) &flag, sizeof(flag)) < 0 )
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("setsockopt"), errnum, server_port, __LINE__);
-      sl_close_fd (FIL__, __LINE__, sock);
-      return -1;
-    }
-  
-  if ( bind(sock, (struct sockaddr *) sa, salen) < 0) 
-    {
-      if (errno != EADDRINUSE)
-	{
-	  errnum = errno;
-	  sh_xfer_printerr (_("bind"), errnum, server_port, __LINE__);
-	  sl_close_fd (FIL__, __LINE__, sock);
-	  return -1;
-	}
-      else
-	{
-	  sl_close_fd (FIL__, __LINE__, sock);
-	  return -2;
-	}
-    }
-  
-  if ( retry_fcntl( FIL__, __LINE__, sock, F_SETFL, O_NONBLOCK ) < 0 )
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("fcntl"), errnum, server_port, __LINE__);
-      sl_close_fd (FIL__, __LINE__, sock);
-      return -1;
-    }
-  
-  if ( listen(sock, 64) < 0)
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("listen"), errnum, server_port, __LINE__);
-      sl_close_fd (FIL__, __LINE__, sock);
-      return -1;
-    }
-
-  return sock;
-}
-
-int sh_create_tcp_socket (void)
-{
-#if defined(USE_IPVX)
-  struct addrinfo *ai;
-  struct addrinfo *p;
-  struct addrinfo hints;
-  char            port[32];
-#else
-  struct sockaddr_in addr;
-  int addrlen      = sizeof(addr);
-#endif
-
-  int sock   = -1;
-
-  SL_ENTER(_("sh_create_tcp_socket"));
-
-  sh_xfer_printerr (NULL, 0, server_port, __LINE__);
-
-#if defined(USE_IPVX)
-  if (use_server_interface == 0) /* INADDR_ANY, listen on all interfaces */
-    {
-      memset (&hints, 0, sizeof (hints));
-      hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
-      hints.ai_socktype = SOCK_STREAM;
-      hints.ai_family   = AF_UNSPEC;
-      sl_snprintf(port, sizeof(port), "%d", server_port);
-
-      if (getaddrinfo (NULL, port, &hints, &ai) != 0)
-	{
-	  int errnum = errno;
-	  sh_xfer_printerr (_("getaddrinfo"), errnum, server_port, __LINE__);
-	  sl_close_fd (FIL__, __LINE__, sock);
-	  SL_RETURN((-1), _("sl_create_tcp_socket"));
-	}
-      
-      p = ai;
-      
-      while (p != NULL && sh_tcp_sock_n < SH_SOCKMAX)
-	{
-	  sock = do_socket(p->ai_family, p->ai_socktype, p->ai_protocol,
-			   p->ai_addr, p->ai_addrlen);
-	  
-	  if (sock >= 0) {
-	    if (sh_tcp_sock_n < SH_SOCKMAX) {
-	      sh_tcp_sock[sh_tcp_sock_n] = sock;
-	      ++sh_tcp_sock_n;
-	    }
-	    else {
-	      sl_close_fd (FIL__, __LINE__, sock);
-	    }    
-	  } else if (sock == -1) {
-	    freeaddrinfo (ai);
-	    goto end;
-	  }
-	  p = p->ai_next;
-	}
-      
-      freeaddrinfo (ai);
-    }
-  else
-    {
-      sh_ipvx_set_port(&server_interface, server_port);
-
-      sock = do_socket(server_interface.ss_family, SOCK_STREAM, 0, 
-		       sh_ipvx_sockaddr_cast(&server_interface), 
-		       SH_SS_LEN(server_interface));
-      
-      if (sock >= 0) {
-	sh_tcp_sock[0] = sock;
-	sh_tcp_sock_n  = 1;
-      }
-    }	       
-#else
-  if (use_server_interface == 0)
-    addr.sin_addr.s_addr = INADDR_ANY;
-  else
-    memcpy(&addr, sh_ipvx_sockaddr_cast(&server_interface), addrlen);
-  addr.sin_family      = AF_INET;
-  addr.sin_port        = htons(server_port);
-  
-  sock = do_socket(AF_INET, SOCK_STREAM, 0, (struct sockaddr *) &addr, addrlen);
-
-  if (sock >= 0) {
-      sh_tcp_sock[0] = sock;
-      sh_tcp_sock_n  = 1;
-  }
-
-#endif
-
-#if defined(USE_IPVX)
- end:
-#endif
-  if (sh_tcp_sock_n > 1)
-    SH_MINSOCK += (sh_tcp_sock_n - 1);
-
-  SL_RETURN((sh_tcp_sock_n), _("sl_create_tcp_socket"));
-}
-
-/*****************************************
- *
- * This is the server main loop.
- *
- * The server is set up for listening, and
- * and starts a select() loop.
- *
- *****************************************/
-
-void sh_xfer_start_server()
-{
-#ifdef SH_USE_XML
-  extern int  sh_log_file    (char * message, char * inet_peer);
-#endif
-
-  /* Use volatile to circumvent a gcc4 problem on RH/CentOS 4.8 (?) */
-  volatile int       sock = -1;
-  sh_conn_t        * cx;
-  fd_set             readset;
-  fd_set             writeset;
-  struct timeval     tv;
-  int                num_sel;
-  int                errnum;
-  int                nowconn;
-  int                status;
-  int                high_fd = -1;
-  register int       i;
-  long               dummy = 0;
-  unsigned long      time_now;
-  unsigned long      time_last = 0;
-  unsigned long      time_out = time_out_val;  
-  
-  time_t told;
-  time_t tcurrent;
-
-  unsigned long tchkold;
-
-  int setsize_fd;
-
-  int sock_tcp[2];
-  int sock_unix;
-#ifdef INET_SYSLOG
-  int sock_log[2];
-#endif
-  
-  SL_ENTER(_("sh_xfer_start_server"));
-
-  if ( sh_xfer_printerr_final(0) < 0)
-    {
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  sock = sh_tcp_sock[0];
-
-  /* ****************************************************************
-   *
-   * This is a non-forking server. We use select() on the listen()
-   * socket to watch for new connections. For new connections, accept()
-   * will return a new socket that is put in the read/write filesets.
-   * Data about active connections are kept in the 'conns' table. 
-   *
-   ******************************************************************/
-  
-  /* The table to hold info on sockets.
-   * We reserve 6 file descriptors for misc. use.
-   * The POSIX lower limit on open files seems to be eight. 
-   */
-  maxconn    = get_open_max() - 6;
-
-  /* ugly fix for FreeBSD compiler warning; casting FD_SETSIZE in the
-   * conditional expression does not suppress the warning... */
-  setsize_fd = (int)FD_SETSIZE;
-  maxconn = (setsize_fd < maxconn) ? setsize_fd : maxconn;
-
-  if (maxconn < 0 || !sl_ok_muls(maxconn, sizeof(sh_conn_t)))
-    {
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_START_SRV,
-		      0, sock);
-      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
-    }
-  conns   = SH_ALLOC (sizeof(sh_conn_t) * maxconn);
-
-  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_START_SRV,
-		  (maxconn-1), sock);
-
-  /* timer
-   */
-  tcurrent                   = (unsigned long) time (NULL);
-  told                       = tcurrent;
-
-  tchkold                    = tcurrent;
-  
-  for (i = SH_MINSOCK; i < maxconn; ++i)
-    {
-      conns[i].buf         = NULL;
-      conns[i].K           = NULL;
-      conns[i].A           = NULL;
-      conns[i].M1          = NULL;
-      conns[i].FileName    = NULL;
-      conns[i].fd          = -1;
-      sh_xfer_do_free ( &conns[i]);
-    }
-  
-  /* status init
-   */
-  server_status.conn_open  = 0;
-  server_status.conn_total = 0;
-  server_status.conn_max   = maxconn-1;
-  server_status.start      = time (NULL);
-  server_status.last       = (time_t) 0;
-
-  nowconn    = 1;
-  tv.tv_sec  = 5;
-  tv.tv_usec = 0;
-  
-  /* conns[0] is the listen() socket. Always in read mode.
-   */
-  sock = 0;
-
-  sock_tcp[0] = 0;
-  while (sock < sh_tcp_sock_n)
-    {
-      conns[sock].fd    = sh_tcp_sock[sock];
-      conns[sock].state = CONN_READING;
-      /* high_fd = (sh_tcp_sock[sock] > high_fd) ? sh_tcp_sock[sock] : high_fd; */
-      ++sock;
-    }
-  sock_tcp[1] = sock;
-  
-  conns[sock].fd    = pf_unix_fd;
-  conns[sock].state = CONN_READING;
-  /* high_fd = (pf_unix_fd > high_fd) ? pf_unix_fd : high_fd; */
-
-  sock_unix = sock;
-
-  ++sock;
-
-#ifdef INET_SYSLOG
-  conns[sock].fd = -1;
-
-  if ( sh_xfer_printerr_final(1) < 0)
-    {
-      SH_FREE(conns);
-      conns = NULL;
-      aud_exit(FIL__, __LINE__, EXIT_FAILURE);
-    }
-
-  sock_log[0] = sock;
-  sock_log[1] = sock;
-
-  if (sh_xfer_syslog_sock_n > 0)
-    {
-      int s2;
-      for (s2 = 0; s2 < sh_xfer_syslog_sock_n; ++s2)
-	{
-	  conns[sock].fd    = sh_xfer_syslog_sock[s2];
-	  conns[sock].state = CONN_READING;
-	  /* high_fd = (high_fd > conns[sock].fd) ? high_fd : conns[sock].fd; */
-	  ++sock;
-	}
-      sock_log[1] = sock;
-
-    }
-#endif
-  
-  sh_html_write(all_clients);
-  
-  /* This is the select() loop.
-   */
-  while (1 == 1)
-    {
-
-    if (sig_raised > 0)
-      {
-	TPT((0, FIL__, __LINE__, _("msg=<Process a signal.>\n")))
-
-	if (sig_termfast == 1)  /* SIGTERM */
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-	    strncpy (sh_sig_msg, _("SIGTERM"), 20);
-	    --sig_raised; --sig_urgent;
-	    aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-	  }
-	  
-	if (sig_config_read_again == 1)
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Re-read configuration.>\n")));
-	    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_RECONF);
-
-
-	    /* -- Delete the name server cache. --
-	     */
-
-	    delete_cache();
-#if defined(WITH_EXTERNAL)
-	    /* -- Delete list of external tasks. --
-	     */
-	    (void) sh_ext_cleanup();
-#endif
-#if defined(SH_WITH_MAIL)
-	      sh_nmail_free();
-#endif
-	    /* - mark all clients dead
-	     * - read configuration file
-	     * - remove clients still dead
-	     */
-	    sh_xfer_mark_dead ();
-
-	    /* free the aliases list */
-	    zAVLFreeTree (all_aliases, free_alias);
-	    all_aliases = NULL;
-
-	    reset_count_dev_console();
-	    reset_count_dev_time();
-	    sl_trust_purge_user();
-
-	    (void) sh_readconf_read ();
-
-	    for (i = SH_MINSOCK; i < maxconn; ++i)
-	      if (conns[i].state != CONN_FREE   && 
-		  conns[i].client_entry != NULL &&
-		  conns[i].client_entry->dead_flag == 1)
-		sh_xfer_do_free ( &conns[i]);
-	    sh_xfer_clean_tree ();
-
-	    sig_config_read_again = 0;
-	    --sig_raised;
-	  }
-
-	if (sig_fresh_trail == 1) /* SIGIOT */
-	  {
-	    /* Logfile access 
-	     */
-#ifdef SH_USE_XML
-	    sh_log_file (NULL, NULL);
-#endif
-	    TPT((0, FIL__, __LINE__, _("msg=<Logfile stop/restart.>\n")));
-	    sh_error_only_stderr (S_TRUE);
-	    sh_unix_rm_lock_file(sh.srvlog.name);
-	    retry_msleep(3, 0);
-	    sh.flag.log_start = S_TRUE;
-	    sh_error_only_stderr (S_FALSE);
-	    sig_fresh_trail       = 0;
-	    --sig_raised;
-	  }
-	
-	  
-	if (sig_terminate == 1 && nowconn < 2)  /* SIGQUIT */
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Terminate.>\n")));
-	    strncpy (sh_sig_msg, _("SIGQUIT"), 20);
-	    --sig_raised; --sig_urgent;
-	    aud_exit (FIL__, __LINE__, EXIT_SUCCESS);
-	  }
-	
-	  
-	if (sig_debug_switch == 1)  /* SIGUSR1 */
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Debug switch.>\n")));
-	    sh_error_dbg_switch();
-	    sig_debug_switch = 0;
-	    --sig_raised;
-	  }
-	
-	if (sig_suspend_switch > 0)  /* SIGUSR2 */
-	  {
-	    TPT((0, FIL__, __LINE__, _("msg=<Suspend switch.>\n")));
-	    if (sh_global_suspend_flag == 1) {
-	      sh_global_suspend_flag = 0;
-	    } else {
-	      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_SUSPEND, 
-			      sh.prg_name);
-	      sh_global_suspend_flag = 1;
-	    }
-	    --sig_suspend_switch;
-	    --sig_raised; --sig_urgent;
-	  }
-
-	sig_raised = (sig_raised < 0) ? 0 : sig_raised;
-	sig_urgent = (sig_urgent < 0) ? 0 : sig_urgent;
-	TPT((0, FIL__, __LINE__, _("msg=<End signal processing.>\n")));
-      }
-      
-      if (sh_global_suspend_flag == 1)
-	{
-	  (void) retry_msleep (1, 0);
-	  continue;
-	}
-
-      /* Recompute the descriptor set. select() modifies it,
-       * thus we update it using the info from the connection table.
-       * Also recompute the number of open connections.
-       */
-      FD_ZERO( &readset );
-      FD_ZERO( &writeset );
-      high_fd = conns[0].fd;
-
-      for (sock = sock_tcp[0]; sock < sock_tcp[1]; ++sock)
-	{
-	  FD_SET(conns[sock].fd, &readset );
-	  high_fd   = (high_fd > conns[sock].fd) ? high_fd : conns[sock].fd;
-	}
-
-      if (conns[sock_unix].fd > -1)
-	{
-	  FD_SET(conns[sock_unix].fd, &readset );
-	  high_fd   = (high_fd > conns[sock_unix].fd) ? high_fd : conns[sock_unix].fd;
-	}
-
-#ifdef INET_SYSLOG
-      for (sock = sock_log[0]; sock < sock_log[1]; ++sock)
-	{
-	  if (conns[sock].fd > -1)
-	    {
-	      FD_SET(conns[sock].fd, &readset );
-	      high_fd   = (high_fd > conns[sock].fd) ? high_fd : conns[sock].fd;
-	    }
-	}
-#endif
-
-      time_now  = (unsigned long) time (NULL);
-      nowconn   = 1;
-      
-      for (i = SH_MINSOCK; i < maxconn; ++i)
-	{
-	  /* eliminate timed out connections
-	   */
-	  if (conns[i].state != CONN_FREE) 
-	    {
-	      if (time_now-conns[i].timer > time_out)
-		{
-		  sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_TIMOUT,
-				  conns[i].peer);
-		  sh_xfer_do_free ( &conns[i]);
-		}
-	      else
-		++nowconn;
-	    }
-	  
-	  
-	  if       (conns[i].state   == CONN_READING)
-	    { 
-	      FD_SET(conns[i].fd, &readset);
-	      high_fd = (high_fd < conns[i].fd ? conns[i].fd : high_fd);
-	    }
-	  else if  (conns[i].state   == CONN_SENDING)
-	    {
-	      FD_SET(conns[i].fd, &writeset);
-	      high_fd = (high_fd < conns[i].fd ? conns[i].fd : high_fd);
-	    }
-	}
-
-      /* -- Exponentially reduce timeout limit if more than 1/2 full. --
-       */
-      /* Eliminate this, will cause problems when too much clients are
-       * starting up. */
-#if 0
-      if (nowconn > (maxconn/2))
-	time_out = ( (time_out/2) > 1) ? (time_out/2) : 1;
-      else
-	time_out = time_out_val;
-#endif
-      
-      
-      /* -- Do the select(). --
-       */
-      num_sel = select(high_fd+1, &readset, &writeset, NULL, &tv);
-      errnum  = errno;
-      
-      /* reset timeout - modified by select() on some systems
-       */
-      tv.tv_sec  = 5;
-      tv.tv_usec = 0;
-      
-
-      if ( (time_now - time_last) > 2L)
-	{
-	  time_last = time_now;
-	  if (sh_html_write(all_clients) < 0)
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_HTML);
-	}
-      
-      
-      /* Error handling.
-       */
-      if ( num_sel < 0 )        /* some error             */
-	{
-	  char errbuf[SH_ERRBUF_SIZE];
-
-	  if (sig_raised == 1)
-	    {
-	      sig_raised = 2;
-	      continue;
-	    }
-
-	  if ( errnum == EINTR)
-	    continue;	  /* try again              */
-
-	  if ( errnum == EBADF)
-	    {
-	      /* seek and destroy the bad fd
-	       */
-	      for (i = SH_MINSOCK; i < high_fd; ++i)
-		{
-		  if ((conns[i].state == CONN_READING) ||
-		      (conns[i].state == CONN_SENDING))
-		    {
-		      if (-1 == retry_fcntl(FIL__, __LINE__, 
-					    conns[i].fd, F_GETFL, dummy))
-			sh_xfer_do_free ( &conns[i]);
-		    }
-		}
-	      continue;
-	    }
-
-	  sh_error_handle((-1), FIL__, __LINE__, errnum, MSG_EXIT_ABORTS,
-			  sh_error_message(errnum, errbuf, sizeof(errbuf)), 
-			  sh.prg_name,
-			  _("select"));
-	  aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
-	}
-      
-
-      /* log the timestamp
-       */
-      if ((tcurrent - told) > sh.looptime )
-	{
-	  told = tcurrent;
-#ifdef MEM_DEBUG
-	  sh_mem_check();
-	  sh_unix_count_mlock();
-#else
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_STAMP);
-#endif
-	}
-
-#if defined(SH_WITH_MAIL)
-      /* 
-       * flush the mail queue
-       */
-      if (tcurrent - sh.mailTime.alarm_last > sh.mailTime.alarm_interval) 
-	{
-	  TPT((0, FIL__, __LINE__, _("msg=<Flush mail queue.>\n")))
-	  (void) sh_nmail_flush ();
-	  sh.mailTime.alarm_last = tcurrent;
-	}
-#endif
-#ifdef MEM_DEBUG
-      sh_mem_dump();
-#endif
-
-      tcurrent = (unsigned long) time (NULL);
-
-      /* check for time limit exceeded
-       */
-      if ((tcurrent - tchkold) > (unsigned int) 3 )
-	{
-	  tchkold = tcurrent;
-	  client_time_check(/* all_clients */);
-	  /* reset cache */
-	  sh_userid_destroy();
-	}
-      
-      /* seed / re-seed the PRNG if required
-       */
-      (void) taus_seed();
-
-      /* select() timeout handling.
-       */
-      if ( num_sel == 0 )       /* timeout - no connection */ 
-	{
-	  if (sh_html_write(all_clients) < 0)
-	    sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_HTML);
-	  continue;
-	}
-
-      /* New connection.
-       */
-      for (sock = sock_tcp[0]; sock < sock_tcp[1]; ++sock)
-	{
-	  if ( FD_ISSET(conns[sock].fd , &readset )) /* a new connection   */
-	    {
-	      --num_sel;
-	      status = 0;
-	      if (nowconn < maxconn && sig_terminate == 0 && sig_termfast == 0)
-		{
-		  /* Find a free slot to accept the connection
-		   */
-		  i = SH_MINSOCK;
-		  while (i < maxconn)
-		    {
-		      if (conns[i].state == CONN_FREE)
-			{
-			  /* Here we run the accept() and copy the peer to
-			   * the free slot. 
-			   */
-			  status = sh_xfer_accept(conns[sock].fd, &conns[i]);
-			  
-			  if (status == 0)
-			    {
-			      high_fd = 
-				(high_fd > conns[i].fd ? high_fd : conns[i].fd);
-			      ++server_status.conn_open;
-			      ++server_status.conn_total;
-			      server_status.last = time (NULL);
-			    }
-			  break;
-			}
-		      ++i;
-		    }
-		}
-	      /* This re-runs select to accept data on the new
-	       * connection, rather than first dealing with old
-	       * connections.
-	       */
-	      if (status == 0) 
-		continue;
-	    }
-	}
-      
-      /* check for commands on the socket
-       */
-      if (conns[sock_unix].fd > (-1) && FD_ISSET(conns[sock_unix].fd , &readset ))
-	{
-	  sh_socket_poll();
-	}
-
-#ifdef INET_SYSLOG
-      for (sock = sock_log[0]; sock < sock_log[1]; ++sock)
-	{
-	  if (conns[sock].fd > (-1) && FD_ISSET(conns[sock].fd , &readset ))
-	    {
-	      sh_xfer_recv_syslog_socket (conns[sock].fd);
-	    }
-	}
-#endif
-
-      /* Check for pending read/write on the rest of the sockets.
-       */
-      for ( i = SH_MINSOCK; num_sel > 0 && i < maxconn; ++i )
-	{
-	  if (sig_termfast == 1)
-	    break;
-
-	  cx = &conns[i];
-	  if ( cx->state == CONN_READING &&
-	       FD_ISSET( cx->fd, &readset ) )
-	    {
-	      --num_sel;
-	      sh_xfer_do_read ( cx );
-	    }
-	  else if ( cx->state == CONN_SENDING &&
-		    FD_ISSET( cx->fd, &writeset ) )
-	    {
-	      --num_sel;
-	      sh_xfer_do_write ( cx );
-	    }
-	}
-      /* continue */
-    }
-  /* notreached */
-}
-
-void  free_client_tree (void)
-{
-  SL_ENTER(_("free_client_tree"));
-  zAVLFreeTree (all_clients, free_client);
-  SL_RET0(_("free_client_tree"));
-}
-
-void sh_xfer_free_all ()
-{
-  register int i;
-  
-  SL_ENTER(_("sh_xfer_free_all"));
-
-  if (conns != NULL)
-    for (i = SH_MINSOCK; i < maxconn; ++i)
-      {
-	sh_xfer_do_free ( &conns[i]);
-      }
-
-
-  free_client_tree ();
-
-  if (conns != NULL)
-    SH_FREE (conns);
-
-  SL_RET0(_("sh_xfer_free_all"));
-}
-
-
-
-/* #ifdef SH_WITH_SERVER */
-#endif
-
-
-  
-
-
-
Index: trunk/src/sh_xfer_syslog.c
===================================================================
--- trunk/src/sh_xfer_syslog.c	(revision 591)
+++ 	(revision )
@@ -1,475 +1,0 @@
-/* SAMHAIN file system integrity testing                                   */
-/* Copyright (C) 1999, 2000 Rainer Wichmann                                */
-/*                                                                         */
-/*  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.              */
-
-#include "config_xor.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <syslog.h>
-
-/* Must be early on FreeBSD
- */
-#include <sys/types.h>
-#include <sys/socket.h> 
-#include <netdb.h>
-#include <netinet/in.h>
-
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-
-#ifdef SH_WITH_SERVER
-
-#include "samhain.h"
-#include "sh_tools.h"
-#include "sh_utils.h"
-#include "sh_ipvx.h"
-
-#undef  FIL__
-#define FIL__  _("sh_xfer_syslog.c")
-
-#ifdef INET_SYSLOG
-
-extern void sh_xfer_printerr(char * str, int errnum, unsigned int port, int line);
-extern int sh_xfer_syslog_sock[SH_SOCKMAX];
-extern int sh_xfer_syslog_sock_n;
-extern int SH_MINSOCK;
-
-/* Unlike Linux / FreeBSD, most systems don't define the stuff below
- * in syslog.h
- */
-
-#ifndef LOG_FAC
-#define LOG_FAC(p)      (((p) & LOG_FACMASK) >> 3)
-#endif
-
-#ifndef LOG_PRI
-#define LOG_PRI(p)      ((p) & LOG_PRIMASK)
-#endif
-
-typedef struct sh_code {
-        char    *c_name;
-        int     c_val;
-} SH_CODE;
-
-SH_CODE sh_facilitynames[] =
-{
-#ifdef LOG_AUTH
-  { N_("auth"), LOG_AUTH },
-#endif
-#ifdef LOG_AUTHPRIV 
-  { N_("authpriv"), LOG_AUTHPRIV },
-#endif
-#ifdef LOG_CRON
-  { N_("cron"), LOG_CRON },
-#endif
-#ifdef LOG_DAEMON
-  { N_("daemon"), LOG_DAEMON },
-#endif
-#ifdef LOG_FTP
-  { N_("ftp"), LOG_FTP },
-#endif
-#ifdef LOG_KERN
-  { N_("kern"), LOG_KERN },
-#endif
-#ifdef LOG_LPR
-  { N_("lpr"), LOG_LPR },
-#endif
-#ifdef LOG_MAIL
-  { N_("mail"), LOG_MAIL },
-#endif
-#ifdef INTERNAL_MARK
-  { N_("mark"), INTERNAL_MARK },          /* INTERNAL */
-#endif
-#ifdef LOG_NEWS
-  { N_("news"), LOG_NEWS },
-#endif
-#ifdef LOG_AUTH
-  { N_("security"), LOG_AUTH },           /* DEPRECATED */
-#endif
-#ifdef LOG_SYSLOG
-  { N_("syslog"), LOG_SYSLOG },
-#endif
-#ifdef LOG_USER
-  { N_("user"), LOG_USER },
-#endif
-#ifdef LOG_UUCP
-  { N_("uucp"), LOG_UUCP },
-#endif
-#ifdef LOG_LOCAL0
-  { N_("local0"), LOG_LOCAL0 },
-#endif
-#ifdef LOG_LOCAL1
-  { N_("local1"), LOG_LOCAL1 },
-#endif
-#ifdef LOG_LOCAL2 
-  { N_("local2"), LOG_LOCAL2 },
-#endif
-#ifdef LOG_LOCAL3
-  { N_("local3"), LOG_LOCAL3 },
-#endif
-#ifdef LOG_LOCAL4
-  { N_("local4"), LOG_LOCAL4 },
-#endif
-#ifdef LOG_LOCAL5
-  { N_("local5"), LOG_LOCAL5 },
-#endif
-#ifdef LOG_LOCAL6
-  { N_("local6"), LOG_LOCAL6 },
-#endif
-#ifdef LOG_LOCAL7
-  { N_("local7"), LOG_LOCAL7 },
-#endif
-  { NULL, -1 }
-};
- 
-
-SH_CODE sh_prioritynames[] =
-{  
-#ifdef LOG_ALERT
-  { N_("alert"), LOG_ALERT },
-#endif
-#ifdef LOG_CRIT
-  { N_("crit"), LOG_CRIT },
-#endif
-#ifdef LOG_DEBUG
-  { N_("debug"), LOG_DEBUG },
-#endif
-#ifdef LOG_EMERG
-  { N_("emerg"), LOG_EMERG },
-#endif
-#ifdef LOG_ERR
-  { N_("err"), LOG_ERR },
-#endif
-#ifdef LOG_ERR
-  { N_("error"), LOG_ERR },               /* DEPRECATED */
-#endif
-#ifdef LOG_INFO
-  { N_("info"), LOG_INFO },
-#endif
-#ifdef INTERNAL_NOPRI
-  { N_("none"), INTERNAL_NOPRI },         /* INTERNAL */
-#endif
-#ifdef LOG_NOTICE
-  { N_("notice"), LOG_NOTICE },
-#endif
-#ifdef LOG_EMERG
-  { N_("panic"), LOG_EMERG },             /* DEPRECATED */
-#endif
-#ifdef LOG_WARNING
-  { N_("warn"), LOG_WARNING },            /* DEPRECATED */
-#endif
-#ifdef LOG_WARNING
-  { N_("warning"), LOG_WARNING },
-#endif
-  { NULL, -1 }
-};
-
-static int enable_syslog_socket = S_FALSE;
-
-int sh_xfer_recv_syslog_socket (int fd)
-{
-  static time_t      return_next = 0;
-  int                priority = 0;
-  int                fac, pri;
-  int                i;
-  char             * cfac = NULL;
-  char             * cpri = NULL;
-  int                res;
-  char             * tmp;
-  char             * bptr;
-  char             * ptr = NULL;
-  char               buf[1048];
-  struct sockaddr_in from;
-  char errbuf[SH_ERRBUF_SIZE];
-
-  struct sh_sockaddr ss;
-  struct sockaddr * sa = (struct sockaddr *) &from;
-  char   namebuf[SH_BUFSIZE];
-
-  /* The 6th argument in recvfrom is *socklen_t in Linux and *BSD, 
-   * but *int everywhere else. Because socklen_t is unsigned int, there
-   * should be no problem as long as  sizeof(struct sockaddr_in) < INT_MAX ...
-   */
-  unsigned int fromlen = sizeof(from);
-
-  if (enable_syslog_socket == S_FALSE)
-    return 0;
-
-  SL_ENTER(_("sh_xfer_recv_syslog_socket"));
-
-  if (return_next > 0)
-    {
-      if ( (time(NULL) - return_next) < 2)
-	SL_RETURN( 0, _("sh_xfer_recv_syslog_socket"));
-      else
-	return_next = 0;
-    }
-
-  res = recvfrom(fd,  buf,  1047, 0, (struct sockaddr *) &from, &fromlen);
-
-  sh_ipvx_save(&ss, sa->sa_family, (struct sockaddr *) &from);
-  sh_ipvx_ntoa(namebuf, sizeof(namebuf), &ss);
-
-  if (res > 0)
-    {
-      res = (res < 1047) ? res : 1047; 
-      buf[res] = '\0';
-      if (res > 1 && buf[res-1] == '\n')
-	buf[res-1] = '\0';
-
-      /* here we expect an xml formatted message, thus we don't
-	 escape xml special chars (flag == 0) */
-      /* commented out to not escape twice    */
-      /* bptr = sh_tools_safe_name(buf, 0);   */
-      bptr = buf;
-
-      if (!bptr || !(*bptr))
-	{
-	  res = errno;
-	  TPT(( 0, FIL__, __LINE__, _("msg=<UDP error: %d>\n"), res));
-	  sh_error_handle((-1), FIL__, __LINE__, res, MSG_ERR_SYSLOG,
-			  sh_error_message(res, errbuf, sizeof(errbuf)), 
-			  namebuf);
-	  SL_RETURN( (-1), _("sh_xfer_recv_syslog_socket"));
-	}      
-
-      TPT(( 0, FIL__, __LINE__, _("msg=<UDP message from %s>\n"), namebuf ));
-
-      ptr = bptr;
-      i = 0;
-      if (*ptr == '<') 
-	{
-	  ++ptr; ++i;
-	  while (i < res &&
-		 (unsigned char) *ptr > 47 && (unsigned char) *ptr < 58)
-	    {
-	      priority = 10 * priority + (*ptr - '0');
-	      ++ptr;
-	      ++i;
-	    }
-	  if (*ptr == '>')
-	    ++ptr;
-	}
-      fac = LOG_FAC(priority);
-      i = 0; 
-      while (sh_facilitynames[i].c_name != NULL)
-	{
-	  if (sh_facilitynames[i].c_val == (fac<<3))
-	    { cfac = sh_util_strdup(_(sh_facilitynames[i].c_name)); break; }
-	  ++i;
-	}
-      pri = LOG_PRI(priority);
-      i = 0; 
-      while (sh_prioritynames[i].c_name != NULL)
-	{
-	  if (sh_prioritynames[i].c_val == pri)
-	    { cpri = sh_util_strdup(_(sh_prioritynames[i].c_name)); break; }
-	  ++i;
-	}
-
-      /* here we do not expect an xml formatted message, thus we escape
-	 xml special chars (flag == 1) */
-      tmp = sh_tools_safe_name (ptr, 1);
-      sh_error_handle((-1), FIL__, __LINE__, 0, MSG_INET_SYSLOG,
-		      namebuf, 
-		      (cfac == NULL) ? _("none") : cfac, 
-		      (cpri == NULL) ? _("none") : cpri, 
-		      (tmp  == NULL) ? _("none") : tmp);
-      if (cfac != NULL)
-	SH_FREE(cfac);
-      if (cpri != NULL)
-	SH_FREE(cpri);
-      SH_FREE(tmp);
-      /* SH_FREE(bptr); */
-    }
-
-  else if (res < 0 && errno != EINTR)
-    {
-      res = errno;
-      TPT(( 0, FIL__, __LINE__, _("msg=<UDP error: %d>\n"), res));
-      sh_error_handle((-1), FIL__, __LINE__, res, MSG_ERR_SYSLOG,
-		      sh_error_message(res, errbuf, sizeof(errbuf)), 
-		      namebuf);
-
-      /* don't accept anything the next 2 seconds
-       */
-      return_next = time(NULL);
-      SL_RETURN( (-1), _("sh_xfer_recv_syslog_socket"));
-    }      
-  SL_RETURN( (0), _("sh_xfer_recv_syslog_socket"));
-}
-
-int set_syslog_active(const char * c)
-{
-  return sh_util_flagval(c, &enable_syslog_socket);
-}
-
-static int do_syslog_socket(int domain, int type, int protocol,
-			    struct sockaddr * sa, int salen)
-{
-  int                flag = 1;  /* non-zero to enable an option */
-  int sock;
-  int errnum;
-  int res;
-
-  /* create the socket, bind() it and listen()
-   */
-  sock = socket(domain, type, protocol);
-
-  if (sock < 0)
-    {
-      errnum = errno; 
-      sh_xfer_printerr (_("syslog socket"), errnum, 514, __LINE__);
-      return -1;
-    }
-  (void) retry_fcntl( FIL__, __LINE__, sock, F_SETFD, 1 );
-  
-  if ( setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-		  (void *) &flag, sizeof(flag)) < 0 )
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("syslog setsockopt SO_REUSEADDR"), 
-			   errnum, 514, __LINE__);
-      return -1;
-    }
-
-#if defined(SO_BSDCOMPAT)
-  if ( setsockopt(sock, SOL_SOCKET, SO_BSDCOMPAT,
-		  (void *) &flag, sizeof(flag)) < 0 )
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("syslog setsockopt SO_BSDCOMPAT"), 
-			   errnum, 514, __LINE__);
-      return -1;
-    }
-#endif
-  
-  res = bind(sock, sa, salen);
-
-  if ( res < 0) 
-    {
-      errnum = errno;
-      sh_xfer_printerr (_("syslog bind"), errnum, 514, __LINE__);
-      sl_close_fd(FIL__, __LINE__, sock);
-      return -1;
-    }
-  return sock;
-}
-
-/* callerFlag == S_TRUE means override the enable_syslog_socket flag
- */
-int sh_xfer_create_syslog_socket (int callerFlag)
-{
-  int sock;
-
-#if defined(USE_IPVX)
-  struct addrinfo *ai;
-  struct addrinfo *p;
-  struct addrinfo hints;
-#else
-  struct sockaddr_in addr;
-  int addrlen      = sizeof(addr);
-#endif
-
-  SL_ENTER(_("sh_xfer_create_syslog_socket"));
-
-  if (callerFlag == S_FALSE)
-    {
-      if (enable_syslog_socket == S_FALSE && sh_xfer_syslog_sock_n > 0)
-	{
-	  /* user does not wish to use this facility
-	   */
-	  TPT(( 0, FIL__, __LINE__, _("msg=<close syslog socket>\n")));
-	  for (sock = 0; sock < sh_xfer_syslog_sock_n; ++sock)
-	    {
-	      sl_close_fd(FIL__, __LINE__, sh_xfer_syslog_sock[sock]);
-	      sh_xfer_syslog_sock[0] = -1;
-	    }
-	}
-      SL_RETURN((-1), _("sh_xfer_create_syslog_socket"));
-    }
-
-  sh_xfer_printerr (NULL, 0, 514, __LINE__);
-
-#if !defined(USE_IPVX)
-
-  memset(&addr, 0, sizeof(addr));
-  addr.sin_family      = AF_INET;
-  addr.sin_port        = htons(514);
-  
-  sock = do_syslog_socket(AF_INET, SOCK_DGRAM, 0, 
-			  (struct sockaddr *) &addr, addrlen);
-
-  if (sock >= 0) {
-    sh_xfer_syslog_sock[0] = sock;
-    sh_xfer_syslog_sock_n  = 1;
-  }
-
-#else
-  memset (&hints, 0, sizeof (hints));
-  hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
-  hints.ai_socktype = SOCK_DGRAM;
-  if (getaddrinfo (NULL, "syslog", &hints, &ai) != 0)
-    {
-      int errnum = errno;
-      sh_xfer_printerr (_("getaddrinfo"), errnum, 514, __LINE__);
-      SL_RETURN((-1), _("sh_xfer_create_syslog_socket"));
-    }
-  
-  p = ai;
-
-  while (p != NULL && sh_xfer_syslog_sock_n < SH_SOCKMAX)
-    {
-      sock = do_syslog_socket(p->ai_family, p->ai_socktype, p->ai_protocol,
-			      p->ai_addr, p->ai_addrlen);
-      
-      if (sock >= 0) {
-	if (sh_xfer_syslog_sock_n < SH_SOCKMAX) {
-	  sh_xfer_syslog_sock[sh_xfer_syslog_sock_n] = sock;
-	  ++sh_xfer_syslog_sock_n;
-	}
-	else {
-	  sl_close_fd (FIL__, __LINE__, sock);
-	}    
-      } else if (sock == -1) {
-	freeaddrinfo (ai);
-	goto end;
-      }
-      p = p->ai_next;
-    }
-  freeaddrinfo (ai);
-
- end:
-#endif
-  if (sh_xfer_syslog_sock_n > 1)
-    SH_MINSOCK += (sh_xfer_syslog_sock_n - 1);
-
-  SL_RETURN((sh_xfer_syslog_sock_n), _("sh_xfer_create_syslog_socket"));
-}
-/* #ifdef INET_SYSLOG */
-#endif
-
-/* #ifdef SH_WITH_SERVER */
-#endif
Index: trunk/src/slib.c
===================================================================
--- trunk/src/slib.c	(revision 591)
+++ trunk/src/slib.c	(revision 1)
@@ -1,17 +1,4 @@
 #include "config_xor.h"
 
-#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_MINCORE)
-
-#if defined(__sun) || defined(__sun__) || defined(sun)
-#define _XOPEN_SOURCE 500
-#else
-#define _XOPEN_SOURCE 600
-#endif
-
-#if defined(__GNUC__)
-#define _DEFAULT_SOURCE
-#endif
-#define _BSD_SOURCE
-#endif
 
 #include <stdio.h>
@@ -19,24 +6,22 @@
 #include <stdarg.h>
 #include <string.h>
-#include <limits.h>
-#ifdef HAVE_STDINT_H
-/* for SIZE_MAX */
-#include <stdint.h>
-#endif
-
+
+
+#include <unistd.h>
+#include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
 
-#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_MINCORE)
-#include <sys/mman.h>
-#endif
-
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
+#else
 #include <time.h>
+#endif
+#endif
 
 #ifdef HAVE_MEMORY_H
@@ -60,12 +45,8 @@
 #endif
 
-#define SH_REAL_SET
-
 #include "slib.h"
 #include "sh_calls.h"
 #define SH_NEED_PWD_GRP 1
 #include "sh_static.h"
-#include "sh_pthread.h"
-#include "sh_string.h"
 
 #undef  FIL__
@@ -117,12 +98,14 @@
 static FILE * trace_fp     = NULL;
 
-int  sl_trace_use (const char * dummy)
-{
-  (void) dummy;
-  slib_do_trace = 1;
+int  sl_trace_use (char * dummy)
+{
+  if (dummy)
+    slib_do_trace = 1;
+  else
+    slib_do_trace = 1;
   return 0;
 }
 
-int  sl_trace_file (const char * str)
+int  sl_trace_file (char * str)
 {
   if (!str)
@@ -134,5 +117,5 @@
 }
 
-FILE * sl_tracefile_open(const char * file, const char * mode)
+FILE * sl_tracefile_open(char * file, char * mode)
 {
   FILE * xp = NULL;
@@ -143,5 +126,5 @@
 }
 
-void sl_trace_in(const char * str, const char * file, int line)
+void sl_trace_in(char * str, char * file, int line)
 {
   int    i;
@@ -165,5 +148,4 @@
 	  fprintf(trace_fp, "[%2d] %s \t - File %c%s%c at line %d\n", 
 		 trace_level, str, 0x22, file, 0x22, line);
-	  fflush(trace_fp);
 	}
       else
@@ -176,5 +158,5 @@
 }
 
-void sl_trace_out(const char * str, const char * file, int line)
+void sl_trace_out(char * str, char * file, int line)
 {
   int    i;
@@ -201,5 +183,4 @@
 	  fprintf(trace_fp, _("[%2d] %s \t - File %c%s%c at line %d\n"), 
 		 trace_level, str, 0x22, file, 0x22, line);
-	  fflush(trace_fp);
 	}
       else
@@ -211,5 +192,5 @@
 }
 
-extern int sh_log_console (const char * msg);
+extern int sh_log_console (char * msg);
 
 static int dlogActive = 0;
@@ -226,5 +207,5 @@
  *      = 3 backtrace
  */
-int dlog (int flag, const char * file, int line,  const char *fmt, ...)
+int dlog (int flag, char * file, int line,  const char *fmt, ...)
 {
   va_list     ap;
@@ -250,8 +231,8 @@
   if (flag == 1)
     {
-      sl_snprintf    (val, 81, _("\n---------  %10s "), file);
-      sl_strlcpy     (msg,    val,   sizeof(msg));
-      sl_snprintf    (val, 81, _(" --- %6d ---------\n"), line);
-      sl_strlcat     (msg,     val,   sizeof(msg));
+      sprintf        (val, _("\n---------  %10s "), file);
+      sl_strlcpy     (msg,    val,   80);
+      sprintf        (val, _(" --- %6d ---------\n"), line);
+      sl_strlcat     (msg,     val,   80);
       sh_log_console (msg);
     }
@@ -262,5 +243,5 @@
   else
     sl_strlcpy(tmp, fmt, 256);
-  retval = strlen(tmp);
+  retval = sl_strlen(tmp);
   if (retval > 0 && tmp[retval-1] == '\n')
     tmp[retval-1] = '\0';
@@ -277,5 +258,5 @@
       sprintf      (val, _("[%2d] "), trace_level);
       sl_strlcat   (msg,     val,   256);
-      sl_vsnprintf (&msg[strlen(msg)], 255, tmp, ap);
+      sl_vsnprintf (&msg[sl_strlen(msg)], 255, tmp, ap);
       sl_snprintf  (tmp, 255, _(" \t - File %c%s%c at line %d"), 
 		    0x22, file, 0x22, line);
@@ -581,38 +562,25 @@
   
 /*
- * Have memset in a different translation unit (i.e. this) to prevent 
- * it to get optimized away ...not safe with link-time optimisation...
- */
-void * sl_memset(void *s, int c, size_t n)
-{
-  /* See:
-   * https://www.usenix.org/sites/default/files/conference/protected-files/usenixsecurity17_slides_zhaomo_yang.pdf
-   */
-#if defined(HAVE_EXPLICIT_MEMSET)
-  return explicit_memset(s, c, n);
-#elif defined(HAVE_EXPLICIT_BZERO)
-  if (c == 0) {
-    explicit_bzero(s, n);
+ * A memset that does not get optimized away
+ */
+void *sl_memset(void *s, int c, size_t n)
+{
+  size_t i;
+  volatile char *p = s;
+
+  if (s == NULL || n <= 0)
     return s;
-  } else {
-    return memset(s, c, n);
-  }
-#elif defined(__GNUC__)
-  memset(s, c, n);
-  __asm__  __volatile__ ("" ::"r"(s): "memory"); /* compiler barrier */
+  
+  for (i = 0; i < n; ++i)
+    p[i] = (char) c;
   return s;
-#else
-  if (c == 0) {
-    size_t i;
-    volatile unsigned char * t_s = (volatile unsigned char *)s;
-    for (i=0; i<n; ++i)
-      t_s[i] = 0;
-    return s;
-  } else {
-    return memset(s, c, n);
-  }
-#endif  
-}
-
+}
+
+#if !defined(HOST_IS_I86SOLARIS)
+#if !defined (_GNU_SOURCE)
+extern int vsnprintf ( char *str, size_t n,
+		       const char *format, va_list ap );
+#endif
+#endif
 
 #if !defined (VA_COPY)
@@ -810,13 +778,12 @@
 
 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_BROKEN_VSNPRINTF)
-  len = vsnprintf (str, n, format, vl);                /* flawfinder: ignore */
+  len = vsnprintf (str, n, format, vl);
   str[n-1] = '\0';
 #else
-  VA_COPY (vl2, vl);                     /* save the argument list           */
+  VA_COPY (vl2, vl);                   /* save the argument list           */
   total = sl_printf_count (format, vl);
-  len = (int) total;
+  len   = (int) total;
   if (total < n) 
     {
-      /* flawfinder: ignore */
       vsprintf (str, format, vl2);       /* program has checked that it fits */
       str[n-1] = '\0';
@@ -838,5 +805,5 @@
  * ENULL:  src || format == NULL
  * ERANGE: n out of range
- * ETRUNC: truncated (unimplemented)
+ * ETRUNC: truncated
  */
 int sl_snprintf(char *str, size_t n,
@@ -855,5 +822,4 @@
   va_start (vl, format);
 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_BROKEN_VSNPRINTF)
-  /* flawfinder: ignore */
   vsnprintf (str, n, format, vl);
   str[n-1] = '\0';
@@ -863,5 +829,4 @@
   if (total < n) 
     {
-      /* flawfinder: ignore */
       vsprintf (str, format, vl2);     /* program has checked that it fits */
       str[n-1] = '\0';
@@ -898,33 +863,33 @@
   register const char * q;
 
-  if (!(dst == NULL || src == NULL || *src == '\0'))
-    {
-      if (siz > 0) 
-	{
-
-	  /* How much free space do we have ?
-	   */
-	  dst_end  = strlen(dst);
-	  dst_free = siz - dst_end - 1;
-	  
-	  p = &dst[dst_end];
-	  q = src;
-	  
-	  while (dst_free > 0 && *q != '\0')
-	    {
-	      *p++ = *q++;
-	      --dst_free;
-	    }
-	
-	  /* NULL terminate dst.
-	   */
-	  *p = '\0';
-	
-	  if (*q == '\0')
-	    return SL_ENONE;
-	  else
-	    return SL_ETRUNC;
-	}
-    }
+  if (dst == NULL)
+    return SL_ENONE;
+  if (src == NULL || src == "") 
+    return SL_ENONE;
+
+  if (siz > 0) {
+
+    /* How much free space do we have ?
+     */
+    dst_end  = strlen(dst);
+    dst_free = siz - dst_end - 1;
+
+    p = &dst[dst_end];
+    q = src;
+
+    while (dst_free > 0 && *q != '\0')
+      {
+	*p++ = *q++;
+	--dst_free;
+      }
+
+    /* NULL terminate dst.
+     */
+    *p = '\0';
+
+    if (*q != '\0') 
+      return SL_ETRUNC;
+  }
+
   return SL_ENONE;
 }
@@ -945,27 +910,24 @@
   /* SL_ENTER(_("sl_strlcpy")); */
 
-  if (!((dst == NULL) || (src == NULL))) 
-    {
-      if (siz > 0) {
-	/* copy siz-1 characters 
-	 */
-	(void) strncpy(dst, src, siz-1);
-
-	/* NULL terminate
-	 */
-	dst[siz-1] = '\0';
-      }
-      return SL_ENONE;
-    }
-  else if (src == NULL)
-    {
-      if (dst && siz > 0) 
+  if (dst == NULL)
+    return SL_ENULL;
+  if (src == NULL)
+    { 
+      if (siz > 0) 
 	dst[0] = '\0';
       return SL_ENONE;
     }
-  else
-    {
-      return SL_ENULL;
-    } 
+
+
+  if (siz > 0) {
+    /* copy siz-1 characters 
+     */
+    (void) strncpy(dst, src, siz-1);
+
+    /* NULL terminate
+     */
+    dst[siz-1] = '\0';
+  }
+  return SL_ENONE;
 }
 
@@ -1044,41 +1006,4 @@
 }
 
-#include <ctype.h>
-int sl_strcasecmp(const char * one, const char * two)
-{
-#ifdef SL_FAIL_ON_ERROR
-  SL_REQUIRE (one != NULL, _("one != NULL"));
-  SL_REQUIRE (two != NULL, _("two != NULL"));
-#endif
-
-  if (one && two)
-    {
-      do {
-	if (*one && *two)
-	  {
-	    if (tolower((int) *one) == tolower((int) *two))
-	      {
-		++one; ++two;
-	      }
-	    else if (tolower((int) *one) < tolower((int) *two))
-	      return -1;
-	    else
-	      return 1;
-	  }
-	else if (*one == '\0' && *two == '\0')
-	  return 0;
-	else if (*one == '\0')
-	  return -1;
-	else
-	  return 1;
-      } while (1 == 1);
-    }
-  else if (one == NULL && two != NULL)
-    return -1;
-  else if (one != NULL && two == NULL)
-    return 1;
-  else
-    return -7; /* default to not equal */
-}
 
 int sl_strcmp(const char * a, const char * b)
@@ -1096,39 +1021,5 @@
     return (1);
   else
-    return (-7); /* default to not equal */
-}
-
-/* Does not report sign. */
-int sl_ts_strncmp(const char * a, const char * b, size_t n)
-{
-#ifdef SL_FAIL_ON_ERROR
-  SL_REQUIRE (a != NULL, _("a != NULL"));
-  SL_REQUIRE (b != NULL, _("b != NULL"));
-  SL_REQUIRE (n > 0, _("n > 0"));
-#endif
-
-  if (a != NULL && b != NULL)
-    {
-      const unsigned char *a1 = (const unsigned char *)a;
-      const unsigned char *b1 = (const unsigned char *)b;
-      size_t i;
-      int  retval=0;
-      /* The simple index based access is optimized best by the
-       * compiler (tested with gcc 7.3.0). */
-      for (i = 0; i < n; ++i)
-	{
-	  if (a1[i] == '\0' || b1[i] == '\0')
-	    break;
-	  retval |= (a1[i] ^ b1[i]);
-	}
-      /* if (retval == 0) --> false (0) */ 
-      return (retval != 0);
-    }
-  else if (a == NULL && b != NULL)
-    return (-1);
-  else if (a != NULL && b == NULL)
-    return (1);
-  else
-    return (-7); /* default to not equal */
+    return (-7); /* arbitrary */
 }
 
@@ -1148,23 +1039,5 @@
     return (1);
   else
-    return (-7); /* default to not equal */
-}
-
-int sl_strncasecmp(const char * a, const char * b, size_t n)
-{
-#ifdef SL_FAIL_ON_ERROR
-  SL_REQUIRE (a != NULL, _("a != NULL"));
-  SL_REQUIRE (b != NULL, _("b != NULL"));
-  SL_REQUIRE (n > 0, _("n > 0"));
-#endif
-
-  if (a != NULL && b != NULL)
-    return (strncasecmp(a, b, n));
-  else if (a == NULL && b != NULL)
-    return (-1);
-  else if (a != NULL && b == NULL)
-    return (1);
-  else
-    return (-7); /* default to not equal */
+    return (-7); /* arbitrary */
 }
 
@@ -1175,5 +1048,5 @@
 {
 #ifndef HAVE_STRSTR
-  unsigned int    i;
+  int             i;
   size_t          needle_len;
   size_t          haystack_len;
@@ -1214,6 +1087,6 @@
 static   gid_t   rgid_orig;
 
-static   int     uids_are_stored = S_FALSE;
-static   int     suid_is_set     = S_TRUE;
+static   int     uids_are_stored = SL_FALSE;
+static   int     suid_is_set     = SL_TRUE;
 
 #ifdef HAVE_SETRESUID
@@ -1229,5 +1102,5 @@
 int sl_is_suid()
 {
-  if (uids_are_stored == S_FALSE)
+  if (uids_are_stored == SL_FALSE)
     {
       if (getuid() == geteuid() && getgid() == getegid())
@@ -1252,6 +1125,6 @@
 {
   SL_ENTER(_("sl_get_euid"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = euid;
   else
@@ -1262,6 +1135,6 @@
 uid_t sl_ret_euid()
 {
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     return (euid);
   else
@@ -1276,6 +1149,6 @@
 {
   SL_ENTER(_("sl_get_egid"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = egid;
   else
@@ -1291,6 +1164,6 @@
 {
   SL_ENTER(_("sl_get_ruid"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = ruid;
   else
@@ -1306,6 +1179,6 @@
 {
   SL_ENTER(_("sl_get_rgid"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = rgid;
   else
@@ -1321,6 +1194,6 @@
 {
   SL_ENTER(_("sl_get_ruid_orig"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = ruid_orig;
   else
@@ -1336,6 +1209,6 @@
 {
   SL_ENTER(_("sl_get_rgid_orig"));
-  /* SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));*/
-  if (uids_are_stored == S_TRUE)
+  /* SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));*/
+  if (uids_are_stored == SL_TRUE)
     *ret = rgid_orig;
   else
@@ -1362,17 +1235,17 @@
   SL_ENTER(_("sl_set_suid"));
 
-  if (uids_are_stored == S_FALSE)
+  if (uids_are_stored == SL_FALSE)
     {
       SL_IRETURN(SL_ENONE, _("sl_set_suid"));
     }
 
-  SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));  
+  SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));  
 
   if (ruid == euid && rgid == egid) 
     {
-      suid_is_set = S_TRUE;
+      suid_is_set = SL_TRUE;
       SL_IRETURN(SL_ENONE, _("sl_set_suid"));
     }  
-  SL_REQUIRE(suid_is_set     == S_FALSE, _("suid_is_set == S_FALSE"));  
+  SL_REQUIRE(suid_is_set     == SL_FALSE, _("suid_is_set == SL_FALSE"));  
 
 #if defined(HAVE_SETRESUID)
@@ -1403,5 +1276,5 @@
 
   SL_REQUIRE(retval == 0, _("retval == 0"));
-  suid_is_set = S_TRUE;
+  suid_is_set = SL_TRUE;
   SL_IRETURN(SL_ENONE, _("sl_set_suid"));
 }
@@ -1417,17 +1290,17 @@
   SL_ENTER(_("sl_unset_suid"));
 
-  if (uids_are_stored == S_FALSE)
+  if (uids_are_stored == SL_FALSE)
     {
       SL_IRETURN(SL_ENONE, _("sl_unset_suid"));
     }
 
-  SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));
+  SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));
 
   if (ruid == euid && rgid == egid)
     {
-      suid_is_set = S_FALSE;
+      suid_is_set = SL_FALSE;
       SL_IRETURN(SL_ENONE, _("sl_unset_suid"));
     }  
-  SL_REQUIRE(suid_is_set     == S_TRUE, _("suid_is_set == S_TRUE"));  
+  SL_REQUIRE(suid_is_set     == SL_TRUE, _("suid_is_set == SL_TRUE"));  
 
 #if defined(HAVE_SETRESUID)
@@ -1457,5 +1330,5 @@
 
   SL_REQUIRE(retval == 0, _("retval == 0"));
-  suid_is_set = S_FALSE;
+  suid_is_set = SL_FALSE;
   SL_IRETURN(SL_ENONE, _("sl_unset_suid"));
 }
@@ -1468,5 +1341,5 @@
 {
   SL_ENTER(_("sl_save_uids"));
-  if (uids_are_stored == S_TRUE) 
+  if (uids_are_stored == SL_TRUE) 
     SL_IRETURN(SL_EREPEAT, _("sl_save_uids"));
 
@@ -1477,5 +1350,5 @@
   ruid = ruid_orig;
   rgid = rgid_orig;
-  uids_are_stored = S_TRUE;
+  uids_are_stored = SL_TRUE;
 
   SL_IRETURN(SL_ENONE, _("sl_save_uids"));
@@ -1490,5 +1363,5 @@
 {
   SL_ENTER(_("sl_drop_privileges"));
-  SL_REQUIRE(uids_are_stored == S_TRUE, _("uids_are_stored == S_TRUE"));
+  SL_REQUIRE(uids_are_stored == SL_TRUE, _("uids_are_stored == SL_TRUE"));
 
   SL_REQUIRE(setgid(rgid_orig) == 0, _("setgid(rgid_orig) == 0"));
@@ -1515,5 +1388,5 @@
 {
   SL_ENTER(_("sl_policy_get_root"));
-  SL_REQUIRE(uids_are_stored == S_FALSE, _("uids_are_stored == S_FALSE"));
+  SL_REQUIRE(uids_are_stored == SL_FALSE, _("uids_are_stored == SL_FALSE"));
 
   SL_REQUIRE (sl_save_uids() == SL_ENONE, _("sl_save_uids() == SL_ENONE"));
@@ -1528,5 +1401,5 @@
       rgid = egid;
     }
-  suid_is_set = S_TRUE;
+  suid_is_set = SL_TRUE;
   if (euid == 0)
     {
@@ -1546,20 +1419,13 @@
 int sl_policy_get_real(char * user)
 {
+  struct passwd * tempres;
+
   SL_ENTER(_("sl_policy_get_real"));
-  SL_REQUIRE(uids_are_stored == S_FALSE, _("uids_are_stored == S_FALSE"));
+  SL_REQUIRE(uids_are_stored == SL_FALSE, _("uids_are_stored == SL_FALSE"));
   SL_REQUIRE (sl_save_uids() == SL_ENONE, _("sl_save_uids() == SL_ENONE"));
 
   if (euid == 0 || ruid == 0)
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      struct passwd    pwd;
-      char          *  buffer;
-      struct passwd *  tempres;
-      buffer = calloc(1,SH_PWBUF_SIZE);
-      SL_REQUIRE (buffer != NULL, _("buffer != NULL"));
-      sh_getpwnam_r(user, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-      struct passwd * tempres = sh_getpwnam(user);
-#endif
+      tempres = sh_getpwnam(user);
 
       SL_REQUIRE (NULL != tempres, _("tempres != NULL"));
@@ -1567,7 +1433,4 @@
       rgid_orig = tempres->pw_gid;
       ruid_orig = tempres->pw_uid;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      free(buffer);
-#endif
     }
   else
@@ -1580,5 +1443,5 @@
 	      _("sl_drop_privileges() == SL_ENONE"));
 
-  suid_is_set = S_TRUE;
+  suid_is_set = SL_TRUE;
   SL_IRETURN(SL_ENONE, _("sl_policy_get_real"));
 }
@@ -1590,35 +1453,29 @@
  * Do nothing if not SUID.
  */
-int sl_policy_get_user(const char * user)
-{
+int sl_policy_get_user(char * user)
+{
+  struct passwd * tempres;
+
   SL_ENTER(_("sl_policy_get_user"));
 
   SL_REQUIRE(user != NULL, _("user != NULL"));
-  SL_REQUIRE(uids_are_stored == S_FALSE, _("uids_are_stored == S_FALSE"));
+  SL_REQUIRE(uids_are_stored == SL_FALSE, _("uids_are_stored == SL_FALSE"));
   SL_REQUIRE (sl_save_uids() == SL_ENONE, _("sl_save_uids() == SL_ENONE"));
 
-#ifndef SH_ALLOW_SUID
   if (euid != ruid || egid != rgid)
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      struct passwd    pwd;
-      char          *  buffer;
-      struct passwd *  tempres;
-      buffer = calloc(1,SH_PWBUF_SIZE);
-      SL_REQUIRE (buffer != NULL, _("buffer != NULL"));
-      sh_getpwnam_r(user, &pwd, buffer, SH_PWBUF_SIZE, &tempres);
-#else
-      struct passwd * tempres = sh_getpwnam(user);
-#endif
+      tempres = sh_getpwnam(user);
 
       SL_REQUIRE (NULL != tempres, _("tempres != NULL"));
 
+#if 0
+      rgid = tempres->pw_gid;
+      ruid = tempres->pw_uid;
+      SL_REQUIRE(sl_unset_suid() == SL_ENONE, 
+		 _("sl_unset_suid() == SL_ENONE"));
+#endif
       SL_REQUIRE (sl_drop_privileges() == SL_ENONE,
 		  _("sl_drop_privileges() == SL_ENONE"));
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      free(buffer);
-#endif
-    }
-#endif
+    }
   SL_IRETURN(SL_ENONE, _("sl_policy_get_user"));
 }
@@ -1640,77 +1497,13 @@
 
 typedef struct openfiles {
-  SL_TICKET ticket;          /* The unique  ID.      */ 
-  int fd;                    /* The file descriptor. */
-  FILE * stream;             /* The file descriptor. */
-  char * path;               /* The file path.       */
-  int flush;                 /* Whether we want to flush the cache */
-  char ofile[SL_OFILE_SIZE]; /* origin file */
-  int  oline;                /* origin line */
-  sh_string * content;       /* The file content     */
+  SL_TICKET ticket;     /* The unique  ID.      */ 
+  int fd;               /* The file descriptor. */
+  char * path;          /* The file path.       */
 } SL_OFILE; 
 
 static SL_OFILE * ofiles[MAXFD]; 
 
-static char stale_orig_file[64] = { '\0' };
-static int  stale_orig_line = -1;
-static char stale_orig_mesg[128];
-
-static char badfd_orig_file[64] = { '\0' };
-static int  badfd_orig_line = -1;
-static char badfd_orig_mesg[128];
-
-
-char * sl_check_stale()
-{
-  if (stale_orig_line == -1)
-    return NULL;
-  sl_snprintf(stale_orig_mesg, sizeof(stale_orig_mesg), 
-	      _("stale handle, %s, %d"), stale_orig_file, stale_orig_line);
-  stale_orig_file[0] = '\0';
-  stale_orig_line    = -1;
-  return stale_orig_mesg;
-}
-
-char * sl_check_badfd()
-{
-  if (badfd_orig_line == -1)
-    return NULL;
-  sl_snprintf(badfd_orig_mesg, sizeof(badfd_orig_mesg), 
-	      _("close on file descriptor with allocated handle, %s, %d"), 
-	      badfd_orig_file, badfd_orig_line);
-  badfd_orig_file[0] = '\0';
-  badfd_orig_line    = -1;
-  return badfd_orig_mesg;
-}
-
-typedef struct { volatile unsigned int atom; } atomic_t;
-static atomic_t nonce_counter = { TOFFSET };
-
-#if defined(__GNUC__) && (defined(__i486__) || defined(__x86_64__))
-/* from linux/include/asm-i386/atomic.h */
-static unsigned int atomic_add ( unsigned int i, atomic_t *var)
-{
-  unsigned int j = i;
-
-  __asm__ __volatile__ ("lock; xaddl %0, %1"
-			: "+r" (i), "+m" (var->atom)
-			: : "memory");
-  return j+i; 
-}
-#else
-SH_MUTEX_STATIC(mutex_ticket, PTHREAD_MUTEX_INITIALIZER);
-
-static unsigned int atomic_add ( unsigned int i, atomic_t *var)
-{
-  volatile unsigned int j;
-
-  SH_MUTEX_LOCK_UNSAFE(mutex_ticket);
-  var->atom += i;
-  j = var->atom;
-  SH_MUTEX_UNLOCK_UNSAFE(mutex_ticket);
-
-  return j;
-}
-#endif
+
+static unsigned int nonce_counter = TOFFSET;
 
 static
@@ -1719,14 +1512,9 @@
   unsigned int high; /* index */ 
   unsigned int low;  /* nonce */
-  SL_TICKET    retval = SL_EINTERNAL;
-  unsigned int nonce;/* nonce */
 
   SL_ENTER(_("sl_create_ticket"));
 
-  if (myindex >= MAXFD)
-    {
-      retval = SL_EINTERNAL01;
-      goto out_ticket;
-    }
+  if (myindex >= MAXFD) 
+    SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket")); 
 
   /* mask out the high bit and check that it is not used
@@ -1735,35 +1523,21 @@
   high = (myindex + TOFFSET) & 0x7fff; 
 
-  if (high != myindex + TOFFSET)
-    {
-      retval = SL_EINTERNAL02;
-      goto out_ticket;
-    }
-
-  nonce = atomic_add(1, &nonce_counter);
-
+  if (high != myindex + TOFFSET) 
+    SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket")); 
+
+  low = nonce_counter & 0xffff;
+
+  /* Overflow -> nonce too big.
+   */
+  if ((low != nonce_counter++) || low == 0)
+    SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));
+ 
   /* Wrap around the nonce counter.
    * This is a dirty trick.
    */
-  if (nonce > 0x7fff)
-    {
-      nonce_counter.atom = TOFFSET;
-      nonce = atomic_add(1, &nonce_counter);
-    }
-
-  low = nonce & 0xffff;
-
-  /* Overflow -> nonce too big.
-   */
-  if ((low != nonce) || low == 0)
-    {
-      retval = SL_EINTERNAL03;
-      goto out_ticket;
-    }
-
-  retval = (SL_TICKET) ((high << 16) | low);
-
- out_ticket:
-  SL_RETURN (retval, _("sl_create_ticket")); 
+  if (nonce_counter > 0x7fff)
+    nonce_counter = TOFFSET;
+
+  SL_RETURN ((SL_TICKET) ((high << 16) | low), _("sl_create_ticket")); 
 }
 
@@ -1785,21 +1559,18 @@
 
   if ((of = ofiles[myindex])->fd < 0 || of->fd >= MAXFD )
-    return (SL_EINTERNAL04);
+    return (SL_EINTERNAL);
 
   if (((of->ticket) & 0xffff) == 0)
-    return (SL_EINTERNAL05); 
+    return (SL_EINTERNAL); 
 
   return (myindex); 
 }
 
-SL_TICKET sl_make_ticket (const char * ofile, int oline,
-			  int fd, const char * filename, FILE * stream)
-{
-  size_t    len;
+SL_TICKET sl_make_ticket (int fd, char * filename)
+{
   SL_TICKET ticket;
   SL_ENTER(_("sl_make_ticket"));
   /* Make entry.
    */
-  /* cppcheck-suppress arrayIndexOutOfBoundsCond */
   if (fd >= MAXFD || fd < 0)
      {
@@ -1807,29 +1578,18 @@
      }
 
-  if (ofiles[fd] != NULL) /* stale entry */
-    {
-      /* SL_IRETURN(SL_EINTERNAL06, _("sl_make_ticket")); */
-      sl_strlcpy(stale_orig_file, ofiles[fd]->ofile, sizeof(stale_orig_file));
-      stale_orig_line = ofiles[fd]->oline;
-
-      if (ofiles[fd]->content)
-	sh_string_destroy(&(ofiles[fd]->content));
-      (void) free (ofiles[fd]->path);
-      (void) free (ofiles[fd]);
+   if (ofiles[fd] != NULL)
+    {
+      SL_IRETURN(SL_EINTERNAL, _("sl_make_ticket"));
+    }
+
+  if ( (ofiles[fd] = (SL_OFILE *) malloc(sizeof(SL_OFILE))) == NULL)
+    {
+      SL_IRETURN(SL_EMEM, _("sl_make_ticket"));
+    }
+
+   if ( (ofiles[fd]->path = (char *) malloc( strlen(filename)+1) ) == NULL)
+    {
+      free(ofiles[fd]);
       ofiles[fd] = NULL;
-    }
-
-  if ( (ofiles[fd] = calloc(1,sizeof(SL_OFILE))) == NULL)
-    {
-      SL_IRETURN(SL_EMEM, _("sl_make_ticket"));
-    }
-
-  len = sl_strlen(filename)+1;
-
-  if ( (ofiles[fd]->path = calloc(1,len) ) == NULL)
-    {
-      free (ofiles[fd]);
-      ofiles[fd] = NULL;
-      /* cppcheck-suppress memleak */
       SL_IRETURN(SL_EMEM, _("sl_make_ticket"));
     }
@@ -1843,20 +1603,11 @@
       (void) free (ofiles[fd]->path);
       (void) free (ofiles[fd]);
-      ofiles[fd] = NULL;
-      /* cppcheck-suppress memleak */
       SL_IRETURN(ticket, _("sl_make_ticket"));
     }
 
-  sl_strlcpy (ofiles[fd]->path, filename, len);
-  ofiles[fd]->ticket  = ticket;
-  ofiles[fd]->fd      = fd;
-  ofiles[fd]->content = NULL;
-  ofiles[fd]->stream  = stream;
-  ofiles[fd]->flush   = S_FALSE;
-
-  sl_strlcpy(ofiles[fd]->ofile, ofile, SL_OFILE_SIZE);
-  ofiles[fd]->oline = oline;
-
-  /* cppcheck-suppress memleak */
+  strcpy (ofiles[fd]->path, filename);                    /* Known to fit  */
+  ofiles[fd]->ticket = ticket;
+  ofiles[fd]->fd     = fd;
+
   SL_IRETURN(ticket, _("sl_make_ticket"));
 }
@@ -1873,5 +1624,5 @@
 
 #if !defined(O_NOATIME)
-#if defined(__linux__) && (defined(__i386__) || defined(__x86_64__) || defined(__PPC__))
+#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
 #define O_NOATIME 01000000
 #else
@@ -1888,15 +1639,12 @@
 
 static
-int sl_open_file (const char * ofile, int oline,
-		  const char *filename, int mode, int priv)
+int sl_open_file (char *filename, int mode, int priv)
 {
   struct stat   lbuf;
   struct stat   buf;
-  int           errval = 0;
   int           lstat_return;
   int           stat_return;
   int           fd;
   int           sflags;
-  size_t        len;
   SL_TICKET     ticket;
  
@@ -1914,10 +1662,10 @@
     SL_IRETURN(SL_ENULL, _("sl_open_file"));
   if (mode < SL_OPEN_MIN || mode > SL_OPEN_MAX)
-    SL_IRETURN(SL_EINTERNAL07, _("sl_open_file"));
+    SL_IRETURN(SL_EINTERNAL, _("sl_open_file"));
     
   /* "This system call always succeeds and the previous value of
    * the mask is returned." 
    */
-  (void) umask (0);
+  (void) umask (0); 
 
   if (mode == SL_OPEN_FOR_FASTREAD)
@@ -1925,10 +1673,8 @@
       fd = aud_open_noatime (FIL__, __LINE__, priv, filename, 
 			     O_RDONLY|O_NONBLOCK, 0, &o_noatime);
-      /*
       if (fd >= 0) {
 	sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
 	retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags & ~O_NONBLOCK);
       }
-      */
       if (fd < 0)
 	SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
@@ -1944,5 +1690,4 @@
   else
     lstat_return = retry_lstat(FIL__, __LINE__, filename, &lbuf);
-  errval = errno;
 #ifdef USE_SUID
   if (priv == SL_YESPRIV)
@@ -1954,10 +1699,9 @@
       lstat_return = ENOENT;
       if ( (mode == SL_OPEN_FOR_READ && lstat_return == ENOENT) ||
-	   (errval != ENOENT))
+	   (errno != ENOENT))
 	{
 	  TPT(( 0, FIL__, __LINE__, _("msg=<lstat: %s> errno=<%d>\n"), 
-	    filename, errval));
-	  errno = errval;
-	  SL_IRETURN(SL_ESTAT, _("sl_open_file"));
+	    filename, errno));
+	  SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
 	}
     }
@@ -1966,9 +1710,6 @@
        ( S_ISDIR(lbuf.st_mode) || (S_IWOTH & lbuf.st_mode) ) 
       )
-    {
-      int retval = S_ISDIR(lbuf.st_mode) ? SL_EISDIR : SL_EBADOTH;
-      errno = 0;
-      SL_IRETURN(retval, _("sl_open_file"));
-    }
+    SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
+
     
   /* O_NOATIME has an effect for read(). But write() ?.
@@ -1979,5 +1720,4 @@
       fd = aud_open_noatime (FIL__, __LINE__, priv, filename, 
 			     O_RDONLY|O_NONBLOCK, 0, &o_noatime);
-      errval = errno;
       if (fd >= 0) {
 	sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
@@ -1992,27 +1732,19 @@
 	fd = aud_open (FIL__, __LINE__, priv, filename, 
 		       O_WRONLY,                   open_mode);
-      errval = errno;
       break;
     case SL_OPEN_SAFE_RDWR:
       if (lstat_return == ENOENT)
-	{
-	  fd = aud_open (FIL__, __LINE__, priv, filename, 
-			 O_RDWR|O_CREAT|O_EXCL,      open_mode);
-	  errval = errno;
-	}
+      	fd = aud_open (FIL__, __LINE__, priv, filename, 
+		       O_RDWR|O_CREAT|O_EXCL,      open_mode);
       else
-	{
-	  errno = errval;
-	  SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
-	}
+	SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
       break;
     case SL_OPEN_FOR_RDWR:
       if (lstat_return == ENOENT)
-	fd = aud_open (FIL__, __LINE__, priv, filename, 
-			 O_RDWR|O_CREAT|O_EXCL,      open_mode);
+      	fd = aud_open (FIL__, __LINE__, priv, filename, 
+		       O_RDWR|O_CREAT|O_EXCL,      open_mode);
       else
 	fd = aud_open (FIL__, __LINE__, priv, filename, 
 		       O_RDWR,                     open_mode);
-      errval = errno;
       break;
     case SL_OPEN_FOR_WTRUNC:
@@ -2023,5 +1755,4 @@
 	fd = aud_open (FIL__, __LINE__, priv, filename, 
 		       O_WRONLY|O_TRUNC,           open_mode);
-      errval = errno;
       break;
     case SL_OPEN_FOR_RWTRUNC:
@@ -2032,9 +1763,7 @@
 	fd = aud_open (FIL__, __LINE__, priv, filename, 
 		       O_RDWR|O_TRUNC,             open_mode);
-      errval = errno;
       break;
     default:
-      errno = 0;
-      SL_IRETURN(SL_EINTERNAL08, _("sl_open_file"));
+      SL_IRETURN(SL_EINTERNAL, _("sl_open_file"));
     }
 
@@ -2042,6 +1771,5 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<Error opening: %s> errno=<%d>\n"), 
-	    filename, errval));
-      errno = errval;
+	    filename, errno));
       SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
     }
@@ -2052,5 +1780,4 @@
 #endif
   stat_return = retry_fstat(FIL__, __LINE__, fd, &buf);
-  errval = errno;
 #ifdef USE_SUID
   if (priv == SL_YESPRIV)
@@ -2060,14 +1787,11 @@
   if (stat_return < 0)
     {
-      sl_close_fd (FIL__, __LINE__, fd);
-      errno = errval;
-      SL_IRETURN(SL_EFSTAT, _("sl_open_file"));
-    }
-
-  errno = 0;
+      close (fd);
+      SL_IRETURN(SL_EBADFILE, _("sl_open_file"));
+    }
 
   if (lstat_return != ENOENT && buf.st_ino != lbuf.st_ino)
     {
-      sl_close_fd (FIL__, __LINE__, fd);
+      close (fd);
       SL_IRETURN(SL_EBOGUS, _("sl_open_file"));
     }
@@ -2077,40 +1801,27 @@
   /* Make entry.
    */
-  /* cppcheck-suppress arrayIndexOutOfBoundsCond */
   if (fd >= MAXFD)
      {
-	sl_close_fd(FIL__, __LINE__, fd);
+	close(fd);
 	SL_IRETURN(SL_TOOMANY, _("sl_open_file"));
      }
 
-  if (ofiles[fd] != NULL) /* stale entry */
-    {
-      /*
-      sl_close_fd(FIL__, __LINE__, fd);
-      SL_IRETURN(SL_EINTERNAL09, _("sl_open_file"));
-      */
-      sl_strlcpy(stale_orig_file, ofiles[fd]->ofile, sizeof(stale_orig_file));
-      stale_orig_line = ofiles[fd]->oline;
-
-      if (ofiles[fd]->content)
-	sh_string_destroy(&(ofiles[fd]->content));
-      (void) free (ofiles[fd]->path);
-      (void) free (ofiles[fd]);
+   if (ofiles[fd] != NULL)
+    {
+      close(fd);
+      SL_IRETURN(SL_EINTERNAL, _("sl_open_file"));
+    }
+
+  if ( (ofiles[fd] = (SL_OFILE *) malloc(sizeof(SL_OFILE))) == NULL)
+    {
+      close(fd);
+      SL_IRETURN(SL_EMEM, _("sl_open_file"));
+    }
+
+   if ( (ofiles[fd]->path = (char *) malloc( strlen(filename)+1) ) == NULL)
+    {
+      free(ofiles[fd]);
       ofiles[fd] = NULL;
-    }
-
-  if ( (ofiles[fd] = calloc(1,sizeof(SL_OFILE))) == NULL)
-    {
-      sl_close_fd(FIL__, __LINE__, fd);
-      SL_IRETURN(SL_EMEM, _("sl_open_file"));
-    }
-
-  len = sl_strlen(filename)+1;
-
-  if ( (ofiles[fd]->path = calloc(1,len) ) == NULL)
-    {
-      free (ofiles[fd]);
-      ofiles[fd] = NULL;
-      sl_close_fd(FIL__, __LINE__, fd);
+      close(fd);
       SL_IRETURN(SL_EMEM, _("sl_open_file"));
     }
@@ -2124,55 +1835,17 @@
       (void) free (ofiles[fd]->path);
       (void) free (ofiles[fd]);
-      ofiles[fd] = NULL;
-      sl_close_fd(FIL__, __LINE__, fd);
+      close(fd);
       SL_IRETURN(ticket, _("sl_open_file"));
     }
 
-  sl_strlcpy (ofiles[fd]->path, filename, len);
-  ofiles[fd]->ticket  = ticket;
-  ofiles[fd]->fd      = fd;
-  ofiles[fd]->content = NULL;
-  ofiles[fd]->stream  = NULL;
-  ofiles[fd]->flush   = S_FALSE;
-
-  sl_strlcpy(ofiles[fd]->ofile, ofile, SL_OFILE_SIZE);
-  ofiles[fd]->oline = oline;
+  strcpy (ofiles[fd]->path, filename);                    /* Known to fit  */
+  ofiles[fd]->ticket = ticket;
+  ofiles[fd]->fd     = fd;
 
   SL_IRETURN(ticket, _("sl_open_file"));
 }
 
-FILE * sl_stream (SL_TICKET ticket, char * mode)
-{
-  int    fd;
-
-  if (SL_ISERROR(fd = sl_read_ticket(ticket)))
-    return (NULL);
-
-  if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || 
-      ticket != ofiles[fd]->ticket || fd < 0)
-    return (NULL);
-
-  if (!ofiles[fd]->stream)
-    ofiles[fd]->stream = fdopen(fd, mode);
-
-  return ofiles[fd]->stream;
-}
-
-int get_the_fd (SL_TICKET ticket)
-{
-  int fd;
-
-  if (SL_ISERROR(fd = sl_read_ticket(ticket)))
-    return (fd);
-
-  if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || 
-      ticket != ofiles[fd]->ticket || fd < 0)
-    return (SL_EINTERNAL10);
-
-  return (fd);
-}
-
 static
-int check_fname_priv (const char * fname, int priv)
+int check_fname_priv (char * fname, int priv)
 {
   SL_ENTER(_("check_fname_priv"));
@@ -2180,10 +1853,9 @@
     SL_IRETURN(SL_ENULL, _("check_fname_priv"));
   if (priv != SL_YESPRIV && priv != SL_NOPRIV)
-    SL_IRETURN(SL_EINTERNAL11, _("check_fname_priv"));
+    SL_IRETURN(SL_EINTERNAL, _("check_fname_priv"));
   SL_IRETURN(SL_ENONE, _("check_fname_priv"));
 }
   
-SL_TICKET sl_open_write (const char * ofile, int oline,
-			 const char * fname, int priv)
+SL_TICKET sl_open_write (char * fname, int priv)
 {
   long status;
@@ -2193,10 +1865,9 @@
     SL_IRETURN(status, _("sl_open_write"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_WRITE, priv);
+  status = sl_open_file(fname, SL_OPEN_FOR_WRITE, priv);
   SL_IRETURN(status, _("sl_open_write"));
 }
 
-SL_TICKET sl_open_read (const char * ofile, int oline,
-			const char * fname, int priv)
+SL_TICKET sl_open_read (char * fname, int priv)
 {
   long status;
@@ -2211,61 +1882,9 @@
     }
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_READ, priv);
+  status = sl_open_file(fname, SL_OPEN_FOR_READ, priv);
   SL_IRETURN(status, _("sl_open_read"));
 }
 
-#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_MINCORE) && defined(POSIX_FADV_DONTNEED)
-static int sl_check_mincore(int fd)
-{
-  /* Idea from Tobias Oetiker (http://insights.oetiker.ch/linux/fadvise.html)
-   */
-  struct stat fbuf;
-  int retval = -1;
-
-  if (0 == fstat(fd, &fbuf))
-    {
-      void *f_map;
-      
-      f_map = mmap((void *)0, fbuf.st_size, PROT_NONE, MAP_SHARED, fd, 0);
-      if (MAP_FAILED != f_map)
-	{
-	  extern int sh_unix_pagesize(void);
-	  size_t i;
-	  size_t page_size    = sh_unix_pagesize();
-	  size_t vec_size     = (fbuf.st_size+page_size-1)/page_size;
-	  unsigned char * vec = calloc(1, vec_size);
-
-	  if (vec)
-	    {
-	      mincore(f_map, fbuf.st_size, vec);
-	      /* imax = fbuf.st_size/page_size; */
-	      for (i = 0; i <= vec_size; ++i)
-		{
-		  if (vec[i]&1)
-		    {
-		      goto incore;
-		    }
-		}
-	      retval = 0;
-	    incore:
-	      free(vec);
-	    }
-	  munmap(f_map, fbuf.st_size);
-	}
-    }
-  return retval;
-}
-#endif
-
-static int sl_drop_cache = S_FALSE;
-
-int sl_set_drop_cache(const char * str)
-{
-  extern int sh_util_flagval(const char * c, int * fval);
-  return sh_util_flagval(str, &sl_drop_cache);
-}
-
-SL_TICKET sl_open_fastread (const char * ofile, int oline,
-			    const char * fname, int priv)
+SL_TICKET sl_open_fastread (char * fname, int priv)
 {
   long status;
@@ -2275,25 +1894,9 @@
     SL_IRETURN(status, _("sl_open_read"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_FASTREAD, priv);
-
-#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_MINCORE) && defined(POSIX_FADV_DONTNEED)
-
-  if (S_FALSE != sl_drop_cache && !SL_ISERROR(status))
-    {
-      int fd = get_the_fd(status);
-      if (fd >= 0)
-	{
-	  if (0 == sl_check_mincore(fd))
-	    ofiles[fd]->flush = S_TRUE;
-	}
-    }
-
-#endif
-
+  status = sl_open_file(fname, SL_OPEN_FOR_FASTREAD, priv);
   SL_IRETURN(status, _("sl_open_fastread"));
 }
 
-SL_TICKET sl_open_rdwr (const char * ofile, int oline,
-			const char * fname, int priv)
+SL_TICKET sl_open_rdwr (char * fname, int priv)
 {
   long status;
@@ -2303,10 +1906,9 @@
     SL_IRETURN(status, _("sl_open_rdwr"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_RDWR, priv);
+  status = sl_open_file(fname, SL_OPEN_FOR_RDWR, priv);
   SL_IRETURN(status, _("sl_open_rdwr"));
 }
 
-SL_TICKET sl_open_safe_rdwr (const char * ofile, int oline,
-			     const char * fname, int priv)
+SL_TICKET sl_open_safe_rdwr (char * fname, int priv)
 {
   long status;
@@ -2316,10 +1918,9 @@
     SL_IRETURN(status, _("sl_open_safe_rdwr"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_SAFE_RDWR, priv);
+  status = sl_open_file(fname, SL_OPEN_SAFE_RDWR, priv);
   SL_IRETURN(status, _("sl_open_safe_rdwr"));
 }
 
-SL_TICKET sl_open_write_trunc (const char * ofile, int oline,
-			       const char * fname, int priv)
+SL_TICKET sl_open_write_trunc (char * fname, int priv)
 {
   long status;
@@ -2329,10 +1930,9 @@
     SL_IRETURN(status, _("sl_open_write_trunc"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_WTRUNC, priv);
+  status = sl_open_file(fname, SL_OPEN_FOR_WTRUNC, priv);
   SL_IRETURN(status, _("sl_open_write_trunc"));
 }
 
-SL_TICKET sl_open_rdwr_trunc (const char * ofile, int oline,
-			      const char * fname, int priv)
+SL_TICKET sl_open_rdwr_trunc (char * fname, int priv)
 {
   long status;
@@ -2342,10 +1942,10 @@
     SL_IRETURN(status, _("sl_open_rdwr_trunc"));
 
-  status = sl_open_file(ofile, oline, fname, SL_OPEN_FOR_RWTRUNC, priv);
+  status = sl_open_file(fname, SL_OPEN_FOR_RWTRUNC, priv);
   SL_IRETURN(status, _("sl_open_rdwr_trunc"));
 }
 
 
-int sl_init_content (SL_TICKET ticket, size_t size)
+int get_the_fd (SL_TICKET ticket)
 {
   int fd;
@@ -2354,62 +1954,12 @@
     return (fd);
 
-  if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || 
-      ticket != ofiles[fd]->ticket || fd < 0)
-    return (SL_EINTERNAL12);
-
-  if (ofiles[fd]->content)
-    sh_string_destroy(&(ofiles[fd]->content));
-  ofiles[fd]->content = sh_string_new(size);
-
-  return SL_ENONE;
-}
-
-sh_string * sl_get_content (SL_TICKET ticket)
-{
-  int fd;
-
-  if (SL_ISERROR(fd = sl_read_ticket(ticket)))
-    return (NULL);
-
-  if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || 
-      ticket != ofiles[fd]->ticket || fd < 0)
-    return (NULL);
-
-  return (ofiles[fd]->content);
-}
-
-int sl_lock (SL_TICKET ticket)
-{
-  int fd;
-  struct flock lock;
-  int retval;
- 
-  SL_ENTER(_("sl_lock"));
-
-  if (SL_ISERROR(fd = get_the_fd (ticket)))
-    SL_IRETURN(fd, _("sl_lock"));
-
-  lock.l_type   = F_WRLCK;
-  lock.l_whence = SEEK_SET;
-  lock.l_start  = 0;
-  lock.l_len    = 0;
-
-  /* F_SETLK returns if the lock cannot be obtained */
-  do {
-    retval = fcntl(fd, F_SETLK, &lock);
-  } while (retval < 0 && errno == EINTR);
-
-  if (retval < 0 && errno == EBADF)
-    SL_IRETURN(SL_ETICKET, _("sl_lock"));
-  else if (retval < 0)
-    SL_IRETURN(SL_EBADFILE, _("sl_lock"));
-  else
-    SL_IRETURN(SL_ENONE, _("sl_lock"));
- }
- 
+  if (ofiles[fd] == NULL || fd != ofiles[fd]->fd || fd < 0)
+    return (SL_EINTERNAL);
+  return (fd);
+}
+
 int sl_close (SL_TICKET ticket) 
 {
   register int fd;
-  FILE * fp = NULL;
 
   SL_ENTER(_("sl_close"));
@@ -2418,81 +1968,21 @@
     SL_IRETURN(fd, _("sl_close"));
 
-  if (ofiles[fd] != NULL)
-    {
-#if defined(HAVE_POSIX_FADVISE) && defined(HAVE_MINCORE) && defined(POSIX_FADV_DONTNEED)
-      if (ofiles[fd]->flush == S_TRUE)
-	{
-	  posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
-	}
-#endif
-      if (ofiles[fd]->content)
-	sh_string_destroy(&(ofiles[fd]->content));
-      (void) free (ofiles[fd]->path);
-      fp = ofiles[fd]->stream;
-      (void) free (ofiles[fd]);
-      ofiles[fd] = NULL;
-    }
-
   /* This may fail, but what to do then ?
    */
-  if (fp)
-    {
-      if (0 != fclose (fp)) /* within sl_close */
-	{
-	  TPT((0, FIL__, __LINE__, 
-	       _("msg=<Error fclosing file.>, fd=<%d>, err=<%s>\n"), 
-	       fd, strerror(errno)));
-	  SL_IRETURN(SL_ECLOSE, _("sl_close")); 
-	}
-    }
-  else
-    {
-      if (0 != close(fd)) /* within sl_close */
-	{
-	  TPT((0, FIL__, __LINE__, 
-	       _("msg=<Error closing file.>, fd=<%d>, err=<%s>\n"), 
-	       fd, strerror(errno)));
-	  SL_IRETURN(SL_ECLOSE, _("sl_close")); 
-	}
+  if (0 != close(fd) && ofiles[fd] != NULL)
+    {
+      TPT((0, FIL__, __LINE__, 
+	   _("msg=<Error closing file.>, path=<%s>, fd=<%d>\n"), 
+	   ofiles[fd]->path, fd));
+    }
+
+  if (ofiles[fd] != NULL)
+    {
+      (void) free(ofiles[fd]->path);
+      (void) free(ofiles[fd]);
+      ofiles[fd] = NULL;
     }
 
   SL_IRETURN(SL_ENONE, _("sl_close")); 
-}
-
-int sl_close_fd (const char * file, int line, int fd)
-{
-  int ret = -1;
-
-  SL_ENTER(_("sl_close_fd"));
-
-  if (fd >= 0 && fd < MAXFD && ofiles[fd] != NULL) /* stale ofiles[fd] handle */
-    {
-      sl_strlcpy(badfd_orig_file, file, sizeof(badfd_orig_file));
-      badfd_orig_line = line;
-    }
-
-  ret = close(fd); /* within sl_close_fd wrapper */
-
-  SL_IRETURN(ret, _("sl_close_fd")); 
-}
-
-int sl_fclose (const char * file, int line, FILE * fp)
-{
-  int ret = -1;
-  int fd;
-
-  SL_ENTER(_("sl_fclose"));
-
-  fd = fileno(fp);
-
-  if (fd >= 0 && fd < MAXFD && ofiles[fd] != NULL) /* stale ofiles[fd] handle */
-    {
-      sl_strlcpy(badfd_orig_file, file, sizeof(badfd_orig_file));
-      badfd_orig_line = line;
-    }
-
-  ret = fclose(fp); /* within sl_fclose wrapper */
-
-  SL_IRETURN(ret, _("sl_fclose")); 
 }
 
@@ -2503,9 +1993,7 @@
       if (ofiles[fd] != NULL && fd != except)
 	{
-	  if (ofiles[fd]->content)
-	    sh_string_destroy(&(ofiles[fd]->content));
 	  if (ofiles[fd]->path != NULL)
-	    (void) free (ofiles[fd]->path);
-	  (void) free (ofiles[fd]);
+	    (void) free(ofiles[fd]->path);
+	  (void) free(ofiles[fd]);
 	  ofiles[fd] = NULL;
 	}
@@ -2515,17 +2003,4 @@
 }
 
-int sl_dropall_dirty(int fd, int except)
-{
-  while (fd < MAXFD)
-    {
-      if (ofiles[fd] != NULL && fd != except)
-	{
-	  ofiles[fd] = NULL;
-	}
-      ++fd;
-    }
-  return 0;
-}
-
 
 int sl_unlink (SL_TICKET ticket) 
@@ -2606,36 +2081,14 @@
 }
 
-int sl_read_timeout_prep (SL_TICKET ticket)
-{
-  int fd;
-  int sflags;
-
-  SL_ENTER(_("sl_read_timeout_prep"));
-
-  if (SL_ISERROR(fd = get_the_fd(ticket)))
-    {
-      TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd));
-      SL_IRETURN(fd, _("sl_read_timeout_prep"));
-    }
-
-  /* set to non-blocking mode 
-   */
-  sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags | O_NONBLOCK);
-
-  SL_IRETURN(SL_ENONE, _("sl_read_timeout_prep"));
-}
-
-
-static int sl_read_timeout_fd_int (int fd, void * buf_in, size_t count, 
-				   int timeout, int is_nonblocking, int once)
-{
-  int sflags = 0;
+
+int sl_read_timeout (SL_TICKET ticket, void * buf_in, size_t count, 
+		     int timeout)
+{
   fd_set readfds;
   struct timeval tv;
-  /* int sflags; */
+  int sflags;
   int retval;
-  int error;
-
+
+  int    fd;
   int    byteread = 0;
   int    bytes    = 0;
@@ -2647,13 +2100,27 @@
   extern volatile int sig_termfast;
  
-  if (is_nonblocking == S_FALSE)
-    {
-      /* set to non-blocking mode 
-       */
-      sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
-      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags | O_NONBLOCK);
+  if (count < 1)
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<range error>")));
+      return(SL_ERANGE);
+    }
+  if (buf_in == NULL)
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>")));
+      return (SL_ENULL);
+    }
+
+  if (SL_ISERROR(fd = get_the_fd(ticket)))
+    {
+      TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd));
+      return (fd);
     }
 
   buf = (char *) buf_in;
+
+  /* set to non-blocking mode 
+   */
+  sflags = retry_fcntl(FIL__, __LINE__, fd, F_GETFL, 0);
+  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags | O_NONBLOCK);
 
   tstart = time(NULL);
@@ -2662,6 +2129,26 @@
   while (count > 0)
     {
+
+      if (sig_termfast == 1) 
+	{
+	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, 
+		      sflags & ~O_NONBLOCK);
+	  return (SL_EREAD);
+	}
+	  
       FD_ZERO(&readfds);
       FD_SET(fd, &readfds);
+
+      if (tdiff >= timeout)
+	{
+	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, 
+		      sflags & ~O_NONBLOCK);
+	  return (SL_TIMEOUT);
+	}
+
+      /*
+      tnow  = time(NULL);
+      tdiff = tnow - tstart;
+      */
 
       tv.tv_sec  = timeout - tdiff;
@@ -2673,15 +2160,13 @@
 	{
 	  byteread = read (fd, buf, count);
-
 	  if (byteread > 0) 
 	    {
 	      bytes += byteread; count -= byteread;
 	      buf += byteread;
-	      if (count == 0 || once == S_TRUE)
+	      if (count == 0)
 		break;
 	    }  
 	  else if (byteread == 0)
 	    {
-	      /* zero indicates end of file */
 	      break;
 	    }
@@ -2697,9 +2182,6 @@
 	      else
 		{
-		  error = errno;
-		  if (is_nonblocking == S_FALSE)
-		      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
-		  TPT(( 0, FIL__, __LINE__, _("msg=<read error>")));
-		  errno = error;
+		  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, 
+			      sflags & ~O_NONBLOCK);
 		  return (SL_EREAD);
 		}
@@ -2715,86 +2197,20 @@
       else if (retval == 0)
 	{
-	  if (is_nonblocking == S_FALSE)
-	      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
-	  TPT(( 0, FIL__, __LINE__, _("msg=<timeout>")));
-	  errno = 0;
-	  if (bytes > 0)
-	    return ((int) bytes); 
+	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, 
+		      sflags & ~O_NONBLOCK);
 	  return (SL_TIMEOUT);
 	}
       else
 	{
-	  error = errno;
-	  if (is_nonblocking == S_FALSE)
-	      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
-	  TPT(( 0, FIL__, __LINE__, _("msg=<timeout>")));
-	  errno = error;
+	  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, 
+		      sflags & ~O_NONBLOCK);
 	  return (SL_EREAD);
 	}
-
-      if (sig_termfast == 1) 
-	{
-	  if (is_nonblocking == S_FALSE)
-	      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
-	  TPT(( 0, FIL__, __LINE__, _("msg=<terminated>")));
-	  errno = 0;
-	  return (SL_EREAD);
-	}
-	  
       tnow  = time(NULL);
       tdiff = tnow - tstart;
-
-      if (tdiff > timeout)
-	{
-	  if (is_nonblocking == S_FALSE)
-	      retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
-	  TPT(( 0, FIL__, __LINE__, _("msg=<timeout>")));
-	  errno = 0;
-	  if (bytes > 0)
-	    return ((int) bytes);
-	  return (SL_TIMEOUT);
-	}
-    }
-
-  if (is_nonblocking == S_FALSE)
-    retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags);
+    }
+
+  retry_fcntl(FIL__, __LINE__, fd, F_SETFL, sflags & ~O_NONBLOCK);
   return ((int) bytes);
-}
-
-int sl_read_timeout_fd (int fd, void * buf_in, size_t count, 
-			int timeout, int is_nonblocking)
-{
-  return sl_read_timeout_fd_int (fd, buf_in, count, timeout, is_nonblocking, S_FALSE);
-}
-
-int sl_read_timeout_fd_once (int fd, void * buf_in, size_t count, 
-			int timeout, int is_nonblocking)
-{
-  return sl_read_timeout_fd_int (fd, buf_in, count, timeout, is_nonblocking, S_TRUE);
-}
-
-int sl_read_timeout (SL_TICKET ticket, void * buf_in, size_t count, 
-		     int timeout, int is_nonblocking)
-{
-  int    fd, retval;
- 
-  SL_ENTER(_("sl_read_timeout"));
-
-  if (buf_in == NULL || SL_ISERROR(fd = get_the_fd(ticket)))
-    {
-      if (buf_in == NULL)
-	{
-	  TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>")));
-	  SL_IRETURN((SL_ENULL), _("sl_read_timeout"));
-	}
-      if (SL_ISERROR(fd = get_the_fd(ticket)))
-	{
-	  TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd));
-	  SL_IRETURN((fd),  _("sl_read_timeout"));
-	}
-    }
-
-  retval = sl_read_timeout_fd (fd, buf_in, count, timeout, is_nonblocking);
-  SL_IRETURN((retval), _("sl_read_timeout"));
 }
 
@@ -2808,15 +2224,13 @@
   char * buf;
 
-  SL_ENTER(_("sl_read"));
-
   if (count < 1)
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<range error>")));
-      SL_IRETURN((SL_ERANGE), _("sl_read"));
+      return(SL_ERANGE);
     }
   if (buf_in == NULL)
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>")));
-      SL_IRETURN((SL_ENULL), _("sl_read"));
+      return (SL_ENULL);
     }
 
@@ -2824,5 +2238,5 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd));
-      SL_IRETURN((fd), _("sl_read"));
+      return (fd);
     }
 
@@ -2838,5 +2252,5 @@
 	}  
     } while ( byteread > 0 || 
-	      ( byteread == -1 && (errno == EINTR || errno == EAGAIN)) 
+	      ( byteread < 0 && (errno == EINTR || errno == EAGAIN)) 
 	      );
 
@@ -2845,7 +2259,7 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<read error> errno=<%d>\n"), errno));
-      SL_IRETURN((SL_EREAD), _("sl_read"));
-    }
-  SL_IRETURN((bytes), _("sl_read"));
+      return (SL_EREAD);
+    }
+  return (bytes);
 }
 
@@ -2857,15 +2271,13 @@
   char * buf;
 
-  SL_ENTER(_("sl_read_fast"));
-
   if (count < 1)
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<range error>")));
-      SL_IRETURN((SL_ERANGE), _("sl_read_fast"));
+      return(SL_ERANGE);
     }
   if (buf_in == NULL)
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<null buffer>")));
-      SL_IRETURN((SL_ENULL), _("sl_read_fast"));
+      return (SL_ENULL);
     }
 
@@ -2873,5 +2285,5 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<ticket error> errno=<%d>"), fd));
-      SL_IRETURN((fd), _("sl_read_fast"));
+      return (fd);
     }
 
@@ -2883,7 +2295,7 @@
       if (byteread >= 0) 
 	{
-	  SL_IRETURN((byteread), _("sl_read_fast"));
+	  return (byteread);
 	}  
-    } while ( byteread == -1 && (errno == EINTR || errno == EAGAIN));
+    } while ( byteread < 0 && (errno == EINTR || errno == EAGAIN));
 
  
@@ -2891,11 +2303,11 @@
     {
       TPT(( 0, FIL__, __LINE__, _("msg=<read error> errno=<%d>\n"), errno));
-      SL_IRETURN((SL_EREAD), _("sl_read_fast"));
-    }
-  SL_IRETURN((0), _("sl_read_fast"));
-}
-
-
-int sl_write (SL_TICKET ticket, const void * msg_in, long nbytes)
+      return (SL_EREAD);
+    }
+  return (0);
+}
+
+
+int sl_write (SL_TICKET ticket, void * msg_in, long nbytes)
 {
   long bytewritten;
@@ -2903,5 +2315,5 @@
   int  fd;
 
-  const char * msg; 
+  char * msg; 
 
   SL_ENTER(_("sl_write"));
@@ -2914,15 +2326,13 @@
     SL_IRETURN(fd, _("sl_write"));
 
-  msg = (const char *) msg_in;
+  msg = (char *) msg_in;
 
   /* write
    */
   bytecount    = 0;
-
+  bytewritten  = 0;
   while (bytecount < nbytes) 
     {    
-      bytewritten = write (fd, msg, nbytes-bytecount);
-
-      if (bytewritten > 0) 
+      if ((bytewritten = write (fd, msg, nbytes-bytecount)) > 0) 
 	{
 	  bytecount += bytewritten;
@@ -2940,5 +2350,5 @@
 }
 
-int sl_write_line (SL_TICKET ticket, const void * msg, long nbytes)
+int sl_write_line (SL_TICKET ticket, void * msg, long nbytes)
 {
   int  status;
@@ -2951,21 +2361,4 @@
 
   SL_IRETURN(status, _("sl_write_line"));
-}
-
-int sl_write_line_fast (SL_TICKET ticket, void * msg, long nbytes)
-{
-  int  status;
-  char * p = (char *) msg;
-
-  SL_ENTER(_("sl_write_line_fast"));
-
-  /* Here nbytes is strlen(msg), so p[nbytes] is the terminating '\0'
-   * Overwrite the terminator, write out, then write back the terminator.
-   */
-  p[nbytes] = '\n';
-  status = sl_write(ticket,  msg, nbytes+1);
-  p[nbytes] = '\0';
-
-  SL_IRETURN(status, _("sl_write_line_fast"));
 }
 
@@ -2978,93 +2371,65 @@
 
 extern uid_t rootonly[];
-extern unsigned int   EUIDSLOT;
-extern unsigned int   ORIG_EUIDSLOT;
+extern int   EUIDSLOT;
+extern int   ORIG_EUIDSLOT;
 
 extern char  tf_path[MAXFILENAME];	/* Error path for trust function. */
 extern uid_t tf_euid;	                /* Space for EUID of process.     */
 
+
 char * sl_error_string(int errorcode)
 {
-
   switch (errorcode)
     {
     case SL_EBOGUS: 
-      return _("Bogus file, modified during access");
+      return _("Bogus file. Modified during access.");
     case SL_EWRITE: 
-      return _("Write error");
+      return _("Write error.");
     case SL_EREAD: 
-      return _("Read error");
+      return _("Read error.");
     case SL_ESYNC: 
-      return _("Error in fsync()");
+      return _("Error in fsync().");
     case SL_EFORWARD: 
-      return _("Error in lseek()");
+      return _("Error in lseek().");
     case SL_EREWIND: 
-      return _("Error in lseek()");
+      return _("Error in lseek().");
     case SL_EUNLINK: 
-      return _("Error in unlink()");
+      return _("Error in unlink().");
     case SL_EMEM: 
-      return _("Out of memory");
+      return _("Out of memory.");
     case SL_EINTERNAL: 
-      return _("Internal error");
-    case SL_EINTERNAL01: 
-      return _("Internal error 01");
-    case SL_EINTERNAL02: 
-      return _("Internal error 02");
-    case SL_EINTERNAL03: 
-      return _("Internal error 03");
-    case SL_EINTERNAL04: 
-      return _("Internal error 04");
-    case SL_EINTERNAL05: 
-      return _("Internal error 05");
-    case SL_EINTERNAL06: 
-      return _("Internal error 06");
-    case SL_EINTERNAL07: 
-      return _("Internal error 07");
-    case SL_EINTERNAL08: 
-      return _("Internal error 08");
-    case SL_EINTERNAL09: 
-      return _("Internal error 09");
-    case SL_EINTERNAL10: 
-      return _("Internal error 10");
-    case SL_EINTERNAL11: 
-      return _("Internal error 11");
-    case SL_EINTERNAL12: 
-      return _("Internal error 12");
+      return _("Internal error.");
     case SL_ETICKET:
-      return _("Bad ticket");
+      return _("Bad ticket.");
     case SL_EREPEAT: 
-      return _("Illegal repeated use of function");
+      return _("Illegal repeated use of function.");
     case SL_ERANGE: 
-      return _("Argument out of range");
+      return _("Argument out of range.");
     case SL_ENULL: 
-      return _("Dereferenced NULL pointer");
+      return _("Dereferenced NULL pointer.");
 
     case SL_EBADUID: 
-      return _("Owner not trustworthy");
+      return _("Owner not trustworthy.");
     case SL_EBADGID:
-      return _("Group writeable and member not trustworthy");
+      return _("Group writeable and member not trustworthy.");
     case SL_EBADOTH:
-      return _("World writeable");
-    case SL_EISDIR:
-      return _("Is a directory");
+      return _("World writeable.");
     case SL_EBADFILE:
-      return _("File access error");
+      return _("File access error.");
     case SL_EBADNAME:
-      return _("Invalid filename (prob. too long or null)");
+      return _("Invalid filename (prob. too long or null).");
 
     case SL_ETRUNC:
-      return _("Truncation occured");
+      return _("Truncation occured.");
     case SL_ESTAT:
-      return _("stat() failed");
-    case SL_EFSTAT:
-      return _("fstat() failed");
+      return _("stat() failed.");
     default:
-      return _("Unknown error");
-    }
-}
-
-
-
-char * sl_trust_errfile(void)
+      return _("Unknown error.");
+    }
+}
+
+
+
+char * sl_trust_errfile()
 {
   return &tf_path[0];
@@ -3072,5 +2437,5 @@
 
 extern uid_t tf_baduid;
-uid_t   sl_trust_baduid(void)
+uid_t   sl_trust_baduid()
 {
   return tf_baduid;
@@ -3078,5 +2443,5 @@
 
 extern gid_t tf_badgid;
-gid_t   sl_trust_badgid(void)
+gid_t   sl_trust_badgid()
 {
   return tf_badgid;
@@ -3086,7 +2451,7 @@
 static int trust_count = 0;
 
-int  sl_trust_purge_user (void)
-{
-  unsigned int i;
+int  sl_trust_purge_user ()
+{
+  int i;
 
   EUIDSLOT = ORIG_EUIDSLOT;
@@ -3112,59 +2477,7 @@
 }
 
-#include "sh_mem.h"
-extern char * sh_util_strdup (const char * str);
-
-struct sl_trustfile_store {
-  char * filename;
-  uid_t  teuid;
-  struct sl_trustfile_store * next;
-};
-
-static struct sl_trustfile_store * sl_trusted_files = NULL;
-
-static void sl_add_trusted_file(const char * filename, uid_t teuid)
-{
-  struct sl_trustfile_store *new = SH_ALLOC(sizeof(struct sl_trustfile_store));
-
-  new->filename = sh_util_strdup (filename);
-  new->teuid    = teuid;
-  new->next     = sl_trusted_files;
-
-  sl_trusted_files = new;
-  return;
-}
-
-static const char * sl_check_trusted_file(const char * filename, uid_t teuid)
-{
-  struct sl_trustfile_store *new = sl_trusted_files;
-
-  while (new)
-    {
-      if ((new->teuid == teuid) && (0 == strcmp(new->filename, filename)))
-	return filename;
-      new = new->next;
-    }
-
-  return NULL;
-}
-
-static void sl_clear_trusted_file(struct sl_trustfile_store * file)
-{
-  if (file)
-    {
-      if (file->next != NULL)
-	sl_clear_trusted_file(file->next);
-      SH_FREE(file->filename);
-      SH_FREE(file);
-    }
-  return;
-}
-
-int sl_trustfile_euid(const char * filename, uid_t teuid)
-{
-  long          status;
-  static size_t old = 0;
-  static size_t now;
-
+int sl_trustfile_euid(char * filename, uid_t teuid)
+{
+  long status;
   SL_ENTER(_("sl_trustfile_euid"));
 
@@ -3173,103 +2486,8 @@
     SL_IRETURN(SL_EBADNAME, _("sl_trustfile_euid"));
 
-  now = time(NULL);
-
-  if (now < (old + 300))
-    {
-      if (NULL != sl_check_trusted_file(filename, teuid))
-	{
-	  sl_strlcpy(tf_path, filename, sizeof(tf_path));
-	  SL_IRETURN(SL_ENONE, _("sl_trustfile_euid"));
-	}
-    }
-  else
-    {
-      sl_clear_trusted_file(sl_trusted_files);
-      sl_trusted_files = NULL;
-      old = now;
-    }
-
   tf_euid = teuid;
   status = sl_trustfile(filename, NULL, NULL);
-  if (status == SL_ENONE)
-    sl_add_trusted_file(filename, teuid);
   SL_IRETURN(status, _("sl_trustfile_euid"));
 }
 
-/* ---------------------------------------------------------------- 
- *
- *    Overflow tests
- *
- * ---------------------------------------------------------------- */
-
-#ifndef SIZE_MAX
-#define SIZE_MAX              (4294967295U)
-#endif
-
-int sl_ok_muli (int a, int b) /* a*b */
-{
-  if ((b == 0) || (a >= (INT_MIN / b) && a <= (INT_MAX / b)))
-    return S_TRUE; /* no overflow */
-  return S_FALSE;
-}
-
-int sl_ok_muls (size_t a, size_t b) /* a*b */
-{
-  if ((b == 0) || (a <= (SIZE_MAX / b)))
-    return S_TRUE; /* no overflow */
-  return S_FALSE;
-}
-
-int sl_ok_divi (int a, int b) /* a/b */
-{
-  (void) a;
-  if (b != 0)
-    return S_TRUE; /* no overflow */
-  return S_FALSE;
-}
-
-int sl_ok_addi (int a, int b) /* a+b */
-{
-  if (a >= 0 && b >= 0)
-    {
-      if (a <= (INT_MAX - b))
-	return S_TRUE; /* no overflow */
-      else
-	return S_FALSE;
-    }
-  else if (a < 0 && b < 0)
-    {
-      if (a >= (INT_MIN - b))
-	return S_TRUE; /* no overflow */
-      else
-	return S_FALSE;
-    }
-  return S_TRUE;
-}
-
-int sl_ok_adds (size_t a, size_t b) /* a+b */
-{
-  if (a <= (SIZE_MAX - b))
-    return S_TRUE; /* no overflow */
-  else
-    return S_FALSE;
-}
-
-int sl_ok_subi (int a, int b) /* a-b */
-{
-  if (a >= 0 && b < 0)
-    {
-      if (a <= (INT_MAX + b))
-	return S_TRUE; /* no overflow */
-      else
-	return S_FALSE;
-    }
-  else if (a < 0 && b >= 0)
-    {
-      if (a >= (INT_MIN + b))
-	return S_TRUE; /* no overflow */
-      else
-	return S_FALSE;
-    }
-  return S_TRUE;
-}
+
Index: trunk/src/sstrip.c
===================================================================
--- trunk/src/sstrip.c	(revision 1)
+++ trunk/src/sstrip.c	(revision 1)
@@ -0,0 +1,331 @@
+/* sstrip, version 2.0: Copyright (C) 1999-2001 by Brian Raiter, under the
+ * GNU General Public License. No warranty. See LICENSE for details.
+ */
+
+/* #include "config_xor.h" */ 
+
+#include	<stdio.h>
+#include	<stdlib.h>
+#include	<string.h>
+#include	<errno.h>
+#include	<unistd.h>
+#include	<fcntl.h>
+
+#if !defined(__ia64)  && !defined(__ia64__)  && !defined(__itanium__) &&  \
+    !defined(__alpha) && !defined(__alpha__) && \
+    (defined(__linux__) || defined(__FreeBSD__)) && \
+    (defined(__i386__)  || defined(__i386) || defined(i386))
+
+/* || defined(__sun) || defined(__sun__) || defined(sun) */
+
+#if defined(__linux__)
+#include        <linux/elf.h>
+#else
+#include        <elf.h>
+#endif
+
+#ifndef TRUE
+#define	TRUE		1
+#define	FALSE		0
+#endif
+
+#if ELF_CLASS == ELFCLASS32
+#define Elf_Ehdr        Elf32_Ehdr
+#define Elf_Phdr        Elf32_Phdr
+#else
+#define Elf_Ehdr        Elf64_Ehdr
+#define Elf_Phdr        Elf64_Phdr
+#endif
+
+/* The name of the program.
+ */
+static char const      *progname;
+
+/* The name of the current file.
+ */
+static char const      *filename;
+
+
+/* A simple error-handling function. FALSE is always returned for the
+ * convenience of the caller.
+ */
+static int err(char const *errmsg)
+{
+    fprintf(stderr, "%s: %s: %s\n", progname, filename, errmsg);
+    return FALSE;
+}
+
+/* A macro for I/O errors: The given error message is used only when
+ * errno is not set.
+ */
+#define	ferr(msg)	(err(errno ? strerror(errno) : (msg)))
+
+/* readelfheader() reads the ELF header into our global variable, and
+ * checks to make sure that this is in fact a file that we should be
+ * munging.
+ */
+static int readelfheader(int fd, Elf_Ehdr *ehdr)
+{
+    errno = 0;
+    if (read(fd, ehdr, sizeof *ehdr) != sizeof *ehdr)
+	return ferr("missing or incomplete ELF header.");
+
+    /* Check the ELF signature.
+     */
+    if (!(ehdr->e_ident[EI_MAG0] == ELFMAG0 &&
+	  ehdr->e_ident[EI_MAG1] == ELFMAG1 &&
+	  ehdr->e_ident[EI_MAG2] == ELFMAG2 &&
+	  ehdr->e_ident[EI_MAG3] == ELFMAG3))
+	return err("missing ELF signature.");
+
+    /* Compare the file's class and endianness with the program's.
+     */
+    if (ehdr->e_ident[EI_DATA] != ELF_DATA)
+	return err("ELF file has different endianness.");
+    if (ehdr->e_ident[EI_CLASS] != ELF_CLASS)
+	return err("ELF file has different word size.");
+
+    /* Check the target architecture.
+     */
+    if (ehdr->e_machine != ELF_ARCH)
+	return err("ELF file created for different architecture.");
+
+    /* Verify the sizes of the ELF header and the program segment
+     * header table entries.
+     */
+    if (ehdr->e_ehsize != sizeof(Elf_Ehdr))
+	return err("unrecognized ELF header size.");
+    if (ehdr->e_phentsize != sizeof(Elf_Phdr))
+	return err("unrecognized program segment header size.");
+
+    /* Finally, check the file type.
+     */
+    if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)
+	return err("not an executable or shared-object library.");
+
+    return TRUE;
+}
+
+/* readphdrtable() loads the program segment header table into memory.
+ */
+static int readphdrtable(int fd, Elf_Ehdr const *ehdr, Elf_Phdr **phdrs)
+{
+    size_t	size;
+
+    if (!ehdr->e_phoff || !ehdr->e_phnum)
+	return err("ELF file has no program header table.");
+
+    size = ehdr->e_phnum * sizeof **phdrs;
+    if (!(*phdrs = malloc(size)))
+	return err("Out of memory!");
+
+    errno = 0;
+    if (read(fd, *phdrs, size) != (ssize_t)size)
+	return ferr("missing or incomplete program segment header table.");
+
+    return TRUE;
+}
+
+/* getmemorysize() determines the offset of the last byte of the file
+ * that is referenced by an entry in the program segment header table.
+ * (Anything in the file after that point is not used when the program
+ * is executing, and thus can be safely discarded.)
+ */
+static int getmemorysize(Elf_Ehdr const *ehdr, Elf_Phdr const *phdrs,
+			 unsigned long *newsize)
+{
+    Elf_Phdr   const   *phdr;
+    unsigned long	size, n;
+    int			i;
+
+    /* Start by setting the size to include the ELF header and the
+     * complete program segment header table.
+     */
+    size = ehdr->e_phoff + ehdr->e_phnum * sizeof *phdrs;
+    if (size < sizeof *ehdr)
+	size = sizeof *ehdr;
+
+    /* Then keep extending the size to include whatever data the
+     * program segment header table references.
+     */
+    for (i = 0, phdr = phdrs ; i < ehdr->e_phnum ; ++i, ++phdr) {
+	if (phdr->p_type != PT_NULL) {
+	    n = phdr->p_offset + phdr->p_filesz;
+	    if (n > size)
+		size = n;
+	}
+    }
+
+    *newsize = size;
+    return TRUE;
+}
+
+/* truncatezeros() examines the bytes at the end of the file's
+ * size-to-be, and reduces the size to exclude any trailing zero
+ * bytes.
+ */
+static int truncatezeros(int fd, unsigned long *newsize)
+{
+    unsigned char	contents[1024];
+    unsigned long	size, n;
+
+    size = *newsize;
+    do {
+	n = sizeof contents;
+	if (n > size)
+	    n = size;
+	if (lseek(fd, size - n, SEEK_SET) == (off_t)-1)
+	    return ferr("cannot seek in file.");
+	if (read(fd, contents, n) != (ssize_t)n)
+	    return ferr("cannot read file contents");
+	while (n && !contents[--n])
+	    --size;
+    } while (size && !n);
+
+    /* Sanity check.
+     */
+    if (!size)
+	return err("ELF file is completely blank!");
+
+    *newsize = size;
+    return TRUE;
+}
+
+/* modifyheaders() removes references to the section header table if
+ * it was stripped, and reduces program header table entries that
+ * included truncated bytes at the end of the file.
+ */
+static int modifyheaders(Elf_Ehdr *ehdr, Elf_Phdr *phdrs,
+			 unsigned long newsize)
+{
+    Elf_Phdr   *phdr;
+    int		i;
+
+    /* If the section header table is gone, then remove all references
+     * to it in the ELF header.
+     */
+    if (ehdr->e_shoff >= newsize) {
+	ehdr->e_shoff = 0;
+	ehdr->e_shnum = 0;
+	ehdr->e_shentsize = 0;
+	ehdr->e_shstrndx = 0;
+    }
+
+    /* The program adjusts the file size of any segment that was
+     * truncated. The case of a segment being completely stripped out
+     * is handled separately.
+     */
+    for (i = 0, phdr = phdrs ; i < ehdr->e_phnum ; ++i, ++phdr) {
+	if (phdr->p_offset >= newsize) {
+	    phdr->p_offset = newsize;
+	    phdr->p_filesz = 0;
+	} else if (phdr->p_offset + phdr->p_filesz > newsize) {
+	    phdr->p_filesz = newsize - phdr->p_offset;
+	}
+    }
+
+    return TRUE;
+}
+
+/* commitchanges() writes the new headers back to the original file
+ * and sets the file to its new size.
+ */
+static int commitchanges(int fd, Elf_Ehdr const *ehdr, Elf_Phdr *phdrs,
+			 unsigned long newsize)
+{
+    size_t	n;
+
+    /* Save the changes to the ELF header, if any.
+     */
+    if (lseek(fd, 0, SEEK_SET))
+	return ferr("could not rewind file");
+    errno = 0;
+    if (write(fd, ehdr, sizeof *ehdr) != sizeof *ehdr)
+	return err("could not modify file");
+
+    /* Save the changes to the program segment header table, if any.
+     */
+    if (lseek(fd, ehdr->e_phoff, SEEK_SET) == (off_t)-1) {
+	err("could not seek in file.");
+	goto warning;
+    }
+    n = ehdr->e_phnum * sizeof *phdrs;
+    if (write(fd, phdrs, n) != (ssize_t)n) {
+	err("could not write to file");
+	goto warning;
+    }
+
+    /* Eleventh-hour sanity check: don't truncate before the end of
+     * the program segment header table.
+     */
+    if (newsize < ehdr->e_phoff + n)
+	newsize = ehdr->e_phoff + n;
+
+    /* Chop off the end of the file.
+     */
+    if (ftruncate(fd, newsize)) {
+	err("could not resize file");
+	goto warning;
+    }
+
+    return TRUE;
+
+  warning:
+    return err("ELF file may have been corrupted!");
+}
+
+/* main() loops over the cmdline arguments, leaving all the real work
+ * to the other functions.
+ */
+int main(int argc, char *argv[])
+{
+    int			fd;
+    Elf_Ehdr		ehdr;
+    Elf_Phdr	       *phdrs = NULL;
+    unsigned long	newsize;
+    char	      **arg;
+    int			failures = 0;
+
+    if (argc < 2 || argv[1][0] == '-') {
+	printf("Usage: sstrip FILE...\n"
+	       "sstrip discards all nonessential bytes from an executable.\n\n"
+	       "Version 2.0 Copyright (C) 2000,2001 Brian Raiter.\n"
+	       "This program is free software, licensed under the GNU\n"
+	       "General Public License. There is absolutely no warranty.\n");
+	return EXIT_SUCCESS;
+    }
+
+    progname = argv[0];
+
+    for (arg = argv + 1 ; *arg != NULL ; ++arg) {
+	filename = *arg;
+
+	fd = open(*arg, O_RDWR);
+	if (fd < 0) {
+	    ferr("can't open");
+	    ++failures;
+	    continue;
+	}
+
+	if (!(readelfheader(fd, &ehdr)			&&
+	      readphdrtable(fd, &ehdr, &phdrs)		&&
+	      getmemorysize(&ehdr, phdrs, &newsize)	&&
+	      truncatezeros(fd, &newsize)		&&
+	      modifyheaders(&ehdr, phdrs, newsize)	&&
+	      commitchanges(fd, &ehdr, phdrs, newsize)))
+	    ++failures;
+
+	close(fd);
+    }
+
+    return failures ? EXIT_FAILURE : EXIT_SUCCESS;
+}
+
+#else
+
+int main()
+{
+  return (EXIT_SUCCESS);
+}
+
+#endif
Index: trunk/src/t-test0.c
===================================================================
--- trunk/src/t-test0.c	(revision 591)
+++ 	(revision )
@@ -1,482 +1,0 @@
-/*
-* Copyright (c) 1996-1999, 2001-2004 Wolfram Gloger
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that (i) the above copyright notices and this permission
-notice appear in all copies of the software and related documentation,
-and (ii) the name of Wolfram Gloger may not be used in any advertising
-or publicity relating to the software.
-
-THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
-INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
-OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-*/
-
-/*
- * $Id: t-test1.c,v 1.2 2004/11/04 14:58:45 wg Exp $
- * by Wolfram Gloger 1996-1999, 2001, 2004
- * A multi-thread test for malloc performance, maintaining one pool of
- * allocated bins per thread.
- */
-/*
-  t-test[12] <n-total> <n-parallel> <n-allocs> <size-max> <bins>
-
-    n-total = total number of threads executed (default 10)
-    n-parallel = number of threads running in parallel (2)
-    n-allocs = number of malloc()'s / free()'s per thread (10000)
-    size-max = max. size requested with malloc() in bytes (10000)
-    bins = number of bins to maintain
-*/
-
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
-#if (defined __STDC__ && __STDC__) || defined __cplusplus
-# include <stdlib.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <sys/mman.h>
-
-/*
-#if !USE_MALLOC
-#include <malloc.h>
-#else
-#include "malloc.h"
-#endif
-*/
-
-#ifdef USE_SYSTEM_MALLOC
-extern void *memalign(size_t boundary, size_t size);
-/* #define memalign(a,b)  malloc(b) */
-#else
-extern void *memalign(size_t boundary, size_t size);
-#endif
-
-static int verbose = 1;
-
-/* dummy for the samhain safe_fatal logger 
- */
-void safe_fatal(const char * details, 
-				const char * file, int line)
-{
-  (void) file;
-  (void) line;
-  fputs("assert failed: ", stderr);
-  puts(details);
-  _exit(EXIT_FAILURE);
-}
-
-/* lran2.h
- * by Wolfram Gloger 1996.
- *
- * A small, portable pseudo-random number generator.
- */
-
-#ifndef _LRAN2_H
-#define _LRAN2_H
-
-#define LRAN2_MAX 714025l /* constants for portable */
-#define IA	  1366l	  /* random number generator */
-#define IC	  150889l /* (see e.g. `Numerical Recipes') */
-
-struct lran2_st {
-    long x, y, v[97];
-};
-
-static void
-lran2_init(struct lran2_st* d, long seed)
-{
-    long x;
-    int j;
-
-    x = (IC - seed) % LRAN2_MAX;
-    if(x < 0) x = -x;
-    for(j=0; j<97; j++) {
-	x = (IA*x + IC) % LRAN2_MAX;
-	d->v[j] = x;
-    }
-    d->x = (IA*x + IC) % LRAN2_MAX;
-    d->y = d->x;
-}
-
-#ifdef __GNUC__
-__inline__
-#endif
-static long
-lran2(struct lran2_st* d)
-{
-    int j = (d->y % 97);
-
-    d->y = d->v[j];
-    d->x = (IA*d->x + IC) % LRAN2_MAX;
-    d->v[j] = d->x;
-    return d->y;
-}
-
-#undef IA
-#undef IC
-
-#endif
-
-/*
- * $Id: t-test.h,v 1.1 2004/11/04 14:32:21 wg Exp $
- * by Wolfram Gloger 1996.
- * Common data structures and functions for testing malloc performance.
- */
-
-/* Testing level */
-#ifndef TEST
-#define TEST 99
-#endif
-
-/* For large allocation sizes, the time required by copying in
-   realloc() can dwarf all other execution times.  Avoid this with a
-   size threshold. */
-#ifndef REALLOC_MAX
-#define REALLOC_MAX	2000
-#endif
-
-struct bin {
-	unsigned char *ptr;
-	unsigned long size;
-};
-
-#if TEST > 0
-
-static void
-mem_init(unsigned char *ptr, unsigned long size)
-{
-	unsigned long i, j;
-
-	if(size == 0) return;
-#if TEST > 3
-	memset(ptr, 0, size);
-#endif
-	for(i=0; i<size; i+=2047) {
-		j = (unsigned long)ptr ^ i;
-		ptr[i] = ((j ^ (j>>8)) & 0xFF);
-	}
-	j = (unsigned long)ptr ^ (size-1);
-	ptr[size-1] = ((j ^ (j>>8)) & 0xFF);
-}
-
-static int
-mem_check(unsigned char *ptr, unsigned long size)
-{
-	unsigned long i, j;
-
-	if(size == 0) return 0;
-	for(i=0; i<size; i+=2047) {
-		j = (unsigned long)ptr ^ i;
-		if(ptr[i] != ((j ^ (j>>8)) & 0xFF)) return 1;
-	}
-	j = (unsigned long)ptr ^ (size-1);
-	if(ptr[size-1] != ((j ^ (j>>8)) & 0xFF)) return 2;
-	return 0;
-}
-
-static int
-zero_check(unsigned* ptr, unsigned long size)
-{
-	unsigned char* ptr2;
-
-	while(size >= sizeof(*ptr)) {
-		if(*ptr++ != 0)
-			return -1;
-		size -= sizeof(*ptr);
-	}
-	ptr2 = (unsigned char*)ptr;
-	while(size > 0) {
-		if(*ptr2++ != 0)
-			return -1;
-		--size;
-	}
-	return 0;
-}
-
-#endif /* TEST > 0 */
-
-/* Allocate a bin with malloc(), realloc() or memalign().  r must be a
-   random number >= 1024. */
-int n_malloc=0, n_memalign=0, n_realloc=0, n_calloc=0;
-
-static void
-bin_alloc(struct bin *m, unsigned long size, int r)
-{
-#if TEST > 0
-	if(mem_check(m->ptr, m->size)) {
-	  fprintf(stderr, "memory corrupt!\n");
-	  exit(1);
-	}
-#endif
-	r %= 1024;
-	/*printf("%d ", r);*/
-	if(r < 4) { /* memalign */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)memalign(sizeof(int) << r, size);
-		++n_memalign;
-	} else if(r < 20) { /* calloc */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)calloc(size, 1);
-#if TEST > 0
-		if(zero_check((unsigned*)m->ptr, size)) {
-			unsigned long i;
-			for(i=0; i<size; i++)
-				if(m->ptr[i] != 0)
-					break;
-			fprintf(stderr, "calloc'ed memory non-zero (ptr=%p, i=%ld)!\n", m->ptr, i);
-			exit(1);
-		}
-#endif
-		++n_calloc;
-	} else if(r < 100 && m->size < REALLOC_MAX) { /* realloc */
-		if(m->size == 0) m->ptr = NULL;
-		m->ptr = realloc(m->ptr, size);
-		++n_realloc;
-	} else { /* plain malloc */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)malloc(size);
-		++n_malloc;
-	}
-	if(!m->ptr) {
-	  fprintf(stderr, "out of memory (r=%d, size=%ld)!\n", r, (long)size);
-	  exit(1);
-	}
-	m->size = size;
-#if TEST > 0
-	mem_init(m->ptr, m->size);
-#endif
-}
-
-/* Free a bin. */
-
-static void
-bin_free(struct bin *m)
-{
-	if(m->size == 0) return;
-#if TEST > 0
-	if(mem_check(m->ptr, m->size)) {
-	  fprintf(stderr, "memory corrupt!\n");
-	  exit(1);
-	}
-#endif
-	free(m->ptr);
-	m->size = 0;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
-
-
-struct user_data {
-	int bins, max;
-	unsigned long size;
-	long seed;
-};
-
-/*
- * $Id: thread-st.h$
- * pthread version
- * by Wolfram Gloger 2004
- */
-
-#include <pthread.h>
-#include <stdio.h>
-
-pthread_cond_t finish_cond = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t finish_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#ifndef USE_PTHREADS_STACKS
-#define USE_PTHREADS_STACKS 0
-#endif
-
-#ifndef STACKSIZE
-#define STACKSIZE	32768
-#endif
-
-
-
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
-
-
-#define N_TOTAL		10
-#ifndef N_THREADS
-#define N_THREADS	2
-#endif
-#ifndef N_TOTAL_PRINT
-#define N_TOTAL_PRINT 50
-#endif
-#ifndef MEMORY
-#define MEMORY		8000000l
-#endif
-#define SIZE		10000
-#define I_MAX		10000
-#define ACTIONS_MAX	30
-#ifndef TEST_FORK
-#define TEST_FORK 0
-#endif
-
-#define RANDOM(d,s)	(lran2(d) % (s))
-
-struct bin_info {
-	struct bin *m;
-	unsigned long size, bins;
-};
-
-#if TEST > 0
-
-void
-bin_test(struct bin_info *p)
-{
-	unsigned int b;
-
-	for(b=0; b<p->bins; b++) {
-		if(mem_check(p->m[b].ptr, p->m[b].size)) {
-		  fprintf(stderr, "memory corrupt!\n");
-		  abort();
-		}
-	}
-}
-
-#endif
-
-void
-malloc_test(unsigned long size, int bins, int max)
-{
-    unsigned int b;
-	int i, j, actions;
-	struct bin_info p;
-	struct lran2_st ld; /* data for random number generator */
-
-	lran2_init(&ld, ((long)max*size + getpid()) ^ bins);
-
-	p.m = (struct bin *)malloc(bins*sizeof(*p.m));
-	p.bins = bins;
-	p.size = size;
-
-	for(b=0; b<p.bins; b++) {
-		p.m[b].size = 0;
-		p.m[b].ptr = NULL;
-		if(RANDOM(&ld, 2) == 0)
-			bin_alloc(&p.m[b], RANDOM(&ld, p.size) + 1, lran2(&ld));
-	}
-	for(i=0; i<=max;) {
-#if TEST > 1
-		bin_test(&p);
-#endif
-		actions = RANDOM(&ld, ACTIONS_MAX);
-#if USE_MALLOC && MALLOC_DEBUG
-		if(actions < 2) { mallinfo2(); }
-#endif
-		for(j=0; j<actions; j++) {
-			b = RANDOM(&ld, p.bins);
-			bin_free(&p.m[b]);
-		}
-		i += actions;
-		actions = RANDOM(&ld, ACTIONS_MAX);
-		for(j=0; j<actions; j++) {
-			b = RANDOM(&ld, p.bins);
-			bin_alloc(&p.m[b], RANDOM(&ld, p.size) + 1, lran2(&ld));
-#if TEST > 2
-			bin_test(&p);
-#endif
-		}
-
-		i += actions;
-	}
-	for(b=0; b<p.bins; b++)
-		bin_free(&p.m[b]);
-	free(p.m);
-	return;
-}
-
-int n_total=0, n_total_max=N_TOTAL, n_running;
-
-int
-main(int argc, char *argv[])
-{
-	int bins;
-	int n_thr=N_THREADS;
-	int i_max=I_MAX;
-	unsigned long size=SIZE;
-
-#if USE_MALLOC && USE_STARTER==2
-	ptmalloc_init();
-	printf("ptmalloc_init\n");
-#endif
-
-	if((argc > 1) && (0 == strcmp(argv[1], "-h") || 0 == strcmp(argv[1], "--help")))
-	  {
-		printf("%s <n-total> <n-parallel> <n-allocs> <size-max> <bins>\n\n", argv[0]);
-		printf(" n-total = total number of threads executed (default 10)\n");
-		printf(" UNUSED n-parallel = number of threads running in parallel (2)\n");
-		printf(" n-allocs = number of malloc()'s / free()'s per thread (10000)\n");
-		printf(" size-max = max. size requested with malloc() in bytes (10000)\n");
-		printf(" bins = number of bins to maintain\n");
-		return 0;
-	  }
-
-	if(argc > 1) n_total_max = atoi(argv[1]);
-	if(n_total_max < 1) n_thr = 1;
-	if(argc > 2) n_thr = atoi(argv[2]);
-	if(n_thr < 1) n_thr = 1;
-	if(n_thr > 100) n_thr = 100;
-	if(argc > 3) i_max = atoi(argv[3]);
-
-	if(argc > 4) size = atol(argv[4]);
-	if(size < 2) size = 2;
-
-	bins = MEMORY/(size*n_thr);
-	if(argc > 5) bins = atoi(argv[5]);
-	if(bins < 4) bins = 4;
-
-	printf("[total=%d threads=%d] i_max=%d size=%ld bins=%d\n",
-		   n_total_max, n_thr, i_max, size, bins);
-
-	do {
-	  n_total++;
-	  malloc_test(size, bins, i_max);
-	  if (verbose)
-		if(n_total%N_TOTAL_PRINT == 0)
-		  printf("n_total = %8d - malloc %12d / memalign %12d / realloc %12d / calloc %12d\n", 
-				 n_total, 
-				 n_malloc, n_memalign, n_realloc, n_calloc);
-	} while (n_total < n_total_max);
-
-
-#if USE_MALLOC
-	malloc_stats();
-#endif
-	if (verbose)
-	  printf("Done.\n");
-	return 0;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/src/t-test1.c
===================================================================
--- trunk/src/t-test1.c	(revision 591)
+++ 	(revision )
@@ -1,684 +1,0 @@
-/*
-* Copyright (c) 1996-1999, 2001-2004 Wolfram Gloger
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that (i) the above copyright notices and this permission
-notice appear in all copies of the software and related documentation,
-and (ii) the name of Wolfram Gloger may not be used in any advertising
-or publicity relating to the software.
-
-THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL,
-INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
-DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY
-OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-*/
-
-/*
- * $Id: t-test1.c,v 1.2 2004/11/04 14:58:45 wg Exp $
- * by Wolfram Gloger 1996-1999, 2001, 2004
- * A multi-thread test for malloc performance, maintaining one pool of
- * allocated bins per thread.
- */
-/*
-  t-test[12] <n-total> <n-parallel> <n-allocs> <size-max> <bins>
-
-    n-total = total number of threads executed (default 10)
-    n-parallel = number of threads running in parallel (2)
-    n-allocs = number of malloc()'s / free()'s per thread (10000)
-    size-max = max. size requested with malloc() in bytes (10000)
-    bins = number of bins to maintain
-*/
-
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
-#if (defined __STDC__ && __STDC__) || defined __cplusplus
-# include <stdlib.h>
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <sys/mman.h>
-
-/*
-#if !USE_MALLOC
-#include <malloc.h>
-#else
-#include "malloc.h"
-#endif
-*/
-
-#ifdef USE_SYSTEM_MALLOC
-extern void *memalign(size_t boundary, size_t size);
-/* #define memalign(a,b)  malloc(b) */
-#else
-extern void *memalign(size_t boundary, size_t size);
-#endif
-
-static int verbose = 1;
-
-/* dummy for the samhain safe_fatal logger 
- */
-void safe_fatal(const char * details, 
-				const char * file, int line)
-{
-  (void) file;
-  (void) line;
-  fputs("assert failed: ", stderr);
-  puts(details);
-  _exit(EXIT_FAILURE);
-}
-
-/* lran2.h
- * by Wolfram Gloger 1996.
- *
- * A small, portable pseudo-random number generator.
- */
-
-#ifndef _LRAN2_H
-#define _LRAN2_H
-
-#define LRAN2_MAX 714025l /* constants for portable */
-#define IA	  1366l	  /* random number generator */
-#define IC	  150889l /* (see e.g. `Numerical Recipes') */
-
-struct lran2_st {
-    long x, y, v[97];
-};
-
-static void
-lran2_init(struct lran2_st* d, long seed)
-{
-    long x;
-    int j;
-
-    x = (IC - seed) % LRAN2_MAX;
-    if(x < 0) x = -x;
-    for(j=0; j<97; j++) {
-	x = (IA*x + IC) % LRAN2_MAX;
-	d->v[j] = x;
-    }
-    d->x = (IA*x + IC) % LRAN2_MAX;
-    d->y = d->x;
-}
-
-#ifdef __GNUC__
-__inline__
-#endif
-static long
-lran2(struct lran2_st* d)
-{
-    int j = (d->y % 97);
-
-    d->y = d->v[j];
-    d->x = (IA*d->x + IC) % LRAN2_MAX;
-    d->v[j] = d->x;
-    return d->y;
-}
-
-#undef IA
-#undef IC
-
-#endif
-
-/*
- * $Id: t-test.h,v 1.1 2004/11/04 14:32:21 wg Exp $
- * by Wolfram Gloger 1996.
- * Common data structures and functions for testing malloc performance.
- */
-
-/* Testing level */
-#ifndef TEST
-#define TEST 99
-#endif
-
-/* For large allocation sizes, the time required by copying in
-   realloc() can dwarf all other execution times.  Avoid this with a
-   size threshold. */
-#ifndef REALLOC_MAX
-#define REALLOC_MAX	2000
-#endif
-
-struct bin {
-	unsigned char *ptr;
-	unsigned long size;
-};
-
-#if TEST > 0
-
-static void
-mem_init(unsigned char *ptr, unsigned long size)
-{
-	unsigned long i, j;
-
-	if(size == 0) return;
-#if TEST > 3
-	memset(ptr, '\0', size);
-#endif
-	for(i=0; i<size; i+=2047) {
-		j = (unsigned long)ptr ^ i;
-		ptr[i] = ((j ^ (j>>8)) & 0xFF);
-	}
-	j = (unsigned long)ptr ^ (size-1);
-	ptr[size-1] = ((j ^ (j>>8)) & 0xFF);
-}
-
-static int
-mem_check(unsigned char *ptr, unsigned long size)
-{
-	unsigned long i, j;
-
-	if(size == 0) return 0;
-	for(i=0; i<size; i+=2047) {
-		j = (unsigned long)ptr ^ i;
-		if(ptr[i] != ((j ^ (j>>8)) & 0xFF)) return 1;
-	}
-	j = (unsigned long)ptr ^ (size-1);
-	if(ptr[size-1] != ((j ^ (j>>8)) & 0xFF)) return 2;
-	return 0;
-}
-
-static int
-zero_check(unsigned* ptr, unsigned long size)
-{
-	unsigned char* ptr2;
-
-	while(size >= sizeof(*ptr)) {
-		if(*ptr++ != 0)
-			return -1;
-		size -= sizeof(*ptr);
-	}
-	ptr2 = (unsigned char*)ptr;
-	while(size > 0) {
-		if(*ptr2++ != 0)
-			return -1;
-		--size;
-	}
-	return 0;
-}
-
-#endif /* TEST > 0 */
-
-/* Allocate a bin with malloc(), realloc() or memalign().  r must be a
-   random number >= 1024. */
-int n_malloc=0, n_memalign=0, n_realloc=0, n_calloc=0;
-
-static void
-bin_alloc(struct bin *m, unsigned long size, int r)
-{
-#if TEST > 0
-	if(mem_check(m->ptr, m->size)) {
-	  fprintf(stderr, "memory corrupt!\n");
-	  exit(1);
-	}
-#endif
-	r %= 1024;
-	/*printf("%d ", r);*/
-	if(r < 4) { /* memalign */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)memalign(sizeof(int) << r, size);
-		++n_memalign;
-	} else if(r < 20) { /* calloc */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)calloc(size, 1);
-#if TEST > 0
-		if(zero_check((unsigned*)m->ptr, size)) {
-			unsigned long i;
-			for(i=0; i<size; i++)
-				if(m->ptr[i] != 0)
-					break;
-			fprintf(stderr, "calloc'ed memory non-zero (ptr=%p, i=%ld)!\n", m->ptr, i);
-			exit(1);
-		}
-#endif
-		++n_calloc;
-	} else if(r < 100 && m->size < REALLOC_MAX) { /* realloc */
-		if(m->size == 0) m->ptr = NULL;
-		m->ptr = realloc(m->ptr, size);
-		++n_realloc;
-	} else { /* plain malloc */
-		if(m->size > 0) free(m->ptr);
-		m->ptr = (unsigned char *)malloc(size);
-		++n_malloc;
-	}
-	if(!m->ptr) {
-	  fprintf(stderr, "out of memory (r=%d, size=%ld)!\n", r, (long)size);
-	  exit(1);
-	}
-	m->size = size;
-#if TEST > 0
-	mem_init(m->ptr, m->size);
-#endif
-}
-
-/* Free a bin. */
-
-static void
-bin_free(struct bin *m)
-{
-	if(m->size == 0) return;
-#if TEST > 0
-	if(mem_check(m->ptr, m->size)) {
-	  fprintf(stderr, "memory corrupt!\n");
-	  exit(1);
-	}
-#endif
-	free(m->ptr);
-	m->size = 0;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
-
-
-struct user_data {
-	int bins, max;
-	unsigned long size;
-	long seed;
-};
-
-/*
- * $Id: thread-st.h$
- * pthread version
- * by Wolfram Gloger 2004
- */
-
-#include <pthread.h>
-#include <stdio.h>
-
-pthread_cond_t finish_cond = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t finish_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#ifndef USE_PTHREADS_STACKS
-#define USE_PTHREADS_STACKS 0
-#endif
-
-#ifndef STACKSIZE
-#define STACKSIZE	32768
-#endif
-
-struct thread_st {
-	char *sp;							/* stack pointer, can be 0 */
-	void (*func)(struct thread_st* st);	/* must be set by user */
-	pthread_t id;
-	int flags;
-	struct user_data u;
-};
-
-static void
-mthread_init(void)
-{
-#if !defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK)
-  extern int dnmalloc_pthread_init(void);
-  dnmalloc_pthread_init();
-#endif
-
-  if (verbose)
-	printf("Using posix threads.\n");
-  pthread_cond_init(&finish_cond, NULL);
-  pthread_mutex_init(&finish_mutex, NULL);
-}
-
-static void *
-mthread_wrapper(void *ptr)
-{
-	struct thread_st *st = (struct thread_st*)ptr;
-
-	/*printf("begin %p\n", st->sp);*/
-	st->func(st);
-	pthread_mutex_lock(&finish_mutex);
-	st->flags = 1;
-	pthread_mutex_unlock(&finish_mutex);
-	pthread_cond_signal(&finish_cond);
-	/*printf("end %p\n", st->sp);*/
-	return NULL;
-}
-
-/* Create a thread. */
-static int
-mthread_create(struct thread_st *st)
-{
-	st->flags = 0;
-	{
-		pthread_attr_t* attr_p = 0;
-#if USE_PTHREADS_STACKS
-		pthread_attr_t attr;
-
-		pthread_attr_init (&attr);
-		if(!st->sp)
-			st->sp = malloc(STACKSIZE+16);
-		if(!st->sp)
-			return -1;
-		if(pthread_attr_setstacksize(&attr, STACKSIZE))
-			fprintf(stderr, "error setting stacksize");
-		else
-			pthread_attr_setstackaddr(&attr, st->sp + STACKSIZE);
-		/*printf("create %p\n", st->sp);*/
-		attr_p = &attr;
-#endif
-		return pthread_create(&st->id, attr_p, mthread_wrapper, st);
-	}
-	return 0;
-}
-
-/* Wait for one of several subthreads to finish. */
-static void
-wait_for_thread(struct thread_st st[], int n_thr,
-				int (*end_thr)(struct thread_st*))
-{
-	int i;
-
-	pthread_mutex_lock(&finish_mutex);
-	for(;;) {
-		int term = 0;
-		for(i=0; i<n_thr; i++)
-			if(st[i].flags) {
-				/*printf("joining %p\n", st[i].sp);*/
-				if(pthread_join(st[i].id, NULL) == 0) {
-					st[i].flags = 0;
-					if(end_thr)
-						end_thr(&st[i]);
-				} else
-					fprintf(stderr, "can't join\n");
-				++term;
-			}
-		if(term > 0)
-			break;
-		pthread_cond_wait(&finish_cond, &finish_mutex);
-	}
-	pthread_mutex_unlock(&finish_mutex);
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
-
-
-#define N_TOTAL		10
-#ifndef N_THREADS
-#define N_THREADS	2
-#endif
-#ifndef N_TOTAL_PRINT
-#define N_TOTAL_PRINT 50
-#endif
-#ifndef MEMORY
-#define MEMORY		8000000l
-#endif
-#define SIZE		10000
-#define I_MAX		10000
-#define ACTIONS_MAX	30
-#ifndef TEST_FORK
-#define TEST_FORK 0
-#endif
-
-#define RANDOM(d,s)	(lran2(d) % (s))
-
-struct bin_info {
-	struct bin *m;
-	unsigned long size, bins;
-};
-
-#if TEST > 0
-
-void
-bin_test(struct bin_info *p)
-{
-	unsigned int b;
-
-	for(b=0; b<p->bins; b++) {
-		if(mem_check(p->m[b].ptr, p->m[b].size)) {
-		  fprintf(stderr, "memory corrupt!\n");
-		  abort();
-		}
-	}
-}
-
-#endif
-
-void
-malloc_test(struct thread_st *st)
-{
-    unsigned int b;
-	int i, j, actions, pid = 1;
-	struct bin_info p;
-	struct lran2_st ld; /* data for random number generator */
-
-	lran2_init(&ld, st->u.seed);
-#if TEST_FORK>0
-	if(RANDOM(&ld, TEST_FORK) == 0) {
-		int status;
-
-#if !USE_THR
-		pid = fork();
-#else
-		pid = fork1();
-#endif
-		if(pid > 0) {
-		    /*printf("forked, waiting for %d...\n", pid);*/
-			waitpid(pid, &status, 0);
-			printf("done with %d...\n", pid);
-			if(!WIFEXITED(status)) {
-				printf("child term with signal %d\n", WTERMSIG(status));
-				exit(1);
-			}
-			return;
-		}
-		exit(0);
-	}
-#endif
-	p.m = (struct bin *)malloc(st->u.bins*sizeof(*p.m));
-	p.bins = st->u.bins;
-	p.size = st->u.size;
-	for(b=0; b<p.bins; b++) {
-		p.m[b].size = 0;
-		p.m[b].ptr = NULL;
-		if(RANDOM(&ld, 2) == 0)
-			bin_alloc(&p.m[b], RANDOM(&ld, p.size) + 1, lran2(&ld));
-	}
-	for(i=0; i<=st->u.max;) {
-#if TEST > 1
-		bin_test(&p);
-#endif
-		actions = RANDOM(&ld, ACTIONS_MAX);
-#if USE_MALLOC && MALLOC_DEBUG
-		if(actions < 2) { mallinfo2(); }
-#endif
-		for(j=0; j<actions; j++) {
-			b = RANDOM(&ld, p.bins);
-			bin_free(&p.m[b]);
-		}
-		i += actions;
-		actions = RANDOM(&ld, ACTIONS_MAX);
-		for(j=0; j<actions; j++) {
-			b = RANDOM(&ld, p.bins);
-			bin_alloc(&p.m[b], RANDOM(&ld, p.size) + 1, lran2(&ld));
-#if TEST > 2
-			bin_test(&p);
-#endif
-		}
-#if 0 /* Test illegal free()s while setting MALLOC_CHECK_ */
-		for(j=0; j<8; j++) {
-			b = RANDOM(&ld, p.bins);
-			if(p.m[b].ptr) {
-			  int offset = (RANDOM(&ld, 11) - 5)*8;
-			  char *rogue = (char*)(p.m[b].ptr) + offset;
-			  /*printf("p=%p rogue=%p\n", p.m[b].ptr, rogue);*/
-			  free(rogue);
-			}
-		}
-#endif
-		i += actions;
-	}
-	for(b=0; b<p.bins; b++)
-		bin_free(&p.m[b]);
-	free(p.m);
-	if(pid == 0)
-		exit(0);
-}
-
-int n_total=0, n_total_max=N_TOTAL, n_running;
-
-int
-my_end_thread(struct thread_st *st)
-{
-	/* Thread st has finished.  Start a new one. */
-#if 0
-	printf("Thread %lx terminated.\n", (long)st->id);
-#endif
-	if(n_total >= n_total_max) {
-		n_running--;
-	} else if(st->u.seed++, mthread_create(st)) {
-		printf("Creating thread #%d failed.\n", n_total);
-		exit(1);
-	} else {
-		n_total++;
-		if (verbose)
-		  if(n_total%N_TOTAL_PRINT == 0)
-			printf("n_total = %8d - malloc %12d / memalign %12d / realloc %12d / calloc %12d\n", 
-				   n_total, 
-				   n_malloc, n_memalign, n_realloc, n_calloc);
-		
-	}
-	return 0;
-}
-
-#if 0
-/* Protect address space for allocation of n threads by LinuxThreads.  */
-static void
-protect_stack(int n)
-{
-	char buf[2048*1024];
-	char* guard;
-	size_t guard_size = 2*2048*1024UL*(n+2);
-
-	buf[0] = '\0';
-	guard = (char*)(((unsigned long)buf - 4096)& ~4095UL) - guard_size;
-	printf("Setting up stack guard at %p\n", guard);
-	if(mmap(guard, guard_size, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,
-			-1, 0)
-	   != guard)
-		printf("failed!\n");
-}
-#endif
-
-int
-main(int argc, char *argv[])
-{
-	int i, bins;
-	int n_thr=N_THREADS;
-	int i_max=I_MAX;
-	unsigned long size=SIZE;
-	struct thread_st *st;
-
-#if USE_MALLOC && USE_STARTER==2
-	ptmalloc_init();
-	printf("ptmalloc_init\n");
-#endif
-
-	if((argc > 1) && (0 == strcmp(argv[1], "-h") || 0 == strcmp(argv[1], "--help")))
-	  {
-		printf("%s <n-total> <n-parallel> <n-allocs> <size-max> <bins>\n\n", argv[0]);
-		printf(" n-total = total number of threads executed (default 10)\n");
-		printf(" n-parallel = number of threads running in parallel (2)\n");
-		printf(" n-allocs = number of malloc()'s / free()'s per thread (10000)\n");
-		printf(" size-max = max. size requested with malloc() in bytes (10000)\n");
-		printf(" bins = number of bins to maintain\n");
-		return 0;
-	  }
-
-	if(argc > 1) n_total_max = atoi(argv[1]);
-	if(n_total_max < 1) n_thr = 1;
-	if(argc > 2) n_thr = atoi(argv[2]);
-	if(n_thr < 1) n_thr = 1;
-	if(n_thr > 100) n_thr = 100;
-	if(argc > 3) i_max = atoi(argv[3]);
-
-	if(argc > 4) size = atol(argv[4]);
-	if(size < 2) size = 2;
-
-	bins = MEMORY/(size*n_thr);
-	if(argc > 5) bins = atoi(argv[5]);
-	if(bins < 4) bins = 4;
-
-	/*protect_stack(n_thr);*/
-
-	mthread_init();
-	printf("total=%d threads=%d i_max=%d size=%ld bins=%d\n",
-		   n_total_max, n_thr, i_max, size, bins);
-
-	st = (struct thread_st *)malloc(n_thr*sizeof(*st));
-	if(!st) exit(-1);
-
-#if !defined NO_THREADS && (defined __sun__ || defined sun)
-	/* I know of no other way to achieve proper concurrency with Solaris. */
-	thr_setconcurrency(n_thr);
-#endif
-
-	/* Start all n_thr threads. */
-	for(i=0; i<n_thr; i++) {
-		st[i].u.bins = bins;
-		st[i].u.max = i_max;
-		st[i].u.size = size;
-		st[i].u.seed = ((long)i_max*size + i) ^ bins;
-		st[i].sp = 0;
-		st[i].func = malloc_test;
-		if(mthread_create(&st[i])) {
-		  fprintf(stderr, "Creating thread #%d failed.\n", i);
-		  n_thr = i;
-		  exit(1);
-		}
-		if (verbose)
-		  printf("Created thread %lx.\n", (long)st[i].id);
-	}
-
-	/* Start an extra thread so we don't run out of stacks. */
-	if(0) {
-		struct thread_st lst;
-		lst.u.bins = 10; lst.u.max = 20; lst.u.size = 8000; lst.u.seed = 8999;
-		lst.sp = 0;
-		lst.func = malloc_test;
-		if(mthread_create(&lst)) {
-		  fprintf(stderr, "Creating thread #%d failed.\n", i);
-		  exit(1);
-		} else {
-			wait_for_thread(&lst, 1, NULL);
-		}
-	}
-
-	for(n_running=n_total=n_thr; n_running>0;) {
-		wait_for_thread(st, n_thr, my_end_thread);
-	}
-	for(i=0; i<n_thr; i++) {
-		free(st[i].sp);
-	}
-	free(st);
-#if USE_MALLOC
-	malloc_stats();
-#endif
-	if (verbose)
-	  printf("Done.\n");
-	return 0;
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * End:
- */
Index: trunk/src/trustfile.c
===================================================================
--- trunk/src/trustfile.c	(revision 591)
+++ trunk/src/trustfile.c	(revision 1)
@@ -86,7 +86,4 @@
 #else
 #define UID_CAST long
-#define HAVE_GETPWENT
-#define SH_MUTEX_LOCK(a)   ((void)0)
-#define SH_MUTEX_UNLOCK(a) ((void)0)
 #endif
 
@@ -99,28 +96,22 @@
 #include <string.h>
 #include <unistd.h>
-#include <errno.h>
-
-
-#if !defined(TRUST_MAIN)
-
+
+
+#ifndef TRUST_MAIN
 #include "slib.h"
 #define SH_NEED_PWD_GRP 1
 #include "sh_static.h"
-#include "sh_pthread.h"
 
 #else
 
 #define sh_getgrgid   getgrgid
-#define sh_getgrgid_r getgrgid_r
+#define sh_getpwent   getpwent
 #define sh_getpwnam   getpwnam
-#define sh_getpwnam_r getpwnam_r
 #define sh_getpwuid   getpwuid
-#define sh_getpwuid_r getpwuid_r
-#define sh_getpwent   getpwent
 #define sh_endpwent   endpwent
 
 #define TRUST_DEBUG
-#define S_FALSE 0
-#define S_TRUE  1
+#define SL_FALSE 0
+#define SL_TRUE  1
 #define SL_ENTER(string)
 #define SL_IRETURN(a, b)  return a
@@ -136,5 +127,4 @@
 #define SL_EINTERNAL -1028     /* Internal error.                      */
 #define SL_EBADFILE  -1030     /* File access error. Check errno.      */
-#define SL_EMEM      -1032     /* Out of memory.                       */
 #define SL_EBADNAME  -1040     /* Invalid name.                        */
 #define SL_ESTAT     -1041     /* stat of file failed. Check errno.    */
@@ -211,5 +201,5 @@
 #define SL_ALWAYS_TRUSTED  0
 #endif
-uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
+static uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
 
 #define tf_uid_neg ((uid_t)-1)
@@ -222,6 +212,6 @@
 
 uid_t tf_euid = tf_uid_neg;
-unsigned int EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);
-unsigned int ORIG_EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);
+int EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);
+int ORIG_EUIDSLOT = sizeof(test_rootonly)/sizeof(uid_t);
 
 char  tf_path[MAXFILENAME];		/* error path for trust function */
@@ -324,5 +314,5 @@
 
 /* not static to circumvent stupid gcc 4 bug */ 
-int getfname(const char *fname, char *rbuf, int rsz)
+int getfname(char *fname, char *rbuf, int rsz)
 {
 #ifndef TRUST_MAIN
@@ -367,8 +357,6 @@
 	SL_IRETURN(status, _("getfname"));
 #else
-      strncat(rbuf, "/",   rsz-strlen(rbuf)-1);
-      rbuf[rsz-1] = '\0';
-      strncat(rbuf, fname, rsz-strlen(rbuf)-1);
-      rbuf[rsz-1] = '\0';
+      strncat(rbuf, "/",   rsz-strlen(rbuf));
+      strncat(rbuf, fname, rsz-strlen(rbuf));
 #endif
     }
@@ -381,5 +369,5 @@
   SL_ENTER(_("isin"));
   if (list == NULL)
-    SL_IRETURN(S_FALSE, _("isin"));
+    SL_IRETURN(SL_FALSE, _("isin"));
 
   while(*list != tf_uid_neg && *list != n)
@@ -400,5 +388,5 @@
 	       (UID_CAST) n);
 #endif 
-      SL_IRETURN(S_FALSE, _("isin"));
+      SL_IRETURN(SL_FALSE, _("isin"));
     }
 
@@ -408,5 +396,5 @@
 	   (UID_CAST)n, (UID_CAST)*list);
 #endif 
-  SL_IRETURN(S_TRUE, _("isin"));
+  SL_IRETURN(SL_TRUE, _("isin"));
 }
 
@@ -415,65 +403,36 @@
  */
 /* not static to circumvent stupid gcc 4 bug */ 
-int isingrp(gid_t grp, uid_t *ulist, int * errval)
+int isingrp(gid_t grp, uid_t *ulist)
 {
-  struct passwd *w;	        /* info about group member */
+  register struct passwd *w;	/* info about group member */
   register uid_t *u;		/* points to current ulist member */
   register char **p;		/* points to current group member */
-  struct group *g;	        /* pointer to group information */
-
-  int status;
+  register struct group *g;	/* pointer to group information */
   
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  struct group    gr;
-  char          * buffer = NULL;
-  struct passwd   pwd;
-  char          * pbuffer = NULL;
-#endif
-
   SL_ENTER(_("isingrp"));
 
-  *errval = 0;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  buffer = calloc(1,SH_GRBUF_SIZE);
-  status = sh_getgrgid_r(grp, &gr, buffer, SH_GRBUF_SIZE, &g);
+  if ((g = sh_getgrgid(grp)) == NULL)
+    {
+      SL_IRETURN(SL_FALSE, _("isingrp") );
+    }
+  /*
+  if(g->gr_mem == NULL || g->gr_mem[0] == NULL )
+    SL_IRETURN(SL_FALSE, _("isingrp") );
+  */
+
+  /* this will return at the first match
+   */
+  for(p = g->gr_mem; *p != NULL; p++)
+    {
+      for(u = ulist; *u != tf_uid_neg; u++)
+	{
+	  /* map user name to UID and compare */
+#ifdef TRUST_MAIN
+	  if ((w = getpwnam(*p)) != NULL && *u == (uid_t)(w->pw_uid) )
+	    SL_IRETURN(SL_TRUE, _("isingrp"));
 #else
-  errno = 0;
-  g = sh_getgrgid(grp);
-  status = errno;
-#endif
-
-  if (g == NULL)
-    {
-      if (status == ERANGE)
-	*errval = status;
-
-      goto end_false;
-    }
-
-  /* this will return at the first match
-   */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  pbuffer = calloc(1,SH_PWBUF_SIZE);
-#endif
-
-  for(p = g->gr_mem; *p != NULL; p++)
-    {
-      for(u = ulist; *u != tf_uid_neg; u++)
-	{
-	  /* map user name to UID and compare */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-	  sh_getpwnam_r(*p, &pwd, pbuffer, SH_PWBUF_SIZE, &w);
-#else
-	  w = sh_getpwnam(*p);
-#endif
-
-#ifdef TRUST_MAIN
-	  if (w != NULL && *u == (uid_t)(w->pw_uid) )
-	    goto end_true;
-#else
-	  if (w != NULL && *u == (uid_t)(w->pw_uid) )
-	    {
-	      goto end_true;
+	  if ((w = sh_getpwnam(*p)) != NULL && *u == (uid_t)(w->pw_uid) )
+	    {
+	      SL_IRETURN(SL_TRUE, _("isingrp"));
 	    }
 #endif
@@ -485,33 +444,16 @@
   for(u = ulist; *u != tf_uid_neg; u++)
     {
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
-      sh_getpwuid_r(*u, &pwd, pbuffer, SH_PWBUF_SIZE, &w);
+#ifdef TRUST_MAIN
+      if ((w = getpwuid(*u)) != NULL && grp == (gid_t)(w->pw_gid) )
+	SL_IRETURN(SL_TRUE, _("isingrp"));
 #else
-      w = sh_getpwuid(*u);
-#endif
-#ifdef TRUST_MAIN
-      if (w != NULL && grp == (gid_t)(w->pw_gid) )
-	goto end_true;
-#else
-      if (w != NULL && grp == (gid_t)(w->pw_gid) )
-	{
-	  goto end_true;
-	}
-#endif
-    }
-
- end_false:
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  if (buffer)  free(buffer);
-  if (pbuffer) free(pbuffer);
-#endif
-  SL_IRETURN(S_FALSE, _("isingrp"));
-
- end_true:
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  if (buffer)  free(buffer);
-  if (pbuffer) free(pbuffer);
-#endif
-  SL_IRETURN(S_TRUE, _("isingrp"));
+      if ((w = sh_getpwuid(*u)) != NULL && grp == (gid_t)(w->pw_gid) )
+	{
+	  SL_IRETURN(SL_TRUE, _("isingrp"));
+	}
+#endif
+    }
+
+  SL_IRETURN(SL_FALSE, _("isingrp"));
 }
 
@@ -520,26 +462,13 @@
  */
 /* not static to circumvent stupid gcc 4 bug */ 
-int onlytrustedingrp(gid_t grp, uid_t *ulist, int * errval)
+int onlytrustedingrp(gid_t grp, uid_t *ulist)
 {
-  struct passwd *w;	        /* info about group member */
+  register struct passwd *w;	/* info about group member */
   register uid_t *u;		/* points to current ulist member */
   register char **p;		/* points to current group member */
-  struct group *g;	        /* pointer to group information */
+  register struct group *g;	/* pointer to group information */
   register int flag = -1;       /* group member found */
 
-  int status;
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  struct group    gr;
-  char          * buffer  = NULL;
-  struct passwd   pw;
-  char          * pbuffer = NULL;
-#endif
-
-  int retval = S_FALSE;
-
   SL_ENTER(_("onlytrustedingrp"));
-
-  *errval = 0;
 
 #ifdef TRUST_DEBUG
@@ -548,18 +477,6 @@
 #endif
 
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  buffer = calloc(1,SH_GRBUF_SIZE);
-  status = sh_getgrgid_r(grp, &gr, buffer, SH_GRBUF_SIZE, &g);
-#else
-  errno = 0;
-  g = sh_getgrgid(grp);
-  status = errno;
-#endif
-
-  if (g == NULL)
-    {
-      if (status == ERANGE)
-	*errval = status;
-
+  if ((g = sh_getgrgid(grp)) == NULL)
+    {
 #ifdef TRUST_DEBUG
       fprintf(stderr, 
@@ -567,6 +484,5 @@
 	      (UID_CAST)grp); 
 #endif
-      retval = S_FALSE;
-      goto end_retval;
+      SL_IRETURN(SL_FALSE, _("onlytrustedingrp") );
     }
 
@@ -574,13 +490,9 @@
    
   if(g->gr_mem == NULL || g->gr_mem[0] == NULL )
-    SL_IRETURN(S_TRUE, _("onlytrustedingrp") );
+    SL_IRETURN(SL_TRUE, _("onlytrustedingrp") );
   */
 
   /* check for untrusted members of the group
    */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-  pbuffer = calloc(1,SH_PWBUF_SIZE);
-#endif
-
   for(p = g->gr_mem; *p != NULL; p++)
     {
@@ -591,10 +503,9 @@
       /* map user name to UID and compare 
        */
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R)
-      sh_getpwnam_r(*p, &pw, pbuffer, SH_PWBUF_SIZE, &w);
-#else
       w = sh_getpwnam(*p);
-#endif
-
+#ifndef TRUST_MAIN
+      if (!w)
+	w = sh_getpwnam(*p);
+#endif
       if (w == NULL)    /* not a valid user, ignore    */
 	{
@@ -640,15 +551,7 @@
 #endif 
 	  tf_baduid = w->pw_uid;
-	  retval = S_FALSE;
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-	  if (pbuffer) free(pbuffer);
-#endif
-	  goto end_retval;
-	}
-    }
-
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  if (pbuffer) free(pbuffer);
-#endif
+	  SL_IRETURN(SL_FALSE, _("onlytrustedingrp"));
+	}
+    }
 
 #ifndef TEST_ONLY	
@@ -656,6 +559,4 @@
   /* now check ALL users for their GID !!!
    */
-  SH_MUTEX_LOCK(mutex_pwent);
-
   while (NULL != (w = sh_getpwent())) 
     {
@@ -676,5 +577,5 @@
 		  fprintf (stderr, 
 			   "trustfile: uid=%ld, trusted_uid=%ld, match found --> OK\n", 
-			   (UID_CAST)(w->pw_uid), (UID_CAST)(*u));
+			   (UID_CAST)(w->pw_uid), *u);
 #endif 
 		  flag = 0;
@@ -698,59 +599,39 @@
 #endif
 	      tf_baduid = w->pw_uid;
-	      retval = S_FALSE;
-	      goto out;
-	      /* SL_IRETURN(S_FALSE, _("onlytrustedingrp")); */
-	    }
-	}
-    }
-  retval = S_TRUE;
-
- out:
+	      SL_IRETURN(SL_FALSE, _("onlytrustedingrp"));
+	    }
+	}
+    }
 
 #ifdef HAVE_ENDPWENT
   sh_endpwent();
 #endif
-
-  SH_MUTEX_UNLOCK(mutex_pwent);
-
   /* TEST_ONLY */
 #endif
+
   /* #ifdef HAVE_GETPWENT */
 #endif
 
 #ifdef TRUST_DEBUG
-  if (retval == S_TRUE)
-    fprintf(stderr,
-	    "trustfile: group %ld:  all members are trusted users --> OK\n", 
-	    (UID_CAST)grp);
+  fprintf(stderr,
+	  "trustfile: group %ld:  all members are trusted users --> OK\n", 
+	  (UID_CAST)grp);
 #endif
   /* all found
    */
- end_retval:
-#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETGRGID_R)
-  if (buffer)  free(buffer);
-#endif
-  SL_IRETURN(retval, _("onlytrustedingrp"));
+  SL_IRETURN(SL_TRUE, _("onlytrustedingrp"));
 }
 
-int sl_trustfile(const char *fname, uid_t *okusers, uid_t *badusers)
+int sl_trustfile(char *fname, uid_t *okusers, uid_t *badusers)
 {
-  char * fexp = NULL;	        /* file name fully expanded        */
-  register char *p;             /* used to hold name to be checked */
+  char fexp[MAXFILENAME];	/* file name fully expanded        */
+  register char *p = fexp;      /* used to hold name to be checked */
   struct stat stbuf;	        /* used to check file permissions  */
   char c;			/* used to hold temp char          */
   
-  int errgrp = 0;
-
   SL_ENTER(_("sl_trustfile"));
   if (fname == NULL)
     SL_IRETURN(SL_EBADFILE, _("sl_trustfile"));
 
-  fexp = calloc(1, MAXFILENAME );
-  if (!fexp)
-    SL_IRETURN(SL_EMEM, _("sl_trustfile"));
-
-  p = fexp;
-
   /*
    * next expand to the full file name
@@ -760,14 +641,8 @@
   sl_errno = getfname(fname, fexp, MAXFILENAME);
   if (sl_errno != 0)
-    {
-      free(fexp);
-      return sl_errno;
-    }
+    return sl_errno;
 #else
   if (SL_ISERROR(getfname(fname, fexp, MAXFILENAME)))
-    {
-      free(fexp);
       SL_IRETURN(sl_errno, _("sl_trustfile"));
-    }
 #endif
 
@@ -812,13 +687,11 @@
       if (retry_lstat(FIL__, __LINE__, fexp, &stbuf) < 0)
 	{
-	  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-	  tf_path[sizeof(tf_path)-1] = '\0';
+	  (void) strcpy(tf_path, fexp);                  /* known to fit  */
 #ifdef TRUST_MAIN
 	  fprintf(stderr, "---------------------------------------------\n");
-	  fprintf(stderr, "trustfile: ESTAT: stat(%s) failed,\n", fexp);
-	  fprintf(stderr, "maybe the file does not exist\n");
+	      fprintf(stderr, "trustfile: ESTAT: stat(%s) failed, maybe the file does not exist\n",
+		      fexp);
 	  fprintf(stderr, "---------------------------------------------\n");
 #endif
-	  free(fexp);
 	  SL_IRETURN(SL_ESTAT, _("sl_trustfile"));
 	}
@@ -847,12 +720,9 @@
 	   * got it?
 	   */
-	  char * csym;	                /* contents of symlink file  */
-	  char * full;	                /* "full" name of symlink    */
-	  char *b;                      /* used to copy stuff around */
-	  const char *t;	        /* used to copy stuff around */
-	  int lsym;	                /* num chars in symlink ref  */
-	  int i;		        /* trustworthy or not?       */
-	  const char * t_const;
-	  char *end;
+	  char csym[MAXFILENAME];	/* contents of symlink file  */
+	  char full[MAXFILENAME];	/* "full" name of symlink    */
+	  register char *b, *t;	        /* used to copy stuff around */
+	  register int lsym;	        /* num chars in symlink ref  */
+	  register int i;		/* trustworthy or not?       */
 
 	  /*
@@ -864,11 +734,4 @@
 	   * R.W. Tue May 29 22:05:16 CEST 2001
 	   */
-	  csym = calloc(1, MAXFILENAME );
-	  if (!csym)
-	    {
-	      free(fexp);
-	      SL_IRETURN(SL_EMEM, _("sl_trustfile"));
-	    }
-
 	  lsym = readlink(fexp, csym, MAXFILENAME-1);
 	  if (lsym >= 0) 
@@ -882,15 +745,5 @@
 	      fprintf(stderr, "---------------------------------------------\n");
 #endif
-	      free(csym);
-	      free(fexp);
 	      SL_IRETURN(SL_EBADNAME, _("sl_trustfile"));
-	    }
-
-	  full = calloc(1, MAXFILENAME );
-	  if (!full)
-	    {
-	      free(csym);
-	      free(fexp);
-	      SL_IRETURN(SL_EMEM, _("sl_trustfile"));
 	    }
 
@@ -900,8 +753,4 @@
 	  if (csym[0] != '/')
 	    {
-	      /* pointer to one above last element
-	       */
-	      end = &full[MAXFILENAME-1]; ++end;
-
 	      /* initialize pointers 
 	       */
@@ -911,11 +760,11 @@
 	       */
 	      t = fexp;
-	      while(*t && b < end)
+	      while(*t && b < &full[MAXFILENAME])
 		*b++ = *t++;
 
 	      /* smack on the /../ 
 	       */
-	      t_const = "/../"; t = (const char *)t_const;
-	      while(*t && b < end)
+	      t = "/../";
+	      while(*t && b < &full[MAXFILENAME])
 		*b++ = *t++;
 
@@ -923,15 +772,14 @@
 	       */
 	      t = csym;
-	      while(*t && b < end)
+	      while(*t && b < &full[MAXFILENAME])
 		*b++ = *t++;
 
 	      /* see if we're too big 
 	       */
-	      if (*t || b == end)
+	      if (*t || b == &full[MAXFILENAME])
 		{
 		  /* yes -- error 
 		   */
-		  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-		  tf_path[sizeof(tf_path)-1] = '\0';
+		  (void) strcpy(tf_path, fexp);          /* known to fit  */
 #ifdef TRUST_MAIN
 		  fprintf(stderr, "---------------------------------------------\n");
@@ -941,7 +789,4 @@
 		  fprintf(stderr, "---------------------------------------------\n");
 #endif
-		  free(full);
-		  free(csym);
-		  free(fexp);
 		  SL_IRETURN(SL_ETRUNC, _("sl_trustfile"));
 		}
@@ -959,10 +804,5 @@
 	   */
 	  if ((i = sl_trustfile(full, okusers, badusers)) != SL_ENONE)
-	    {
-	      free(full);
-	      free(csym);
-	      free(fexp);
-	      SL_IRETURN(i, _("sl_trustfile"));
-	    }
+	    SL_IRETURN(i, _("sl_trustfile"));
 
 	  /*
@@ -983,6 +823,4 @@
 		p++;
 	    }
-	  free(full);
-	  free(csym);
 	  continue;
 	}
@@ -998,6 +836,6 @@
        * file regardless of permissions, so bomb
        */
-      if (((okusers != NULL && S_FALSE == isin((uid_t)stbuf.st_uid,okusers))||
-	   (badusers != NULL && S_TRUE == isin((uid_t)stbuf.st_uid,badusers))))
+      if (((okusers != NULL && SL_FALSE == isin((uid_t)stbuf.st_uid,okusers))||
+	   (badusers != NULL && SL_TRUE == isin((uid_t)stbuf.st_uid,badusers))))
 	{
 #ifdef TRUST_DEBUG
@@ -1012,9 +850,6 @@
 	  fprintf(stderr, "---------------------------------------------\n");
 #endif 
-	  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-	  tf_path[sizeof(tf_path)-1] = '\0';
-
+	  (void) strcpy(tf_path, fexp);                  /* known to fit  */
 	  tf_baduid = (uid_t) stbuf.st_uid;
-	  free(fexp);
 	  SL_IRETURN(SL_EBADUID, _("sl_trustfile"));
 	}
@@ -1032,6 +867,6 @@
        */
       if (((stbuf.st_mode & S_IWGRP) == S_IWGRP) &&
-	  ((okusers != NULL && !onlytrustedingrp((gid_t)stbuf.st_gid,okusers,&errgrp))||
-	   (badusers != NULL && isingrp((gid_t)stbuf.st_gid, badusers,&errgrp)))
+	  ((okusers != NULL && !onlytrustedingrp((gid_t)stbuf.st_gid,okusers))||
+	   (badusers != NULL && isingrp((gid_t)stbuf.st_gid, badusers)))
 #ifdef STICKY
 	  && ((stbuf.st_mode&S_IFDIR) != S_IFDIR ||
@@ -1052,10 +887,7 @@
 	  fprintf(stderr, "---------------------------------------------\n");
 #endif 
-	  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-	  tf_path[sizeof(tf_path)-1] = '\0';
-
+	  (void) strcpy(tf_path, fexp);                  /* known to fit  */
 	  tf_badgid = (gid_t) stbuf.st_gid;
-	  free(fexp);
-	  SL_IRETURN((errgrp == ERANGE) ? SL_ERANGE : SL_EBADGID, _("sl_trustfile"));
+	  SL_IRETURN(SL_EBADGID, _("sl_trustfile"));
 	}
       /*
@@ -1077,8 +909,5 @@
 	  fprintf(stderr, "---------------------------------------------\n");
 #endif 
-	  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-	  tf_path[sizeof(tf_path)-1] = '\0';
-
-	  free(fexp);
+	  (void) strcpy(tf_path, fexp);                  /* known to fit  */
 	  SL_IRETURN(SL_EBADOTH, _("sl_trustfile"));
 	}
@@ -1103,19 +932,9 @@
    * yes, it can be trusted
    */
-  (void) strncpy(tf_path, fexp, sizeof(tf_path));
-  tf_path[sizeof(tf_path)-1] = '\0';
-
-  free(fexp);
+  (void) strcpy(tf_path, fexp);                      /* known to fit  */
   SL_IRETURN(SL_ENONE, _("sl_trustfile"));
 }
 
 #ifdef TRUST_MAIN
-
-#if defined(HOST_IS_CYGWIN) || defined(__cygwin__) || defined(__CYGWIN32__) || defined(__CYGWIN__)
-int main()
-{
-  return 0;
-}
-#else
 int main (int argc, char * argv[])
 {
@@ -1132,5 +951,5 @@
   tf_path[0] = '\0';
 #if defined(SH_WITH_SERVER)
-  pass = sh_getpwnam(SH_IDENT);  /* TESTONLY */
+  pass = getpwnam(SH_IDENT);
   if (pass != NULL)
     tf_euid = pass->pw_uid;
@@ -1155,6 +974,5 @@
 }
 #endif
-#endif
-
-
-
+
+
+
Index: trunk/src/yulectl.c
===================================================================
--- trunk/src/yulectl.c	(revision 591)
+++ trunk/src/yulectl.c	(revision 1)
@@ -24,5 +24,4 @@
 #include <stdlib.h>
 #include <string.h> 
-#include <ctype.h>
 #include <errno.h>
 
@@ -42,14 +41,9 @@
 #define SH_MAXMSG 209
 
-#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && \
-  !defined(HAVE_STRUCT_CMSGCRED) && !defined(HAVE_STRUCT_FCRED) && \
-  !(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
-#define SH_REQ_PASSWORD 1
-#endif
-
-#define SH_PW_SIZE 15
-
 static int    sock     = -1;
-static char   password[SH_PW_SIZE] = "";
+static char * sockname = NULL;
+
+static char   password[15] = "";
+
 static int    verbose = 0;
 
@@ -92,8 +86,15 @@
 
 
-static int 
-create_unix_socket ()
+int 
+make_named_socket (char * sockname)
 {
   int sock;
+
+#if 0
+  struct sockaddr_un name;
+  size_t size;
+#else
+  (void) sockname;
+#endif
 
   /* Create the socket. */
@@ -106,8 +107,27 @@
     }
 
+#if 0
+  /* Bind a name to the socket. */
+  name.sun_family = AF_FILE;
+  strcpy (name.sun_path, sockname);
+
+  /* The size of the address is
+     the offset of the start of the filename,
+     plus its length,
+     plus one for the terminating null byte. */
+  size = (offsetof (struct sockaddr_un, sun_path)
+          + strlen (name.sun_path) + 1);
+
+  if (bind (sock, (struct sockaddr *) &name, size) < 0)
+    {
+      perror (_("ERROR: bind"));
+      return -1;
+    }
+#endif
+
   return sock;
 }
 
-static void
+void
 termination_handler (int signum)
 {
@@ -118,23 +138,17 @@
 	fprintf(stdout, _("# Terminated on signal %d\n"), signum);
     }
-  if (sock   >= 0 ) 
-    close  (sock);
+#if 0
+  if (sockname != NULL) unlink (sockname);
+#endif
+  if (sock   >= 0 ) close  (sock);
+
   return;
 }
 
-static char * safe_copy(char * to, const char * from, size_t size)
-{
-  if (to && from && (size > 0))
-    {
-      strncpy (to, from, size-1);
-      to[size-1] = '\0';
-    }
-  return to;
-}
- 
-
-static int send_to_server (char * serversock, char * message)
+
+int send_to_server (char * serversock, char * message)
 {
   struct sockaddr_un name;
+  /* size_t size; */
   int size;
   int nbytes;
@@ -143,11 +157,5 @@
    */
   name.sun_family = AF_UNIX;
-  memcpy(name.sun_path, serversock, sizeof(name.sun_path));
-  name.sun_path[sizeof(name.sun_path)-1] = '\0';
-  if (strlen(serversock) > strlen(name.sun_path))
-    {
-      perror (_("ERROR: socket path too long"));
-      return -1;
-    }
+  strncpy (name.sun_path, serversock, sizeof(name.sun_path) - 1);
   size = (offsetof (struct sockaddr_un, sun_path)
           + strlen (name.sun_path) + 1);
@@ -160,7 +168,10 @@
     }
 
-  /* Send the data. 
+  /* Send the datagram. 
+  nbytes = sendto (sock, message, strlen (message) + 1, 0,
+                   (struct sockaddr *) & name, size);
    */
   nbytes = send (sock, message, strlen (message) + 1, 0);
+
   if (nbytes < 0)
     {
@@ -194,5 +205,5 @@
 }
 
-static int recv_from_server (char * message)
+int recv_from_server (char * message)
 {
   int nbytes = 0;
@@ -200,20 +211,48 @@
   int  num = 0;
   int  good = -1;
+  int  islist = 0;
   char * p;
 
   if (password[0] == '\0')
-    p = message;
-  else
-    p = &message[strlen(password)+1];
-
-  if (0 == strncmp(p, _("PROBE"), 5) ||
-      0 == strncmp(p, _("LIST"),  4))
+    {
+      if (message[0] == 'L' && message[1] == 'I' &&
+	  message[2] == 'S' && message[3] == 'T')
+	{
+	  islist = 1;
+	}
+      if (message[0] == 'P' && message[1] == 'R' &&
+	  message[2] == 'O' && message[3] == 'B' && message[4] == 'E' )
+	{
+	  islist = 1;
+	}
+    }
+  else
+    {
+      p = &message[strlen(password)+1];
+      if (p[0] == 'L' && p[1] == 'I' &&
+	  p[2] == 'S' && p[3] == 'T')
+	{
+	  islist = 1;
+	}
+      if (p[0] == 'P' && p[1] == 'R' &&
+	  p[2] == 'O' && p[3] == 'B' && p[4] == 'E' )
+	{
+	  islist = 1;
+	}
+    }
+
+  if (islist == 1)
     {
       do {
+	/*
+	nbytes = recvfrom (sock, recvmsg, SH_MAXMSG, 0, NULL, 0);
+	*/
 	nbytes = getline_from_server (sock, recvmsg, SH_MAXMSG);
 	if (nbytes < 0)
 	  {
 	    if (errno == EAGAIN)
-	      return 0;
+	      {
+		return 0;
+	      }
 	    else
 	      {
@@ -223,10 +262,11 @@
 	  }
 	else if (nbytes == 0)
-	  return 0;
-
+	  {
+	    return 0;
+	  }
 	if (recvmsg[0] == 'E' && recvmsg[1] == 'N' && recvmsg[2] == 'D')
 	  {
 	    if (verbose && (num == 0))
-	      fprintf (stdout, "%s", _("# There are no pending commands.\n"));
+	      fprintf (stdout, _("# There are no pending commands.\n"));
 	    return 0;
 	  }
@@ -237,4 +277,7 @@
   else
     {
+      /*
+      nbytes = recvfrom (sock, recvmsg, SH_MAXMSG, 0, NULL, 0);
+      */
       nbytes = recv (sock, recvmsg, SH_MAXMSG, 0);
       if (nbytes < 0)
@@ -247,19 +290,15 @@
   /* Print a diagnostic message. */
   if (password[0] == '\0')
-    good = strcmp (message, recvmsg);
-  else
-    good = strcmp (&message[strlen(password)+1], recvmsg);
+    {
+      good = strcmp (message, recvmsg);
+    }
+  else
+    {
+      good = strcmp (&message[strlen(password)+1], recvmsg);
+    }
 
   if (0 != good)
     {
-      if (0 == strncmp(recvmsg, _("!E:"), 3))
-	{ 
-	  fputs(recvmsg, stderr); 
-	  fputc('\n', stderr); 
-	}
-      else
-	{
-	  fputs (_("ERROR: Bounced message != original message.\n"), stderr);
-	}
+      fprintf (stderr, _("ERROR: Bounced message != original message.\n"));
       return -1;
     }
@@ -267,5 +306,5 @@
     {
       if (verbose)
-	fprintf (stdout, "%s", _("# Message received by server.\n"));
+	fprintf (stdout, _("# Message received by server.\n"));
     }
 
@@ -273,105 +312,31 @@
 }
 
-static int check_uuid(const char * in)
-{
-  int 		i;
-  const char	*cp;
-
-  if (!in || strlen(in) != 36)
-    return -1;
-  for (i=0, cp = in; i <= 36; i++,cp++) {
-    if ((i == 8) || (i == 13) || (i == 18) ||
-	(i == 23)) {
-      if (*cp == '-')
-	continue;
-      else
-	return -1;
-    }
-    if (i== 36)
-      if (*cp == 0)
-	continue;
-    if (!isxdigit(*cp))
-      return -1;
-  }
-  return 0;
-}
-
-static int check_command(const char * str)
-{
-  unsigned int i = 0;
-  char * commands[] = { N_("DELTA:"), N_("RELOAD"),  N_("STOP"), N_("SCAN"),
-			N_("CANCEL"), N_("LISTALL"), N_("LIST"), N_("PROBE"), NULL };
-
-  while (commands[i])
-    {
-      size_t len = strlen(_(commands[i]));
-
-      if (0 == strncmp(_(commands[i]), str, len))
-	{
-	  if (i == 0)
-	    {
-	      char * p = strchr(str, ':'); ++p;
-	      if ( 0 == check_uuid(p) )
-		return 0;
-	    }
-	  else
-	    {
-	      if (len == strlen(str))
-		return 0;
-	    }
-	}
-      ++i;
-    }
-
-  fprintf (stderr, _("ERROR: invalid command <%s>\n\n"), str);
-  return -1;
-}
-
-static void print_usage_and_exit(char * name, int exit_status)
+void usage(char * name)
 {
   printf(_("\nUsage : %s [-v][-s server_socket] -c command <client_hostname>\n\n"), 
 	 name);
 
-  printf("%s", _("Purpose : send commands to the server via a socket,\n"));
-  printf("%s", _("          in particular commands that the server would\n"));
-  printf("%s", _("          transfer to the client <client_hostname> when\n"));
-  printf("%s", _("          this client connects to deliver a message.\n\n"));
-  printf("%s", _("          If password is required, it is read from\n"));
-  printf("%s", _("          $HOME/.yulectl_cred or taken from the environment\n"));
-  printf("%s", _("          variable YULECTL_PASSWORD (not recommended).\n\n"));
-
-  printf("%s", _("Commands: RELOAD         reload configuration\n"));
-  printf("%s", _("          DELTA:<uuid>   load delta database with given uuid\n"));
-  printf("%s", _("          STOP           terminate\n"));
-  printf("%s", _("          SCAN           initiate file system check\n"));
-  printf("%s", _("          CANCEL         cancel pending command(s)\n"));
-  printf("%s", _("          LIST           list queued commands\n"));
-  printf("%s", _("          LISTALL        list queued and last sent commands\n"));
-  printf("%s", _("          PROBE          probe all clients for necessity of reload\n"));
-  exit(exit_status);
-}
-
-char * rtrim(char * str)
-{
-  size_t len;
-
-  if (!str) return str;
-
-  len = strlen(str);
-  while (len > 0)
-    {
-      --len;
-      if (str[len] == '\n' || str[len] == '\r')
-	str[len] = '\0';
-      else
-	break;
-    }
-  return str;
-}
-
-static int get_home(char * home, size_t size)
-{
+  printf(_("Purpose : send commands to the server via a socket,\n"));
+  printf(_("          in particular commands that the server would\n"));
+  printf(_("          transfer to the client <client_hostname> when\n"));
+  printf(_("          this client connects to deliver a message.\n\n"));
+
+  printf(_("Commands: RELOAD    <reload configuration>\n"));
+  printf(_("          STOP      <terminate>\n"));
+  printf(_("          CANCEL    <cancel previous command>\n"));
+  printf(_("          LIST      <list queued commands>\n"));
+  printf(_("          LISTALL   <list queued and last sent commands>\n"));
+  printf(_("          PROBE     <probe all clients for necessity of reload>\n"));
+  return;
+}
+
+void fixup_message (char * message)
+{
+  char message2[SH_MAXMSG];
+  char home[4096];
+  FILE * fp;
   struct passwd * pwent;
 
+  
   pwent = getpwuid(geteuid());
   if ((pwent == 0) || (pwent->pw_dir == NULL))
@@ -382,165 +347,99 @@
       if (NULL != getenv(_("HOME")))
 	{
-	  safe_copy(home, getenv(_("HOME")), size);
+	  strncpy(home, getenv(_("HOME")), 4096);
+	  home[4095] = '\0';
 	}
       else
 	{
 	  fprintf (stderr, _("ERROR: no home directory for euid %ld (tried $HOME and password database).\n"), (long) geteuid());
-	  return -1;
-	}
-    }
-  else
-    {
-      safe_copy(home, pwent->pw_dir, size);
-    }
-  return 0;
-}
-
-static int get_passwd(char * message2, size_t size)
-{
-  char home[4096];
-  FILE * fp;
-  char * pw;
-
-  /* 1) Password from environment
-   */
-  pw = getenv(_("YULECTL_PASSWORD"));
-  if (pw && strlen(pw) < SH_PW_SIZE)
-    {
-      strcpy(password, pw);
-      strcpy(message2, password);
-      return 0;
-    }
-
-  /* 2) Password from $HOME/.yule_cred
-   */
-  if (get_home(home, sizeof(home)) < 0)
-    return -1;
-
-  if ( (strlen(home) + strlen(_("/.yulectl_cred")) + 1) > sizeof(home))
-    {
-      fprintf (stderr, "%s", _("ERROR: path for $HOME is too long.\n"));
-      return -1;
+	  exit(EXIT_FAILURE);
+	}
+    }
+  else
+    {
+      strncpy(home, pwent->pw_dir, 4096);
+      home[4095] = '\0';
+    }
+
+  if ( (strlen(home) + strlen(_("/.yulectl_cred")) + 1) > 4096)
+    {
+      fprintf (stderr, _("ERROR: path for $HOME is too long.\n"));
+      exit(EXIT_FAILURE);
     }
   strcat(home, _("/.yulectl_cred"));
   fp = fopen(home, "r");
-
-#if defined(SH_REQ_PASSWORD)
   if (fp == NULL)
     {
-      if (errno == ENOENT) {
-	fprintf (stderr, 
-		 _("ERROR No password file (%s) exists\n"),
+      if (verbose && (errno == ENOENT))
+	fprintf (stdout, 
+		 _("# Password file (%s) missing\n"),
 		 home);
-      }
-      else {
-	fprintf (stderr, 
-		 _("ERROR: Password file (%s) not accessible for euid %ld uid %ld\n"),
+      else if (verbose)
+	fprintf (stdout, 
+		 _("# Password file (%s) not accessible for euid %ld uid %ld\n"),
 		 home, (long)geteuid(), (long)getuid());
-      }
-      return -1;
-    }
-#else
-  if (fp == NULL)
-    return 0;
-#endif
-
-  if (NULL == fgets(message2, size, fp))
-    {
-      fprintf (stderr,
+      return;
+    }
+  if (NULL == fgets(message2, SH_MAXMSG, fp))
+    {
+      fprintf (stderr, 
 	       _("ERROR: empty or unreadable password file (%s).\n"),
 	       home);
-      return -1;
-    }
-
-  (void) rtrim(message2);
-
-  if (strlen(message2) > (SH_PW_SIZE -1))
-    {
-      fprintf (stderr, "%s", 
+      exit(EXIT_FAILURE);
+    }
+  if (strlen(message2) > 15)
+    {
+      fprintf (stderr, 
 	       _("ERROR: Password too long (max. 14 characters).\n"));
-      return -1;
+      exit(EXIT_FAILURE);
+    }
+
+  if ( (0 != strlen(message2)) && ('\n' == message2[strlen(message2)-1]))
+    {
+      message2[strlen(message2)-1] = '\0';
     }
   strcpy(password, message2);
+  strcat(message2, "@");
   fclose(fp);
 
-  return 0;
-}
-
-static int fixup_message (char * message)
-{
-  char message_fixed[SH_MAXMSG] = { 0 };
-
-  if (get_passwd(message_fixed, sizeof(message_fixed)) < 0)
-    return -1;
-
-  if (strlen(message_fixed) > 0)
-    {
-      strcat(message_fixed, "@");
-
-      strncat(message_fixed, message, SH_MAXMSG - strlen(message_fixed) -1);
-      message_fixed[SH_MAXMSG-1] = '\0';
-      strcpy(message, message_fixed);
-    }
-  return 0;
-}
-
-static int fill_serversock(char * serversock, size_t size)
-{
-  int status;
-
+  strncat(message2, message, SH_MAXMSG - strlen(message2) -1);
+  message2[SH_MAXMSG-1] = '\0';
+  strcpy(message, message2);
+  return;
+}
+
+
+int
+main (int argc, char * argv[])
+{
+
+  char   message[SH_MAXMSG] = "";
+  char   clientcd[1024];
+  char   serversock[256];
+  int    status, size;
+  int    num = 1;
+  int    flag = 0;
+  
 #ifdef HAVE_VSNPRINTF
-  status = snprintf(serversock, size, _("%s/%s.sock"), 
+  status = snprintf(serversock, 256, _("%s/%s.sock"), 
 		    DEFAULT_PIDDIR, SH_INSTALL_NAME);
 #else
-  if ((strlen(DEFAULT_PIDDIR) + strlen(SH_INSTALL_NAME) + 1 + 6) > size)
-    status = -1;
-  else
-    status = sprintf (serversock, _("%s/%s.sock"), 
-		      DEFAULT_PIDDIR, SH_INSTALL_NAME);
-#endif
-
-  if ((status < 0) || (status > (int)(size-1)))
-    {
-      fprintf(stderr, _("ERROR: Path too long (maximum %d): %s/%s.sock\n"), 
-	      (int) (size-1), DEFAULT_PIDDIR, SH_INSTALL_NAME);
-      return -1;
-    }
-  return 0;
-}
-
-static void checklen(char * command, char * str, size_t maxlen)
-{
-  if (strlen(str) > maxlen) 
-    {
-      fprintf(stderr, _("ERROR: String too long (max %d): %s\n\n"), 
-	      (int) maxlen, str);
-      print_usage_and_exit (command, EXIT_FAILURE);
-    }
-  return;
-}
-
-static void checknull(char * command, char * str)
-{
-  if (str == NULL || str[0] == '\0') {
-    fprintf(stderr, "%s", _("ERROR: option with missing argument\n\n"));
-    print_usage_and_exit(command, EXIT_FAILURE);
-  }
-  return;
-}
-
-int
-main (int argc, char * argv[])
-{
-
-  char   message[SH_MAXMSG] = "";
-  char   serversock[256];
-  int    status;
-  int    num = 1;
-  int    flag = 0;
-
-  if (fill_serversock(serversock, sizeof(serversock)) < 0)
-    return (EXIT_FAILURE);
-
+  if ((strlen(DEFAULT_PIDDIR) + strlen(SH_INSTALL_NAME) + 1 + 6) > 256)
+    {
+      status = -1;
+    }
+  else
+    {
+      status = sprintf (serversock, _("%s/%s.sock"), 
+			DEFAULT_PIDDIR, SH_INSTALL_NAME);
+    }
+#endif
+
+  if ((status < 0) || (status > 255))
+    {
+      fprintf(stderr, _("ERROR: Path too long (maximum 255): %s/%s.sock\n"), 
+	      DEFAULT_PIDDIR, SH_INSTALL_NAME);
+      return (EXIT_FAILURE);
+    }
 
   while (argc > 1 && argv[num][0] == '-')
@@ -549,30 +448,53 @@
 	{
 	  case 'h':
-	    print_usage_and_exit(argv[0], EXIT_SUCCESS);
-	    break;
+	    usage(argv[0]);
+	    return (EXIT_SUCCESS);
+
 	  case 'v':
 	    ++verbose;
 	    break;
+
 	  case 's':
 	    --argc; ++num;
-	    checknull(argv[0], argv[num]);
-	    checklen(argv[0], argv[num], sizeof(serversock)-1);
-	    safe_copy (serversock, argv[num], sizeof(serversock));
+	    if (argv[num] == NULL || argv[num][0] == '\0') {
+	      usage(argv[0]);
+	      fprintf(stderr, _("ERROR: -s: argument missing\n"));
+	      return (EXIT_FAILURE);
+	    } else {
+	      if (strlen(argv[num]) > 255) 
+		{
+		  fprintf(stderr, _("ERROR: Path too long: %s\n"), argv[num]);
+		  return (EXIT_FAILURE);
+		}
+	      strncpy (serversock, argv[num], 256);
+	      serversock[255] = '\0';
+	    }
 	    break;
+
 	  case 'c':
 	    --argc; ++num;
-	    checknull(argv[0], argv[num]);
-	    checklen(argv[0], argv[num], SH_MAXMSG-1);
-	    if (0 != check_command(argv[num]))
-	      print_usage_and_exit(argv[0], EXIT_FAILURE);
-	    safe_copy(message, argv[num], SH_MAXMSG);
-	    strncat(message, ":", SH_MAXMSG-strlen(message)-1);
-	    message[SH_MAXMSG-1] = '\0';
-	    flag = 1;
+	    if (argv[num] == NULL || argv[num][0] == '\0') {
+	      usage(argv[0]);
+	      fprintf(stderr, _("ERROR: -c: argument missing\n"));
+	      return (EXIT_FAILURE);
+	    } else {
+	      if (strlen(argv[num]) >= SH_MAXMSG) 
+		{
+		  fprintf(stderr, _("ERROR: Command too long: %s\n"), 
+			  argv[num]);
+		  return (EXIT_FAILURE);
+		}
+	      strncpy (message, argv[num], SH_MAXMSG);
+	      message[SH_MAXMSG-1] = '\0';
+	      strncat(message, ":", SH_MAXMSG-strlen(message)-1);
+	      message[SH_MAXMSG-1] = '\0';
+	      flag = 1;
+	    }
 	    break;
+
 	  default:
-	    fprintf(stderr, _("ERROR: unknown option -%c\n\n"), argv[num][1]);
-	    print_usage_and_exit(argv[0], EXIT_FAILURE);
-	    break;
+	    usage(argv[0]);
+	    fprintf(stderr, _("ERROR: unknown option -%c\n"), argv[num][1]);
+	    return (EXIT_FAILURE);
 	}
       --argc; ++num;
@@ -580,35 +502,67 @@
 
   if (flag == 0) /* no command given */
-    print_usage_and_exit(argv[0], EXIT_FAILURE);
+    {
+      usage(argv[0]);
+      return (EXIT_FAILURE);
+    }
 
   if (argc > 1)
     {
-      checklen(argv[0], argv[num], SH_MAXMSG - strlen(message) - 1);
-      strncat (message, argv[num], SH_MAXMSG - strlen(message) - 1);
+      if (strlen(argv[num]) > (SH_MAXMSG - strlen(message) -1)) 
+	{
+	  fprintf(stderr, _("ERROR: Hostname too long: %s\n"), argv[num]);
+	  return (EXIT_FAILURE);
+	}
+      strncat (message, argv[num], SH_MAXMSG -strlen(message) - 1);
       message[SH_MAXMSG-1] = '\0';
     }
   else
     {
-      if (0 == strncmp(message, _("PROBE"), 5) ||
-	  0 == strncmp(message, _("LIST"),  4))
+      if (message[0] == 'P' && message[1] == 'R' &&
+	  message[2] == 'O' && message[3] == 'B' && message[4] == 'E' )
 	{
 	  strncat (message, _("dummy"), SH_MAXMSG -strlen(message) - 1);
 	  message[SH_MAXMSG-1] = '\0';
 	}
+      else if (message[0] == 'L' && message[1] == 'I' &&
+	       message[2] == 'S' && message[3] == 'T')
+	{
+	  strncat (message, _("dummy"), SH_MAXMSG -strlen(message) - 1);
+	  message[SH_MAXMSG-1] = '\0';
+	}
       else
 	{
-	  fprintf(stderr, "%s", _("ERROR: this command requires a hostname\n"));
-	  print_usage_and_exit(argv[0], EXIT_FAILURE);
-	}
-    }
-
-  if (fixup_message(message) < 0)
-    return (EXIT_FAILURE);
+	  fprintf(stderr, "ERROR: this command requires a hostname\n");
+	  usage(argv[0]);
+	  return (EXIT_FAILURE);
+	}
+    }
+
+  fixup_message(message);
+
+  /* OpenBSD wants >= 1024
+   */
+  if (NULL == getcwd(clientcd, 1024))
+    {
+      perror(_("ERROR: getcwd"));
+      return (EXIT_FAILURE);
+    }
+  size = strlen(clientcd) + 1 + strlen(CLIENT) + 6;
+  sockname = malloc (size);
+  if (!sockname)
+    {
+      perror(_("ERROR: main: malloc"));
+      return (EXIT_FAILURE);
+    }
+  sprintf(sockname, _("%s/%s.sock"), clientcd, CLIENT);
+
 
   /* Make the socket.
    */
-  sock = create_unix_socket ();
+  sock = make_named_socket (sockname);
   if (sock < 0)
-    return (EXIT_FAILURE);
+    {
+      return (EXIT_FAILURE);
+    }
 
   /* Set up termination handler.
@@ -624,5 +578,5 @@
   if (status < 0)
     {
-      fprintf(stderr, "%s", _("ERROR: sending command to server failed\n"));
+      fprintf(stderr, _("ERROR: sending command to server failed\n"));
       (void) termination_handler(0);
       return (EXIT_FAILURE);
@@ -631,17 +585,20 @@
   /* Wait for a reply. 
    */
-  if (verbose)
-    {
-      if (0 == strncmp(message, "LIST", 4))
-	fprintf(stdout, "%s", _("# Waiting for listing.\n"));
-      else
-	fprintf(stdout, "%s", _("# Waiting for confirmation.\n"));
-    }
-
+  if (message[0] == 'L' && message[1] == 'I' &&
+      message[2] == 'S' && message[3] == 'T')
+    {
+      if (verbose)
+	fprintf(stdout, _("# Waiting for listing.\n"));
+    }
+  else
+    {
+      if (verbose)
+	fprintf(stdout, _("# Waiting for confirmation.\n"));
+    }
   status = recv_from_server (message);
 
   if (status < 0)
     {
-      fputs(_("ERROR: unexpected or no reply from server.\n"), stderr);
+      fprintf(stderr, _("ERROR: receiving data from server failed.\n"));
       (void) termination_handler(0);
       return (EXIT_FAILURE);
Index: trunk/src/zAVLTree.c
===================================================================
--- trunk/src/zAVLTree.c	(revision 591)
+++ trunk/src/zAVLTree.c	(revision 1)
@@ -32,88 +32,4 @@
 #include <string.h>
 #include "zAVLTree.h"
-
-/* Interface for handling "string only" items rw 2014-06-26
- */
-static zAVLKey zstring_key (void const * arg)
-{
-  return (zAVLKey) arg;
-}
-
-char * dummy_zfree_string;
-#ifdef __clang__
-char * dummy_zfree_str;
-#endif
-
-static void zfree_string (void * inptr)
-{
-#ifdef __clang__
-  dummy_zfree_str = (char *) inptr;
-#else
-  char * str = (char *) inptr;
-#endif
-
-  /* Take the address to circumvent gcc 4.9 optimizer bug */
-  dummy_zfree_string = (char *) &inptr;
-
-#ifdef __clang__
-  dummy_zfree_str[0] = '\0';
-  free (dummy_zfree_str);
-#else
-  str[0] = '\0';
-  free (inptr);
-#endif
-  return;
-}
-void zAVL_string_reset (zAVLTree * tree)
-{
-  if (tree)
-    zAVLFreeTree (tree, zfree_string);
-  return;
-}
-int zAVL_string_set (zAVLTree ** tree, const char * key)
-{
-  if (tree && key)
-    {
-      zAVLTree * itree = (*tree);
-      if (!itree)
-	{
-	  itree = zAVLAllocTree (zstring_key, zAVL_KEY_STRING);
-	  if (!itree) 
-	    {
-	      return -1;
-	    }
-	}
-      *tree = itree;
-      return zAVLInsert (itree, strdup(key));
-    }
-  return -1;
-}
-char * zAVL_string_get (zAVLTree * tree, const char * key)
-{
-  /* zAVLSearch() checks for NULL tree 
-   */
-  if (key)
-    {
-      return ((char *) zAVLSearch (tree, key));
-    }
-  return NULL;
-}
-void zAVL_string_del (zAVLTree * tree, const char * key)
-{
-  /* zAVLSearch() checks for NULL tree 
-   */
-  if (key)
-    {
-      char * item = ((char *) zAVLSearch (tree, key));
-      if (item)
-	{
-	  zAVLDelete(tree, key);
-	  zfree_string(item);
-	}
-    }
-  return;
-}
-
-
 
 /* Wed Nov 23 17:57:42 CET 2005 rw: introduce third argument in
@@ -137,24 +53,4 @@
 #define ZAVL_NO 0
 
-/* The comparison function. Was a macro, but this allows for more
- * flexibility (non-string keys). The key is a (void *) now, and
- * the type is stored in the zAVLTree struct. Oct 21, 2011, rw
- */
-static int zAVLKey_cmp(const zAVLTree * tree, zAVLKey a, zAVLKey b)
-{
-  if (tree->keytype == zAVL_KEY_STRING)
-    {
-      return (strcmp((const char*)a, (const char *)b));
-    }
-  else /* zAVL_KEY_INT */
-    {
-      const int x = *((const int *)a);
-      const int y = *((const int *)b);
-
-      if      (x > y) return  1;
-      else if (x < y) return -1;
-      else return 0;
-    }
-}
 
 /*
@@ -166,9 +62,9 @@
  * was a malloc failure, then NULL is returned.
  */
-zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item), int keytype)
+zAVLTree *zAVLAllocTree (zAVLKey (*getkey)(void const *item))
 {
   zAVLTree *rc;
 
-  rc = calloc(1, sizeof(zAVLTree));
+  rc = malloc(sizeof(zAVLTree));
   if (rc == NULL)
     return NULL;
@@ -177,5 +73,4 @@
   rc->count = 0;
   rc->getkey = getkey;
-  rc->keytype = keytype;
   return rc;
 }
@@ -214,5 +109,5 @@
   int       ok;
 
-  newnode = calloc(1, sizeof(zAVLNode));
+  newnode = malloc(sizeof(zAVLNode));
   if (newnode == NULL)
     return -1;
@@ -228,5 +123,5 @@
     node = zAVLCloseSearchNode(avltree, newnode->key, &ok);
 
-    if (ok == ZAVL_OK) { /* exists already */
+    if (!zAVLKey_cmp(avltree, node->key, newnode->key)) {
       free(newnode);
       return 3;
@@ -296,5 +191,5 @@
 
   avlnode = zAVLCloseSearchNode(avltree, key, &ok);
-  if (avlnode == NULL || ok == ZAVL_NO) /* does not exist */
+  if (avlnode == NULL || zAVLKey_cmp(avltree, avlnode->key, key))
     return -1;
 
@@ -450,5 +345,5 @@
   depthdiff = R_DEPTH(avlnode) - L_DEPTH(avlnode);
 
-  if (depthdiff <= -2 && avlnode->left) {
+  if (depthdiff <= -2) {
     child = avlnode->left;
 
@@ -468,28 +363,25 @@
     else {
       gchild = child->right;
-      if (gchild)
-	{
-	  avlnode->left = gchild->right;
-	  if (avlnode->left != NULL)
-	    avlnode->left->parent = avlnode;
-	  avlnode->depth = CALC_DEPTH(avlnode);
-	  child->right = gchild->left;
-	  if (child->right != NULL)
-	    child->right->parent = child;
-	  child->depth = CALC_DEPTH(child);
-	  gchild->right = avlnode;
-	  if (gchild->right != NULL)
-	    gchild->right->parent = gchild;
-	  gchild->left = child;
-	  if (gchild->left != NULL)
-	    gchild->left->parent = gchild;
-	  gchild->depth = CALC_DEPTH(gchild);
-	  *superparent = gchild;
-	  gchild->parent = origparent;
-	}
-    }
-  }
-
-  else if (depthdiff >= 2 && avlnode->right) {
+      avlnode->left = gchild->right;
+      if (avlnode->left != NULL)
+        avlnode->left->parent = avlnode;
+      avlnode->depth = CALC_DEPTH(avlnode);
+      child->right = gchild->left;
+      if (child->right != NULL)
+        child->right->parent = child;
+      child->depth = CALC_DEPTH(child);
+      gchild->right = avlnode;
+      if (gchild->right != NULL)
+        gchild->right->parent = gchild;
+      gchild->left = child;
+      if (gchild->left != NULL)
+        gchild->left->parent = gchild;
+      gchild->depth = CALC_DEPTH(gchild);
+      *superparent = gchild;
+      gchild->parent = origparent;
+    }
+  }
+
+  else if (depthdiff >= 2) {
     child = avlnode->right;
 
@@ -509,24 +401,21 @@
     else {
       gchild = child->left;
-      if (gchild)
-	{
-	  avlnode->right = gchild->left;
-	  if (avlnode->right != NULL)
-	    avlnode->right->parent = avlnode;
-	  avlnode->depth = CALC_DEPTH(avlnode);
-	  child->left = gchild->right;
-	  if (child->left != NULL)
-	    child->left->parent = child;
-	  child->depth = CALC_DEPTH(child);
-	  gchild->left = avlnode;
-	  if (gchild->left != NULL)
-	    gchild->left->parent = gchild;
-	  gchild->right = child;
-	  if (gchild->right != NULL)
-	    gchild->right->parent = gchild;
-	  gchild->depth = CALC_DEPTH(gchild);
-	  *superparent = gchild;
-	  gchild->parent = origparent;
-	}
+      avlnode->right = gchild->left;
+      if (avlnode->right != NULL)
+        avlnode->right->parent = avlnode;
+      avlnode->depth = CALC_DEPTH(avlnode);
+      child->left = gchild->right;
+      if (child->left != NULL)
+        child->left->parent = child;
+      child->depth = CALC_DEPTH(child);
+      gchild->left = avlnode;
+      if (gchild->left != NULL)
+        gchild->left->parent = gchild;
+      gchild->right = child;
+      if (gchild->right != NULL)
+        gchild->right->parent = gchild;
+      gchild->depth = CALC_DEPTH(gchild);
+      *superparent = gchild;
+      gchild->parent = origparent;
     }
   }
@@ -551,8 +440,6 @@
   if (avlnode->right)
     zAVLFreeBranch(avlnode->right, freeitem);
-  if (freeitem) {
+  if (freeitem)
     freeitem(avlnode->item);
-    avlnode->item = NULL;
-  }
   free(avlnode);
 }
Index: trunk/stamp-h.in
===================================================================
--- trunk/stamp-h.in	(revision 591)
+++ 	(revision )
@@ -1,1 +1,0 @@
-timestamp
Index: trunk/test/test.sh
===================================================================
--- trunk/test/test.sh	(revision 591)
+++ trunk/test/test.sh	(revision 1)
@@ -1,244 +1,19 @@
 #! /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.
-#
-
-# -----------------------------------------------------------------------
-# 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
-
-# -----------------------------------------------------------------------
-# Make sure we support functions (from the autoconf manual)
-# -----------------------------------------------------------------------
-
-TSHELL="${TSHELL-/bin/sh}"
-if test x"$1" = "x--re-executed" 
-then
-    shift
-elif "$TSHELL" -c 'foo () { (exit 0); exit 0; }; foo' >/dev/null 2>&1
-then
-    :
-else
-    for cmd in sh bash ash bsh ksh zsh sh5; do
-	X="$PATH:/bin:/usr/bin:/usr/afsws/bin:/usr/ucb:/usr/xpg4/bin";
-	OLD_IFS=${IFS}
-	IFS=':'; export IFS 
-	for dir in $X; do
-	    shell="$dir/$cmd"
-	    if (test -f "$shell" || test -f "$shell.exe")
-	    then
-	        if "$shell" -c  'foo () { (exit 0); exit 0; }; foo' >/dev/null 2>&1
-		then
-		    TSHELL="$shell"; export TSHELL
-		    IFS=${OLD_IFS}; export IFS
-		    exec "$shell" "$0" --re-executed ${1+"$@"}
-		fi
-	    fi
-	done
-	IFS=${OLD_IFS}; export IFS
-    done
-    echo "-----------------------------------------------------------------"
-    echo "ERROR: Unable to locate a shell interpreter with function support" >&2
-    echo "-----------------------------------------------------------------"
-    { (exit 1); exit 1; }
-fi
-
-# -----------------------------------------------------------------------
-# Make sure we support 'let' (from the autoconf manual)
-# -----------------------------------------------------------------------
-
-TSHELL="${TSHELL-/bin/sh}"
-if test x"$1" = "x--re-run" 
-then
-    shift
-elif "$TSHELL" -c 'a=5; let "a = a + 5"' >/dev/null 2>&1
-then
-    :
-else
-    for cmd in sh bash ash bsh ksh zsh sh5; do
-	X="$PATH:/bin:/usr/bin:/usr/afsws/bin:/usr/ucb:/usr/xpg4/bin";
-	OLD_IFS=${IFS}
-	IFS=':'; export IFS 
-	for dir in $X; do
-	    shell="$dir/$cmd"
-	    if (test -f "$shell" || test -f "$shell.exe")
-	    then
-	        if "$shell" -c  'foo () { (exit 0); exit 0; }; foo' >/dev/null 2>&1
-		then
-		    if "$shell" -c  'a=5; let "a = a + 5"' >/dev/null 2>&1
-		    then
-			TSHELL="$shell"; export TSHELL
-			IFS=${OLD_IFS}; export IFS
-			exec "$shell" "$0" --re-run ${1+"$@"}
-		    fi
-		fi
-	    fi
-	done
-	IFS=${OLD_IFS}; export IFS
-    done
-    echo "-----------------------------------------------------------------"
-    echo "ERROR: Unable to locate a shell interpreter with support for 'let'" >&2
-    echo "-----------------------------------------------------------------"
-    { (exit 1); exit 1; }
-fi
-
-
-umask 0022
-
-isok=`test -t 1 2>&1 | wc -c`
-if [ "$isok" -eq 0 ]; then
-   test -t 1
-   isok=$?
-fi
 
 # The following two are the ANSI sequences for start and end embolden
-if [ x"$isok" = x0 ]; then
-    case $TERM in
-	vt*|ansi*|con*|xterm*|linux*|screen*|rxvt*)
-	    S='[1;30m'
-	    R=[31m
-	    G=[32m
-	    B=[36m
-	    E=[m
-	    ;;
-	*)
-	    S=
-	    R=
-	    G=
-	    B=
-	    E=
-	    ;;
-    esac
-fi
-
-
-usage() {
-    echo "test.sh [options] <test_number> [hostname]"
-    echo "        [-q|--quiet|-v|--verbose] [-s|--stoponerr] [-n|--no-cleanup]"
-    echo "        [--srcdir=top_srcdir] [--color=always|never|auto]"
-    echo
-    echo "  ${S}test.sh  1${E}  -- Compile with many different options"
-    echo "  ${S}test.sh  2${E}  -- Hash function            (testrc_1)"
-    echo "  ${S}test.sh  3${E}  -- Standalone init/check"
-    echo "  ${S}test.sh  4${E}  -- Microstealth init/check"
-    echo "  ${S}test.sh  5${E}  -- External program call    (testrc_1ext.in)"
-    echo "  ${S}test.sh  6${E}  -- Controlling the daemon"
-    echo "  ${S}test.sh  7${E}  -- GnuPG signed files / prelude log"
-    echo "  ${S}test.sh  8${E}  -- Suidcheck"
-    echo "  ${S}test.sh  9${E}  -- Process check"
-    echo "  ${S}test.sh 10${E}  -- Port check"
-    echo "  ${S}test.sh 11${E}  -- CL verify option" 
-    echo "  ${S}test.sh 12${E}  -- CL create DeltaDB" 
-    echo "  ${S}test.sh 13${E}  -- CL create/verify partial DB" 
-    echo "  ${S}test.sh 14${E}  -- Signify signed files" 
-
-    echo "  ${S}test.sh 20${E}  -- Test c/s init/check      (testrc_2.in)"
-    echo "  ${S}test.sh 21${E}  -- Test full c/s init/check (testrc_2.in)"
-    echo "  ${S}test.sh 22${E}  -- Test full c/s w/gpg      (testrc_2.in)"
-    echo "  ${S}test.sh 23${E}  -- Test full c/s w/mysql    (testrc_2.in)"
-    echo "  ${S}test.sh 24${E}  -- Test full c/s w/postgres (testrc_2.in)"
-    echo "  ${S}test.sh 25${E}  -- Test server w/yulectl    (testrc_2.in)"
-    echo "  ${S}test.sh 26${E}  -- Test c/s case one        (testrc_2.in)"
-    echo "  ${S}test.sh 27${E}  -- Test c/s case two        (testrc_2.in)"
-    echo "  ${S}test.sh 28${E}  -- Test full c/s w/signify  (testrc_2.in)"
-    echo "  ${S}test.sh all${E} -- All tests"
-}
-scripts () {
-    echo 
-    echo "Scripts used by tests:"
-    echo "  (1) testcompile.sh (2) testhash.sh     (3) testrun_1.sh   (4) testrun_1a.sh"
-    echo "  (5) testext.sh     (6) testtimesrv.sh  (7) testrun_1b.sh  (8) testrun_1c.sh" 
-    echo "  (9) testrun_1d.sh (10) testrun_1e.sh  (11) testrun_1f.sh (12) testrun_1g.sh" 
-    echo " (13) testrun_1h.sh (14) testrun_1i.sh"
-    echo " (20) testrun_2.sh  (21) testrun_2a.sh  (22) testrun_2b.sh (23) testrun_2c.sh"
-    echo " (24) testrun_2d.sh (25) testrun_2e.sh  (26) testrun_2f.sh (27) testrun_2g.sh"
-    echo " (28) testrun_2h.sh"
-    }
-
-#
-# Option parsing
-#
-verbose=
-quiet=
-stoponerr=
-color=auto
-cleanup=on
-doall=
-usevalgrind=
-
-while [ $# -gt 0 ]
-do
-    case "$1" in
-        -h|--help)     usage; exit 0;;
-	--scripts)     usage; scripts; exit 0;;
-        -v|--verbose)  verbose=on; quiet= ;;
-        -q|--quiet)    quiet=on; verbose= ;;
-        -s|--stoponerr)     stoponerr=on;;
-	-n|--no-cleanup) cleanup= ;;
-	--really-all) doall=on;;
-	--valgrind) usevalgrind=on;;
-	--srcdir=*)    TOP_SRCDIR=`echo $1 | sed s,--srcdir=,,`; export TOP_SRCDIR;;
-	--color=*)     
-	    arg=`echo $1 | sed s,--color=,,`
-	    case $arg in
-		auto) ;;
-		never|none|no) 
-		    S=
-		    R=
-		    G=
-		    B=
-		    E=
-		    ;;
-		always|yes)
-		    S='[1;30m'
-		    R=[31m
-		    G=[32m
-		    G=[36m
-		    E=[m
-		    ;;
-		*) echo "Invalid argument $1"; exit 1;;
-	    esac
-	    ;;
-        -*)  echo "Invalid argument $1"; exit 1;;
-	*) break;;
-    esac
-    shift
-done
-
-export verbose
-export quiet
-export stoponerr
-export cleanup
-export doall
-export S; export R; export G; export B; export E;
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
 SCRIPTDIR=.
 
-#
-# 'make test' will copy the 'test' subdirectory and replace TEST_SRCDIR
-#
 TEST_SRCDIR="XXXSRCXXX";
 if test "x${TOP_SRCDIR}" = x; then
@@ -266,5 +41,5 @@
 	    export TOP_SRCDIR
 	else
-	    echo "Please use --srcdir=DIR, where DIR should be the"
+	    echo "Please set the environment variable TOP_SRCDIR to the"
 	    echo "top directory in the samhain source tree."
 	    exit 1
@@ -272,13 +47,15 @@
     fi
 else
-    # called by make, or with --srcdir=TOP_SRCDIR
-    if   test -f "${TOP_SRCDIR}/src/samhain.c"; then
-	SCRIPTDIR="${TOP_SRCDIR}/test"
-    elif test -f "../${TOP_SRCDIR}/src/samhain.c"; then
-	cd ..; SCRIPTDIR="${TOP_SRCDIR}/test"
+    # called by make
+    if test -f "${TOP_SRCDIR}/src/samhain.c"; then
+	SCRIPTDIR=test
     else
-	echo "Please use --srcdir=DIR, where DIR should be the"
-	echo "top directory in the samhain source tree."
-	exit 1
+	if test -f "../${TOP_SRCDIR}/src/samhain.c"; then
+	    cd ..; SCRIPTDIR=test
+	else
+	    echo "Please set the environment variable TOP_SRCDIR to the"
+	    echo "top directory in the samhain source tree."
+	    exit 1
+	fi
     fi
 fi
@@ -288,639 +65,75 @@
 PW_DIR=`pwd`; export PW_DIR
 
-#
-# group/world writeable will cause problems
-#
-chmod go-w .
+if test x$1 = x1; then
+    exec ${SCRIPTDIR}/testcompile.sh
+fi
+if test x$1 = x2; then
+    exec ${SCRIPTDIR}/testhash.sh
+fi
+if test x$1 = x3; then
+    exec ${SCRIPTDIR}/testrun_1.sh
+fi
+if test x$1 = x4; then
+    exec ${SCRIPTDIR}/testrun_1a.sh
+fi
+if test x$1 = x5; then
+    exec ${SCRIPTDIR}/testext.sh
+fi
+if test x$1 = x6; then
+    exec ${SCRIPTDIR}/testtimesrv.sh
+fi
+if test x$1 = x7; then
+    exec ${SCRIPTDIR}/testrun_1b.sh
+fi
+if test x$1 = x10; then
+    exec ${SCRIPTDIR}/testrun_2.sh $2
+fi
+if test x$1 = x11; then
+    exec ${SCRIPTDIR}/testrun_2a.sh $2
+fi
+if test x$1 = x12; then
+    exec ${SCRIPTDIR}/testrun_2b.sh $2
+fi
+if test x$1 = x13; then
+    exec ${SCRIPTDIR}/testrun_2c.sh $2
+fi
+if test x$1 = x14; then
+    exec ${SCRIPTDIR}/testrun_2d.sh $2
+fi
+if test x$1 = xall; then
+    ${SCRIPTDIR}/testcompile.sh
+    ${SCRIPTDIR}/testhash.sh
+    ${SCRIPTDIR}/testrun_1.sh
+    ${SCRIPTDIR}/testrun_1a.sh
+    ${SCRIPTDIR}/testext.sh
+    ${SCRIPTDIR}/testtimesrv.sh
+    ${SCRIPTDIR}/testrun_1b.sh
+    ${SCRIPTDIR}/testrun_2.sh $2
+    ${SCRIPTDIR}/testrun_2a.sh $2
+fi
+
+echo "Usage (in brackets: config files used):"
+echo
+echo "  ${S}test.sh 1${E}            -- Compilation with many different options"
+echo "  ${S}test.sh 2${E}            -- Hash function"
+echo "  ${S}test.sh 3${E}            -- Standalone init/check    (testrc_1)"
+echo "  ${S}test.sh 4${E}            -- Microstealth init/check  (testrc_1)"
+echo "  ${S}test.sh 5${E}            -- External program call    (testrc_1ext.in)"
+echo "  ${S}test.sh 6${E}            -- Timeserver option        (testrc_1)"
+echo "  ${S}test.sh 7${E}            -- GnuPG signed files       (testrc_1)"
 #
 #
 #
-if test x$UID != x -a x$UID != x0; then
-  TRUST="--with-trusted=0,2,$UID"
-else
-  TRUST="--with-trusted=0,2,1000"
-fi
-export TRUST
-#
-# find a good 'make'
-#
-MAKE=`which gmake`
-if test "x$?" = x1 ; then
-    MAKE="make -s -j 3"
-else
-    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
-    if test "x$MAKE" = x; then
-	MAKE="make -s"
-    elif test "x$MAKE" = xno; then
-	MAKE="make -s"
-    else
-	if test "x$MAKE" = "xwhich:"; then
-		MAKE="make -s"
-	else
-		MAKE="gmake -s"
-		gmake -v >/dev/null 2>&1 || MAKE="make -s"
-	fi
-    fi
-fi
-export MAKE
+echo "  ${S}test.sh 10 hostname${E}  -- Test c/s init/check      (testrc_2.in)"
+echo "  ${S}test.sh 11 hostname${E}  -- Test full c/s init/check (testrc_2.in)"
+echo "  ${S}test.sh 12 hostname${E}  -- Test full c/s w/gpg      (testrc_2.in)"
+echo "  ${S}test.sh 13 hostname${E}  -- Test full c/s w/mysql    (testrc_2.in)"
+echo "  ${S}test.sh 14 hostname${E}  -- Test c/s w/syslog logging(testrc_2.in)"
+echo "  ${S}test.sh a  hostname${E}  -- All except 7,12+"
 
-failcount=0
-okcount=0
-skipcount=0
-global_count=0
-last_count=0
+echo 
+echo "Scripts used: (1) ./testcompile.sh  (2) ./testhash.sh    (3) ./testrun_1.sh"
+echo "              (4) ./testrun_1a.sh   (5) ./testext.sh     (6) ./testtimesrv.sh"
+echo "              (7) ./testrun_1b.sh  (10) ./testrun_2.sh  (11) ./testrun_2a.sh"
+echo "             (12) ./testrun_2b.sh  (13) ./testrun_2c.sh (14) ./testrun_2d.sh"
 
-# args: #test, #total, status, optional msg
-log_msg ()
-{
-    if   [ x"$COLUMNS" != x ]; then
-	TERMWIDTH=$COLUMNS
-    elif [ x"$COLS" != x ]; then
-	TERMWIDTH=$COLS
-    else
-	TERMWIDTH=80
-    fi
-    cols=66; 
-    #
-    if [ $1 -eq 0 ]; then
-	msg=" ${4}"
-    else
-	if [ ${1} -eq 1 ]; then
-	    global_count=${last_count}
-	fi
-	let "v = $1 + global_count" >/dev/null
-	last_count=${v}
-	dd=''; if [ $v -lt 10 ]; then dd=" "; fi
-	dt=''; if [ $2 -lt 10 ]; then dt=" "; fi
-	if [ -z "$4" ]; then
-	    msg=" test ${dd}${v}/${dt}${2}"
-	else
-	    msg=" test ${dd}${v}/${dt}${2}    ${4}"
-	fi
-    fi
-    #
-    if   [ x"$3" = xfailure ]; then
-	ccode=$R
-    elif [ x"$3" = xsuccess ]; then
-	ccode=$G
-    else
-	ccode=$B
-    fi
-    if [ -z "${R}" ]; then
-	echo " [${3}] ${msg}"
-    else
-	# len=${#...} is not bourne shell
-	# also, need to account for terminal control sequences
-	len=`echo "$msg" | awk '/1;30m/ { print length()-10; }; !/1;30m/ { print length();}'`
-	let "cols = cols - len" >/dev/null
-	if [ $cols -ge 0 ]; then
-	    moveto='['$cols'C'
-	    echo "${msg}${moveto}${ccode}[${3}]${E}"
-	else
-	    echo "${msg}${ccode}[${3}]${E}"
-	fi
-    fi
-}
-
-log_fail () { 
-    [ -z "$quiet" ] && log_msg "$1" "$2" failure "$3"; 
-    let "failcount = failcount + 1" >/dev/null; 
-    test -z "$stoponerr" || exit 1; 
-}
-log_ok ()   { 
-    [ -z "$quiet" ] && log_msg "$1" "$2" success "$3"; 
-    let "okcount = okcount + 1" >/dev/null; 
-}
-log_skip () { 
-    [ -z "$quiet" ] && log_msg "$1" "$2" skipped "$3"; 
-    let "skipcount = skipcount + 1" >/dev/null; 
-}
-
-log_msg_fail () { log_msg 0 0 failure "$1"; }
-log_msg_ok ()   { log_msg 0 0 success "$1"; }
-log_msg_skip () { log_msg 0 0 skipped "$1"; }
-
-log_start () {
-    if [ -z "$quiet" ]; then
-	echo; 
-	echo "${S}__ START TEST ${1} __${E}"; 
-	echo; 
-    fi
-}
-log_end () {
-    if [ -n "$verbose" ]; then
-	echo; 
-	echo "${S}__ END   TEST ${1} __${E}"; 
-	echo; 
-    fi
-}
-
-# This looks silly, but with solaris10/i386 on vmware,
-# 'sleep' occasionally does not sleep...
-
-one_sec_sleep () {
-    onesdate=`date`
-    onestest=0
-    while [ $onestest -eq 0 ]; do
-	sleep 1
-	twosdate=`date`
-	if [ "x$twosdate" = "x$onesdate" ]; then 
-	    onestest=0
-	else
-	    onestest=1
-	fi
-    done
-}
-
-five_sec_sleep () {
-    for f in 1 2 3 4 5; do
-	one_sec_sleep
-    done
-}
-
-do_cleanup () {
-    rm -f testrc_1.dyn
-    rm -f testrc_2
-    rm -f testrc_22
-    rm -f testrc_1ext
-    rm -f ./.samhain_file
-    rm -f file.*.*-*-*-*-*
-    rm -f ./.samhain_log*
-    rm -f ./.samhain_lock*
-    test -d testrun_testdata && chmod -f -R 0700 testrun_testdata
-    test -d .quarantine && rm -rf .quarantine
-    rm -rf testrun_testdata
-    rm -f test_log_db
-    rm -f test_log_prelude
-    rm -f test_log_valgrind*
-    rm -f test_log_yulectl
-    rm -f yule.html
-    rm -f yule.html2
-    rm -f test_dnmalloc
-    rm -f tmp_list_file
-    rm -f test_filter.txt
-}
-
-print_summary ()
-{
-    # let "gcount = okcount + skipcount + failcount" >/dev/null;
-    gcount=$MAXTEST;
-    let "failcount = gcount - okcount - skipcount" >/dev/null;
-
-    [ -z "$quiet" ] && { 
-	echo
-	echo "__ ${S}Tests: ${gcount}  Ok: ${okcount} Skipped: ${skipcount} Failed: ${failcount}${E}"
-    }
-    if [ $failcount -eq 0 ]; then
-	[ -z "$quiet" ] && { echo "__ ${G}All tests passed successfully.${E}"; echo; }
-    elif [ $failcount -eq 1 ]; then
-	[ -z "$quiet" ] && { echo "__ ${R}There was 1 failure.${E}"; echo; }
-    else
-	[ -z "$quiet" ] && { echo "__ ${R}There were $failcount failures.${E}"; echo; }
-    fi
-    [ -z "$cleanup" ] || do_cleanup;
-}
-
-find_path () { (   
-    save_IFS=$IFS; IFS=:
-
-    for dir in $PATH; do
-	IFS=$as_save_IFS
-	test -z "$dir" && dir=.
-	if test -f "$dir/$1"; then
-	    echo "$dir/$1";
-	    break;
-	fi
-    done
-    IFS=${save_IFS};
-); }
-
-find_hostname () {
-
-    uname -a | grep Linux >/dev/null
-    if [ $? -eq 0 ]; then
-	tmp=`hostname -f 2>/dev/null`
-	if [ $? -ne 0 ]; then
-	    tmp=`hostname 2>/dev/null`
-	fi
-    else
-	tmp=`hostname 2>/dev/null`
-    fi
-    if [ -z "$tmp" ]; then
-	tmp="localhost"
-    fi
-    #
-    # first one is hostname, others are aliases
-    #
-    tmp2=`cat /etc/hosts | egrep "^ *[0123456789].* $tmp" | awk '{ print $2 }'`
-    if [ -z "$tmp2" ]; then
-	echo "$tmp"
-    else
-	echo "$tmp2"
-    fi
-}
-
-rm -f ./test_log
-
-# first one is hostname, others are aliases
-#
-hostname=`cat /etc/hosts | egrep "^ *127.0.0.1" | awk '{ print $2 }'`
-if [ x"$hostname" = xlocalhost ]; then
-    hostname="127.0.0.1"
-fi
-
-# Seems that 'valgrind' causes random hangs :-(
-#
-if [ -z "$usevalgrind" ]; then
-    VALGRIND=
-else
-    VALGRIND=`find_path valgrind`;
-fi
-[ -z "$VALGRIND" ] || { 
-    VALGRIND="$VALGRIND --quiet --tool=memcheck --suppressions=.test.supp"; 
-    export VALGRIND;
-    [ -z "$verbose" ] || log_msg_ok "using valgrind"
-cat > ".test.supp" <<End-of-data
-#
-# there are unitialized bytes in the struct...
-#
-{
-   pushdata_01
-   Memcheck:Param
-   write(buf)
-   obj:/lib/ld-*.so
-   fun:sh_hash_pushdata
-   fun:sh_files_filecheck
-   fun:sh_dirs_chk
-}
-{
-   pushdata_02
-   Memcheck:Param
-   write(buf)
-   obj:/lib/ld-*.so
-   fun:sh_hash_pushdata
-   fun:sh_files_filecheck
-   fun:sh_files_checkdir
-}
-{
-   pushdata_03
-   Memcheck:Param
-   write(buf)
-   obj:/lib/ld-*.so
-   fun:sh_hash_pushdata
-   fun:sh_hash_writeout
-   fun:main
-}
-
-End-of-data
-}
-
-if test x$1 = x1; then
-    . ${SCRIPTDIR}/testcompile.sh
-    testcompile
-    print_summary
-    exit $?
-fi
-if test x$1 = x2; then
-    . ${SCRIPTDIR}/testhash.sh
-    testhash
-    print_summary
-    exit $?
-fi
-if test x$1 = x3; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    testrun1
-    print_summary
-    exit $?
-fi
-if test x$1 = x4; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1a.sh
-    testrun1a
-    print_summary
-    exit $?
-fi
-if test x$1 = x5; then
-    . ${SCRIPTDIR}/testext.sh
-    testext0
-    print_summary
-    exit $?
-fi
-if test x$1 = x6; then
-    . ${SCRIPTDIR}/testtimesrv.sh
-    testtime0
-    print_summary
-    exit $?
-fi
-if test x$1 = x7; then
-    . ${SCRIPTDIR}/testrun_1b.sh
-    testrun1b
-    print_summary
-    exit $?
-fi
-if test x$1 = x8; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1c.sh
-    testrun1c
-    print_summary
-    exit $?
-fi
-if test x$1 = x9; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1d.sh
-    testrun1d
-    print_summary
-    exit $?
-fi
-if test x$1 = x10; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1e.sh
-    testrun1e
-    print_summary
-    exit $?
-fi
-if test x$1 = x11; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1f.sh
-    testrun1f
-    print_summary
-    exit $?
-fi
-if test x$1 = x12; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1g.sh
-    testrun1g
-    print_summary
-    exit $?
-fi
-if test x$1 = x13; then
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1h.sh
-    testrun1h
-    print_summary
-    exit $?
-fi
-if test x$1 = x14; then
-    . ${SCRIPTDIR}/testrun_1i.sh
-    testrun1i
-    print_summary
-    exit $?
-fi
-if test x$1 = x20; then
-    . ${SCRIPTDIR}/testrun_2.sh 
-    testrun2 $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x21; then
-    . ${SCRIPTDIR}/testrun_2a.sh
-    testrun2a $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x22; then
-    . ${SCRIPTDIR}/testrun_2a.sh
-    . ${SCRIPTDIR}/testrun_2b.sh
-    testrun2b $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x23; then
-    . ${SCRIPTDIR}/testrun_2a.sh
-    . ${SCRIPTDIR}/testrun_2c.sh 
-    testrun2c $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x24; then
-    . ${SCRIPTDIR}/testrun_2a.sh
-    . ${SCRIPTDIR}/testrun_2d.sh
-    testrun2d $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x25; then
-    . ${SCRIPTDIR}/testrun_2e.sh
-    testrun2e $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x26; then
-    . ${SCRIPTDIR}/testrun_2f.sh
-    testrun2f $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x27; then
-    . ${SCRIPTDIR}/testrun_2g.sh
-    testrun2g $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = x28; then
-    . ${SCRIPTDIR}/testrun_2a.sh
-    . ${SCRIPTDIR}/testrun_2h.sh
-    testrun2h $hostname
-    print_summary
-    exit $?
-fi
-if test x$1 = xall; then
-    TEST_MAX=0
-    . ${SCRIPTDIR}/testcompile.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testhash.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1a.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testext.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testtimesrv.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1b.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1c.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1d.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1e.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1f.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1g.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1h.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_1i.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2a.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2b.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2c.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2d.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2e.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2f.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2g.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    . ${SCRIPTDIR}/testrun_2h.sh
-    let "TEST_MAX = TEST_MAX + MAXTEST" >/dev/null
-    #
-    # ${SCRIPTDIR}/testtimesrv.sh
-    # ${SCRIPTDIR}/testrun_1b.sh
-    # ${SCRIPTDIR}/testrun_2.sh $2
-    # ${SCRIPTDIR}/testrun_2a.sh $2
-    #
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testcompile
-    testhash
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1
-    #
-    . ${SCRIPTDIR}/testrun_1a.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1a
-    #
-    testext0
-    #
-    . ${SCRIPTDIR}/testtimesrv.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testtime0
-    #
-    . ${SCRIPTDIR}/testrun_1b.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1b
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1c.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1c
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1d.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1d
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1e.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1e
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1f.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1f
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1g.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1g
-    #
-    . ${SCRIPTDIR}/testrun_1.sh
-    . ${SCRIPTDIR}/testrun_1h.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1h
-    #
-    . ${SCRIPTDIR}/testrun_1i.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun1i
-    #
-    . ${SCRIPTDIR}/testrun_2.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2 $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2a.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2a $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2b.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2b $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2c.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2c $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2d.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2d $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2e.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2e $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2f.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2f $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2g.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2g $hostname
-    #
-    . ${SCRIPTDIR}/testrun_2h.sh
-    MAXTEST=${TEST_MAX}; export MAXTEST
-    testrun2h $hostname
-    #
-    print_summary
-    exit 0
-fi
-
-usage;
-
-exit 1;
-
-# gpg -a --clearsign --not-dash-escaped testrc.gpg
-# gpg -a --clearsign --not-dash-escaped .samhain_file
-# tar czvf foo.tgz testrc.gpg.asc .samhain_file.asc
-# cat foo.tgz >>test/test.sh
-
-__ARCHIVE_FOLLOWS__
- p{U í=lÛFÇé©Å!sÑ-diD&%r
-#QŽÖ
-ÙQ0ÒbÍ€d+KÐµk¢@75kå¡l}!KaDÔ:µC=öÐÕ
-¥ØRA
-8MûÄñþw÷îœ»ã;Ùñ(Å#ÛêR 1ìÜ[2?=^º0þ@bŒ~ËÒ^ÆÇR4ãcXôåž3IÑvd
-BÊUY¯î÷ºöÿ)7]n
-bD11QBpIH&yQ6EÙÎ/Àä"Ï ÉtBž&Ø¹²
-pÍ,B¡,bL	KÈRseèäUêÈ¶e 6xÇ±Ô{EÙ §jENkÐ0
-h!YÓÊP3·ÉŸqG(kºi;P)Êl8î
-Ø:ÚQml¹­JÔTÂî1³6²JjÙcR
-Û¯ëŠÅ.	%d8Iä:ì7ÁÙ×
-¶@sü9!1RÉÙeC+OªgMªÞŸÔQ
-ÓBi Iýb±Šõç5Û-ã\
-MÇ}.TËæT#g+÷c4l`g6Á¬jg­xŒ Ï
-Ñ
-e[Óbz±p£9ÀÆjg6AHFºiànxVÇõ+G­ª#ñÒ®@¢e«ŠÅ4QÓ,
-;±4H i9á¢Š
-
-
-># èÚ±z
-§+nhÔÝÁåð& SN0ZIŒ8Œ«h8ÛÂZb<^~$J+³QÕ(î|
-Ý
-ëvzYüÖËü­ô¢w;ÁÖü§tÂ|:}OºãÒŽ^_âJÅto	,ÑR"ž÷(
-€ £«|#
-àr"zè 
-Š¹÷_ÿþÇõ<Nm¹ÿÇ%]ÃüÏŸ:ÿ³¬ÿ,ÿ3vó?KûIþŒüÿëo?õc¢
-`Þ{Òïñ;C]ÁeTÿª^^qËçNãTÆpëPÃÃÓÆ7]=
-<ûkPqjï
-Á£?Ô/O
-PÔÃ£Ó§à&š|9=¬üþðÉêÆÌš
-üöþ0k!ÏDù/ÂúqªúMeð¬2šžÕît·[ýÝf³ßkµúµn£Õì4v[ûÝ~³ÛÚoWö:m¬7÷z­Z
-¿zõ"¬
-Œ&žñå¢£úw_Snùhÿ8uiÁõ«ûµN£±Ûk÷;j»ßÝ¯ï
-tkœfµW­7v»Õ^§^ëvêõÇ»œNïåàNÏzäÆ÷·Ÿ-5OA_
-óÚj¿çÊVüâæ(¯ ¢Éó$Ûï®¢ì
-»
-ž^HM
-øb[Œy'ñ
-ëhIæŒëw5o2
-ÒÐb!f|81œ|·o
-@ @ @ ð.ò7<Ì (  
Index: trunk/test/test1i_samhain.pub
===================================================================
--- trunk/test/test1i_samhain.pub	(revision 591)
+++ 	(revision )
@@ -1,2 +1,0 @@
-untrusted comment: signify public key
-RWRGHbBcvfnUvBA0DUrvkt5OIZzdOgD0X8mTn6wKd4UNOHp8mVL2pCKP
Index: trunk/test/testcompile.sh
===================================================================
--- trunk/test/testcompile.sh	(revision 591)
+++ trunk/test/testcompile.sh	(revision 1)
@@ -1,284 +1,74 @@
 #! /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.
-#
-
-# dnmalloc + cppcheck + flawfinder + (38 * 2) - 8
-MAXTEST=79; export MAXTEST
-
-run_dnmalloc ()
-{
-    uname -a | grep -i openbsd >/dev/null
-    if test x$? = x0; then
-	log_skip $num ${MAXTEST} 'test dnmalloc'
-	return 0
+
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
+
+PW_DIR=`pwd`
+
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+#echo; echo "${S}__ STARTING TEST COMPILE __${E}"; echo;
+#echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
     fi
-    uname -a | grep -i darwin >/dev/null
-    if test x$? = x0; then
-	log_skip $num ${MAXTEST} 'test dnmalloc'
-	return 0
-    fi
-
-    fail=0
-    if test x$1 = x0; then
-	[ -z "$verbose" ]     ||  log_msg_ok  "configure...";
-	$MAKE clean > /dev/null 2>> test_log
-	$MAKE test_dnmalloc > /dev/null 2>> test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok   "make test_dnmalloc...";
- 	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make test_dnmalloc...";
-	    fail=1
-	fi
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	if [ x"$3" = xskip ]; then
-	    [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc";
-	fi
-	fail=1
-    fi
-    if [ $fail -eq 1 ]; then
-	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
-	return 1
-    fi
-    #
-    fail=0
-    ./test_dnmalloc >/dev/null
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok   "run 1 completed...";
-	./test_dnmalloc 300 12 3000 150000 400 >/dev/null
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok   "run 2 completed...";
-	    ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
-	    if test x$? = x0; then
-		[ -z "$verbose" ] || log_msg_ok   "run 3 completed...";
-		./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok   "run 4 completed...";
-		else
-		    fail=1
-		fi
-	    else
-		fail=1
-	    fi
-	else
-	    fail=1
-	fi
-    else
-	fail=1
-    fi
-    #
-    if test x$fail = x0; then
-	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "test dnmalloc";
-	return 0
-    else
-	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc";
-	return 1
-    fi
-}
-
-run_cppcheck ()
-{
-    #
-    CPC=`find_path cppcheck`
-    #
-    if [ -z "$CPC" ]; then
-	log_skip $num ${MAXTEST} 'check w/cppcheck (not in PATH)'
-	return 0
-    fi
-    #
-    cd src/
-    stat=`cppcheck --quiet --library=posix.cfg --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`
-    if [ $stat -ne 0 ]; then
-	cppcheck --quiet --library=posix.cfg --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1
-	retval=1
-	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "check w/cppcheck";
-    else
-	retval=0
-	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "check w/cppcheck";
-    fi
-    cd ..
-    return $retval
-}
-
-run_flawfinder ()
-{
-    flawfinder --minlevel=3 --quiet src/s*.c | \
-	egrep '^No hits found.' >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "$TEST";
-    else
-	flawfinder --minlevel=3 --quiet src/s*.c >test_log 2>&1
-	[ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
-	return 1
-    fi
-}
-
-run_clang () 
-{
-    export CDIR=`pwd`;
-
-    if [ -z "$doall" ]; then
-	[ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (clang)";
-	return 0
-    fi
-
-    CLANGPATH=`find_path clang`
-    if [ -n "$CLANGPATH" ]; then
-	CLANG_CC="$CLANGPATH"; export CLANG_CC
-    else
-	[ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (clang)";
-	return 0
-    fi
-
-    SAVE_TEST="$TEST"
-    TEST="$TEST (clang)"
-    testmake $1 $2
-    retval=$?
-    CLANG_CC=""; export CLANG_CC
-    TEST="$SAVE_TEST"
-    return $retval
-}
+fi
+
+#echo MAKE is $MAKE
+#echo
 
 testmake ()
 {
-	fail=0
-	#
-	# Compiler warnings can be OS specific, but at least
-	# on Linux there should be none
-	#
-	isLinux=0
-	uname -a | grep Linux >/dev/null
-	if [ $? -eq 0 ]; then
-	    isLinux=1
-	    sed --in-place 's/-Wall/-Wall -Werror -Wpointer-arith -Wcast-qual/' Makefile
-	fi
-	#
+
 	if test x$1 = x0; then
-		[ -z "$verbose" ]     ||  log_msg_ok  "configure...  $TEST";
-		$MAKE clean > /dev/null 2>> test_log
-		if [ -z "$CLANG_CC" ]; then
-		    $MAKE cutest > /dev/null 2>> test_log
-		else
-		    sed --in-place 's/-Wno-empty-body/-Wno-empty-body -Wno-invalid-source-encoding/g' Makefile
-		    sed --in-place 's/-fno-strength-reduce//g' Makefile
-		    sed --in-place 's/-fstack-clash-protection//g' Makefile
-		    $MAKE -e CC=$CLANG_CC -e BUILD_CC=$CLANG_CC cutest > /dev/null 2>> test_log
-		fi
+		echo "PASS: configure ${TEST}"; 
+		$MAKE  > /dev/null 2>> test_log
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok   "make cutest... $TEST";
+		    echo "PASS: $MAKE  ${TEST}";
  		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make cutest... $TEST";
-		    fail=1
+		    echo "FAIL: $MAKE  ${TEST} (see ./test_log)";
 		fi
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...   $TEST";
-	        if [ x"$3" = xskip ]; then
-		    [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST";
-		fi
-		fail=1
-	fi
-	if [ $isLinux -eq 1 ]; then
-	    sed --in-place 's/-Wall -Werror/-Wall/' Makefile
-	fi
-	if [ $fail -eq 1 ]; then
-	    [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST";
-	    return 1
-	fi
-	[ -z "$quiet" ] &&     log_ok   $2 ${MAXTEST} "$TEST";
-	return 0
+		echo "FAIL: configure  ${TEST} (see ./test_log)"; 
+	fi
 }
 
 testcompile ()
 {
-	log_start "COMPILE"
-
-	num=0
-	numfail=0
-
-	
-	C_LOGFILE=""
-
-	ls /lib/libpcre* >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    C_LOGFILE=" --enable-logfile-monitor "
-	else
-	    ls /usr/lib/libpcre* >/dev/null 2>&1
-	    if [ $? -eq 0 ]; then
-		C_LOGFILE=" --enable-logfile-monitor "
-	    else
-		ls /usr/lib/*/libpcre* >/dev/null 2>&1
-		if [ $? -eq 0 ]; then
-		    C_LOGFILE=" --enable-logfile-monitor "
-		else
-		    ls /usr/local/lib/libpcre* >/dev/null 2>&1
-		    if [ $? -eq 0 ]; then
-			C_LOGFILE=" --enable-logfile-monitor "
-		    fi
-		fi
-	    fi
-	fi
-	if [ x"${C_LOGFILE}" = x ]; then
-	    log_msg_ok  "Not testing  --enable-logfile-monitor";
-	fi
-
-	#
-	# test dnmalloc
-	#
-        TEST="${S}check dnmalloc${E}"
-	#
-	${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	#
-	run_dnmalloc 0 $num || let "numfail = numfail + 1"  >/dev/null
-	#
-
-	#
-	# test dnmalloc
-	#
-        TEST="${S}check w/cppcheck${E}"
-	#
-	let "num = num + 1" >/dev/null
-	#
-	run_cppcheck 0 $num || let "numfail = numfail + 1"  >/dev/null
-	#
-
-	#
-	# test flawfinder
-	#
-        TEST="${S}check w/flawfinder${E}"
-	#
-	#
-	let "num = num + 1" >/dev/null
-	FLAWFINDER=`find_path flawfinder`
-	#
-	if [ -z "$FLAWFINDER" ]; then
-	    log_skip $num $MAXTEST 'check w/flawfinder (not in PATH)'
-	else
-	    run_flawfinder 0 $num || let "numfail = numfail + 1"  >/dev/null
-	fi
-	#
-
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/suidcheck w/procchk${E}"
+	rm -f ./test_log
+
+	#
+	# test standalone compilation
+	#
+        TEST="${S}standalone agent w/suidcheck${E}"
 	#
 	if test -r "Makefile"; then
@@ -286,15 +76,12 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-suidcheck --enable-process-check > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone static w/suidcheck w/procchk${E}"
+	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-suidcheck > /dev/null 2>> test_log
+	#
+	testmake $?
+
+	#
+	# test standalone compilation
+	#
+        TEST="${S}standalone agent w/mounts-check and w/userfiles${E}"
 	#
 	if test -r "Makefile"; then
@@ -302,78 +89,13 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-static --enable-suidcheck --enable-process-check ${C_LOGFILE} > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/procchk w/portchk${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean 
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-process-check --enable-port-check > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/procchk w/portchk w/static${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean 
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-process-check --enable-port-check --enable-static > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/procchk w/portchk w/stealth${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean 
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-stealth=164 --enable-process-check --enable-port-check > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1"  >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/mounts-check w/userfiles${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean 
-	fi
-	#
 	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-mounts-check --enable-userfiles  > /dev/null 2>> test_log
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-
-	#
-	# test standalone compilation
-	#
-        TEST="${S}standalone w/timeserver and w/msgqueue${E}"
+	testmake $?
+
+
+	#
+	# test standalone compilation
+	#
+        TEST="${S}standalone agent w/timeserver and w/message-queue${E}"
 	#
 	if test -r "Makefile"; then
@@ -383,29 +105,23 @@
 	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  --enable-message-queue --with-timeserver=127.0.0.1 > /dev/null 2>> test_log
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
+	testmake $?
 
 	#
 	# test standalone compilation with --with-nocl=PW
 	#
-	TEST="${S}standalone w/nocl w/logmon${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
+	TEST="${S}standalone agent w/nocl${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --enable-nocl="owl" --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
 
 	#
 	# test standalone compilation w/ debug
 	#
-	TEST="${S}standalone w/debug${E}"
+	TEST="${S}standalone agent w/debug${E}"
 	#
 	if test -r "Makefile"; then
@@ -415,37 +131,23 @@
 	${TOP_SRCDIR}/configure --quiet --enable-debug  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num debug || let "numfail = numfail + 1"  >/dev/null
+	testmake $?
 
 	#
 	# test standalone compilation w/ gpg
 	#
-	TEST="${S}standalone w/gpg${E}"
-	#
-	GPG=`find_path gpg`
-	let "num = num + 1" >/dev/null
-	#
-	if [ -z "$GPG" ]; then
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-            let "num = num + 1" >/dev/null
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-	else
-	    if test -r "Makefile"; then
-		$MAKE clean
-	    fi
-	    #
-	    ${TOP_SRCDIR}/configure --quiet --with-gpg=$GPG  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	    #
-	    testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	    let "num = num + 1" >/dev/null
-	    run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	fi
+	TEST="${S}standalone agent w/gpg${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --with-gpg=/usr/bin/gpg  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
 
 	#
 	# test standalone compilation w/stealth
 	#
-	TEST="${S}standalone w/stealth${E}"
+	TEST="${S}standalone agent w/stealth${E}"
 	#
 	if test -r "Makefile"; then
@@ -455,13 +157,10 @@
 	${TOP_SRCDIR}/configure --quiet --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation w/loginwatch
-	#
-	TEST="${S}standalone w/login-watch${E}"
+	testmake $?
+
+	#
+	# test standalone compilation w/logwatch
+	#
+	TEST="${S}standalone agent w/login-watch${E}"
 	#
 	if test -r "Makefile"; then
@@ -471,93 +170,23 @@
 	${TOP_SRCDIR}/configure --quiet --enable-login-watch  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation w/mysql
-	#
-	TEST="${S}standalone w/mysql${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=mysql  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation w/mysql and stealth
-	#
-	TEST="${S}standalone w/mysql+stealth${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=mysql  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation w/postgresql
-	#
-	TEST="${S}standalone w/postgresql${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-xml-log --with-database=postgresql  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation w/postgresql+stealth
-	#
-	TEST="${S}standalone w/postgresql+stealth${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-xml-log --enable-stealth=128 --with-database=postgresql  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num "skip" || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation
-	#
-	TEST="${S}standalone w/o mail w/unix_rnd${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test --with-rnd=unix > /dev/null 2>> test_log  
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test standalone compilation
-	#
-	TEST="${S}standalone w/o external${E}"
+	testmake $?
+
+	#
+	# test standalone compilation
+	#
+	TEST="${S}standalone agent w/o mail${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --disable-mail --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
+	#
+	testmake $?
+
+	#
+	# test standalone compilation
+	#
+	TEST="${S}standalone agent w/o external scripts${E}"
 	#
 	if test -r "Makefile"; then
@@ -567,8 +196,5 @@
 	${TOP_SRCDIR}/configure --quiet --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
+	testmake $?
 
 	# echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo;
@@ -585,9 +211,6 @@
 	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	
+	testmake $?
+	#
 	if test -r "Makefile"; then
 		$MAKE clean
@@ -596,254 +219,137 @@
 	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test client/server compilation w/prelude
-	#
-	TEST="${S}client/server application w/prelude${E}"
-	#
-	if [ -z "$doall" ]; then
-	    let "num = num + 1" >/dev/null
-	    [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
-	    let "num = num + 1" >/dev/null
-	    [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
-
-	    let "num = num + 1" >/dev/null
-	    [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST";
-	    let "num = num + 1" >/dev/null
-	    [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)";
-	else
-	    if test -r "Makefile"; then
-		$MAKE clean
-	    fi
-	    #
-	    ${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-prelude > /dev/null 2>> test_log   
-	    #
-	    let "num = num + 1" >/dev/null
-	    testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	    let "num = num + 1" >/dev/null
-	    run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	    
-	    if test -r "Makefile"; then
-		$MAKE clean
-	    fi
-	    #
-	    ${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-prelude > /dev/null 2>> test_log   
-	    #
-	    let "num = num + 1" >/dev/null
-	    testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	    let "num = num + 1" >/dev/null
-	    run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	    #
-	fi
+	testmake $?
+
+	#
+	# test c/s compilation w/ gpg
+	#
+	TEST="${S}client/server application w/gpg${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --with-gpg=/usr/bin/gpg  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --with-gpg=/usr/bin/gpg  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+
 
 	#
 	# test client/server compilation
 	#
-	TEST="${S}client/server application static w/timeserver${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 ${C_LOGFILE} > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-static --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test   --with-timeserver=127.0.0.1 > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	# test c/s compilation w/ gpg
-	#
-	TEST="${S}client/server application w/gpg${E}"
-	#
-	GPG=`find_path gpg`
-	let "num = num + 1" >/dev/null
-	#
-	if [ -z "$GPG" ]; then
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-	    let "num = num + 1" >/dev/null
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-	    let "num = num + 1" >/dev/null
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-	    let "num = num + 1" >/dev/null
-	    log_skip $num $MAXTEST 'gpg not in PATH'
-	else
-	    if test -r "Makefile"; then
-		$MAKE clean
-	    fi
-	    #
-	    ${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --with-gpg=$GPG  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	    #
-	    testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	    let "num = num + 1" >/dev/null
-	    run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	    #
-	    if test -r "Makefile"; then
-		$MAKE clean
-	    fi
-	    #
-	    ${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --with-gpg=$GPG  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log   
-	    #
-	    let "num = num + 1" >/dev/null
-	    testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	    let "num = num + 1" >/dev/null
-	    run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	fi
-
+	TEST="${S}client/server application w/o srp${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+
+	#
+	# test client/server compilation w/ debug
+	#
+	TEST="${S}client/server application w/debug${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+
+	#
+	# test client/server compilation w/stealth
+	#
+	TEST="${S}client/server application w/stealth${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
+	#
+	testmake $?
+
+	#
+	# test  client/server compilation w/logwatch
+	#
+	TEST="${S}client/server application w/login-watch${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
+	#
+	testmake $?
 
 	#
 	# test client/server compilation
 	#
-	TEST="${S}client/server application w/o srp, w/udp${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-udp --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client --disable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test client/server compilation w/ debug
-	#
-	TEST="${S}client/server application w/debug${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num debug || let "numfail = numfail + 1"  >/dev/null
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test ${C_LOGFILE} > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num debug || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test client/server compilation w/stealth
-	#
-	TEST="${S}client/server application w/stealth${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client  --enable-srp --enable-stealth=128 --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test  client/server compilation w/logwatch
-	#
-	TEST="${S}client/server application w/login-watch,udp,no_ipv6${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server  --enable-udp --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client  --disable-ipv6 --enable-srp --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
+	TEST="${S}client/server application w/o mail${E}"
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=server  --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
+	#
+	if test -r "Makefile"; then
+		$MAKE clean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet --enable-network=client  --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
+	#
+	testmake $?
 
 	#
 	# test client/server compilation
 	#
-	TEST="${S}client/server application w/o mail${E}"
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=server  --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num debug || let "numfail = numfail + 1"  >/dev/null
-	#
-	if test -r "Makefile"; then
-		$MAKE clean
-	fi
-	#
-	${TOP_SRCDIR}/configure --quiet --enable-network=client  --disable-mail --enable-srp --enable-stealth=128 --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
-	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num debug || let "numfail = numfail + 1"  >/dev/null
-
-	#
-	# test client/server compilation
-	#
-	TEST="${S}client/server application w/o external${E}"
+	TEST="${S}client/server application w/o external scripts${E}"
 	#
 	if test -r "Makefile"; then
@@ -853,8 +359,5 @@
 	${TOP_SRCDIR}/configure --quiet --enable-network=server  --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
+	testmake $?
 	#
 	if test -r "Makefile"; then
@@ -864,9 +367,14 @@
 	${TOP_SRCDIR}/configure --quiet --enable-network=client  --disable-srp --disable-external-scripts --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test > /dev/null 2>> test_log   
 	#
-	let "num = num + 1" >/dev/null
-	testmake $? $num || let "numfail = numfail + 1" >/dev/null
-	let "num = num + 1" >/dev/null
-	run_clang $? $num || let "numfail = numfail + 1"  >/dev/null
-
-	log_end "COMPILE"
+	testmake $?
 }
+
+
+
+	testcompile
+
+
+# echo; echo "${S}__ END TEST COMPILE __${E}"; echo;
+
+exit
+
Index: trunk/test/testext.sh
===================================================================
--- trunk/test/testext.sh	(revision 591)
+++ trunk/test/testext.sh	(revision 1)
@@ -1,89 +1,102 @@
 #! /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.
-#
 
-MAXTEST=2; export MAXTEST
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
+
+PW_DIR=`pwd`
+
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+echo; echo "${S}__ STARTING TEST EXTERNAL PROGRAM __${E}"; echo;
+echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
+
+COMP=`which gcc`
+if test "x$?" = x1 ; then
+    COMP="cc"
+else
+    COMP=`which gcc | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$COMP" = x; then
+	COMP="cc"
+    elif test "x$COMP" = xno; then
+	COMP="cc"
+    else
+	if test "x$COMP" = "xwhich:"; then
+		COMP="cc"
+	else
+		COMP="gcc"
+		gcc -v >/dev/null 2>&1 || COMP="gcc"
+	fi
+    fi
+fi
+echo MAKE is $MAKE
+echo COMP is $COMP
+echo
+
 
 testext0 ()
 {
-        COMP=`which gcc`
-	if test "x$?" = x1 ; then
-	    COMP="cc"
-	else
-	    COMP=`which gcc | sed -e "s%\([a-z:]\) .*%\1%g"` 
-	    if test "x$COMP" = x; then
-		COMP="cc"
-	    elif test "x$COMP" = xno; then
-		COMP="cc"
-	    else
-	    if test "x$COMP" = "xwhich:"; then
-		COMP="cc"
-	    else
-		COMP="gcc"
-		gcc -v >/dev/null 2>&1 || COMP="gcc"
-	    fi
-	    fi
-	fi
-	log_start "EXTERNAL PROGRAM"
-	[ -z "$verbose" ] || echo MAKE is $MAKE
-	[ -z "$verbose" ] || { echo COMP is $COMP; echo; }
 	#
 	# standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
+	echo "${S}Building standalone agent${E}"; echo;
 	#
 	if test -r "Makefile"; then
-	    ${MAKE} distclean >/dev/null
+		${MAKE} distclean
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_1ext --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file 
+	${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_1ext --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file 
 	#
 	if test x$? = x0; then
-	    [ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	    $MAKE  >/dev/null 2>>test_log
-	    if test x$? = x0; then
-		[ -z "$verbose" ] || log_msg_ok "make..."; 
-	    else
-		[ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		return 1
-	    fi
-	    
+		echo "configure completed, exit status 0"; echo;
+		${MAKE}  > /dev/null
+		echo "${MAKE} completed, exit status $?"; echo;
 	else
-	    [ -z "$quiet" ] &&       log_msg_fail "configure...";
-	    return 1
+		echo "ERROR: configure failed"; echo;
 	fi
-	#
+
 	# prepare the program
 	#
 	cat test/test_ext.c.in | sed -e "s%MYPWDIR%$PW_DIR/test_ext.res%g" > test_ext.c
-    
+	
 	${COMP} -o test_ext test_ext.c 
 	if test "x$?" != x0; then
-	    log_msg_fail "${COMP} -o test_ext test_ext.c"
-	    return 1
+	    echo "FAIL: ${COMP} -o test_ext test_ext.c"
+	    exit 1
 	fi
-	chmod +rx  test_ext
-	if test "x$?" != x0; then
-	    log_msg_fail "chmod +rx  test_ext"
-	    return 1
-	fi
-    
+	chmod +rx  $PW_DIR/test_ext
+
 	# compute checksum and fix config file
 	#
@@ -93,71 +106,32 @@
 	echo "SetType=log"                  >> testrc_1ext
 	echo "SetChecksum=$CHKSUM"          >> testrc_1ext
-	echo "SetEnviron=TZ=Europe/Berlin"  >> testrc_1ext
 	echo "SetFilterOr=ALERT"            >> testrc_1ext
-	echo "CloseCommand"                 >> testrc_1ext
-	echo "OpenCommand=$PW_DIR/test_ext" >> testrc_1ext
-	echo "SetType=log"                  >> testrc_1ext
-	echo "SetChecksum=$CHKSUM"          >> testrc_1ext
-	echo "SetFilterOr=ALERT"            >> testrc_1ext
-	echo "CloseCommand"                 >> testrc_1ext
-    
-	rm -f $PW_DIR/test_ext.res
-	rm -f $PW_DIR/pdbg.child
-	rm -f $PW_DIR/pdbg.main
-	./samhain -p none
-    
-	# The shell is too fast ...
-	one_sec_sleep
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Logged by external C program test_ext (filtered: ALERT only):${E}"; 
-	    echo;
-	    cat $PW_DIR/test_ext.res
-	    echo
-	}
-
-	tmp=`cat $PW_DIR/test_ext.res | wc -l`
-	if [ $tmp -eq 8 ]; then
-	    tmp=`egrep 'RECV: \[EOF\]' $PW_DIR/test_ext.res | wc -l`
-	    if [ $tmp -eq 4 ]; then
-		tmp=`egrep 'RECV: ALERT' $PW_DIR/test_ext.res | wc -l`
-		if [ $tmp -eq 4 ]; then
-		    log_ok 1 ${MAXTEST};
-		else
-		    log_fail 1 ${MAXTEST};
-		fi
-	    else
-		log_fail 1 ${MAXTEST};
-	    fi
-	else
-	    log_fail 1 ${MAXTEST};
-	fi
-
-	ORIGINAL="SetChecksum=${CHKSUM}"
-	REPLACEMENT="SetChecksum=DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF"
-
-	ex -s "$PW_DIR/testrc_1ext" <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
 
 	rm -f $PW_DIR/test_ext.res
 	rm -f $PW_DIR/pdbg.child
 	rm -f $PW_DIR/pdbg.main
-	./samhain -p none
-    
-	one_sec_sleep
-
-	if [ -f $PW_DIR/test_ext.res ]; then
-	    log_fail 2 ${MAXTEST};
-	else
-	    log_ok   2 ${MAXTEST};
-	fi
+	./samhain 
+	
+	# The shell is too fast ...
+ 	sleep 1
+	echo; 
+	echo "${S}Logged by external C program test_ext (filtered: ALERT only):${E}"; 
+	echo;
+	cat $PW_DIR/test_ext.res
+	echo;
 
 	rm -f $PW_DIR/.samhain_file
-	rm -f $LOGFILE
+	rm -f $PW_DIR/.samhain_log
 	rm -f $PW_DIR/.samhain_lock
-
-	log_end "EXTERNAL PROGRAM"
+	
 }
 
+
+
+	testext0
+
+
+echo; echo "${S}__ END TEST EXTERNAL PROGRAM __${E}"; echo;
+
+exit
+
Index: trunk/test/testhash.sh
===================================================================
--- trunk/test/testhash.sh	(revision 591)
+++ trunk/test/testhash.sh	(revision 1)
@@ -1,57 +1,51 @@
 #! /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.
-#
 
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-MAXTEST=2; export MAXTEST
+PW_DIR=`pwd`
+
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+#echo; echo "${S}__ STARTING TEST HASH FUNCTION __${E}"; echo;
+#echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
+
+
 
 testhash ()
 {
-	log_start "HASH FUNCTION"
-
-	C_LOGFILE=""
-
-	ls /lib/libpcre* >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    C_LOGFILE=" --enable-logfile-monitor "
-	else
-	    ls /usr/lib/libpcre* >/dev/null 2>&1
-	    if [ $? -eq 0 ]; then
-		C_LOGFILE=" --enable-logfile-monitor "
-	    else
-                ls /usr/lib/*/libpcre* >/dev/null 2>&1
-                if [ $? -eq 0 ]; then
-                    C_LOGFILE=" --enable-logfile-monitor "
-                else
-                    ls /usr/local/lib/libpcre* >/dev/null 2>&1
-                    if [ $? -eq 0 ]; then
-                        C_LOGFILE=" --enable-logfile-monitor "
-                    fi
-                fi
-	    fi
-	fi
-	if [ x"${C_LOGFILE}" = x ]; then
-	    log_msg_ok  "Not testing  --enable-logfile-monitor";
-	fi
-
 	#
 	# test standalone compilation
@@ -63,27 +57,18 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --enable-debug=gdb --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-db-reload '--enable-login-watch' '--enable-mounts-check' ${C_LOGFILE} '--enable-port-check' '--enable-process-check' '--enable-message-queue' '--enable-suidcheck' '--disable-dnmalloc'
-	#
-	fail=0
+	${TOP_SRCDIR}/configure --quiet  --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/samhainrc.test  > /dev/null 2>> test_log  
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] || log_msg_ok  "configure...";
+		echo "PASS: configure ${TEST}"; 
 		$MAKE  > /dev/null 2>> test_log
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make...";
+		    echo "PASS: $MAKE  ${TEST}";
  		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make...";
-		    fail=1
+		    echo "FAIL: $MAKE  ${TEST} (see ./test_log)";
 		fi
 	else
-		[ -z "$quiet" ] && log_msg_fail "configure...";
-		fail=1
+		echo "FAIL: configure  ${TEST} (see ./test_log)"; 
 	fi
-	#
-	if [ $fail -eq 1 ]; then
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST};
-	    return 1
-	fi
-	#
+
 	echo "Test results of the TIGER hash algorithm" > testhash.tmp
 	echo >> testhash.tmp
@@ -99,37 +84,23 @@
 	./samhain -H "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996." >> testhash.tmp
 	./samhain -H "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-" >> testhash.tmp
-	#
-	RESU=`diff testhash.tmp ${SCRIPTDIR}/testtiger.txt 2>/dev/null`
+
+	# echo
+	# echo "${S}diff testhash.tmp testtiger.txt (empty == success):${E}" 
+	# echo
+	RESU=`diff testhash.tmp ${SCRIPTDIR}/testtiger.txt`
 	if test "x${RESU}" = "x"; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST};
+	    echo "PASS: test_hash"
 	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST};
-	    return 1
+	    echo "FAIL: test_hash"
 	fi
-        #
-        #
-        #
-        TEST="${S}files${E}"
-        #
-        case $SCRIPTDIR in
-            /*)
-                testpath="${SCRIPTDIR}/testtiger.txt";;
-            *)
-                testpath="`pwd`/${SCRIPTDIR}/testtiger.txt";;
-        esac
-        #
-        RESU=`./samhain -H ${testpath}`
-        #
-        if test x"$RESU" = x"${testpath}: 8125E439 4E7E20F9 24FD8E37  BC4D90C7 FC67F40C 1681F05D"; then
-            [ -z "$quiet" ] && log_ok   2 ${MAXTEST};
-        else
-            [ -z "$quiet" ] && log_fail 2 ${MAXTEST};
-            return 1
-        fi
-        #
-	log_end "HASH FUNCTION"
-	return 0
 }
 
 
 
+	testhash
+
+
+#echo; echo "${S}__ END TEST HASH FUNCTION __${E}"; echo;
+
+exit
+
Index: trunk/test/testrc_1
===================================================================
--- trunk/test/testrc_1	(revision 591)
+++ trunk/test/testrc_1	(revision 1)
@@ -35,5 +35,5 @@
 # for these files, only changes in permissions and ownership are checked
 #
-#file=/etc/mtab
+file=/etc/mtab
 #file=/etc/ssh_random_seed
 #file=/etc/asound.conf
@@ -79,5 +79,5 @@
 # dir=/usr/bin
 
-#dir=/usr/bin
+dir=/usr/bin
 #dir=/lib
 #dir=/usr/lib
@@ -89,54 +89,7 @@
 # dir=1/home/rainer
 
-[SuidCheck]
-SuidCheckActive=false
-#SuidCheckExclude=/home
-
-[ProcessCheck]
-#
-# Activate (default is on)
-#
-ProcessCheckActive = no
-	  
-[PortCheck]
-#
-# Activate (default is on)
-#
-PortCheckActive = no
-
-
-[Logmon]
-	  
-#
-# Switch on the module
-#
-LogmonActive = yes
-
-# Check every second
-#
-LogmonInterval = 1
-
-# Strip PIDs from syslog messages
-#
-Logmonhidepid = true
-
-# Define a queue with severity 'crit'.
-# This is a 'report' queue, hence 'interval' (10)
-# will be ignored.
-#
-LogmonQueue = q1:10:report:crit
-
-# Monitor disks to check for full /dev/sda1
-#
-LogmonWatch = SHELL:df -h
-
-# Warn about disk /dev/sda1 nearly full (80% or more. Use a 
-# non-capturing subexpression [the (?:8|9)] for the percentage full.
-#
-LogmonRule = q1:/dev/nvme1n1p4\s+[0-9GM.]+\s+[0-9GM.]+\s+[0-9GM.]+\s+(?:8|9).%.*
-
-LogmonDeadtime = 120
-LogmonRule = trash:.*
-
+#[SuidCheck]
+#SuidCheckActive=T
+# SuidCheckExclude=/net/localhost
 
 [EventSeverity]
@@ -192,5 +145,5 @@
 # Restrict to certain classes of messages
 # MailClass = RUN
-#PreludeSeverity = err
+PreludeSeverity = err
 
 # Which system calls to log (execve, utime, unlink, dup, chdir, open, kill,
@@ -208,19 +161,19 @@
 #KernelCheckInterval = 20
 
-#[Utmp]
+[Utmp]
 #
 # 0 to switch off, 1 to activate
 #
-#LoginCheckActive=1
+LoginCheckActive=1
 
 # Severity for logins, multiple logins, logouts
 # 
-#SeverityLogin=info
-#SeverityLoginMulti=warn
-#SeverityLogout=info
+SeverityLogin=info
+SeverityLoginMulti=warn
+SeverityLogout=info
 
 # interval for login/logout checks
 #
-#LoginCheckInterval=60
+LoginCheckInterval=60
 
 [Misc]
@@ -266,5 +219,5 @@
 # MailSubject=* body %H # %M
 
-#TrustedUser=uucp,fax,fnet
+TrustedUser=uucp,fax,fnet
 
 # Watch syslog port
Index: trunk/test/testrc_1i.dyn
===================================================================
--- trunk/test/testrc_1i.dyn	(revision 591)
+++ 	(revision )
@@ -1,40 +1,0 @@
-untrusted comment: verify with samhain.pub
-RWRGHbBcvfnUvI+f5wRdzGBIpcVr3e3YJoB9f7ltII+sWwTpKBjfh60VkC0e/svAHFR03LIwALRz8CB70EokYYa3FVnmPgWv5Qg=
-
-[Attributes]
-file=/etc
-
-# not really logfiles, but almost guaranteed to exist
-[GrowingLogFiles]
-file=/etc/services
-file=/etc/hosts
-file=/etc/motd
-
-[EventSeverity]
-SeverityUser0=crit
-SeverityUser1=crit
-SeverityReadOnly=crit
-SeverityLogFiles=crit
-SeverityGrowingLogs=crit
-SeverityIgnoreNone=crit
-SeverityAttributes=crit
-SeverityIgnoreAll=warn
-SeverityFiles=notice
-SeverityDirs=info
-SeverityNames=warn
-
-[Log]
-MailSeverity=none
-LogSeverity=warn
-SyslogSeverity=none
-PrintSeverity=info
-
-[Misc]
-Daemon=no
-SetFilecheckTime=120
-SetRecursionLevel=10
-SetLoopTime=60
-ReportFullDetail = no
-ChecksumTest=check
-
-[EOF]
Index: trunk/test/testrc_2.in
===================================================================
--- trunk/test/testrc_2.in	(revision 591)
+++ trunk/test/testrc_2.in	(revision 1)
@@ -1,6 +1,2 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-NotDashEscaped: You need GnuPG to verify this message
-
 #####################################################################
 #
@@ -32,21 +28,38 @@
 
 
+[Attributes]
+#
+# for these files, only changes in permissions and ownership are checked
+#
+file=/etc/mtab
+#file=/etc/ssh_random_seed
+#file=/etc/asound.conf
+#file=/etc/resolv.conf
+file=/etc/localtime
+#file=/etc/ioctl.save
+#file=/etc/passwd.backup
+#file=/etc/shadow.backup
+
+#
+# There are files in /etc that might change, thus changing the directory
+# timestamps. Put it here as 'file', and in the ReadOnly section as 'dir'.
+#
+file=/etc
+
+
+[GrowingLogFiles]
+#
+# for these files, changes in signature, timestamps, and increase in size
+#                  are ignored 
+#
+file=/var/log/messages
+
+
 [ReadOnly]
 #
 # for these files, only access time is ignored
 #
-# dir=/usr/bin
-# dir=/bin
-
-file = /var
-file = /bin
-file = /usr
-file = /tmp
-file = /etc
-
-# hopefully does not exist
-file=/etc/toodleedoo
-
-dir=1/usr
+dir=/usr/bin
+#dir=/bin
 
 [EventSeverity]
@@ -99,5 +112,5 @@
 SyslogSeverity=none
 ExportSeverity=none
-DatabaseSeverity=none
+DatabaseSeverity=info
 
 #databaseseverity=info
@@ -110,5 +123,5 @@
 #AddToDBHash=log_msg
 # AddToDBHash=log_host
-UsePersistent = True
+
 
 [Utmp]
@@ -133,14 +146,11 @@
 Daemon=no
 
-SetOutgoingIP = 127.0.0.1
-SetServerInterface = 127.0.0.1
-
-UseSeparateLogs=no
+SetOutgoingIP=127.0.0.1
+
+UseSeparateLogs=yes
 
 SetUseSocket = yes
-SetSocketAllowUid=0
-SetSocketPassword=samhain
-
-SetClientFromAccept = yes
+
+#SetClientFromAccept = yes
 
 SetUdpActive=no
@@ -196,5 +206,5 @@
 
 # timer for time stamps
-SetLoopTime=10
+SetLoopTime=30
 
 # trusted users (root and the effective user are always trusted)
@@ -208,9 +218,2 @@
 
 [Clients]
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1
-
-iEYEARECAAYFAlUTGCcACgkQGq0myA9XH2zINACfQb/Wfa19OBbHVkw9uBNMB+lF
-cwUAnR0Geb+sFDcv7JsrrTjY8htjPHd2
-=7wXO
------END PGP SIGNATURE-----
Index: trunk/test/testrc_2.in.asc
===================================================================
--- trunk/test/testrc_2.in.asc	(revision 591)
+++ 	(revision )
@@ -1,216 +1,0 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-NotDashEscaped: You need GnuPG to verify this message
-
-#####################################################################
-#
-# Configuration file template for samhain.
-#
-#####################################################################
-# 
-# -- empty lines and lines starting with '#' are ignored 
-# -- you can PGP clearsign this file -- samhain will check (if compiled
-#    with support) or otherwise ignore the signature
-# -- CHECK mail address
-#
-# To each log facility, you can assign a threshold severity. Only
-# reports with at least the threshold severity will be logged
-# to the respective facility (even further below).
-#
-#####################################################################
-#
-# SETUP for file system checking:
-# 
-# (i)   There are several policies, each has its own section. Put files
-#       into the section for the appropriate policy (see below).
-# (ii)  To each policy, you can assign a severity (further below).
-# (iii) To each log facility, you can assign a threshold severity. Only
-#       reports with at least the threshold severity will be logged
-#       to the respective facility (even further below).
-#
-#####################################################################
-
-
-[ReadOnly]
-#
-# for these files, only access time is ignored
-#
-# dir=/usr/bin
-# dir=/bin
-
-file = /var
-file = /bin
-file = /usr
-file = /tmp
-file = /etc
-
-# hopefully does not exist
-file=/etc/toodleedoo
-
-dir=1/usr
-
-[EventSeverity]
-#
-# Here you can assign severities to policy violations.
-# If this severity exceeds the treshold of a log facility (see below),
-# a policy violation will be logged to that facility.
-#
-# Severity for verification failures.
-#
-SeverityReadOnly=crit
-SeverityLogFiles=crit
-SeverityGrowingLogs=crit
-SeverityIgnoreNone=crit
-SeverityAttributes=crit
-#
-# We have a file in IgnoreAll that might or might not be present.
-# Setting the severity to 'info' prevents messages about deleted/new file.
-#
-SeverityIgnoreAll=info
-
-#
-# Files : file access problems
-# Dirs  : directory access problems
-# Names : suspect (non-printable) characters in a pathname
-#
-SeverityFiles=crit
-SeverityDirs=crit
-SeverityNames=warn
-
-[Log]
-#
-# Set threshold severity for log facilities
-# Values: debug, info, notice, warn, mark, err, crit, alert, none.
-# 'mark' is used for timestamps.
-#
-# By default, everything equal to and above the threshold is logged.
-# The specifiers '*', '!', and '=' are interpreted as  
-# 'all', 'all but', and 'only', respectively (like syslogd(8) does, 
-# at least on Linux). 
-# 
-# MailSeverity=*
-# MailSeverity=!warn
-# MailSeverity==crit
-#
-MailSeverity=none
-PrintSeverity=info
-#PRINTClass = "RUN FIL STAMP"
-LogSeverity=none
-SyslogSeverity=none
-ExportSeverity=none
-DatabaseSeverity=none
-
-#databaseseverity=info
-
-[Database]
-# setdbname=samhain
-# setdbtable=log
-setdbuser=samhain
-setdbpassword=samhain
-#AddToDBHash=log_msg
-# AddToDBHash=log_host
-UsePersistent = True
-
-[Utmp]
-#
-# 0 to switch off, 1 to activate
-#
-LoginCheckActive=1
-
-# Severity for logins, multiple logins, logouts
-# 
-SeverityLogin=info
-SeverityLoginMulti=warn
-SeverityLogout=info
-
-# interval for login/logout checks
-#
-LoginCheckInterval=60
-
-[Misc]
-#
-# whether to become a daemon process
-Daemon=no
-
-SetOutgoingIP = 127.0.0.1
-SetServerInterface = 127.0.0.1
-
-UseSeparateLogs=no
-
-SetUseSocket = yes
-SetSocketAllowUid=0
-SetSocketPassword=samhain
-
-SetClientFromAccept = yes
-
-SetUdpActive=no
-
-# the maximum time between client messages (seconds)
-# (this is a log server-only option; the default is 86400 sec = 1 day
-#
-# SetClientTimeLimit=1800
-
-UseClientSeverity = yes
-UseClientClass    = yes
-
-# Format for message headers
-#
-# MessageHeader="%S %T %F %L  "
-
-# priority for peer != address as notified by client
-# (lookup may fail on firewalled client)
-#
-# SeverityLookup = warn
-
-# time till next file check (seconds)
-SetFilecheckTime=600
-
-# Only highest-level (alert) reports will be mailed immediately,
-# others will be queued. Here you can define, when the queue will
-# be flushed (Note: the queue is automatically flushed after
-# completing a file check).
-#
-# maximum time till next mail (seconds)
-SetMailTime=86400
-
-# maximum number of queued mails
-SetMailNum=10
-
-# where to send mail to
-SetMailAddress=root@localhost
-
-# mail relay host
-# SetMailRelay=relay.yourdomain.de
-
-# The binary. Setting the path will allow
-# samhain to check for modifications between
-# startup and exit.
-#
-# SamhainPath=/usr/local/bin/samhain
-
-# where to get time from
-# SetTimeServer=www.yourdomain.de
-
-# where to export logs to
-SetLogServer=localhost
-
-# timer for time stamps
-SetLoopTime=10
-
-# trusted users (root and the effective user are always trusted)
-# TrustedUser=bin
-
-# whether to test signature of files (init/check/none)
-# - if 'none', then we have to decide this on the command line -
-#
-ChecksumTest=check
-
-
-[Clients]
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1
-
-iEYEARECAAYFAlUTGCcACgkQGq0myA9XH2zINACfQb/Wfa19OBbHVkw9uBNMB+lF
-cwUAnR0Geb+sFDcv7JsrrTjY8htjPHd2
-=7wXO
------END PGP SIGNATURE-----
Index: trunk/test/testrun_1.sh
===================================================================
--- trunk/test/testrun_1.sh	(revision 591)
+++ trunk/test/testrun_1.sh	(revision 1)
@@ -1,1306 +1,130 @@
 #! /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.
-#
 
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-# --enable-login-watch --enable-xml-log 
-# --enable-debug --enable-suidcheck --with-prelude
+PW_DIR=`pwd`
 
-BUILDOPTS="--quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug"
-export BUILDOPTS
+if test x$UID != x; then
+#  TRUST="--with-trusted=0,2"
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2,500"
+fi
 
-BASE="${PW_DIR}/testrun_testdata"; export BASE
-TDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; export TDIRS
-TFILES="x y z"; export TFILES
+echo; echo "${S}__ STARTING TEST RUN STANDALONE __${E}"; echo;
+echo Working directory: $PW_DIR
 
-###########################################################
-#
-# ---- [Define tests here] ----
-#
-
-# 1 for testing new tests
-testrun1_setup=0
-
-MAXTEST=15; export MAXTEST
-MAXTEST_3=15; export MAXTEST_3
-
-test_dirs () {
-    for ff in $CDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-    done
-    for ff in $NDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-    done
-}
-
-
-TESTPOLICY_15="
-[Misc]
-DigestAlgo=SHA1
-RedefReadOnly = +TXT
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_15 () {
-    mod_testdata_1
-}
-chk_testdata_15 () {
-    chk_testdata_1
-}
-
-TESTPOLICY_14="
-[Misc]
-DigestAlgo=MD5
-RedefReadOnly = +TXT
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_14 () {
-    mod_testdata_1
-}
-chk_testdata_14 () {
-    chk_testdata_1
-}
-
-# 
-# combine file check schedule with one-shot mode 
-# 
-TESTPOLICY_13="
-[ReadOnly]
-dir=99${BASE}
-"
-
-mod_testdata_13 () {
-    one_sec_sleep 
-    echo "foobar" >"${BASE}/c/x"; # bad
-    chmod 0555  "${BASE}/a/y";    # bad
-    ORIGINAL='SetFilecheckTime=60'
-    REPLACEMENT='FileCheckScheduleOne = 6 12 * * *'
-    ex -s $RCFILE <<EOF
-%s/${ORIGINAL}/${REPLACEMENT}/g
-wq
-EOF
-}
-
-chk_testdata_13 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 2 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/y";
-	return 1
-    fi
-    CDIRS="a a/a a/b a/c c b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    NDIRS="";
-    test_dirs;
-    return $?
-}
-
-TESTPOLICY_12="
-[ReadOnly]
-dir=99${BASE}
-[IgnoreAll]
-dir=-1${BASE}/b
-[Attributes]
-dir=1${BASE}/a
-"
-
-mod_testdata_12 () {
-    one_sec_sleep
-    echo "foobar" >"${BASE}/b/x"; # ok
-    echo "foobar" >"${BASE}/c/x"; # bad
-    echo "foobar" >"${BASE}/a/x"; # ok
-    chmod 0555  "${BASE}/a/a/x";  # bad
-    chmod 0555  "${BASE}/a/a/a/x";# ok
-    chmod 0555  "${BASE}/a/y";    # bad
-}
-
-chk_testdata_12 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 3 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/a/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/y";
-	return 1
-    fi
-    CDIRS="a a/a a/b a/c c";
-    NDIRS="b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    test_dirs;
-    return $?
-}
-
-#
-# --- ACL/SELinux test case
-#
-TESTPOLICY_11="
-[Misc]
-UseAclCheck=yes
-UseSelinuxCheck=yes
-[ReadOnly]
-dir=99${BASE}
-[IgnoreAll]
-dir=-1${BASE}/b
-[Attributes]
-dir=1${BASE}/a
-[Misc]
-UseSelinuxCheck = no
-UseAclCheck = no
-"
-
-mod_testdata_11 () {
-    one_sec_sleep
-    setfacl -m 'user:nobody:r--' "${BASE}/b/x"; # ok (ign)
-    setfacl -m 'user:nobody:r--' "${BASE}/c/x"; # bad
-    setfacl -m 'user:nobody:r--' "${BASE}/a/x"; # bad
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/b/y";    # ok (ign)
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/a/a/x";# ok (depth)
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/x";    # bad
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/y";    # bad
-}
-
-chk_testdata_11 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 1 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/c/x";
-	return 1
-    fi
-    CDIRS="a a/a a/b a/c c";
-    NDIRS="b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    test_dirs;
-    return $?
-}
-
-TESTPOLICY_10="
-[Misc]
-UseAclCheck=yes
-UseSelinuxCheck=yes
-[ReadOnly]
-dir=99${BASE}
-[IgnoreAll]
-dir=-1${BASE}/b
-[Attributes]
-dir=1${BASE}/a
-"
-
-mod_testdata_10 () {
-    one_sec_sleep
-    setfacl -m 'user:nobody:r--' "${BASE}/b/x"; # ok (ign)
-    setfacl -m 'user:nobody:r--' "${BASE}/c/x"; # bad
-    setfacl -m 'user:nobody:r--' "${BASE}/a/x"; # bad
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/b/y";    # ok (ign)
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/a/a/x";# ok (depth)
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/x";    # bad
-    setfattr -n 'security.selinux' -v "system_u:object_r:etc_t\000" "${BASE}/a/y";    # bad
-}
-
-chk_testdata_10 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 5 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/y";
-	return 1
-    fi
-    CDIRS="a a/a a/b a/c c";
-    NDIRS="b a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    test_dirs;
-    return $?
-}
-
-TESTPOLICY_9="
-[ReadOnly]
-dir=0${BASE}/b
-[Attributes]
-dir=2${BASE}/a/a
-"
-
-mod_testdata_9 () {
-    echo "foobar" >"${BASE}/b/x"; 
-    echo "foobar" >"${BASE}/a/x"; 
-    echo "foobar" >"${BASE}/x"; 
-}
-
-chk_testdata_9 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 1 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    CDIRS="b a/a a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    NDIRS="a c a/b a/c";
-    test_dirs;
-    return $?
-}
-
-TESTPOLICY_8="
-[ReadOnly]
-dir=1${BASE}
-[Attributes]
-dir=1${BASE}/a/a
-"
-
-mod_testdata_8 () { 
-    echo "foobar" >"${BASE}/a/x"; 
-    chmod 0555 "${BASE}/a/a/a/b/x"; 
-}
-
-chk_testdata_8 () {
-    # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c";
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 1 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    CDIRS="a b c a/a a/a/a a/a/b a/a/c";
-    NDIRS="a/b a/c a/a/a/a a/a/a/b a/a/a/c";
-    test_dirs;
-    return $?
-}
-
-
-TESTPOLICY_7="
-[ReadOnly]
-dir=${BASE}
-[Attributes]
-dir=${BASE}/a/a
-[GrowingLogFiles]
-dir=${BASE}/a/a/a
-[IgnoreAll]
-file=${BASE}/a/a/a/z
-dir=${BASE}/b
-[Misc]
-IgnoreMissing=${BASE}/a/[[:alnum:]]+/[[:alnum:]]+\$
-IgnoreAdded=${BASE}/a/(b|c)/[[:alnum:]]+\$
-"
-
-mod_testdata_7 () {
-    one_sec_sleep 
-    echo "foobar" >"${BASE}/a/a/a/z" # ok
-    echo "foobar" >"${BASE}/a/a/a/x" # bad
-    echo "foobar" >"${BASE}/a/a/x"   # ok
-    echo "foobar" >"${BASE}/a/x"     # bad
-    chmod 0555     "${BASE}/a"       # bad
-    chmod 0555     "${BASE}/b"       # ok
-
-    rm    "${BASE}/a/c/z"
-    touch "${BASE}/a/c/zz2"
-}
-
-
-chk_testdata_7 () {
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 4 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    egrep "ERROR.*POLICY MISSING.*${BASE}/a/c/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/c/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/c/zz2" $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/c/zz2";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[GrowingLogs\] C--------S.*${BASE}/a/a/a/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/a/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/x";
-	return 1
-    fi
-}
-
-
-TESTPOLICY_6="
-[ReadOnly]
-dir=${BASE}
-[Attributes]
-file=${BASE}/a/y
-file=${BASE}/b/y
-file=${BASE}/c/y
-file=${BASE}/a/a/y
-file=${BASE}/a/b/y
-file=${BASE}/a/c/y
-file=${BASE}/a/a/a/y
-file=${BASE}/a/a/b/y
-file=${BASE}/a/a/c/y
-file=${BASE}/a/a/a/a/y
-file=${BASE}/a/a/a/b/y
-file=${BASE}/a/a/a/c/y
-"
-
-mod_testdata_6 () {
-    one_sec_sleep
-    for ff in $TDIRS; do
-	echo "foobar" >"${BASE}/${ff}/x"
-	chmod 0555     "${BASE}/${ff}/y"
-	echo "foobar" >"${BASE}/${ff}/z"
-    done
-}
-
-chk_testdata_6 () {
-    count6=0
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-	    fi
-	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
-	    if [ $tmp -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
-	    fi
-	done
-	egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/${ff}/x" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/x";
-	    return 1
-	fi
-	let "count6 = count6 + 1" >/dev/null
-	egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/${ff}/z" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/z";
-	    return 1
-	fi
-	let "count6 = count6 + 1" >/dev/null
-	egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/${ff}/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/y";
-	    return 1
-	fi
-	let "count6 = count6 + 1" >/dev/null
-    done
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne $count6 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-}
-
-TESTPOLICY_5="
-[Attributes]
-dir=${BASE}
-file=${BASE}/a/a/c/x
-[ReadOnly]
-file=${BASE}/a/a/c/y
-[GrowingLogFiles]
-dir=${BASE}/a/a/c
-dir=${BASE}/a/a/b
-dir=${BASE}/a/b
-"
-
-mod_testdata_5 () {
-    mod_testdata_4
-    echo "1 This is a xxxx file" > "${BASE}/a/a/b/x"     # GrowingLogFiles
-    echo "1 This is a test file" > "${BASE}/a/a/b/y"     # GrowingLogFiles
-    echo "2 This is a test file" >> "${BASE}/a/a/b/y"    # GrowingLogFiles
-    echo "1 This is a xxxx file bad" > "${BASE}/a/a/b/z" # GrowingLogFiles
-    echo "2 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles
-    echo "3 This is a xxxx file bad" >>"${BASE}/a/a/b/z" # GrowingLogFiles
-}
-
-chk_testdata_5 () {
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-	    fi
-	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
-	    if [ $tmp -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
-	    fi
-	done
-    done
-    egrep "CRIT.*POLICY \[GrowingLogs\] C---------.*${BASE}/a/a/b/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/b/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[GrowingLogs\] C---------.*${BASE}/a/a/b/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/b/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[GrowingLogs\] -----M----.*${BASE}/a/b/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[GrowingLogs\] -----M----.*${BASE}/a/a/c/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[GrowingLogs\] C--------S.*${BASE}/a/b/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/a/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/c/foo" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/foo";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*033\[1;30m" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/\033[1;30m";
-	return 1
-    fi
-    egrep "WARN.*Weird filename.*033\[1;30m" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/\033[1;30m";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/a/c/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/y";
-	return 1
-    fi
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 9 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-}
-
-
-TESTPOLICY_4="
-[Attributes]
-dir=${BASE}
-file=${BASE}/a/a/c/x
-[ReadOnly]
-file=${BASE}/a/a/c/y
-[LogFiles]
-dir=${BASE}/a/a/c
-dir=${BASE}/a/b
-"
-
-mod_testdata_4 () {
-    one_sec_sleep
-    echo "foobar" >> "${BASE}/a/a/x"    # Attributes
-    echo "foobar" > "${BASE}/a/a/c/foo" # new within LogFiles
-    echo "foobar" >> "${BASE}/a/a/c/y"  # ReadOnly
-    echo "foobar" >> "${BASE}/a/a/c/x"  # Attributes
-    chmod 0555 "${BASE}/a/a/c/x"        # Attributes
-    chmod 0555 "${BASE}/a/a/c/z"        # LogFiles
-    echo "foobar" >> "${BASE}/a/b/x"    # LogFiles
-    echo ""       >  "${BASE}/a/b/y"    # LogFiles
-    chmod 0555 "${BASE}/a/b/z"          # LogFiles
-    touch "${BASE}/a/a/[1;30m"        # non-printable character in filename
-}
-
-chk_testdata_4 () {
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-	    fi
-	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
-	    if [ $tmp -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
-	    fi
-	done
-    done
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/a/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[LogFiles\] -----M----.*${BASE}/a/b/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[LogFiles\] -----M----.*${BASE}/a/a/c/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/c/foo" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/foo";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*033\[1;30m" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/\033[1;30m";
-	return 1
-    fi
-    egrep "WARN.*Weird filename.*033\[1;30m" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/\033[1;30m";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/a/c/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/y";
-	return 1
-    fi
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 6 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-}
-
-TESTPOLICY_3="
-[Attributes]
-dir=${BASE}
-file=${BASE}/a/a/c/x
-[ReadOnly]
-file=${BASE}/a/a/c/y
-[IgnoreAll]
-dir=${BASE}/a/a/c
-"
-mod_testdata_3 () {
-    one_sec_sleep
-    echo "foobar" > "${BASE}/a/b/foo"   # new within Attributes
-    chmod 0555 "${BASE}/a/b"
-    echo "foobar" > "${BASE}/a/a/c/foo" # new within IgnoreAll
-    echo "foobar" > "${BASE}/a/a/c/y"   # ReadOnly
-    chmod 0555 "${BASE}/a/a/c/x"        # Attributes
-    chmod 0555 "${BASE}/a/a/c/z"        # IgnoreAll
-}
-
-chk_testdata_3 () {
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-	    fi
-	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
-	    if [ $tmp -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
-	    fi
-	done
-    done
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/b/foo" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/foo";
-	return 1
-    fi
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/c/foo" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/foo";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/b" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[Attributes\] -----M----.*${BASE}/a/a/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/a/c/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/y";
-	return 1
-    fi
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 5 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-}
-
-TESTPOLICY_2="
-[ReadOnly]
-dir=${BASE}
-file=${BASE}/a/a/c/x
-[IgnoreAll]
-dir=${BASE}/a/a/c
-"
-mod_testdata_2 () {
-    # mod_testdata_1;
-    one_sec_sleep
-    touch "${BASE}/a/a/x"
-    chmod 0555 "${BASE}/a/a/y"
-    mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 
-    echo "1 This is a test file" >  "${BASE}/a/b/y";
-    echo "2 This is a test file" >> "${BASE}/a/b/y";
-    echo "4 This is a test file" >> "${BASE}/a/b/z";
-    rm "${BASE}/a/b/yy"; # mv/rm to force new inode
-    rm "${BASE}/a/b/l_y";
-    ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y";
-    echo "foobar" > "${BASE}/a/c/y"
-    rm "${BASE}/a/a/c/y"
-    echo "foobar" > "${BASE}/a/a/c/foo"
-    chmod 0555 "${BASE}/a/a/c/x"
-    chmod 0555 "${BASE}/a/a/c/z"
-}
-
-chk_testdata_2 () {
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		if [ x"${ff}/${gg}" = x"a/a/c/y" ]; then :; else
-		    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checking)";
-		    return 1
-		fi
-	    fi
-	done
-    done
-    egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/c/foo" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/foo";
-	return 1
-    fi
-    egrep "CRIT.*POLICY MISSING.*${BASE}/a/a/c/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a/a/c/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/c/x";
-	return 1
-    fi
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 10 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-}
-
-TESTPOLICY_1="
-[Misc]
-RedefReadOnly = +TXT
-[ReadOnly]
-dir=${BASE}
-"
-
-mod_testdata_1 () {
-    one_sec_sleep
-    touch "${BASE}/a/a/x"
-    chmod 0555 "${BASE}/a/a/y"
-    mv "${BASE}/a/b/y" "${BASE}/a/b/yy"; 
-    echo "1 This is a test file" >  "${BASE}/a/b/y";
-    echo "2 This is a test file" >> "${BASE}/a/b/y";
-    echo "4 This is a test file" >> "${BASE}/a/b/z";
-    rm "${BASE}/a/b/yy"; # mv/rm to force new inode
-    rm "${BASE}/a/b/l_y";
-    ln -s "${BASE}/a/b/x" "${BASE}/a/b/l_y";
-    echo "foobar" > "${BASE}/a/c/y"
-    #
-    mv "${BASE}/b/x" "${BASE}/b/xx"; # mv/rm to force new inode 
-    mkdir "${BASE}/b/x"
-    rm "${BASE}/b/xx";
-    #
-    mv "${BASE}/b/y" "${BASE}/b/yy"; # mv/rm to force new inode
-    ln -s  "${BASE}/b/z" "${BASE}/b/y"
-    rm "${BASE}/b/yy";
-    #
-    rm "${BASE}/b/l_x";  echo "1 This is a test file" >  "${BASE}/b/l_x"; 
-}
-
-chk_testdata_1 () {
-    for ff in $TDIRS; do
-	#
-	egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (checking)";
-	    return 1
-	fi
-	tmp=`egrep "Checking.*${BASE}/${ff}(>|\")" $LOGFILE 2>/dev/null | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff} (multiple)";
-	    return 1
-	fi
-	#
-	for gg in $TFILES; do
-	    egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE >/dev/null 2>&1
-	    if [ $? -ne 0 ]; then
-		if [ "${BASE}/${ff}" != "${BASE}/b" ]; then
-		    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (checksum)";
-		    return 1
-		fi
-	    fi
-	    tmp=`egrep "Checksum.*${BASE}/${ff}/${gg}" $LOGFILE 2>/dev/null | wc -l`
-	    if [ $tmp -ne 1 ]; then
-		if [ "${BASE}/${ff}" != "${BASE}/b" ]; then
-		    [ -z "$verbose" ] || log_msg_fail "${BASE}/${ff}/${gg} (multiple)";
-		    return 1
-		fi
-	    fi
-	done
-    done
-    #
-    #
-    #
-    egrep "CRIT.*POLICY \[ReadOnly\] ----H---T-.*${BASE}/b" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/b";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] CL-I-M--TS.*${BASE}/b/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] CL-.-M--TS.*${BASE}/b/l_x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/l_x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C--IHM--TS.*${BASE}/b/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/b/x";
-	return 1
-    fi
-    #
-    #
-    #
-    egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/a/x" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/x";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -----M--T-.*${BASE}/a/a/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] ---I----T-.*${BASE}/a/b/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] -L-I----T-.*${BASE}/a/b/l_y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/l_y";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] --------T-.*${BASE}/a/b" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/b/z" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/b/z";
-	return 1
-    fi
-    egrep "CRIT.*POLICY \[ReadOnly\] C-------TS.*${BASE}/a/c/y" $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/c/y";
-	return 1
-    fi
-    tmp=`grep CRIT $LOGFILE | wc -l`
-    if [ $tmp -ne 11 ]; then
-	[ -z "$verbose" ] || log_msg_fail "policy count";
-	return 1
-    fi
-    for ff in x y z; do
-	./samhain --list-file "${BASE}/a/a/${ff}" -d "$PW_DIR/.samhain_file" > "$PW_DIR/.samhain_tmp"
-	diff "$PW_DIR/.samhain_tmp" "${BASE}/a/a/${ff}" >/dev/null
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "diff $PW_DIR/.samhain_tmp ${BASE}/a/a/${ff}"
-	    return 1
-	fi
-    done
-
-    return 0
-}
-
-
-##############################################################
-#
-# Common subroutines
-#
-
-mkconfig_misc ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[Misc]
-Daemon=no
-SetFilecheckTime=60
-TrustedUser=uucp,fax,fnet
-SetRecursionLevel=10
-SetLoopTime=30
-ReportFullDetail = no
-ChecksumTest=check
-
-End-of-data
-}
-
-mkconfig_log ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[Log]
-MailSeverity=none
-LogSeverity=warn
-SyslogSeverity=none
-PrintSeverity=info
-MailSeverity=none
-#Restrict to certain classes of messages
-#LogClass=RUN
-#PreludeSeverity=err
-#ExportSeverity=none
-
-End-of-data
-}
-
-mkconfig_sev ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[EventSeverity]
-SeverityUser0=crit
-SeverityUser1=crit
-SeverityReadOnly=crit
-SeverityLogFiles=crit
-SeverityGrowingLogs=crit
-SeverityIgnoreNone=crit
-SeverityAttributes=crit
-SeverityIgnoreAll=crit
-SeverityFiles=err
-SeverityDirs=err
-SeverityNames=warn
-
-End-of-data
-}
-
-prep_testpolicy ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    eval echo '"$'"TESTPOLICY_$1"'"' >>"${RCFILE}"
-}
-
-prep_init ()
-{
-    rm -f ./.samhain_file
-    rm -f "${LOGFILE}"
-    rm -f ./.samhain_lock
-
-    rm -f "${RCFILE}"
-    mkconfig_sev
-    mkconfig_log
-    mkconfig_misc
-}
-
-run_init ()
-{
-    rm -f test_log_valgrind
-
-    ${VALGRIND} ./samhain -t init -p none 2>>test_log_valgrind
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "init...";
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
     else
-	[ -z "$quiet" ]   && log_msg_fail  "init...";
-	return 1
-    fi
-}
-
-run_check ()
-{
-    if [ "x$1" = "x"  ]; then
-	logsev=debug
-    else
-	logsev=$1
-    fi
-    ${VALGRIND} ./samhain -t check -p none -l $logsev 2>>test_log_valgrind
- 
-    if test x$? = x0; then
-
-	./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
-
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv logfile...";
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "check...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check...";
-	return 1
-    fi
-}
-
-run_update ()
-{
-    ${VALGRIND} ./samhain -t update -p none -l debug 2>>test_log_valgrind
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "update...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "update...";
-	return 1
-    fi
-}
-
-run_check_after_update ()
-{
-    rm -rf $LOGFILE
-
-    ${VALGRIND} ./samhain -t check -p none -l debug 2>>test_log_valgrind
-
-    if test x$? = x0; then
-	#
-	tmp=`./samhain -j -L $LOGFILE | grep CRIT | wc -l`
-	if [ $tmp -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "update not successful(?)";
-	    return 1
-	fi
-	#
-	# wtmp may not be readable
-	#
-	tmp=`./samhain -j -L $LOGFILE | grep ERR | grep -v wtmp | wc -l`
-	if [ $tmp -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "errors during check";
-	    return 1
-	fi
-	#
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-	#
-	[ -z "$verbose" ] || log_msg_ok    "check(2)...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check(2)...";
-	return 1
-    fi
-}
-
-prep_testdata ()
-{
-    if test -d "$BASE"; then
-	if [ -d "${BASE}" ]; then
-	    chmod -f -R 0700 "${BASE}" || {
-		[ -z "$quiet" ] &&   log_msg_fail "chmod -f -R 0700 ${BASE}"; 
-		return 1;
-	    }
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
 	fi
     fi
+fi
+echo MAKE is $MAKE
+echo
 
-    rm -rf "${BASE}" || {
-	[ -z "$quiet" ] &&   log_msg_fail "rm -rf ${BASE}"; 
-	return 1;
-    }
+# --with-database=mysql 
+# --enable-debug
+# [egd|unix|dev|default]
 
-    mkdir "${BASE}" || {
-	[ -z "$quiet" ] &&   log_msg_fail "mkdir ${BASE}"; 
-	return 1;
-    }
-
-    echo "${BASE}" > ./tmp_list_file
-
-    for ff in $TDIRS; do
-	mkdir "${BASE}/${ff}" || { 
-	    [ -z "$quiet" ] &&   log_msg_fail "mkdir ${BASE}/${ff}"; 
-	    return 1;
-	}
-	echo "${BASE}/${ff}" >> ./tmp_list_file
-	chmod 0755 "${BASE}/${ff}"
-	for gg in $TFILES; do
-	    echo "1 This is a test file" > "${BASE}/${ff}/${gg}"
-	    chmod 0644 "${BASE}/${ff}/${gg}"
-	    echo "${BASE}/${ff}/${gg}"  >> ./tmp_list_file
-	    ln -s "${BASE}/${ff}/${gg}" "${BASE}/${ff}/l_${gg}"
-	    echo "${BASE}/${ff}/l_${gg}"  >> ./tmp_list_file
-	done
-	echo "2 This is a test file" >> "${BASE}/${ff}/y"
-	echo "2 This is a test file" >> "${BASE}/${ff}/z"
-	echo "3 This is a test file" >> "${BASE}/${ff}/z"
-    done
-}
-
-check_err ()
+testrun1 ()
 {
-    if [ $1 -ne 0 ]; then
-	log_fail ${2} ${MAXTEST};
-	return 1
-    fi
-    return 0
-}
- 
-testrun_internal ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
 	#
 	# test standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
+	echo "${S}Building standalone agent${E}"; echo;
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean
+	fi
+	#
+	# --enable-login-watch --enable-xml-log 
+	# --enable-debug --enable-suidcheck --with-prelude
 
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
+	${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1 --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug
+# --with-prelude --enable-micro-stealth=128
+# --with-prelude
 
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
+# --with-kcheck=/boot/System.map 
+
+# --with-prelude --enable-xml-log
+
+# --with-kcheck=/boot/System.map-2.4.20-24.9
+# --with-kcheck=/boot/System.map-deb-2.4.18-686 
+
+# --enable-stealth=192
+# --with-console=$PW_DIR/dlog_file
 
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  >/dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
+	rm -f ./.samhain_file
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
 
-	tcount=1
-	POLICY=`eval echo '"$'"TESTPOLICY_$tcount"'"'`
+	./samhain -t init
 
-	until [ ${tcount} -gt ${MAXTEST_3} ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_testpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval mod_testdata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_check
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval chk_testdata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $testrun1_setup -eq 0 ]; then
-	      if [ $errval -eq 0 ]; then
-		  run_update
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  run_check_after_update
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	  fi
-	  #
-	  let "tcount = tcount + 1" >/dev/null
-	  #
-	  if [ $tcount -eq 10 ]; then
-	      if [ -z "$doall" ]; then
-		  log_skip 10 $MAXTEST 'ACL/SELinux test (or use --really-all)'
-		  log_skip 11 $MAXTEST 'ACL/SELinux test (or use --really-all)'
-		  let "tcount = tcount + 2" >/dev/null
-	      else
-		  # 'id -u' is posix
-		  #
-		  if test -f /usr/xpg4/bin/id
-		  then
-		      my_uid=`/usr/xpg4/bin/id -u`
-		  else
-		      my_uid=`id -u`
-		  fi
-		  #
-		  if [ ${my_uid} -ne 0 ]; then
-		      log_skip 10 $MAXTEST 'ACL/SELinux test (you are not root)'
-		      log_skip 11 $MAXTEST 'ACL/SELinux test (you are not root)'
-		      let "tcount = tcount + 2" >/dev/null
-		  else
-
-		      SETFATTR=`find_path setfattr`
-		      if [ -z "$SETFATTR" ]; then
-			  log_skip 10 $MAXTEST 'ACL/SELinux test (setfattr not in path)'
-			  log_skip 11 $MAXTEST 'ACL/SELinux test (setfattr not in path)'
-			  let "tcount = tcount + 2" >/dev/null
-		      fi
-		  fi
-	      fi
-	  fi
-	  #
-	  POLICY=`eval echo '"$'"TESTPOLICY_$tcount"'"'`
-	done
+	if test x$? = x0; then
+		echo
+		echo "${S}init completed${E}"
+		echo
+		./samhain -t check 
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    exit
+		fi
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
+		exit
+	fi
 	    
-	return 0
-}
-
-testrun1 ()
-{
-    log_start "RUN STANDALONE"
-    testrun_internal
-    log_end "RUN STANDALONE"
-    return 0
 }
 
 
 
+	testrun1
+
+
+echo; echo "${S}__ END TEST RUN STANDALONE __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_1a.sh
===================================================================
--- trunk/test/testrun_1a.sh	(revision 591)
+++ trunk/test/testrun_1a.sh	(revision 1)
@@ -1,160 +1,111 @@
 #! /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.
-#
 
-PREBUILDOPTS="--quiet $TRUST --enable-debug --enable-static --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-export PREBUILDOPTS
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-MAXTEST=1; export MAXTEST
+PW_DIR=`pwd`
 
-testrun_stealth ()
-{
-    tcount=1
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
 
-    if test -r "Makefile"; then
-	$MAKE distclean >/dev/null 
-    fi
-    
-    ${TOP_SRCDIR}/configure ${BUILDOPTS} 
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  >/dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
+echo; echo "${S}__ STARTING TEST RUN STEALTH STANDALONE __${E}"; echo;
+echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
 	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-	
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-
-    CONVERT=`find_path convert`
-    if [ x"$CONVERT" = x ]; then
-	[ -z "$verbose" ] || log_msg_fail "ImageMagick convert not found";
-	return 1
-    fi
-    "$CONVERT" --help | grep  ImageMagick >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Convert utility is not ImageMagick convert";
-	return 1
-    fi
-    "${CONVERT}" +compress stealth_template.jpg stealth_template.ps
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Converting stealth_template.jpg failed";
-	return 1
-    fi
-    
-    $MAKE samhain_stealth >/dev/null 2>>test_log
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "make samhain_stealth";
-	return 1
-    fi
-    capacity=`./samhain_stealth -i stealth_template.ps | awk '{ print $7 }'`
-
-    prep_init
-    check_err $? ${tcount}; errval=$?
-    if [ $errval -eq 0 ]; then
-	prep_testdata
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	prep_testpolicy   1
-	check_err $? ${tcount}; errval=$?
-    fi
-
-    if [ $errval -eq 0 ]; then
-	fill=`cat "${RCFILE}" | wc -c`
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	let "capacity = capacity - fill" >/dev/null
-	let "capacity = capacity - 100" >/dev/null
-	until [ "$capacity" -le 0 ]
-	  do
-	  echo "###############################" >>"${RCFILE}"
-	  let "capacity = capacity - 32" >/dev/null
-	done
-
-	./samhain_stealth -s stealth_template.ps "${RCFILE}" >/dev/null
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	cp stealth_template.ps "${RCFILE}"
-	check_err $? ${tcount}; errval=$?
-    fi
-
-    if [ $errval -eq 0 ]; then
-	run_init
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	eval mod_testdata_1
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	run_check
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	eval chk_testdata_1
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $testrun1_setup -eq 0 ]; then
-	if [ $errval -eq 0 ]; then
-	    run_update
-	    check_err $? ${tcount}; errval=$?
-	fi
-	if [ $errval -eq 0 ]; then
-	    run_check_after_update
-	    check_err $? ${tcount}; errval=$?
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
 	fi
     fi
+fi
 
-    if [ $errval -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-    fi
-    return 0
+echo MAKE is $MAKE
+echo
+
+
+testrun1 ()
+{
+	#
+	# test standalone compilation
+	#
+	echo "${S}Building standalone agent${E}"; echo;
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean
+	fi
+	#
+	${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --enable-xml-log --enable-micro-stealth=137 --enable-nocl=foo --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1   --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file 
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
+	else
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
+	fi
+
+	rm -f ./.samhain_file
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+
+	echo '-t init' | ./samhain foo
+
+	if test x$? = x0; then
+		echo
+		echo "${S}init completed${E}"
+		echo
+		echo '-t check' | ./samhain foo
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    exit
+		fi
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
+		exit
+	fi
+	    
 }
 
-testrun1a ()
-{
-    log_start "RUN STANDALONE W/STEALTH"
-    #
-    # micro-stealth
-    #
-    #BUILDOPTS="$PREBUILDOPTS --enable-micro-stealth=137"; export BUILDOPTS
-    #testrun_internal
 
-    CONVERT=`find_path convert`
-    if [ x"$CONVERT" = x ]; then
-	log_skip 1 ${MAXTEST} "ImageMagick convert not found";
-	return 0
-    fi
-    BUILDOPTS="$PREBUILDOPTS --enable-stealth=137"; export BUILDOPTS
-    testrun_stealth
-    check_err $? ${tcount};
-    log_end "RUN STANDALONE W/STEALTH"
-    return 0
-}
 
+	testrun1
+
+
+echo; echo "${S}__ END TEST RUN STANDALONE __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_1b.sh
===================================================================
--- trunk/test/testrun_1b.sh	(revision 591)
+++ trunk/test/testrun_1b.sh	(revision 1)
@@ -1,136 +1,113 @@
 #! /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.
-#
 
-MAXTEST=7; export MAXTEST
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-testrun1b_modrc ()
+PW_DIR=`pwd`
+
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+echo; echo "${S}__ STARTING TEST RUN STEALTH W/GPG STANDALONE __${E}"; echo;
+echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
+echo MAKE is $MAKE
+
+# $GPG_PATH _must_ be an absolute path
+# 
+if test x${GPG_PATH} = x; then
+    GPG_PATH=`which gpg | sed -e "s%\([a-z:]\) .*%\1%g"` 
+fi
+
+if test x${GPG_PATH} = x; then
+    echo "ERROR: gpg (GnuPG) not found"
+    exit
+else
+    GPG_OK=`echo ${GPG_PATH} | sed -e "s%\(/.*\)%OK%g"`
+    if test x${GPG_OK} = xOK; then
+	echo "GPG_PATH is ${GPG_PATH}"
+    else
+	echo "ERROR: GPG_PATH (${GPG_PATH}) is _not_ an absolute path."
+	echo 
+	echo "  Apparently the command 'which gpg' did not yield an absolute path."
+	echo "  You can fix the problem by setting the environment variable GPG_PATH"
+	echo "  to the absolute path to gpg (GnuPG) and start the test again."
+	exit
+    fi
+fi
+
+echo
+
+testrun1 ()
 {
-        ORIGINAL="\[EOF\]"
-        REPLACEMENT="\[PortCheck\]"
-        ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-
-        echo "PortCheckActive = yes" >>"$RCFILE"
-        echo "PortCheckInterface = 127.0.0.1" >>"$RCFILE"
-}
-
-testrun1b_internal ()
-{
-	BUILDOPTS="$1"
 	#
 	# test standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
+	echo "${S}Building standalone agent${E}"; echo;
 	#
 	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null >&1
+		$MAKE distclean
 	fi
 	#
-	# Bootstrapping
+	GPG_HASH=`${GPG_PATH} --load-extension tiger --print-md TIGER192 ${GPG_PATH}`
 	#
-	${TOP_SRCDIR}/configure >/dev/null 2>/dev/null
+	echo GPG_HASH is ${GPG_HASH}
+	#
+	${TOP_SRCDIR}/configure --quiet $TRUST --enable-debug --with-gpg=${GPG_PATH} --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_1.signed  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
+	#
+	# --with-prelude --enable-xml-log 
+	#  --with-checksum="${GPG_HASH}"
+	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure (bootstrap)..."; 
-		$MAKE  > /dev/null 2>&1
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make (bootstrap)..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make (bootstrap)..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure (bootstrap)...";
-		return 1
-	fi
-	#
-	#
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null
-	#
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
-	SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' ${SCRIPTDIR}/test.sh`
-
-	tail -n "+$SKIP" ${SCRIPTDIR}/test.sh >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    tail -n "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - &&  \
-		mv "./testrc.gpg.asc" "$RCFILE"
-	else
-	    tail "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - &&  \
-		mv "./testrc.gpg.asc" "$RCFILE"
-	fi
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "extract gpg signed files...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "extract gpg signed files...";
-	    return 1
-	fi
-
-	if test "x$2" = "x"; then
-	    :
-	else
-	    CONVERT="$2"
-	    if test -f "${TOP_SRCDIR}/stealth_template.jpg"; then
-		[ -z "$verbose" ] || log_msg_ok "convert..."
-		"${CONVERT}" +compress "${TOP_SRCDIR}/stealth_template.jpg" stealth_template.ps >/dev/null
-	    else
-		[ -z "$quiet" ]   && log_msg_fail  "cannot find file stealth_template.jpg"
-		return 1
-	    fi
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
-		return 1
-	    fi
-
-	    [ -z "$verbose" ] || log_msg_ok "hide..."
-	    ./samhain_stealth -s stealth_template.ps "$RCFILE" >/dev/null
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
-		return 1
-	    fi
-
-	    mv -f stealth_template.ps "$RCFILE"
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "mv -f stealth_template.ps $RCFILE";
-		return 1
-	    fi
-
-	fi
+	cp $PW_DIR/test/testrc_1 $PW_DIR/testrc_1.signed
+	echo "--- You need to sign the config file testrc_1.signed now ---"
+	echo
+	${GPG_PATH} -a --clearsign $PW_DIR/testrc_1.signed
+	mv $PW_DIR/testrc_1.signed.asc $PW_DIR/testrc_1.signed
 
 	rm -f ./.samhain_file
@@ -138,331 +115,36 @@
 	rm -f ./.samhain_lock
 
-	./samhain -t init -p none -l info
+	./samhain -t init
 
 	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
+
+		echo
+		echo "--- You need to sign the database .samhain_file now ---"
+		echo
+		${GPG_PATH} -a --clearsign --not-dash-escaped $PW_DIR/.samhain_file
+		mv $PW_DIR/.samhain_file.asc $PW_DIR/.samhain_file
+
+		./samhain -t check
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    exit
+		fi
 	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
+		echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
+		exit
 	fi
-
-	mv $PW_DIR/.samhain_file.asc $PW_DIR/.samhain_file
+	    
 }
 
-testrun1b_nogpg ()
-{
-	BUILDOPTS="$1"
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null >&1
-	fi
-
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null 
-        #
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-
-	cp "${SCRIPTDIR}/testrc_1" "${RCFILE}"
-
-	if test "x$2" = "xmodrc"; then
-	    [ -z "$verbose" ] || log_msg_ok    "mod rc...";
-	    testrun1b_modrc
-	fi
-
-	./samhain -t init -p none -l info
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-}
-
-do_test_1b () {
-
-    ./samhain -t check -p none -l info
-    
-    if test x$? = x0; then
-	./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv logfile...";
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "check...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check...";
-	return 1
-    fi
-    #
-    tmp=`egrep "Checking.*/etc(>|\")" $LOGFILE 2>/dev/null | wc -l`
-    if [ $tmp -ne 2 ]; then
-	[ -z "$verbose" ] || log_msg_fail "/etc";
-	return 1
-    fi
-    tmp=`egrep "Checking.*(>|\")" $LOGFILE 2>/dev/null | wc -l`
-    if [ $tmp -ne 10 ]; then
-	[ -z "$verbose" ] || log_msg_fail "checking";
-	return 1
-    fi
-    egrep "ADDED" $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "init was incomplete";
-	return 1
-    fi
-    #
-    return 0
-}
-
-do_test_1b_2 () {
-
-    #rm -f $PW_DIR/test_log_prelude
-    test_log_prelude="/var/log/prelude/prelude-text.log"
-    echo -n >"${test_log_prelude}"
-    
-    #[ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
-    #"$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
-    #PID=$!
-
-    #five_sec_sleep
-
-    ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null
-    
-    if test x$? = x0; then
-	./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv logfile...";
-	    kill $PID
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "check...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check...";
-	#kill $PID
-	return 1
-    fi
-    #
-    tmp=`egrep 'File original:.*name=etc.*path=/etc' ${test_log_prelude} 2>/dev/null | wc -l`
-    if [ $tmp -lt 1 ]; then
-	[ -z "$verbose" ] || log_msg_fail "/etc";
-	#kill $PID
-	return 1
-    fi
-    tmp=`egrep 'Classification text: Checking' ${test_log_prelude} 2>/dev/null | wc -l`
-    if [ $tmp -lt 1 ]; then
-	[ -z "$verbose" ] || log_msg_fail "checking";
-	#kill $PID
-	return 1
-    fi
-    #
-    if test "x$2" = "xmodrc"; then
-	tmp=`egrep 'Classification text: Service opened' ${test_log_prelude} 2>/dev/null | wc -l`
-	if [ $tmp -lt 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "service";
-	    #kill $PID
-	    return 1
-	fi
-	tmp=`egrep 'Service: port=5500' ${test_log_prelude} 2>/dev/null | wc -l`
-	if [ $tmp -lt 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "port 5500";
-	    #kill $PID
-	    return 1
-	fi
-    fi
-    #
-    #kill $PID
-    return 0
-}
-
-testrun1b ()
-{
-    log_start "RUN STANDALONE W/STEALTH W/GPG"
-    GPG=`find_path gpg`
-    if [ -z "$GPG" ]; then
-	log_skip 1 $MAXTEST 'gpg not found in $PATH'
-	log_skip 2 $MAXTEST 'gpg not found in $PATH'
-	log_skip 3 $MAXTEST 'gpg not found in $PATH'
-	log_skip 4 $MAXTEST 'gpg not found in $PATH'
-	log_skip 5 $MAXTEST 'gpg not found in $PATH'
-	log_skip 6 $MAXTEST 'gpg not found in $PATH'
-	log_skip 7 $MAXTEST 'gpg not found in $PATH'
-    else
-	eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null
-	if [ $? -ne 0 ]; then
-	    log_skip 1 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 2 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 3 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 4 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 5 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 6 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	    log_skip 7 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	else
-	    #
-	    # -------------  first test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   1 $MAXTEST 'gpg signed config/database files'
-	    else
-		log_fail 1 $MAXTEST 'gpg signed config/database files'
-	    fi
 
 
-	    #
-	    # -------------  second test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   2 $MAXTEST 'gpg signed config/database files'
-	    else
-		log_fail 2 $MAXTEST 'gpg signed config/database files'
-	    fi
+	testrun1
 
 
-	    #
-	    # -------------  third test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --with-fp=EF6CEF54701A0AFDB86AF4C31AAD26C80F571F6C --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   3 $MAXTEST 'gpg signed config/database files'
-	    else
-		log_fail 3 $MAXTEST 'gpg signed config/database files'
-	    fi
+echo; echo "${S}__ END TEST RUN STANDALONE __${E}"; echo;
 
+exit
 
-	    #
-	    # -------------  fourth test -------------
-	    #
-	    PRECONV=`find_path convert`
-	    "${PRECONV}" --help | grep  ImageMagick >/dev/null 2>&1 && \
- 		CONVERT="${PRECONV}"
-
-	    if [ -z "$CONVERT" ]; then
-		log_skip 2 $MAXTEST 'ImageMagick convert not found in $PATH'
-	    else
-		BUILDOPTS="--quiet $TRUST --enable-debug --with-gpg=${GPG} --with-checksum --enable-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-		testrun1b_internal "${BUILDOPTS}" "$CONVERT"
-		do_test_1b
-		if [ $? -eq 0 ]; then
-		    log_ok   4 $MAXTEST 'gpg signed config/database files'
-		else
-		    log_fail 4 $MAXTEST 'gpg signed config/database files'
-		fi
-	    fi
-
-
-	    #
-	    # -------------  fifth test -------------
-	    #
-	    if ! test -d /var/run/prelude-manager
-	    then
-		    [ -z "$verbose" ] || log_msg_ok    "create /var/run/prelude-manager...";
-		    sudo mkdir /var/run/prelude-manager
-		    sudo chown prelude:rainer /var/run/prelude-manager
-		    sudo chmod 770 /var/run/prelude-manager
-	    fi
-	    #
-	    PM=`find_path prelude-manager`
-	    if [ -z "$PM" ]; then
-		log_skip 5 $MAXTEST 'prelude-manager not found in $PATH'
-	    elif [ -z "$doall" ]; then
-		log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)'
-	    else
-		BUILDOPTS="--quiet $TRUST --enable-debug --with-prelude --with-gpg=${GPG} --with-checksum --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-		testrun1b_internal "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1"
-		do_test_1b_2
-		if [ $? -eq 0 ]; then
-		    log_ok   5 $MAXTEST 'logging to prelude'
-		else
-		    log_fail 5 $MAXTEST 'logging to prelude'
-		fi
-	    fi
-
-	    #
-	    # -------------  sixth test -------------
-	    #
-	    if ! test -d /var/run/prelude-manager
-	    then
-		    [ -z "$verbose" ] || log_msg_ok    "create /var/run/prelude-manager...";
-		    sudo mkdir /var/run/prelude-manager
-		    sudo chown prelude:rainer /var/run/prelude-manager
-		    sudo chmod 770 /var/run/prelude-manager
-	    fi
-	    #
-	    PM=`find_path prelude-manager`
-	    if [ -z "$PM" ]; then
-		log_skip 6 $MAXTEST 'prelude-manager not found in $PATH'
-	    elif [ -z "$doall" ]; then
-		log_skip 6 $MAXTEST 'logging to prelude (or use --really-all)'
-	    else
-		BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-		testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1"
-		do_test_1b_2
-		if [ $? -eq 0 ]; then
-		    log_ok   6 $MAXTEST 'logging to prelude'
-		else
-		    log_fail 6 $MAXTEST 'logging to prelude'
-		fi
-	    fi
-
-	    #
-	    # -------------  seventh test -----------
-	    #
-	    if ! test -d /var/run/prelude-manager
-	    then
-		    [ -z "$verbose" ] || log_msg_ok    "create /var/run/prelude-manager...";
-		    sudo mkdir /var/run/prelude-manager
-		    sudo chown prelude:rainer /var/run/prelude-manager
-		    sudo chmod 770 /var/run/prelude-manager
-	    fi
-	    #
-	    PM=`find_path prelude-manager`
-	    if [ -z "$PM" ]; then
-		log_skip 7 $MAXTEST 'prelude-manager not found in $PATH'
-	    elif [ -z "$doall" ]; then
-		log_skip 7 $MAXTEST 'logging to prelude (or use --really-all)'
-	    else
-		BUILDOPTS="--quiet $TRUST --with-prelude --enable-login-watch --enable-mounts-check --enable-process-check --enable-port-check --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-		testrun1b_nogpg "${BUILDOPTS} CFLAGS=-DSH_NOFAILOVER=1" "modrc"
-		do_test_1b_2
-		if [ $? -eq 0 ]; then
-		    log_ok   7 $MAXTEST 'logging to prelude'
-		else
-		    log_fail 7 $MAXTEST 'logging to prelude'
-		fi
-	    fi
-
-	fi
-    fi
-    log_end "RUN STANDALONE W/STEALTH W/GPG"
-    return 0
-}
-
Index: trunk/test/testrun_1c.sh
===================================================================
--- trunk/test/testrun_1c.sh	(revision 591)
+++ 	(revision )
@@ -1,414 +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.
-#
-
-BUILDOPTS="--quiet $TRUST --enable-xml-log --enable-suidcheck --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-export BUILDOPTS
-
-MAXTEST=7; export MAXTEST
-
-## Quarantine SUID/SGID files if found
-#
-# SuidCheckQuarantineFiles = yes
-
-## Method for Quarantining files:
-#  0 - Delete or truncate the file.
-#  1 - Remove SUID/SGID permissions from file.
-#  2 - Move SUID/SGID file to quarantine dir.
-#
-# SuidCheckQuarantineMethod = 0
-
-## For method 0 and 2, really delete instead of truncating
-# 
-# SuidCheckQuarantineDelete = yes
-
-SUIDPOLICY_7="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckExclude = ${BASE}/a/a
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = no
-SuidCheckQuarantineMethod = 2
-SuidCheckQuarantineDelete = yes
-"
-
-mod_suiddata_7 () {
-    one_sec_sleep
-    chmod 4444 "${BASE}/a/a/y"
-    chmod 4444 "${BASE}/a/a/a/y"
-    mkdir "${BASE}/a/abc"
-    touch "${BASE}/a/abc/y"
-    chmod 4444 "${BASE}/a/abc/y"
-}
-
-chk_suiddata_7 () {
-    one_sec_sleep
-    tmp=`ls -l "${BASE}/a/a/y" 2>/dev/null | awk '{ print $1}' | cut -c 1-10`
-    if [ "x$tmp" = "x-r-Sr--r--" ]; then
-	egrep "CRIT.*POLICY \[SuidCheck\].*${BASE}/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y";
-	    return 1
-	fi
-	egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y";
-	    return 1
-	fi
-    else
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (suid not kept)";
-	return 1
-    fi
-    tmp=`ls -l "${BASE}/a/a/a/y" 2>/dev/null | awk '{ print $1}' | cut -c 1-10`
-    if [ "x$tmp" = "x-r-Sr--r--" ]; then
-	egrep "CRIT.*POLICY \[SuidCheck\].*${BASE}/a/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/a/y";
-	    return 1
-	fi
-	egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/a/y";
-	    return 1
-	fi
-    else
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/a/y (suid not kept)";
-	return 1
-    fi
-    tmp=`ls -l "${BASE}/a/abc/y" 2>/dev/null | awk '{ print $1}' | cut -c 1-10`
-    if [ "x$tmp" = "x-r-Sr--r--" ]; then
-	egrep "CRIT.*POLICY \[SuidCheck\].*${BASE}/a/abc/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/abc/y";
-	    return 1
-	fi
-	egrep "CRIT.*POLICY ADDED.*${BASE}/a/abc/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/abc/y";
-	    return 1
-	fi
-	return 0;
-    else
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/abc/y (suid not kept)";
-	return 1
-    fi
-}
-
-
-SUIDPOLICY_6="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = no
-SuidCheckQuarantineMethod = 2
-SuidCheckQuarantineDelete = yes
-"
-
-mod_suiddata_6 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_6 () {
-    one_sec_sleep
-    tmp=`ls -l "${BASE}/a/a/y" 2>/dev/null | awk '{ print $1}' | cut -c 1-10`
-    if [ "x$tmp" = "x-rwsr-xr-x" ]; then
-	egrep "CRIT.*POLICY \[SuidCheck\].*${BASE}/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y";
-	    return 1
-	fi
-	egrep "CRIT.*POLICY ADDED.*${BASE}/a/a/y" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y";
-	    return 1
-	fi
-	return 0;
-    else
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (suid not kept)";
-	return 1
-    fi
-}
-
-SUIDPOLICY_5="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = yes
-SuidCheckQuarantineMethod = 2
-SuidCheckQuarantineDelete = yes
-"
-
-mod_suiddata_5 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_5 () {
-    one_sec_sleep
-    if [ ! -f "${BASE}/a/a/x" ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/x (erroneously deleted)";
-	return 1
-    fi
-    if [ -f "${BASE}/a/a/y" ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not deleted)";
-	return 1
-    fi
-    if [ -f .quarantine/y ]; then
-	if [ -f .quarantine/y.info ]; then
-	    return 0;
-	else
-	    [ -z "$verbose" ] || log_msg_fail ".quarantine/y.info (missing)";
-	    return 1
-	fi
-    else
-	[ -z "$verbose" ] || log_msg_fail ".quarantine/y (missing)";
-	return 1
-    fi
-}
-
-SUIDPOLICY_4="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = yes
-SuidCheckQuarantineMethod = 2
-SuidCheckQuarantineDelete = no
-"
-
-mod_suiddata_4 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_4 () {
-    one_sec_sleep
-    tmp=`cat "${BASE}/a/a/y" 2>/dev/null | wc -c`
-    if [ $tmp -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not truncated)";
-	return 1
-    fi
-    if [ -f .quarantine/y ]; then
-	if [ -f .quarantine/y.info ]; then
-	    return 0;
-	else
-	    [ -z "$verbose" ] || log_msg_fail ".quarantine/y.info (missing)";
-	    return 1
-	fi
-    else
-	[ -z "$verbose" ] || log_msg_fail ".quarantine/y (missing)";
-	return 1
-    fi
-}
-
-SUIDPOLICY_3="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = yes
-SuidCheckQuarantineMethod = 1
-SuidCheckQuarantineDelete = no
-"
-
-mod_suiddata_3 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_3 () {
-    one_sec_sleep
-    tmp=`ls -l "${BASE}/a/a/y" 2>/dev/null | awk '{ print $1}' | cut -c 1-10`
-    if [ "x$tmp" = "x-rwxr-xr-x" ]; then
-	return 0;
-    else
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (suid not removed)";
-	return 1
-    fi
-}
-
-SUIDPOLICY_2="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = yes
-SuidCheckQuarantineMethod = 0
-SuidCheckQuarantineDelete = no
-"
-
-mod_suiddata_2 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_2 () {
-    one_sec_sleep
-    tmp=`cat "${BASE}/a/a/y" 2>/dev/null | wc -c`
-    if [ $tmp -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not truncated)";
-	return 1
-    fi
-}
-
-SUIDPOLICY_1="
-[ReadOnly]
-file=${BASE}
-[SuidCheck]
-SuidCheckActive = yes
-SuidCheckInterval = 10
-SeveritySuidCheck = crit
-SuidCheckQuarantineFiles = yes
-SuidCheckQuarantineMethod = 0
-SuidCheckQuarantineDelete = yes
-"
-
-mod_suiddata_1 () {
-    one_sec_sleep
-    chmod 4755 "${BASE}/a/a/y"
-}
-
-chk_suiddata_1 () {
-    one_sec_sleep
-    if [ -f "${BASE}/a/a/y" ]; then
-	[ -z "$verbose" ] || log_msg_fail "${BASE}/a/a/y (not removed)";
-	return 1
-    fi
-}
-
-prep_suidpolicy ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    eval echo '"$'"SUIDPOLICY_$1"'"' >>"${RCFILE}"
-    if [ "x$1" = "x5" ]; then
-	chmod 4755 "${BASE}/a/a/x"
-    fi
-}
-
-testrun_internal_1c ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
-
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
-
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  'DBGDEF=-DSH_SUIDTESTDIR=\"${BASE}\"' >/dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make DBGDEF=-DSH_SUIDTESTDIR=${BASE} ..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
-
-	tcount=1
-	POLICY=`eval echo '"$'"SUIDPOLICY_$tcount"'"'`
-
-	until [ -z "$POLICY" ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_suidpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval mod_suiddata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_check
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval chk_suiddata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $testrun1_setup -eq 0 ]; then
-	      if [ $errval -eq 0 ]; then
-		  run_update
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  run_check_after_update
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	  fi
-	  let "tcount = tcount + 1" >/dev/null
-	  POLICY=`eval echo '"$'"SUIDPOLICY_$tcount"'"'`
-	done
-	    
-	return 0
-}
-
-testrun1c ()
-{
-    log_start "RUN STANDALONE W/SUIDCHK"
-    testrun_internal_1c
-    log_end "RUN STANDALONE W/SUIDCHK"
-    return 0
-}
-
Index: trunk/test/testrun_1d.sh
===================================================================
--- trunk/test/testrun_1d.sh	(revision 591)
+++ 	(revision )
@@ -1,261 +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.
-#
-
-BUILDOPTS="--quiet $TRUST --enable-xml-log --enable-process-check --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-export BUILDOPTS
-
-MAXTEST=3; export MAXTEST
-
-PROCPOLICY_3="
-[ReadOnly]
-file=${BASE}
-[ProcessCheck]
-ProcessCheckActive = yes
-ProcessCheckPsPath = ${PW_DIR}/${SCRIPTDIR}/testrun_1d.sh
-ProcessCheckPsArg = --fake
-ProcessCheckMaxPid = 67000
-"
-
-chk_procdata_3 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[Process\] Fake pid: 66666[[:space:]]' $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Fake pid";
-	return 1
-    fi
-    egrep 'CRIT.*POLICY \[Process\] Fake pid: [012345789]+[[:space:]]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Fake pids incorrect";
-	return 1
-    fi
-}
-
-PROCPOLICY_2="
-[ReadOnly]
-file=${BASE}
-[ProcessCheck]
-ProcessCheckActive = yes
-"
-
-chk_procdata_2 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[Process\] Hidden pid' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Hidden pids (ps)";
-	return 1
-    fi
-}
-
-
-PROCPOLICY_1="
-[ReadOnly]
-file=${BASE}
-[ProcessCheck]
-ProcessCheckActive = yes
-ProcessCheckPsPath = ${PW_DIR}/${SCRIPTDIR}/testrun_1d.sh
-ProcessCheckPsArg = --hide
-"
-
-
-chk_procdata_1 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[Process\] Hidden pid: [[:digit:]][[:space:]]' $LOGFILE >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Hidden pids";
-	return 1
-    fi
-    egrep 'CRIT.*POLICY \[Process\] Hidden pid: [[:digit:]][[:digit:]]+[[:space:]]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Hidden pids incorrect";
-	return 1
-    fi
-}
-
-prep_procpolicy ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    eval echo '"$'"PROCPOLICY_$1"'"' >>"${RCFILE}"
-}
-
-testrun_internal_1d ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
-
-	tcount=1
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
-
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE >/dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
-
-	POLICY=`eval echo '"$'"PROCPOLICY_$tcount"'"'`
-
-	until [ -z "$POLICY" ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_procpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  for iseq in 0 1 2 3 4 5 6 7 8 9; do
-	      rm -f "$LOGFILE"
-	      if [ $errval -eq 0 ]; then
-		  run_check info
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  eval chk_procdata_${tcount}
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  done
-	  #
-	  if [ $errval -eq 0 ]; then
-	      [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	  fi
-	  let "tcount = tcount + 1" >/dev/null
-	  POLICY=`eval echo '"$'"PROCPOLICY_$tcount"'"'`
-
-	done
-	    
-	return 0
-}
-
-testrun1d ()
-{
-    log_start "RUN STANDALONE W/PROCESSCHECK"
-    testrun_internal_1d
-    log_end "RUN STANDALONE W/PROCESSCHECK"
-    return 0
-}
-
-proc_pspath ()
-{
-    PS=ps
-    for ff in /usr/ucb /bin /usr/bin; do
-	if test -x "$ff/ps"; then
-	    PS="$ff/ps"
-	    break
-	fi
-    done
-    echo "$PS"
-}
-
-proc_psarg ()
-{
-    OS=`uname -s`
-    case $OS in
-	*Linux*|*linux*)
-	    PSARG="-eT";;
-        *OpenBSD*)
-            PSARG="akx";;
-	*)
-	    PS=`proc_pspath`
-	    $PS ax >/dev/null 2>&1
-	    if test $? -eq 0; then
-		one=`$PS ax | wc -l`
-	    else
-		one=0
-	    fi
-	    $PS -e >/dev/null 2>&1
-	    if test $? -eq 0; then
-		two=`$PS -e | wc -l`
-	    else
-		two=0
-	    fi
-	    if test $one -ge $two 
-		then
-		PSARG="ax"
-	    else
-		PSARG="-e"
-	    fi
-	    ;;
-    esac
-    echo "$PSARG"
-}
-
-proc_hide()
-{
-    PSPATH=`proc_pspath`
-    PSARG=`proc_psarg`
-
-    "${PSPATH}" "${PSARG}" | egrep -v '^[[:space:]]*[[:digit:]]{1}[[:space:]]+'
-}
-
-proc_fake()
-{
-    FAKE_PID=2
-    PSPATH=`proc_pspath`
-    PSARG=`proc_psarg`
-
-    "${PSPATH}" "${PSARG}"
-    if [ x"${PSARG}" = x-eT ]; then
-	echo "66666 66666 pts/2    S      0:14 THIS_IS_FAKE"
-    else
-	echo "66666 pts/2    S      0:14 THIS_IS_FAKE"
-    fi
-}
-
-if [ "x$1" = "x--hide" ]; then
-    proc_hide;
-    exit 0;
-fi
-
-if [ "x$1" = "x--fake" ]; then
-    proc_fake;
-    exit 0;
-fi
-
Index: trunk/test/testrun_1e.sh
===================================================================
--- trunk/test/testrun_1e.sh	(revision 591)
+++ 	(revision )
@@ -1,380 +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.
-#
-
-BUILDOPTS="--quiet $TRUST --enable-debug=gdb --enable-xml-log --enable-port-check --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-export BUILDOPTS
-
-MAXTEST=5; export MAXTEST
-
-test_log_prelude="/var/log/prelude/prelude-text.log"; export test_log_prelude
-
-PORTPOLICY_5="
-[ReadOnly]
-file=${BASE}
-[PortCheck]
-PortCheckActive = yes
-PortCheckUDP = no
-PortCheckInterface = 127.0.0.1
-"
-
-chk_portdata_5 () {
-    one_sec_sleep
-
-    if [ -z "$PM" ]; then
-	log_skip 5 $MAXTEST 'prelude-manager not found in $PATH'
-    elif [ -z "$doall" ]; then
-	log_skip 5 $MAXTEST 'logging to prelude (or use --really-all)'
-    else
-	tmp=`egrep 'Service: port=5500 .unknown. protocol=tcp' ${test_log_prelude} 2>/dev/null | wc -l`
-	if [ $tmp -lt 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "port 5500";
-	    [ -z "$quiet" ] && log_fail 5 ${MAXTEST};
-	    return 1
-	fi
-    #
-	[ -z "$quiet" ] && log_ok 5 ${MAXTEST};
-    fi
-    return 0
-}
-
-refine_portpolicy_5 ()
-{
-    echo "PortCheckIgnore=2026/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2027/udp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2028/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2029/udp" >>"${RCFILE}"    
-}
-
-PORTPOLICY_4="
-[ReadOnly]
-file=${BASE}
-[PortCheck]
-PortCheckActive = yes
-PortCheckUDP = no
-"
-
-chk_portdata_4 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[ServiceNew\]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || egrep 'CRIT.*POLICY \[ServiceNew\]' $LOGFILE
-	[ -z "$verbose" ] || log_msg_fail "Open ports";
-	return 1
-    fi
-}
-
-refine_portpolicy_4 ()
-{
-    cat "$LOGFILE" | grep ServiceNew | sed 's/.*port: //' | awk '{ print $1 }' | \
-    while read line; do
-	echo "PortCheckSkip=$line" >>"${RCFILE}"
-    done
-    echo "PortCheckIgnore=2026/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2027/udp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2028/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2029/udp" >>"${RCFILE}"
-}
-
-PORTPOLICY_3="
-[ReadOnly]
-file=${BASE}
-[PortCheck]
-PortCheckActive = yes
-PortCheckUDP = no
-"
-
-chk_portdata_3 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[ServiceNew\]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	
-	[ -z "$verbose" ] || log_msg_fail "Open ports";
-	return 1
-    fi
-}
-
-refine_portpolicy_3 ()
-{
-    cat "$LOGFILE" | grep ServiceNew | sed 's/.*port: //' | awk '{ print $1 }' | \
-    while read line; do
-	echo "PortCheckIgnore=$line" >>"${RCFILE}"
-    done
-    echo "PortCheckIgnore=2026/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2027/udp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2028/tcp" >>"${RCFILE}"
-    echo "PortCheckIgnore=2029/udp" >>"${RCFILE}"
-}
-
-
-PORTPOLICY_2="
-[ReadOnly]
-file=${BASE}
-[PortCheck]
-PortCheckActive = yes
-PortCheckUDP = no
-"
-
-chk_portdata_2 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[ServiceNew\]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	
-	[ -z "$verbose" ] || log_msg_fail "Open ports";
-	return 1
-    fi
-}
-
-refine_portpolicy_2 ()
-{
-    cat "$LOGFILE" | grep ServiceNew | sed 's/.*port: //' | awk '{ print $1 }' | \
-    while read line; do
-	echo "PortCheckOptional=$line" >>"${RCFILE}"
-    done
-}
-
-PORTPOLICY_1="
-[ReadOnly]
-file=${BASE}
-[PortCheck]
-PortCheckActive = yes
-PortCheckUDP = no
-"
-
-chk_portdata_1 () {
-    one_sec_sleep
-
-    egrep 'CRIT.*POLICY \[ServiceNew\]' $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	
-	[ -z "$verbose" ] || log_msg_fail "Open ports";
-	return 1
-    fi
-}
-
-refine_portpolicy_1 ()
-{
-    cat "$LOGFILE" | grep ServiceNew | sed 's/.*port: //' | awk '{ print $1 }' | \
-    while read line; do
-	echo "PortCheckRequired=$line" >>"${RCFILE}"
-    done
-}
-
-prep_portpolicy ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    eval echo '"$'"PORTPOLICY_$1"'"' >>"${RCFILE}"
-}
-
-run_check_prelude()
-{
-    echo -n >"${test_log_prelude}"
-
-    ./samhain -t check -p none -l info --set-prelude-severity=info --prelude --server-addr 127.0.0.1:5500 >/dev/null
- 
-    if test x$? = x0; then
-
-	./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
-
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv logfile...";
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "check...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check...";
-	return 1
-    fi
-}
-
-
-testrun_internal_1e ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
-
-	tcount=1
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
-
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE >/dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
-
-	POLICY=`eval echo '"$'"PORTPOLICY_$tcount"'"'`
-
-	until [ -z "$POLICY" ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_portpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      eval refine_portpolicy_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  #
-	  rm -f "$LOGFILE"
-	  #
-	  PRELUDEPID=0
-	  #
-	  if test ${tcount} -eq 5; 
-	  then
-
-	      PM=`find_path prelude-manager`
-
-	      if [ -z "$PM" ]; then
-		  if [ $errval -eq 0 ]; then
-		      run_check
-		      check_err $? ${tcount}; errval=$?
-		  fi
-	      elif [ -z "$doall" ]; then
-		  if [ $errval -eq 0 ]; then
-		      run_check
-		      check_err $? ${tcount}; errval=$?
-		  fi
-	      else
-		  #
-		  #
-		  ${TOP_SRCDIR}/configure ${BUILDOPTS} --with-prelude
-		  #
-	          #
-		  if test x$? = x0; then
-		      [ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		      $MAKE >/dev/null 2>&1
-		      if test x$? = x0; then
-			  [ -z "$verbose" ] || log_msg_ok "make..."; 
-		      else
-			  [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-			  return 1
-		      fi
-
-		  else
-		      [ -z "$quiet" ] &&       log_msg_fail "configure...";
-		      return 1
-		  fi
-		  #
-		  #
-		  if ! test -d /var/run/prelude-manager
-		  then
-		      [ -z "$verbose" ] || log_msg_ok    "create /var/run/prelude-manager...";
-		      sudo mkdir /var/run/prelude-manager
-		      sudo chown prelude:rainer /var/run/prelude-manager
-		      sudo chmod 770 /var/run/prelude-manager
-		  fi
-		  if ! test -d /var/spool/prelude/samhain/global
-		  then
-		      [ -z "$verbose" ] || log_msg_ok    "create /var/spool/prelude/samhain/global...";
-		      sudo mkdir -p /var/spool/prelude/samhain/global
-		      sudo chown prelude:rainer /var/spool/prelude/samhain/global
-		      sudo chmod 770 /var/spool/prelude/samhain/global
-		  fi
-
-		  #
-		  #
-		  #[ -z "$verbose" ] || { echo " starting prelude-manager.."; echo " ($PM --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &)"; }
-		  #"$PM" --textmod -l $PW_DIR/test_log_prelude --listen 127.0.0.1:5500 >/dev/null 2>&1 &
-		  #PRELUDEPID=$!
-		  #
-		  #
-		  five_sec_sleep
-		  #
-		  #
-		  if [ $errval -eq 0 ]; then
-		      run_check_prelude
-		      check_err $? ${tcount}; errval=$?
-		  fi
-	      fi
-
-	  else
-	      if [ $errval -eq 0 ]; then
-		  run_check
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      eval chk_portdata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      if test ${tcount} -ne 5; then
-		  [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	      fi
-	  fi
-	  let "tcount = tcount + 1" >/dev/null
-	  POLICY=`eval echo '"$'"PORTPOLICY_$tcount"'"'`
-
-	  if test $PRELUDEPID -ne 0;
-	  then
-	      kill $PRELUDEPID
-	  fi
-
-	done
-	    
-	return 0
-}
-
-testrun1e ()
-{
-    log_start "RUN STANDALONE W/PORTCHECK"
-    testrun_internal_1e
-    log_end "RUN STANDALONE W/PORTCHECK"
-    return 0
-}
-
-
Index: trunk/test/testrun_1f.sh
===================================================================
--- trunk/test/testrun_1f.sh	(revision 591)
+++ 	(revision )
@@ -1,292 +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.
-#
-
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-
-# --enable-login-watch --enable-xml-log 
-# --enable-debug --enable-suidcheck --with-prelude
-
-BUILDOPTS="--quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug --with-gpg=/usr/bin/gpg --with-keyid=0x8A0B337A  --with-fp=DCCBBB6625591ECE2B8F3AC94ED99E4E8A0B337A"
-export BUILDOPTS
-
-BASE="${PW_DIR}/testrun_testdata"; export BASE
-TDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; export TDIRS
-TFILES="x y z"; export TFILES
-
-###########################################################
-#
-# ---- [Define tests here] ----
-#
-
-# 1 for testing new tests
-testrun1_setup=0
-
-MAXTEST=17; export MAXTEST
-
-TESTPOLICY_17="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_17 () {
-    one_sec_sleep
-    rm "${BASE}/a/a/c/x"   # delete 
-}
-
-TESTPOLICY_16="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_16 () {
-    one_sec_sleep
-    echo "foobar" > "${BASE}/foo"   # new 
-}
-
-prep_sign_file ()
-{
-    scripts/samhainadmin.pl  -m R $1 >/dev/null
-    scripts/samhainadmin.pl  -k 8A0B337A -m E $1 >/dev/null
-}
-
-
-run_check_CLverify ()
-{
-    if [ "x$1" = "x"  ]; then
-	logsev=debug
-    else
-	logsev=$1
-    fi
-    if test -f ./.samhain_file; then
-	mv ./.samhain_file ./.samhain_file_clverify
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv ./.samhain_file ...";
-	    return 1
-	fi
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "test -f ./.samhain_file ...";
-	return 1
-    fi
-
-    rm -f test_log_valgrind
-
-    ${VALGRIND} ./samhain -p =err --verify-database ./.samhain_file_clverify 2>>test_log_valgrind
- 
-    if test x$? = x0; then
-	if [ "x$2" != "xnullok"  ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "check (1)...";
-	    return 1
-	fi
-    else
-	if [ "x$2" = "xnullok"  ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "check (1)...";
-	    return 1
-	fi
-    fi
-
-    LL=`wc -l test_log_valgrind | awk '{ print $1; }'`
-    if ! test x$LL = x0; then
-	[ -z "$quiet" ]   && log_msg_fail  "check (2)...";
-	[ -z "$quiet" ]   && cat test_log_valgrind
-	return 1
-    fi
-    
-    [ -z "$verbose" ] || log_msg_ok    "check...";
-}
-
-run_update_CLverify ()
-{
-    if test -f ./.samhain_file_clverify; then
-	mv ./.samhain_file_clverify ./.samhain_file
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv ./.samhain_file_clverify ...";
-	    return 1
-	fi
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "test -f ./.samhain_file_clverify ...";
-	return 1
-    fi
-
-    ${VALGRIND} ./samhain -t update -p none -l debug 2>>test_log_valgrind
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "update...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "update...";
-	return 1
-    fi
-}
-
-run_check_after_update_CLverify ()
-{
-    rm -rf $LOGFILE
-
-    run_check_CLverify debug nullok
-}
-
-testrun_internal_CLverify ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
-
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
-
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  >/dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
-
-	tcount=1
-	POLICY=`eval echo '"$'"TESTPOLICY_$tcount"'"'`
-
-	until [ -z "$POLICY" ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_testpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_sign_file  "${RCFILE}"
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_sign_file  ./.samhain_file
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval mod_testdata_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_check_CLverify
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $testrun1_setup -eq 0 ]; then
-	      if [ $errval -eq 0 ]; then
-		  prep_sign_file  "${RCFILE}"
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  run_update_CLverify
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  prep_sign_file  ./.samhain_file
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  run_check_after_update_CLverify
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	  fi
-	  #
-	  let "tcount = tcount + 1" >/dev/null
-	  #
-	  if [ $tcount -eq 10 ]; then
-	      if [ -z "$doall" ]; then
-		  log_skip 10 $MAXTEST 'ACL/SELinux test (or use --really-all)'
-		  log_skip 11 $MAXTEST 'ACL/SELinux test (or use --really-all)'
-		  let "tcount = tcount + 2" >/dev/null
-	      else
-		  # 'id -u' is posix
-		  #
-		  if test -f /usr/xpg4/bin/id
-		  then
-		      my_uid=`/usr/xpg4/bin/id -u`
-		  else
-		      my_uid=`id -u`
-		  fi
-		  #
-		  if [ ${my_uid} -ne 0 ]; then
-		      log_skip 10 $MAXTEST 'ACL/SELinux test (you are not root)'
-		      log_skip 11 $MAXTEST 'ACL/SELinux test (you are not root)'
-		      let "tcount = tcount + 2" >/dev/null
-		  else
-
-		      SETFATTR=`find_path setfattr`
-		      if [ -z "$SETFATTR" ]; then
-			  log_skip 10 $MAXTEST 'ACL/SELinux test (setfattr not in path)'
-			  log_skip 11 $MAXTEST 'ACL/SELinux test (setfattr not in path)'
-			  let "tcount = tcount + 2" >/dev/null
-		      fi
-		  fi
-	      fi
-	  fi
-	  #
-	  POLICY=`eval echo '"$'"TESTPOLICY_$tcount"'"'`
-	done
-	    
-	return 0
-}
-
-testrun1f ()
-{
-    log_start "RUN CL Verify"
-    gpg --list-keys | grep 8A0B337A >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	echo "You need to do 'gpg --import test/gnupg/public-key.asc' first"
-	for ff in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17; do
-	    log_skip $ff $MAXTEST 'CL verify'
-	done
-    else
-	testrun_internal_CLverify
-    fi
-    log_end "RUN CL Verify"
-    return 0
-}
-
-
-
Index: trunk/test/testrun_1g.sh
===================================================================
--- trunk/test/testrun_1g.sh	(revision 591)
+++ 	(revision )
@@ -1,114 +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.
-#
-
-BUILDOPTS="--quiet $TRUST --enable-debug --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-export BUILDOPTS
-
-MAXTEST=1; export MAXTEST
-
-testrun_deltadb ()
-{
-    tcount=1
-
-    if test -r "Makefile"; then
-	$MAKE distclean >/dev/null 
-    fi
-    
-    ${TOP_SRCDIR}/configure ${BUILDOPTS} 
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  >/dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-	
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-
-    prep_init
-    check_err $? ${tcount}; errval=$?
-
-    if [ $errval -eq 0 ]; then
-	prep_testdata
-	check_err $? ${tcount}; errval=$?
-    fi
-    if [ $errval -eq 0 ]; then
-	prep_testpolicy   1
-	check_err $? ${tcount}; errval=$?
-    fi
-
-    rm "${BASE}/a/a/b/x"
-    rm -f file.*.*-*-*-*-*
-
-    ./samhain --create-database=./tmp_list_file
-
-    check_err $? ${tcount}; errval=$?
-    if [ $errval -eq 0 ]; then
-	num=$( ./samhain -a -d file.*.*-*-*-*-* | grep "1970-01-01T00:00:00" >/dev/null | wc -l )
-	if [ $num -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_ok "list...";
-	else
-	    [ -z "$quiet" ] &&       log_msg_fail "list...";
-	    log_fail ${tcount} ${MAXTEST};
-	fi
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "create...";
-	log_fail ${tcount} ${MAXTEST};
-    fi
-
-    if [ $errval -eq 0 ]; then
-	./samhain --verify-database file.*.*-*-*-*-*
-    fi
-
-    check_err $? ${tcount}; errval=$?
-    if [ $errval -eq 0 ]; then
-	echo "o_O" > "${BASE}/a/a/b/y"
-	./samhain --verify-database file.*.*-*-*-*-*
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] &&       log_msg_fail "detect modify...";
-	check_err 1 ${tcount}; errval=1
-    fi
-
-    if [ $errval -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-    fi
-
-    [ -z "$cleanup" ] || rm -f file.*.*-*-*-*-*
-    return 0
-}
-
-testrun1g ()
-{
-    log_start "RUN CL Create DeltaDB"
-
-    testrun_deltadb
-
-    log_end "RUN CL Create DeltaDB"
-    return 0
-}
-
Index: trunk/test/testrun_1h.sh
===================================================================
--- trunk/test/testrun_1h.sh	(revision 591)
+++ 	(revision )
@@ -1,305 +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.
-#
-
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-
-# --enable-login-watch --enable-xml-log 
-# --enable-debug --enable-suidcheck --with-prelude
-
-BUILDOPTS="--quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug"
-export BUILDOPTS
-
-BASE="${PW_DIR}/testrun_testdata"; export BASE
-TDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; export TDIRS
-TFILES="x y z"; export TFILES
-TFILES_PART="c/miss c/add c/change c/leave"; export TFILES_PART
-
-###########################################################
-#
-# ---- [Define tests here] ----
-#
-
-# 1 for testing new tests
-testrun1_setup=0
-
-MAXTEST=5; export MAXTEST
-
-PARTIAL_OUTFILE=".samhain_file_partial"; export PARTIAL_OUTFILE
-PARTIAL_FILTER="c/create c/miss c/change c/leave"; export PARTIAL_FILTER
-
-TEST_PART_POLICY_1="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_partial_1 () {
-    one_sec_sleep
-    rm "${BASE}/a/a/c/x"   # delete 
-}
-EXPECT_1="nullok"
-
-TEST_PART_POLICY_2="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_partial_2 () {
-    one_sec_sleep
-    echo "foobar" > "${BASE}/foo"   # new 
-}
-EXPECT_2="nullok"
-
-TEST_PART_POLICY_3="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_partial_3 () {
-    one_sec_sleep
-    rm -f "${BASE}/c/miss"
-}
-EXPECT_3=""
-
-TEST_PART_POLICY_4="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_partial_4 () {
-    one_sec_sleep
-    echo foo >"${BASE}/c/create"
-}
-EXPECT_4=""
-
-TEST_PART_POLICY_5="
-[ReadOnly]
-dir=${BASE}
-"
-mod_testdata_partial_5 () {
-    one_sec_sleep
-    echo toodledoo >"${BASE}/c/change"
-}
-EXPECT_5=""
-
-#
-# $2 == "nullok" means no mods should be detected,
-# else it is an error to detect no mods
-#
-run_check_partial_verify ()
-{
-    if [ "x$1" = "x"  ]; then
-	logsev=debug
-    else
-	logsev=$1
-    fi
-    if ! test -f ${PARTIAL_OUTFILE}; then
-	[ -z "$quiet" ]   && log_msg_fail  "missing ${PARTIAL_OUTFILE} ...";
-	return 1
-    fi
-
-    rm -f test_log_valgrind
-
-    ${VALGRIND} ./samhain -p =err --verify-database ${PARTIAL_OUTFILE} 2>>test_log_valgrind
- 
-    if test x$? = x0; then
-	if [ "x$2" != "xnullok"  ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "check (1a)...";
-	    return 1
-	fi
-    else
-	if [ "x$2" = "xnullok"  ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "check (1b)...";
-	    return 1
-	fi
-    fi
-
-    LL=`wc -l test_log_valgrind | awk '{ print $1; }'`
-    if ! test x$LL = x0; then
-	[ -z "$quiet" ]   && log_msg_fail  "check (2)...";
-	[ -z "$quiet" ]   && cat test_log_valgrind
-	return 1
-    fi
-    
-    [ -z "$verbose" ] || log_msg_ok    "check...";
-}
-
-run_update_partial_verify ()
-{
-    ${VALGRIND} ./samhain -t update -p none -l debug 2>>test_log_valgrind
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "update...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "update...";
-	return 1
-    fi
-}
-
-run_check_after_update_partial ()
-{
-    rm -rf $LOGFILE
-
-    run_check_partial_verify debug nullok
-}
-
-create_partial ()
-{
-    echo "${BASE}/c" > test_filter.txt
-    for ff in ${TFILES_PART}; do
-	echo "${BASE}/${ff}" >> test_filter.txt
-    done
-
-    ./samhain -o "${PARTIAL_OUTFILE}" --binary --list-filter=test_filter.txt --list-database=./.samhain_file
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "create partial DB...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "create partial DB...";
-	return 1
-    fi
-
-    if test -f "${PARTIAL_OUTFILE}"; then
-	[ -z "$verbose" ] || log_msg_ok    "partial DB exists...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "partial DB exists...";
-	return 1
-    fi
-    rm -f test_filter.txt
-}
-
-prep_partial_testpolicy ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    eval echo '"$'"TEST_PART_POLICY_$1"'"' >>"${RCFILE}"
-}
-
-prep_testdata_partial ()
-{
-    prep_testdata
-    if test x$? = x0; then
-	touch "${BASE}/c/miss"
-	touch "${BASE}/c/change"
-	touch "${BASE}/c/leave"
-    else
-	return 1
-    fi
-}
-
-testrun_internal_partial_verify ()
-{
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
-
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null 
-	fi
-
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 
-
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  >/dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	[ -z "$verbose" ] || { echo; echo "${S}Running test suite${E}"; echo; }
-
-	tcount=1
-	POLICY=`eval echo '"$'"TEST_PART_POLICY_$tcount"'"'`
-
-	until [ -z "$POLICY" ]
-	do
-	  prep_init
-	  check_err $? ${tcount}; errval=$?
-	  if [ $errval -eq 0 ]; then
-	      prep_testdata_partial
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      prep_partial_testpolicy   ${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      run_init
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      create_partial
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      eval mod_testdata_partial_${tcount}
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $errval -eq 0 ]; then
-	      arg2=`eval echo '"$'"EXPECT_$tcount"'"'`
-	      run_check_partial_verify debug $arg2
-	      check_err $? ${tcount}; errval=$?
-	  fi
-	  if [ $testrun1_setup -eq 0 ]; then
-	      if [ $errval -eq 0 ]; then
-		  run_update_partial_verify
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  create_partial
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	      if [ $errval -eq 0 ]; then
-		  run_check_after_update_partial
-		  check_err $? ${tcount}; errval=$?
-	      fi
-	  fi
-	  #
-	  if [ $errval -eq 0 ]; then
-	      [ -z "$quiet" ] && log_ok ${tcount} ${MAXTEST};
-	  fi
-	  #
-	  let "tcount = tcount + 1" >/dev/null
-	  #
-	  POLICY=`eval echo '"$'"TEST_PART_POLICY_$tcount"'"'`
-	done
-	    
-	return 0
-}
-
-testrun1h ()
-{
-    log_start "RUN CL Partial DB Verify"
-    testrun_internal_partial_verify
-    log_end "RUN CL Partial DB Verify"
-    return 0
-}
-
-
-
Index: trunk/test/testrun_1i.sh
===================================================================
--- trunk/test/testrun_1i.sh	(revision 591)
+++ 	(revision )
@@ -1,322 +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.
-#
-
-MAXTEST=4; export MAXTEST
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-
-testrun1b_modrc ()
-{
-        ORIGINAL="\[EOF\]"
-        REPLACEMENT="\[PortCheck\]"
-        ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-
-        echo "PortCheckActive = yes" >>"$RCFILE"
-        echo "PortCheckInterface = 127.0.0.1" >>"$RCFILE"
-}
-
-testrun1b_internal ()
-{
-	BUILDOPTS="$1"
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null >&1
-	fi
-	#
-	# Bootstrapping
-	#
-	${TOP_SRCDIR}/configure >/dev/null 2>/dev/null
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure (bootstrap)..."; 
-		$MAKE  > /dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make (bootstrap)..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make (bootstrap)..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure (bootstrap)...";
-		return 1
-	fi
-	#
-	#
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null
-	#
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	cp ${SCRIPTDIR}/testrc_1i.dyn "$RCFILE"
-	
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy signed config file...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "copy signed config file...";
-	    return 1
-	fi
-
-	if test "x$2" = "x"; then
-	    :
-	else
-	    CONVERT="$2"
-	    if test -f "${TOP_SRCDIR}/stealth_template.jpg"; then
-		[ -z "$verbose" ] || log_msg_ok "convert..."
-		"${CONVERT}" +compress "${TOP_SRCDIR}/stealth_template.jpg" stealth_template.ps >/dev/null
-	    else
-		[ -z "$quiet" ]   && log_msg_fail  "cannot find file stealth_template.jpg"
-		return 1
-	    fi
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
-		return 1
-	    fi
-
-	    [ -z "$verbose" ] || log_msg_ok "hide..."
-	    ./samhain_stealth -s stealth_template.ps "$RCFILE" >/dev/null
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "${CONVERT} +compress ${TOP_SRCDIR}/stealth_template.jpg stealth_template.ps";
-		return 1
-	    fi
-
-	    mv -f stealth_template.ps "$RCFILE"
-	    if [ $? -ne 0 ]; then
-		[ -z "$quiet" ]   && log_msg_fail  "mv -f stealth_template.ps $RCFILE";
-		return 1
-	    fi
-
-	fi
-
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-
-	./samhain -t init -p none -l info
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-	cp ${SCRIPTDIR}/test1i_file.sig $PW_DIR/.samhain_file
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy signed database file...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "copy signed database file...";
-	    return 1
-	fi
-}
-
-testrun1b_nogpg ()
-{
-	BUILDOPTS="$1"
-	#
-	# test standalone compilation
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null >&1
-	fi
-
-	${TOP_SRCDIR}/configure ${BUILDOPTS} 2>/dev/null 
-        #
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>&1
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-
-	cp "${SCRIPTDIR}/testrc_1" "${RCFILE}"
-
-	if test "x$2" = "xmodrc"; then
-	    [ -z "$verbose" ] || log_msg_ok    "mod rc...";
-	    testrun1b_modrc
-	fi
-
-	./samhain -t init -p none -l info
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-}
-
-do_test_1b () {
-
-    ./samhain -t check -p none -l info
-    
-    if test x$? = x0; then
-	./samhain -j -L $LOGFILE >"${LOGFILE}.tmp" && mv "${LOGFILE}.tmp" "${LOGFILE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "mv logfile...";
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "check...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "check...";
-	return 1
-    fi
-    #
-    tmp=`egrep "Checking.*/etc(>|\")" $LOGFILE 2>/dev/null | wc -l`
-    if [ $tmp -ne 2 ]; then
-	[ -z "$verbose" ] || log_msg_fail "/etc";
-	return 1
-    fi
-    tmp=`egrep "Checking.*(>|\")" $LOGFILE 2>/dev/null | wc -l`
-    if [ $tmp -ne 10 ]; then
-	[ -z "$verbose" ] || log_msg_fail "checking";
-	return 1
-    fi
-    egrep "ADDED" $LOGFILE >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "init was incomplete";
-	return 1
-    fi
-    #
-    return 0
-}
-
-testrun1i ()
-{
-    log_start "RUN STANDALONE W/STEALTH W/SIGNIFY"
-    SIGNIFY=`find_path signify-openbsd`
-    if [ -z "$SIGNIFY" ]; then
-	SIGNIFY=`find_path signify`
-    fi
-    if [ -z "$SIGNIFY" ]; then
-	log_skip 1 $MAXTEST 'signify not found in $PATH'
-	log_skip 2 $MAXTEST 'signify not found in $PATH'
-	log_skip 3 $MAXTEST 'signify not found in $PATH'
-	log_skip 4 $MAXTEST 'signify not found in $PATH'
-    else
-	eval "ls ~/.signify/samhain.pub >/dev/null 2>/dev/null"
-	if [ $? -ne 0 ]; then
-	    log_skip 1 $MAXTEST 'public key ~/.signify/samhain.pub not present'
-	    log_skip 2 $MAXTEST 'public key ~/.signify/samhain.pub not present'
-	    log_skip 3 $MAXTEST 'public key ~/.signify/samhain.pub not present'
-	    log_skip 4 $MAXTEST 'public key ~/.signify/samhain.pub not present'
-	else
-	    #
-	    # -------------  first test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-signify=${SIGNIFY} --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   1 $MAXTEST 'signify signed config/database files'
-	    else
-		log_fail 1 $MAXTEST 'signify signed config/database files'
-	    fi
-
-
-	    #
-	    # -------------  second test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-signify=${SIGNIFY} --with-checksum --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   2 $MAXTEST 'signify signed config/database files'
-	    else
-		log_fail 2 $MAXTEST 'signify signed config/database files'
-	    fi
-
-
-	    #
-	    # -------------  third test -------------
-	    #
-	    BUILDOPTS="--quiet $TRUST --enable-debug --with-signify=${SIGNIFY} --with-checksum --with-pubkey-checksum=62F3EAE3CD9BA8849015060750908790B6326015A20AC0DA --enable-micro-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-	    testrun1b_internal "${BUILDOPTS}" 
-	    do_test_1b
-	    if [ $? -eq 0 ]; then
-		log_ok   3 $MAXTEST 'signify signed config/database files'
-	    else
-		log_fail 3 $MAXTEST 'signify signed config/database files'
-	    fi
-
-
-	    #
-	    # -------------  fourth test -------------
-	    #
-	    PRECONV=`find_path convert`
-	    "${PRECONV}" --help | grep  ImageMagick >/dev/null 2>&1 && \
- 		CONVERT="${PRECONV}"
-
-	    if [ -z "$CONVERT" ]; then
-		log_skip 2 $MAXTEST 'ImageMagick convert not found in $PATH'
-	    else
-		BUILDOPTS="--quiet $TRUST --enable-debug --with-signify=${SIGNIFY} --with-checksum --enable-stealth=137 --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file"
-		testrun1b_internal "${BUILDOPTS}" "$CONVERT"
-		do_test_1b
-		if [ $? -eq 0 ]; then
-		    log_ok   4 $MAXTEST 'signify signed config/database files'
-		else
-		    log_fail 4 $MAXTEST 'signify signed config/database files'
-		fi
-	    fi
-
-	fi
-    fi
-    log_end "RUN STANDALONE W/STEALTH W/SIGNIFY"
-    return 0
-}
-
Index: trunk/test/testrun_2.sh
===================================================================
--- trunk/test/testrun_2.sh	(revision 591)
+++ trunk/test/testrun_2.sh	(revision 1)
@@ -1,631 +1,66 @@
 #! /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.
-#
 
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-HTML="$PW_DIR/yule.html";  export HTML
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
+PW_DIR=`pwd`
 
-do_test_1 () {
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
+echo; echo "${S}__ STARTING TEST RUN CLIENT/SERVER __${E}"; echo;
+echo Working directory: $PW_DIR
 
-	rm -f test_log_valgrind
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
 
-	${VALGRIND} ./yule.2 -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y2=$!
-	five_sec_sleep
+echo MAKE is $MAKE
+echo
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server #2${E}: ./yule.2 -l info -p none &"; 
-	    echo; 
-	}
+# --with-database=postgresql
+# export MYLIB=-L/usr/local/pgsql/lib
+# export MYINC=-I/usr/local/pgsql/include
+# export LD_LIBRARY_PATH=/usr/local/pgsql/lib
 
-	${VALGRIND} ./yule -l info -p none -e info --bind-address=127.0.0.1 \
-	    --server-port=49778 >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
+# --with-database=mysql
+# export MYLIB=-L/usr/local/mysql/lib
+# export MYINC=-I/usr/local/mysql/include
+# export LD_LIBRARY_PATH=/usr/local/mysql/lib
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./samhain.new -t check -p none -l none -e info --bind-address=127.0.0.1 >/dev/null 2>>test_log_valgrind
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    kill $PROC_Y
-	    kill $PROC_Y2
-	    return 1
-	fi
-
-	kill $PROC_Y
-	kill $PROC_Y2
-	five_sec_sleep
-
-	# cp ${LOGFILE}  triple_test
-	# cp ${LOGFILE}2 triple_test_2
-
-	egrep "START(>|\").*Yule(>|\")" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server #2 start";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (relayed)";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit (relayed)";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server #2 exit";
-	    return 1
-	fi
-
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-
-	return 0
-}
-
-do_test_2 () {
-
-        ORIGINAL="UseSeparateLogs=no"
-	REPLACEMENT="UseSeparateLogs=yes"
-        ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-# :%s is the "ex" substitution command.
-# :wq is write-and-quit.
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-
-	rm -f $LOGFILE
-	rm -f test_log_valgrind
-
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./samhain.new -t check -p none -l none -e info --bind-address=127.0.0.1 >/dev/null 2>>test_log_valgrind
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	kill $PROC_Y
-	five_sec_sleep
-
-	if [ -f ${LOGFILE}.${SH_LOCALHOST} ]; then
-	    remhost=${SH_LOCALHOST}
-	else
-	    remhost=`echo $SH_LOCALHOST | sed 's,\..*,,'`
-	fi
-	if [ -f ${LOGFILE}.${remhost} ]; then
-	    CLIENTLOG="${LOGFILE}.${remhost}"
-	else
-	    tail -n 1 ${SCRIPTDIR}/test.sh >/dev/null 2>&1
-	    if [ $? -eq 0 ]; then
-		CLIENTLOG=`ls -1 ${LOGFILE}.* 2>/dev/null | tail -n 1`
-	    else
-		CLIENTLOG=`ls -1 ${LOGFILE}.* 2>/dev/null | tail -1`
-	    fi
-	fi
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" ${CLIENTLOG} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" ${CLIENTLOG} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-	
-	rm -f ${LOGFILE}.${remhost}
-	return 0
-}
-
-do_test_3 () {
-
-        ORIGINAL_1="ExportSeverity=none"
-        REPLACEMENT_1="ExportSeverity=mark"
-	ORIGINAL_2="UseSeparateLogs=yes"
-	REPLACEMENT_2="UseSeparateLogs=no"
-	ORIGINAL_3="LogSeverity=none"
-	REPLACEMENT_3="LogSeverity=debug"
-	ORIGINAL_4="# SetClientTimeLimit=1800"
-	REPLACEMENT_4="SetClientTimeLimit=20"
-	# takes too much time if we leave that in
-	ORIGINAL_5="dir=1"
-	REPLACEMENT_5="#dir=1"
-        ex -s $RCFILE <<EOF
-%s/${ORIGINAL_1}/${REPLACEMENT_1}/g
-%s/${ORIGINAL_2}/${REPLACEMENT_2}/g
-%s/${ORIGINAL_3}/${REPLACEMENT_3}/g
-%s/${ORIGINAL_4}/${REPLACEMENT_4}/g
-%s/${ORIGINAL_5}/${REPLACEMENT_5}/g
-wq
-EOF
-# :%s is the "ex" substitution command.
-# :wq is write-and-quit.
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -p none -e none &"; 
-	    echo; 
-	}
-
-	rm -f $LOGFILE
-	rm -f test_log_valgrind
-
-	${VALGRIND} ./yule -p none -e none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -t check -p none -l none --forever --bind-address=127.0.0.1 &"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./samhain.new -t check -p none -l none --forever --bind-address=127.0.0.1 >/dev/null 2>>test_log_valgrind &
-	if test x$? = x0; then
-	    PROC_S=$!
-	    # echo "PID is ${PROC_S}"
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	    five_sec_sleep
-	    # Redirect the shells (un-)helpful job monitoring messages.
-	    # The 'disown' buildin is not portable. 
-	    { kill -9 ${PROC_S}; sleep 40; } >/dev/null 2>&1
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	if [ -t 0 ]; then
-	    # enable monitor mode again if interactive
-	    set -m
-	fi
-
-	kill $PROC_Y
-	five_sec_sleep
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "remote_host.*File check completed.*" ${LOGFILE} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "Time limit exceeded" ${LOGFILE} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client dead detection";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-	
-	rm -f ${LOGFILE}
-	return 0
-}
-
-do_test_4 () {
-
-        # don't know what is supported on the test platform, so
-        # prepare for both (password and socket credential)
-
-        # 'id -u' is posix
-        if test -f /usr/xpg4/bin/id
-	then
-	    me=`/usr/xpg4/bin/id -u`
-	else
-	    me=`id -u`
-	fi
-
-	ORIGINAL_1="SetSocketAllowUid=0"
-	REPLACEMENT_1="SetSocketAllowUid=$me"
-        ex -s $RCFILE <<EOF
-%s/${ORIGINAL_1}/${REPLACEMENT_1}/g
-wq
-EOF
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-
-	rm -f $LOGFILE
-	rm -f test_log_valgrind
-
-	${VALGRIND} ./yule -l info -p none -e none \
-	    >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check"; 
-	    echo; 
-	}
-
-	$MAKE yulectl >/dev/null 
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "make yulectl";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-
-	./yulectl -v -c RELOAD foobar1 >test_log_yulectl 2>/dev/null
-
-	if [ $? -ne 0 ]; then 
-	    YULECTL_PASSWORD=samhain; export YULECTL_PASSWORD
-	    ./yulectl -v -c RELOAD foobar1 >test_log_yulectl
-	    if [ $? -ne 0 ]; then
-		kill ${PROC_Y}
-		[ -z "$verbose" ] || log_msg_fail "yulectl";
-		return 1
-	    fi
-	fi
-
-	./yulectl -v -c RELOAD foobar2 >test_yulectl_log
-
-	if [ $? -ne 0 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "yulectl";
-	    return 1
-	fi
-
-	./yulectl -v -c RELOAD foobar3 >test_log_yulectl
-
-	if [ $? -ne 0 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "yulectl";
-	    return 1
-	fi
-
-	./yulectl -v -c LISTALL dummy >test_log_yulectl
-
-	if [ $? -ne 0 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "yulectl";
-	    return 1
-	fi
-
-	tmp=`cat test_log_yulectl | grep RELOAD | wc -l`
-	if [ $tmp -ne 3 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "command confirmation";
-	    return 1
-	fi
-
-	./yulectl -v -c CANCEL foobar3 >test_log_yulectl
-
-	if [ $? -ne 0 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "yulectl";
-	    return 1
-	fi
-
-	./yulectl -v -c LISTALL dummy >test_log_yulectl
-
-	if [ $? -ne 0 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "yulectl";
-	    return 1
-	fi
-
-	tmp=`cat test_log_yulectl | grep RELOAD | wc -l`
-	if [ $tmp -ne 2 ]; then
-	    kill ${PROC_Y}
-	    [ -z "$verbose" ] || log_msg_fail "command confirmation";
-	    return 1
-	fi
-
-	kill ${PROC_Y}
-	one_sec_sleep
-	one_sec_sleep
-	kill -9 ${PROC_Y} >/dev/null 2>&1
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-	
-	return 0
-}
-
-do_test_5 () {
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-
-( cat <<EOF
-<!-- head -->
-<html><head><title>test</title></head>
-<body>
-Current time: %T <br>
-<table>
-<!-- ehead -->
-EOF
-) >head.html
-
-( cat <<EOF
-<!-- foot -->
-</table>
-</body>
-<!-- efoot -->
-EOF
-) >foot.html
-
-( cat <<EOF
-<!-- entry -->
-<tr>
-  <td>%H</td>
-  <td>%S</td>
-  <td>%T</td>
-</tr>
-<!-- eentry -->
-EOF
-) >entry.html
-
-	${VALGRIND} ./yule -l info -p none -e none \
-	    >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	egrep '<!-- head -->' $HTML >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    # rm -f head.html; rm -f foot.html; rm -f entry.html;
-	    kill $PROC_Y
-	    [ -z "$verbose" ] || log_msg_fail "head.html (1)";
-	    return 1
-	fi
-
-	egrep '<!-- foot -->' $HTML >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    rm -f head.html; rm -f foot.html; rm -f entry.html;
-	    kill $PROC_Y
-	    [ -z "$verbose" ] || log_msg_fail "foot.html (1)";
-	    return 1
-	fi
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./samhain.new -t check -p none -l none -e info --bind-address=127.0.0.1 >/dev/null 2>>test_log_valgrind
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	else
-	    kill $PROC_Y
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    return 1
-	fi
-
-	cp $HTML  ${HTML}.tmp
-
-	kill $PROC_Y
-	five_sec_sleep
-
-	# rm -f head.html; rm -f foot.html; rm -f entry.html;
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-
-	egrep '<!-- head -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "head.html";
-	    return 1
-	fi
-	egrep '<!-- ehead -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "end head.html";
-	    return 1
-	fi
-
-	egrep '<!-- entry -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "entry.html";
-	    return 1
-	fi
-	egrep '<!-- eentry -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "end entry.html";
-	    return 1
-	fi
-
-	egrep '<!-- foot -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "foot.html";
-	    return 1
-	fi
-	egrep '<!-- efoot -->' ${HTML}.tmp >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "end foot.html";
-	    return 1
-	fi
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-
-	rm ${HTML}.tmp
-
-	return 0
-}
-
-
-testrun2_internal ()
+testrun2 ()
 {
-        [ -z "$verbose" ] || { 
-	    echo; 
-	    echo Working directory: $PW_DIR; echo MAKE is $MAKE; 
-	    echo; 
-	}
 	#
+	# test standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
+	echo "${S}Building client and server${E}"; echo;
 	#
 	if test -r "Makefile"; then
@@ -633,69 +68,48 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=client  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-encrypt=2 --enable-static
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-network=client  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_2  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-encrypt=2
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	# save binary and build server2
-	#
-	cp samhain samhain.build || return 1
-	$MAKE clean >/dev/null || return 1
-
-	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=${RCFILE}2  --with-log-file=${LOGFILE}2 --with-pid-file=$PW_DIR/.samhain_lock2 --with-html-file=${HTML}2 --with-state-dir=$PW_DIR --enable-encrypt=2 --with-port=49778
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
 	# save binary and build server
 	#
-	cp yule yule.2 || return 1
-	$MAKE clean >/dev/null || return 1
+	cp samhain samhain.build
+	make clean
 
-	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-html-file=$HTML --with-state-dir=$PW_DIR --enable-encrypt=2
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_2  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-identity=rainer --enable-encrypt=2
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
-
 
 	#####################################################################
 	#
 	#
+	echo "${S}Initialize database${E}"; echo;
+
 	rm -f ./.samhain_file
 	rm -f ./.samhain_log
@@ -704,12 +118,8 @@
 	cp ${SCRIPTDIR}/testrc_2.in testrc_2
 
-	./samhain.build -t init -p none
+	echo "./samhain.build -t init"
+	./samhain.build -t init
 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
+	SHINI=$?
 
 	# Create a password
@@ -717,112 +127,64 @@
 	SHPW=`./yule -G`
 	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
+	    echo "password not generated -- aborting"
+	    exit 1
 	fi
 
 	# Set in client
 
-	./samhain_setpwd samhain.build new $SHPW >/dev/null
+	echo "./samhain_setpwd samhain.build new $SHPW"
+	./samhain_setpwd samhain.build new $SHPW
 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
+	mv samhain.build.new  samhain.new
+
+	rm -f ./.samhain_log.*
+	rm -f ./.samhain_lock
+
+	SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%`
+
+ 	echo $SHCLT >> testrc_2
+
+	if test x$SHINI = x0; then
+		echo; echo "${S}Start Server${E}: ./yule  &"; echo;
+		./yule -l info &
+		PROC_Y=$!
+		sleep 5
+
+		echo; echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check";
+
+		./samhain.new -t check -p none -l none -e info
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    kill $PROC_Y
+		    exit
+		fi
+
+		kill $PROC_Y
+		sleep 5
 	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	    return 1
+		echo "${S}ERROR:${E} -- init -- failed, exit status $SHINI"; 
+		echo;
+		exit
 	fi
-
-	mv samhain.build.new  samhain.new || return 1
-
-	# Set in server
-
-	./samhain_setpwd yule new $SHPW >/dev/null
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd yule new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd yule new $SHPW";
-	    return 1
-	fi
-
-	mv yule.new yule || return 1
-
-	#
-
-	rm -f ./.samhain_log*
-	rm -f ./.samhain_lock*
-
-	SHCLT=`./yule -P $SHPW`
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	    return 1
-	fi
-
-	SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-	AHOST=`find_hostname`
-	SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
-
- 	echo $SHCLT1 >> testrc_2
- 	echo $SHCLT2 >> testrc_2
-	cp testrc_2 testrc_22
-
-	do_test_1
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client logging";
-	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client logging";
-	fi
-
-	do_test_2
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   2 ${MAXTEST} "Client logging, separate logfiles";
-	else
-	    [ -z "$quiet" ] && log_fail 2 ${MAXTEST} "Client logging, separate logfiles";
-	fi
-
-	do_test_3
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   3 ${MAXTEST} "Dead client detection";
-	else
-	    [ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Dead client detection";
-	fi
-
-	do_test_4
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   4 ${MAXTEST} "Server command socket";
-	else
-	    [ -z "$quiet" ] && log_fail 4 ${MAXTEST} "Server command socket";
-	fi
-
-	do_test_5
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   5 ${MAXTEST} "Server status file";
-	else
-	    [ -z "$quiet" ] && log_fail 5 ${MAXTEST} "Server status file";
-	fi
-
-	return $?
+	    
 }
 
-MAXTEST=5; export MAXTEST
+    if test x$1 = x; then
+	echo
+	echo "Please provide the local hostname as argument."
+	echo
+	exit 8
+    fi
 
-testrun2 ()
-{
-    log_start "RUN CLIENT/SERVER"
+    SH_LOCALHOST=$1; export SH_LOCALHOST
 
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    testrun2_internal
-    #
-    log_end "RUN CLIENT/SERVER"
+    testrun2
 
-    return 0
-}
 
+echo; echo "${S}__ END TEST RUN CLIENT/SERVER __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_2a.sh
===================================================================
--- trunk/test/testrun_2a.sh	(revision 591)
+++ trunk/test/testrun_2a.sh	(revision 1)
@@ -1,109 +1,58 @@
 #! /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.
-#
 
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --enable-debug=gdb"; export SERVER_BUILDOPTS
+PW_DIR=`pwd`
 
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --enable-suidcheck --enable-debug"; export CLIENT_BUILDOPTS
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
 
-do_test_1_a () {
+echo; echo "${S}__ STARTING TEST RUN CLIENT/SERVER __${E}"; echo;
+echo Working directory: $PW_DIR
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-	rm -f test_log_valgrind
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
 
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
+echo MAKE is $MAKE
+echo
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check --bind-address=127.0.0.1 --server-host=localhost"; 
-	    echo; 
-	}
 
-	${VALGRIND} ./samhain.new -t check -p none -l none -e info --bind-address=127.0.0.1 --server-host=localhost >/dev/null 2>>test_log_valgrind
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    kill $PROC_Y
-	    return 1
-	fi
 
-	kill $PROC_Y
-	five_sec_sleep
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "Checking.*/etc" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "EXIT.*Samhain" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-	
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-
-	return 0
-}
-
-testrun2a_internal ()
+testrun2a ()
 {
-        [ -z "$verbose" ] || { 
-	    echo; 
-	    echo Working directory: $PW_DIR; echo MAKE is $MAKE; 
-	    echo; 
-	}
 	#
+	# test standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
+	echo "${S}Building client and server${E}"; echo;
 	#
 	if test -r "Makefile"; then
@@ -111,51 +60,50 @@
 	fi
 	#
-	${TOP_SRCDIR}/configure ${CLIENT_BUILDOPTS}
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock 
 	#
-	# Limit suid check
-	#
-	BASE="${PW_DIR}"; export BASE
+	# --disable-encrypt
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  'DBGDEF=-DSH_SUIDTESTDIR=\"${BASE}\"' > /dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
 	# save binary and build server
 	#
-	cp samhain samhain.build || return 1
-	$MAKE clean >/dev/null || return 1
+	cp samhain samhain.build
+	make clean
 
-	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
+	#
+	${TOP_SRCDIR}/configure --quiet  $TRUST  --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock
+	# --enable-identity=rainer
+	# --with-libwrap
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "$MAKE completed, exit status $?"; echo;
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
 		fi
 
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
+	echo "${S}Initialize database${E}"; echo;
 
-	#####################################################################
-	#
-	#
 	rm -f ./.samhain_file
 	rm -f ./.samhain_log
@@ -163,17 +111,11 @@
 	rm -f ./rc.${SH_LOCALHOST}
 	rm -f ./file.${SH_LOCALHOST}
-	rm -f  "./rc.${ALTHOST}"
-	rm -f  "./file.${ALTHOST}"
 
 	cp ${SCRIPTDIR}/testrc_2.in testrc_2
 
-	./samhain.build -t init -p none
+	echo "./samhain.build -t init"
+	./samhain.build -t init
 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
+	SHINI=$?
 
 	# Create a password
@@ -181,122 +123,67 @@
 	SHPW=`./yule -G`
 	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
+	    echo "password not generated -- aborting"
+	    exit 1
 	fi
 
 	# Set in client
 
-	./samhain_setpwd samhain.build new $SHPW >/dev/null
+	echo "./samhain_setpwd samhain.build new $SHPW"
+	./samhain_setpwd samhain.build new $SHPW
 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	    return 1
-	fi
+	mv samhain.build.new  samhain.new
 
-	mv samhain.build.new  samhain.new || return 1
-
-	rm -f ./.samhain_log*
+	rm -f ./.samhain_log
 	rm -f ./.samhain_lock
-
-	SHCLT=`./yule -P $SHPW`
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	    return 1
-	fi
-
-	SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-	AHOST=`find_hostname`
-	SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
-
- 	echo $SHCLT1 >> testrc_2
- 	echo $SHCLT2 >> testrc_2
-
 
 	cp    ./testrc_2       ./rc.${SH_LOCALHOST}
 	mv    ./.samhain_file  ./file.${SH_LOCALHOST}
-	chmod 644 ./rc.${SH_LOCALHOST}
-	chmod 644 ./file.${SH_LOCALHOST}
 
-	ALTHOST=`find_hostname`
-	cp    ./testrc_2       "./rc.${ALTHOST}"
-	cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-	chmod 644 ./rc.${ALTHOST}
-	chmod 644 ./file.${ALTHOST}
+	SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%`
 
-	echo $SHPW > ./testpw
+ 	echo $SHCLT >> testrc_2
+
+	if test x$SHINI = x0; then
+		echo; echo "${S}Start Server${E}: ./yule  &"; echo;
+		./yule -q &
+		PROC_Y=$!
+		sleep 5
+
+		echo; echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check";
+
+		./samhain.new -t check -p none -l none -e info 
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    kill $PROC_Y
+		    exit
+		fi
+
+		kill $PROC_Y
+		sleep 5
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $SHINI"; 
+		echo;
+		exit
+	fi
+	    
 }
 
-MAXTEST=4; export MAXTEST
+    if test x$1 = x; then
+	echo
+	echo "Please provide the local hostname as argument."
+	echo
+	exit 8
+    fi
 
-testrun2a ()
-{
-    log_start "RUN FULL CLIENT/SERVER";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
     SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    testrun2a_internal
-    do_test_1_a
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client download+logging";
-    else
-	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client download+logging";
-    fi
-    ####### EXIT HERE FOR TESTING ######
-    #
-    #
-    SERVER_BUILDOPTS_ORIG="${SERVER_BUILDOPTS}"
-    CLIENT_BUILDOPTS_ORIG="${CLIENT_BUILDOPTS}"
-    #
-    SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --disable-srp"; export SERVER_BUILDOPTS
-    CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --disable-srp"; export CLIENT_BUILDOPTS
-    #
-    testrun2a_internal
-    do_test_1_a
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   2 ${MAXTEST} "SRP disabled";
-    else
-	[ -z "$quiet" ] && log_fail 2 ${MAXTEST} "SRP disabled";
-    fi
-    #
-    SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --disable-encrypt"; export SERVER_BUILDOPTS
-    CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --disable-encrypt"; export CLIENT_BUILDOPTS
-    #
-    testrun2a_internal
-    do_test_1_a
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   3 ${MAXTEST} "Encryption disabled";
-    else
-	[ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Encryption disabled";
-    fi
-    #
-    SERVER_BUILDOPTS="${SERVER_BUILDOPTS_ORIG} --disable-ipv6"; export SERVER_BUILDOPTS
-    CLIENT_BUILDOPTS="${CLIENT_BUILDOPTS_ORIG} --disable-ipv6"; export CLIENT_BUILDOPTS
-    #
-    testrun2a_internal
-    do_test_1_a
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   4 ${MAXTEST} "IPv6 disabled";
-    else
-	[ -z "$quiet" ] && log_fail 4 ${MAXTEST} "IPv6 disabled";
-    fi
-    #
-    if [ -n "$cleanup" ]; then
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./file.${SH_LOCALHOST}
-	ALTHOST=`find_hostname`
-	rm -f "./file.${ALTHOST}"
-	rm -f "./rc.${ALTHOST}"
-    fi
-    #
-    log_end "RUN FULL CLIENT/SERVER"
-}
+
+    testrun2a
+
+
+echo; echo "${S}__ END TEST RUN CLIENT/SERVER __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_2b.sh
===================================================================
--- trunk/test/testrun_2b.sh	(revision 591)
+++ trunk/test/testrun_2b.sh	(revision 1)
@@ -1,215 +1,221 @@
 #! /bin/sh
 
+
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
+
+PW_DIR=`pwd`
+
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+TEST_MYSQL=
+# TEST_MYSQL=" --with-database=mysql --with-libs=-L/usr/local/mysql/lib "
+export TEST_MYSQL
+
+echo; echo "${S}__ STARTING TEST RUN CLIENT/SERVER W/GPG __${E}"; echo;
+echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
+
+echo MAKE is $MAKE
+echo
+
+# $GPG_PATH _must_ be an absolute path
 #
-# 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.
-#
-
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-RCFILE_C="$PW_DIR/testrc_1.dyn";  export RCFILE_C
-
-SERVER_BUILDOPTS="--quiet  $TRUST  --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export SERVER_BUILDOPTS
-
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-micro-stealth=137 --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER${RCFILE_C} --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS
-
-testrun2b_internal ()
-{
-    GPG="$1"
-
-    [ -z "$verbose" ] || { 
-	echo; 
-	echo Working directory: $PW_DIR; echo MAKE is $MAKE; echo GPG is $GPG;
-	echo; 
-    }
-
-    [ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-
-    if test -r "Makefile"; then
-	$MAKE distclean
+if test x${GPG_PATH} = x; then
+    GPG_PATH=`which gpg | sed -e "s%\([a-z:]\) .*%\1%g"`
+fi
+
+if test x${GPG_PATH} = x; then
+    echo "ERROR: gpg (GnuPG) not found"
+    exit
+else
+    GPG_OK=`echo ${GPG_PATH} | sed -e "s%\(/.*\)%OK%g"`
+    if test x${GPG_OK} = xOK; then
+        echo "GPG_PATH is ${GPG_PATH}"
+    else
+        echo "ERROR: GPG_PATH (${GPG_PATH}) is _not_ an absolute path."
+        echo
+        echo "  Apparently the command 'which gpg' did not yield an absolute path."
+        echo "  You can fix the problem by setting the environment variable GPG_PATH"
+        echo "  to the absolute path to gpg (GnuPG) and start the test again."
+        exit
     fi
-
-    ${TOP_SRCDIR}/configure --with-gpg=${GPG} --with-checksum=no ${CLIENT_BUILDOPTS} >/dev/null 2>&1
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  > /dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-    
-    SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' ${SCRIPTDIR}/test.sh`
-    
-    tail -n "+$SKIP" ${SCRIPTDIR}/test.sh >/dev/null 2>&1
-    if [ $? -eq 0 ]; then
-	tail -n "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - &&  \
-	    mv "./testrc.gpg.asc" "${RCFILE_C}"
-    else
-	tail "+$SKIP" ${SCRIPTDIR}/test.sh | gunzip -c - 2>/dev/null | tar xf - &&  \
-	    mv "./testrc.gpg.asc" "${RCFILE_C}"
-    fi
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "extract gpg signed files...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "extract gpg signed files...";
-	return 1
-    fi
-
-    # save binary and build server
-
-    cp samhain samhain.build || return 1
-    $MAKE clean >/dev/null || return 1
-    
-    ${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  > /dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-	
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-    
-    
-    #####################################################################
-    #
-    #
-    rm -f ./.samhain_file
-    rm -f ./.samhain_log
-    rm -f ./.samhain_lock
-    rm -f ./rc.${SH_LOCALHOST}
-    rm -f ./file.${SH_LOCALHOST}
-    
-    cp ${SCRIPTDIR}/testrc_2.in testrc_2
-    
-    ./samhain.build -t init -p none
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "init...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "init...";
-	return 1
-    fi
-    
-    # Create a password
-
-    SHPW=`./yule -G`
-    if test x"$SHPW" = x; then
-	[ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	return 1
-    fi
-    
-    # Set in client
-    
-    ./samhain_setpwd samhain.build new $SHPW >/dev/null
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	return 1
-    fi
-    
-    mv samhain.build.new  samhain.new || return 1
-    
-    rm -f ./.samhain_log*
-    rm -f ./.samhain_lock
-    
-    SHCLT=`./yule -P $SHPW`
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	return 1
-    fi
-    
-    SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-    AHOST=`find_hostname`
-    SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
-
-    echo $SHCLT1 >> testrc_2
-    echo $SHCLT2 >> testrc_2
-
-    
-    cp    "${RCFILE_C}"              ./rc.${SH_LOCALHOST}
-    mv    $PW_DIR/.samhain_file.asc  ./file.${SH_LOCALHOST}
-
-    ALTHOST=`find_hostname`
-    cp    "${RCFILE_C}"          "./rc.${ALTHOST}"
-    cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-}
-
-MAXTEST=1; export MAXTEST
+fi
+
+echo
 
 testrun2b ()
 {
-    log_start "RUN FULL CLIENT/SERVER W/GPG";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
+	#
+	# test standalone compilation
+	#
+	echo "${S}Building client and server${E}"; echo;
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean
+	fi
+        #
+        GPG_HASH=`${GPG_PATH} --load-extension tiger --print-md TIGER192 ${GPG_PATH}`
+        #
+        echo GPG_HASH is ${GPG_HASH}
+        #
+	${TOP_SRCDIR}/configure --quiet  $TRUST --with-gpg=${GPG_PATH} --enable-xml-log --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2.signed --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock 
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
+	else
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
+	fi
+
+	# save binary and build server
+	#
+	cp samhain samhain.build
+	make clean
+
+        #
+	${TOP_SRCDIR}/configure --quiet  $TRUST --with-gpg=${GPG_PATH} --enable-xml-log ${TEST_MYSQL} --enable-debug --enable-network=server --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2.signed --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --enable-identity=rainer
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
+	else
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
+	fi
+	echo "${S}Initialize database${E}"; echo;
+
+	rm -f ./.samhain_file
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+	rm -f ./rc.${SH_LOCALHOST}
+	rm -f ./file.${SH_LOCALHOST}
+
+	cp ${SCRIPTDIR}/testrc_2.in testrc_2.signed
+
+	# Create a password
+	SHPW=`./yule -G`
+	if test x"$SHPW" = x; then
+	    echo "password not generated -- aborting"
+	    exit 1
+	fi
+
+	# Set in client
+	echo "./samhain_setpwd samhain.build new $SHPW"
+	./samhain_setpwd samhain.build new $SHPW
+	mv samhain.build.new samhain.new
+	SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%`
+ 	echo $SHCLT >> testrc_2.signed
+
+        echo "--- You need to sign the config file testrc_2.signed now ---"
+        echo
+        ${GPG_PATH} -a --clearsign --not-dash-escaped $PW_DIR/testrc_2.signed
+        mv $PW_DIR/testrc_2.signed.asc $PW_DIR/testrc_2.signed
+
+	echo "./samhain.new -t init"
+	./samhain.new -t init
+
+	SHINI=$?
+
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+
+	cp    ./testrc_2.signed       ./rc.${SH_LOCALHOST}
+	mv    ./.samhain_file         ./file.${SH_LOCALHOST}
+
+	if test x$SHINI = x0; then
+                echo
+                echo "--- You need to sign the database file.${SH_LOCALHOST} now ---"
+                echo
+                ${GPG_PATH} -a --clearsign --not-dash-escaped $PW_DIR/file.${SH_LOCALHOST}
+                mv $PW_DIR/file.${SH_LOCALHOST}.asc $PW_DIR/file.${SH_LOCALHOST}
+
+		echo; echo "${S}Start Server${E}: ./yule  &"; echo;
+		./yule &
+		PROC_Y=$!
+		sleep 5
+
+		echo; echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check";
+
+		./samhain.new -t check -p none -l none -e info 
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    kill $PROC_Y
+		    exit
+		fi
+
+		kill $PROC_Y
+		sleep 5
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $SHINI"; 
+		echo;
+		exit
+	fi
+	    
+}
+
+    if test x$1 = x; then
+	echo
+	echo "Please provide the local hostname as argument."
+	echo
+	exit 8
     fi
-    #
-    GPG=`find_path gpg`
-    if [ -z "$GPG" ]; then
-	log_skip 1 $MAXTEST 'gpg not found in $PATH'
-    else
-	eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null
-	if [ $? -ne 0 ]; then
-	    log_skip 1 $MAXTEST 'public PGP key 0x0F571F6C not present'
-	else
-	    
-	    SH_LOCALHOST=$1; export SH_LOCALHOST
-    
-	    testrun2b_internal "$GPG"
-
-	    SAVE_VALGRIND="${VALGRIND}"; VALGRIND=''; export VALGRIND
-	    do_test_1_a
-	    VALGRIND="${SAVE_VALGRIND}"; export VALGRIND 
-	    if [ $? -eq 0 ]; then
-		[ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client download+logging w/gpg";
-	    else
-		[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client download+logging w/gpg";
-	    fi
-    
-	    if [ -n "$cleanup" ]; then
-		rm -f ./rc.${SH_LOCALHOST}
-		rm -f ./file.${SH_LOCALHOST}
-		ALTHOST=`find_hostname`
-		rm -f "./file.${ALTHOST}"
-		rm -f "./rc.${ALTHOST}"
-	    fi
-	fi
-    fi
-    log_end "RUN FULL CLIENT/SERVER W/GPG"
-}
-
+
+    SH_LOCALHOST=$1; export SH_LOCALHOST
+
+    testrun2b
+
+
+echo; echo "${S}__ END TEST RUN CLIENT/SERVER W/GPG __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_2c.sh
===================================================================
--- trunk/test/testrun_2c.sh	(revision 591)
+++ trunk/test/testrun_2c.sh	(revision 1)
@@ -1,427 +1,189 @@
 #! /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.
-#
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-HTML="$PW_DIR/yule.html";  export HTML
 
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-xml-log --enable-debug --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-database=mysql"; export SERVER_BUILDOPTS
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-CLIENT_BUILDOPTS="--quiet  $TRUST --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --enable-network=client --disable-mail --disable-external-scripts --enable-login-watch --enable-xml-log --enable-db-reload --with-logserver=localhost --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS
+PW_DIR=`pwd`
 
-MAXTEST=4; export MAXTEST
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
 
-do_test_1_c () {
+echo; echo "${S}__ STARTING TEST RUN CLIENT/SERVER W/MYSQL __${E}"; echo;
+echo Working directory: $PW_DIR
 
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
+    fi
+fi
 
-	rm -f test_log_valgrind
+echo MAKE is $MAKE
+echo
 
-	${VALGRIND} ./yule.2 -q -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y2=$!
-	five_sec_sleep
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server #2${E}: ./yule.2 -l info -p none &"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./yule -l info -p none -e info --bind-address=127.0.0.1 \
-	    --server-port=49778 >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check"; 
-	    echo; 
-	}
-
-	${VALGRIND} ./samhain.new -t check -p none -l none -e info --bind-address=127.0.0.1 >/dev/null 2>>test_log_valgrind
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "samhain.new -t check";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "samhain.new -t check";
-	    kill $PROC_Y
-	    kill $PROC_Y2
-	    return 1
-	fi
-
-	kill $PROC_Y
-	kill $PROC_Y2
-	five_sec_sleep
-
-	# cp ${LOGFILE}  triple_test
-	# cp ${LOGFILE}2 triple_test_2
-
-	egrep "START(>|\").*Yule(>|\")" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server #2 start";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (relayed)";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit (relayed)";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" ${LOGFILE}2 >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server #2 exit";
-	    return 1
-	fi
-
-
-	egrep "START(>|\").*Yule(>|\")" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server start";
-	    return 1
-	fi
-	egrep "NEW CLIENT" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client connect";
-	    return 1
-	fi
-	egrep "remote_host.*Checking.*/bin" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    return 1
-	fi
-	egrep "remote_host.*EXIT.*Samhain" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client exit";
-	    return 1
-	fi
-	egrep "EXIT.*Yule.*SIGTERM" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Server exit";
-	    return 1
-	fi
-
-	[ -z "$VALGRIND" ] || {
-	    tmp=`cat test_log_valgrind 2>/dev/null | wc -l`;
-	    if [ $tmp -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "valgrind reports errors";
-		cat test_log_valgrind
-		return 1;
-	    fi;
-	}
-
-	return 0
-}
-
-testrun_threesockets () {
-
-    GPG="$1"
-
-    [ -z "$verbose" ] || { 
-        echo; 
-        echo Working directory: $PW_DIR; echo MAKE is $MAKE; echo GPG is $GPG;
-        echo; 
-    }
-
-    [ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-
-    if test -r "Makefile"; then
-        $MAKE distclean
-    fi
-
-    ${TOP_SRCDIR}/configure --with-gpg=${GPG} --with-fp=EF6CEF54701A0AFDB86AF4C31AAD26C80F571F6C --with-checksum=no ${SERVER_BUILDOPTS} >/dev/null 2>&1
-
-    if test x$? = x0; then
-        [ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-        $MAKE  > /dev/null 2>>test_log
-        if test x$? = x0; then
-            [ -z "$verbose" ] || log_msg_ok "make..."; 
-        else
-            [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-            return 1
-        fi
-    else
-        [ -z "$quiet" ] &&       log_msg_fail "configure...";
-        return 1
-    fi
-
-    rm -f ./.samhain_file
-    rm -f ./.samhain_log
-    rm -f ./.samhain_lock
-    rm -f ./rc.${SH_LOCALHOST}
-    rm -f ./file.${SH_LOCALHOST}
-    
-    cp ${SCRIPTDIR}/testrc_2.in testrc_2
-    
-    ORIGINAL="DatabaseSeverity=none"
-    REPLACEMENT="DatabaseSeverity=warn"
-    ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-
-    ORIGINAL="MailSeverity=none"
-    REPLACEMENT="MailSeverity=crit"
-    ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-    return 0
- }
-
-check_mysql_log () {
-    DATE="$1"
-
-    rm -f test_log_db
-    #
-    echo "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '"${DATE}"';" | mysql --password=samhain -u samhain samhain >test_log_db
-    #
-    egrep "START.*Yule" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Server start";
-	return 1
-    fi
-    egrep "NEW CLIENT" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client connect";
-	return 1
-    fi
-    egrep "Checking.*/bin" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client file check";
-	return 1
-    fi
-    egrep "EXIT.*Samhain" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client exit";
-	return 1
-    fi
-    egrep "EXIT.*Yule.*SIGTERM" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Server exit";
-	return 1
-    fi
-    return 0
-}
 
 testrun2c ()
 {
-    log_start "RUN FULL CLIENT/SERVER W/MYSQL"
-    #
-    if [ -z "$doall" ]; then
-	log_skip 1 $MAXTEST 'Client/server w/mysql (or use --really-all)'
-	log_skip 2 $MAXTEST 'Client/server w/mysql (or use --really-all)'
-	log_skip 3 $MAXTEST 'Client/server w/mysql (or use --really-all)'
-	log_skip 4 $MAXTEST 'Client/server w/mysql (or use --really-all)'
-	return 0
-    fi
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    MYSQL=`find_path mysql`
-    if [ -z "$MYSQL" ]; then
-	log_skip 1 $MAXTEST "mysql not found";
-	log_skip 2 $MAXTEST "mysql not found";
-	log_skip 3 $MAXTEST "mysql not found";
-	log_skip 4 $MAXTEST "mysql not found";
-	return 1
-    else
-	TEST=`echo "DESCRIBE log;" | mysql --password=samhain -u samhain samhain 2>/dev/null`
-	if [ $? -ne 0 -o -z "$TEST" ]; then
-	    log_skip 1 $MAXTEST "mysql not default setup"
-	    log_skip 2 $MAXTEST "mysql not default setup"
-	    log_skip 3 $MAXTEST "mysql not default setup"
-	    log_skip 4 $MAXTEST "mysql not default setup"
-	    return 1
+	#
+	# test standalone compilation
+	#
+	echo "${S}Building client and server${E}"; echo;
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean
 	fi
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    DATE=`date '+%Y-%m-%d %T'`
-    #
-    testrun2a_internal
-    #
-    # BUILD Server 2
-    #
-    cp ./yule ./yule.orig
+        #
+        #
+	# ${TOP_SRCDIR}/configure --quiet  $TRUST --enable-login-watch --enable-xml-log --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock
+	#
+	${TOP_SRCDIR}/configure --prefix=$PW_DIR --localstatedir=$PW_DIR --enable-network=client --disable-mail --disable-external-scripts --enable-login-watch --enable-xml-log --enable-db-reload --with-logserver=localhost --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-timeserver=localhost --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock
+	#
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
 
-    ${TOP_SRCDIR}/configure --quiet  $TRUST --enable-debug --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=${RCFILE}2  --with-log-file=${LOGFILE}2 --with-pid-file=$PW_DIR/.samhain_lock2 --with-html-file=${HTML}2 --with-state-dir=$PW_DIR --with-port=49778 --with-database=mysql
-    #
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  > /dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
 	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
 
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-    
-    cp yule yule.2 || return 1
-    #
-    cp ./yule.orig ./yule
-    #
-    SHPW=`cat ./testpw`
-    
-    if test x"$SHPW" = x; then
-	[ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	return 1
-    fi
-    
-    rm -f ./testpw
-    
-    ./samhain_setpwd yule new $SHPW >/dev/null
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd yule new $SHPW";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd yule new $SHPW";
-	return 1
+	# save binary and build server
+	#
+	cp samhain samhain.build
+	make clean
+
+        #
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-xml-log --enable-debug --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-database=mysql  
+
+#  --enable-login-watch --enable-mounts-check --enable-userfiles  --enable-identity=yule --enable-suidcheck --with-gpg=/usr/local/bin/gpg --with-fp="EF6C EF54 701A 0AFD B86A  F4C3 1AAD 26C8 0F57 1F6C"
+
+	#
+        # --with-database=mysql --with-libs=-L/usr/local/mysql/lib 
+	# --with-database=postgresql
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
+	else
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
+	fi
+	echo "${S}Initialize database${E}"; echo;
+
+	rm -f ./.samhain_file
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+	rm -f ./rc.${SH_LOCALHOST}
+	rm -f ./file.${SH_LOCALHOST}
+
+	cp ${SCRIPTDIR}/testrc_2.in testrc_2
+
+	# Create a password
+	SHPW=`./yule -G`
+	if test x"$SHPW" = x; then
+	    echo "password not generated -- aborting"
+	    exit 1
+	fi
+
+	# Set in client
+	echo "./samhain_setpwd samhain.build new $SHPW"
+	./samhain_setpwd samhain.build new $SHPW
+	mv samhain.build.new samhain.new
+	SHCLT=`./yule -P $SHPW | sed s%HOSTNAME%${SH_LOCALHOST}%`
+ 	echo $SHCLT >> testrc_2
+
+	echo "./samhain.new -t init"
+	./samhain.new -t init
+
+	SHINI=$?
+
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+
+	cp    ./testrc_2              ./rc.${SH_LOCALHOST}
+	mv    ./.samhain_file         ./file.${SH_LOCALHOST}
+
+	if test x$SHINI = x0; then
+
+		echo; echo "${S}Start Server${E}: ./yule  &"; echo;
+		./yule &
+		PROC_Y=$!
+		sleep 5
+
+		echo; echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check";
+
+		./samhain.new -t check -p none -l none -e info 
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    kill $PROC_Y
+		    exit
+		fi
+
+		kill $PROC_Y
+		sleep 5
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $SHINI"; 
+		echo;
+		exit
+	fi
+	    
+}
+
+    if test x$1 = x; then
+	echo
+	echo "Please provide the local hostname as argument."
+	echo
+	exit 8
     fi
 
+    SH_LOCALHOST=$1; export SH_LOCALHOST
 
-    $MAKE clean >/dev/null || return 1
-    mv yule.new yule || return 1
-    #
-    ORIGINAL="DatabaseSeverity=none"
-    REPLACEMENT="DatabaseSeverity=info"
-    ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-    #
-    do_test_1_a
-    #
-    if [ $? -ne 0 ]; then
-	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client/server w/mysql";
-    else
-    #
-	check_mysql_log "${DATE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client/server w/mysql";
-	else
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client/server w/mysql";
-	fi
-    fi
-    #
-    cp testrc_2 testrc_22
-    ORIGINAL="DatabaseSeverity=none"
-    REPLACEMENT="DatabaseSeverity=info"
-    ex -s $RCFILE <<EOF
-%s/$REPLACEMENT/$ORIGINAL/g
-wq
-EOF
-    #
-    do_test_1_c
-    #
-    if [ $? -ne 0 ]; then
-	[ -z "$quiet" ] && log_fail 2 ${MAXTEST} "Client/server (relay) w/mysql";
-    else
-    #
-	check_mysql_log "${DATE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ] && log_fail 2 ${MAXTEST} "Client/server (relay) w/mysql";
-	else
-	    [ -z "$quiet" ] && log_ok   2 ${MAXTEST} "Client/server (relay) w/mysql";
-	fi
-    fi
-    #
-    #
-    if [ -f ./yule ]; then
-	./yule -p info -l info --set-database-severity=info -D >/dev/null 2>>test_log 
-	five_sec_sleep
-	netstat -pant 2>/dev/null | grep 49777 | grep yule >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Client/server w/mysql";
-	else
-	    NSOCK=`netstat -pand 2>/dev/null | grep STREAM | grep yule | wc -l`
-	    if [ $NSOCK -ne 2 ]; then
-		[ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Three sockets open";
-		netstat -pand 2>/dev/null | grep yule 
-	    else
-		[ -z "$quiet" ] && log_ok   3 ${MAXTEST} "Three sockets open";
-	    fi
-	fi
-	PID=`cat .samhain_lock`
-	kill $PID
-    else
-	log_fail 3 ${MAXTEST} "Three sockets open";
-    fi
-    #
-    cp ${SCRIPTDIR}/testrc_2.in testrc_2
-    #
-    GPG=`find_path gpg`
-    if [ -z "$GPG" ]; then
-        log_skip 4 $MAXTEST 'gpg not found in $PATH'
-    else
-        eval "$GPG" --list-keys 0F571F6C >/dev/null 2>/dev/null
-        if [ $? -ne 0 ]; then
-            log_skip 4 $MAXTEST 'public PGP key 0x0F571F6C not present'
-        else
-	    testrun_threesockets "$GPG"
-	    #
-	    cp ${SCRIPTDIR}/testrc_2.in testrc_2
-	    #
-	    if [ -f ./yule ]; then
-		./yule -D --set-database-severity=warn >/dev/null 2>>test_log 
-		five_sec_sleep
-		netstat -pant 2>/dev/null | grep 49777 | grep yule >/dev/null 2>&1
-		if [ $? -ne 0 ]; then
-		    [ -z "$quiet" ] && log_fail 4 ${MAXTEST} "Three sockets open (gpg) - 1";
-		else
-		    NSOCK=`netstat -pand 2>/dev/null | grep STREAM | grep yule | wc -l`
-		    if [ $NSOCK -ne 2 ]; then
-			[ -z "$quiet" ] && log_fail 4 ${MAXTEST} "Three sockets open (gpg) - 2";
-			netstat -pand 2>/dev/null | grep yule 
-		    else
-			[ -z "$quiet" ] && log_ok   4 ${MAXTEST} "Three sockets open (gpg)";
-		    fi
-		fi
-		PID=`cat .samhain_lock`
-		kill $PID
-	    else
-		log_fail 4 ${MAXTEST} "Three sockets open (gpg) - 3";
-	    fi
-	fi
-    fi
-    #
-    if [ -n "$cleanup" ]; then
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./file.${SH_LOCALHOST}
-	ALTHOST=`find_hostname`
-	rm -f "./file.${ALTHOST}"
-	rm -f "./rc.${ALTHOST}"
-    fi
-    #
-    log_end "RUN FULL CLIENT/SERVER W/MYSQL"
-}
+    testrun2c
 
+
+echo; echo "${S}__ END TEST RUN CLIENT/SERVER W/MYSQL __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_2d.sh
===================================================================
--- trunk/test/testrun_2d.sh	(revision 591)
+++ trunk/test/testrun_2d.sh	(revision 1)
@@ -1,150 +1,190 @@
 #! /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.
-#
 
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-xml-log --enable-debug --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-database=postgresql"; export SERVER_BUILDOPTS
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-CLIENT_BUILDOPTS="--quiet  $TRUST --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --enable-network=client --disable-mail --disable-external-scripts --enable-login-watch --enable-xml-log --enable-db-reload --with-logserver=localhost --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS
+PW_DIR=`pwd`
 
-create_pgpass () {
-touch ~/.pgpass
-chmod 600 ~/.pgpass
-cat > ~/.pgpass << EOF
-localhost:*:samhain:samhain:samhain
-EOF
-}
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
 
-check_psql_log () {
-    DATE="$1"
+echo; echo "${S}__ STARTING TEST RUN CLIENT/SERVER __${E}"; echo;
+echo Working directory: $PW_DIR
 
-    rm -f test_log_db
-    # PGPASSWORD=samhain; export PGPASSWORD
-    create_pgpass
-    psql -h localhost -o test_log_db -U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';"
-    #
-    egrep "START.*Yule" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Server start (psql) DATE ${DATE}";
-	return 1
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
     fi
-    egrep "NEW CLIENT" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client connect (psql)";
-	return 1
-    fi
-    egrep "Checking.*/bin" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client file check (psql)";
-	return 1
-    fi
-    egrep "EXIT.*Samhain" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Client exit (psql)";
-	return 1
-    fi
-    egrep "EXIT.*Yule.*SIGTERM" test_log_db >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	[ -z "$verbose" ] || log_msg_fail "Server exit (psql)";
-	return 1
-    fi
-    return 0
-}
+fi
 
-MAXTEST=1; export MAXTEST
+echo MAKE is $MAKE
+echo
+
+# --with-database=postgresql
+# export MYLIB=-L/usr/local/pgsql/lib
+# export MYINC=-I/usr/local/pgsql/include
+# export LD_LIBRARY_PATH=/usr/local/pgsql/lib
+
+# --with-database=mysql
+# export MYLIB=-L/usr/local/mysql/lib
+# export MYINC=-I/usr/local/mysql/include
+# export LD_LIBRARY_PATH=/usr/local/mysql/lib
 
 testrun2d ()
 {
-    log_start "RUN FULL CLIENT/SERVER W/POSTGRESQL"
-    #
-    if [ -z "$doall" ]; then
-	log_skip 1 $MAXTEST 'Client/server w/postgresql (or use --really-all)'
-	return 0
-    fi
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    PSQL=`find_path psql`
-    if [ -z "$PSQL" ]; then
-	log_skip 1 $MAXTEST "psql not found";
-	return 1
-    else
-	# PGPASSWORD="samhain"; export PGPASSWORD
-	create_pgpass
-	TEST=`psql -h localhost -U samhain -d samhain -c "SELECT * FROM log LIMIT 1;" 2>/dev/null`
-	if [ $? -ne 0 -o -z "$TEST" ]; then
-	    log_skip 1 $MAXTEST "psql not default setup"
-	    return 1
+	#
+	# test standalone compilation
+	#
+	echo "${S}Building client and server${E}"; echo;
+	#
+	if test -r "Makefile"; then
+		$MAKE distclean
 	fi
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    DATE=`date '+%Y-%m-%d %T'`
-    #
-    testrun2a_internal
-    #
-    for ff in ./rc.*; do
-    ORIGINAL="SetUdpActive=no"
-    REPLACEMENT="ReportCheckflags=yes"
-    ex -s rc.morrigan.localdomain <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-    done
-    #
-    ORIGINAL="DatabaseSeverity=none"
-    REPLACEMENT="DatabaseSeverity=info"
-    ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-    #
-    ORIGINAL="# setdbname=samhain"
-    REPLACEMENT="setdbhost=127.0.0.1"
-    ex -s $RCFILE <<EOF
-%s/$ORIGINAL/$REPLACEMENT/g
-wq
-EOF
-    #
-    do_test_1_a
-    #
-    if [ $? -ne 0 ]; then
-	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client/server w/postgresql";
-    else
-    #
-	check_psql_log "${DATE}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client/server w/postgresql";
+	#
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-network=client  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_2  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
 	else
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client/server w/postgresql";
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
 	fi
-    fi
-    #
-    if [ -n "$cleanup" ]; then
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./file.${SH_LOCALHOST}
-	ALTHOST=`find_hostname`
-	rm -f "./file.${ALTHOST}"
-	rm -f "./rc.${ALTHOST}"
-    fi
-    #
-    log_end "RUN FULL CLIENT/SERVER W/POSTGRESQL"
+
+	# save binary and build server
+	#
+	cp samhain samhain.build
+	make clean
+
+	${TOP_SRCDIR}/configure --quiet  $TRUST --enable-network=server  --enable-xml-log --enable-login-watch --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/testrc_2  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-udp --enable-identity=rainer
+	#
+	if test x$? = x0; then
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		if test x$? = x0; then
+		    echo "$MAKE completed, exit status $?"; echo;
+		else
+		    echo "${S}ERROR:${E} make failed, exit status $?"; echo;
+		    exit
+		fi
+
+	else
+		echo "${S}ERROR:${E} configure failed, exit status $?"; echo;
+		exit
+	fi
+
+	#################################################################
+	#
+	#
+	echo "${S}Initialize database${E}"; echo;
+
+	rm -f ./.samhain_file
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+
+	cp ${SCRIPTDIR}/testrc_2.in testrc_2
+
+	echo "./samhain.build -t init"
+	./samhain.build -t init
+
+	SHINI=$?
+
+	# Create a password
+
+	SHPW=`./yule -G 2>&1 | grep -v 'ERRO'`
+	if test x"$SHPW" = x; then
+	    echo "password not generated -- aborting"
+	    exit 1
+	fi
+
+	# Set in client
+
+	echo "./samhain_setpwd samhain.build new $SHPW"
+	./samhain_setpwd samhain.build new $SHPW
+
+	mv samhain.build.new  samhain.new
+
+	rm -f ./.samhain_log
+	rm -f ./.samhain_lock
+
+	SHCLT=`./yule -P $SHPW  2>&1 | grep -v 'ERRO' | sed s%HOSTNAME%${SH_LOCALHOST}%`
+
+ 	echo $SHCLT >> testrc_2
+
+	if test x$SHINI = x0; then
+		echo; echo "${S}Start Server${E}: ./yule  &"; echo;
+		su -c "./yule &"
+		PROC_Y=$!
+		sleep 5
+
+		echo; echo "${S}Start Client${E}: ./samhain.new -l none -p none -e info -t check";
+
+		./samhain.new -t check -p none -l none -e info
+		if test x$? = x0; then
+		    echo "${S}check completed${E}"
+		else
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    su -c "kill $PROC_Y"
+		    exit
+		fi
+
+		su -c "kill $PROC_Y"
+		sleep 5
+	else
+		echo "${S}ERROR:${E} -- init -- failed, exit status $SHINI"; 
+		echo;
+		exit
+	fi
+	    
 }
 
+    if test x$1 = x; then
+	echo
+	echo "Please provide the local hostname as argument."
+	echo
+	exit 8
+    fi
+
+    SH_LOCALHOST=$1; export SH_LOCALHOST
+
+    testrun2d
+
+
+echo; echo "${S}__ END TEST RUN CLIENT/SERVER __${E}"; echo;
+
+exit
+
Index: trunk/test/testrun_2e.sh
===================================================================
--- trunk/test/testrun_2e.sh	(revision 591)
+++ 	(revision )
@@ -1,299 +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.
-#
-
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --enable-debug=gdb"; export SERVER_BUILDOPTS
-
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --enable-debug"; export CLIENT_BUILDOPTS
-
-do_test_2_e () {
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-	rm -f test_log_valgrind
-
- 	# SetSocketAllowUid=$(id -u)
-	#
-	if test -f /usr/xpg4/bin/id; then
-	    MY_ID=$(/usr/xpg4/bin/id -u)
-	else
-	    MY_ID=$(id -u)
-	fi
-	#
-	sed -i -e "s/SetSocketAllowUid=0/SetSocketAllowUid=${MY_ID}/g" $RCFILE
-
-	# Start server
-	#
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-	./yulectl -c LIST >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (1)";
-	    kill $PROC_Y
-	    return 1
-	fi	
-	NR=$( ./yulectl -c LIST | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (2)";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	./yulectl -c SCAN localhost.localdomain
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c SCAN";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	UUID=$(uuidgen)
-	./yulectl -c DELTA:$UUID localhost.localdomain
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c DELTA:$UUID";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	./yulectl -c RELOAD localhost.localdomain
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c RELOAD";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	./yulectl -c LIST >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (3)";
-	    kill $PROC_Y
-	    return 1
-	fi	
-	NR=$( ./yulectl -c LIST | wc -l )
-	if [ $NR -ne 3 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (4)";
-	    kill $PROC_Y
-	    return 1
-	fi
-	
-	{ ./yulectl -c LIST | head -n 1 | grep SCAN; } >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (5)";
-	    kill $PROC_Y
-	    return 1
-	fi	
-	{ ./yulectl -c LIST | tail -n 1 | grep RELOAD; } >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (6)";
-	    kill $PROC_Y
-	    return 1
-	fi	
-	{ ./yulectl -c LIST | tail -n 2 | head -n 1| grep "DELTA:$UUID"; } >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (7)";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	./yulectl -c CANCEL localhost.localdomain
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c CANCEL";
-	    kill $PROC_Y
-	    return 1
-	fi
-	
-	./yulectl -c LIST >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (8)";
-	    kill $PROC_Y
-	    return 1
-	fi	
-	NR=$( ./yulectl -c LIST | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "./yulectl -c LIST (9)";
-	    kill $PROC_Y
-	    return 1
-	fi
-
-	kill $PROC_Y
-	return 0
-}
-
-testrun2e_internal ()
-{
-        [ -z "$verbose" ] || { 
-	    echo; 
-	    echo Working directory: $PW_DIR; echo MAKE is $MAKE; 
-	    echo; 
-	}
-	#
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean
-	fi
-	#
-	${TOP_SRCDIR}/configure ${CLIENT_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	# save binary and build server
-	#
-	cp samhain samhain.build || return 1
-	$MAKE clean >/dev/null || return 1
-
-	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-
-	#####################################################################
-	#
-	#
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./file.${SH_LOCALHOST}
-	rm -f  "./rc.${ALTHOST}"
-	rm -f  "./file.${ALTHOST}"
-
-	cp ${SCRIPTDIR}/testrc_2.in testrc_2
-
-	./samhain.build -t init -p none
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-	# Create a password
-
-	SHPW=`./yule -G`
-	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
-	fi
-
-	# Set in client
-
-	./samhain_setpwd samhain.build new $SHPW >/dev/null
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	    return 1
-	fi
-
-	mv samhain.build.new  samhain.new || return 1
-
-	rm -f ./.samhain_log*
-	rm -f ./.samhain_lock
-
-	SHCLT=`./yule -P $SHPW`
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	    return 1
-	fi
-
-	SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-	AHOST=`find_hostname`
-	SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
- 	echo $SHCLT1 >> testrc_2
- 	echo $SHCLT2 >> testrc_2
-
-	cp    ./testrc_2       ./rc.${SH_LOCALHOST}
-	mv    ./.samhain_file  ./file.${SH_LOCALHOST}
-	chmod 644 ./rc.${SH_LOCALHOST}
-	chmod 644 ./file.${SH_LOCALHOST}
-
-	ALTHOST=`find_hostname`
-	cp    ./testrc_2       "./rc.${ALTHOST}"
-	cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-	chmod 644 ./rc.${ALTHOST}
-	chmod 644 ./file.${ALTHOST}
-
-	echo $SHPW > ./testpw
-}
-
-MAXTEST=1; export MAXTEST
-
-testrun2e ()
-{
-    log_start "RUN SERVER W/YULECTL";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    testrun2e_internal
-    do_test_2_e
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Server w/yulectl";
-    else
-	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Server w/yulectl";
-    fi
-    ####### EXIT HERE FOR TESTING ######
-    #
-    #
-    log_end "RUN SERVER W/YULECTL"
-}
Index: trunk/test/testrun_2f.sh
===================================================================
--- trunk/test/testrun_2f.sh	(revision 591)
+++ 	(revision )
@@ -1,390 +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.
-#
-
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --enable-debug=gdb"; export SERVER_BUILDOPTS
-
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --enable-debug"; export CLIENT_BUILDOPTS
-
-do_test_2_f () {
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-	rm -f test_log_valgrind
-
- 	# SetSocketAllowUid=$(id -u)
-	#
-	if test -f /usr/xpg4/bin/id; then
-	    MY_ID=$(/usr/xpg4/bin/id -u)
-	else
-	    MY_ID=$(id -u)
-	fi
-	#
-	sed -i -e "s/SetSocketAllowUid=0/SetSocketAllowUid=${MY_ID}/g" $RCFILE
-
-	# Start server
-	#
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -t check --foreground --forever .. &"; 
-	    echo; 
-	}
-	${VALGRIND} ./samhain.new -t check -D -p none -l none -e info --bind-address=127.0.0.1 --server-host=localhost >/dev/null 2>>test_log_valgrind 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "starting samhain.new";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "starting samhain.new";
-	    kill $PROC_Y
-	    return 1
-	fi
-	five_sec_sleep
-	PROC_S=$(  ps aux | grep samhain.new | grep -v grep | awk '{ print $2; }' )
-
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	egrep "File check completed" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (1)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	#
-	# >>> (1) Send SIGTTOU to force a second scan, 
-	# >>>      and verify that it was done
-	#
-	kill -TTOU $PROC_S
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Kill -TTOU";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 2 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (2)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "sigttou";
-
-	NR=$( egrep "POLICY" $LOGFILE | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (3)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	#
-	# >>> (2) Modify the file system
-	#
-
-	UUID=$(uuidgen)
-	mkdir /tmp/testrun_samhain/$UUID
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "mkdir";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	kill -TTOU $PROC_S
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Kill -TTOU (2)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	NR=$( egrep "POLICY" $LOGFILE | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (4)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "/tmp/testrun_samhain modified";
-
-	kill $PROC_S; 
-	five_sec_sleep
-
-	rm -f ./.samhain_file
-	rm -f ./file.${SH_LOCALHOST} 
-	rm -f "./file.${ALTHOST}"
-
-	rm ./.samhain_log 
-	rm -f ./.samhain_lock
-
-	#
-	# >>> (3) Re-init the database 
-	#
-	./samhain.new -t init -p none
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "init (2) ..";
-	    kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "init (2) ..";
-
-	#
-	# >>> (4) Re-start Samhain with delay
-	#
-
-	sed --in-place -e 's/SetUdpActive=no/StartupLoadDelay=10/g' ./rc.${SH_LOCALHOST}
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "sed (1) ..";
-	    kill $PROC_Y;
-	    return 1
-	fi
-	sed --in-place -e 's/SetUdpActive=no/StartupLoadDelay=10/g' "./rc.${ALTHOST}"
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "sed (2) ..";
-	    kill $PROC_Y;
-	    return 1
-	fi
-
-	${VALGRIND} ./samhain.new -t check -D -p none -l none -e info --bind-address=127.0.0.1 --server-host=localhost >/dev/null 2>>test_log_valgrind 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "starting samhain.new (2)";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "starting samhain.new (2)";
-	    kill $PROC_Y
-	    return 1
-	fi
-	five_sec_sleep
-	PROC_S=$(  ps aux | grep samhain.new | grep -v grep | awk '{ print $2; }' )
-
-	#
-	# >>> (5) Copy database to server after Samhain startup
-	# >>>     verifies that StartupLoadDelay works
-	#
-
-	if test -f ./.samhain_file; then
-	    mv ./.samhain_file ./file.${SH_LOCALHOST}
-	    chmod 644 ./file.${SH_LOCALHOST}
-
-	    ALTHOST=`find_hostname`
-	    cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-	    chmod 644 ./file.${ALTHOST}
-	else
-	    [ -z "$verbose" ] || log_msg_fail "baseline file ..";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	for ff in 1 2 3; do
-	    five_sec_sleep
-	done
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (5)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "file check after delay";
-
-	NR=$( egrep "POLICY" $LOGFILE | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (6)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	kill $PROC_S; 
-	kill $PROC_Y
-	return 0
-}
-
-testrun2f_internal ()
-{
-        [ -z "$verbose" ] || { 
-	    echo; 
-	    echo Working directory: $PW_DIR; echo MAKE is $MAKE; 
-	    echo; 
-	}
-	#
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean
-	fi
-	#
-	${TOP_SRCDIR}/configure ${CLIENT_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	# save binary and build server
-	#
-	cp samhain samhain.build || return 1
-	$MAKE clean >/dev/null || return 1
-
-	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-
-	#####################################################################
-	#
-	#
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./file.${SH_LOCALHOST}
-	rm -f  "./rc.${ALTHOST}"
-	rm -f  "./file.${ALTHOST}"
-
-	cp ${SCRIPTDIR}/testrc_2.in testrc_2
-
-	sed --in-place -e 's,file = /tmp,file = /tmp/testrun_samhain,g'  testrc_2
-	mkdir /tmp/testrun_samhain 2>/dev/null
-
-	./samhain.build -t init -p none
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-	# Create a password
-
-	SHPW=`./yule -G`
-	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
-	fi
-
-	# Set in client
-
-	./samhain_setpwd samhain.build new $SHPW >/dev/null
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	    return 1
-	fi
-
-	mv samhain.build.new  samhain.new || return 1
-
-	rm -f ./.samhain_log*
-	rm -f ./.samhain_lock
-
-	SHCLT=`./yule -P $SHPW`
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	    return 1
-	fi
-
-	SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-	AHOST=`find_hostname`
-	SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
- 	echo $SHCLT1 >> testrc_2
- 	echo $SHCLT2 >> testrc_2
-
-	cp    ./testrc_2       ./rc.${SH_LOCALHOST}
-	mv    ./.samhain_file  ./file.${SH_LOCALHOST}
-	chmod 644 ./rc.${SH_LOCALHOST}
-	chmod 644 ./file.${SH_LOCALHOST}
-
-	ALTHOST=`find_hostname`
-	cp    ./testrc_2       "./rc.${ALTHOST}"
-	cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-	chmod 644 ./rc.${ALTHOST}
-	chmod 644 ./file.${ALTHOST}
-
-	echo $SHPW > ./testpw
-}
-
-MAXTEST=1; export MAXTEST
-
-testrun2f ()
-{
-    log_start "RUN CLIENT/SERVER CASE ONE";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-    testrun2f_internal
-    do_test_2_f
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Case One Change Management Integration";
-    else
-	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Case One Change Management Integration";
-    fi
-    #
-    log_end "RUN CLIENT/SERVER CASE ONE"
-}
Index: trunk/test/testrun_2g.sh
===================================================================
--- trunk/test/testrun_2g.sh	(revision 591)
+++ 	(revision )
@@ -1,867 +1,0 @@
-#! /bin/sh
-
-#
-# Copyright Rainer Wichmann (2015)
-#
-# 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.
-#
-
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-
-SERVER_BUILDOPTS="--quiet  $TRUST --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --enable-debug=gdb --enable-static"; export SERVER_BUILDOPTS
-
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --enable-static"; export CLIENT_BUILDOPTS
-
-TEST_DIRS="one two three four"
-TEST_FILES="change leave rmthis"
-BASE="/tmp/testrun_samhain"
-
-TEST_LIST="./tmp_list_file"
-
-ALTHOST=`find_hostname`
-
-PROC_S=0; export PROC_S
-PROC_Y=0; export PROC_Y
-
-mod_files ()
-{
-    rm -f "${TEST_LIST}"
-    touch "${TEST_LIST}"
-    #
-    for dd in ${TEST_DIRS}; do
-	echo "changed" > "${BASE}/$dd/change"
-	rm -f "${BASE}/$dd/rmthis"
-	echo "added" > "${BASE}/$dd/addedthis"
-	echo "${BASE}/$dd"           >> "${TEST_LIST}"
-	echo "${BASE}/$dd/change"    >> "${TEST_LIST}"
-	echo "${BASE}/$dd/rmthis"    >> "${TEST_LIST}"
-	echo "${BASE}/$dd/addedthis" >> "${TEST_LIST}"
-    done
-}
-
-do_test_2_g_yule_start () {
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Server${E}: ./yule -l info -p none &"; 
-	    echo; 
-	}
-	rm -f test_log_valgrind
-
- 	# SetSocketAllowUid=$(id -u)
-	#
-	if test -f /usr/xpg4/bin/id; then
-	    MY_ID=$(/usr/xpg4/bin/id -u)
-	else
-	    MY_ID=$(id -u)
-	fi
-	#
-	sed -i -e "s/SetSocketAllowUid=0/SetSocketAllowUid=${MY_ID}/g" $RCFILE
-
-	# Start server
-	#
-	${VALGRIND} ./yule -l info -p none >/dev/null 2>>test_log_valgrind &
-	PROC_Y=$!
-	five_sec_sleep
-
-
-	[ -z "$verbose" ] || { 
-	    echo; 
-	    echo "${S}Start Client${E}: ./samhain.new -t check -D .. &"; 
-	    echo; 
-	}
-	${VALGRIND} ./samhain.new -t check -D -p none -l none -e info --bind-address=127.0.0.1 --server-host=localhost >/dev/null 2>>test_log_valgrind 
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "starting samhain.new";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "starting samhain.new";
-	    kill $PROC_Y
-	    return 1
-	fi
-	five_sec_sleep
-	PROC_S=$(  ps aux | grep samhain.new | grep -v grep | awk '{ print $2; }' | sort | head -n 1 )
-
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	egrep "File check completed" $LOGFILE >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (1)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	return 0
-}
-
-do_test_2_g_two () {
-
-	#
-	# >>> Modify files
-	#
-	mod_files
-	#
-	if ! test -f ${TEST_LIST}; then
-	    [ -z "$verbose" ] || log_msg_fail "No file list created";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	#
-	#
-	# >>> Trigger a scan
-	#
-	kill -TTOU $PROC_S
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Kill -TTOU";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	for ff in 1 2 3; do
-	    five_sec_sleep
-	done
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 2 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (2)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "sigttou";
-
-	NR=$( egrep "POLICY" $LOGFILE | grep ReadOnly | wc -l )
-	if [ $NR -ne 8 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (ReadOnly)";  
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	NR=$( egrep "POLICY" $LOGFILE | grep ADDED | wc -l )
-	if [ $NR -ne 4 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (added)";  
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	NR=$( egrep "POLICY" $LOGFILE | grep MISSING | wc -l )
-	if [ $NR -ne 4 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (removed)";  
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	kill $PROC_S; 
-	kill $PROC_Y;
-	return 0
-}
-
-do_test_2_g_one () {
-
-	#
-	# >>> (1) Modify files, create DeltaDB from file list in ${TEST_LIST}
-	#
-	mod_files
-	#
-	if ! test -f ${TEST_LIST}; then
-	    [ -z "$verbose" ] || log_msg_fail "No file list created";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	#
-	./samhain.new --outfile ./file.delta --create-database "${TEST_LIST}"
-	#
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Create DeltaDB";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	if ! test -f ./file.delta; then
-	    [ -z "$verbose" ] || log_msg_fail "No DeltaDB created";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	#
-	# >>> (2) Copy to server and tag with a UUID
-	#
-	UUID=$(uuidgen)
-	mv ./file.delta file.${SH_LOCALHOST}.${UUID}
-	if [ "x${SH_LOCALHOST}" != "x${ALTHOST}" ]
-	then
-	    cp file.${SH_LOCALHOST}.${UUID} "./file.${ALTHOST}.${UUID}"
-	fi
-	
-	#
-	# >>> (3) Tell client to load delta database.
-	# >>>     testrc_2: timestamps every 10 sec
-	#
-	grep '^SetLoopTime=10$' rc.${SH_LOCALHOST} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "SetLoopTime != 10 in rc.${SH_LOCALHOST}";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	grep '^SetLoopTime=10$' rc.${ALTHOST} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "SetLoopTime != 10 in rc.${ALTHOST}";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	NHOSTS=1
-	
-	./yulectl -c "DELTA:${UUID}" ${SH_LOCALHOST}
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (1)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	if [ "x${SH_LOCALHOST}" != "x${ALTHOST}" ]
-	then
-	    ./yulectl -c "DELTA:${UUID}" ${ALTHOST}
-	    NHOSTS=2
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "yulectl (2)";
-		kill $PROC_S; kill $PROC_Y;
-		return 1
-	    fi
-	fi
-	
-	NR=$( ./yulectl -c LIST | grep ${UUID} | grep -v grep | wc -l )
-	if [ $NR -ne $NHOSTS ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (3)";
-	    [ -z "$verbose" ] || ./yulectl -c LIST
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	# Wait and verify that command has been sent
-	#
-	for tt in 1 2 3 4; do
-	    five_sec_sleep
-	done
-	#
-	NR=$( ./yulectl -c LISTALL | grep ${UUID} | grep SENT | grep -v grep | wc -l )
-	# NR=$( ./yulectl -c LIST | grep ${UUID} | grep -v grep | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (4)";
-	    [ -z "$verbose" ] || ./yulectl -c LISTALL
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	#
-	# >>> (4) Trigger a scan
-	#
-	kill -TTOU $PROC_S
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Kill -TTOU";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 2 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (2)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "sigttou";
-
-	NR=$( egrep "POLICY" $LOGFILE | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (3)";  
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	# --- The End ---
-
-	kill $PROC_S; 
-	kill $PROC_Y
-	return 0
-}
-
-do_test_2_g_three () {
-
-	#
-	# >>> (1) Modify files, create DeltaDB from file list in ${TEST_LIST}
-	#
-	mod_files
-	#
-	if ! test -f ${TEST_LIST}; then
-	    [ -z "$verbose" ] || log_msg_fail "No file list created";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	#
-	./samhain.new --outfile ./file.delta --create-database "${TEST_LIST}"
-	#
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Create DeltaDB";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	if ! test -f ./file.delta; then
-	    [ -z "$verbose" ] || log_msg_fail "No DeltaDB created";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "... DeltaDB created ...";
-	
-	#
-	# >>> (2) Copy to server and tag with a UUID
-	#
-	UUID=$(uuidgen)
-	if [ x"$1" != "xnosig" ]; then
-	    scripts/samhainadmin.pl -k 8A0B337A -m E ./file.delta >/dev/null
-	fi
-	if [ x"$1" == "xnodelta" ]; then
-	    rm -f ./file.*
-	else
-	    mv ./file.delta file.${SH_LOCALHOST}.${UUID}
-	    if [ "x${SH_LOCALHOST}" != "x${ALTHOST}" ]
-	    then
-		cp file.${SH_LOCALHOST}.${UUID} "./file.${ALTHOST}.${UUID}"
-	    fi
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "... DeltaDB copied as file.${SH_LOCALHOST}.${UUID} ...";
-	
-	#
-	# >>> (3) Tell client to load delta database.
-	# >>>     testrc_2: timestamps every 10 sec
-	#
-	grep '^SetLoopTime=10$' rc.${SH_LOCALHOST} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "SetLoopTime != 10 in rc.${SH_LOCALHOST}";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	grep '^SetLoopTime=10$' rc.${ALTHOST} >/dev/null 2>&1
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "SetLoopTime != 10 in rc.${ALTHOST}";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	NHOSTS=1
-	
-	./yulectl -c "DELTA:${UUID}" ${SH_LOCALHOST}
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (1)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	
-	if [ "x${SH_LOCALHOST}" != "x${ALTHOST}" ]
-	then
-	    ./yulectl -c "DELTA:${UUID}" ${ALTHOST}
-	    NHOSTS=2
-	    if [ $? -ne 0 ]; then
-		[ -z "$verbose" ] || log_msg_fail "yulectl (2)";
-		kill $PROC_S; kill $PROC_Y;
-		return 1
-	    fi
-	fi
-	
-	NR=$( ./yulectl -c LIST | grep ${UUID} | grep -v grep | wc -l )
-	if [ $NR -ne $NHOSTS ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (3)";
-	    [ -z "$verbose" ] || ./yulectl -c LIST
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "... command sent to client ...";
-
-	# Wait and verify that command has been sent
-	#
-	for tt in 1 2 3 4; do
-	    five_sec_sleep
-	done
-	#
-	NR=$( ./yulectl -c LISTALL | grep ${UUID} | grep SENT | grep -v grep | wc -l )
-	if [ $NR -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "yulectl (4): ${UUID}";
-	    [ -z "$verbose" ] || ./yulectl -c LISTALL
-	    [ -z "$verbose" ] || echo "(now just LIST)"
-	    [ -z "$verbose" ] || ./yulectl -c LIST
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || OLINE=$( ./yulectl -c LISTALL | grep ${UUID} )
-	[ -z "$verbose" ] || echo "${OLINE}"
-
-	#
-	# >>> (4) Trigger a scan
-	#
-	kill -TTOU $PROC_S
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Kill -TTOU";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || echo    " ... TTOU sent to /${PROC_S}/ ...";
-	
-	for ff in 1 2; do
-	    five_sec_sleep
-	done
-	if [ x"$1" != x ]; then
-	    if [ x"$1" = xnodelta ]; then
-		NR=$( egrep "File download failed" $LOGFILE | wc -l )
-	    else
-		NR=$( egrep "No good signature" $LOGFILE | wc -l )
-	    fi
-	    if [ $NR -ne 1 ]; then
-		[ -z "$verbose" ] || log_msg_fail "Client file check (expected fail)";
-		kill $PROC_S; kill $PROC_Y;
-		return 1
-	    else
-		[ -z "$verbose" ] || log_msg_ok "Client file check (expected fail)";
-		kill $PROC_S; kill $PROC_Y;
-		return 0
-	    fi
-	fi
-
-	NR=$( egrep "File check completed" $LOGFILE | wc -l )
-	if [ $NR -ne 2 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (2)";
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-	[ -z "$verbose" ] || log_msg_ok    "sigttou";
-
-	NR=$( egrep "POLICY" $LOGFILE | wc -l )
-	if [ $NR -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "Client file check (3)";  
-	    kill $PROC_S; kill $PROC_Y;
-	    return 1
-	fi
-
-	# --- The End ---
-
-	kill $PROC_S; 
-	kill $PROC_Y
-	return 0
-}
-
-testrun2g_prepare ()
-{
-	#####################################################################
-	#
-	# Create test area and initialize database
-	#
-	rm -f ./.samhain_file
-	rm -f ./.samhain_log
-	rm -f ./.samhain_lock
-	rm -f ./rc.${SH_LOCALHOST}
-	rm -f ./rc.${ALTHOST}
-	rm -f ./file.*
-	#
-	rm -rf ${BASE}
-	#
-	mkdir ${BASE} 2>/dev/null
-	for dd in ${TEST_DIRS}; do
-	    mkdir ${BASE}/$dd
-	    for ff in ${TEST_FILES}; do
-		echo "foobar" > ${BASE}/$dd/$ff
-	    done
-	done
-	#
-	./samhain.build -t init -p none
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-}
-
-testrun2g_build ()
-{
-        [ -z "$verbose" ] || { 
-	    echo; 
-	    echo Working directory: $PW_DIR; echo MAKE is $MAKE; 
-	    echo; 
-	}
-	#
-	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-	#
-	if test -r "Makefile"; then
-		$MAKE distclean
-	fi
-	#
-	${TOP_SRCDIR}/configure ${CLIENT_BUILDOPTS} $1 $2 >/dev/null 2>&1
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	# save binary and build server
-	#
-	cp samhain samhain.build || return 1
-	if test -f scripts/samhainadmin.pl
-	then
-	    cp scripts/samhainadmin.pl  scripts/xxx_samhainadmin.pl
-	fi
-	$MAKE clean >/dev/null || return 1
-
-	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
-	# Create a password
-
-	SHPW=`./yule -G`
-	if test x"$SHPW" = x; then
-	    [ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	    return 1
-	fi
-
-	# Set in client
-
-	./samhain_setpwd samhain.build new $SHPW >/dev/null
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	    return 1
-	fi
-
-	mv samhain.build.new  samhain.new || return 1
-	if test -f scripts/xxx_samhainadmin.pl
-	then
-	    cp scripts/xxx_samhainadmin.pl  scripts/samhainadmin.pl
-	fi
-
-	rm -f ./.samhain_log*
-	rm -f ./.samhain_lock
-
-	SHCLT=`./yule -P $SHPW`
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	    return 1
-	fi
-
-	SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-	AHOST=`find_hostname`
-	SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
-	cp ${SCRIPTDIR}/testrc_2.in testrc_2
-	#
-	sed --in-place -e 's,file = /tmp,dir = 99/tmp/testrun_samhain,g' testrc_2
-	# 
-	sed --in-place -e 's,SetUdpActive=no,ReportCheckflags=yes,g' testrc_2
-	#
- 	echo $SHCLT1 >> testrc_2
- 	echo $SHCLT2 >> testrc_2
-
-	echo $SHPW > ./testpw
-}
-
-testrun2g_signrc ()
-{
-    scripts/samhainadmin.pl  -m R $1 >/dev/null
-    scripts/samhainadmin.pl  -k 8A0B337A -m E $1 >/dev/null
-}
-
-testrun2g_signdb ()
-{
-    scripts/samhainadmin.pl  -k 8A0B337A -m E ./.samhain_file >/dev/null
-}
-
-copy_rc_db_files ()
-{
-	cp    ./testrc_2       ./rc.${SH_LOCALHOST}
-	mv    ./.samhain_file  ./file.${SH_LOCALHOST}
-	if [ $? -ne 0 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "No .samhain_file";
-	    return 1
-	fi
-	chmod 644 ./rc.${SH_LOCALHOST}
-	chmod 644 ./file.${SH_LOCALHOST}
-
-	if [ "x${SH_LOCALHOST}" != "x${ALTHOST}" ]
-	then
-	    cp    ./testrc_2       "./rc.${ALTHOST}"
-	    cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-	    chmod 644 ./rc.${ALTHOST}
-	    chmod 644 ./file.${ALTHOST}
-	fi
-}
-
-MAXTEST=6; export MAXTEST
-
-testrun2g ()
-{
-    log_start "RUN CLIENT/SERVER CASE TWO";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    #
-
-
-    # Test with missing delta
-    #
-    gpg --list-keys | grep 8A0B337A >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	echo "You need to do 'gpg --import test/gnupg/public-key.asc' first"
-	log_skip 1 $MAXTEST 'Case Two w/signed files'
-    else
-	testrun2g_build "--with-gpg=/usr/bin/gpg" "--with-keyid=0x8A0B337A"
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "build..";
-	    testrun2g_signrc ./testrc_2
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign rc..";
-	    testrun2g_prepare
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "prepare..";
-	    testrun2g_signdb
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign db..";
-	    copy_rc_db_files
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy..";
-	    do_test_2_g_yule_start
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "start yule..";
-	    do_test_2_g_three nodelta
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Case Two w/missing delta";
-	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Case Two w/missing delta";
-	fi
-    fi
-
-    # Test with unsigned delta
-    #
-    gpg --list-keys | grep 8A0B337A >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	echo "You need to do 'gpg --import test/gnupg/public-key.asc' first"
-	log_skip 1 $MAXTEST 'Case Two w/signed files'
-    else
-	testrun2g_build "--with-gpg=/usr/bin/gpg" "--with-keyid=0x8A0B337A"
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "build..";
-	    testrun2g_signrc ./testrc_2
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign rc..";
-	    testrun2g_prepare
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "prepare..";
-	    testrun2g_signdb
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign db..";
-	    copy_rc_db_files
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy..";
-	    do_test_2_g_yule_start
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "start yule..";
-	    do_test_2_g_three nosig
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Case Two w/unsigned delta";
-	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Case Two w/unsigned delta";
-	fi
-    fi
-
-    # Test with signed files, no sig client
-    #
-    gpg --list-keys | grep 8A0B337A >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	echo "You need to do 'gpg --import test/gnupg/public-key.asc' first"
-	log_skip 1 $MAXTEST 'Case Two w/signed files'
-    else
-	testrun2g_build
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "build..";
-	    testrun2g_signrc ./testrc_2
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign rc..";
-	    testrun2g_prepare
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "prepare..";
-	    testrun2g_signdb
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign db..";
-	    copy_rc_db_files
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy..";
-	    do_test_2_g_yule_start
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "start yule..";
-	    do_test_2_g_three
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Case Two w/signed files+nosig client";
-	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Case Two w/signed files+nosig client";
-	fi
-    fi
-
-    # Test with signed files
-    #
-    gpg --list-keys | grep 8A0B337A >/dev/null 2>&1
-    if [ $? -ne 0 ]; then
-	echo "You need to do 'gpg --import test/gnupg/public-key.asc' first"
-	log_skip 1 $MAXTEST 'Case Two w/signed files'
-    else
-	testrun2g_build "--with-gpg=/usr/bin/gpg" "--with-keyid=0x8A0B337A"
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "build..";
-	    testrun2g_signrc ./testrc_2
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign rc..";
-	    testrun2g_prepare
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "prepare..";
-	    testrun2g_signdb
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "sign db..";
-	    copy_rc_db_files
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "copy..";
-	    do_test_2_g_yule_start
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$verbose" ] || log_msg_ok    "start yule..";
-	    do_test_2_g_three
-	fi
-	if [ $? -eq 0 ]; then
-	    [ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Case Two w/signed files";
-	else
-	    [ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Case Two w/signed files";
-	fi
-    fi
-
-    # Test with non-signed files
-    #
-    testrun2g_build
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "build..";
-	testrun2g_prepare
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "prepare..";
-	copy_rc_db_files
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "copy..";
-	do_test_2_g_yule_start
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "start yule..";
-	do_test_2_g_one
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   2 ${MAXTEST} "Case Two w/unsigned files";
-    else
-	[ -z "$quiet" ] && log_fail 2 ${MAXTEST} "Case Two w/unsigned files";
-    fi
-
-
-
-    #
-    testrun2g_prepare
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "prepare..";
-	copy_rc_db_files
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "copy..";
-	do_test_2_g_yule_start
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$verbose" ] || log_msg_ok    "start yule..";
-	do_test_2_g_two
-    fi
-    if [ $? -eq 0 ]; then
-	[ -z "$quiet" ] && log_ok   3 ${MAXTEST} "Case Two w/o delta";
-    else
-	[ -z "$quiet" ] && log_fail 3 ${MAXTEST} "Case Two w/o delta";
-    fi
-
-    if test -f scripts/xxx_samhainadmin.pl
-    then
-	rm -f scripts/xxx_samhainadmin.pl
-    fi
-
-
-    log_end "RUN CLIENT/SERVER CASE TWO"
-}
Index: trunk/test/testrun_2h.sh
===================================================================
--- trunk/test/testrun_2h.sh	(revision 591)
+++ 	(revision )
@@ -1,233 +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.
-#
-
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-RCFILE="$PW_DIR/testrc_2";  export RCFILE
-RCFILE_C="$PW_DIR/testrc_1.dyn";  export RCFILE_C
-
-SERVER_BUILDOPTS="--quiet  $TRUST  --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export SERVER_BUILDOPTS
-
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-micro-stealth=137 --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER${RCFILE_C} --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS
-
-testrun2h_internal ()
-{
-    SIGNIFY="$1"
-
-    [ -z "$verbose" ] || { 
-	echo; 
-	echo Working directory: $PW_DIR; echo MAKE is $MAKE; echo SIGNIFY is $SIGNIFY;
-	echo; 
-    }
-
-    [ -z "$verbose" ] || { echo; echo "${S}Building client and server${E}"; echo; }
-
-    if test -r "Makefile"; then
-	$MAKE distclean
-    fi
-
-    #
-    # Bootstrapping
-    #
-    ${TOP_SRCDIR}/configure >/dev/null 2>/dev/null
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure (bootstrap)..."; 
-	$MAKE  > /dev/null 2>&1
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make (bootstrap)..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make (bootstrap)..."; 
-	    return 1
-	fi
-	
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure (bootstrap)...";
-	return 1
-    fi
-
-    ${TOP_SRCDIR}/configure --with-signify=${SIGNIFY} --with-checksum=yes ${CLIENT_BUILDOPTS} >/dev/null 2>&1
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  > /dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-
-    cp ${SCRIPTDIR}/testrc_1i.dyn "$RCFILE_C"
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "copy signify signed config file...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "copy signify signed config file...";
-	return 1
-    fi
-
-    # save binary and build server
-
-    cp samhain samhain.build || return 1
-    $MAKE clean >/dev/null || return 1
-    
-    ${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-
-    if test x$? = x0; then
-	[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-	$MAKE  > /dev/null 2>>test_log
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok "make..."; 
-	else
-	    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-	    return 1
-	fi
-	
-    else
-	[ -z "$quiet" ] &&       log_msg_fail "configure...";
-	return 1
-    fi
-    
-    
-    #####################################################################
-    #
-    #
-    rm -f ./.samhain_file
-    rm -f ./.samhain_log
-    rm -f ./.samhain_lock
-    rm -f ./rc.${SH_LOCALHOST}
-    rm -f ./file.${SH_LOCALHOST}
-    
-    cp ${SCRIPTDIR}/testrc_2.in testrc_2
-    
-    ./samhain.build -t init -p none
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "init...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "init...";
-	return 1
-    fi
-    
-    cp ${SCRIPTDIR}/test1i_file.sig $PW_DIR/.samhain_file
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "copy signed database file...";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "copy signed database file...";
-	return 1
-    fi
-
-    # Create a password
-
-    SHPW=`./yule -G`
-    if test x"$SHPW" = x; then
-	[ -z "$quiet" ]   && log_msg_fail  "password not generated -- aborting"
-	return 1
-    fi
-    
-    # Set in client
-    
-    ./samhain_setpwd samhain.build new $SHPW >/dev/null
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "./samhain_setpwd samhain.build new $SHPW";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "./samhain_setpwd samhain.build new $SHPW";
-	return 1
-    fi
-    
-    mv samhain.build.new  samhain.new || return 1
-    
-    rm -f ./.samhain_log*
-    rm -f ./.samhain_lock
-    
-    SHCLT=`./yule -P $SHPW`
-    
-    if test x$? = x0; then
-	[ -z "$verbose" ] || log_msg_ok    "yule -P $SHPW";
-    else
-	[ -z "$quiet" ]   && log_msg_fail  "yule -P $SHPW";
-	return 1
-    fi
-    
-    SHCLT1=`echo "${SHCLT}"  | sed s%HOSTNAME%${SH_LOCALHOST}%`
-    AHOST=`find_hostname`
-    SHCLT2=`echo "${SHCLT}"  | sed s%HOSTNAME%${AHOST}%`
-	
-
-    echo $SHCLT1 >> testrc_2
-    echo $SHCLT2 >> testrc_2
-
-    
-    cp    "${RCFILE_C}"              ./rc.${SH_LOCALHOST}
-    mv    $PW_DIR/.samhain_file      ./file.${SH_LOCALHOST}
-
-    ALTHOST=`find_hostname`
-    cp    "${RCFILE_C}"          "./rc.${ALTHOST}"
-    cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-}
-
-MAXTEST=1; export MAXTEST
-
-testrun2h ()
-{
-    log_start "RUN FULL CLIENT/SERVER W/SIGNIFY";
-    #
-    if [ x"$1" = x ]; then
-	[ -z "$quiet" ] && log_msg_fail "Missing hostname"
-    fi
-    #
-    SIGNIFY=`find_path signify-openbsd`
-    if [ -z "$SIGNIFY" ]; then
-	SIGNIFY=`find_path signify`
-    fi
-    if [ -z "$SIGNIFY" ]; then
-	log_skip 1 $MAXTEST 'signify not found in $PATH'
-    fi
-	    
-    SH_LOCALHOST=$1; export SH_LOCALHOST
-    
-    testrun2h_internal "${SIGNIFY}"
-
-    SAVE_VALGRIND="${VALGRIND}"; VALGRIND=''; export VALGRIND
-    do_test_1_a
-    out=$?
-    VALGRIND="${SAVE_VALGRIND}"; export VALGRIND 
-
-    if [ $out -eq 0 ]; then
-    	[ -z "$quiet" ] && log_ok   1 ${MAXTEST} "Client download+logging w/signify";
-    else
-    	[ -z "$quiet" ] && log_fail 1 ${MAXTEST} "Client download+logging w/signify";
-    fi
-    
-    if [ -n "$cleanup" ]; then
-    	rm -f ./rc.${SH_LOCALHOST}
-    	rm -f ./file.${SH_LOCALHOST}
-    	ALTHOST=`find_hostname`
-    	rm -f "./file.${ALTHOST}"
-    	rm -f "./rc.${ALTHOST}"
-    fi
-
-    log_end "RUN FULL CLIENT/SERVER W/SIGNIFY"
-}
-
Index: trunk/test/testtimesrv.sh
===================================================================
--- trunk/test/testtimesrv.sh	(revision 591)
+++ trunk/test/testtimesrv.sh	(revision 1)
@@ -1,424 +1,103 @@
 #! /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.
-#
 
-RCFILE="$PW_DIR/testrc_1.dyn";  export RCFILE
-LOGFILE="$PW_DIR/.samhain_log"; export LOGFILE
-PIDFILE="$PW_DIR/.samhain_lock"; export PIDFILE
+# The following two are the ANSI sequences for start and end embolden
+case $TERM in
+vt*|ansi*|con*|xterm*|linux*|screen*)
+  S=[1m
+  E=[m
+  ;;
+*)
+  S=
+  E=
+  ;;
+esac
 
-BASE="${PW_DIR}/testrun_testdata"; export BASE
-TDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; export TDIRS
-TFILES="x y z"; export TFILES
+PW_DIR=`pwd`
 
-prep_testdata ()
-{
-    if test -d "$BASE"; then
-	chmod -f -R 0700 "${BASE}" || {
-	    [ -z "$quiet" ] &&   log_msg_fail "chmod -f -R 0700 ${BASE}"; 
-	    return 1;
-	}
+if test x$UID != x; then
+  TRUST="--with-trusted=0,2,$UID"
+else
+  TRUST="--with-trusted=0,2"
+fi
+
+echo; echo "${S}__ STARTING TEST TIMESERVER OPTION __${E}"; echo;
+echo Working directory: $PW_DIR
+
+MAKE=`which gmake`
+if test "x$?" = x1 ; then
+    MAKE="make -s"
+else
+    MAKE=`which gmake | sed -e "s%\([a-z:]\) .*%\1%g"` 
+    if test "x$MAKE" = x; then
+	MAKE="make -s"
+    elif test "x$MAKE" = xno; then
+	MAKE="make -s"
+    else
+	if test "x$MAKE" = "xwhich:"; then
+		MAKE="make -s"
+	else
+		MAKE="gmake -s"
+		gmake -v >/dev/null 2>&1 || MAKE="make -s"
+	fi
     fi
+fi
 
-    rm -rf "${BASE}" || {
-	[ -z "$quiet" ] &&   log_msg_fail "rm -rf ${BASE}"; 
-	return 1;
-    }
-
-    mkdir "${BASE}" || {
-	[ -z "$quiet" ] &&   log_msg_fail "mkdir ${BASE}"; 
-	return 1;
-    }
-
-    for ff in $TDIRS; do
-	mkdir "${BASE}/${ff}" || { 
-	    [ -z "$quiet" ] &&   log_msg_fail "mkdir ${BASE}/${ff}"; 
-	    return 1;
-	}
-	chmod 0755 "${BASE}/${ff}"
-	for gg in $TFILES; do
-	    echo "This is a test file" > "${BASE}/${ff}/${gg}"
-	    chmod 0644 "${BASE}/${ff}/${gg}"
-	done
-    done
-}
-
-mkconfig_misc ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[Misc]
-Daemon=no
-SetFilecheckTime=60
-TrustedUser=uucp,fax,fnet
-SetRecursionLevel=10
-SetLoopTime=30
-ReportFullDetail = no
-ChecksumTest=check
-
-End-of-data
-}
-
-mkconfig_log ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[Log]
-MailSeverity=none
-LogSeverity=warn
-SyslogSeverity=none
-PrintSeverity=info
-MailSeverity=none
-#Restrict to certain classes of messages
-#LogClass=RUN
-#PreludeSeverity=err
-#ExportSeverity=none
-
-End-of-data
-}
-
-mkconfig_sev ()
-{
-    test -f "${RCFILE}" || touch "${RCFILE}"
-    cat >> "${RCFILE}" <<End-of-data
-[EventSeverity]
-SeverityUser0=crit
-SeverityUser1=crit
-SeverityReadOnly=crit
-SeverityLogFiles=crit
-SeverityGrowingLogs=crit
-SeverityIgnoreNone=crit
-SeverityAttributes=crit
-SeverityIgnoreAll=crit
-SeverityFiles=err
-SeverityDirs=err
-SeverityNames=warn
-
-End-of-data
-}
-
-prep_init ()
-{
-    rm -f ./.samhain_file
-    rm -f "${LOGFILE}"
-    rm -f ./.samhain_lock
-
-    rm -f "${RCFILE}"
-    mkconfig_sev
-    mkconfig_log
-    mkconfig_misc
-}
-
-TESTPOLICY="
-[ReadOnly]
-dir=${BASE}/c
-[Attributes]
-dir=${BASE}/a
-#dir=${BASE}/b
-"
+echo MAKE is $MAKE
+echo
 
 
-testtime0_int ()
+testtime0 ()
 {
-	[ -z "$verbose" ] || echo Working directory: $PW_DIR
-	[ -z "$verbose" ] || { echo MAKE is $MAKE; echo; }
 	#
 	# standalone compilation
 	#
-	[ -z "$verbose" ] || { echo; echo "${S}Building standalone agent${E}"; echo; }
+	echo "${S}Building standalone agent w/timeserver${E}"; echo;
 	#
 	if test -r "Makefile"; then
-		$MAKE distclean >/dev/null
+		$MAKE distclean
 	fi
 	#
-	${TOP_SRCDIR}/configure --quiet --enable-debug --enable-xml-log --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PIDFILE --with-data-file=$PW_DIR/.samhain_file
+	${TOP_SRCDIR}/configure --quiet --enable-debug --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$PW_DIR/test/testrc_1  --with-timeserver=www.foo.bar --with-alttimeserver=127.0.0.1 --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file
 	#
 	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
+		echo "configure completed, exit status 0"; echo;
+		$MAKE  > /dev/null
+		echo "$MAKE completed, exit status $?"; echo;
+	else
+		echo "ERROR: configure failed"; echo;
+	fi
+
+
+	rm -f $PW_DIR/.samhain_file $PW_DIR/.samhain_log $PW_DIR/.samhain_lock
+
+	./samhain -t init
+	
+	if test x$? = x0; then
+		echo
+		echo "${S}init completed${E}"
+		echo
+		./samhain -t check
 		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		    echo "${S}check completed${E}"
 		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
+		    echo "${S}ERROR:${E} -- check -- failed, exit status $?"
+		    echo
+		    exit
 		fi
 	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
+		echo "${S}ERROR:${E} -- init -- failed, exit status $?"; echo;
+		exit
 	fi
 
-	prep_init && prep_testdata && echo "$TESTPOLICY" >>$RCFILE
-	if [ $? -ne 0 ]; then
-	    [ -z "$quiet" ]   && log_msg_fail  "prepare...";
-	    return 1
-	fi
-
-	./samhain -t init -p none
-	
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "init...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "init...";
-	    return 1
-	fi
-
-	chmod 0555 "${BASE}/a/x"
-	chmod 0555 "${BASE}/b/x"
-
-	./samhain -t check -p none -l info -D
-
-	count=0
-	until [ -f $PIDFILE ]; do
-	    one_sec_sleep
-	    let "count = count + 1" >/dev/null
-	    if [ $count -gt 12 ]; then
-		break;
-	    fi
-	done
-
-	if test x$? = x0; then
-	    [ -z "$verbose" ] || log_msg_ok    "start daemon...";
-	else
-	    [ -z "$quiet" ]   && log_msg_fail  "start daemon...";
-	    return 1
-	fi
-
-	return 0
-}
-
-MAXTEST=14; export MAXTEST
-
-die () {
-    test -z "$stoponerr" && return 0;
-    PID=`cat $PIDFILE`
-    kill -9 $PID
-}
-
-killdaemon () {
-    if [ -f $PIDFILE ]; then
-	PID=`cat $PIDFILE`
-	kill -9 $PID
-    fi
-}
-
-check_err () {
-    if [ ${2} -ne 0 ]; then
-	die;
-	[ -z "$quiet" ] && log_fail ${1} ${MAXTEST} "${3}";
-	return 1
-    else
-	[ -z "$quiet" ] && log_ok   ${1} ${MAXTEST} "${3}";
-    fi
-}
-
-daemontest_started () {
-    PID=`cat $PIDFILE`
-
-    kill -0 $PID
-    check_err ${1} $? "started"
-}
-
-daemontest_sigterm () {
-    PID=`cat $PIDFILE`
-
-    kill -15 $PID
-    count=0
-    while [ `kill -0 $PID` ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sigterm"
-	    return 1
-	fi
-    done
-    check_err ${1} 0 "sigterm"
-}
-
-daemontest_sigusr2 () {
-    PID=`cat $PIDFILE`
-
-    tmp=`grep 'File check completed' $LOGFILE | wc -l`
-    kill -USR2 $PID
-    kill -TTOU $PID
-    
-    count=0
-    tmp2=`grep 'SUSPEND' $LOGFILE | wc -l`
-    while [ $tmp2 -ne $2 ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sigusr2: suspend"
-	    return 1
-	fi
-	tmp2=`grep 'SUSPEND' $LOGFILE | wc -l`
-    done
-
-    kill -USR2 $PID
-
-    count=0
-    tmp2=$tmp
-    while [ $tmp2 -eq $tmp ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sigusr2: wakeup"
-	    return 1
-	fi
-	tmp2=`grep 'File check completed' $LOGFILE | wc -l`
-    done
-    check_err ${1} 0 "sigusr2"
-}
-
-daemontest_sigttou () {
-    PID=`cat $PIDFILE`
-
-    tmp=`grep 'File check completed' $LOGFILE | wc -l`
-    kill -TTOU $PID
-    count=0
-    tmp2=$tmp
-    while [ $tmp2 -eq $tmp ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sigttou"
-	    return 1
-	fi
-	tmp2=`grep 'File check completed' $LOGFILE | wc -l`
-    done
-    check_err ${1} 0 "sigttou"
-}
-
-daemontest_sighup () {
-
-    if [ $2 -eq 1 ]; then
-	echo "dir=${BASE}/b" >>$RCFILE
-	tmp=`grep CRIT $LOGFILE | grep -v Runtime | wc -l`
-	if [ $tmp -ne 1 ]; then
-	    [ -z "$verbose" ] || log_msg_fail "policy count (before)";
-	    return 1
-	fi
-    fi
-    
-    PID=`cat $PIDFILE`
-    kill -HUP $PID
-
-    if [ $2 -eq 1 ]; then
-	kill -TTOU $PID
-	count=0
-	tmp=`grep CRIT $LOGFILE | grep -v Runtime | wc -l`
-	while [ $tmp -lt 2 ]; do
-	    one_sec_sleep
-	    let "count = count + 1" >/dev/null
-	    if [ $count -gt 12 ]; then
-		[ -z "$verbose" ] || log_msg_fail "policy count (after)";
-		return 1
-	    fi
-	    tmp=`grep CRIT $LOGFILE | grep -v Runtime | wc -l`
-	done
-    fi    
-
-    count=0
-    tmp2=0
-    while [ $tmp2 -ne $2 ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sighup"
-	    return 1
-	fi
-	tmp2=`grep 'Runtime configuration reloaded' $LOGFILE | wc -l`
-    done
-    check_err ${1} 0 "sighup"
-}
-
-daemontest_sigabrt () {
-    PID=`cat $PIDFILE`
-    kill -${3} $PID
-
-    count=0
-    while [ -f $LOGFILE.lock ]; do
-	one_sec_sleep
-	let "count = count + 1" >/dev/null
-	if [ $count -gt 12 ]; then
-	    check_err ${1} 1 "sigabrt"
-	    return 1
-	fi
-    done
-
-    kill -TTOU $PID
-
-    five_sec_sleep
-
-    if [ -f $LOGFILE.lock ]; then
-	tmp=`grep '<trail>' $LOGFILE | wc -l`
-	tst=$2; let "tst = tst + 2" >/dev/null;
-	if [ $tmp -eq $tst ]; then
-	    check_err ${1} 0 "sigabrt"
-	    return 0
-	fi
-    fi
-    check_err ${1} 1 "sigabrt"
-}
-
-testtime0 () {
-    log_start "DAEMON CONTROL"
-
-    testtime0_int;
-
-    tcount=1
-
-    trap 'killdaemon' 1 3 15
-
-    daemontest_started $tcount;
-
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigttou $tcount;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigttou $tcount;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigttou $tcount;
-
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigusr2 $tcount 1;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigusr2 $tcount 2;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigusr2 $tcount 3;
-
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigabrt $tcount 1 ABRT;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigabrt $tcount 2 TTIN;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigabrt $tcount 3 ABRT;
-
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sighup  $tcount 1;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sighup  $tcount 2;
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sighup  $tcount 3;
-
-    let "tcount = tcount + 1" >/dev/null
-    daemontest_sigterm $tcount;
-
-    log_end "DAEMON CONTROL"
 }
 
 
+
+	testtime0
+
+
+echo; echo "${S}__ END TEST TIMESERVER OPTION __${E}"; echo;
+
+exit
+
Index: trunk/yulerc.template
===================================================================
--- trunk/yulerc.template	(revision 591)
+++ trunk/yulerc.template	(revision 1)
@@ -47,12 +47,13 @@
 ##
 # MailSeverity=none
+MailSeverity=crit
 
 ## Console
 ##
-PrintSeverity=none
+# PrintSeverity=info
 
 ## Logfile
 ##
-LogSeverity = warn
+# LogSeverity=none
 
 ## Syslog
@@ -96,9 +97,9 @@
 ## Log the server timestamp for received messages
 #
-# SetDBServerTstamp = True
+SetDBServerTstamp = True
 
 ## Use a persistent connection
 #
-# UsePersistent = True
+UsePersistent = True
 
 
@@ -164,4 +165,13 @@
 #####################################################
 
+[Misc]
+
+## whether to become a daemon process
+## (this is not honoured on database initialisation)
+#
+# Daemon = no
+Daemon = yes
+
+
 
 [Misc]
@@ -173,12 +183,4 @@
 # SetLoopTime = 60
 SetLoopTime = 600
-
-## Normally, client messages are regarded as data within a
-## server message of fixed severity. The following two
-## options cause the server to use the original severity/class
-## of client messages for logging.
-#
-# UseClientSeverity = False
-# UseClientClass    = False
 
 ## The maximum time between client messages (seconds)
